@clickview/lite 0.32.0 → 0.32.1
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/dist/bundles.json +1 -1
- package/dist/languages/en.json +1 -1
- package/dist/scripts/1366-c65306205c-lite.chunk.js +2 -0
- package/dist/scripts/{1517-448f9bae26-lite.chunk.js → 1517-4c765cf6b6-lite.chunk.js} +1 -1
- package/dist/scripts/{162-7569985bf0-lite.chunk.js → 162-64b366f2d0-lite.chunk.js} +2 -2
- package/dist/scripts/1794-196bab58b7-lite.chunk.js +1 -0
- package/dist/scripts/1913-121ddb03c7-lite.chunk.js +1 -0
- package/dist/scripts/2208-8cca4d3922-lite.chunk.js +1 -0
- package/dist/scripts/{2318-43fc5f8fde-lite.chunk.js → 2318-f20f53577b-lite.chunk.js} +1 -1
- package/dist/scripts/2477-0c1cc0274e-lite.chunk.js +1 -0
- package/dist/scripts/275-48e39524cd-lite.chunk.js +1 -0
- package/dist/scripts/{383-81d5b0f3da-lite.chunk.js → 383-867d273f61-lite.chunk.js} +1 -1
- package/dist/scripts/3962-6b13cdecc3-lite.chunk.js +1 -0
- package/dist/scripts/4290-9275108346-lite.chunk.js +1 -0
- package/dist/scripts/{4617-543181732e-lite.chunk.js → 4617-9f75859a94-lite.chunk.js} +1 -1
- package/dist/scripts/4657-5482d930f8-lite.chunk.js +2 -0
- package/dist/scripts/528-c80dafea15-lite.chunk.js +1 -0
- package/dist/scripts/{6801-fb5064f563-lite.chunk.js → 6801-d3cf047fb8-lite.chunk.js} +1 -1
- package/dist/scripts/7052-b5ffd3e5ae-lite.chunk.js +2 -0
- package/dist/scripts/7056-1278a992e8-lite.chunk.js +1 -0
- package/dist/scripts/7112-72e5351e87-lite.chunk.js +2 -0
- package/dist/scripts/7318-c329ca7c0d-lite.chunk.js +1 -1
- package/dist/scripts/7950-057729fd3f-lite.chunk.js +2 -0
- package/dist/scripts/8516-401b97bede-lite.chunk.js +1 -0
- package/dist/scripts/8905-76145a06df-lite.chunk.js +1 -0
- package/dist/scripts/9118-936a46d5aa-lite.chunk.js +1 -0
- package/dist/scripts/{9151-8b26396391-lite.chunk.js → 9151-d8f10661a1-lite.chunk.js} +1 -1
- package/dist/scripts/9194-c255b66c7c-lite.chunk.js +2 -0
- package/dist/scripts/bundle-fe6d2f5050.min.js +2 -0
- package/jest.config.js +11 -11
- package/package.json +61 -61
- package/typings/libs/CVEvents.d.ts +12 -12
- package/typings/libs/CVLanguages.d.ts +24 -24
- package/typings/libs/backbone.validation.d.ts +99 -99
- package/typings/libs/cloneDeep.d.ts +4 -4
- package/typings/libs/cookiesjs.d.ts +25 -25
- package/typings/libs/draft-convert.d.ts +3 -3
- package/typings/libs/google-api.d.ts +93 -93
- package/typings/libs/intersection-observer.d.ts +82 -82
- package/typings/libs/microsoft-teams.d.ts +2 -2
- package/typings/libs/react-table-config.d.ts +138 -138
- package/typings/libs/trackjs.d.ts +2 -2
- package/typings/libs/videojs-contrib-quality-levels.d.ts +28 -28
- package/typings/utils/imports.d.ts +13 -13
- package/dist/scripts/1366-f2333e9855-lite.chunk.js +0 -2
- package/dist/scripts/1794-e84731e75e-lite.chunk.js +0 -1
- package/dist/scripts/1913-8f9af95784-lite.chunk.js +0 -1
- package/dist/scripts/2208-356e60f7ed-lite.chunk.js +0 -1
- package/dist/scripts/2477-1ca7a26273-lite.chunk.js +0 -1
- package/dist/scripts/275-d32bdaf3c4-lite.chunk.js +0 -1
- package/dist/scripts/3962-f2dff30617-lite.chunk.js +0 -1
- package/dist/scripts/4290-50b30979bb-lite.chunk.js +0 -1
- package/dist/scripts/528-cc94d0b7ce-lite.chunk.js +0 -1
- package/dist/scripts/7052-6e758d823a-lite.chunk.js +0 -2
- package/dist/scripts/7056-e916d8c1d5-lite.chunk.js +0 -1
- package/dist/scripts/7112-09720be50b-lite.chunk.js +0 -2
- package/dist/scripts/7950-4a82e3281f-lite.chunk.js +0 -2
- package/dist/scripts/8516-ce00b83316-lite.chunk.js +0 -1
- package/dist/scripts/8905-ea152b10f8-lite.chunk.js +0 -1
- package/dist/scripts/9118-1603bf2a31-lite.chunk.js +0 -1
- package/dist/scripts/9194-039e6b2075-lite.chunk.js +0 -2
- package/dist/scripts/9701-70a5dbb349-lite.chunk.js +0 -2
- package/dist/scripts/bundle-af88380c2c.min.js +0 -2
- /package/dist/scripts/{1366-f2333e9855-lite.chunk.js.LICENSE.txt → 1366-c65306205c-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{162-7569985bf0-lite.chunk.js.LICENSE.txt → 162-64b366f2d0-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{2452-446607a894-lite.chunk.js → 2452-f96e548d17-lite.chunk.js} +0 -0
- /package/dist/scripts/{7052-6e758d823a-lite.chunk.js.LICENSE.txt → 4657-5482d930f8-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{7112-09720be50b-lite.chunk.js.LICENSE.txt → 7052-b5ffd3e5ae-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{7950-4a82e3281f-lite.chunk.js.LICENSE.txt → 7112-72e5351e87-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{9194-039e6b2075-lite.chunk.js.LICENSE.txt → 7950-057729fd3f-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{9701-70a5dbb349-lite.chunk.js.LICENSE.txt → 9194-c255b66c7c-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{bundle-af88380c2c.min.js.LICENSE.txt → bundle-fe6d2f5050.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7950-057729fd3f-lite.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[7950],{49935:(e,t,n)=>{n.d(t,{Oo:()=>m,b2:()=>d});var r=n(1024),a=n(36848),i=n(86764),o=n(3747),c=n(5859),l=n(58130),s=n(83914),u=function(e){var t=e.breadcrumb,n=t.name,i=t.appLink,o=t.active,c=e.withBackIcon;return r.createElement("li",{className:"breadcrumb-item".concat(o?" active":"")},o?r.createElement("strong",null,n):r.createElement(a.F,{appLink:i},c&&r.createElement(s.x,{svgName:l.vn.ChevronLeft,size:s.S.Small}),r.createElement("span",{className:c?"ml-2":""},n)))},m=function(e){var t=e.breadcrumbs,n=(0,o.a)(i.r.XS),a=null==t?void 0:t.length;return!a||n&&a<2?r.createElement(r.Fragment,null):n?r.createElement("nav",{"aria-label":"breadcrumb"},r.createElement("ol",{className:"breadcrumb m-0 p-0"},r.createElement(u,{breadcrumb:t[a-2],withBackIcon:!0}))):r.createElement("nav",{"aria-label":"breadcrumb"},r.createElement("ol",{className:"breadcrumb m-0 p-0"},t.map((function(e,t){return r.createElement(u,{key:t,breadcrumb:e})}))))},d=r.memo((function(e){var t=e.numItems,n=void 0===t?3:t;return(0,o.a)(i.r.XS)?r.createElement("div",{className:"partial-loading-background",style:{height:"1.3125rem",width:"6rem"}}):r.createElement("nav",{"aria-label":"breadcrumb"},r.createElement("ol",{className:"breadcrumb m-0 p-0"},c.u.getPartialLoadingItems({numItems:n}).map((function(e,t){var n=e.width;return r.createElement("li",{key:t,className:"breadcrumb-item"},r.createElement("span",{className:"d-inline-block partial-loading-background",style:{width:n},dangerouslySetInnerHTML:{__html:" "}}))}))))}))},38502:(e,t,n)=>{n.d(t,{r:()=>u});var r=n(1024),a=n.n(r),i=n(49985),o=n(36848),c=n(76246),l=n(11607),s=n(87432);function u(e){var t;return a().createElement("nav",{className:null!==(t=e.className)&&void 0!==t?t:""},a().createElement("ul",{className:"list-unstyled d-inline-block m-0 ".concat(s.Z.pillTabSelector)},e.tabs.map((function(e){return a().createElement("li",{className:"p-0 ".concat(e.active?"btn btn-dark":"btn btn-outline-dark"),key:e.name},e.appLink?a().createElement(o.F,{appLink:e.appLink,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,className:"cursor-pointer d-flex justify-content-center text-decoration-none text-reset px-2 ".concat(s.Z.pillItem)},e.name,"number"==typeof e.count&&a().createElement("div",{className:"pl-2"},a().createElement(c.C,{type:c.g.Count,data:e.count}))):a().createElement(l.L,{className:"".concat(s.Z.pillItem," d-flex justify-content-center p-2"),onClick:function(){return function(e){!e.active&&e.onSelect&&(e.onSelect(),e.analyticsData&&e.analyticsOptions&&i.k.logUserAction(e.analyticsData,e.analyticsOptions))}(e)}},e.name,"number"==typeof e.count&&a().createElement("div",{className:"pl-2"},a().createElement(c.C,{type:c.g.Count,data:e.count}))))}))))}},99705:(e,t,n)=>{var r,a;n.d(t,{b:()=>a}),function(e){e.AddToPlaylist="115005679748",e.EditSsoAccounts="8202508040345",e.LibraryEditor="360001974533",e.VideoAccess="360000153947",e.AddFromOnline="360011718234",e.UploadToLibraryEditor="360012069334",e.PBTErrorCodes="360012421153",e.ManuelReview="360020004534",e.LibraryReview="360000163788"}(r||(r={})),function(e){e.Integrations="4407268725529",e.Classrooms="4405362551833",e.MakeInteractive="4405370510873",e.EditSsoAccounts="8202605666073",e.UploadToLibraryEditor="10672936659865",e.AddFromLite="10671345281561",e.ManageSsoYearGroups="12522160412313",e.ContentReview="18525199576601",e.ContentPermissions="14692125209497",e.AccessSettings="22110291468057",e.ContentGuidelines="24133696186009",e.FoxtelFaq="24133519542169"}(a||(a={}))},5859:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{u:()=>i});var a={numItems:5,minWidth:50,maxWidth:100},i={getPartialLoadingItems:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign(Object.assign({},a),t);return(e=Array(n.numItems),function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(){return{width:"".concat(Math.max(Math.floor(Math.random()*n.maxWidth),n.minWidth),"px")}}))}}},23224:(e,t,n)=>{n.d(t,{j:()=>p});var r=n(1024),a=n.n(r),i=n(39202),o=n(23481),c=n(65858),l=n(38502),s=n(14070),u=n(97291),m="settings.restrictedVideosTabs",d=o.T.encloseNamespace(m),f={restrictedVideos:{application:u.O.SETTINGS,action:s.e.Settings.VIDEO_RESTRICTIONS},contentReview:{application:u.O.SETTINGS,action:s.e.Settings.CONTENT_REVIEW},contentReviewSettings:{application:u.O.SETTINGS,action:s.e.Settings.CONTENT_REVIEW_SETTINGS}};function p(e){return a().createElement("div",{className:"mb-3"},a().createElement(l.r,{tabs:[{name:d("restrictedVideos"),appLink:f.restrictedVideos,active:"restricted-videos"===e.active,analyticsData:{name:d("restrictedVideos"),url:i.C$.getHref(f.restrictedVideos)},analyticsOptions:{actionType:c.Vw.Click,entity:c.py.Url,location:c.LZ.MagicTabs}},{name:d("contentReview"),appLink:f.contentReview,active:"content-review"===e.active,analyticsData:{name:o.T.getPhrase(m,"contentReview"),url:i.C$.getHref(f.contentReview)},analyticsOptions:{actionType:c.Vw.Click,entity:c.py.Url,location:c.LZ.MagicTabs}},{name:d("contentReviewSettings"),appLink:f.contentReviewSettings,active:"content-review-settings"===e.active,analyticsData:{name:o.T.getPhrase(m,"contentReviewSettings"),url:i.C$.getHref(f.contentReviewSettings)},analyticsOptions:{actionType:c.Vw.Click,entity:c.py.Url,location:c.LZ.MagicTabs}}]}))}},81803:(e,t,n)=>{n.d(t,{d:()=>v});var r=n(1024),a=n.n(r),i=n(81886),o=n(23481),c=n(49935),l=n(22902),s=n(14070),u=n(97291),m=n(96368);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f="settings.settingsLayout",p=function(e){var t=(0,l.T)().hasPermissions,n=(0,m.e)();if(e)return t(e);var r=i.Q.C$.getCurrentAppLink();return r.application!==u.O.SETTINGS||n.some((function(e){return e.modules.some((function(e){return"appLink"in e&&e.appLink.action===r.action}))}))};function v(e){var t=p(e.requiredPermissions);if(a().useEffect((function(){t||i.Q.C$.trigger({application:u.O.SETTINGS,action:s.e.Settings.HOME},{replace:!0})}),[t]),!t)return a().createElement(a().Fragment,null);var n,r=e.breadcrumbs.map((function(t,n){return{name:t,appLink:{application:u.O.SETTINGS,action:s.e.Settings.HOME},active:n===e.breadcrumbs.length-1}}));return a().createElement("div",{className:"px-3"},a().createElement("h1",{className:"h2"},e.heading),a().createElement("div",{className:"pb-3"},a().createElement(c.Oo,{breadcrumbs:[{name:o.T.getPhrase(f,"settingsBreadcrumb"),appLink:{application:u.O.SETTINGS,action:s.e.Settings.HOME}}].concat((n=r,function(e){if(Array.isArray(e))return d(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))})),e.description&&a().createElement(a().Fragment,null,a().createElement("p",null,e.description),a().createElement("hr",null)),e.children)}},17749:(e,t,n)=>{n.d(t,{g:()=>a});var r=n(99940),a={getLibraryReviewPeriod:function(){return{url:"{gateway}/v1/library-reviews",key:"coming:soon:settings",normalize:!1}},setLibraryReviewPeriod:function(e){return{url:"{gateway}/v1/library-reviews",key:"update:coming:soon:settings",invalidationKeys:"coming:soon:settings",type:r.k.POST,data:{reviewPeriod:e},normalize:!1}},deleteLibraryReviewPeriod:function(){return{url:"{gateway}/v1/library-reviews",key:"delete:coming:soon:settings",invalidationKeys:"coming:soon:settings",type:r.k.DELETE,normalize:!1}}}},51672:(e,t,n)=>{n.r(t),n.d(t,{ContentReviewSettingsView:()=>V});var r=n(1024),a=n.n(r),i=n(50242),o=n(23481),c=n(81886),l=n(20354),s=n(16714),u=n(69883),m=n(14070),d=n(97291),f=n(23224),p=n(81803),v=n(17749),h=n(2102),y=n(83345),g="settings.contentReviewSettings",b=o.T.encloseNamespace(g),E=[{phrase:"14days",value:14},{phrase:"21days",value:21},{phrase:"30days",value:30}];function w(e){return a().createElement("div",{className:"mb-3 d-flex"},a().createElement("div",null,a().createElement("p",{className:(t="font-weight-bold mb-1",e.isSettingEnabled?t:"".concat(t," text-muted"))},a().createElement(y.x,{namespace:g,phrase:"reviewHeading"})),a().createElement("p",{className:"mb-1 text-muted"},a().createElement(y.x,{namespace:g,phrase:"reviewDescription",options:{days:e.selected}}))),a().createElement("div",{className:"flex-shrink-0 ml-2"},a().createElement("select",{id:"review-days",name:"review-days",autoComplete:"off",className:"form-control",value:e.selected||"",disabled:!e.isSettingEnabled||e.disabled,onChange:function(t){e.onChange(parseInt(t.target.value))}},E.map((function(e,t){return a().createElement("option",{value:e.value,key:t},b(e.phrase))})))));var t}var S=n(98461),N=n(83523),L=n(99705),k=n(12778),T="settings.contentReviewSettings";function O(e){var t=k.o.getLiteArticle(L.b.ContentReview);return a().createElement("div",{className:"row mb-3"},a().createElement("div",{className:"col-10"},a().createElement("p",{className:"font-weight-bold mb-1"},a().createElement(y.x,{namespace:T,phrase:"subHeading"})),a().createElement("p",{className:"mb-1 text-muted"},a().createElement(y.x,{namespace:T,phrase:"description"})),a().createElement("p",{className:"mb-0"},a().createElement(S.d,{href:t,className:"info-link"},a().createElement(y.x,{namespace:T,phrase:"learnMore"})))),a().createElement("div",{className:"col"},a().createElement(N.Z,{on:e.isEnabled,onClick:e.toggleSwitch,disabled:e.disabled,showStateWhenDisabled:!0})))}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,c=[],l=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var A="settings.contentReviewSettings";function C(e){var t=x(a().useState(e.isEnabled),2),n=t[0],r=t[1],i=x(a().useState(e.reviewDays),2),o=i[0],c=i[1],l=e.reviewDays!==o||e.isEnabled!==n;return a().createElement("div",{className:"row"},a().createElement("div",{className:"col col-md-8 col-lg-6"},a().createElement(O,{disabled:e.isLoading,isEnabled:n,toggleSwitch:function(){n||o||c(14),r((function(e){return!e}))}}),a().createElement(w,{disabled:e.isLoading,selected:o,isSettingEnabled:n,onChange:function(e){return c(e)}}),a().createElement(h.m,{onClick:function(){l&&e.handleOnSave(n,o)},showSpinner:e.isLoading,className:"btn btn-dark",disabled:e.isLoading||!l},a().createElement(y.x,{namespace:A,phrase:"saveButton"}))))}const j={oneLine:"BlwYh",twoLine:"xfqid"};function R(){return a().createElement("div",{className:"row no-gutters"},a().createElement("div",{className:"col col-md-7 col-lg-5"},a().createElement("div",{className:"row mb-3"},a().createElement("div",{className:"col-10"},a().createElement("div",{className:"partial-loading-background w-50 mb-1 ".concat(j.oneLine)}),a().createElement("div",{className:"partial-loading-background w-100 mb-1 ".concat(j.twoLine)}),a().createElement("div",{className:"partial-loading-background w-100 ".concat(j.oneLine)})),a().createElement("div",{className:"col"},a().createElement("div",{className:"partial-loading-background w-100 ".concat(j.oneLine)}))),a().createElement("div",{className:"row mb-2"},a().createElement("div",{className:"col-9"},a().createElement("div",{className:"partial-loading-background w-50 mb-1 ".concat(j.oneLine)}),a().createElement("div",{className:"partial-loading-background w-100 mb-1 ".concat(j.twoLine)})),a().createElement("div",{className:"col"},a().createElement("div",{className:"partial-loading-background w-100 ".concat(j.twoLine)}))),a().createElement("div",{className:"partial-loading-background w-25 ".concat(j.twoLine)})))}function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function _(){_=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),c=new A(r||[]);return a(o,"_invoke",{value:T(e,n,c)}),o}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function y(){}function g(){}function b(){}var E={};s(E,o,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(C([])));S&&S!==n&&r.call(S,o)&&(E=S);var N=b.prototype=y.prototype=Object.create(E);function L(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(a,i,o,c){var l=m(e[a],e,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==P(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,o,c)}),(function(e){n("throw",e,o,c)})):t.resolve(u).then((function(e){s.value=e,o(s)}),(function(e){return n("throw",e,o,c)}))}c(l.arg)}var i;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return i=i?i.then(a,a):a()}})}function T(t,n,r){var a=d;return function(i,o){if(a===p)throw new Error("Generator is already running");if(a===v){if("throw"===i)throw o;return{value:e,done:!0}}for(r.method=i,r.arg=o;;){var c=r.delegate;if(c){var l=O(c,r);if(l){if(l===h)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===d)throw a=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=p;var s=m(t,n,r);if("normal"===s.type){if(a=r.done?v:f,s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(a=v,r.method="throw",r.arg=s.arg)}}}function O(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=m(a,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(P(t)+" is not iterable")}return g.prototype=b,a(N,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(N),e},t.awrap=function(e){return{__await:e}},L(k.prototype),s(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,a,i){void 0===i&&(i=Promise);var o=new k(u(e,n,r,a),i);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},L(N),s(N,l,"Generator"),s(N,o,(function(){return this})),s(N,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=C,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return c.type="throw",c.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],c=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(l&&s){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;I(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:C(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var M=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function c(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,c)}l((r=r.apply(e,t||[])).next())}))},F=o.T.encloseNamespace("settings.contentReviewSettings");function V(){var e,t,n,r=l.a.useGetFetchAsync(),o=(0,u.Z)(),h=(t=a().useState(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,c=[],l=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return c}}(t,n)||function(e,t){if(e){if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=h[0],g=h[1],b=l.a.useBasicFetch(v.g.getLibraryReviewPeriod()),E=!(b.hasError||b.statusCode===i.o.NotFound);return a().createElement(p.d,{heading:F("heading"),breadcrumbs:[F("heading")],requiredPermissions:s.C.ManageVideoAccess},a().createElement(f.j,{active:"content-review-settings"}),b.hasCompleted?a().createElement(C,{isLoading:y,isEnabled:E,reviewDays:null===(e=b.data)||void 0===e?void 0:e.reviewPeriod,handleOnSave:function(e,t){return M(this,void 0,void 0,_().mark((function n(){return _().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e){n.next=3;break}return c.Q.C$.trigger({application:d.O.SETTINGS,action:m.e.Settings.TURN_OFF_CONTENT_REVIEW}),n.abrupt("return");case 3:return g(!0),n.prev=4,n.next=7,r(v.g.setLibraryReviewPeriod(t));case 7:o.success(F("success")),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(4),o.error(F("error"));case 13:g(!1);case 14:case"end":return n.stop()}}),n,null,[[4,10]])})))}}):a().createElement(R,null))}},41063:(e,t,n)=>{n.d(t,{b:()=>o});var r=n(16714),a=n(22902),i=n(37802);function o(){var e=(0,a.T)().hasPermissions;return(0,i.r)(null).manageVideoAccess&&e(r.C.ManageVideoAccess)}},87432:(e,t,n)=>{n.d(t,{Z:()=>r});const r={pillTabSelector:"Hdi6o",pillItem:"hUJx1"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[8516],{49935:(e,t,n)=>{n.d(t,{Oo:()=>m,b2:()=>d});var r=n(1024),a=n(36848),i=n(86764),l=n(3747),c=n(5859),o=n(58130),u=n(83914),s=function(e){var t=e.breadcrumb,n=t.name,i=t.appLink,l=t.active,c=e.withBackIcon;return r.createElement("li",{className:"breadcrumb-item".concat(l?" active":"")},l?r.createElement("strong",null,n):r.createElement(a.F,{appLink:i},c&&r.createElement(u.x,{svgName:o.vn.ChevronLeft,size:u.S.Small}),r.createElement("span",{className:c?"ml-2":""},n)))},m=function(e){var t=e.breadcrumbs,n=(0,l.a)(i.r.XS),a=null==t?void 0:t.length;return!a||n&&a<2?r.createElement(r.Fragment,null):n?r.createElement("nav",{"aria-label":"breadcrumb"},r.createElement("ol",{className:"breadcrumb m-0 p-0"},r.createElement(s,{breadcrumb:t[a-2],withBackIcon:!0}))):r.createElement("nav",{"aria-label":"breadcrumb"},r.createElement("ol",{className:"breadcrumb m-0 p-0"},t.map((function(e,t){return r.createElement(s,{key:t,breadcrumb:e})}))))},d=r.memo((function(e){var t=e.numItems,n=void 0===t?3:t;return(0,l.a)(i.r.XS)?r.createElement("div",{className:"partial-loading-background",style:{height:"1.3125rem",width:"6rem"}}):r.createElement("nav",{"aria-label":"breadcrumb"},r.createElement("ol",{className:"breadcrumb m-0 p-0"},c.u.getPartialLoadingItems({numItems:n}).map((function(e,t){var n=e.width;return r.createElement("li",{key:t,className:"breadcrumb-item"},r.createElement("span",{className:"d-inline-block partial-loading-background",style:{width:n},dangerouslySetInnerHTML:{__html:" "}}))}))))}))},99705:(e,t,n)=>{var r,a;n.d(t,{b:()=>a}),function(e){e.AddToPlaylist="115005679748",e.EditSsoAccounts="8202508040345",e.LibraryEditor="360001974533",e.VideoAccess="360000153947",e.AddFromOnline="360011718234",e.UploadToLibraryEditor="360012069334",e.PBTErrorCodes="360012421153",e.ManuelReview="360020004534",e.LibraryReview="360000163788"}(r||(r={})),function(e){e.Integrations="4407268725529",e.Classrooms="4405362551833",e.MakeInteractive="4405370510873",e.EditSsoAccounts="8202605666073",e.UploadToLibraryEditor="10672936659865",e.AddFromLite="10671345281561",e.ManageSsoYearGroups="12522160412313",e.ContentReview="18525199576601",e.ContentPermissions="14692125209497",e.AccessSettings="22110291468057",e.ContentGuidelines="24133696186009",e.FoxtelFaq="24133519542169"}(a||(a={}))},5859:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{u:()=>i});var a={numItems:5,minWidth:50,maxWidth:100},i={getPartialLoadingItems:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign(Object.assign({},a),t);return(e=Array(n.numItems),function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(){return{width:"".concat(Math.max(Math.floor(Math.random()*n.maxWidth),n.minWidth),"px")}}))}}},81803:(e,t,n)=>{n.d(t,{d:()=>g});var r=n(1024),a=n.n(r),i=n(81886),l=n(23481),c=n(49935),o=n(22902),u=n(14070),s=n(97291),m=n(96368);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p="settings.settingsLayout",f=function(e){var t=(0,o.T)().hasPermissions,n=(0,m.e)();if(e)return t(e);var r=i.Q.C$.getCurrentAppLink();return r.application!==s.O.SETTINGS||n.some((function(e){return e.modules.some((function(e){return"appLink"in e&&e.appLink.action===r.action}))}))};function g(e){var t=f(e.requiredPermissions);if(a().useEffect((function(){t||i.Q.C$.trigger({application:s.O.SETTINGS,action:u.e.Settings.HOME},{replace:!0})}),[t]),!t)return a().createElement(a().Fragment,null);var n,r=e.breadcrumbs.map((function(t,n){return{name:t,appLink:{application:s.O.SETTINGS,action:u.e.Settings.HOME},active:n===e.breadcrumbs.length-1}}));return a().createElement("div",{className:"px-3"},a().createElement("h1",{className:"h2"},e.heading),a().createElement("div",{className:"pb-3"},a().createElement(c.Oo,{breadcrumbs:[{name:l.T.getPhrase(p,"settingsBreadcrumb"),appLink:{application:s.O.SETTINGS,action:u.e.Settings.HOME}}].concat((n=r,function(e){if(Array.isArray(e))return d(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))})),e.description&&a().createElement(a().Fragment,null,a().createElement("p",null,e.description),a().createElement("hr",null)),e.children)}},61324:(e,t,n)=>{n.r(t),n.d(t,{ContentPermissionsView:()=>B});var r=n(1024),a=n.n(r),i=n(58566),l=n(23481),c=n(20354),o=n(1048),u=n(98461),s=n(2102),m=n(69674),d=n(83345),p=n(99705),f=n(1666),g=n(31949),v=n(69883),b=n(79612),E=n(12778),y=n(24965),h=n(81803);const S={row:"jSsH6",headerCell:"OiarJ",opaqueRating:"JUpUV",partialNameColumn:"SzdZi",partialRatingColumn:"LEWRI",partialHeading:"bE8aX",partialName:"yKKFv",partialRating:"zeYNd"};function w(){return a().createElement("div",{className:"d-flex striped-row rounded py-2 ".concat(S.row)},a().createElement("div",{className:"d-flex align-items-center pl-3 mr-n2 ".concat(S.partialNameColumn)},a().createElement("div",{className:"partial-loading-background ".concat(S.partialName)})),a().createElement("div",{className:"d-flex align-items-center pr-2 ".concat(S.partialRatingColumn)},a().createElement("div",{className:"partial-loading-background ".concat(S.partialRating)})))}function N(){return a().createElement("div",{className:"d-flex py-2 mb-1"},a().createElement("div",{className:"".concat(S.partialNameColumn," pl-3 mr-n2")},a().createElement("div",{className:"partial-loading-background ".concat(S.partialHeading)})),a().createElement("div",{className:"".concat(S.partialRatingColumn," pr-2")},a().createElement("div",{className:"partial-loading-background ".concat(S.partialHeading)})))}function C(){return a().createElement(a().Fragment,null,a().createElement("div",{className:"mb-3"},a().createElement(N,null),a().createElement("div",{className:"striped-list no-full-width"},a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null),a().createElement(w,null))))}var k=n(75896),A=n(76439),I=n(36532),O=n(81993),T=l.T.encloseNamespace("settings.contentPermissions"),j="staff";function x(e,t,n){return[{Header:T("yearGroup"),id:"yearGroup",accessor:"yearGroup",Cell:function(e){var t=e.value;return a().createElement("div",{className:"w-100 pl-3"},t.name)},width:20},{Header:T("rating"),id:"ratings",accessor:"ratings",Cell:function(r){var i=r.value,l=i.yearGroup.id===j,c=a().createElement("div",{className:"mr-n1"},a().createElement(A.P,{ratings:i.ratings,yearGroup:i.yearGroup,yearGroups:n,selections:e(i.yearGroup),onSelectRange:function(e){return t(i.yearGroup,k.m.last(e))},disabled:!1,isDisabled:function(){return l},getButtonClasses:function(e,t,n,r){var a="badge rating-badge d-flex justify-content-center mr-1",i=O.u.mapRatingToClass(e.value);return r&&!l||(a+=" ".concat(S.opaqueRating)),a+(l?" cursor-default ".concat(i):t||n&&r?" "+i:" bg-secondary")}}));return l?a().createElement(I.u,{title:T("staffTooltip"),spanHack:!0},c):c},width:40}]}function G(e,t){var n=e.map((function(e){return{yearGroup:e,ratings:{yearGroup:e,ratings:t.map((function(t){var n;return(null===(n=e.rating)||void 0===n?void 0:n.code)===t.code?Object.assign(Object.assign({},t),{active:!0}):t}))}}})),r={id:j,name:T("staff")};return n.push({yearGroup:r,ratings:{yearGroup:r,ratings:t}}),n}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,l,c=[],o=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);o=!0);}catch(e){u=!0,a=e}finally{try{if(!o&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw a}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var P="settings.contentPermissions",R=l.T.encloseNamespace(P);function F(e){return a().createElement(s.m,{onClick:e.onClick,showSpinner:e.showSpinner,disabled:e.isDisabled,className:"btn btn-dark text-nowrap mr-2"},a().createElement(d.x,{namespace:P,phrase:"save"}))}var H={table:"striped-list no-full-width mb-3",header:"font-weight-500 pb-1",headerCell:"py-2 pr-2 ".concat(S.headerCell),row:"striped-row rounded ".concat(S.row),cell:"d-flex align-items-center py-2 pr-2"};function B(){var e=L(a().useState(!1),2),t=e[0],n=e[1],r=c.a.useBasicFetch(g.N.currentUser()),l=c.a.useBasicFetch(y.Z.ratings()),s=c.a.useBasicFetch(r.data&&f.h.yearGroups(r.data.customerId)),S=L(a().useState(null),2),w=S[0],N=S[1],k=L(a().useState(null),2),A=k[0],I=k[1],O=L(a().useState(!1),2),T=O[0],M=O[1],B=(0,i.useDispatch)(),U=(0,v.Z)();(0,b.M)({title:R("pageTitle")}),a().useEffect((function(){s.hasCompleted&&(N(s.data),I(s.data))}),[s.hasCompleted]),a().useEffect((function(){var e;A&&M((e=A).every((function(t,n){if(0===n)return!0;var r=e[n-1];return t.rating.value>=r.rating.value})))}),[A]);var _=a().useMemo((function(){return!(!w||!A||o.t.isEqual(w,A))}),[w,A]);function D(){n(!0);var e=A.filter((function(e){return s.data.find((function(t){var n,r;return t.id===e.id&&(null===(n=t.rating)||void 0===n?void 0:n.id)!==(null===(r=e.rating)||void 0===r?void 0:r.id)}))})),t=f.h.updateYearGroupRatings(r.data.customerId,e,q,V);c.a.fetch(B,t)}function q(){U.success(R("success")),n(!1),N(A)}function V(){U.error(R("error")),n(!1)}var W=!!A&&l.hasCompleted,$=E.o.getLiteArticle(p.b.ContentPermissions);return a().createElement(h.d,{heading:R("heading"),breadcrumbs:[R("breadcrumb")]},a().createElement("div",{className:"d-flex justify-content-between align-items-center"},a().createElement("p",null,a().createElement(d.x,{namespace:P,phrase:"description"})),a().createElement(F,{isDisabled:!_||!T,showSpinner:t,onClick:D})),a().createElement("p",null,a().createElement("small",null,a().createElement(d.x,{namespace:P,phrase:"note"}))),a().createElement("p",null,a().createElement(u.d,{href:$,className:"info-link",newTab:!0},a().createElement(d.x,{namespace:P,phrase:"learnMore"}))),W?a().createElement(m.i,{columns:x((function(e){if(e.id===j)return l.data;var t=A.find((function(t){return t.id===e.id}));return t.rating?l.data.filter((function(e){return e.value<=t.rating.value})):[]}),(function(e,t){e.id!==j&&I((function(n){return n.map((function(n){if(n)return n.id===e.id||n.value>e.value&&n.rating.value<t.value?Object.assign(Object.assign({},n),{rating:t}):n}))}))}),A),data:G(s.data,l.data),theme:H}):a().createElement(C,null),a().createElement("div",{className:"d-flex justify-content-end pb-3"},a().createElement(F,{isDisabled:!_||!T,showSpinner:t,onClick:D})))}},24965:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(97395),a={ratings:function(e){return{url:"/api/domain/v2/me/ratings",publicUrl:r._.urlBuilder("/api/domain/v2/me/ratings",{countryCode:e}),key:"ratings",formatData:function(e){return e.sort((function(e,t){return e.value-t.value}))}}}}},41063:(e,t,n)=>{n.d(t,{b:()=>l});var r=n(16714),a=n(22902),i=n(37802);function l(){var e=(0,a.T)().hasPermissions;return(0,i.r)(null).manageVideoAccess&&e(r.C.ManageVideoAccess)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[8905],{75143:(e,r,t)=>{t.d(r,{A:()=>i});var a=t(1024),n=t.n(a),l=t(99910),o=t(8612),s=t(83345);const u={emptyPill:"uDXhS"};var c="userManager.bulkUserActionsChangeYearGroupActionDetails";function i(e){return n().createElement(s.D.Provider,{value:c},n().createElement(l.Row,{className:"mb-2"},n().createElement(l.Col,{xs:4},n().createElement(s.x,{phrase:"yearGroupsList"})),n().createElement(l.Col,{xs:8},n().createElement(s.x,{phrase:"changesTo"}))),e.yearGroups.filter((function(r){return e.countsByYearGroup[r.value]>0})).map((function(r){var t,a;return n().createElement(l.Row,{key:r.value,className:"mb-2"},n().createElement(l.Col,{xs:4},n().createElement(o.G,null,r.name),n().createElement("div",null,n().createElement(s.x,{phrase:"count",options:{smartCount:e.countsByYearGroup[r.value]}}))),n().createElement(l.Col,{xs:8},(null===(t=e.selectedYearGroup)||void 0===t?void 0:t.id)?n().createElement(o.G,null,null===(a=e.selectedYearGroup)||void 0===a?void 0:a.name):n().createElement(o.G,{className:u.emptyPill},n().createElement(s.x,{phrase:"emptyPill"}))))})))}},8612:(e,r,t)=>{t.d(r,{G:()=>l});var a=t(1024),n=t.n(a);function l(e){return n().createElement("span",{className:"".concat(e.className," rounded-pill px-2 text-nowrap bg-white border border-dark")},e.children)}},99705:(e,r,t)=>{var a,n;t.d(r,{b:()=>n}),function(e){e.AddToPlaylist="115005679748",e.EditSsoAccounts="8202508040345",e.LibraryEditor="360001974533",e.VideoAccess="360000153947",e.AddFromOnline="360011718234",e.UploadToLibraryEditor="360012069334",e.PBTErrorCodes="360012421153",e.ManuelReview="360020004534",e.LibraryReview="360000163788"}(a||(a={})),function(e){e.Integrations="4407268725529",e.Classrooms="4405362551833",e.MakeInteractive="4405370510873",e.EditSsoAccounts="8202605666073",e.UploadToLibraryEditor="10672936659865",e.AddFromLite="10671345281561",e.ManageSsoYearGroups="12522160412313",e.ContentReview="18525199576601",e.ContentPermissions="14692125209497",e.AccessSettings="22110291468057",e.ContentGuidelines="24133696186009",e.FoxtelFaq="24133519542169"}(n||(n={}))},50885:(e,r,t)=>{t.r(r),t.d(r,{BulkUserActionsChangeYearGroupActionDetailsView:()=>k});var a=t(1024),n=t.n(a),l=t(20354),o=t(23481),s=t(2948),u=t(83345),c=t(38143),i=t(96728),d=t(75143);function p(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}var m="userManager.bulkUserActionsChangeYearGroupActionDetails";function v(e){var r,t,a,l,v,y=(l=(0,s.D)(c.g.BULK_USER_ACTIONS),v=2,function(e){if(Array.isArray(e))return e}(l)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,n,l,o,s=[],u=!0,c=!1;try{if(l=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=l.call(t)).done)&&(s.push(a.value),s.length!==r);u=!0);}catch(e){c=!0,n=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw n}}return s}}(l,v)||function(e,r){if(e){if("string"==typeof e)return p(e,r);var t=Object.prototype.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)?p(e,r):void 0}}(l,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=y[0],E=y[1];n().useEffect((function(){E("subAction","changeYearGroup")}),[]);var h=n().useContext(i.e).setDisableNext;return n().useEffect((function(){h(!(null==f?void 0:f.yearGroup))}),[null==f?void 0:f.yearGroup]),n().createElement(u.D.Provider,{value:m},n().createElement("h2",{className:"h4 mb-3"},n().createElement(u.x,{phrase:"heading"})),n().createElement("div",{className:"px-2 pt-2 border rounded mb-2 pb-0"},n().createElement("ul",{className:"mt-2 pl-3 ml-1"},n().createElement("li",null,n().createElement(u.x,{phrase:"ssoWarning"})," ",!!e.editSsoHelpArticleUrl&&n().createElement("a",{href:e.editSsoHelpArticleUrl,target:"_blank",className:"info-link"},n().createElement(u.x,{phrase:"ssoWarningArticle"})))),n().createElement("div",{className:"form-group"},n().createElement("label",null,n().createElement(u.x,{phrase:"label"})),n().createElement("select",{className:"form-control form-control-lg w-33 ".concat((null===(r=f.yearGroup)||void 0===r?void 0:r.id)?"":"text-secondary"),onChange:function(r){var t=r.target.value;E("yearGroup",t?e.yearGroups.find((function(e){return e.value.toString()===t.toString()})):null)},defaultValue:null!==(a=null===(t=null==f?void 0:f.yearGroup)||void 0===t?void 0:t.value)&&void 0!==a?a:""},n().createElement("option",{className:"text-secondary",value:""},o.T.getPhrase(m,"placeholder")),e.yearGroups.map((function(e){return n().createElement("option",{key:e.id,value:e.value,className:"text-dark"},e.name)})))),n().createElement(d.A,{countsByYearGroup:e.countsByYearGroup,yearGroups:e.yearGroups,selectedYearGroup:f.yearGroup})))}var y=t(58703),f=t(84566),E=t(70197),h=t(99705),g=t(39151),b=t(1666),G=t(31949),A=t(12778),x=t(47288),S=t(88323),C=t(18087);function k(e){var r=(0,S.h)(e.userType),t=r.users,a=r.count,o=(0,C.Y)(e.userType),s=l.a.useBasicFetch(G.N.currentUser()),u=l.a.useBasicFetch(g.L.config()),c=l.a.useBasicFetch(s.hasCompleted&&b.h.yearGroups(s.data.customerId)),i=(0,f.S)({userType:e.userType,field:E.q.YearGroupValues,getSearchAggregation:x.N.getSearchAggregation}),d=!!(i&&c.data&&u.data&&s.data);return n().createElement(y.d,{appLinks:o,userType:e.userType,users:t,currentStep:"action-details",userCount:a,loaded:d},d&&n().createElement(v,{appLinks:o,yearGroups:c.data,countsByYearGroup:i,editSsoHelpArticleUrl:A.o.getLiteArticle(h.b.EditSsoAccounts)}))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9118],{75143:(e,r,t)=>{t.d(r,{A:()=>c});var n=t(1024),a=t.n(n),o=t(99910),l=t(8612),s=t(83345);const i={emptyPill:"uDXhS"};var u="userManager.bulkUserActionsChangeYearGroupActionDetails";function c(e){return a().createElement(s.D.Provider,{value:u},a().createElement(o.Row,{className:"mb-2"},a().createElement(o.Col,{xs:4},a().createElement(s.x,{phrase:"yearGroupsList"})),a().createElement(o.Col,{xs:8},a().createElement(s.x,{phrase:"changesTo"}))),e.yearGroups.filter((function(r){return e.countsByYearGroup[r.value]>0})).map((function(r){var t,n;return a().createElement(o.Row,{key:r.value,className:"mb-2"},a().createElement(o.Col,{xs:4},a().createElement(l.G,null,r.name),a().createElement("div",null,a().createElement(s.x,{phrase:"count",options:{smartCount:e.countsByYearGroup[r.value]}}))),a().createElement(o.Col,{xs:8},(null===(t=e.selectedYearGroup)||void 0===t?void 0:t.id)?a().createElement(l.G,null,null===(n=e.selectedYearGroup)||void 0===n?void 0:n.name):a().createElement(l.G,{className:i.emptyPill},a().createElement(s.x,{phrase:"emptyPill"}))))})))}},8612:(e,r,t)=>{t.d(r,{G:()=>o});var n=t(1024),a=t.n(n);function o(e){return a().createElement("span",{className:"".concat(e.className," rounded-pill px-2 text-nowrap bg-white border border-dark")},e.children)}},99705:(e,r,t)=>{var n,a;t.d(r,{b:()=>a}),function(e){e.AddToPlaylist="115005679748",e.EditSsoAccounts="8202508040345",e.LibraryEditor="360001974533",e.VideoAccess="360000153947",e.AddFromOnline="360011718234",e.UploadToLibraryEditor="360012069334",e.PBTErrorCodes="360012421153",e.ManuelReview="360020004534",e.LibraryReview="360000163788"}(n||(n={})),function(e){e.Integrations="4407268725529",e.Classrooms="4405362551833",e.MakeInteractive="4405370510873",e.EditSsoAccounts="8202605666073",e.UploadToLibraryEditor="10672936659865",e.AddFromLite="10671345281561",e.ManageSsoYearGroups="12522160412313",e.ContentReview="18525199576601",e.ContentPermissions="14692125209497",e.AccessSettings="22110291468057",e.ContentGuidelines="24133696186009",e.FoxtelFaq="24133519542169"}(a||(a={}))},23118:(e,r,t)=>{t.r(r),t.d(r,{BulkUserActionsChangeYearGroupConfirmationView:()=>I});var n=t(1024),a=t.n(n),o=t(58566),l=t(81886),s=t(20354),i=t(2948),u=t(3044),c=t(68036),m=t(83345),d=t(36033),p=t(38143),f=t(40424),y=t(75143);const h={infoContainer:"jWW4t"};function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var g="userManager.bulkUserActionsChangeYearGroupConfirmation";function b(e){var r,t,n,o,l=(n=(0,i.D)(p.g.BULK_USER_ACTIONS),o=1,function(e){if(Array.isArray(e))return e}(n)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,a,o,l,s=[],i=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;i=!1}else for(;!(i=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{if(!i&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(u)throw a}}return s}}(n,o)||function(e,r){if(e){if("string"==typeof e)return v(e,r);var t=Object.prototype.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)?v(e,r):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return c.b.useSetWizardConfirmationCallback(e.onClickConfirm),a().createElement(m.D.Provider,{value:g},a().createElement(d.s,null,a().createElement("ul",{className:"mt-1 pl-3 ml-1"},a().createElement("li",null,a().createElement(m.x,{namespace:g,phrase:"heading",options:{smartCount:e.userCount,yearGroup:null!==(t=null===(r=null==l?void 0:l.yearGroup)||void 0===r?void 0:r.name)&&void 0!==t?t:""}})),a().createElement("li",null,a().createElement(m.x,{namespace:g,phrase:"ssoWarning"})," ",!!e.editSsoHelpArticleUrl&&a().createElement("a",{href:e.editSsoHelpArticleUrl,target:"_blank",className:"info-link"},a().createElement(m.x,{namespace:g,phrase:"ssoWarningArticle"})))),a().createElement("div",{className:"".concat(h.infoContainer," rounded-lg p-2")},a().createElement(y.A,{yearGroups:e.yearGroups,selectedYearGroup:null==l?void 0:l.yearGroup,countsByYearGroup:e.countsByYearGroup}))),a().createElement(u.Q,{users:e.users,imageCdnUrl:e.imageCdnUrl,statuses:[f.w.Active,f.w.Inactive],hasMore:e.hasMoreUsers,isFetching:e.isFetchingUsers,fetchNext:e.fetchNextUserPage,userType:e.userType,userCount:e.userCount}))}var C=t(58703),E=t(84566),A=t(70197),S=t(99705),G=t(39151),U=t(31949),w=t(12778),T=t(29613),x=t(47288),k=t(88323),N=t(18087);function j(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function I(e){var r,t,n,u=(0,k.h)(e.userType),m=u.users,d=u.count,f=u.isFetching,y=u.hasMore,h=u.fetchNext,v=(t=(0,i.D)(p.g.BULK_USER_ACTIONS),n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,a,o,l,s=[],i=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;i=!1}else for(;!(i=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{if(!i&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(u)throw a}}return s}}(t,n)||function(e,r){if(e){if("string"==typeof e)return j(e,r);var t=Object.prototype.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)?j(e,r):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],g=s.a.useBasicFetch(U.N.currentUser()),I=s.a.useBasicFetch(G.L.config()),Y=s.a.useBasicFetch(g.data&&x.N.yearGroups(g.data.customerId)),O=(0,E.S)({userType:e.userType,field:A.q.YearGroupValues,getSearchAggregation:x.N.getSearchAggregation}),B=(0,o.useDispatch)(),F=(0,N.Y)(e.userType),L=c.b.useCreateJobErrorAlert();function M(r){l.Q.C$.trigger(Object.assign(Object.assign({},F.bulkActionsStatus.polling),{params:{userType:e.userType,jobId:r.id}}))}var P=!!O&&!!Y.data;return a().createElement(C.d,{appLinks:F,userType:e.userType,users:m,currentStep:"confirmation",userCount:d,loaded:P},P&&a().createElement(b,{users:m,imageCdnUrl:null===(r=I.data)||void 0===r?void 0:r.imageCdnUrl,hasMoreUsers:y,isFetchingUsers:f,fetchNextUserPage:h,userType:e.userType,onClickConfirm:function(){if(v){var r=c.b.getCreateJobRequestData(v,g.data.customerId,e.userType);s.a.fetch(B,T.q.createJob(r,M,L))}},userCount:d,countsByYearGroup:O,yearGroups:Y.data,editSsoHelpArticleUrl:w.o.getLiteArticle(S.b.EditSsoAccounts)}))}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9151],{33472:(t,e,r)=>{r.r(e),r.d(e,{StartSignUpView:()=>k});var n=r(1024),i=r.n(n),a=r(99910),o=r(20354),l=r(49985),c=r(65858),u=r(
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9151],{33472:(t,e,r)=>{r.r(e),r.d(e,{StartSignUpView:()=>k});var n=r(1024),i=r.n(n),a=r(99910),o=r(20354),l=r(49985),c=r(65858),u=r(12594),s=r(83529),p=r(84789),f=r(17331),y=r(28366),d=r(39151),m=r(48456),v=r(17762),g=r(63643),h=r(2948),b=r(86702);function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,i=t}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function k(t){var e,r,n,w=(e=(r=(0,h.D)(b.y.OPEN_IN_APP_DATA),n=1,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,i=t}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}(r,n)||function(t,e){if(t){if("string"==typeof t)return S(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],{trialAppLinkString:function(){if(e&&["videos","clips","series","playlists","topics","interactives"].includes(e.app)){var t=e.id;switch(e.app){case"videos":return"video:".concat(t);case"playlists":return"playlist:".concat(t);case"series":return"series:".concat(t);case"topics":return"topic:".concat(t);case"interactives":return"interactive:".concat(t);case"clips":return"clip:".concat(t)}}}()}).trialAppLinkString,k=A(i().useState("lg"),2),j=k[0],U=k[1],C=A(i().useState(),2),L=C[0],O=C[1],P=o.a.useBasicFetch(d.L.config()),I=o.a.useBasicFetch(d.L.version()),E=(0,v.M)(),M=(0,g.c)();function _(){t.closePopup();var e=f.i.filterBlacklistedKeys(L);l.k.logUserAction(e||{},{actionType:c.Vw.Click,location:c.LZ.SignUpPopup,entity:c.py.SignUp,descriptor:c.Yu.ClosePopup,workflowPhase:c.eu.Discard})}return P.hasCompleted&&E&&M&&I.hasCompleted?i().createElement(a.Modal,{show:!0,onHide:_,size:j},i().createElement(a.Modal.Body,{className:"mx-auto p-0 ".concat(y.Z.modalBody," w-100 position-relative")},i().createElement(u.h,{onStepUpdate:function(t){O(t),"completed"===t.currentStepId&&U(void 0)},pageAppLinkString:w,close:_,type:s.c.Popup,location:c.LZ.SignUpPopup,googleMapsApiKey:P.data.googleMapsApiKey,geoLocation:E,imageUrls:m.v,ajaxUrls:M,brazeConfig:P.data.braze,version:I.data,productName:p.X.Lite}))):i().createElement(i().Fragment,null)}}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9194-c255b66c7c-lite.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9194],{73758:(t,e,n)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===r(o)?o:String(o)),i)}var o}n.d(e,{n:()=>o});var o=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners={}}var e,n;return e=t,n=[{key:"subscribe",value:function(t,e){this.registerListener(t,e)}},{key:"subscribeOnce",value:function(t,e){this.registerListener(t,e,1)}},{key:"unsubscribe",value:function(t,e){this.deregisterListener(t,e)}},{key:"trigger",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.triggerCallbacks(t,n)}},{key:"registerListener",value:function(t,e,n){var r;if("string"!=typeof t)throw new Error("Event name must be a string");if("function"!=typeof e)throw new Error("Event callback must be a function");if(n&&"number"!=typeof n)throw new Error("Execution limit must be a number or undefined");this.listeners[t]=null!==(r=this.listeners[t])&&void 0!==r?r:[],this.listeners[t].push({callback:e,executionLimit:n})}},{key:"deregisterListener",value:function(t,e){var n;if("string"!=typeof t)throw new Error("Event name must be a string");if(e&&"function"!=typeof e)throw new Error("Event callback must be a function");if(e){var r=null===(n=this.listeners[t])||void 0===n?void 0:n.findIndex((function(t){return t.callback===e}));"number"==typeof r&&-1!==r&&(this.listeners[t].splice(r,1),0===this.listeners[t].length&&delete this.listeners[t])}else this.listeners[t]=[]}},{key:"triggerCallbacks",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(this.listeners[t]){var o=[];this.listeners[t].forEach((function(t){var e,n;"number"==typeof t.executionLimit&&(t.executionCount=null!==(n=t.executionCount)&&void 0!==n?n:0,t.executionCount++,t.executionCount===t.executionLimit&&o.push(t.callback)),(e=t.callback).apply.apply(e,[null].concat(r))})),o.length&&o.forEach((function(n){return e.deregisterListener(t,n)}))}}}],n&&i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())},26733:(t,e,n)=>{n.d(e,{s:()=>P,R:()=>S});var r=n(1024),i=n.n(r),o=n(39202),a=n(97395),s=n(49985),u=n(65858),c=n(36848),l=n(78276),f=n(36532),h=n(71063),p=n(54610),y=n(4594),d=n(1164),v=n(79967),b=n(67453);const g={imageStyle:"I9E5O",item:"tqUFn",background:"s1dNr",thumbnailContainer:"EDiGi",teacherPack:"_tdVE",text:"g5NWS",hoverState:"xRYhX",atomGuide:"X39wU",studentActivity:"X9pMl",additionalMaterials:"qRVUo",userUploaded:"_18JaV",imageTypeResource:"KYtZL"};var m={width:200,resizeType:p.Nq.Cover};function w(t,e){var n,r,i;if("thumbnail"in e&&(null===(n=e.thumbnail)||void 0===n?void 0:n.url))return b.j.createUrl(null===(r=e.thumbnail)||void 0===r?void 0:r.url,Object.assign({},m));var o=a._.safeUrlConcat(t,"/v1/previews");return"metadata"in e?e.metadata.type===d.L.Pdf?b.j.createResourceImage(o,e.url,m):e.metadata.type===d.L.Image?b.j.createUrl(e.url,{size:p.h2.Medium,resizeType:p.Nq.Cover}):(null===(i=e.pdf)||void 0===i?void 0:i.url)?b.j.createResourceImage(o,e.pdf.url,m):(e.metadata.type,d.L.Zip,"/images/zip-resource.png"):b.j.createResourceImage(o,e.url,Object.assign({},m))}function O(t){var e;return"metadata"in t?t.metadata.type===d.L.Pdf?p.__.Pdf:t.metadata.type===d.L.Image?p.__.Thumbnails:(null===(e=t.pdf)||void 0===e?void 0:e.url)?p.__.Pdf:(t.metadata.type,d.L.Zip,p.__.Thumbnails):p.__.Link}function P(t){var e,n,r,o,a,s,c,h=null,p=0;"metadata"in t.data&&(h=t.data.metadata,p=null!==(r=null===(n=null===(e=t.data.thumbnail)||void 0===e?void 0:e.metadata)||void 0===n?void 0:n.rotation)&&void 0!==r?r:0);var y="".concat(null!==(a=null===(o=t.theme)||void 0===o?void 0:o.containerClass)&&void 0!==a?a:""," pt-3 px-3 rounded-lg d-flex flex-column align-items-center")+" justify-content-end ".concat(function(t){switch(t){case"atom-guide":return g.atomGuide;case"student-activity":return g.studentActivity;case"teacher-pack":return g.teacherPack;case"additional-materials":return g.additionalMaterials;default:return g.userUploaded}}(null==h?void 0:h.resourceType)," ").concat(g.background," ").concat(t.applyHoverState?g.hoverState:""," ");return i().createElement("div",{className:y},!t.hideHeading&&i().createElement(f.u,{title:t.data.name},i().createElement("h3",{className:"text-center text-break h5 mb-3 ".concat(g.text)},i().createElement("span",{className:"clamp-1"},t.data.name))),i().createElement("div",{className:"".concat(null!==(c=null===(s=t.theme)||void 0===s?void 0:s.thumbnailContainerClass)&&void 0!==c?c:""," w-75 overflow-hidden ").concat(g.thumbnailContainer," ").concat(g.imageStyle)},i().createElement(l.Z,{data:w(t.imageCdnUrl,t.data),imageType:O(t.data),imageStyle:{transform:"rotate(".concat(p,"deg)")},alt:t.data.name,analyticsOptions:{location:u.LZ.SlidingListItem},errorFallbackImageSrc:t.imageErrorFallbackUrl,imageClassName:(null==h?void 0:h.type)===d.L.Image?"".concat(g.imageTypeResource," ").concat(g.imageStyle):"",preload:t.preloadImage,preventLoad:!t.preloadImage})))}P.defaultProps={preloadImage:!0,actionBehaviour:"normal"};var S=i().memo((function(t){var e,n,r,a,l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,[]),f=(e=t.data,n=t.actionBehaviour,a=(0,v.k)(),"public"===n||!a.xs&&!a.sm&&"resource"===e.type&&"metadata"in e&&(e.metadata.type===d.L.Image||(e.metadata.type===d.L.Pdf?!!e.url:!!(null===(r=e.pdf)||void 0===r?void 0:r.url)))),p=Object.assign(Object.assign({},t.analyticsData),t.data),b=Object.assign(Object.assign({},t.analyticsOptions),{actionType:u.Vw.Click,entity:t.data.typeId===y.E.Resource?u.py.Resource:u.py.Link});function m(){s.k.logUserAction(p,b)}var w,O=!!t.data.url;return l.applyHoverState=f||O,i().createElement("div",{className:"pt-1 px-1 flex-shrink-0 ".concat(g.item," ").concat(h.M.RESOURCE_ITEM_SELECTOR)},(w="d-block no-decoration","link"===t.data.type?i().createElement("a",{href:t.data.url,target:"_blank",className:w,onClick:m},i().createElement(P,Object.assign({},l))):f?"public"===t.actionBehaviour?i().createElement("div",{className:"".concat(w," cursor-pointer d-inline"),onClick:function(){m(),o.C$.trigger(t.getAppLink(t.data))}},i().createElement(P,Object.assign({},l))):i().createElement(c.F,{appLink:t.getAppLink(t.data),className:w,analyticsData:p,analyticsOptions:b},i().createElement(P,Object.assign({},l))):O?i().createElement("a",{href:t.data.url,className:w,onClick:m},i().createElement(P,Object.assign({},l))):i().createElement("div",{className:w},i().createElement(P,Object.assign({},l)))))}))},43965:(t,e,n)=>{n.r(e),n.d(e,{ClickViewPlayer:()=>xn});var r=n(1024),i=n.n(r),o=n(2200),a=(n(16852),n(93861));function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==s(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===s(i)?i:String(i)),r)}var i}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},c.apply(this,arguments)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=f(r);if(i){var n=f(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.apply(this,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){c(f(a.prototype),"handleClick",this).call(this,null)}}])&&u(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getComponent("Button"));function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==p(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===p(i)?i:String(i)),r)}var i}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}h.prototype.controlText_="Create Clip",a.Z.registerComponent("CreateClipButton",h);var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=v(r);if(i){var n=v(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,t.ready((function(){return n.onReady()})),n}return e=a,(n=[{key:"onReady",value:function(){var t,e=this.player.getChild("collapserator"),n=null===(t=null==e?void 0:e.children())||void 0===t?void 0:t.findIndex((function(t){return"CustomControlSpacer"===t.name()}));n&&-1!==n&&e.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&y(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getPlugin("plugin"));function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==g(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===g(i)?i:String(i)),r)}var i}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function O(t){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},O(t)}a.Z.registerPlugin("createClipButtonPlugin",b);var P=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&w(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=O(r);if(i){var n=O(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&m(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getComponent("PictureInPictureToggle"));function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==S(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===S(i)?i:String(i)),r)}var i}function j(){return j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=T(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},j.apply(this,arguments)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}a.Z.registerComponent("PictureInPictureToggle",P);var x=a.Z.getComponent("PlayToggle"),C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=T(r);if(i){var n=T(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).pictureInPictureEnabled=!1,n.options=e,n.bindFunctions(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"enablePictureInPicture",value:function(){var t=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var e=this.getToggleParentComponent();if(e){this.pictureInPictureEnabled=!0;var n=e.children().findIndex((function(t){var e;return"fullscreentoggle"===(null===(e=t.name())||void 0===e?void 0:e.toLowerCase())}));-1===n&&(n=e.children().length-1),e.addChild("pictureInPictureToggle",{},n);var r=e.getChild("pictureInPictureToggle");null==r||r.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var e;null===(e=t.player)||void 0===e||e.off("playerresize",t.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var t=this.getToggleParentComponent(),e=null==t?void 0:t.getChild("pictureInPictureToggle");e&&t.removeChild(e),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(t){if(t!==this.player.isInPictureInPicture()){var e=t?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(t),this.player.trigger(e),t?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){if(!this.player.isInPictureInPicture()){var t=this.player.el().getBoundingClientRect();0!==t.width&&(t.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new x(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var t;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(t=this.options)||void 0===t?void 0:t.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0))}},{key:"exitPictureInPicture",value:function(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,j(T(a.prototype),"dispose",this).call(this)}}])&&k(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getPlugin("plugin"));a.Z.registerPlugin("pictureInPicture",C);var _=n(23035),I=n(42892),R=n(73758);function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==L(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==L(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===L(i)?i:String(i)),r)}var i}function M(){return M="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=V(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},M.apply(this,arguments)}function N(t,e){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},N(t,e)}function B(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function V(t){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},V(t)}var A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=V(r);if(i){var n=V(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return B(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=o.call(this,t,e)).hasBuffered=!1,n.hasPlayed=!1,n.eventsService=R.n,n.pointOfInterest=e.pointOfInterest,n.onMouseOver=n.onMouseOver.bind(B(n)),n.onMouseLeave=n.onMouseLeave.bind(B(n)),n.onGlancePointOfInterestMouseEnter=n.onGlancePointOfInterestMouseEnter.bind(B(n)),n.onGlancePointOfInterestMouseLeave=n.onGlancePointOfInterestMouseLeave.bind(B(n)),n.initialize(),n}return e=s,(n=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(M(V(s.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return M(V(s.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),n)}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/t*100+"%"}},{key:"updateBuffered",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasBuffered){this.hasBuffered=e;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasPlayed){this.hasPlayed=e;var n="cv-point-of-interest-indicator-played";e?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(t){var e="cv-point-of-interest-indicator-hidden";t?this.removeClass(e):this.addClass(e)}},{key:"onMouseOver",value:function(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}},{key:"onMouseLeave",value:function(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}},{key:"onGlancePointOfInterestMouseEnter",value:function(t){t.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}},{key:"onGlancePointOfInterestMouseLeave",value:function(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}},{key:"setTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var t=this.getTimeTooltip();null==t||t.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var t,e,n=null===(t=this.getSeekBar())||void 0===t?void 0:t.el();if(n){var r=a.Z.dom.findPosition(n),i=this.getPointOfInterestTime()/this.player().duration();null===(e=this.getMouseTimeDisplay())||void 0===e||e.update(r,i)}}},{key:"showMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.removeForceShow()}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player().controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var t;return null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var t;return null===(t=this.getMouseTimeDisplay())||void 0===t?void 0:t.getChild("TimeTooltip")}}])&&D(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(a.Z.getComponent("Component"));function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function Z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==F(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===F(i)?i:String(i)),r)}var i}function U(){return U="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=G(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},U.apply(this,arguments)}function z(t,e){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},z(t,e)}function G(t){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},G(t)}var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&z(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=G(r);if(i){var n=G(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===F(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=o.call(this,t,e)).pointsOfInterestVisible=e.pointsOfInterestVisible,n.toggle(n.pointsOfInterestVisible),n}return e=s,(n=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){a.Z.dom.addClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){a.Z.dom.removeClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,e,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=a.Z.dom.createEl("div",{className:"custom-toggle toggle-option float-right",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=U(G(s.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Points of Interest</span>\n <span class="cv-toggle-container"></span>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&Z(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(a.Z.getComponent("MenuItem"));function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function W(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==H(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===H(i)?i:String(i)),r)}var i}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function $(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}a.Z.registerComponent("PointsOfInterestMenuItem",q);var J=a.Z.getPlugin("plugin"),X="cvplayer-points-of-interest",K=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Q(r);if(i){var n=Q(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===H(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return $(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t)).pointOfInterestIndicators=[],n.enabled=!0,n.pointsOfInterest=null==e?void 0:e.pointsOfInterest,n.initialize=n.initialize.bind($(n)),n.updateBuffered=n.updateBuffered.bind($(n)),n.updatePlaybackProgress=n.updatePlaybackProgress.bind($(n)),n.player.one("loadedmetadata",(function(){return n.player.ready(n.initialize)})),n}return e=a,(n=[{key:"initialize",value:function(){this.pointsOfInterest&&(I.S.hasLocalStorage()&&"false"===I.S.get(X)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var t=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var e,n;null===(e=t.player)||void 0===e||e.off("progress",t.updateBuffered),null===(n=t.player)||void 0===n||n.off("timeupdate",t.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(t){I.S.set(X,t.toString()),this.pointOfInterestIndicators.forEach((function(e){return e.toggleVisibility(t)}))}},{key:"setupTrack",value:function(){var t=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(e){t.addCue({startTime:e.startTime,endTime:e.endTime,text:e.description})})),t.trigger({type:"loadeddata",target:t})}},{key:"createPointOfInterestIndicators",value:function(){var t,e=this,n=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach((function(t){var r=new A(e.player,{pointOfInterest:t});e.pointOfInterestIndicators.push(r),n.addChild(r)}))}},{key:"addMenuItem",value:function(){var t;(null===(t=this.player.getChild("collapserator"))||void 0===t?void 0:t.getChild("cogButton")).addItem({index:0,ctor:q,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updateBuffered((0,_.b)(t.player))}))}},{key:"updatePlaybackProgress",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updatePlaybackProgress(t.player.currentTime())}))}}])&&W(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(J);a.Z.registerPlugin("pointsOfInterestPlugin",K),n(93262);var tt=n(95569),et=function(){var t,e;return null!==(e=null===(t=window.crypto)||void 0===t?void 0:t.randomUUID())&&void 0!==e?e:Math.random().toString()};function nt(t){var e="function"==typeof Map?new Map:void 0;return nt=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return rt(t,arguments,at(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ot(n,t)},nt(t)}function rt(t,e,n){return rt=it()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&ot(i,n.prototype),i},rt.apply(null,arguments)}function it(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function ot(t,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ot(t,e)}function at(t){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},at(t)}function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ct(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==st(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==st(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===st(i)?i:String(i)),r)}var i}function lt(t,e,n){return e&&ct(t.prototype,e),n&&ct(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var ft=function(){function t(){ut(this,t),this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}return lt(t,[{key:"trigger",value:function(t){var e=this;this.callbacks.forEach((function(n,r){var i=e.predicates[r];i&&!i(t)||n(t)}))}},{key:"on",value:function(t){var e=this;this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");var n=this.callbacks.length;this.callbacks[n]=t,this.predicates[n]=function(){return!0};var r=function(){e.off(t)};return{off:r,filter:function(t){return e.predicates[n]=t,r}}}},{key:"one",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return this.isDisposed()?ht.reject(new Error("This EventChannel instance has been disposed")):new ht((function(r,i){t=e.on((function(n){e.signal.removeEventListener("abort",o),t(),r(n)})).filter(n);var o=function(){t(),i(new Error("Aborted while waiting for message"))};e.signal.addEventListener("abort",o,{once:!0})}),(function(){t()}))}},{key:"off",value:function(t){var e=this.callbacks.indexOf(t);-1!==e&&(this.callbacks.splice(e,1),this.predicates.splice(e,1))}},{key:"dispose",value:function(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}},{key:"isDisposed",value:function(){return this.signal.aborted}}]),t}(),ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ot(t,e)}(i,t);var e,n,r=(e=i,n=it(),function(){var t,r=at(e);if(n){var i=at(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t,e){var n;return ut(this,i),(n=r.call(this,t)).onTimeout=e,n.bindFunctions(),n}return lt(i,[{key:"bindFunctions",value:function(){this.timeout=this.timeout.bind(this)}},{key:"timeout",value:function(t){var e=this;return new Promise((function(n,r){e.then(n).catch(r).finally((function(){return clearTimeout(i)}));var i=setTimeout((function(){var t;null===(t=e.onTimeout)||void 0===t||t.call(e),r(new Error("Promise timed out"))}),t)}))}}],[{key:"reject",value:function(t){return new i((function(e,n){return n(t)}))}}]),i}(nt(Promise)),pt=function(){function t(){ut(this,t),this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}return lt(t,[{key:"trigger",value:function(t,e){this.getChannel(t).trigger(e)}},{key:"on",value:function(t,e){return this.getChannel(t).on(e)}},{key:"one",value:function(t,e){return this.getChannel(t).one(e)}},{key:"off",value:function(t,e){this.getChannel(t).off(e)}},{key:"dispose",value:function(){this.trigger("dispose",yt.void),Object.values(this.channels).forEach((function(t){return t.dispose()})),this.channels={}}},{key:"getChannel",value:function(t){return this.channels[t]||(this.channels[t]=new ft),this.channels[t]}}]),t}(),yt={void:void 0};function dt(t){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==dt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===dt(i)?i:String(i)),r)}var i}var bt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions()}var e,n;return e=t,(n=[{key:"bindFunctions",value:function(){this.schedule=this.schedule.bind(this),this.every=this.every.bind(this),this.trigger=this.trigger.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this)}},{key:"schedule",value:function(t){return this.task=t,this}},{key:"every",value:function(t){return this.intervalInMilliseconds=t,this}},{key:"trigger",value:function(){var t;return null===(t=this.task)||void 0===t||t.call(this,this),this}},{key:"start",value:function(){var t=this;return this.intervalId||(this.intervalId=setInterval((function(){return t.trigger()}),this.intervalInMilliseconds)),this}},{key:"stop",value:function(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}])&&vt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==gt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===gt(i)?i:String(i)),r)}var i}var wt,Ot={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},Pt=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ot;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions(),this.url=e,this.options=Object.assign(Object.assign({},Ot),r),this.webSocket=this.connect(),this.heartbeat=(new bt).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)}var e,n;return e=t,(n=[{key:"bindFunctions",value:function(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}},{key:"cleanup",value:function(){this.heartbeat.stop(),this.webSocket.removeEventListener("error",this.handleError),this.webSocket.removeEventListener("message",this.handleMessage),this.webSocket.removeEventListener("open",this.handleOpen),this.webSocket.removeEventListener("close",this.handleClose)}},{key:"handleOpen",value:function(t){var e;null===(e=this.onOpen)||void 0===e||e.call(this,t),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(t){var e;null===(e=this.onMessage)||void 0===e||e.call(this,t)}},{key:"handleClose",value:function(t){var e,n=this;null===(e=this.onClose)||void 0===e||e.call(this,t),this.cleanup(),setTimeout((function(){n.webSocket=n.connect()}),this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(t){var e;null===(e=this.onError)||void 0===e||e.call(this,t),this.handleClose()}},{key:"connect",value:function(){var t=new WebSocket(this.url);return t.addEventListener("open",this.handleOpen),t.addEventListener("message",this.handleMessage),t.addEventListener("close",this.handleClose),t.addEventListener("error",this.handleError),t}},{key:"send",value:function(t){this.webSocket.send(t)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&mt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==St(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==St(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===St(i)?i:String(i)),r)}var i}!function(t){t.AppleTv="apple-tv",t.Vivi="vivi"}(wt||(wt={}));var jt=function(){function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lastModified={},this.position=0,this.duration=0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=e,this.device=n,this.ready=!1,this.debounced=this.withDebouncedSetters(),this.withTimestampedSetters()}var e,n;return e=t,(n=[{key:"withDebouncedSetters",value:function(){var t=this;return new Proxy(this,{set:function(e,n,r,i){var o=t.lastModified[n.toString()];return!!(o&&Date.now()<o+2e3)||Reflect.set(e,n,r,i)}})}},{key:"withTimestampedSetters",value:function(){var t=this;return new Proxy(this,{set:function(e,n,r,i){return t.lastModified[n.toString()]=Date.now(),Reflect.set(e,n,r,i)}})}}])&&kt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function Tt(){Tt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(I([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=m.prototype=b.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Et(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===d){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=f(e,n,r);if("normal"===c.type){if(i=r.done?d:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Et(e)+" is not iterable")}return g.prototype=m,i(S,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},k(j.prototype),c(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Et(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Et(i)?i:String(i)),r)}var i}function Ct(){return Ct="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=It(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ct.apply(this,arguments)}function _t(t,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_t(t,e)}function It(t){return It=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},It(t)}var Rt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Lt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_t(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=It(r);if(i){var n=It(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this)).client=t,n.queryDeviceState=new bt,n.localState=new jt(e.title,e.device),n.bindFunctions(),n.initialize(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnect=this.handleDisconnect.bind(this),this.reconcileRemoteState=this.reconcileRemoteState.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){var t=this;this.client.on("dispose",this.dispose),this.client.on("message",this.handleDisconnect).filter((function(e){return e.source===t.getDevice().id&&"disconnect"===e.message.type})),this.queryDeviceState.every(1e3).schedule((function(){return t.reconcileRemoteState()}))}},{key:"dispose",value:function(){this.client.off("dispose",this.dispose),this.client.off("message",this.handleDisconnect),this.queryDeviceState.stop(),this.client.stop(this.getDevice().id).catch(tt.ZT),Ct(It(a.prototype),"dispose",this).call(this)}},{key:"handleDisconnect",value:function(){return Rt(this,void 0,void 0,Tt().mark((function t(){return Tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.joinRoom(this.getDevice().id);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),this.trigger("error",t.t0),this.dispose();case 9:case"end":return t.stop()}}),t,this,[[0,5]])})))}},{key:"reconcileRemoteState",value:function(){return Rt(this,void 0,void 0,Tt().mark((function t(){var e,n,r,i,o,a;return Tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.query(this.getDevice().id);case 2:if(e=t.sent,n=this.localState.debounced,r=e.message.payload.play_state,i=e.message.payload.urls,o=i.find((function(t){return t.url===n.videoSource})),a=i.indexOf(o),o&&a===r.chapter){t.next=12;break}return console.info("The device is no longer playing the source we loaded - disposing the session"),this.dispose(),t.abrupt("return");case 12:n.subtitleSource!==o.suburl&&(n.subtitleSource=o.suburl,this.trigger("subtitleschange",yt.void)),n.subtitles!==r.subtitles&&(n.subtitles=r.subtitles,this.trigger("subtitleschange",yt.void)),n.volume!==r.volume&&(n.volume=r.volume,this.trigger("volumechange",yt.void)),n.mute!==r.mute&&(n.mute=r.mute,this.trigger("volumechange",yt.void)),n.duration!==r.duration&&(n.duration=r.duration,this.trigger("durationchange",yt.void)),n.playing!==r.playing&&(n.playing=r.playing,this.trigger("playingchange",yt.void)),n.position!==r.position&&(n.position=r.position,this.trigger("positionchange",yt.void));case 19:case"end":return t.stop()}}),t,this)})))}},{key:"loadSource",value:function(t,e){return Rt(this,void 0,void 0,Tt().mark((function n(){return Tt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.localState.videoSource!==t||this.localState.subtitleSource!==e){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,this.localState.videoSource=t,this.localState.subtitleSource=e,this.localState.ready=!1,this.queryDeviceState.stop(),n.next=9,this.client.joinRoom(this.getDevice().id);case 9:return n.next=11,this.client.loadQueue({roomId:this.getDevice().id,title:this.getTitle(),videoSource:t,subtitleSource:e});case 11:this.client.seek(this.getDevice().id,this.localState.position),this.localState.ready=!0,this.queryDeviceState.start(),this.trigger("sourceloaded",yt.void),n.next=20;break;case 17:n.prev=17,n.t0=n.catch(2),this.trigger("error",n.t0);case 20:case"end":return n.stop()}}),n,this,[[2,17]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",yt.void))}},{key:"pause",value:function(){this.localState.ready&&!1!==this.localState.playing&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",yt.void))}},{key:"seek",value:function(t){this.localState.ready&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",yt.void))}},{key:"setVolume",value:function(t){this.localState.ready&&this.localState.volume!==t&&(this.localState.volume=t,this.client.setVolume(this.getDevice().id,t),this.trigger("volumechange",yt.void))}},{key:"setMuted",value:function(t){this.localState.ready&&this.localState.mute!==t&&(this.localState.mute=t,this.client.setMuted(this.getDevice().id,t),this.trigger("volumechange",yt.void))}},{key:"setSubtitles",value:function(t){return Rt(this,void 0,void 0,Tt().mark((function e(){var n;return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.localState.ready){e.next=2;break}return e.abrupt("return");case 2:if(!t){e.next=5;break}return e.next=5,this.loadSource(this.localState.videoSource,t);case 5:n=!!t,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",yt.void));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"isPlaying",value:function(){return this.localState.playing}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){return this.localState.duration}},{key:"getVolume",value:function(){return this.localState.volume}},{key:"getMuted",value:function(){return this.localState.mute}},{key:"getSubtitles",value:function(){if(this.localState.subtitles)return this.localState.subtitleSource}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}])&&xt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(pt);function Dt(t){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(t)}function Mt(){Mt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(I([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=m.prototype=b.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Dt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===d){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=f(e,n,r);if("normal"===c.type){if(i=r.done?d:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Dt(e)+" is not iterable")}return g.prototype=m,i(S,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},k(j.prototype),c(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Dt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Dt(i)?i:String(i)),r)}var i}function Bt(){return Bt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=At(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Bt.apply(this,arguments)}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(t,e)}function At(t){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},At(t)}var Ft=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Zt=1e4,Ut=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vt(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=At(i);if(o){var n=At(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Dt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).options=t,e.accessToken="",e.devices=[],e.deviceDiscovery=new bt,e.bindFunctions(),e.initialize(),e}return e=s,r=[{key:"createAckId",value:function(){return et()}}],(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=(0,tt.Ds)(this.sendMessage,500,!0),this.getDevices=this.getDevices.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}},{key:"initialize",value:function(){var t=this;this.webSocket=new Pt(this.options.url.toString()),this.webSocket.onMessage=function(e){return t.trigger("message",JSON.parse(e.data))},this.webSocket.onOpen=function(){return Ft(t,void 0,void 0,Mt().mark((function t(){return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,t.next=6,this.authenticateWithVivi();case 6:this.beginDeviceDiscovery(),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),this.trigger("error",t.t0);case 12:case"end":return t.stop()}}),t,this,[[0,9]])})))}}},{key:"beginDeviceDiscovery",value:function(){var t=this;this.deviceDiscovery.every(1e4).schedule((function(){return Ft(t,void 0,void 0,Mt().mark((function t(){var e;return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRoomList();case 2:if((e=t.sent).map((function(t){return t.id})).sort().join(",")!==this.devices.map((function(t){return t.id})).sort().join(",")){t.next=5;break}return t.abrupt("return");case 5:this.devices=e.map((function(t){return{id:t.id,name:t.name,type:wt.Vivi,available:!0}})),this.trigger("deviceschange",yt.void);case 7:case"end":return t.stop()}}),t,this)})))})).trigger().start()}},{key:"dispose",value:function(){var t;this.deviceDiscovery.stop(),null===(t=this.webSocket)||void 0===t||t.dipose(),Bt(At(s.prototype),"dispose",this).call(this)}},{key:"sendMessage",value:function(t){var e;null===(e=this.webSocket)||void 0===e||e.send(JSON.stringify(t))}},{key:"canCastToDevice",value:function(t){return t===wt.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new Lt(this,t)}},{key:"authenticateWithVivi",value:function(){return Ft(this,void 0,void 0,Mt().mark((function t(){return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),t.next=3,this.one("message",(function(t){return"video_api_identified"===t.message.type})).timeout(Zt).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getRoomList",value:function(){return Ft(this,void 0,void 0,Mt().mark((function t(){var e;return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),t.next=3,this.one("message",(function(t){return"video_api_rooms"===t.message.type})).timeout(Zt).catch((function(){throw new Error("Failed to fetch rooms")}));case 3:return e=t.sent,t.abrupt("return",e.message.rooms||[]);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"joinRoom",value:function(t){return Ft(this,void 0,void 0,Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:t,token:this.accessToken,type:"connect"}}),e.next=3,this.one("message",(function(e){return e.source===t&&"connect"===e.message.type||"error"===e.message.type&&"already_connected"===e.message.error_type||void 0})).timeout(Zt).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"query",value:function(t){return Ft(this,void 0,void 0,Mt().mark((function e(){var n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:n,name:"query"}}),e.next=4,this.one("message",(function(t){return t.message.ack_id===n})).timeout(Zt).catch((function(){throw new Error("Failed to fetch query")}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"loadQueue",value:function(t){var e=t.roomId,n=t.title,r=t.videoSource,i=t.subtitleSource;return Ft(this,void 0,void 0,Mt().mark((function t(){return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:s.createAckId(),name:"queue_load",payload:{urls:[{title:n,url:r,suburl:i}]}}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"playing"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"play",value:function(t){return Ft(this,void 0,void 0,Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_play",payload:{}}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return Ft(this,void 0,void 0,Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_pause"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"paused"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stop",value:function(t){return Ft(this,void 0,void 0,Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_stop"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"stopped"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to stop video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){return Ft(this,void 0,void 0,Mt().mark((function n(){return Mt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"video_seek",payload:{position:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to seek video")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setVolume",value:function(t,e){return Ft(this,void 0,void 0,Mt().mark((function n(){return Mt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"set_volume",payload:{volume:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"volume"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to set volume")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setMuted",value:function(t,e){return Ft(this,void 0,void 0,Mt().mark((function n(){return Mt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"set_mute",payload:{mute:e}}}),n.next=3,this.one("message",(function(e){var n;return e.source===t&&"mute"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Zt).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(t,e){return Ft(this,void 0,void 0,Mt().mark((function n(){var r;return Mt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=s.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:r,name:"set_subtitles",payload:{subtitles:e}}}),n.next=4,this.one("message",(function(e){return e.source===t&&e.message.ack_id===r})).timeout(Zt).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return n.stop()}}),n,this)})))}}])&&Nt(e.prototype,n),r&&Nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(pt);function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function Gt(t){return function(t){if(Array.isArray(t))return qt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return qt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==zt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===zt(i)?i:String(i)),r)}var i}function Wt(){return Wt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$t(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Wt.apply(this,arguments)}function Yt(t,e){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yt(t,e)}function $t(t){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$t(t)}var Qt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yt(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=$t(i);if(o){var n=$t(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this)).clients=[],t.bindFunctions(),t}return e=s,r=[{key:"getOrCreateInstance",value:function(t){if(!t)throw new Error("instanceId is required");return this.instances[t]||(this.instances[t]=new s),this.instances[t]}},{key:"disposeAndRemoveInstance",value:function(t){this.getOrCreateInstance(t).dispose(),delete this.instances[t]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],(n=[{key:"bindFunctions",value:function(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}},{key:"addClient",value:function(t){var e=this;t.on("deviceschange",this.gatherAndPublishDevices),t.on("error",(function(t){return e.trigger("error",t)})),this.clients.push(t)}},{key:"hasInstanceOfClient",value:function(t){return this.clients.some((function(e){return e instanceof t}))}},{key:"startCastSession",value:function(t){var e=this;if(this.castSession){if(this.castSession.getDevice().id===t.device.id)return void console.info("A session with device ".concat(t.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find((function(e){return e.canCastToDevice(t.device.type)}));n&&(this.castSession=n.startCastSession(t),this.castSession.on("error",(function(t){e.castSession.dispose(),e.trigger("error",t)})),this.castSession.on("dispose",(function(){e.castSession=void 0,e.trigger("castsessionchange",void 0)})),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var t=this.clients.map((function(t){return t.getDevices()})).reduce((function(t,e){return[].concat(Gt(t),Gt(e))}),[]);this.trigger("deviceschange",t)}},{key:"dispose",value:function(){var t;null===(t=this.castSession)||void 0===t||t.dispose(),this.clients.forEach((function(t){return t.dispose()})),this.castSession=void 0,this.clients=[],Wt($t(s.prototype),"dispose",this).call(this)}}])&&Ht(e.prototype,n),r&&Ht(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(pt);Qt.instances={};var Jt=n(30050),Xt=n(98115);function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Kt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Kt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Kt(i)?i:String(i)),r)}var i}function ee(){return ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ie(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ee.apply(this,arguments)}function ne(t,e){return ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ne(t,e)}function re(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ie(t){return ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ie(t)}var oe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ne(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ie(r);if(i){var n=ie(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return re(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).isVisible=n.isVisible.bind(re(n)),n}return e=a,(n=[{key:"createEl",value:function(){return ee(ie(a.prototype),"createEl",this).call(this,"li",{className:"vjs-menu-item cv-device-menu-item",innerHTML:'\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <span class="vjs-menu-item-text">').concat(this.options_.label,"</span>\n ")})}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){ee(ie(a.prototype),"show",this).call(this)}},{key:"hide",value:function(){ee(ie(a.prototype),"hide",this).call(this)}},{key:"isVisible",value:function(){return!ee(ie(a.prototype),"hasClass",this).call(this,"vjs-hidden")}}])&&te(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getComponent("MenuItem"));function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function se(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==ae(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ae(i)?i:String(i)),r)}var i}function ue(){return ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=le(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ue.apply(this,arguments)}function ce(t,e){return ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ce(t,e)}function le(t){return le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},le(t)}var fe=a.Z.getComponent("MenuButton"),he=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ce(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=le(r);if(i){var n=le(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ae(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).alwaysCollapsed=!1,n.isCollapsed=!1,n.isCollabsible=!0,n.searchText="",n.devices=[],n.castSession=void 0,n.bindFunctions(),n.bindEventListeners(),n}return e=a,n=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}},{key:"bindEventListeners",value:function(){var t=this,e=this.$("button"),n=function(e){t.menu.handleBlur(e)};e.addEventListener("blur",n),this.one("dispose",(function(){e.removeEventListener("blur",n)}))}},{key:"createEl",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=fe.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(ue(le(a.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var t=this,e=[];return this.headingItem=new Jt.Z(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new Xt.Z(this.player_,{menuButton:this,search:function(e){return t.setSearchText(e)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new Xt.C(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}},{key:"pressButton",value:function(){var t;ue(le(a.prototype),"pressButton",this).call(this),this.shouldShowSearchInput()&&(null===(t=this.searchInputItem)||void 0===t||t.focus())}},{key:"setDevices",value:function(t){this.devices=t,this.render()}},{key:"setCastSession",value:function(t){this.castSession=t,this.render()}},{key:"setSearchText",value:function(t){this.searchText=t,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter((function(t){return t instanceof oe}))}},{key:"render",value:function(){var t=this.getDeviceMenuItems();this.removeMenuItems(t),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(t){var e=this;t.forEach((function(t){return e.menu.removeChild(t)}))}},{key:"addMenuItemsForDevices",value:function(t){var e=this;t.forEach((function(t){var n=new oe(e.player(),{id:t.id,label:t.name,selected:!1,multiSelectable:!1,selectable:t.available,available:t.available,type:t.type,onClick:function(){e.options_.onDeviceMenuItemClick(n,t)}});e.menu.addItem(n)}))}},{key:"shouldShowSearchInput",value:function(){return this.getDeviceMenuItems().length>=20}},{key:"toggleSearchInput",value:function(){this.shouldShowSearchInput()?(this.headingItem.hide(),this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.headingItem.show(),this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}},{key:"toggleDeviceMenuItems",value:function(){var t=this,e=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();e.forEach((function(e){var i,o=t.devices.find((function(t){return t.id===e.options_.id}));if(o){var a=o.available,s=!n||-1!==o.name.toLowerCase().indexOf(r),u=o.id===(null===(i=t.castSession)||void 0===i?void 0:i.getDevice().id);a?e.enable():e.disable(),s?e.show():e.hide(),u?e.selected(!0):e.selected(!1)}}))}},{key:"toggleEmptyStatePlaceholder",value:function(){var t=this.getDeviceMenuItems();t.filter((function(t){return t.isVisible()})).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),t.length?this.emptyPlaceholder.setLabel(this.localize("No matching results")):this.emptyPlaceholder.setLabel(this.localize("No devices found"))}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){var t,e;return null!==(e=null===(t=this.castSession)||void 0===t?void 0:t.getDevice().name)&&void 0!==e?e:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){ue(le(a.prototype),"handleClick",this).call(this,null),this.options_.onClick()}}],n&&se(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(fe);he.prototype.controlText_="Devices",a.Z.registerComponent("DevicesButton",he);var pe=n(10463);function ye(t){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(t)}function de(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==ye(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ye(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ye(i)?i:String(i)),r)}var i}function ve(){return ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ge(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ve.apply(this,arguments)}function be(t,e){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},be(t,e)}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ge(t)}var me=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&be(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ge(r);if(i){var n=ge(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ye(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,null,t)}return e=a,(n=[{key:"createEl",value:function(){return ve(ge(a.prototype),"createEl",this).call(this,"div",{className:"cv-devices-tech"})}},{key:"setPoster",value:function(t){this.poster=t,this.update()}},{key:"setDeviceName",value:function(t){this.deviceName=t,this.update()}},{key:"update",value:function(){var t=this;this.el_.innerHTML='\n <div class="cv-devices-content">\n <p>'.concat(this.localize("Currently playing on"),"</p>\n <h2>").concat(this.deviceName||"",'</h2>\n </div>\n <div class="cv-devices-background" style="background-image: url(').concat(this.poster,')"></div>\n ');var e=document.createElement("button"),n=function(e){e.stopPropagation(),t.options_.onStopCasting()};e.onclick=n,e.ontouchstart=n,e.className="stop-casting-button",e.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(e)}},{key:"play",value:function(){}}])&&de(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getComponent("Component"));function we(t){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(t)}function Oe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==we(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==we(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===we(i)?i:String(i)),r)}var i}function Pe(){return Pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ke(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Pe.apply(this,arguments)}function Se(t,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Se(t,e)}function ke(t){return ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ke(t)}var je=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Se(t,e)}(u,t);var e,n,r,i,o,s=(i=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ke(i);if(o){var n=ke(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===we(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(n=s.call(this,t,e)).featuresVolumeControl=!0,n.featuresPlaybackRate=!1,n.movingMediaElementInDOM=!1,n.featuresFullscreenResize=!0,n.featuresTimeupdateEvents=!0,n.featuresProgressEvents=!1,n.featuresNativeTextTracks=!1,n.featuresNativeAudioTracks=!1,n.featuresNativeVideoTracks=!1,n.featuresMuteControl=!0,n.featuresSourceset=!1,n.canControlPlaybackRate=!1,n.videojsPlayer=(0,a.Z)(n.options_.playerId),n.bindFunctions(),n.bindEventListeners(),n.setSource(n.options_.source),n.triggerReady(),n}return e=u,r=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(t,e){var n;return!!Qt.getOrCreateInstance(null!==(n=null==e?void 0:e.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return Qt.isActive()}}],(n=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}},{key:"bindEventListeners",value:function(){var t=this,e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",(function(){e.dispose()})),e.on("durationchange",(function(){t.trigger("durationchange")})),e.on("dispose",(function(){t.trigger("ended"),t.hideUI()})),e.on("playingchange",(function(){e.isPlaying()?(t.trigger("play"),t.trigger("playing")):t.trigger("pause")})),e.on("volumechange",(function(){t.trigger("volumechange")})),e.on("sourceloaded",(function(){t.trigger("loadeddata");var n=t.getSelectedTextTrack();n&&e.setSubtitles(n.src)})),e.on("subtitleschange",(function(){t.setSelectedTextTrack(e.getSubtitles())})))}},{key:"onTextTrackChanged",value:function(){var t,e=this.getSelectedTextTrack();null===(t=this.getCastSession())||void 0===t||t.setSubtitles(null==e?void 0:e.src)}},{key:"getSelectedTextTrack",value:function(){return pe.O.getCurrentTextTrack(this.videojsPlayer)}},{key:"setSelectedTextTrack",value:function(t){pe.O.forEachTrack(this.videojsPlayer,(function(e){e.src===t?e.mode="showing":e.mode="hidden"}))}},{key:"showUI",value:function(t){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDeviceName(t),this.ui.show())}},{key:"hideUI",value:function(){var t;null===(t=this.ui)||void 0===t||t.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged),Pe(ke(u.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){var t=this;return this.ui=this.ui||new me({onStopCasting:function(){var e;null===(e=t.getCastSession())||void 0===e||e.dispose()}}),this.ui.el()}},{key:"setSource",value:function(t){var e=this.getCastSession();e&&(this.showUI(e.getDevice().name),this.triggerReady(),this.trigger("loadstart"),e.loadSource(t.src))}},{key:"addRemoteTextTrack",value:function(t){return Pe(ke(u.prototype),"addRemoteTextTrack",this).call(this,t,!0)}},{key:"getCastSession",value:function(){var t;return Qt.getOrCreateInstance(null!==(t=this.options_.instanceId)&&void 0!==t?t:"").getCastSession()}},{key:"play",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.play()}},{key:"pause",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.pause()}},{key:"paused",value:function(){var t;return!1===(null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaying())}},{key:"ended",value:function(){return void 0===this.getCastSession()}},{key:"setCurrentTime",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.seek(null!=t?t:0)}},{key:"currentTime",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}},{key:"duration",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getDuration())&&void 0!==e?e:0}},{key:"volume",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getVolume())&&void 0!==e?e:1}},{key:"setVolume",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setVolume(t)}},{key:"muted",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getMuted())&&void 0!==e&&e}},{key:"setMuted",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setMuted(t)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return a.Z.createTimeRanges(0,this.duration())}},{key:"playbackRate",value:function(){return 1}},{key:"readyState",value:function(){return 4}},{key:"controls",value:function(){return!1}},{key:"playsinline",value:function(){return!0}},{key:"supportsFullScreen",value:function(){return!0}},{key:"setAutoplay",value:function(){}},{key:"preload",value:function(){}},{key:"load",value:function(){}},{key:"setPlaybackRate",value:function(){}}])&&Oe(e.prototype,n),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(a.Z.getComponent("Tech"));function Ee(t){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(t)}function Te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ee(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ee(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ee(i)?i:String(i)),r)}var i}function xe(){return xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_e(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},xe.apply(this,arguments)}function Ce(t,e){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ce(t,e)}function _e(t){return _e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_e(t)}a.Z.registerTech("devices",je);var Ie=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ce(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_e(r);if(i){var n=_e(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,n.instanceId=null!==(i=null===(r=n.player.options_.devices)||void 0===r?void 0:r.instanceId)&&void 0!==i?i:"",n.bindFunctions(),n.initialize(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}},{key:"initialize",value:function(){this.player.ready(this.onReady)}},{key:"onReady",value:function(){var t=this,e=this.player.getChild("collapserator"),n=null==e?void 0:e.children().findIndex((function(t){return"CustomControlSpacer"===t.name()})),r=this.getSessionManager();if(e&&n&&-1!==n&&r){r.on("deviceschange",this.onDevicesChanged),r.on("castsessionchange",this.onCastSessionChanged),r.on("error",this.onDevicesError);var i={onClick:function(){if(t.options.viviApi&&t.options.fetchViviAccessToken&&!r.hasInstanceOfClient(Ut)){var e=new Ut({url:t.options.viviApi,fetchAccessToken:t.options.fetchViviAccessToken});r.addClient(e)}},onDeviceMenuItemClick:function(e,n){r.startCastSession({device:n,title:t.options.title})}};this.devicesButton=e.addChild("DevicesButton",i,n+1)}}},{key:"onDevicesChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setDevices(t)}},{key:"onCastSessionChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setCastSession(t),this.reloadTech()}},{key:"onDevicesError",value:function(t){this.player.error(t.message),this.player.pause()}},{key:"reloadTech",value:function(){var t=this.player,e=t.currentSources(),n=t.currentTime(),r=t.paused(),i=t.muted(),o=t.volume();t.src(e),t.one("playing",(function(){t.volume(o),t.muted(i),t.currentTime(n),r?t.pause():t.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return Qt.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){this.instanceId&&Qt.disposeAndRemoveInstance(this.instanceId),xe(_e(a.prototype),"dispose",this).call(this)}}])&&Te(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getPlugin("plugin"));function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function Le(){Le=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(I([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=m.prototype=b.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Re(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===d){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=f(e,n,r);if("normal"===c.type){if(i=r.done?d:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Re(e)+" is not iterable")}return g.prototype=m,i(S,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},k(j.prototype),c(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function De(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Re(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Re(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Re(i)?i:String(i)),r)}var i}function Ne(){return Ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ve(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ne.apply(this,arguments)}function Be(t,e){return Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Be(t,e)}function Ve(t){return Ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ve(t)}a.Z.registerPlugin("devicesPlugin",Ie);var Ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Be(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ve(r);if(i){var n=Ve(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Re(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,t,e)}return e=a,(n=[{key:"getPlayerOptions",value:function(){var t,e=Ne(Ve(a.prototype),"getPlayerOptions",this).call(this);return e.enableDevices?Object.assign(Object.assign({},e),{techOrder:["devices"].concat((t=e.techOrder,function(t){if(Array.isArray(t))return De(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return De(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?De(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),devices:{instanceId:et()}}):e}},{key:"configurePlugins",value:function(){var t;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(t=this.options.pointsOfInterest)||void 0===t?void 0:t.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(t){console.log("failed to register plugins",t)}}},{key:"setNextVideo",value:function(t,e,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(t,e,n)}},{key:"enablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(t){var e=this.player.pictureInPicture();e&&e.togglePictureInPicture(t)}},{key:"additionalSetup",value:function(t){var e,n,r,i,o=this,s=Object.create(null,{additionalSetup:{get:function(){return Ne(Ve(a.prototype),"additionalSetup",o)}}});return e=this,n=void 0,r=void 0,i=Le().mark((function e(){var n;return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.additionalSetup.call(this,t),this.options.showResources&&t.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:t.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==t.mediaType){e.next=7;break}if(null!==(n=t.additionalData)){e.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime});case 7:this.options.enableDevices&&this.player.devicesPlugin({viviApi:this.options.viviApi,fetchViviAccessToken:this.options.fetchViviAccessToken,title:t.title});case 8:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(t,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}u((i=i.apply(e,n||[])).next())}))}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}])&&Me(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.r),Fe=n(63816),Ze=n(14735);function Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ze(t){var e,n,i,o=r.useRef(t.player.duration()-t.player.currentTime()),a=(n=r.useState(o.current),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(n,i)||function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=a[0],u=a[1];function c(){var e=t.player.duration()-t.player.currentTime();u(e),e>o.current&&(o.current=e)}if(r.useEffect((function(){return t.player.on("timeupdate",c),function(){t.player.off("timeupdate",c)}}),[]),!t.nextVideo||!t.onPlayNext)return r.createElement(r.Fragment,null);var l=Math.ceil(s),f=1===l?"second":"seconds";return r.createElement(r.Fragment,null,r.createElement("div",{className:"cv-up-next-container"},r.createElement("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:t.onCancel},"×"),r.createElement("div",{className:"cv-up-next-heading"},"Up next in ",l," ",f,":"),r.createElement("div",{className:"cv-up-next-image cursor-pointer",onClick:t.onPlayNext,style:{backgroundImage:"url(".concat(null===(e=t.nextVideo)||void 0===e?void 0:e.thumbnailUrl,")")}}),r.createElement("div",{className:"cv-up-next-title"},t.nextVideo.name)))}function Ge(t){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(t)}function qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ge(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ge(i)?i:String(i)),r)}var i}function He(){return He="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ye(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},He.apply(this,arguments)}function We(t,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},We(t,e)}function Ye(t){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ye(t)}a.Z.registerComponent("UpNext",(0,Ze.Z)((function(t,e){return r.createElement(ze,Object.assign({player:t},e))})));var $e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&We(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ye(r);if(i){var n=Ye(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=o.call(this,t,e)).playNext=t.nextVideoPlugin().getShouldPlayNext(),n.toggle(n.playNext),n}return e=s,(n=[{key:"handleToggle",value:function(){this.toggle(!this.playNext)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){this.playNext=!0,a.Z.dom.addClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"toggleOff",value:function(){this.playNext=!1,a.Z.dom.removeClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,e,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=a.Z.dom.createEl("div",{className:"custom-toggle toggle-option float-right",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=He(Ye(s.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Play next video</span>\n <span class="cv-toggle-container"></span>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&qe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(a.Z.getComponent("MenuItem"));function Qe(t){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(t)}function Je(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Qe(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Qe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Qe(i)?i:String(i)),r)}var i}function Xe(){return Xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=en(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Xe.apply(this,arguments)}function Ke(t,e){return Ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ke(t,e)}function tn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function en(t){return en=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},en(t)}a.Z.registerComponent("NextVideoMenuItem",$e);var nn="cv-persisttest",rn="cv-play-next-video",on=a.Z.getPlugin("plugin"),an=(a.Z.getComponent("MenuItem"),a.Z.getComponent("NextVideoMenuItem")),sn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ke(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=en(r);if(i){var n=en(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Qe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return tn(t)}(this,t)});function a(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).setShouldPlayNext=e.setShouldPlayNext.bind(tn(e)),e.getShouldPlayNext=e.getShouldPlayNext.bind(tn(e)),e.setChapterTrack=e.setChapterTrack.bind(tn(e)),e.onTimeUpdate=e.onTimeUpdate.bind(tn(e)),e.hasLocalStorage=e.testHasLocalStorage(),e.shouldPlayNextVideo=!1,e.hasLocalStorage){var n=window.localStorage.getItem(rn);e.shouldPlayNextVideo="true"===n}return t.ready((function(){e.initialize()})),e}return e=a,(n=[{key:"initialize",value:function(){this.player.isDisposed()||(pe.O.useTrack(this.player,"chapters",null,this.setChapterTrack),this.bindListeners())}},{key:"setNextVideo",value:function(t,e,n){var r;this.nextVideo=t,this.callback=n,e&&this.setShouldPlayNext(!0),(null===(r=this.player.getChild("collapserator"))||void 0===r?void 0:r.getChild("cogButton")).addItem({index:0,ctor:an,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(t,e){this.shouldPlayNextVideo=t,this.hasLocalStorage&&e&&window.localStorage.setItem(rn,t.toString())}},{key:"setChapterTrack",value:function(t){this.chapterTrack=t}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),Xe(en(a.prototype),"dispose",this).call(this)}},{key:"onTimeUpdate",value:function(){var t,e,n;if(!this.player.pictureInPicture||!this.player.isInPictureInPicture())if(this.getShouldPlayNext()){if(this.player.ended())return this.callback(),void this.hideUpNext();if(!(this.upNextRendered&&this.player.currentTime()>this.upNextTimepoint)){var r=(null===(e=null===(t=this.chapterTrack)||void 0===t?void 0:t.activeCues)||void 0===e?void 0:e.length)&&this.chapterTrack.activeCues[0];"credits"===(null===(n=null==r?void 0:r.text)||void 0===n?void 0:n.toLowerCase())||this.player.currentTime()>=this.player.duration()-5?this.showUpNext():this.hideUpNext()}}else this.hideUpNext()}},{key:"showUpNext",value:function(){var t=this;this.upNextRendered||(this.upNextRendered=!0,this.upNextTimepoint=this.player.currentTime(),this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:function(){t.hideUpNext(),t.setShouldPlayNext(!1)}}))}},{key:"hideUpNext",value:function(){if(this.upNextRendered){this.upNextRendered=!1,this.upNextTimepoint=null;var t=this.player.getChild("UpNext");t&&this.player.removeChild(t)}}},{key:"testHasLocalStorage",value:function(){try{return window.localStorage.setItem(nn,"persistPlayNext"),window.localStorage.removeItem(nn),!0}catch(t){return!1}}}])&&Je(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(on);a.Z.registerPlugin("nextVideoPlugin",sn);var un=n(26733);function cn(t){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cn(t)}function ln(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==cn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==cn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===cn(i)?i:String(i)),r)}var i}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fn(t,e)}function hn(t){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hn(t)}function pn(t){return i().createElement("div",{className:"cv-resource-item"},i().createElement(un.s,{data:t.resource,imageCdnUrl:t.imageCdnUrl}))}var yn=(0,Ze.Z)((function(t,e){return i().createElement(pn,Object.assign({},e))})),dn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fn(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=hn(r);if(i){var n=hn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),n=o.call(this,t,e);var r=new yn(t,{resource:e.resource,imageCdnUrl:e.imageCdnUrl});return n.addChild(r),n}return e=s,(n=[{key:"createEl",value:function(){return a.Z.dom.createEl("div")}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}])&&ln(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(a.Z.getComponent("ClickableComponent"));function vn(t){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(t)}function bn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==vn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==vn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===vn(i)?i:String(i)),r)}var i}function gn(){return gn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},gn.apply(this,arguments)}function mn(t,e){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mn(t,e)}function wn(t){return wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wn(t)}var On=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mn(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=wn(r);if(i){var n=wn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(t=o.apply(this,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return e=s,(n=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small ".concat(gn(wn(s.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(gn(wn(s.prototype),"buildCSSClass",this).call(this))}},{key:"update",value:function(){gn(wn(s.prototype),"update",this).call(this)}},{key:"createMenu",value:function(){return this.options_.title="Resources",gn(wn(s.prototype),"createMenu",this).call(this)}},{key:"createItems",value:function(){var t=this,e=[];return this.options_.resources.forEach((function(n){var r=new dn(t.player(),{resource:n,imageCdnUrl:t.options_.imageCdnUrl,downloadResource:function(e){return t.downloadResource(e)}});e.push(r)})),e}},{key:"downloadResource",value:function(t){this.getDownloadIframe().src=t.url}},{key:"getDownloadIframe",value:function(){return this.downloadIframe||(this.downloadIframe=a.Z.dom.createEl("iframe"),this.downloadIframe.style.display="none",a.Z.dom.appendContent(a.Z.dom.$("body"),this.downloadIframe)),this.downloadIframe}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){gn(wn(s.prototype),"handleClick",this).call(this,null)}}])&&bn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(a.Z.getComponent("MenuButton"));function Pn(t){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(t)}function Sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Pn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Pn(i)?i:String(i)),r)}var i}function kn(t,e){return kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kn(t,e)}function jn(t){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jn(t)}On.prototype.controlText_="Resources",a.Z.registerComponent("ResourcesButton",On);var En=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=jn(r);if(i){var n=jn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Pn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,t.ready((function(){return n.onReady()})),n}return e=a,(n=[{key:"onReady",value:function(){if(this.options.resources.length){var t=this.player.getChild("collapserator");t.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},t.children_.length-3)}}}])&&Sn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(a.Z.getPlugin("plugin"));a.Z.registerPlugin("resourcesPlugin",En);var Tn=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function xn(t){var e=t.className,n=void 0===e?"":e,r=t.playerApi,o=t.onReady,a=t.onDispose,s=Tn(t,["className","playerApi","onReady","onDispose"]),u=i().useRef();return i().useEffect((function(){if(u){var t=new Ae(u.current,Object.assign(Object.assign({},s),{playerApi:r}));return o&&t.ready((function(){o((0,Fe.G)(t))})),a&&t.one("dispose",a),function(){null==t||t.dispose()}}}),[t.viewKey]),i().createElement("div",{ref:u,className:n})}}}]);
|