@viewlift/player-backup 2.0.375-backup → 2.0.377-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-8316b7c4.js → autoNextVideo-970d7952.js} +1 -1
- package/cjs/bundle.css +1194 -1039
- package/cjs/{features-541cfdcb.js → features-911c3816.js} +1 -1
- package/cjs/generic-118f7ebd.js +1 -0
- package/cjs/{index-6822b5b5.js → index-50f15aa6.js} +1 -1
- package/cjs/{index-91441ebe.js → index-6133b444.js} +1 -1
- package/cjs/index-774736bd.js +1 -0
- package/cjs/{index-7017ec38.js → index-aa64a6c0.js} +1 -1
- package/cjs/{index-03fa3832.js → index-c52abe27.js} +1 -1
- package/cjs/{index-03d65bd4.js → index-de9db53d.js} +1 -1
- package/cjs/index-f3365b73.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/multicamv2-e88d0dc2.js +1 -0
- package/cjs/multicamv2-f17375d7.js +1 -0
- package/cjs/nextEpisodeButton-551faeb3.js +1 -0
- package/cjs/playerControlEvents-db923a5c.js +1 -0
- package/cjs/playlist-f0a6659a.js +1 -0
- package/cjs/series-47045f7e.js +1 -0
- package/cjs/series-v2-5ce609b4.js +1 -0
- package/cjs/series-v2-cf79269e.js +1 -0
- package/cjs/skin-237f8d4f.js +1 -0
- package/cjs/skin-3a43f138.js +1 -0
- package/cjs/skin-425c1322.js +1 -0
- package/cjs/skin-a9a5a925.js +1 -0
- package/cjs/skin-b11e1757.js +1 -0
- package/cjs/skin-c49d50b6.js +1 -0
- package/cjs/skin-dbff0922.js +1 -0
- package/cjs/skin-dc3525c7.js +1 -0
- package/cjs/skin-ebab1e3f.js +1 -0
- package/cjs/skin-f7c4ead4.js +1 -0
- package/cjs/videoSelector-607de014.js +1 -0
- package/cjs/videoSelector-f4eb61cd.js +1 -0
- package/esm/{autoNextVideo-d90e89be.js → autoNextVideo-c9d22cb4.js} +1 -1
- package/esm/{browser-de5f6a74.js → browser-02f174cf.js} +1 -1
- package/esm/bundle.css +1194 -1039
- package/esm/{features-5a73d4fc.js → features-8b0d92d7.js} +1 -1
- package/esm/generic-6871d7d1.js +1 -0
- package/esm/{index-73e46c45.js → index-18292507.js} +1 -1
- package/esm/index-28ebfa21.js +1 -0
- package/esm/{index-f648e9c2.js → index-3addf20e.js} +1 -1
- package/esm/{index-7a550e72.js → index-9f2bf24a.js} +1 -1
- package/esm/index-cbb86a6c.js +1 -0
- package/esm/{index-d120a4cc.js → index-cef05213.js} +1 -1
- package/esm/{index-f9920e5f.js → index-e9e43270.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/multicamv2-1bd7f8c5.js +1 -0
- package/esm/multicamv2-1e925995.js +1 -0
- package/esm/nextEpisodeButton-f1a025e4.js +1 -0
- package/esm/playerControlEvents-26580023.js +1 -0
- package/esm/playlist-2012e5ef.js +1 -0
- package/esm/{resolution-2e9ad83f.js → resolution-847a299c.js} +1 -1
- package/esm/series-8f854466.js +1 -0
- package/esm/series-v2-4ada8ab6.js +1 -0
- package/esm/series-v2-f28041a6.js +1 -0
- package/esm/{settings-icon-3d9ec523.js → settings-icon-c188c46d.js} +1 -1
- package/esm/skin-30a7f835.js +1 -0
- package/esm/skin-30a90635.js +1 -0
- package/esm/skin-66b334cd.js +1 -0
- package/esm/skin-74348872.js +1 -0
- package/esm/skin-7bdb21cf.js +1 -0
- package/esm/skin-85e8dcbb.js +1 -0
- package/esm/skin-be4ea9e2.js +1 -0
- package/esm/skin-c16b40b9.js +1 -0
- package/esm/skin-d6417c01.js +1 -0
- package/esm/skin-f0b7e11c.js +1 -0
- package/esm/src/components/chapters/timelineMapper.d.ts +1 -0
- package/esm/src/features/dvrStartOver/helpers.d.ts +41 -0
- package/esm/src/features/dvrStartOver/helpers.test.d.ts +1 -0
- package/esm/src/features/dvrStartOver/index.d.ts +47 -0
- package/esm/src/features/dvrStartOver/index.test.d.ts +1 -0
- package/esm/src/helpers/playerControlEvents.d.ts +1 -0
- package/esm/src/helpers/playerControlEvents.test.d.ts +1 -0
- package/esm/src/helpers/token.d.ts +1 -0
- package/esm/src/index.d.ts +2 -0
- package/esm/src/utilities/beacon.d.ts +33 -4
- package/esm/src/utilities/beacon.test.d.ts +1 -0
- package/esm/src/utilities/beaconHelpers.d.ts +62 -0
- package/esm/videoSelector-435aa016.js +1 -0
- package/esm/videoSelector-48a4e382.js +1 -0
- package/package.json +1 -1
- package/cjs/_commonjsHelpers-81c4d214.js +0 -1
- package/cjs/generic-ddb9f830.js +0 -1
- package/cjs/index-62250ea0.js +0 -1
- package/cjs/index-9ff76281.js +0 -1
- package/cjs/multicamv2-e214d56d.js +0 -1
- package/cjs/multicamv2-f859af0e.js +0 -1
- package/cjs/nextEpisodeButton-d818eff8.js +0 -1
- package/cjs/playerControlEvents-0512f252.js +0 -1
- package/cjs/playlist-67d74a2b.js +0 -1
- package/cjs/series-2fbef62b.js +0 -1
- package/cjs/series-v2-0f61d2e5.js +0 -1
- package/cjs/series-v2-663e3ea7.js +0 -1
- package/cjs/skin-1b6bad92.js +0 -1
- package/cjs/skin-2db97eac.js +0 -1
- package/cjs/skin-4701bbb1.js +0 -1
- package/cjs/skin-730b9c41.js +0 -1
- package/cjs/skin-7a90fce9.js +0 -1
- package/cjs/skin-c7284d41.js +0 -1
- package/cjs/skin-ca2b0407.js +0 -1
- package/cjs/skin-d007d625.js +0 -1
- package/cjs/skin-ecb40ff3.js +0 -1
- package/cjs/skin-ef4a5769.js +0 -1
- package/cjs/videoSelector-5b39b88d.js +0 -1
- package/cjs/videoSelector-dec6e057.js +0 -1
- package/esm/_commonjsHelpers-0307ea52.js +0 -1
- package/esm/generic-061851d1.js +0 -1
- package/esm/index-23afe568.js +0 -1
- package/esm/index-c4656b30.js +0 -1
- package/esm/multicamv2-5b81efa1.js +0 -1
- package/esm/multicamv2-baf41d9b.js +0 -1
- package/esm/nextEpisodeButton-f9a2d975.js +0 -1
- package/esm/playerControlEvents-96ef1a5d.js +0 -1
- package/esm/playlist-a47b041e.js +0 -1
- package/esm/series-1cc84308.js +0 -1
- package/esm/series-v2-0698df9c.js +0 -1
- package/esm/series-v2-f913e362.js +0 -1
- package/esm/skin-00d58c5d.js +0 -1
- package/esm/skin-426412d0.js +0 -1
- package/esm/skin-60971e8f.js +0 -1
- package/esm/skin-84df67c6.js +0 -1
- package/esm/skin-97dde5c6.js +0 -1
- package/esm/skin-c1bd2da5.js +0 -1
- package/esm/skin-c3aee0cd.js +0 -1
- package/esm/skin-d5dea9b2.js +0 -1
- package/esm/skin-e0a3db9a.js +0 -1
- package/esm/skin-ff84766b.js +0 -1
- package/esm/videoSelector-3149d4ee.js +0 -1
- package/esm/videoSelector-3fa509f9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{W as a,T as s}from"./generic-6871d7d1.js";import{g as c}from"./renditions-28891b91.js";import{g as d,p as u}from"./skin-2a3ee818.js";import{g as p}from"./localisation-0bf399a1.js";import{t as m,a as h}from"./playerControlEvents-26580023.js";function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?f(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(e){var t=C();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C=function(){return!!e})()}var y=function(e){var o=function(e){r(i,e);var o=g(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=p("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},B=function(e,o,l){var s=function(o){r(s,o);var i=g(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button"),o.setAttribute("aria-label","Backward 10 seconds");var a=u(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){m(this.player_,h.REPLAY),a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},b=function(e,o,l){var a=function(o){r(a,o);var i=g(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button"),o.setAttribute("aria-label","Forward 10 seconds");var s=u(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},j=function(e,t,n){import("./resolution-847a299c.js").then((function(e){return e.c})).then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))}))},k=function(e,t,n){import("./nextEpisodeButton-f1a025e4.js").then((function(r){var o=r.default,l=d(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},w=function(e,t,n){import("./series-8f854466.js").then((function(r){var o=r.seriesModule,l=d(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},c=0;c<a.length;c++)s(c)}))},E=function(e,t){import("./videoSelector-48a4e382.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-404c4774.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},O=function(e,t){import("./settings-icon-c188c46d.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},I=function(e,t){import("./playlist-2012e5ef.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},M=function(e,t){import("./series-v2-f28041a6.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",v({playerId:e},t),o.controlBar.children().length-3)}))},V=function(e,t){import("./multicamv2-1bd7f8c5.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},P=function(e,t){var n=d(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},x=function(e){var t=d(e).el(),n=0,r=d(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o},L=function(e,t){import("./videoSelector-435aa016.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},_=function(e,t){import("./series-v2-4ada8ab6.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",v({playerId:e},t),o.controlBar.children().length-3)}))},D=function(e,t){import("./multicamv2-1e925995.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},N=function(e,t){import("./index-8b7ad7a7.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("MuteButton",r),o.addChild("MuteButton",v({playerId:e},t))}))},R=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0===(null==n||null===(t=n.ui)||void 0===t?void 0:t.showVerticalViewButton)&&import("./index-18292507.js").then((function(t){var r=t.default,o=d(e);o&&(i.registerComponent("VerticalViewButton",r),o.getChild("VerticalViewButton")||o.addChild("VerticalViewButton",v({playerId:e},n)))}))};export{j as a,w as b,k as c,b as d,B as e,R as f,O as g,S as h,P as i,y as j,L as k,D as l,I as m,_ as n,x as o,E as p,M as q,V as r,N as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import r from"video.js";import i from"axios";import{p as o}from"./manager-d812dea7.js";import{g as a,t as l,c as s}from"./skin-2a3ee818.js";import{i as u,d,a as c}from"./browser-02f174cf.js";import v from"md5";import f from"js-cookie";import{b as p,a as m}from"./captions-8c8e9f2b.js";import h from"@babel/runtime/helpers/typeof";import{P as g,a as y,t as I,m as b}from"./playerControlEvents-26580023.js";import T from"@babel/runtime/helpers/toConsumableArray";import E from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as _,formulateComscorePayload as w,createComscoreStreamingTag as S,setComscorePlayerInstance as k}from"@viewlift/comscore/index.js";import A from"@babel/runtime/helpers/classCallCheck";import O from"@babel/runtime/helpers/createClass";import L from"@babel/runtime/helpers/objectWithoutProperties";var P={name:"@viewlift/player",version:"2.1.73",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant","test:chromecast":"mocha -- 'remote/chromecast/tests/**/*.test.js'","test:airplay":"mocha -- 'remote/airplay/tests/**/*.test.js'"},dependencies:{"@viewlift/sse":"^0.0.3","broadcast-channel":"^7.3.0","@viewlift/comscore":"^1.0.19",axios:"^1.18.1",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3","webcomponents.js":"git+https://git@github.com/webcomponents/webcomponentsjs.git#v0.7.24"},devDependencies:{"expect.js":"^0.3.1",mocha:"^10.8.2",sinon:"^2.4.1"},overrides:{"min-document":"^2.19.1"}},D={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"},C=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},N=null;function R(){return{set:function(e){e&&(N=e)},get:function(){return N}}}var j=function(){var e=n(t.mark((function e(){var n,r,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=R().get(),r=Ae.get(),n){e.next=4;break}throw new Error("Missing refresh token");case 4:return e.prev=4,e.next=7,i({method:"GET",url:"".concat(r,"/identity/refresh/").concat(n),headers:ye("refreshToken"),params:Ie("refreshToken")});case 7:return o=e.sent,e.abrupt("return",o);case 11:throw e.prev=11,e.t0=e.catch(4),e.t0;case 14:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(){return e.apply(this,arguments)}}(),F=null,V=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!C(n)){e.next=6;break}return F||(F=j().then((function(e){var t,r,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,o=null==e||null===(r=e.data)||void 0===r?void 0:r.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),o&&R().set(o),i||n})).catch((function(e){return n})).finally((function(){F=null}))),e.abrupt("return",F);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,r=null==e?void 0:e.asat;return t&&!r&&(n=!1),n},U=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},W=function(){return"undefined"!=typeof window&&window.sessionStorage?window.sessionStorage.getItem("uid"):null},B=function(e){return!!e&&"drm"===function(e){var n;if(5===Number(null==e?void 0:e.code))return"drm";var t="".concat(null!==(n=null==e?void 0:e.code)&&void 0!==n?n:""," ").concat(function(e){var n,t,r,i,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(e)).toLowerCase();return/(drm|license|widevine|playready|fairplay|eme|key|hdcp)/.test(t)?"drm":/(network|manifest|segment|playlist|http|xhr|fetch|timeout)/.test(t)?"network":/(decode|mediaerror|mediasource|appendbuffer|sourcebuffer)/.test(t)?"decode":"player"}(e)},G=function(e,n){var t=String(n||"").toLowerCase();if(t.includes("license"))return"license";if(t.includes("certificate"))return"server_certificate";if(t.includes("manifest"))return"manifest";if(t.includes("key"))return"key";if(t.includes("segment")||t.includes("media"))return"segment";var r=String(e||"").split("?")[0].toLowerCase();return r.endsWith(".mpd")||r.endsWith(".m3u8")||r.endsWith(".ism/manifest")?"manifest":/\.(m4s|mp4|m4a|m4v|ts|aac|webm|cmf[av]|mp4a)$/.test(r)?"segment":/license|widevine|playready|fairplay|drm/.test(r)?"license":/cert|certificate/.test(r)?"server_certificate":/\.key($|\?)/.test(r)||/\/key\//.test(r)?"key":"other"},H=new Set(["license","key","server_certificate"]),Y=function(e){return H.has(e)},q=function(e,n){for(var t=0,r=[null==e?void 0:e.statusCode,null==e?void 0:e.status,null==e?void 0:e.code,null==n?void 0:n.statusCode,null==n?void 0:n.status,null==n?void 0:n.code];t<r.length;t++){var i=Number(r[t]);if(Number.isFinite(i)&&i>0)return i}return null},z=function(e){return null==e||e>=200&&e<400};function K(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 Q="asset_not_found",$="geo_blocking_issue",X="entitlement_mismatch",J="DRM/License Failures",Z=new Set(["contentgeorestricted","contentgeorestrictedbyhba","content_not_available_for_country"]),ee=[/geo[\s_-]?block/i,/geo[\s_-]?restrict/i,/geographic/i,/not available in your/i,/outside.*(?:region|country|territory)/i,/\bcountry\b/i,/\bterritory\b/i],ne=[/entitlement/i,/not entitled/i,/subscription/i,/not subscribed/i,/access denied/i,/\bunauthorized\b/i,/\bforbidden\b/i,/\bpremium\b/i,/upgrade required/i,/tv[\s_-]?provider/i,/\bprovider\b/i],te=[/not found/i,/no content/i,/does not exist/i,/\bmissing\b/i,/not available currently/i,/not available/i],re=function(e,n,t,r){var i=Number(e),o=String(n||"");return B(r)?J:Z.has(function(e){return String(e||"").toLowerCase().replace(/[\s-]/g,"_")}(t))||ee.some((function(e){return e.test(o)}))?$:ne.some((function(e){return e.test(o)}))?X:te.some((function(e){return e.test(o)}))||404===i?Q:451===i?$:X},ie=function(n,t,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};console.log("emitApiErrorEvent",{apiName:n,error:t,errorCategory:r,meta:a});var l,s,u,d,c,v=(null==(c=o.getConfig()||{})?void 0:c.apiErrorCb)||(null==c?void 0:c.onApiError)||(null==c||null===(l=c.customData)||void 0===l?void 0:l.apiErrorCb)||(null==c||null===(s=c.customData)||void 0===s?void 0:s.onApiError)||(null==c||null===(u=c.customData)||void 0===u||null===(d=u.callbacks)||void 0===d?void 0:d.onApiError)||null;if("function"==typeof v){console.log("emitApiErrorEvent",t);var f=(null==t||null===(i=t.response)||void 0===i?void 0:i.status)||(null==t?void 0:t.status)||0,p=function(e){var n,t,r,i,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(t),m=function(e){var n,t,r,i,o,a;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorCode)||(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.error_code)||(null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.code)||(null==e?void 0:e.errorCode)||null}(t),h=re(f,p,m,t),g=function(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({errorcode:f||m,errormessage:p,errorcategory:r||h},a);n&&(g.apiPath=n);try{v(h,g)}catch(e){console.warn("[VLPlayer] apiError callback failed:",e)}}};function oe(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 ae(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var le=P;window.vl_player_version=le.version;var se,ue,de,ce,ve,fe,pe,me,he=["videoDetails","linearChannel","series","entitlementData"],ge=function(e,n){var t,r,i;return null!==(t=null==e||null===(r=e.endpoints)||void 0===r||null===(i=r[n])||void 0===i?void 0:i.useGlobal)&&void 0!==t?t:he.includes(n)},ye=function(e){var n,t,r,i=null===(n=o.getConfig())||void 0===n?void 0:n.api;return ae(ae({},ge(i,e)&&(null==i?void 0:i.headers)),null==i||null===(t=i.endpoints)||void 0===t||null===(r=t[e])||void 0===r?void 0:r.headers)},Ie=function(e){var n,t,r,i=null===(n=o.getConfig())||void 0===n?void 0:n.api;return ae(ae({},ge(i,e)&&(null==i?void 0:i.params)),null==i||null===(t=i.endpoints)||void 0===t||null===(r=t[e])||void 0===r?void 0:r.params)},be=function(){var e,n,t,r;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.overrideEntitlementBaseUrl)+"/video/status":Ae.get()+"".concat(null==D?void 0:D.getVideoDetails)},Te=function(e,n){var t,r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.overrideEntitlementResponse)return new Promise((function(e,n){var t,r;return e({data:null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.overrideEntitlementResponse})}));var a,l,s,u,d=be();return i({url:be(),params:ae(ae({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:o},null===(a=window)||void 0===a||null===(l=a.customData)||void 0===l?void 0:l.entitlement),Ie("videoDetails")),method:"GET",headers:ae({Authorization:n,"Sdk-Version":le.version,"x-player-name":"videojs",adbTempToken:null===(s=window)||void 0===s||null===(u=s.customData)||void 0===u?void 0:u.adbTempToken},ye("videoDetails")),withCredentials:!0}).catch((function(n){throw ie(d,n,"content",{videoId:e}),n}))},Ee=function(e,n){var t,r,o,a,l,s,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.overrideEntitlementResponse)return new Promise((function(e,n){var t,r;return e({data:null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.overrideEntitlementResponse})}));var d=Ae.get()+D.getLinearChannelDetails;return i({url:d,params:ae(ae(ae(ae(ae(ae({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),Ie("linearChannel")),method:"GET",headers:ae({Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken},ye("linearChannel"))}).catch((function(n){throw ie(d,n,"content",{videoId:null==e?void 0:e.id,channelId:null==e?void 0:e.channelId,programId:null==e?void 0:e.programId}),n}))},_e=function(e,n){var t,r,o=U(n),a=(null==o?void 0:o.site)||null;if(null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.seriesData)return new Promise((function(e,n){var t,r;return e({data:null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.seriesData})}));var l=Ae.get()+"/v3/content/series/".concat(e);return i({url:l,params:ae({site:a},Ie("series")),method:"GET",headers:ae({Authorization:n},ye("series"))}).catch((function(n){throw ie(l,n,"content",{videoId:e}),n}))},we=function(){var e=n(t.mark((function e(n){var r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V();case 2:return r=e.sent,e.abrupt("return",i({url:Ae.get()+"".concat(null==D?void 0:D.saveWatchHistoryV2),method:"POST",headers:ae({Authorization:r},ye("saveWatchHistory")),data:ae({},n),params:ae(ae({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId}),Ie("saveWatchHistory"))}).catch((function(e){throw ie("saveWatchHistory",e,"content",{videoId:null==n?void 0:n.videoId,profileId:null==n?void 0:n.profileId}),e})));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Se=function(e,n){var t,r,o=window.contentType,a=Ae.get()+"".concat(null==D?void 0:D.getVideoInfoV2,"/").concat(o,"/").concat(e);return i({method:"GET",url:a,headers:ae({Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(r=t.watchHistory)||void 0===r?void 0:r.xApiKey},ye("videoInfo")),params:Ie("videoInfo"),timeout:15e3}).catch((function(n){throw ie(a,n,"content",{videoId:e,contentType:o}),n}))},ke=function(e){var n=e.videoId,t=Ae.get()+"".concat(null==D?void 0:D.getSeriesWatchHistoryV2,"/").concat(n);return i({method:"GET",url:t,headers:ae({Authorization:e.token},ye("seriesWatchHistory")),params:Ie("seriesWatchHistory"),timeout:15e3}).catch((function(r){throw ie(t,r,"content",{seriesId:n,videoId:null==e?void 0:e.videoId}),r}))},Ae=(se=null==D?void 0:D.apiBaseUrl,{set:function(e){e&&(se=e)},get:function(){return se}}),Oe=function(e,n,t,r){var o,a;return i({url:t,params:ae({id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==r?void 0:r.latitude,longitude:null==r?void 0:r.longitude},Ie("entitlementData")),method:"GET",headers:ae({Authorization:n,adbTempToken:null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.adbTempToken},ye("entitlementData")),withCredentials:!0}).catch((function(n){throw ie(t,n,"content",{videoId:e,url:t}),n}))},Le=(pe=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;pe.set(t,(pe.get(t)||0)+1)},get:function(e){return pe.get(e)},clear:function(){pe.clear()}}),Pe=function(e){de=e},De=function(){return de},Ce=function(e){ue=e},Ne=function(){return ue},Re=function(){return ce},je=function(e){ce=e},Fe=function(){return fe},Ve=function(e){ve=new Map,e.map((function(e,n){ve.set(e.id,n)}))},Me=function(e){if(ve){var n=ve.get(e);je(n+1)}},Ue=(me=0,{set:function(e){e>=0&&(me=e)},get:function(){return me}}),xe=function(e,n){var t=new Map;ke({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),fe=t})).catch((function(e){return console.log(e)}))},We=function(){var e=Ue.get();return e>=0?e+1:1},Be=function(){var e,n,t,r=Ne(),i=De(),o=null==i||null===(e=i.video)||void 0===e?void 0:e.id,a=Ue.get(),l=null==r||null===(n=r[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===o}));return l>=0?l+1:1};function Ge(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 He(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Ye=v,qe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ze=function(e){var n=Ke(e,"video.tags",[]),t=Ke(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},Ke=function(e,n,t){for(var r=0,i=(n=n.split(".")).length;r<i;r++){var o;e=null===(o=e)||void 0===o?void 0:o[n[r]]}return e||t},Qe=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID";return e?n:n.includes("browser-")?n.replace("browser-",""):n},$e=function(){var e,n,t,r,i,o,l,s,u,d,c,v,p,m,h,g,y,I,b,T,E,_,w,S,k,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",O=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return A;var P=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",D=(null==L?void 0:L.contentType)||"video",C=(null==L||null===(t=L[D])||void 0===t?void 0:t.metadata)||(null==L||null===(r=L[D])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.metadata),N=a(O);if(!A.includes("VIEWLIFT_"))return A;var R,j=window.getComputedStyle(document.getElementById(O),null),F=Math.trunc(j.getPropertyValue("height").slice(0,-2)),V=Math.trunc(j.getPropertyValue("width").slice(0,-2)),M="linearchannel"===D?null==L||null===(o=L.linearchannel)||void 0===o||null===(l=o.channels)||void 0===l||null===(s=l.find((function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)})))||void 0===s||null===(u=s.content)||void 0===u?void 0:u.id:Ke(L,"video.gist.id",""),U="linearchannel"===D?null==L||null===(d=L.linearchannel)||void 0===d||null===(c=d.channels)||void 0===c||null===(v=c.find((function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)})))||void 0===v?void 0:v.title:Ke(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),x=null,W=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",(function(e){x=null==e?void 0:e.gppString,W=null==e?void 0:e.sectionList[0]})));var B=f.get("us_privacy")||f.get("usprivacy"),G=void 0!==B?B:"1YNN",H=null!==(p=null===(m=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===m?void 0:m.fwIdentifier)&&void 0!==p?p:null,Y=He(He({},Xe(C)),{},{VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:F,VIEWLIFT_SIZE:qe(V,F),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ke(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ke(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ke(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==N||null===(g=N.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==N||null===(y=N.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P||"golfchannel"==P?"":Qe(!1),VIEWLIFT_DID:"spinco"==P||"usanetwork"==P||"golfchannel"==P?"":Qe(),VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ze(L),VIEWLIFT_MEDIA_ID:M,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ke(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:M,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ke(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:f.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ke(null===(I=window)||void 0===I||null===(b=I.app_data)||void 0===b||null===(T=b.site)||void 0===T?void 0:T.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P||"golfchannel"==P?"":Ke(null===(E=window)||void 0===E||null===(_=E.app_data)||void 0===_||null===(w=_.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:G,VIEWLIFT_TVE_PROVIDER:H?Ye(H):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*Ke(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ke(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:M,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:Ke(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ke(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Be(),VIEWLIFT_SEASON_NUMBER:We(),VIEWLIFT_CONTENT_TAGS:ze(L),VIEWLIFT_GPP_SID:W||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:x||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.macros);for(var q in Y){var z=new RegExp(q,"g");A=A.replace(z,Y[q])}return A},Xe=function(e){var n,t,r,i,o,a,l,s,d,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){v.set(e.name,e.value)})));var f=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(r=t.subscription)||void 0===r?void 0:r.SVOD)||!1,p=(null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o||null===(a=o.subscription)||void 0===a?void 0:a.TVE)||!1;return f||p?(u()?f?c=He(He({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):p&&(c=He(He({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=He(He({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):p&&(c=He(He({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=He(He({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(u()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):p&&(c=He(He({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(u()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=u()?He(He({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):He(He({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=He(He({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(u()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=u()?He(He({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):He(He({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=He(He({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:Ke(null===(l=window)||void 0===l||null===(s=l.app_data)||void 0===s||null===(d=s.appcmsMain)||void 0===d?void 0:d.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Je=function(e,n){var t,r,i,o,a,l,s,u,c,v,f,p,m,h=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[h])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(r=e[h])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.videoAssets,I=null==e||null===(o=e[h])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.audioAssets,b=(null==e||null===(l=e[h])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[h])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var T=(null==e||null===(f=e[h])||void 0===f||null===(p=f.streamingInfo)||void 0===p||null===(m=p.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=I&&I.hls)return en(I);if(g){var E=nn(y,n);return E.src=$e(E.src,n,e),E}if("Safari"!==d()&&T)return Ze(y);if(b){var _=en(y);return _.src=$e(_.src,n,e),_}if(null!=y&&y.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return w.src=$e(w.src,n,e),w}return null},Ze=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},en=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},nn=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,o=e.widevine,l=e.playReady,s=d();if(a(n),"Safari"===s){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",__vlLicenseUrl:(null==e?void 0:e.licenseUrl)||"",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};r.xhr(i,(function(e,n,r){console.log(e),e&&t(e),t(null,new Uint8Array(r))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,o){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};r.xhr(a,(function(e,n,t){console.log(e),e&&o(e),o(null,t)}))}}}}}(i);return tn(n),u}var c,v={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(tn(n),v.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var tn=function(e){var n=a(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},rn=function(e,n){var t=e.src,r=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:r};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:r}};function on(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function an(e){window.dataLayer=window.dataLayer||[],on("js",new Date),on("config",e)}var ln=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var r=document.getElementById(e);if(r){var i=document.createElement("div");i.className="error-container";var o=document.createElement("div");o.className="error-message",o.innerHTML="".concat(n),i.appendChild(o),r.append(i)}}},sn=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var un=!1,dn=function(e,n,t){var r=$e(n,e,t),i=a(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==h(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,r,i,o=a(e);if(null!==o.el_){un=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),un&&null!==o.el_&&("function"==typeof o.ima?o.ima(l):setTimeout((function(){o.ima.setContentWithAdTag(null,n,!0),o.ima.requestAds()}),1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var u="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,u="touchend"),o.one(u,(function(){d&&o.ima.initializeAdDisplayContainer()})),function(e){if(!e._adVolumeSynced){e._adVolumeSynced=!0;var n=function(){try{var n=e.ima&&e.ima.getAdsManager&&e.ima.getAdsManager();if(!n||"function"!=typeof n.setVolume)return;n.setVolume(e.muted()?0:e.volume())}catch(e){}};e.on(["volumechange","advolumechange"],n),e.on("ads-manager",n)}}(o);var c=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.adEventHandler)||null;o.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),o.one("ads-manager",(function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})),n.addEventListener(google.ima.AdEvent.Type.LOADED,(function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})}))})),o.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,r)}};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 vn(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 fn=Object.freeze({PLAY:"PLAY",FIRST_FRAME:"FIRST_FRAME",PING:"PING",PAUSE:"PAUSE",RESUME:"RESUME",BUFFERING:"BUFFERING",SEEK_FORWARD:"SEEK_FORWARD",SEEK_BACKWARD:"SEEK_BACKWARD",FAILED_TO_START:"FAILED_TO_START",DROPPED_STREAM:"DROPPED_STREAM",AD_REQUEST:"AD_REQUEST",AD_IMPRESSION:"AD_IMPRESSION",WATCH_LIVE:"WATCH_LIVE",START_FROM_BEGINNING:"START_FROM_BEGINNING",RESUME_PLAYBACK:"RESUME_PLAYBACK",MV_SELECTION:"MV_SELECTION"}),pn=[fn.WATCH_LIVE,fn.START_FROM_BEGINNING,fn.RESUME_PLAYBACK,fn.MV_SELECTION],mn=[fn.WATCH_LIVE,fn.START_FROM_BEGINNING,fn.RESUME_PLAYBACK],hn=[fn.PING,fn.MV_SELECTION],gn=Object.freeze({LOADED:"loaded",STARTED:"start"}),yn="WEBSITE",In=function(e){return(null==e?void 0:e.contentType)||"video"},bn=function(e){return"linearchannel"===In(e)},Tn=function(e){var n,t,r,i,o,a,l;return bn(e)?null==e||null===(n=e.linearchannel)||void 0===n||null===(t=n.channels)||void 0===t||null===(r=t.find((function(n){return(null==n?void 0:n.id)===(null==e?void 0:e.channelId)})))||void 0===r||null===(i=r.content)||void 0===i?void 0:i.id:(null==e||null===(o=e.video)||void 0===o||null===(a=o.gist)||void 0===a?void 0:a.id)||(null==e||null===(l=e.video)||void 0===l?void 0:l.id)||(null==e?void 0:e.id)},En=function(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return bn(e)?r.title:(null==e||null===(n=e.video)||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||r.title},_n=function(e){return Array.from({length:e},(function(){return Math.floor(16*Math.random()).toString(16)})).join("")},wn=function(e){return bn(e)&&(null==e?void 0:e.channelId)||null},Sn=function(e,n){return Boolean(null==e?void 0:e.key)&&e.key===wn(n)},kn=function(e,n,t){var r=e.lastCountedAt,i=null===r?0:Math.min(Math.max(n-r,0),1e3);return{seconds:e.seconds+i/1e3,lastCountedAt:t?n:null}},An=function(e){var n,t,r,i,o,a,l,s,u,d=e.site,c=e.profid,v=e.context,f=e.event;return[vn(vn(vn(vn({aid:d.name,cid:d.id,pfm:yn},v.params),{},{uid:v.uid,vid:v.vid,url:v.url,ref:v.ref,pa:f.eventName,vpos:null!==(n=f.videoPosition)&&void 0!==n?n:null,environment:"production",dp1:"",dp2:"",dp3:"",dp4:"",dp5:"",apos:f.isAdEvent?f.videoPosition:null,apod:f.isAdEvent?(u=f.adPosition,u?String(u):""):"",profid:c,player:"native",media_type:"VIDEO",stream_id:v.streamId,embedurl:"",ttfirstframe:null!==(t=f.ttFirstFrame)&&void 0!==t?t:null,bitrate:null!==(r=f.bitrate)&&void 0!==r?r:null,connectionspeed:null,resolutionheight:null!==(i=f.resHeight)&&void 0!==i?i:null,resolutionwidth:null!==(o=f.resWidth)&&void 0!==o?o:null,bufferhealth:null!==(a=f.bufferHealth)&&void 0!==a?a:null,networkname:null!==(l=v.network)&&void 0!==l?l:null,brandname:null!==(s=d.name)&&void 0!==s?s:null},f.duration&&{duration:f.duration}),v.params),v.title&&{title:v.title})]};function On(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 Ln(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?On(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):On(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Pn=["localhost","127.0.0.1"],Dn=["adend","adskip","adtimeout","adserror"],Cn=["pause","waiting","seeking","ended","error","adstart"],Nn=new Map,Rn=function(){return performance.now()},jn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var t;return null!==(t=e())&&void 0!==t?t:n}catch(e){return n}},Fn=function(e){return function(){try{e.apply(void 0,arguments)}catch(e){console.error("[BEACON]",e)}}},Vn=function(e){return jn((function(){return Math.floor(e.currentTime())}),0)},Mn=function(e){return{resHeight:jn((function(){return e.videoHeight()})),resWidth:jn((function(){return e.videoWidth()}))}},Un=function(e){return jn((function(){var n=e.currentTime(),t=e.buffered(),r=Array.from({length:t.length},(function(e,n){return n})).find((function(e){return n>=t.start(e)&&n<=t.end(e)}));return void 0===r?null:Math.round(t.end(r)-n)}))},xn=function(e){return jn((function(){var n,t,r,i,o,a,l,s,u,d,c,v=null!==(n=null===(t=e.tech_)||void 0===t||null===(r=t.vhs)||void 0===r||null===(i=r.playlists)||void 0===i||null===(o=i.media)||void 0===o||null===(a=o.call(i))||void 0===a||null===(l=a.attributes)||void 0===l?void 0:l.BANDWIDTH)&&void 0!==n?n:null===(s=e.dash)||void 0===s||null===(u=s.mediaPlayer)||void 0===u||null===(d=u.getCurrentRepresentationForType)||void 0===d||null===(c=d.call(u,"video"))||void 0===c?void 0:c.bandwidth;return v?Math.round(v/1e3):null}))},Wn=function(e,n){return Ln(Ln({duration:n},Mn(e)),{},{bufferHealth:Un(e),bitrate:xn(e)})},Bn=function(e){return jn((function(){return e.hasClass("vjs-waiting")&&!e.paused()}),!1)},Gn=function(e,n){return!n.adPlaying&&jn((function(){return!e.paused()&&!e.seeking()&&!e.hasClass("vjs-waiting")}),!1)},Hn=function(){var e;return Pn.includes(null===(e=globalThis.location)||void 0===e?void 0:e.hostname)},Yn=function(){var e,n;return Boolean(null===(e=o.getConfig())||void 0===e||null===(n=e.debugConfig)||void 0===n?void 0:n.beacon)},qn=function(e){var n,t,r,i,o,a,l,s,u=null!==(o="undefined"!=typeof window?null===(a=window.customData)||void 0===a?void 0:a.beacon:void 0)&&void 0!==o?o:{},d=u.params||{};return{playerId:e.playerId,beaconUrl:u.url,params:Ln({},d),uid:e.userId||W(),vid:Tn(e.content),title:En(e.content,d),network:(l=e.content,(null==l||null===(s=l[In(l)])||void 0===s?void 0:s.network)||null),streamId:e.streamId,url:null!==(n=null===(t=globalThis.location)||void 0===t?void 0:t.href)&&void 0!==n?n:"",ref:null!==(r=null===(i=globalThis.document)||void 0===i?void 0:i.referrer)&&void 0!==r?r:""}},zn=function(e,n){return!e||null!=n&&n.anonymousId?"guest-user":null==n?void 0:n.userId},Kn=function(){var e=n(t.mark((function e(n,r){var o,a,l,s,u,d=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(d.length>2&&void 0!==d[2]?d[2]:{}).keepalive,a=void 0!==o&&o,e.prev=1,e.next=4,V();case 4:if(l=e.sent,s=U(l),u=An({site:{name:null==s?void 0:s.site,id:null==s?void 0:s.siteId},profid:zn(l,s),context:n,event:r}),Yn()&&console.log("%c[BEACON] ".concat(r.eventName),"color:#fff;background:#7a1010;padding:1px 4px;border-radius:3px",n.playerId,u[0]),!Hn()){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,i(Ln({url:n.beaconUrl||Ae.get()+D.getBeaconUrl,method:"post",headers:Ln({Authorization:l},ye("beacon")),params:Ie("beacon"),data:u},a&&{adapter:"fetch",fetchOptions:{keepalive:!0}}));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),console.error("[BEACON]",e.t0);case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(n,t){return e.apply(this,arguments)}}(),Qn=function(e,n){var t,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0,a=Ln({eventName:n,videoPosition:Vn(e.player),isAdEvent:!1},i),l=qn(e);hn.includes(n)||(t=n,r=function(e,n){return vn(vn({},n),{},{pfm:yn,uid:e.uid,vid:e.vid},e.params)}(l,a),on("event",t,r)),Kn(l,a,o)},$n=function(e,n){var t=e.player,r=e.state;if(!r.adPlaying){var i=Math.round(kn(r.watchTime,Rn(),!1).seconds);r.watchTime={seconds:0,lastCountedAt:null},i<1||Qn(e,fn.PING,Wn(t,i),n)}},Xn=function(e,n){var t=e.state;t.pendingFailure&&(Qn(e,t.pendingFailure,{},n),t.pendingFailure=null,t.failed=!0),$n(e,n)},Jn=function(e,n){mn.includes(n)&&(e.state.ignoreSeeksUntil=Rn()+5e3),Qn(e,n,Mn(e.player))},Zn=[function(e){var n=e.player,t=e.getContent,r=e.state,i=e.analytics,o=e.on,a=e.track;o("play",(function(){r.playSent||(r.playSent=!0,r.playStartedAt=Rn(),a(fn.PLAY),"function"==typeof i.callback&&i.callback("started_video_playback",Ln({"Video ID":Tn(t()),watchTime:Vn(n)},i.params)))})),o("timeupdate",(function(){if(r.playSent&&!r.firstFrameSent&&Gn(n,r)){r.firstFrameSent=!0;var e=(Rn()-r.playStartedAt)/1e3;a(fn.FIRST_FRAME,{ttFirstFrame:parseFloat(e.toFixed(2)),bufferHealth:Un(n)})}})),o(g,(function(e,n){r.firstFrameSent&&((null==n?void 0:n.playeraction)!==y.PAUSE||r.paused?(null==n?void 0:n.playeraction)===y.RESUME&&r.paused&&(r.paused=!1,a(fn.RESUME)):(r.paused=!0,a(fn.PAUSE)))}))},function(e){var n=e.player,t=e.state,r=e.on,i=e.track,o=null,a=function(){if(o&&!jn((function(){return n.scrubbing()||n.seeking()}),!1)){var e=o,r=e.from,a=e.programmatic;o=null;var l=Vn(n);t.lastPosition=l,!a&&t.firstFrameSent&&l!==r&&i(l>r?fn.SEEK_FORWARD:fn.SEEK_BACKWARD)}};r("seeking",(function(){o||(o={from:t.lastPosition,programmatic:Rn()<=t.ignoreSeeksUntil})})),r("seeked",a),r("playing",(function(){t.ignoreSeeksUntil===1/0&&(t.ignoreSeeksUntil=Rn()+5e3)})),r("timeupdate",(function(){o?a():jn((function(){return n.seeking()}),!1)||(t.lastPosition=Vn(n))}))},function(e){var n=e.player,t=e.state,r=e.on,i=e.timeout,o=e.interval,a=e.track,l=e.flushPing,s=null,u=null,d=null,c=0,v=0,f=0,p=function(){var e;null===(e=u)||void 0===e||e(),u=null},m=function(){var e;null===(e=d)||void 0===e||e(),d=null,t.pendingFailure=null},h=function(e){var n;t.failed||(t.failed=!0,m(),null===(n=s)||void 0===n||n(),p(),a(e),e===fn.DROPPED_STREAM&&l())},g=function(){d||(v=Rn(),d=i((function(){return h(t.pendingFailure)}),c))},y=function(){var e;null===(e=s)||void 0===e||e(),s=i((function(){t.firstFrameSent||n.paused()||h(fn.FAILED_TO_START)}),3e4)};r("play",(function(){t.firstFrameSent||t.adPlaying||y()})),r("adstart",(function(){var e;return null===(e=s)||void 0===e?void 0:e()})),r(Dn,(function(){t.playSent&&!t.firstFrameSent&&y()})),r("waiting",(function(){var e,r,l=!t.adPlaying&&!t.failed&&!t.pendingFailure;t.firstFrameSent&&l&&!u&&(e=i((function(){return Bn(n)&&h(fn.DROPPED_STREAM)}),45e3),r=o((function(){return Bn(n)?a(fn.BUFFERING):p()}),5e3),u=function(){r(),e()})})),r(["playing","pause"],p),r("playing",(function(){t.failed=!1})),r("error",(function(){t.failed||t.pendingFailure||(t.pendingFailure=t.firstFrameSent?fn.DROPPED_STREAM:fn.FAILED_TO_START,f=jn((function(){return n.currentTime()}),0),c=45e3,p(),jn((function(){return n.paused()}),!1)||g())})),r("timeupdate",(function(){if(t.pendingFailure){var e=jn((function(){return n.currentTime()}),0),r=e>f;f=e,r&&Gn(n,t)&&m()}})),r("pause",(function(){return t.pendingFailure&&void(d&&(d(),d=null,c=Math.max(c-(Rn()-v),0)))})),r("play",(function(){return t.pendingFailure&&g()}))},function(e){var n=e.player,t=e.state,r=e.on,i=e.cleanup,o=e.track,a=null,l=function(e){return Ln({isAdEvent:!0,adPosition:jn((function(){return e.getAd().getAdPodInfo().getAdPosition()}),1)},Mn(n))},s=Fn((function(e){return o(fn.AD_REQUEST,l(e))})),u=Fn((function(e){return o(fn.AD_IMPRESSION,l(e))})),d=function(){var e,n;null===(e=a)||void 0===e||e.removeEventListener(gn.LOADED,s),null===(n=a)||void 0===n||n.removeEventListener(gn.STARTED,u),a=null},c=function(e){e&&e!==a&&(d(),e.addEventListener(gn.LOADED,s),e.addEventListener(gn.STARTED,u),a=e)};r("ads-manager",(function(e){return c(null==e?void 0:e.adsManager)})),r("adstart",(function(){t.adPlaying=!0})),r(Dn,(function(){t.adPlaying=!1})),c(jn((function(){return n.ima.getAdsManager()}))),i(d)},function(e){var n=e.player,t=e.state,r=e.on,i=e.track;r("timeupdate",(function(){var e=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,t=Math.floor(e.seconds/n);return{pings:t,watchTime:vn(vn({},e),{},{seconds:e.seconds-t*n})}}(kn(t.watchTime,Rn(),Gn(n,t))),r=e.pings,o=e.watchTime;t.watchTime=o,Array.from({length:r}).forEach((function(){return i(fn.PING,Wn(n,30))}))})),r(Cn,(function(){t.watchTime=kn(t.watchTime,Rn(),!1)}))},function(e){var n=e.player,t=e.on,r=e.reportUserAction;t(g,(function(e,t){(null==t?void 0:t.playeraction)===y.GO_LIVE&&function(e){return!jn((function(){return e.liveTracker.atLiveEdge()}),!1)}(n)&&r(fn.WATCH_LIVE)}))}],et=function(e){return Ln({playSent:!1,firstFrameSent:!1,playStartedAt:null,paused:!1,adPlaying:!1,failed:!1,pendingFailure:null,lastPosition:0,ignoreSeeksUntil:0,watchTime:{seconds:0,lastCountedAt:null}},e)},nt=function(e,n){n.flush&&Xn(e),e.teardowns.forEach((function(e){return Fn(e)()})),e.teardowns.clear()},tt=function(e){var n,t=null===(n=Nn.get(e))||void 0===n?void 0:n.session;t&&nt(t,{flush:!0}),Nn.delete(e)},rt=!1,it=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.content,r=n.analyticsCb,i=n.analyticsEventParams,l=n.userId,s=a(e);if(!(!s||Hn()&&!Yn()||c()||null!==(u=o.getConfig())&&void 0!==u&&u.disableBeacon)){var u,d=Nn.get(e),v=function(e,n){var t,r,i,o=Sn(e,n);return{stream:o?e:{key:wn(n),id:null!==(t=null===(r=globalThis.crypto)||void 0===r||null===(i=r.randomUUID)||void 0===i?void 0:i.call(r))&&void 0!==t?t:[_n(8),_n(4),_n(4),_n(4),_n(12)].join("-")},reused:o}}(null==d?void 0:d.stream,t),f=v.stream,p=v.reused;null!=d&&d.session&&nt(d.session,{flush:!p});var m,h,g=function(e){var n=e.playerId,t=e.player,r=e.content,i=e.streamId,o=e.userId,a=e.analyticsCb,l=e.analyticsEventParams,s=e.inherited,u=new Set,d={playerId:n,player:t,content:r,streamId:i,userId:o,state:et(s),teardowns:u},c=function(e,n){var r=Fn(n);t.on(e,r),u.add((function(){return t.off(e,r)}))},v=function(e){return u.add(e),e},f={player:t,getContent:function(){return d.content},state:d.state,analytics:{callback:a,params:l},on:c,timeout:function(e,n){var t=v((function(){clearTimeout(r),u.delete(t)})),r=setTimeout((function(){u.delete(t),Fn(e)()}),n);return t},interval:function(e,n){var t=setInterval(Fn(e),n),r=v((function(){clearInterval(t),u.delete(r)}));return r},cleanup:v,track:function(e,n){return Qn(d,e,n)},flushPing:function(){return $n(d)},reportUserAction:function(e){return Jn(d,e)}};return Zn.forEach((function(e){return e(f)})),c("dispose",(function(){return tt(n)})),d}({playerId:e,player:s,content:t,userId:l,analyticsCb:r,analyticsEventParams:i,streamId:f.id,inherited:p&&null!=d&&d.session?(m=d.session.state,{playSent:m.playSent,firstFrameSent:m.firstFrameSent,playStartedAt:m.playStartedAt,paused:m.paused,watchTime:m.watchTime,ignoreSeeksUntil:1/0}):{}});Nn.set(e,{stream:f,session:g}),rt||(rt=!0,null===(h=globalThis.addEventListener)||void 0===h||h.call(globalThis,"pagehide",(function(){return Nn.forEach((function(e){var n=e.session;return n&&Xn(n,{keepalive:!0})}))})))}},ot=function(e,n){var t=Nn.get(e);null!=t&&t.session&&Sn(t.stream,n)&&(t.session.content=n)},at=function(e,n){var t,r=null===(t=Nn.get(e))||void 0===t?void 0:t.session;return!(!r||!pn.includes(n))&&(Jn(r,n),!0)};function lt(e,n){var t,r,i,o=a(e),l=null==o||null===(t=o.controlBar)||void 0===t||null===(r=t.playToggle)||void 0===r?void 0:r.el_,s=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",(function(t){var r,i,a,u,d,c,v,f,p,m,h;if(ut.enabled&&(!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName&&!(null===(r=t.target)||void 0===r||null===(i=r.closest)||void 0===i?void 0:i.call(r,'.vjs-control-bar button, .vjs-control-bar [role="button"]')))){var g=t.key,y=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(g)&&(t.preventDefault(),null==s||s.focus()),g){case" ":null==l||l.click();break;case"m":case"M":o.muted(!o.muted());break;case"f":case"F":null===(a=document.querySelector(".vjs-fullscreen-control"))||void 0===a||a.click();break;case"ArrowLeft":y&&!1===n.liveui||Qi(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(d=u.app_data)||void 0===d||null===(c=d.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(p=f.app_data)&&void 0!==p&&null!==(m=p.appcmsMain)&&void 0!==m&&null!==(h=m.adsConfig)&&void 0!==h&&h.vodAdClientSideTracking)return;y||Ki(e,10)}}}),!0)}var st,ut=(st=!0,{enable:function(){st=!0},disable:function(){st=!1},get enabled(){return st}}),dt="ssai-breakStart",ct="ssai-adImpression",vt="ssai-firstQuartile",ft="ssai-midpoint",pt="ssai-thirdQuartile",mt="ssai-complete",ht="ssai-breakEnd",gt={breakStart:dt,impression:ct,firstQuartile:vt,midpoint:ft,thirdQuartile:pt,complete:mt,breakEnd:ht};function yt(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=a(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var r=n.eventType,i=gt[r];i&&t.trigger(i,n)}function It(e){var n=a(e);if(!n)return console.error("[SSAI] 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{adBreakStart:function(e){return t(dt,e)},adImpression:function(e){return t(ct,e)},adFirstQuartile:function(e){return t(vt,e)},adMidpoint:function(e){return t(ft,e)},adThirdQuartile:function(e){return t(pt,e)},adComplete:function(e){return t(mt,e)},adBreakEnd:function(e){return t(ht,e)}}}function bt(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 Tt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Et,_t=(Et={},{get:function(){return Et},set:function(e){Et=e}});function wt(e,n){var t,r,i,o,l,s,u,d,c,v,f,p,m,h,g,y,I,b,T,E,A,O=null==e?void 0:e.playerId,L=a(O);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var P=De(),D=(null==P||null===(r=P.video)||void 0===r?void 0:r.metadata)||[],C=(null==D?void 0:D.length)&&D.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(i=C)&&void 0!==i&&i.length){var N=C.map((function(e){return e.value}));C=null==N?void 0:N.join(",")}_();var R,j,F,V=null===(o=window)||void 0===o?void 0:o.lcProgrammeDetails,M=Array.isArray(null==V?void 0:V.category)?null==V||null===(l=V.category)||void 0===l?void 0:l.join(","):(null==V?void 0:V.category)||null,U=Tt(Tt(Tt({},null==P?void 0:P.video),null==P?void 0:P.linearchannel),{},{siteName:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.applicationName)||(null==e||null===(u=e.comscore)||void 0===u||null===(d=u.metadata)||void 0===d?void 0:d.siteName)||(null==P?void 0:P.site)||null,programId:(null==V?void 0:V.videotmsid)||null,programTitle:(null==V?void 0:V.lcProgrammeName)||null,episodeId:(null==V?void 0:V.videotmsid)||null,seasonNumber:(null==P||null===(c=P.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==V||null===(f=V.seriesDetails)||void 0===f?void 0:f.season)||null,episodeNumber:(null==P||null===(p=P.video)||void 0===p||null===(m=p.series)||void 0===m?void 0:m.episodeNumber)||(null==V||null===(h=V.seriesDetails)||void 0===h?void 0:h.episode)||null,episodeTitle:(null==V?void 0:V.lcSubTitle)||null,isCompleteEpisode:!!(null!=P&&null!==(g=P.video)&&void 0!==g&&g.series||null!=V&&null!==(y=V.seriesDetails)&&void 0!==y&&y.episode),genre:C||M,comscoreConfig:{implementationId:(null==e||null===(I=e.comscore)||void 0===I?void 0:I.implementationId)||null,projectId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.projectId)||null}}),x=null==e||null===(T=e.comscore)||void 0===T||null===(E=T.metadata)||void 0===E?void 0:E.contentType;if(null!=U&&null!==(A=U.streamingInfo)&&void 0!==A&&A.isLiveStream?U.contentType="Live":U.contentType=x||"LongFormOnDemand",null==U||!U.network){var W,B=(null==U?void 0:U.metadata)||[],G=null==B||null===(W=B.find((function(e){return"network"===e.name})))||void 0===W?void 0:W.value;U.network=G||null}null!=U&&U.network&&null!=U&&U.genre&&(U.customGenre="".concat(U.network,"_").concat((null==U?void 0:U.programTitle)||(R=U,null!=R&&R.series?null==R||null===(F=R.series)||void 0===F?void 0:F.title:null==R||null===(j=R.gist)||void 0===j?void 0:j.title),"_").concat(U.genre)),null!=V&&V.airDate&&(U.publishDate=V.airDate),null!=U&&U.runtime&&"function"==typeof L.duration&&(U.runtime=1e3*Math.ceil(L.duration()));var H=w(U,L);console.log("comscoreOptions player data",H),S(Tt({playerName:"Video.js"},H)),k(L)}}function St(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 kt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function At(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 Ot(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)?Ot(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,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function Ot(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 Lt=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}();function Pt(e,n){return Dt.apply(this,arguments)}function Dt(){return(Dt=n(t.mark((function e(n,r){var i,o,l,s,u,d,c,v,f,p,m,h,g,y,I,b,T,_;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(n),l=Je(r,n),s=l.src,u=(null==r?void 0:r.contentType)||"video",null==r||null===(i=r[u])||void 0===i||null===(o=i.streamingInfo)||void 0===o||o.isLiveStream,d=s.replace("/dash/","/session/").replace("/master/","/session/"),d=$e(d,n,r),c=Ct(d),v=E(c,2),f=v[0],p=v[1],t=p,w=void 0,S=void 0,S=Object.fromEntries(null==Object||null===(w=Object.entries(t))||void 0===w?void 0:w.map((function(e){var n=E(e,2),t=n[0],r=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(r)]}))),m=S||{}||{},d=new URL(d.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=E(e,2),t=n[0],r=n[1];d.searchParams.set(t,r)})),e.prev=11,e.next=14,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(kt({adsParams:kt({},f)},m))});case 14:return h=e.sent,e.next=17,h.json();case 17:return g=e.sent,y="https://"+new URL(d).hostname,I=g.trackingUrl,b=g.manifestUrl,T=y+I,_=y+b,Lt.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),l.src=_,e.abrupt("return",l);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",l);case 32:case"end":return e.stop()}var t,w,S}),e,null,[[11,29]])})))).apply(this,arguments)}function Ct(e){var n={};if(!e.split("?")[1])return[{},{}];var t,r=new URL(e,window.location.origin),i=At((null==r?void 0:r.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var o=E(t.value,2),a=o[0],l=o[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){i.e(e)}finally{i.f()}for(var s={},u={},d=0,c=Object.entries(n);d<c.length;d++){var v=E(c[d],2),f=v[0],p=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=p;else u[f]=p}return[s,u]}var Nt,Rt,jt,Ft=new Map;function Vt(e,n){return Mt.apply(this,arguments)}function Mt(){return Mt=n(t.mark((function e(r,i){var o,s,u,d,c,v,f,p,m,h,g,y,I,b,E,_,w,S,k,A,O,L,P,D,C;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,i,o,l){var s,u,d=a(r);if(!d.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<P&&L.clear(),P=e;var v=(null==n||null===(s=n.ads)||void 0===s||null===(u=s[i])||void 0===u?void 0:u.adId)||c;Math.floor(d.currentTime());var f,p=At(t);try{for(p.s();!(f=p.n()).done;){var m,h,g,y=f.value,I=y.eventType,b=y.beaconUrls,T=y.startTimeInSeconds,E=y.startTime,_=y.durationInSeconds,w=T||0,S=b,k=(null===(m=window)||void 0===m||null===(h=m.customData)||void 0===h||null===(g=h.ads)||void 0===g?void 0:g.adEventHandler)||null,A="".concat(w,"_").concat(I),O=Ft.get("pod-".concat(o))||[];if(console.warn(e,w,"map:",I,"condition1:",e>=w,"map:",Ft),e>=w&&!O.includes(A)){O.push(A),Ft.set("pod-".concat(o),O);try{D(I,n,S,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,I,n)}if("function"==typeof k)try{var C,N={eventType:I,startTimeInSeconds:T,startTime:E,durationInSeconds:_,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[i],adIndex:i};k({adsData:N}),yt(r,N)}catch(e){console.error("Error when calling ads callback:",e)}var R=_t.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,F=R.startComscoreAdTracking,V=R.finishComscoreAdTracking,M=R.endComscoreAdTracking,U="".concat(w,"_").concat(v,"_").concat(I);if(!L.has(U))if(L.set(U,!0),"impression"===I){var x,W=Lt.get();F(j(kt(kt({},null==n||null===(x=n.ads)||void 0===x?void 0:x[i]),{},{trackingUrl:W})))}else"complete"===I?V():"breakEnd"===I&&M()}}}}catch(e){p.e(e)}finally{p.f()}}},D=function(e,n,t,r){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},O=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ft.clear(),window.isAdPlaying=!1,m=Lt.get(),(h=a(r)).one("loadeddata",(function(){m&&A(m)})),g=new Map,y=new Map,I=-1,b=(null===(o=document)||void 0===o||null===(s=o.getElementsByClassName("tvProviderImage"))||void 0===s?void 0:s[0])||null,E=(null==h||null===(u=h.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,_=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,w=(null==h||null===(c=h.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,S=(null==h||null===(f=h.el())||void 0===f||null===(p=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,k=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return T(r);var i=[],o=null==r?void 0:r.find((function(e){return"breakEnd"===(null==e?void 0:e.eventType)})),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find((function(e){return e.includes("videoView")})))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter((function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)})),u=(null==s?void 0:s.some((function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some((function(e){return e.includes("videoView")}))})))||!1;if(!u&&a){var d=null==s?void 0:s.map((function(e){return kt(kt({},e),{},{eventType:"videoView",beaconUrls:[a]})}));null!=d&&d[0]&&i.push(null==d?void 0:d[0])}return i},A=function(){var e=n(t.mark((function e(n){var o,s,u,d,c,v,f,p,m,h,A,L,P,D,N,R,j,F,V,M,U,x,W,B,G,H;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e){document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",x),0===e.button&&F(j)},U=function(e){},M=function(e){if(null!=e){var n,t=null,r=At(p);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.startTimeInSeconds,a=i.ads;Array.isArray(a)&&(null==a?void 0:a.length)>0&&(o>e||g.has(o)||(null===t||o>t.startTimeInSeconds)&&(t=i))}}catch(e){r.e(e)}finally{r.f()}t?(console.log("Resume: seeking back to recent ad break:",t.startTimeInSeconds,"then resuming to",e),m={position:e,podStart:t.startTimeInSeconds,podEndTime:t.startTimeInSeconds+t.durationInSeconds,entered:!1},setTimeout((function(){h.currentTime(t.startTimeInSeconds+.4)}),100)):(m=null,h.currentTime(e),V(e))}},V=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.currentTime(),t=null,r=At(p);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=i.startTimeInSeconds,a=i.durationInSeconds,l=(i.ads,Math.floor(o+a));n>=o&&n<=l&&(t=l,g.set(o,!0))}}catch(e){r.e(e)}finally{r.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){h.currentTime(t+2.2)}),100))},F=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.currentTime();if(!(null==e||e<0||n<=e)){var t,r=null,i=At(p);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=o.startTimeInSeconds,l=o.ads;Array.isArray(l)&&(null==l?void 0:l.length)>0&&(g.has(a)||a>e&&a<=n&&(null===r||a>r.startTimeInSeconds)&&(r=o))}}catch(e){i.e(e)}finally{i.f()}null!==r&&(g.set(r.startTimeInSeconds,!0),y.set(r.startTimeInSeconds,!0),m={position:n,podStart:r.startTimeInSeconds,podEndTime:r.startTimeInSeconds+r.durationInSeconds,entered:!1},console.log("Seeking back to ad pod:",r.startTimeInSeconds,"then resuming to",n),setTimeout((function(){h.currentTime(r.startTimeInSeconds+.4)}),100))}},e.next=8,fetch(n);case 8:return c=e.sent,e.next=11,c.json();case 11:v=e.sent,f=v.avails,p=[],m=null,h=a(r),A=h.controlBar.progressControl,L=A.seekBar.el(),null===(o=document)||void 0===o||o.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),f.map((function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t||t.length),p.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:k(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),i&&M(i),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p,"function"==typeof(R=(null===(P=window)||void 0===P||null===(D=P.customData)||void 0===D||null===(N=D.ads)||void 0===N?void 0:N.onAdBreaksLoaded)||null)&&R(p)),console.log(p,"data"),p.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,r=h.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(i,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(i,"%"),o.style.pointerEvents="none",L.appendChild(o)}})),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=l((function(){var e=h.currentTime();if(e!==I){I=e;for(var n=!1,t=function(){var t=p[r],i=t.startTimeInSeconds,o=t.durationInSeconds,a=t.ads,l=i+o;if(e>=i-1.2&&e<=l+1.2){var s;e>=i&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&g.set(i,!0),ut.disable(),b&&b.classList.add("vjs-hidden"),w&&(w.style.pointerEvents="none",w.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var u=e-i,d=0,c=0,v=0;v<a.length;v++){var f,m=null==a||null===(f=a[v])||void 0===f?void 0:f.durationInSeconds;if(u<d+m){c=v;break}d+=m}a[c];var h=Math.max(0,o-u),I=Math.round(h);W.style.display="block",H.textContent="".concat(c+1," of ").concat(a.length," • ").concat(O(I));var k=[];return null==a||a.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));k.push.apply(k,T(n))})),(null==t||null===(s=t.podSlotImpressionBeacon)||void 0===s?void 0:s.length)>0&&k.push.apply(k,T(null==t?void 0:t.podSlotImpressionBeacon)),C(e,t,k,c,r),"break"}y.delete(i)},r=0;r<p.length;r++){if("break"===t())break}if(window.isAdPlaying=n,m&&!h.seeking()&&(e>=m.podStart&&e<=m.podEndTime&&(m.entered=!0),m.entered&&e>=m.podEndTime)){var i=m.position;m=null,setTimeout((function(){h.currentTime(i),V(i)}),300)}n||(W.style.display="none",A.el().classList.remove("hide-progress-bar"),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),w&&(w.style.pointerEvents="auto",w.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),ut.enable())}}),1e3),h.on("timeupdate",h._timeUpdateHandler),null===(s=document)||void 0===s||s.addEventListener("keydown",(function(e){if(ut.enabled&&"ArrowRight"==e.key){var n=h.currentTime();Ki(r,10),F(n,n+10),e.stopPropagation()}})),j=-1,A.el().addEventListener("pointerdown",(function(e){0===e.button&&(j=h.currentTime(),document.addEventListener("pointermove",U),document.addEventListener("pointerup",x))})),null===(u=document)||void 0===u||null===(d=u.querySelectorAll(".ssai-ad-container"))||void 0===d||d.forEach((function(e){return null==e?void 0:e.remove()})),(W=document.createElement("div")).className="ssai-ad-container",(B=document.createElement("div")).className="sponsored-adbox",(G=document.createElement("div")).className="sponsored-text",G.textContent="Sponsored Ad",B.append(G),(H=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",W.append(B),W.append(H),h.el().appendChild(W);case 47:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),L=new Map,P=-1;case 21:case"end":return e.stop()}}),e)}))),Mt.apply(this,arguments)}function Ut(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 xt(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)?xt(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,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function xt(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 Wt(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 Bt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Gt={},Ht=(null===(Nt=window)||void 0===Nt||null===(Rt=Nt.location)||void 0===Rt||null===(jt=Rt.search)||void 0===jt?void 0:jt.includes("debug=true"))||!1,Yt=null;function qt(e){return zt.apply(this,arguments)}function zt(){return zt=n(t.mark((function e(r){var i,o,s,u,d,c,v,f,p,m,h,g,y,I,b,E,_,w,S,k,A,O,L,P,D,C,N;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N=function(e,n,t,i,o){var l,s,u=a(r);if(!u.seeking()){var d=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(l=n.ads)||void 0===l||null===(s=l[i])||void 0===s?void 0:s.adId)||d;Math.floor(u.currentTime());var v,f=Ut(t);try{for(f.s();!(v=f.n()).done;){var p,m,h,g=v.value,y=g.eventType,I=g.beaconUrls,b=g.startTimeInSeconds,T=g.startTime,E=g.durationInSeconds,_=(g.eventId,b||d),w=I,S=(null===(p=window)||void 0===p||null===(m=p.customData)||void 0===m||null===(h=m.ads)||void 0===h?void 0:h.adEventHandler)||null,k="".concat(c,"_").concat(y),A="pod-".concat(d);P.has(A)||P.set(A,new Set);var O=P.get(A);if(Ht&&console.warn(e,_,"map:",y,"condition1:",e>=_,"map:",P),e>=_&&e<=_+D&&!O.has(k)){O.add(k);try{C(y,n,w,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var L,N={eventType:y,startTimeInSeconds:b,startTime:T,durationInSeconds:E,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[i],adIndex:i};S({adsData:N}),yt(r,N)}catch(e){console.error("Error when calling ads callback:",e)}var R=_t.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,F=R.startComscoreAdTracking,V=R.finishComscoreAdTracking,M=R.endComscoreAdTracking;if("impression"===y){var U,x=Lt.get();F(j(Bt(Bt({},null==n||null===(U=n.ads)||void 0===U?void 0:U[i]),{},{trackingUrl:x})))}else"complete"===y?V():"breakEnd"===y&&M()}}}}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,r){var i,o,a;"breakEnd"===e&&(null===(i=Gt)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(o=Gt)||void 0===o?void 0:o.totalAds)&&(null==n||null===(a=n.ads)||void 0===a?void 0:a.length)>0||(Ht&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))})))},h=function(){Yt&&clearInterval(Yt)},p=Lt.get(),(m=a(r)).one("loadeddata",(function(){h(),Yt=setInterval((function(){p&&!m.paused()&&L(p)}),2e3)})),m.on("dispose",(function(){h()})),g=new Map,y=new Map,I=-1,b=null,E=(null===(i=document)||void 0===i||null===(o=i.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])||null,_=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,w=(null==m||null===(u=m.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==m||null===(d=m.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,k=(null==m||null===(v=m.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,A=!1,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return T(r);var i=[],o=null==r?void 0:r.find((function(e){return"breakEnd"===(null==e?void 0:e.eventType)})),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find((function(e){return e.includes("videoView")})))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter((function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)})),u=(null==s?void 0:s.some((function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some((function(e){return e.includes("videoView")}))})))||!1;if(!u&&a){var d=null==s?void 0:s.map((function(e){return Bt(Bt({},e),{},{eventType:"videoView",beaconUrls:[a]})}));null!=d&&d[0]&&i.push(null==d?void 0:d[0])}return i},L=function(){var e=n(t.mark((function e(n){var i,o,s,u,d,c,v,f,p,m,h,L;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=new URL(n),b&&u.searchParams.append("nextToken",b),e.next=4,fetch(u.toString(),{method:"GET"});case 4:return d=e.sent,e.next=7,d.json();case 7:c=e.sent,v=c.avails,f=c.nextToken||null,b=f,p=[],m=a(r),h=null==m||null===(i=m.controlBar)||void 0===i?void 0:i.progressControl,L=null==h||null===(o=h.seekBar)||void 0===o?void 0:o.el(),null===(s=document)||void 0===s||s.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),v.map((function(e,n){p.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),Ht&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),null!=p&&p.length&&(window.adsQueueList=p),p.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,r=m.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(i,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(i,"%"),o.style.pointerEvents="none",L.appendChild(o)}})),m._timeUpdateHandler&&m.off("timeupdate",null==m?void 0:m._timeUpdateHandler),m._timeUpdateHandler=l((function(){if($i(r)){var e=null==m?void 0:m.currentTime();if(e!==I){I=e;for(var n=function(){var n=p[t],r=n.startTimeInSeconds,i=n.durationInSeconds,o=n.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){var l;A=!!(e>=r&&e<=a&&Array.isArray(o)&&(null==o?void 0:o.length)>0),e>a&&g.set(r,!0),ut.disable(),E&&E.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),k&&(k.style.pointerEvents="none",k.classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),h.el().classList.add("hide-progress-bar");for(var s=e-r,u=0,d=0,c=0;c<o.length;c++){var v,f=null==o||null===(v=o[c])||void 0===v?void 0:v.durationInSeconds;if(s<u+f){d=c;break}u+=f}setTimeout((function(){Gt.totalAds=null==o?void 0:o.length,Gt.currentAdIndex=d}),1e3);var m=[];return null==o||o.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));m.push.apply(m,T(n))})),(null==n||null===(l=n.podSlotImpressionBeacon)||void 0===l?void 0:l.length)>0&&m.push.apply(m,T(null==n?void 0:n.podSlotImpressionBeacon)),N(e,n,m,d),"break"}y.delete(r)},t=0;t<p.length;t++){if("break"===n())break}A||(Gt={},h.el().classList.remove("hide-progress-bar"),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),E&&E.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),k&&(k.style.pointerEvents="auto",k.classList.remove("vjs-hidden")),ut.enable())}}}),1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),P=new Map,D=2.5;case 22:case"end":return e.stop()}}),e)}))),zt.apply(this,arguments)}var Kt=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function Qt(e){return JSON.stringify((e||[]).map((function(e){return{availId:e.availId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds,ads:(e.ads||[]).map((function(e){return{adId:e.adId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds}}))}})))}var $t=function(){function e(n,t,r,i){A(this,e),this.video_=i,this.ad_=n,this.skipOffset_=function(e){if(!e)return null;var n=new RegExp(Kt.source,"g");n.lastIndex=0;var t=n.exec(e);if(!t)return null;var r=Number(t[1])||0,i=Number(t[2]),o=Number(t[3]),a=Number(t[6])||0;return i>59||o>59?null:a/1e3+o+60*i+3600*r}(null==n?void 0:n.skipOffset),this.adPosition_=t,this.totalAds_=r,this.isSkipped_=!1}return O(e,[{key:"isClientRendering",value:function(){return!1}},{key:"getDuration",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.durationInSeconds)&&void 0!==e?e:0}},{key:"getRemainingTime",value:function(){var e,n,t,r,i,o;return(null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0)+(null!==(t=null===(r=this.ad_)||void 0===r?void 0:r.durationInSeconds)&&void 0!==t?t:0)-(null!==(i=null===(o=this.video_)||void 0===o?void 0:o.currentTime)&&void 0!==i?i:0)}},{key:"isSkippable",value:function(){return"number"==typeof this.skipOffset_}},{key:"getTimeUntilSkippable",value:function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var e=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(e,0)}},{key:"canSkipNow",value:function(){return 0===this.getTimeUntilSkippable()}},{key:"skip",value:function(){this.isSkipped_=!0,this.video_&&(this.video_.currentTime+=this.getRemainingTime())}},{key:"isLinear",value:function(){return!0}},{key:"getSequenceLength",value:function(){return this.totalAds_||1}},{key:"getPositionInSequence",value:function(){return this.adPosition_||1}},{key:"getTitle",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adTitle)||""}},{key:"getVastAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.vastAdId)||""}},{key:"getAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adId)||""}},{key:"getCreativeAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.creativeId)||""}},{key:"getTimeOffset",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0}},{key:"release",value:function(){this.ad_=null,this.adPosition_=null,this.totalAds_=null}},{key:"isSkipped",value:function(){return this.isSkipped_}}]),e}(),Xt="impression",Jt="start",Zt="mute",er="unmute",nr="resume",tr="pause",rr="firstQuartile",ir="midpoint",or="thirdQuartile",ar="complete",lr="skip",sr="breakStart",ur="breakEnd",dr="skipStateChanged",cr="ad_impression",vr="ad_started",fr="ad_muted",pr="ad_volume_changed",mr="ad_resumed",hr="ad_paused",gr="ad_first_quartile",yr="ad_midpoint",Ir="ad_third_quartile",br="ad_complete",Tr="ad_stopped",Er="ad_skipped",_r="ad_skip_state_changed",wr="ad_break_started",Sr="ad_break_ended",kr="ads_loaded",Ar="ad_cuepoints_changed";function Or(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 Lr(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Or(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function Pr(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 Dr(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)?Dr(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,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function Dr(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 Cr="[Transmit]";function Nr(e){var n,t,r;if(null==e)return{avails:[],nextToken:null,dashAvailabilityStartTime:null};var i=null!==(n=e.dashAvailabilityStartTime)&&void 0!==n?n:null,o=null!==(t=e.nextToken)&&void 0!==t?t:null,a=[];if(Array.isArray(e.avails))a=e.avails;else if(Array.isArray(e)){var l,s,u,d,c=e[0];if(c&&Array.isArray(c.avails))a=c.avails,i=null!==(l=null!==(s=i)&&void 0!==s?s:c.dashAvailabilityStartTime)&&void 0!==l?l:null,o=null!==(u=null!==(d=o)&&void 0!==d?d:c.nextToken)&&void 0!==u?u:null;else a=e}else if(Array.isArray(null==e||null===(r=e.data)||void 0===r?void 0:r.avails)){var v,f,p,m;a=e.data.avails,o=null!==(v=null!==(f=o)&&void 0!==f?f:e.data.nextToken)&&void 0!==v?v:null,i=null!==(p=null!==(m=i)&&void 0!==m?m:e.data.dashAvailabilityStartTime)&&void 0!==p?p:null}else Array.isArray(null==e?void 0:e.data)&&(a=e.data);return{avails:a,nextToken:o,dashAvailabilityStartTime:i}}var Rr=function(){function e(n,t,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};A(this,e),this.video_=n,this.player_=t,this.onEvent_="function"==typeof r?r:function(){},this.dashManifestUrl_=o.dashManifestUrl||null,this.config_=null,this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.pollIntervalMs_=2e3,this.pollId_=null,this.adBreaks_=[],this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null,this.eventsSent_=new Set,this.firedBeacons_=new Set,this.adBreakListenersAttached_=!1,this.globalListeners_=[],this.adListeners_=[],this.videoTimeupdate_=null,this.lastMutedForAd_=null,this.onDispose_=function(){return i.release()},this.apiTimelineAbsolute_=!1}var r,i,o;return O(e,[{key:"configure",value:function(e){this.config_=e}},{key:"addTrackingUrl",value:function(e){this.trackingUrl_=e||"",this.onEvent_({type:kr,loadTime:0})}},{key:"getCuePoints",value:function(){var e,n=new Map,t=Pr(this.adBreaks_);try{for(t.s();!(e=t.n()).done;){var r,i=Pr(e.value.ads||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.startTimeInSeconds,l=a+o.durationInSeconds;if(isFinite(a)&&isFinite(l)&&!(l<=a)){var s="".concat(a.toFixed(1),"|").concat(l.toFixed(1));n.has(s)||n.set(s,{start:a,end:l})}}}catch(e){i.e(e)}finally{i.f()}}}catch(e){t.e(e)}finally{t.f()}return Array.from(n.values()).sort((function(e,n){return e.start-n.start}))}},{key:"onManifestUpdated",value:function(){this.trackingUrl_&&(this.requestTrackingInfo_(this.firstTrackingRequest_),this.firstTrackingRequest_=!1,this.ensurePolling_())}},{key:"stop",value:function(){this.onEnded_(),this.detachAllListeners_(),this.eventsSent_.clear(),this.firedBeacons_.clear(),this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.apiTimelineAbsolute_=!1,this.adBreaks_=[],this.adBreakListenersAttached_=!1,this.pollId_&&(clearInterval(this.pollId_),this.pollId_=null)}},{key:"release",value:function(){this.stop()}},{key:"ensurePolling_",value:function(){var e=this;this.pollId_||(this.pollId_=setInterval((function(){var n,t;e.trackingUrl_&&(null!==(n=e.player_)&&void 0!==n&&null!==(t=n.paused)&&void 0!==t&&t.call(n)||e.requestTrackingInfo_(!1))}),this.pollIntervalMs_))}},{key:"requestTrackingInfo_",value:(o=n(t.mark((function e(n){var r,i,o,a,l,s,u,d,c,v,f,p,m,h,g,y,I;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,i=new Map,o=0,a=null;case 4:if(!(o<10)){e.next=25;break}return l=new URL(this.trackingUrl_),this.nextToken_&&l.searchParams.set("nextToken",this.nextToken_),e.next=9,fetch(l.toString(),{method:"GET"});case 9:return s=e.sent,e.next=12,s.json();case 12:u=e.sent,o++,(d=Nr(u)).dashAvailabilityStartTime&&!a&&(a=d.dashAvailabilityStartTime),c=Pr(d.avails);try{for(c.s();!(v=c.n()).done;)f=v.value,p=(null==f?void 0:f.availId)||"".concat(null==f?void 0:f.startTimeInSeconds),i.set(p,f)}catch(e){c.e(e)}finally{c.f()}if((m=d.nextToken||null)&&m!==this.nextToken_){e.next=22;break}return this.nextToken_=m,e.abrupt("break",25);case 22:this.nextToken_=m,e.next=4;break;case 25:if(h=Array.from(i.values()),this.updateApiTimelineAbsoluteFlag_(h),g=(null==h||null===(r=h[0])||void 0===r?void 0:r.startTimeInSeconds)||0,this.apiTimelineAbsolute_){e.next=33;break}return e.next=31,this.resolveDashAvailabilityStartTime_(a,g);case 31:e.next=35;break;case 33:this.dashAvailabilityStartTimeResolved_=!0,this.dashAvailabilityStartTime_=0;case 35:h.length?(y=this.normalizeAvails_(h),Qt(this.adBreaks_)!==Qt(y)&&(this.adBreaks_=y,I=this.getCuePoints(),this.onEvent_({type:Ar,cuepoints:I}))):this.adBreaks_.length&&(this.onEvent_({type:Ar,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),n&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(Cr,"tracking info fetch failed",e.t0);case 42:case"end":return e.stop()}}),e,this,[[0,39]])}))),function(e){return o.apply(this,arguments)})},{key:"updateApiTimelineAbsoluteFlag_",value:function(e){this.apiTimelineAbsolute_=!1;var n,t=1e6,r=Pr(e||[]);try{for(r.s();!(n=r.n()).done;){var i,o=n.value;if((null!==(i=null==o?void 0:o.startTimeInSeconds)&&void 0!==i?i:0)>t)return void(this.apiTimelineAbsolute_=!0);var a,l=Pr((null==o?void 0:o.ads)||[]);try{for(l.s();!(a=l.n()).done;){var s,u=a.value;if((null!==(s=null==u?void 0:u.startTimeInSeconds)&&void 0!==s?s:0)>t)return void(this.apiTimelineAbsolute_=!0)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){r.e(e)}finally{r.f()}}},{key:"normalizeAvails_",value:function(e){var n=this,t=this.apiTimelineAbsolute_?0:this.dashAvailabilityStartTime_||0;return e.map((function(e){var r=n.resolveAbsoluteStart_(e,t,null);return Lr(Lr({},e),{},{startTimeInSeconds:r,ads:(e.ads||[]).map((function(i){return Lr(Lr({},i),{},{startTimeInSeconds:n.resolveAbsoluteStart_(i,t,e,r)})}))})}))}},{key:"resolveAbsoluteStart_",value:function(e,n,t,r){var i=null==e?void 0:e.adProgramDateTime;if(i){var o=new Date(i).getTime()/1e3;if(isFinite(o)&&o>0)return o}return null!=t&&t.adProgramDateTime&&"number"==typeof r?r+((e.startTimeInSeconds||0)-(t.startTimeInSeconds||0)):(e.startTimeInSeconds||0)+n}},{key:"resolveDashAvailabilityStartTime_",value:(i=n(t.mark((function e(n,r){var i,o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.dashAvailabilityStartTimeResolved_){e.next=2;break}return e.abrupt("return");case 2:if(!n){e.next=8;break}if(i=new Date(n).getTime()/1e3,!(isFinite(i)&&i>0)){e.next=8;break}return this.dashAvailabilityStartTime_=i,this.dashAvailabilityStartTimeResolved_=!0,e.abrupt("return");case 8:if(!(r>0)){e.next=13;break}return e.next=11,this.fetchDashAvailabilityStartTimeFromMpd_();case 11:(o=e.sent)>0&&(this.dashAvailabilityStartTime_=o,this.dashAvailabilityStartTimeResolved_=!0);case 13:case"end":return e.stop()}}),e,this)}))),function(e,n){return i.apply(this,arguments)})},{key:"fetchDashAvailabilityStartTimeFromMpd_",value:(r=n(t.mark((function e(){var n,r,i,o,a,l;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(r=this.dashManifestUrl_||this.getCurrentSourceUrl_())&&r.includes(".mpd")){e.next=4;break}return e.abrupt("return",0);case 4:return e.next=6,fetch(r);case 6:return i=e.sent,e.next=9,i.text();case 9:return o=e.sent,a=(new DOMParser).parseFromString(o,"application/xml"),l=null===(n=a.querySelector("MPD"))||void 0===n?void 0:n.getAttribute("availabilityStartTime"),e.abrupt("return",l?new Date(l).getTime()/1e3:0);case 15:return e.prev=15,e.t0=e.catch(0),console.warn(Cr,"MPD availabilityStartTime parse failed",e.t0),e.abrupt("return",0);case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(){return r.apply(this,arguments)})},{key:"getCurrentSourceUrl_",value:function(){try{var e,n,t,r,i=(null===(e=this.player_)||void 0===e||null===(n=e.currentSrc)||void 0===n?void 0:n.call(e))||(null===(t=this.player_)||void 0===t||null===(r=t.src)||void 0===r?void 0:r.call(t));return"string"==typeof i?i:(null==i?void 0:i.src)||""}catch(e){return""}}},{key:"setupAdBreakListeners_",value:function(){var e=this;if(!this.adBreakListenersAttached_){this.adBreakListenersAttached_=!0,this.onTimeupdate_();this.attachGlobalListener_("timeupdate",(function(){return e.onTimeupdate_()})),this.attachGlobalListener_("dispose",this.onDispose_),this.video_&&(this.videoTimeupdate_=function(){return e.onTimeupdate_()},this.video_.addEventListener("timeupdate",this.videoTimeupdate_))}}},{key:"isHlsSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase(),r=((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase();return t.includes(".m3u8")||"application/x-mpegurl"===r||"application/vnd.apple.mpegurl"===r}},{key:"isDashSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase();return"application/dash+xml"===((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase()||t.includes(".mpd")}},{key:"getDashMediaPlayerTimelineSeconds_",value:function(){try{var e,n,t=null===(e=this.player_)||void 0===e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer;if(!t||"function"!=typeof t.time)return null;var r=t.time();return"number"==typeof r&&isFinite(r)&&r>1e6?r:null}catch(e){return null}}},{key:"getCurrentTime_",value:function(){var e,n,t,r=null!==(e=null===(n=this.video_)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:0,i=d();if(this.isHlsSource_()){var o,a,l=r,s=null===(o=this.player_)||void 0===o||null===(a=o.seekable)||void 0===a?void 0:a.call(o);return s&&s.length>0&&(l=s.end(s.length-1)),Date.now()/1e3-(l-r)}if(this.isDashSource_()){var u,c,v,f=this.getDashMediaPlayerTimelineSeconds_();if(null!=f)return f;var p=null===(u=this.player_)||void 0===u||null===(c=u.seekable)||void 0===c?void 0:c.call(u),m="function"==typeof(null===(v=this.player_)||void 0===v?void 0:v.currentTime)?this.player_.currentTime():r;if(p&&p.length>0){var h=p.start(0);if(h>1e6&&h+m>1e6)return h+m}if(this.apiTimelineAbsolute_&&(this.dashAvailabilityStartTime_||0)>1e9)return(this.dashAvailabilityStartTime_||0)+m}return"Safari"===i?r:"function"==typeof(null===(t=this.player_)||void 0===t?void 0:t.currentTime)?this.player_.currentTime():r}},{key:"onTimeupdate_",value:function(){if(this.ad_||this.adBreaks_.length){var e=this.getCurrentTime_();if(this.ad_){var n,t;this.sendInProgressEvents_(e,this.transmitAd_);var r=this.ad_.getDuration(),i=(null!==(n=null===(t=this.transmitAd_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==n?n:0)+r,o=i-e;this.ad_.canSkipNow()&&o>0&&r>0&&this.sendTrackingEvent_(dr),r>0&&e>=i&&this.onEnded_()}this.ad_||this.checkLinearAds_(e)}}},{key:"sendInProgressEvents_",value:function(e,n){if(n){var t=n.startTimeInSeconds+.25*n.durationInSeconds,r=n.startTimeInSeconds+.5*n.durationInSeconds,i=n.startTimeInSeconds+.75*n.durationInSeconds;e>=t&&!this.eventsSent_.has(rr)&&(this.eventsSent_.add(rr),this.sendTrackingEvent_(rr)),e>=r&&!this.eventsSent_.has(ir)&&(this.eventsSent_.add(ir),this.sendTrackingEvent_(ir)),e>=i&&!this.eventsSent_.has(or)&&(this.eventsSent_.add(or),this.sendTrackingEvent_(or))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,n=[rr,ir,or];e<n.length;e++){var t=n[e];this.eventsSent_.has(t)||(this.eventsSent_.add(t),this.sendTrackingEvent_(t))}}},{key:"checkLinearAds_",value:function(e){var n,t=Pr(this.adBreaks_);try{for(t.s();!(n=t.n()).done;){var r=n.value;if(this.ad_)break;for(var i=r.ads||[],o=0;o<i.length;o++){var a=i[o],l=a.startTimeInSeconds,s=l+a.durationInSeconds;if(l<=e&&s>e){this.onEnded_(),this.transmitAdBreak_=r,this.transmitAd_=a,this.ad_=new $t(a,o+1,i.length,this.video_),0===o&&this.sendTrackingEvent_(sr),this.setupCurrentAdListeners_();break}}}}catch(e){t.e(e)}finally{t.f()}}},{key:"onEnded_",value:function(){this.ad_&&this.transmitAd_&&(this.ad_.isSkipped()||this.flushPendingQuartiles_(),this.removeCurrentAdListeners_(this.ad_.isSkipped()),this.ad_.getPositionInSequence()===this.ad_.getSequenceLength()&&this.sendTrackingEvent_(ur),this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null)}},{key:"setupCurrentAdListeners_",value:function(){var e,n,t,r,i,o=this,a=!1;null!==(e=this.player_)&&void 0!==e&&null!==(n=e.paused)&&void 0!==n&&n.call(e)?a=!0:(this.sendTrackingEvent_(Xt),this.sendTrackingEvent_(Jt)),this.lastMutedForAd_=null!==(t=null===(r=this.player_)||void 0===r||null===(i=r.muted)||void 0===i?void 0:i.call(r))&&void 0!==t&&t,this.attachAdListener_("volumechange",(function(){var e,n,t,r=null!==(e=null===(n=o.player_)||void 0===n||null===(t=n.muted)||void 0===t?void 0:t.call(n))&&void 0!==e&&e;r!==o.lastMutedForAd_&&(o.lastMutedForAd_=r,r?o.sendTrackingEvent_(Zt):o.sendTrackingEvent_(er))})),this.attachAdListener_("play",(function(){a?(o.sendTrackingEvent_(Xt),o.sendTrackingEvent_(Jt),a=!1):o.sendTrackingEvent_(nr)})),this.attachAdListener_("pause",(function(){o.sendTrackingEvent_(tr)}))}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?lr:ar),this.detachAdListeners_(),this.eventsSent_.clear()}},{key:"attachGlobalListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.globalListeners_.push({event:e,handler:n}))}},{key:"attachAdListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.adListeners_.push({event:e,handler:n}))}},{key:"detachAdListeners_",value:function(){var e,n=Pr(this.adListeners_);try{for(n.s();!(e=n.n()).done;){var t,r,i,o=e.value,a=o.event,l=o.handler;null===(t=this.player_)||void 0===t||null===(r=(i=t).off)||void 0===r||r.call(i,a,l)}}catch(e){n.e(e)}finally{n.f()}this.adListeners_=[]}},{key:"detachAllListeners_",value:function(){this.detachAdListeners_();var e,n=Pr(this.globalListeners_);try{for(n.s();!(e=n.n()).done;){var t,r,i,o=e.value,a=o.event,l=o.handler;null===(t=this.player_)||void 0===t||null===(r=(i=t).off)||void 0===r||r.call(i,a,l)}}catch(e){n.e(e)}finally{n.f()}this.globalListeners_=[],this.video_&&this.videoTimeupdate_&&(this.video_.removeEventListener("timeupdate",this.videoTimeupdate_),this.videoTimeupdate_=null)}},{key:"startComscoreForCurrentAd_",value:function(){try{var e=_t.get();if(!e||0===Object.keys(e).length)return;var n=e.formulateComscoreAdPayload,t=e.startComscoreAdTracking,r=Lt.get();t(n(Lr(Lr({},this.transmitAd_),{},{trackingUrl:r})))}catch(e){console.warn(Cr,"comscore start failed",e)}}},{key:"sendTrackingEvent_",value:function(e){var n,t=this;if(this.transmitAd_&&this.transmitAdBreak_){var r=(this.transmitAd_.trackingEvents||[]).find((function(n){return n.eventType===e}));if(r||(r=(this.transmitAdBreak_.adBreakTrackingEvents||[]).find((function(n){return n.eventType===e}))),r&&(null===(n=this.config_)||void 0===n||!n.disableTrackingEvents)){var i,o,a,l=(null===(i=this.transmitAd_)||void 0===i?void 0:i.adId)||(null===(o=this.transmitAdBreak_)||void 0===o?void 0:o.availId)||"unknown",s=Pr(r.beaconUrls||[]);try{var u=function(){var n=a.value;if(!n)return"continue";var r="".concat(l,"|").concat(e,"|").concat(n);if(t.firedBeacons_.has(r))return"continue";t.firedBeacons_.add(r),fetch(n,{mode:"no-cors"}).catch((function(e){console.warn(Cr,"beacon failed",n,e)}))};for(s.s();!(a=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}var d=_t.get(),c=d&&Object.keys(d).length?d:null;switch(e){case Xt:this.onEvent_({type:cr}),this.startComscoreForCurrentAd_();break;case Jt:this.onEvent_({type:vr,ad:this.ad_});break;case Zt:this.onEvent_({type:fr});break;case er:this.onEvent_({type:pr});break;case nr:this.onEvent_({type:mr});break;case tr:this.onEvent_({type:hr});break;case rr:this.onEvent_({type:gr});break;case ir:this.onEvent_({type:yr});break;case or:this.onEvent_({type:Ir});break;case ar:this.onEvent_({type:br}),this.onEvent_({type:Tr}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case lr:this.onEvent_({type:Er}),this.onEvent_({type:Tr});break;case sr:this.onEvent_({type:wr});break;case ur:this.onEvent_({type:Sr}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case dr:this.onEvent_({type:_r})}}else console.warn(Cr,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function jr(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 Fr(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):jr(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Vr={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function Mr(e){if(null==e||!e.src)return null;var n=(e.type||"").toLowerCase(),t=String(e.src).toLowerCase();return"application/dash+xml"===n||t.includes(".mpd")?"dash":"application/x-mpegurl"===n||"application/vnd.apple.mpegurl"===n||t.includes(".m3u8")?"hls":null}function Ur(e,n,t){return xr.apply(this,arguments)}function xr(){return(xr=n(t.mark((function e(n,r,i){var o,a,l,s,u,d,c,v,f,p,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Mr(n)){e.next=3;break}return e.abrupt("return",n);case 3:return a=$e(n.src,i,r),l=a.replace(o,Vr[o]),console.log("[Transmit] session init →",l),e.prev=6,e.next=9,fetch(l,{method:"GET",redirect:"follow"});case 9:return s=e.sent,e.next=12,s.json();case 12:if(u=e.sent,console.log("[Transmit] session response",u),d="dash"===o?null==u?void 0:u.dashUrl:null==u?void 0:u.hlsUrl,c=null==u?void 0:u.trackingUrl,d&&c){e.next=18;break}return e.abrupt("return",n);case 18:return v=new URL(l),f=v.hostname,p="https://".concat(f).concat(d),m="https://".concat(f).concat(c),Lt.set(m),console.log("[Transmit] session ready",{manifestUrl:p,trackingUrl:m}),e.abrupt("return",Fr(Fr({},n),{},{src:p}));case 26:return e.prev=26,e.t0=e.catch(6),console.warn("[Transmit] session init failed",e.t0),e.abrupt("return",n);case 30:case"end":return e.stop()}}),e,null,[[6,26]])})))).apply(this,arguments)}var Wr,Br=null;function Gr(e,n){var t;if(Br)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),Br;var r=Lt.get();if(!r)return console.warn("[Transmit] initializeTransmit skipped — no tracking URL"),null;var i=a(e);if(!i)return console.warn("[Transmit] initializeTransmit skipped — no player"),null;var o=(null===(t=i.el())||void 0===t?void 0:t.querySelector("video"))||null,l=function(e){try{var n="function"==typeof(null==e?void 0:e.currentSrc)&&e.currentSrc()||"function"==typeof(null==e?void 0:e.src)&&e.src()||"";if("application/dash+xml"===("function"==typeof(null==e?void 0:e.currentType)&&e.currentType()||"")||String(n).includes(".mpd"))return n}catch(e){}return null}(i);return(Br=new Rr(o,i,(function(e){var t,r;console.log("[Transmit] ad event",e);var i=null==n||null===(t=n.customData)||void 0===t||null===(r=t.ads)||void 0===r?void 0:r.adEventHandler;if("function"==typeof i)try{i(e)}catch(e){console.warn("[Transmit] adEventHandler threw",e)}}),{dashManifestUrl:l})).configure({disableTrackingEvents:!1}),Br.addTrackingUrl(r),Br.onManifestUpdated(),Br}function Hr(){Br&&(Br.release(),Br=null)}function Yr(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 qr(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yr(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var zr=[],Kr=0,Qr=null;function $r(e,n){var t,r,i;if(null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&"function"==typeof(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.cb)){var o,a,l,s=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,u=(null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.completionThreshold)||95,d=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.cb,c=-1;e.on("seeked",(function(){if(!window.isAdPlaying){var n=Math.floor(e.currentTime()),t=n-n%s;if(c=t,t>0){var r=Math.floor(n/e.duration()*100);d({watchedTime:n,watchedPercentage:r,doneWatching:r>=u})}}})),e.on("timeupdate",(function(){if(!window.isAdPlaying){var n=Math.floor(e.currentTime()),t=n-n%s;if(n%s==0&&t!==c){c=t;var r=Math.floor(n/e.duration()*100);d({watchedTime:n,watchedPercentage:r,doneWatching:r>=u||!1})}}})),e.on("ended",(function(){d({watchedTime:Math.floor(e.duration()),watchedPercentage:100,doneWatching:!0})}))}}function Xr(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Qr=null==n||null===(i=n.series)||void 0===i?void 0:i.id),zr=[],Kr=0,Wr=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,s=a(e);s&&(s.on("dispose",Jr),s.on("timeupdate",(function(){if(!s.seeking()&&!window.isAdPlaying){var e=Math.floor(s.currentTime());zr.includes(Kr)||(e!=Kr||e<l?e>Kr&&(Kr=e+l):(zr.push(e),Zr(s,n,l)))}})),s.on("seeked",(function(){var e=Math.floor(s.currentTime());Kr=e+l,zr=[]})),s.one("ended",(function(){Zr(s,n,l,!0)})))}function Jr(){Wr=null,zr=[],Kr=0,Qr=null}function Zr(n,t,r){var i,o,a,l,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,c=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(a=t.watchHistory)||void 0===a||a.xapiKey;var f=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,p=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(n.currentTime()),h=u?100:Math.floor(c/v*100),g={};p?function(n,t,r){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(r),o=ei(i),a=(new Date).getTime(),l=De(),s=(null==l?void 0:l.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return qr(qr({},n),{},e({},t,s[t]))}),{}),d=o.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Wr}));d<0?o.push(qr(qr({content:u},n),{},{addedDate:a,updateDate:a})):o[d]=qr(qr(qr({},o[d]),n),{},{updateDate:a});localStorage.setItem("".concat(i),JSON.stringify(o))}(g={completed:u,watchedTime:m,watchedPercentage:h},d,t.siteOwner):(g=qr(qr({videoId:Wr,watchedTime:m,watchedPercentage:h,doneWatching:u,profileId:d},Qr&&{seriesId:Qr}),f&&{originalObjectId:f}),we(g).then((function(e){})).catch((function(e){}))),Kr=c+r}function ei(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ni(e,n,t){var r=ei(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}function ti(e,n){at(e.id(),fn.RESUME_PLAYBACK),setTimeout((function(){e.currentTime(n)}),0),e.one("playing",(function(){e.currentTime()<n-1&&e.currentTime(n)}))}function ri(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 ii(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)?ii(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,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function ii(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 oi=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},ai=function(e){var n;try{var t,r,i=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(i))return i}catch(e){}var o=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return o&&o.length?o.end(o.length-1):NaN};function li(e){var n=null,t=null,r="none",i=null,o=null,l=function(e){var n=e&&e.data||[],t=n.find((function(e){return e&&"encoder"===e.type}))||n[0];t&&Number.isFinite(t.ntpTimestamp)&&Number.isFinite(t.mediaTime)&&(o=t)},s=function(r){var i=a(e);if(!i)return null;if(null!=n&&null!=t)return t+(r-n);var o=ai(i);return Number.isFinite(o)?o-(Date.now()/1e3-r):null},u=function(r){var i=a(e);if(!i)return null;if(null!=n&&null!=t)return n+(r-t);var o=ai(i);return Number.isFinite(o)?Date.now()/1e3-(o-r):null},d=function(){var n=a(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}},c=function(){var n=a(e),t=n&&n.liveTracker;try{if(t&&"function"==typeof t.isLive&&t.isLive()){var r=t.seekableStart(),i=t.liveWindow();if(Number.isFinite(r)&&Number.isFinite(i)&&i>0)return{start:r,end:r+i}}}catch(e){}return d()};return{refreshAnchor:function(){var s=a(e);if(s){var u=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,i=r&&"function"==typeof r.media&&r.media();return i&&i.segments||null}catch(e){return null}}(s),d=s.currentTime()||0;if(u&&u.length){var c,v=null,f=1/0,p=ri(u);try{for(p.s();!(c=p.n()).done;){var m=c.value;if(m&&"number"==typeof m.programDateTime&&"number"==typeof m.start&&Number.isFinite(m.start)){var h=Math.abs(m.start-d);h<f&&(f=h,v=m)}}}catch(e){p.e(e)}finally{p.f()}if(v)return n=v.programDateTime/1e3,t=v.start,void(r="pdt")}var g=function(e){var n=e&&e.dash&&e.dash.mediaPlayer;if(!n||"function"!=typeof n.on)return null;if(n!==i){try{i&&"function"==typeof i.off&&i.off("inbandPrft",l);var t="function"==typeof n.getSettings?n.getSettings():null;t&&t.streaming&&t.streaming.parseInbandPrft||n.updateSettings({streaming:{parseInbandPrft:!0}}),n.on("inbandPrft",l)}catch(e){}i=n,o=null}return o}(s);if(g&&function(e,n){var t=e.seekable();return!(!t||!t.length)&&n>=t.start(0)-60&&n<=t.end(t.length-1)+60}(s,g.mediaTime))return n=g.ntpTimestamp/1e3,t=g.mediaTime,void(r="prft");var y=s.dash?null:function(e){try{var n=e.tech(!0),t=n&&"function"==typeof n.el?n.el():null,r=t&&"function"==typeof t.getStartDate?t.getStartDate():null,i=r?r.getTime():NaN;return Number.isFinite(i)?i/1e3:null}catch(e){return null}}(s);if(null!=y)return n=y,t=0,void(r="startDate");n=null,t=null,r="now"}},anchorInfo:function(){return{anchorPdtSec:n,anchorPlayerT:t,source:r}},playerTimeToUtc:u,utcToPlayerTime:s,chapterToPlayerTime:function(e){return s(oi(e).start)},chapterStartPercent:function(e){return function(e){var n=c(),t=n.start,r=n.end;if(!(r>t))return null;var i=s(e);return null==i||i<t||i>r?null:(i-t)/(r-t)*100}(oi(e).start)},playerTimeToChapterIndex:function(e,n){var t=u(e);if(null==t)return-1;for(var r=-1,i=0;i<n.length;i++){var o=oi(n[i]),a=o.start,l=o.end,s=Math.max(l,a+.001);t>=a&&t<s&&(r=i)}return r},windowBounds:d,displayBounds:c}}function si(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?li(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=a(e),i=r&&r.duration();if(!Number.isFinite(i)||i<=0)return null;var o,l=n(t);return l<0||l>i?null:100*((o=l/i)<0?0:o>1?1:o)},playerTimeToChapterIndex:function(e,r){for(var i=-1,o=0;o<r.length;o++){var a=n(r[o]),l=Math.max(t(r[o]),a+.001);e>=a&&e<l&&(i=o)}return i},windowBounds:function(){var n=a(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}},playerTimeToUtc:function(){return null}}}(e)}var ui=Object.freeze({PENDING_SELECTION:"PENDING_SELECTION",PENDING_RESUME:"PENDING_RESUME",PLAYING_LIVE:"PLAYING_LIVE",PLAYING_DVR:"PLAYING_DVR"}),di=Object.freeze({LIVE:"live",BEGINNING:"beginning",RESUME:"resume"}),ci=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/,vi=/^\d+(\.\d+)?$/,fi=function(e){if(null==e||""===e)return null;if(e instanceof Date){var n=e.getTime();return Number.isFinite(n)?n/1e3:null}var t=String(e).trim();if("number"==typeof e||vi.test(t)){var r=Number(e);return!Number.isFinite(r)||r<=0?null:r>1e12?r/1e3:r}var i=Date.parse(ci.test(t)?"".concat(t.replace(" ","T"),"Z"):t);return Number.isFinite(i)?i/1e3:null},pi=function(e){return(null==e?void 0:e.contentType)||"video"},mi=function(e){return"linearchannel"===pi(e)},hi=function(){for(var e,n,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.config,a=i.content,l=0,s=[null==o||null===(e=o.dvrStartOverConfig)||void 0===e?void 0:e.startOverTime,mi(a)?null==o||null===(n=o.epg)||void 0===n?void 0:n.programStartTime:null,null==a||null===(t=a[pi(a)])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.scheduleStartDate];l<s.length;l++){var u=fi(s[l]);if(null!=u)return u}return null},gi=function(e,n){var t,r,i=mi(e)?null==e?void 0:e.channelId:null==e||null===(t=e[pi(e)])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id;return"vl_dvr_resume_utc_".concat(i||n)},yi=function(e){var n,t,r=Number(null==e||null===(n=e[pi(e)])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.startOverTime);return r>0?r:21600},Ii=function(e,n){return e===di.LIVE?ui.PLAYING_LIVE:e===di.BEGINNING?ui.PLAYING_DVR:e===di.RESUME?n?ui.PLAYING_DVR:ui.PENDING_SELECTION:n?ui.PENDING_RESUME:ui.PENDING_SELECTION},bi=function(e){return e===ui.PENDING_SELECTION||e===ui.PENDING_RESUME},Ti=function(e){var n=e.start,t=e.end;return Number.isFinite(n)&&Number.isFinite(t)&&t-n>=30},Ei=function(e,n){var t=e.start,r=e.end;if(!(Number.isFinite(t)&&Number.isFinite(r)&&r>t))return null;var i=Math.min(t+5,r);return Number.isFinite(n)?Math.min(Math.max(n,i),r):i},_i=["config"];function wi(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 Si(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wi(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):wi(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var ki=["loadedmetadata","durationchange","canplay","progress"],Ai=["timeupdate","seeked","pause","playing"],Oi=["chromecastConnected","chromecastDisconnected"],Li="vl-dvr-hidden",Pi='<svg width="16" height="15" viewBox="0 0 10 12" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true"><path d="M0.5 10.2539C0.5 11.0268 1.33937 11.5076 2.00601 11.1165L9.06227 6.9768C9.71345 6.59477 9.72265 5.65656 9.07908 5.26184L2.02283 0.934003C1.35652 0.525331 0.5 1.00479 0.5 1.78644V10.2539Z"></path></svg>',Di='<svg width="16" height="14" viewBox="0 0 16 14" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true"><path d="M1.22392e-06 0.109374L4 0.109374L4 14.1094L0 14.1094L1.22392e-06 0.109374ZM16 13.7549C16 13.904 15.8322 13.9917 15.71 13.9062L6.21582 7.26074C6.11093 7.18732 6.11093 7.03143 6.21582 6.95801L15.71 0.3125C15.8322 0.227075 16 0.314702 16 0.463867L16 13.7549Z"></path></svg>',Ci=new Map,Ni=function(e){try{return window.localStorage.getItem(e)}catch(e){return null}},Ri=function(e,n){try{window.localStorage.setItem(e,n)}catch(e){}},ji=function(e){try{window.localStorage.removeItem(e)}catch(e){}},Fi=function(e,n){var t,r,i,o=Number(Ni(e));return t=o,r=Date.now()/1e3,i=n,Number.isFinite(t)&&t<=r&&r-t<=i?o:(ji(e),null)},Vi=function(e,n,t){var i=r.dom.createEl("button",{className:"vl-dvr-btn ".concat(e),type:"button"});return i.appendChild(r.dom.createEl("span",{className:"vl-dvr-icon",innerHTML:n})),i.appendChild(r.dom.createEl("span",{className:"vl-dvr-label"})),Mi(i,t),i},Mi=function(e,n){var t=e.querySelector(".vl-dvr-label");t.textContent!==n&&(t.textContent=n,e.setAttribute("aria-label",n))},Ui=function(e){e&&"function"==typeof e.catch&&e.catch((function(){}))};function xi(e,n,t){var i,o=t.config,a=t.content,l=(null==o?void 0:o.dvrStartOverConfig)||{},s=function(){var e,n,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{watchLive:(null==i||null===(e=i.watchLive)||void 0===e?void 0:e.text)||"Watch Live",startFromBeginning:(null==i||null===(n=i.startFromBeginning)||void 0===n?void 0:n.text)||(null==i||null===(t=i.startFromBegining)||void 0===t?void 0:t.text)||"Watch from Beginning",resume:(null==i||null===(r=i.resume)||void 0===r?void 0:r.text)||"Resume"}}(l.localisation),u=si(e,{timeMode:"livedvr"}),d=hi({config:o,content:a}),c=null==a?void 0:a.channelId,v=gi(a,e),f=Fi(v,yi(a)),p=Ii(l.dvrPlayFrom,null!=f),m=!1,h=function(e,n){return e===ui.PLAYING_LIVE?di.LIVE:e===ui.PLAYING_DVR?n===di.RESUME?di.RESUME:di.BEGINNING:null}(p,l.dvrPlayFrom),g=null,b=new Set,T=[],E=n.autoplay();bi(p)&&n.autoplay(!1);var _=function(){try{var e=n.seekable();if(e&&e.length)return{start:e.start(0),end:e.end(e.length-1)}}catch(e){}return{start:NaN,end:NaN}},w=function(e){return null==e?null:(u.refreshAnchor(),u.utcToPlayerTime(e))},S=function(){return m&&"Chromecast"!==n.techName_&&Ti(_())},k=function(e){var t,r,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).starting,a=void 0!==o&&o;if(e===di.LIVE)a||function(){var e=n.liveTracker;if(e&&e.isTracking())e.seekToLiveEdge();else{var t=_().end;Number.isFinite(t)&&n.currentTime(t)}}();else{var l=e===di.RESUME&&null!=f?f:d;t=w(l),null!=(r=Ei(_(),t))&&n.currentTime(r),a&&(i=l)}e!==di.RESUME&&ji(v),f=null},A=function(){var e=_(),t=e.start,r=e.end;if(null!=h&&n.hasStarted()&&r>t){var i=h;h=null,k(i,{starting:!0})}},O=function(){if(m)if(p!==ui.PLAYING_LIVE){if(p===ui.PLAYING_DVR){u.refreshAnchor();var e=u.playerTimeToUtc(n.currentTime());Number.isFinite(e)&&Ri(v,String(Math.floor(e)))}}else ji(v)},L=function(){g||(g=setInterval(O,5e3))},P=function(e){if(e!==p){var n=p;p=e,W(),b.forEach((function(t){try{t(e,n)}catch(e){console.error("[DVR START OVER]",e)}}))}},D=function(){m&&!bi(p)&&P(function(){var e=n.liveTracker;if(e&&e.isTracking())return e.atLiveEdge();var t=_().end;return!(n.paused()||t-n.currentTime()>15)}()?ui.PLAYING_LIVE:ui.PLAYING_DVR)},C=function(t){return!(!Object.values(di).includes(t)||!function(e){return e===di.LIVE||!m||S()}(t))&&(function(t,r){t===di.BEGINNING?(I(n,y.START_FROM_BEGINNING),at(e,fn.START_FROM_BEGINNING)):t===di.RESUME?at(e,fn.RESUME_PLAYBACK):r?at(e,fn.WATCH_LIVE):I(n,y.GO_LIVE)}(t,bi(p)),P(t===di.LIVE?ui.PLAYING_LIVE:ui.PLAYING_DVR),n.hasStarted()?k(t):h=t,Ui(n.play()),L(),!0)},N=Vi("vl-dvr-btn--primary",Pi,s.watchLive),R=Vi("vl-dvr-btn--secondary",Di,s.startFromBeginning),j=r.dom.createEl("div",{className:"vl-dvr-overlay ".concat(Li)}),F=r.dom.createEl("div",{className:"vl-dvr-overlay-actions"});F.append(N,R),j.appendChild(F);var V=Vi("vl-dvr-control vl-dvr-control--live",Pi,s.watchLive),M=Vi("vl-dvr-control vl-dvr-control--beginning",Di,s.startFromBeginning),U=r.dom.createEl("div",{className:"vl-dvr-controls ".concat(Li)});U.append(V,M),n.el().append(j,U);var x=null;function W(){var e,t,r=bi(p),i={pending:r,primaryLabel:p===ui.PENDING_RESUME?s.resume:s.watchLive,controlsHidden:r||!S(),liveHidden:p!==ui.PLAYING_DVR};(t=i,(e=x)&&Object.keys(t).every((function(n){return e[n]===t[n]})))||(x=i,n.toggleClass("vl-dvr-pending",i.pending),j.classList.toggle(Li,!i.pending),Mi(N,i.primaryLabel),U.classList.toggle(Li,i.controlsHidden),V.classList.toggle(Li,i.liveHidden))}var B=function(e,n,t){e.on(n,t),T.push((function(){return e.off(n,t)}))},G=function(e,n){var t=function(e){e.stopPropagation(),n()};e.addEventListener("click",t),T.push((function(){return e.removeEventListener("click",t)}))};G(N,(function(){return C(p===ui.PENDING_RESUME?di.RESUME:di.LIVE)})),G(R,(function(){return C(di.BEGINNING)})),G(V,(function(){return C(di.LIVE)})),G(M,(function(){return C(di.BEGINNING)})),B(n,ki,(function(){var e;e=_(),!m&&e.end>e.start&&(m=!0,u.refreshAnchor(),bi(p)&&!Ti(e)&&(P(ui.PLAYING_LIVE),n.autoplay(E),E&&Ui(n.play())),bi(p)||L(),W()),A()})),B(n,"play",(function(){bi(p)&&(P(ui.PLAYING_LIVE),L()),n.setTimeout(A,0)})),B(n,"playing",(function(){if(void 0!==i){var e=Ei(_(),w(i));i=void 0,null!=e&&Math.abs(n.currentTime()-e)>10&&n.currentTime(e)}})),B(n,Ai,(function(){D(),W()})),B(n,Oi,W),n.liveTracker&&B(n.liveTracker,"liveedgechange",D);var H=function(){bi(p)&&n.autoplay(E),clearInterval(g),g=null,T.splice(0).forEach((function(e){return e()})),b.clear(),j.remove(),U.remove(),n.removeClass("vl-dvr-pending"),Ci.get(e)===Y&&Ci.delete(e)};B(n,"dispose",H);var Y={manager:{getState:function(){return p},onStateChange:function(e){return b.add(e),function(){return b.delete(e)}},isAvailable:S,hasResume:function(){return null!=f},selectAction:C,seekToLive:function(){return C(di.LIVE)},seekToBeginning:function(){return C(di.BEGINNING)},setStartOverTime:function(e){d=fi(e)},getStartOverTime:function(){return d},destroy:H},updateContent:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.params,r=n.content,o=n.sourceReloaded,a=void 0!==o&&o,l=hi({config:{epg:t},content:r}),s=!(null==r||!r.channelId)&&r.channelId!==c;(s||null!=l)&&(d=l),a&&(m=!1,i=void 0),s&&(c=r.channelId,v=gi(r,e),f=Fi(v,yi(r)),P(bi(p)?Ii(null,null!=f):ui.PLAYING_LIVE),bi(p)||(f=null)),W()},destroy:H};return W(),Y}function Wi(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.config,o=r.content,l=r.liveVideo,s=r.isDvrEnabled;null===(n=Ci.get(e))||void 0===n||n.destroy();var u=a(e);if(!u||!function(e){var n,t=e.config,r=e.content,i=e.liveVideo,o=e.isDvrEnabled;return!(null==t||null===(n=t.dvrStartOverConfig)||void 0===n||!n.enable)&&!!i&&(!!o||mi(r))}({config:i,content:o,liveVideo:l,isDvrEnabled:s}))return null;var d=xi(e,u,{config:i,content:o});Ci.set(e,d);var c=null==i||null===(t=i.dvrStartOverConfig)||void 0===t?void 0:t.getDvrManager;return"function"==typeof c&&c(d.manager),d.manager}function Bi(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.config,r=L(n,_i),i=Si(Si({},null==t?void 0:t.dvrStartOverConfig),{},{startOverTime:void 0,dvrPlayFrom:void 0});return Wi(e,Si(Si({},r),{},{config:Si(Si({},t),{},{epg:void 0,dvrStartOverConfig:i})}))}function Gi(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.params,i=t.content,o=t.sourceReloaded;mi(i)&&(null===(n=Ci.get(e))||void 0===n||n.updateContent({params:r,content:i,sourceReloaded:o}))}var Hi=function(e){var n;return(null===(n=Ci.get(e))||void 0===n?void 0:n.manager)||null};function Yi(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 qi=function(e){var n=r(e);n.paused()&&b(e,{play:1}),n.play()},zi=function(e){var n=r(e);n.paused()||b(e,{pause:1}),n.pause()},Ki=function(e,n){var t=r(e),i=t.currentTime()+n;t.currentTime(i)},Qi=function(e,n){var t=r(e),i=t.currentTime(),o=i<=n?0:i-n;t.currentTime(o)},$i=function(e){return!!r.getPlayer("".concat(e))},Xi=function(e){return r(e).paused()},Ji=function(){var e=n(t.mark((function e(r,i){var l,s,u,d,c=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=c.length>2&&void 0!==c[2]&&c[2],e.next=3,V();case 3:return s=e.sent,u=a(r),d=o.getConfig(),e.abrupt("return",new Promise((function(e,o){Ee(i,s).then(function(){var o=n(t.mark((function n(o){var a,s,c,v,f,p,m,h,g,y,I;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Hr(),(p=null==o?void 0:o.data).contentType="linearchannel",p.channelId=null==i?void 0:i.channelId,m=(null===(a=window.customData)||void 0===a?void 0:a.ads)||(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v?void 0:v.adsConfig)||{},h=!(null==p||null===(f=p.linearchannel)||void 0===f||!f.isSSAIEnabled),g=h&&"MEDIA_TAILOR"==(null==m?void 0:m.vodAdSticherProvider),y=h&&"TRANSMIT"==(null==m?void 0:m.liveAdSticherProvider)&&!(null==m||!m.liveAdClientSideTracking),I=Je(p,r),!g){n.next=16;break}return n.next=12,Pt(r,p);case 12:I=n.sent,l=!0,n.next=21;break;case 16:if(!y){n.next=21;break}return n.next=19,Ur(I,p,r);case 19:I=n.sent,l=!0;case 21:Pe(p),Gi(r,{params:i,content:p,sourceReloaded:Boolean(I&&l)}),I&&l?(it(r,{content:p,analyticsCb:null==d?void 0:d.analyticsCb,analyticsEventParams:null==d?void 0:d.analyticsEventParams,userId:null==d?void 0:d.userId}),ro(r,I),y?Gr(r,{customData:window.customData||{ads:m}}):g&&qt(r),u.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:p})}))):(ot(r,p),_t.get()&&0!==Object.keys(_t.get()).length&&wt({playerId:r,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:p}));case 24:case"end":return n.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}()).catch((function(e){o({status:!1,msg:"Cannot load feed",response:e})}))})));case 7:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Zi=function(){var e=n(t.mark((function e(r,i,l){var s,u,d,c,v,f,h,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V();case 2:return c=e.sent,v=o.getConfig(),console.log("load video"),(Ne()||null)&&Me(i),f=0,h=0,g=null,null!==(s=window)&&void 0!==s&&s.watchHistory&&null!==(u=window)&&void 0!==u&&null!==(d=u.watchHistory)&&void 0!==d&&d.enable&&Se(i,c).then((function(e){var n,t,r,i,o,a,l,s,u;(null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t||!t.cb||null!==(r=window)&&void 0!==r&&null!==(i=r.watchHistory)&&void 0!==i&&i.isExternal||null===(o=window)||void 0===o||null===(a=o.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data),f=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,(h=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedPercentage)||null)<95)&&(g=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedTime)||null)})).catch((function(){})),e.abrupt("return",new Promise((function(e,o){Te(i,c).then(function(){var i=n(t.mark((function n(i){var l,s,u,d,c,y,I,b,T,E,_,w,S,k,A,O,L,P,D,C,N,R,j,F,V,M,U,x,W,B,G,H,Y,q,z,K,Q,$,X,J,Z,ee,ne,te;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(O=null==i?void 0:i.data,L=(null==O?void 0:O.contentType)||"video",P=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(d=u.appcmsMain)||void 0===d?void 0:d.adsConfig)||{},D=!(null==O||null===(c=O[L])||void 0===c||!c.isSSAIEnabled),C=D&&"MEDIA_TAILOR"==(null==P?void 0:P.vodAdSticherProvider),N=D&&"TRANSMIT"==(null==P?void 0:P.liveAdSticherProvider)&&!(null==P||!P.liveAdClientSideTracking),R=!(null==O||null===(y=O[L])||void 0===y||null===(I=y.streamingInfo)||void 0===I||!I.isLiveStream)||"linearchannel"===L,Pe(i.data),(j=(null==O||null===(b=O.ads)||void 0===b||null===(T=b.preRoll)||void 0===T||null===(E=T.adTags)||void 0===E||null===(_=E.web)||void 0===_?void 0:_.active)&&(null==O||null===(w=O.ads)||void 0===w||null===(S=w.preRoll)||void 0===S||null===(k=S.adTags)||void 0===k||null===(A=k.web)||void 0===A?void 0:A.url))&&dn(r,j,O),F=Je(O,r),!C){n.next=17;break}return n.next=14,Pt(r,O);case 14:F=n.sent,n.next=22;break;case 17:if(!N||!R){n.next=22;break}return Hr(),n.next=21,Ur(F,O,r);case 21:F=n.sent;case 22:if(!F){n.next=40;break}if(z=(null==O||null===(V=O.video)||void 0===V||null===(M=V.gist)||void 0===M?void 0:M.videoImageUrl)||(null==O||null===(U=O.video)||void 0===U||null===(x=U.gist)||void 0===x||null===(W=x.imageGist)||void 0===W?void 0:W.r16x9),K=a(r)){n.next=28;break}return console.error("[VL][player-core] player not found for id=".concat(r),{player:K}),n.abrupt("return",o({status:!1,msg:"Player not found",response:{}}));case 28:K.poster(z),it(r,{content:O,analyticsCb:null==v?void 0:v.analyticsCb,analyticsEventParams:null==v?void 0:v.analyticsEventParams,userId:null==v?void 0:v.userId}),null!=v&&v.disableControls||(X=!(null==O||null===(Q=O[L])||void 0===Q||null===($=Q.liveDetails)||void 0===$||!$.isDvrEnabled),Bi(r,{config:v,content:O,liveVideo:R,isDvrEnabled:X})),ro(r,F),N&&R?Gr(r,{customData:window.customData||{ads:P}}):C&&Vt(r,g),K.on("loadstart",(function(){R&&e({status:!0,msg:"Video Loaded",response:O})})),K.on("loadeddata",(function(){sn(),e({status:!0,msg:"Video Loaded",response:O})})),K.one("play",(function(){!f||C||N&&R||h<95&&ti(K,f)})),K.one("error",(function(){var e;o({status:!1,msg:(null==K||null===(e=K.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==O||null===(B=O.video)||void 0===B||null===(G=B.contentDetails)||void 0===G||null===(H=G.closedCaptions)||void 0===H?void 0:H.length)>0||(null==O||null===(Y=O.video)||void 0===Y||null===(q=Y.closedCaptions)||void 0===q?void 0:q.length)>0?(te=(null==O||null===(Z=O.video)||void 0===Z||null===(ee=Z.contentDetails)||void 0===ee?void 0:ee.closedCaptions)||(null==O||null===(ne=O.video)||void 0===ne?void 0:ne.closedCaptions),J=te.filter((function(e){return"VTT"===e.format})),m(r,J)):p(r),n.next=42;break;case 40:ln(r,"Incompatible Source, only hls,mp4,drm content is allowed"),o("Incompatible Source, only hls,mp4,drm content is allowed");case 42:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){io(e,r,o,i)}))})));case 12:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}(),eo=function(e,n,t){var r=a(e);return r.src(n),new Promise((function(e,n){var i=0;r.one("loadedmetadata",(function(){clearTimeout(i),e({status:!0,msg:"video loaded"})})),r.one("loadstart",(function(e){i=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},no=function(e){Hr();var n=a(e),t=(_t.get()||{}).destroyComscoreTag;if(to(),t&&t(),s(),window.onresize=null,n)n.dispose();else{var r=document.getElementById(e);r&&r.remove()}tt(e)},to=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},ro=function(e,n){console.log("load video in core",n);var t=a(e);t&&t.src(n)},io=function(n,t,r,i){var o,a,l,s,u,d,c=null==n||null===(o=n.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);$i(t)&&ln(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[c])||"".concat(v)),r&&r(function(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Yi(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},oo=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var r=n.getElementsByClassName("vjs-big-play-button")[0];r&&(r.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{Oe as $,Pt as A,B,ie as C,G as D,Y as E,q as F,z as G,U as H,Te as I,ni as J,Se as K,io as L,V as M,Ee as N,_e as O,xe as P,Ue as Q,Ce as R,eo as S,Ki as T,qi as U,zi as V,Qi as W,$i as X,Zi as Y,Ji as Z,no as _,Be as a,It as a0,at as a1,Hi as a2,x as a3,Ae as a4,M as a5,R as a6,C as a7,an as a8,Ft as a9,lt as aa,Re as ab,Xi as ac,je as ad,Gr as ae,qt as af,Vt as ag,ke as ah,Ve as ai,Me as aj,Ne as b,_t as c,We as d,De as e,oi as f,W as g,si as h,Je as i,wt as j,sn as k,ro as l,$r as m,Xr as n,ln as o,ti as p,Fe as q,oo as r,Pe as s,Lt as t,Ur as u,Le as v,it as w,dn as x,Wi as y,rn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/get";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{p as a}from"./skin-2a3ee818.js";import{g as u}from"./localisation-0bf399a1.js";import{t as s,
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/get";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{p as a}from"./skin-2a3ee818.js";import{g as u}from"./localisation-0bf399a1.js";import{t as s,a as c}from"./playerControlEvents-26580023.js";import{V as v}from"./icons-f9c8be77.js";import{i as p}from"./browser-02f174cf.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}var f=n.getComponent("Button"),d=function(){o(b,f);var n,d,h=(n=b,d=m(),function(){var e,t=l(n);if(d){var r=l(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return i(this,e)});function b(t){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(r=h.call(this,t,o)).playerId=o.playerId,r.options_=o,r.initialiseStructure(),r.mountToControlBar(),r}return t(b,[{key:"buildCSSClass",value:function(){return"".concat(function(e,t,o,i){var n=r(l(1&i?e.prototype:e),t,o);return 2&i&&"function"==typeof n?function(e){return n.apply(o,e)}:n}(b,"buildCSSClass",this,3)([])," vjs-vertical-view-button")}},{key:"initialiseStructure",value:function(){var e,t,r,o=this.el();if(o){var i=(null===(e=this.options_)||void 0===e?void 0:e.label)||(null===(t=this.options_)||void 0===t||null===(r=t.ui)||void 0===r?void 0:r.verticalViewLabel)||u("verticalViewText")||"Watch in Vertical View";o.setAttribute("role","button"),o.setAttribute("aria-label",i),o.setAttribute("title",i);var l=document.createElement("span");l.className="vjs-vertical-view-icon";var n=a(v(window.controlsColor||"white"));if(n&&l.appendChild(n),o.appendChild(l),!p()){var s=document.createElement("span");s.className="vjs-vertical-view-text",s.textContent=i,o.appendChild(s)}}}},{key:"mountToControlBar",value:function(){var e,t,r,o=this;if(!0===(null===(e=this.options_)||void 0===e||null===(t=e.ui)||void 0===t?void 0:t.showVerticalViewButton)){var i=this.player_;if(i){var l=function(){var e,t,r,l,n,a,u,s=o.el();if(s){var c=(null===(e=i.controlBar)||void 0===e||null===(t=e.el)||void 0===t?void 0:t.call(e))||(null===(r=i.getChild)||void 0===r||null===(l=r.call(i,"controlBar"))||void 0===l||null===(n=l.el)||void 0===n?void 0:n.call(l))||(null===(a=i.el())||void 0===a||null===(u=a.querySelector)||void 0===u?void 0:u.call(a,".vjs-control-bar"));if(c){c.querySelectorAll(".vjs-vertical-view-button").forEach((function(e){e!==s&&e.remove()}));var v=c.querySelector(".vjs-picture-in-picture-control")||c.querySelector(".vjs-quality-menu-wrapper")||c.querySelector(".vjs-quality-menu-button")||c.querySelector(".settings-selection")||c.querySelector(".vjs-resolution-button")||c.querySelector(".vjs-fullscreen-control");v?s.nextSibling!==v&&c.insertBefore(s,v):s.parentElement!==c&&c.appendChild(s)}}};i.ready&&i.ready(l),null===(r=i.on)||void 0===r||r.call(i,"loadeddata",l),"function"==typeof queueMicrotask&&queueMicrotask(l),setTimeout(l,0)}}else this.hide()}},{key:"handleClick",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player_;t.trigger("watch-in-vertical-view"),s(t,c.WATCH_IN_VERTICAL_VIEW)}}]),b}();export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"@babel/runtime/helpers/classCallCheck";import e from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/get";import r from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";function o(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}var l=function(){return!!window.WebKitPlaybackTargetAvailabilityEvent},u=t,c=e,s=n,b=r,d=a,f=i;function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}var p=l,h=l;function v(t){var e=t.el().querySelector("video, audio");e&&e.webkitShowPlaybackTargetPicker&&e.webkitShowPlaybackTargetPicker()}function g(t,e){t.controlBar&&h()&&(function(t){t.on("airPlayRequested",v.bind(null,t))}(t),function(t,e){var n,r=function(t){return t.controlBar.getChild("airPlayButton")}(t);e.addButtonToControlBar&&!r&&(n=t.controlBar.children().length,void 0!==e.buttonPositionIndex&&(n=e.buttonPositionIndex>=0?e.buttonPositionIndex:t.controlBar.children().length+e.buttonPositionIndex),t.controlBar.addChild("airPlayButton",e,n))}(t,e))}var m=function(t){var e=function(t){b(a,t);var e,n,r=(e=a,n=y(),function(){var t,r=f(e);if(n){var a=f(this).constructor;t=Reflect.construct(r,arguments,a)}else t=r.apply(this,arguments);return d(this,t)});function a(t,e){var n;return u(this,a),n=r.call(this,t,e),p()||n.hide(),n._reactToAirPlayAvailableEvents(),e.addAirPlayLabelToButton?(n.el().classList.add("vjs-airplay-button-lg"),n._labelEl=document.createElement("span"),n._labelEl.classList.add("vjs-airplay-button-label"),n._labelEl.textContent=n.localize("AirPlay"),n.el().appendChild(n._labelEl)):n.controlText("Start AirPlay"),n}return c(a,[{key:"buildCSSClass",value:function(){return"vjs-airplay-button "+function(t,e,n,r){var a=s(f(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof a?function(t){return a.apply(n,t)}:a}(a,"buildCSSClass",this,3)([])}},{key:"handleClick",value:function(){this.player().trigger("airPlayRequested")}},{key:"_getMediaEl",value:function(){return this.player().el().querySelector("video, audio")}},{key:"_reactToAirPlayAvailableEvents",value:function(){var t=this._getMediaEl(),e=this;function n(t){"available"===t.availability?e.show():e.hide()}t&&p()&&(t.addEventListener("webkitplaybacktargetavailabilitychanged",n),this.on("dispose",(function(){t.removeEventListener("webkitplaybacktargetavailabilitychanged",n)})))}}]),a}(t.getComponent("Button"));t.registerComponent("airPlayButton",e)},P=function(t){t.registerPlugin("airPlay",(function(t){var e=Object.assign({addButtonToControlBar:!0},t||{});this.ready(g.bind(this,this,e))}))},k=function(t){t=t||window.videojs,m(t),P(t)},C=o({__proto__:null,default:k},[k]);export{C as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,d as n}from"./skin-2a3ee818.js";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,d as n}from"./skin-2a3ee818.js";import{ab as a,b as i}from"./generic-6871d7d1.js";import{s as l}from"./autoNextVideo-c9d22cb4.js";import{r as o}from"./relatedVideosManager-93533a90.js";import r from"@babel/runtime/helpers/typeof";import d from"video.js";var s,u,c,m,p=[],v=!1,f=null,h=!1,g=null,x=null,y=null,C=null,E=null,b=function(){null!=f&&(clearInterval(f),f=null),h=!1},N="next-ep-preview-player-thumb",w=function(e,t){if(e){var n,a,i,l,o;(null==(n=t)||null===(a=n.gist)||void 0===a||null===(i=a.imageGist)||void 0===i?void 0:i.r16x9)||(null==n?void 0:n.img)||null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o||o.fallbackImage;var r=e.getElementsByClassName(N)[0];r||((r=document.createElement("div")).className=N,r.setAttribute("aria-hidden","true"),e.appendChild(r))}},A=function(e,t){if(e){var n=e.getElementsByClassName(N)[0];n&&(n.style.visibility=t?"visible":"hidden")}},L=function(){var e=document.createElement("div");e.className="next-heading-wrapper";var t=document.createElement("div");t.className="next-ep-header";var n=document.createElement("span");n.className="next-ep-header-text",n.textContent="Next up in";var a=document.createElement("span");return a.className="next-ep-duration",a.textContent="10",t.append(n,a),e.append(t),e},B=function(e,t,a,i){var l,o,r,d,s,u=null==e?void 0:e.isSport,c=(null==e?void 0:e.title)||"",m=(null==e||null===(l=e.gist)||void 0===l?void 0:l.description)||(null==e?void 0:e.description)||"",p=null==e?void 0:e.publishDate,f=document.createElement("div");f.className="next-ep-content";var h=document.createElement("div");h.className="next-ep-thumb-wrap";var g=document.createElement("img");g.className="next-ep-img",g.alt="",g.src=(null==e||null===(o=e.gist)||void 0===o||null===(r=o.imageGist)||void 0===r?void 0:r.r16x9)||(null==e?void 0:e.img)||(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s?void 0:s.fallbackImage);var x=function(e){if(null==e||Number.isNaN(Number(e)))return"";var t=Math.floor(Number(e)),n=Math.floor(t/60),a=t%60;return"".concat(n,":").concat(String(a).padStart(2,"0"))}(null==e?void 0:e.runtime),y=document.createElement("div");y.className="next-ep-thumb-runtime",y.textContent=x,x||y.classList.add("next-ep-thumb-runtime--empty"),h.appendChild(g),h.appendChild(y);var C=document.createElement("div");C.className="next-ep-meta";var E=document.createElement("div");E.className="next-ep-title",E.textContent="".concat(c||"");var N=document.createElement("div");N.className="next-ep-desc",N.textContent=m||"",String(m||"").trim()||N.classList.add("next-ep-desc--empty");var w=document.createElement("div");w.className="next-ep-meta-row";var A=document.createElement("span");A.className="next-ep-badge";var L=function(e){if(null==e?void 0:e.isClip)return"CLIP"}(e);A.textContent=L,L||A.classList.add("next-ep-badge--empty");var B=document.createElement("span");B.className="next-ep-episode",B.textContent=u?p:function(e){if(!e||"string"!=typeof e)return"";var t=e.match(/^S(\d+)\s*E(\d+)$/i)||e.match(/^S(\d+)E(\d+)$/i);return t?"S".concat(t[1]," E").concat(Number(t[2])):e}(null==e?void 0:e.episodeDisplayAttribute)||"";var S=document.createElement("div");S.className="next-ep-meta-row-left",S.appendChild(A),S.appendChild(B);var k=document.createElement("img");k.className="next-ep-network-logo",k.alt="";var j=function(e){var t,n,a;if(e){var i=null===(t=window)||void 0===t||null===(n=t.app_data)||void 0===n||null===(a=n.appcmsMain)||void 0===a?void 0:a.networks;if(e&&i){var l=null==i?void 0:i.find((function(t){if(t.identifier==e)return t}));return null==l?void 0:l.badgeImage}}}(null==e?void 0:e.network);j?k.src=j:k.classList.add("next-ep-network-logo--empty"),w.appendChild(S),C.appendChild(E),C.appendChild(N),C.appendChild(w);var P=document.createElement("div");return P.className="next-ep-meta-with-logo",P.appendChild(C),P.appendChild(k),f.appendChild(h),f.appendChild(P),f.onclick=n((function(){b(),null==t||t.remove(),v=!0,I(a)}),400),f},S=function n(l,r){var d;if(v=!1,C=l,E=r,y&&(y(),y=null),null!=r&&null!==(d=r.series)&&void 0!==d&&d.enable){var s;p=[];var u=i();null==u||u.map((function(t){var n;return(n=p).push.apply(n,e(t.episodes))})),null==r||null===(s=r.series)||void 0===s||s.cb}else{var c=o.get();p=(null==c?void 0:c.content)||[],null==c||c.cb,y=o.subscribe((function(){y&&(y(),y=null),C&&E&&n(C,E)}))}var m=t(l);if(m){!function(e){e&&x&&(e.off("timeupdate",x),x=null)}(t(g)),b(),g=l,x=function(){var e,t;if(!v){var n=m.duration(),i=m.currentTime(),o=Number.isFinite(n)&&n>0?n-i:1/0,r=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0],d=document.getElementById(l),s=a()<=(null===(t=p)||void 0===t?void 0:t.length)-1;if(o>1){if(null!=f||h){b();var u=null==r?void 0:r.querySelector(".next-ep-header .next-ep-duration");u&&(u.textContent="10")}return r&&(r.style.visibility="hidden"),void A(d,!1)}s?(r&&(r.style.visibility="visible"),A(d,!0),h||null!=f||(m.pause(l),h=!0,function(e){var t;if(null==f){var n=null===(t=document.getElementsByClassName("next-ep-preview"))||void 0===t?void 0:t[0],i=null==n?void 0:n.querySelector(".next-ep-header .next-ep-duration");if(i){var l=10;i.textContent="10",f=setInterval((function(){l--,i.textContent=String(l),0===l&&(clearInterval(f),f=null,h=!1,p.filter((function(e,t){return t==a()})),I(e))}),1e3)}}}(l))):A(d,!1)}},m.on("timeupdate",x);var N,S=p.filter((function(e,t){return t==a()}));if((null==S?void 0:S.length)>0)if(null!==(N=document.getElementsByClassName("next-ep-preview"))&&void 0!==N&&N[0]){var k,j,P=null===(k=document.getElementsByClassName("next-ep-preview"))||void 0===k?void 0:k[0];P.style.visibility="hidden",null===(j=P.querySelector(".next-ep-preview-inner"))||void 0===j||j.remove(),Array.from(P.children).forEach((function(e){e.classList.contains("next-ep-content")&&e.remove()}));var M=P.querySelector(".next-heading-wrapper");if(M){var O=M.querySelector(".next-ep-header"),q=null==O?void 0:O.querySelector(".next-ep-duration");if(!q&&O){O.textContent="";var F=document.createElement("span");F.className="next-ep-header-text",F.textContent="Next up in",(q=document.createElement("span")).className="next-ep-duration",q.textContent="10",O.append(F,q)}else q&&(q.textContent="10")}else M=L(),P.insertBefore(M,P.firstChild);P.appendChild(B(S[0],P,l));var D=document.getElementById(l);w(D,S[0]),A(D,!1)}else{var T=document.createElement("div");T.className="next-ep-preview",T.style.visibility="hidden";var X=document.getElementById(l);X.append(T);var R=L();T.append(R);var G=B(S[0],T,l);T.append(G),w(X,S[0]),A(X,!1)}}},I=function(e,n){var i=t(e);if(i){var o=i.duration();if(Number.isFinite(o)&&!(o<=0)){i.pause(e);var r=a();l(r,e,p)}}};function k(e,n){var a=t(e),i=null==n?void 0:n.tvProviderLogoUrl,l=null==n?void 0:n.tvProviderName;if(i){var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(i),r.alt="connected to ".concat(l)||"Provider Name",o.append(r),a.el().appendChild(o),a.on("useractive",(function(){o.classList.remove("vjs-fade")})),a.on("userinactive",(function(){a.paused()||o.classList.add("vjs-fade")})),a.on("fullscreenchange",(function(){a.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}s={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,a,i,l;for(a in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[a])i.hasOwnProperty(l)&&("object"===r(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},c=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},m=function e(t){return"HTML"!==t.nodeName&&"static"===c(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",(function(e){var t,n,a,i,l,o,r,d;function p(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",p),d()}n=u({},s,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),t.appendChild(a),a.src=n[0].src,a.className="vjs-thumbnail",u(a.style,n[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",(function(e){o=i.duration()})),i.on("loadedmetadata",(function(e){o=i.duration()})),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,d,s,p,v,f,h,g,x;for(r in d=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=m(l.el()).getBoundingClientRect()).width||x.right)+g,v=e.pageX,e.changedTouches&&(v=e.changedTouches[0].pageX),s=v||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=m(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>r&&(d=Math.max(d,r));(p=n[d]).src&&a.src!=p.src&&(a.src=p.src),p.style&&a.style!=p.style&&u(a.style,p.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=c(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(a,p.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",(function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",p)})),d=function(e){t.style.left="-1000px"},l.on("mouseout",d),l.on("touchcancel",d),l.on("touchend",d),i.on("userinactive",d)}));export{S as a,k as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-3addf20e.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{t as r,g as n}from"./skin-2a3ee818.js";import i from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/slicedToArray";import{e as u}from"./generic-6871d7d1.js";function o(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l="my-player";function c(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 p(){return(p=e(t.mark((function e(r){var n,i,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,k,w,E,j,N,A,T;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 i=e.sent,e.next=11,createImageBitmap(i);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=a(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=a(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===(A=N.appcmsMain)||void 0===A||null===(T=A.images)||void 0===T?void 0:T.placeholderCover,duration:r.duration});return e.abrupt("return",w);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark((function e(r,n){var i,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=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",c(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,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=n(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=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()),r),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then((function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri})))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark((function e(n){var u,o,l,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u={},n.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),n=a(r,2),o=n[0]*n[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);u[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},i(p,"left","-60px"),i(p,"border","1px solid transparent"),i(p,"borderRadius","4px"),p)})}})),o=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((function(e){return f(e,u,o)}),500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",r((function(e){return f(e,u,o)}),500))})),e.abrupt("return",u);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var v=function(){var r=e(t.mark((function e(r,n){var i,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 i=e.sent,e.next=5,i.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=a(t,2),n=r[0],i=r[1];n&&i&&(l[n.trim().toLowerCase()]=i.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 h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark((function e(r,i){var o,s,c,p,d,m,f,b,g,v,x,y,w,E,j,N,A,T,O,I,S,M,P,R,$,B,L,D,U,C,X,q,_,F,W,z,G,K,H,J,Q,V,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=i,o=n(i),s=r.split("/"),c=s.findIndex((function(e){return"dash"===e.toLowerCase()})),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(r).origin),e.prev=5,e.next=8,fetch(r);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=u())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),w=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.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(T=N.getElementsByTagName("SegmentTemplate")[0],O=null===(A=T.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!T||!O){e.next=48;break}if(M=O.getElementsByTagName("S"),P=parseInt(null===(I=M[0])||void 0===I?void 0:I.getAttribute("t")),R=parseInt(null===(S=M[0])||void 0===S?void 0:S.getAttribute("d")),$=N.getElementsByTagName("Representation")[0],B=$.getElementsByTagName("EssentialProperty")[0],L=B.getAttribute("value"),D=null==L?void 0:L.split("x"),U=a(D,2),C=U[0],X=U[1],!T){e.next=46;break}if(T.getAttribute("media"),q=T.getAttribute("timescale"),_=(q?R/q:R)/(C*X),F=$.getAttribute("id"),W=Math.round(y/_),z=Math.ceil(W/(C*X)),G=T.getAttribute("media"),parseInt(T.getAttribute("startNumber")),!isNaN(parseInt(z))){e.next=43;break}return e.abrupt("return");case 43:for(K=[],j=0;j<z;j++)J="/"==(H=G)[0]?new URL(p).origin:p+"/",K.push({duration:_,layout:L,uri:J+H.replace("$Time$",P+j*R).replace("$RepresentationID$",F)});return e.abrupt("return",K);case 46:e.next=69;break;case 48:if(Q=N.getElementsByTagName("Representation")[0],V=Q.getElementsByTagName("EssentialProperty")[0],Y=V.getAttribute("value"),Z=null==Y?void 0:Y.split("x"),ee=a(Z,2),te=ee[0],re=ee[1],!T){e.next=69;break}if(T.getAttribute("media"),ne=T.getAttribute("duration"),ie=T.getAttribute("timescale"),ae=(ie?ne/ie:ne)/(te*re),ue=Q.getAttribute("id"),oe=Math.round(y/ae),se=Math.ceil(oe/(te*re)),le=T.getAttribute("media"),ce=parseInt(T.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++)me=de?k(de,j+ce):le,pe.push({duration:ae,layout:Y,uri:w+me.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 k(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 w(e){return E.apply(this,arguments)}function E(){return(E=e(t.mark((function e(r){var i,a,u,o,s,l,c,p,m,f,g,h,y,k,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r),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,d(c,r);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,f=m.uri,g=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,v(g,f);case 12:return h=e.sent,e.next=15,b(h);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,x(c,r);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,b(k);case 26:w=e.sent,s.thumbnails(w);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}export{w as i};
|