@clickview/lite 0.76.0-rc.2 → 0.76.0-rc.3
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/css/{658-lite-5cb7c60d3b.chunk.css → 3700-lite-2ddbf5e39f.chunk.css} +0 -1
- package/dist/css/{4033-lite-b2fb1fd10e.chunk.css → 5987-lite-dc7e18cd99.chunk.css} +1 -0
- package/dist/css/{3325-lite-6f710728af.chunk.css → 5999-lite-bd05e26c6b.chunk.css} +1 -0
- package/dist/css/{6273-lite-e023522516.chunk.css → 6554-lite-a69c2a69da.chunk.css} +1 -0
- package/dist/languages/en.json +1 -1
- package/dist/scripts/{1518-c916754d35-lite.chunk.js → 1518-7005bfd3c8-lite.chunk.js} +2 -2
- package/dist/scripts/{1518-c916754d35-lite.chunk.js.map → 1518-7005bfd3c8-lite.chunk.js.map} +1 -1
- package/dist/scripts/{1670-823b692de0-lite.chunk.js → 1670-d9ced49962-lite.chunk.js} +2 -2
- package/dist/scripts/{1670-823b692de0-lite.chunk.js.map → 1670-d9ced49962-lite.chunk.js.map} +1 -1
- package/dist/scripts/{1912-f7cadd3e9e-lite.chunk.js → 1912-2271f9d8ee-lite.chunk.js} +2 -2
- package/dist/scripts/{1912-f7cadd3e9e-lite.chunk.js.map → 1912-2271f9d8ee-lite.chunk.js.map} +1 -1
- package/dist/scripts/{3143-f03801138f-lite.chunk.js → 3143-a754e306a5-lite.chunk.js} +3 -3
- package/dist/scripts/{3143-f03801138f-lite.chunk.js.map → 3143-a754e306a5-lite.chunk.js.map} +1 -1
- package/dist/scripts/{3191-6f79256d33-lite.chunk.js → 3191-e387636012-lite.chunk.js} +2 -2
- package/dist/scripts/{3191-6f79256d33-lite.chunk.js.map → 3191-e387636012-lite.chunk.js.map} +1 -1
- package/dist/scripts/3700-3859a400a5-lite.chunk.js +3 -0
- package/dist/scripts/3700-3859a400a5-lite.chunk.js.map +1 -0
- package/dist/scripts/{4050-57e2409255-lite.chunk.js → 4050-8852c15f40-lite.chunk.js} +3 -3
- package/dist/scripts/4050-8852c15f40-lite.chunk.js.map +1 -0
- package/dist/scripts/{4802-1b7a767c46-lite.chunk.js → 4802-bc321d7ede-lite.chunk.js} +3 -3
- package/dist/scripts/{4802-1b7a767c46-lite.chunk.js.map → 4802-bc321d7ede-lite.chunk.js.map} +1 -1
- package/dist/scripts/{5877-6c9d90249b-lite.chunk.js → 5877-20ef40af7c-lite.chunk.js} +2 -2
- package/dist/scripts/{5877-6c9d90249b-lite.chunk.js.map → 5877-20ef40af7c-lite.chunk.js.map} +1 -1
- package/dist/scripts/5987-ece2ee4793-lite.chunk.js +3 -0
- package/dist/scripts/5987-ece2ee4793-lite.chunk.js.map +1 -0
- package/dist/scripts/{6273-a71eccd48b-lite.chunk.js → 6554-353cf95001-lite.chunk.js} +2 -2
- package/dist/scripts/{6273-a71eccd48b-lite.chunk.js.map → 6554-353cf95001-lite.chunk.js.map} +1 -1
- package/dist/scripts/{7815-554d031e0a-lite.chunk.js → 7815-05c5e8df47-lite.chunk.js} +2 -2
- package/dist/scripts/{7815-554d031e0a-lite.chunk.js.map → 7815-05c5e8df47-lite.chunk.js.map} +1 -1
- package/dist/scripts/{7835-61d04f9f11-lite.chunk.js → 7835-8d490274c8-lite.chunk.js} +3 -3
- package/dist/scripts/{7835-61d04f9f11-lite.chunk.js.map → 7835-8d490274c8-lite.chunk.js.map} +1 -1
- package/dist/scripts/{8362-5936447d00-lite.chunk.js → 8362-7cac098b34-lite.chunk.js} +3 -3
- package/dist/scripts/{8362-5936447d00-lite.chunk.js.map → 8362-7cac098b34-lite.chunk.js.map} +1 -1
- package/dist/scripts/{8548-4eeb094dbb-lite.chunk.js → 8548-c987128b9f-lite.chunk.js} +3 -3
- package/dist/scripts/{8548-4eeb094dbb-lite.chunk.js.map → 8548-c987128b9f-lite.chunk.js.map} +1 -1
- package/dist/scripts/{8756-a3f84f1b64-lite.chunk.js → 8756-560899a88b-lite.chunk.js} +2 -2
- package/dist/scripts/{8756-a3f84f1b64-lite.chunk.js.map → 8756-560899a88b-lite.chunk.js.map} +1 -1
- package/dist/scripts/{8933-01ed4c4e69-lite.chunk.js → 8933-aa3f547d1e-lite.chunk.js} +3 -3
- package/dist/scripts/{8933-01ed4c4e69-lite.chunk.js.map → 8933-aa3f547d1e-lite.chunk.js.map} +1 -1
- package/dist/scripts/914-4a8424247f-lite.chunk.js +2 -0
- package/dist/scripts/914-4a8424247f-lite.chunk.js.map +1 -0
- package/dist/scripts/{9423-d67a0bb6f3-lite.chunk.js → 9423-3ce35ca995-lite.chunk.js} +2 -2
- package/dist/scripts/{9423-d67a0bb6f3-lite.chunk.js.map → 9423-3ce35ca995-lite.chunk.js.map} +1 -1
- package/dist/scripts/bundle-385a231a9d.min.js +3 -0
- package/dist/scripts/{bundle-4276667ced.min.js.map → bundle-385a231a9d.min.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/4033-d8dbb0d208-lite.chunk.js +0 -3
- package/dist/scripts/4033-d8dbb0d208-lite.chunk.js.map +0 -1
- package/dist/scripts/4050-57e2409255-lite.chunk.js.map +0 -1
- package/dist/scripts/5467-3c44100a58-lite.chunk.js +0 -2
- package/dist/scripts/5467-3c44100a58-lite.chunk.js.map +0 -1
- package/dist/scripts/658-f500e8210f-lite.chunk.js +0 -3
- package/dist/scripts/658-f500e8210f-lite.chunk.js.map +0 -1
- package/dist/scripts/bundle-4276667ced.min.js +0 -3
- /package/dist/scripts/{3143-f03801138f-lite.chunk.js.LICENSE.txt → 3143-a754e306a5-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4033-d8dbb0d208-lite.chunk.js.LICENSE.txt → 3700-3859a400a5-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4050-57e2409255-lite.chunk.js.LICENSE.txt → 4050-8852c15f40-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4802-1b7a767c46-lite.chunk.js.LICENSE.txt → 4802-bc321d7ede-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{658-f500e8210f-lite.chunk.js.LICENSE.txt → 5987-ece2ee4793-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{7835-61d04f9f11-lite.chunk.js.LICENSE.txt → 7835-8d490274c8-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{8362-5936447d00-lite.chunk.js.LICENSE.txt → 8362-7cac098b34-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{8548-4eeb094dbb-lite.chunk.js.LICENSE.txt → 8548-c987128b9f-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{8933-01ed4c4e69-lite.chunk.js.LICENSE.txt → 8933-aa3f547d1e-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{bundle-4276667ced.min.js.LICENSE.txt → bundle-385a231a9d.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 5987-ece2ee4793-lite.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[5987],{25023:(e,t,n)=>{n.d(t,{s:()=>P,R:()=>S});var i=n(32735),r=n(6044),o=n(49985),a=n(65858),s=n(15611),c=n(11607),u=n(17848),l=n(83914),f=n(62335),p=n(36532),d=n(82308),h=n(71063),y=n(4594),v=n(1164),b=n(79967),m=n(45778),g=n(54297),w=n(35223);const O={imageStyle:"I9E5O",item:"tqUFn",dashboard:"o7j7p",playPage:"V2RwX",aspectRatio:"OnJDH",outerContainer:"CIFy7",innerContainer:"oUZPD",actions:"jzGAm",titleBelow:"Cpjs3",thumbnailContainer:"EDiGi",titleAbove:"e9ejn",teacherPack:"_tdVE",text:"g5NWS",hoverState:"xRYhX",atomGuide:"X39wU",studentActivity:"X9pMl",additionalMaterials:"qRVUo",userUploaded:"_18JaV",imageTypeResource:"KYtZL",download:"fbb_e"};function P(e){var t,n,r,o,a=null;"metadata"in e.data&&(a=e.data.metadata);var s=m.G.isType(e.data,y.E.Resource);return i.createElement(i.Fragment,null,i.createElement("div",{className:O.aspectRatio},i.createElement("div",{className:O.outerContainer},i.createElement("div",{className:function(t){var n,i="\n d-flex flex-column align-items-center justify-content-end rounded-3 h-100\n position-relative ".concat(function(e){switch(e){case"atom-guide":return O.atomGuide;case"student-activity":return O.studentActivity;case"teacher-pack":return O.teacherPack;case"additional-materials":return O.additionalMaterials;default:return O.userUploaded}}(t)," ").concat(O.innerContainer);return(null===(n=e.theme)||void 0===n?void 0:n.containerClass)?i+=" ".concat(e.theme.containerClass):i+=" pt-3 px-3",e.applyHoverState&&(i+=" ".concat(O.hoverState)),i}(null==a?void 0:a.resourceType)},"above"===e.titlePosition&&i.createElement(p.u,{title:e.data.name},i.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat(O.text)},i.createElement("span",{className:"clamp-1"},e.data.name))),i.createElement("div",{className:"\n ".concat(null!==(n=null===(t=e.theme)||void 0===t?void 0:t.thumbnailContainerClass)&&void 0!==n?n:""," w-75 overflow-hidden \n ").concat(O.thumbnailContainer," ").concat("above"===e.titlePosition?O.titleAbove:""," \n ").concat(O.imageStyle,"\n ")},i.createElement(u.C,{resource:e.data,imageCdnUrl:e.imageCdnUrl,imageErrorFallbackUrl:e.imageErrorFallbackUrl,preloadImage:e.preloadImage})),s&&e.onClickDownload&&"normal"===e.actionBehaviour&&i.createElement("div",{className:O.actions},i.createElement(c.L,{onClick:function(t){return e.onClickDownload(t,e.data)},className:"".concat(O.download," d-flex align-items-center justify-content-center")},i.createElement(l.x,{svgName:w.vn.Download}))),!e.hideTypeBadge&&s&&i.createElement(d.y,{typeId:y.E.Resource})))),"below"===e.titlePosition&&i.createElement("div",{className:"mt-1 ".concat(O.titleBelow)},m.G.isType(e.data,y.E.Resource)&&!!(null===(o=null===(r=e.data)||void 0===r?void 0:r.metadata)||void 0===o?void 0:o.resourceType)&&i.createElement(f.m,null,g.C.getResourceTypeName(e.data.metadata.resourceType)),i.createElement("h3",{className:"h6 clamp-2"},e.data.name)))}P.defaultProps={preloadImage:!0,actionBehaviour:"normal"};var S=i.memo(function(e){var t,n,c,u,l=(t=e.data,n=e.actionBehaviour,u=(0,b.k)(),"public"===n||!u.xs&&!u.sm&&"resource"===t.type&&"metadata"in t&&(t.metadata.type===v.L.Image||(t.metadata.type===v.L.Pdf?!!t.url:!!(null===(c=t.pdf)||void 0===c?void 0:c.url)))),f=Object.assign(Object.assign({},e.analyticsData),e.data),p=Object.assign(Object.assign({},e.analyticsOptions),{actionType:a.Vw.Click,entity:e.data.typeId===y.E.Resource?a.py.Resource:a.py.Link});function d(){o.k.logUserAction(f,p)}var m,g=Object.assign(Object.assign({},e),{applyHoverState:l||!!e.data.url});return i.createElement("div",{className:"px-1 flex-shrink-0 ".concat(O.item," ").concat("play-page"===e.location?O.playPage:O.dashboard," ").concat(h.M.RESOURCE_ITEM_SELECTOR)},(m="d-block no-decoration","link"===e.data.type?i.createElement("a",{href:e.data.url,target:"_blank",className:m,onClick:d},i.createElement(P,Object.assign({},g))):l?"public"===e.actionBehaviour?i.createElement("div",{className:"".concat(m," cursor-pointer d-inline"),onClick:function(){d(),r.C$.trigger(e.getAppLink(e.data))}},i.createElement(P,Object.assign({},g))):i.createElement(s.F,{appLink:e.getAppLink(e.data),className:m,analyticsData:f,analyticsOptions:p},i.createElement(P,Object.assign({},g))):e.data.url?i.createElement("a",{href:e.data.url,className:m,onClick:d},i.createElement(P,Object.assign({},g))):i.createElement("div",{className:m},i.createElement(P,Object.assign({},g)))))})},16852:(e,t,n)=>{var i=n(76032);function r(e){return r="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},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},c.apply(null,arguments)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var f=function(e){function t(e,n){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=function(e,t,n){return t=u(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}(this,t,[e]),void 0===n.startTime)throw Error("Invalid clip start");if(void 0===n.endTime)throw Error("Invalid clip end");if(n.startTime>n.endTime)throw Error("Clip start cannot be greater than clip end");return i._clipStart=parseFloat(n.startTime.toPrecision(4)),i._clipEnd=parseFloat(n.endTime.toPrecision(4)),i.playerEndedFn=i.player.ended.bind(e),i.playerDurationFn=i.player.duration.bind(e),i.playerCurrentTimeFn=i.player.currentTime.bind(e),i.playerbufferedFn=i.player.buffered.bind(e),i.player.ended=i.ended.bind(i),i.player.duration=i.duration.bind(i),i.player.currentTime=i.currentTime.bind(i),i.player.buffered=i.buffered.bind(i),i.initialize(),i.player.ready(function(){i.player.trigger("durationchange")}),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,a=[{key:"clipStart",get:function(){var e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}},{key:"clipEnd",get:function(){var e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}},{key:"dispose",value:function(){var e,n,i;this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),(e=t,n=this,"function"==typeof(i=c(u(1&3?e.prototype:e),"dispose",n))?function(e){return i.apply(n,e)}:i)([])}},{key:"initialize",value:function(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}},{key:"onPlay",value:function(){this._isEnded&&this.player.currentTime(0)}},{key:"onTimeUpdate",value:function(){var e=this.getCurrentTime(!1);e>this.clipEnd?this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0):(this._isEnded=!1,e<this.clipStart-10&&this.playerCurrentTimeFn(this.clipStart,!0))}},{key:"ended",value:function(){return this.getCurrentTime(!1)>this.clipEnd}},{key:"duration",value:function(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}},{key:"currentTime",value:function(e){if("number"!=typeof e)return this.getCurrentTime(!0);for(var t=e+this.clipStart,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.playerCurrentTimeFn(t,i)}},{key:"getCurrentTime",value:function(e){var t=this.playerCurrentTimeFn(),n=0;return t>=this.clipStart&&(n=t-this.clipStart),this.player.getCache().currentTime=n,e?n:t}},{key:"buffered",value:function(){for(var e=this.playerbufferedFn(),t=[],n=0;n<e.length;n++)t[n]=[Math.max(0,e.start(n)-this.clipStart),Math.min(Math.max(0,e.end(n)-this.clipStart),this.player.duration())];return i.Z.createTimeRanges(t)}}],a&&o(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("clipPlugin",f)},50358:(e,t,n)=>{n.r(t),n.d(t,{ClickViewPlayer:()=>Gi});var i=n(32735),r=n(43700),o=(n(16852),n(76032));function a(e){return a="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},a(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},l.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var d=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=f(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),n=t,i=[{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(){var e,n,i;(e=t,n=this,"function"==typeof(i=l(f(1&3?e.prototype:e),"handleClick",n))?function(e){return i.apply(n,e)}:i)([null])}}],i&&s(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("Button"));function h(e){return h="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},h(e)}function y(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function v(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}d.prototype.controlText_="Create clip",o.Z.registerComponent("CreateClipButton",d);var w=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=m(t),function(e,t){if(t&&("object"==h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,b()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,e.ready(function(){return i.onReady()}),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(t,e),n=t,(i=[{key:"onReady",value:function(){var e,t=this.player.getChild("collapserator"),n=null===(e=null==t?void 0:t.children())||void 0===e?void 0:e.findIndex(function(e){return"CustomControlSpacer"===e.name()});n&&-1!==n&&t.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&y(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getPlugin("plugin"));function O(e){return O="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},O(e)}function P(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,S(i.key),i)}}function S(e){var t=function(e){if("object"!=O(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==O(t)?t:t+""}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}o.Z.registerPlugin("createClipButtonPlugin",w);var T=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=j(t),function(e,t){if(t&&("object"==O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,k()?Reflect.construct(t,n||[],j(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(t,e),n=t,(i=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&P(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("PictureInPictureToggle"));function _(e){return _="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},_(e)}function E(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var c=i&&i.prototype instanceof s?i:s,u=Object.create(c.prototype);return I(u,"_invoke",function(n,i,r){var o,s,c,u=0,l=r||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,s=0,c=e,p.n=n,a}};function d(n,i){for(s=n,c=i,t=0;!f&&u&&!r&&t<l.length;t++){var r,o=l[t],d=p.p,h=o[2];n>3?(r=h===i)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((r=n<2&&d<o[1])?(s=0,p.v=i,p.n=o[1]):d<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw f=!0,i}return function(r,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){o||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=p.n<0)?c:n.call(i,p))!==a)break}catch(t){o=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,r,o),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(I(t={},i,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,I(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,I(f,"constructor",u),I(u,"constructor",c),c.displayName="GeneratorFunction",I(u,r,"GeneratorFunction"),I(f),I(f,r,"Generator"),I(f,i,function(){return this}),I(f,"toString",function(){return"[object Generator]"}),(E=function(){return{w:o,m:p}})()}function I(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}I=function(e,t,n,i){if(t)r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n;else{var o=function(t,n){I(e,t,function(e){return this._invoke(t,n,e)})};o("next",0),o("throw",1),o("return",2)}},I(e,t,n,i)}function R(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,M(i.key),i)}}function M(e){var t=function(e){if("object"!=_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_(t)?t:t+""}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=B(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},x.apply(null,arguments)}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},B(e)}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(e,t)}o.Z.registerComponent("PictureInPictureToggle",T);var V=o.Z.getComponent("PlayToggle"),F=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=B(t),function(e,t){if(t&&("object"==_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,D()?Reflect.construct(t,n||[],B(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,i.bindFunctions(),e.ready(function(){return i.initialize()}),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(t,e),n=t,i=[{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:"initialize",value:function(){var e=this,t=this.player.getChild("collapserator"),n=t.children().findIndex(function(e){var t;return"fullscreentoggle"===(null===(t=e.name())||void 0===t?void 0:t.toLowerCase())});-1===n&&(n=t.children().length-1),this.toggle=t.addChild("pictureInPictureToggle",{},n),this.toggle.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",function(){var t;null===(t=e.player)||void 0===t||t.off("playerresize",e.onPlayerResize)})}},{key:"togglePictureInPicture",value:function(e){if(e!==this.player.isInPictureInPicture()){var t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){var e,t;if(!this.player.isInPictureInPicture()){var n=this.player.el().getBoundingClientRect();0!==n.width&&(n.width<800?null===(e=this.toggle)||void 0===e||e.hide():null===(t=this.toggle)||void 0===t||t.show())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new V(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 e;this.togglePictureInPicture(!0),"function"==typeof(null===(e=this.options)||void 0===e?void 0:e.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0)}},{key:"exitPictureInPicture",value:function(){return e=this,t=void 0,n=void 0,i=E().m(function e(){return E().w(function(e){for(;;)switch(e.n){case 0:this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles();case 1:return e.a(2)}},e,this)}),new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((i=i.apply(e,t||[])).next())});var e,t,n,i}},{key:"dispose",value:function(){var e,n,i;this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,(e=t,n=this,"function"==typeof(i=x(B(1&3?e.prototype:e),"dispose",n))?function(e){return i.apply(n,e)}:i)([])}}],i&&R(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("pictureInPicture",F);var A=n(23035),L=n(42892),Z=n(73758);function U(e){return U="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},U(e)}function z(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,G(i.key),i)}}function G(e){var t=function(e){if("object"!=U(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==U(t)?t:t+""}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(q=function(){return!!e})()}function W(e,t,n,i){var r=H(Y(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function H(){return H="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Y(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},H.apply(null,arguments)}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},X(e,t)}var $=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=Y(t),function(e,t){if(t&&("object"==U(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,q()?Reflect.construct(t,n||[],Y(e).constructor):t.apply(e,n))}(this,t,[e,n])).hasBuffered=!1,i.hasPlayed=!1,i.eventsService=Z.n,i.pointOfInterest=n.pointOfInterest,i.onMouseOver=i.onMouseOver.bind(i),i.onMouseLeave=i.onMouseLeave.bind(i),i.onGlancePointOfInterestMouseEnter=i.onGlancePointOfInterestMouseEnter.bind(i),i.onGlancePointOfInterestMouseLeave=i.onGlancePointOfInterestMouseLeave.bind(i),i.initialize(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}(t,e),n=t,(i=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(W(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,i){return W(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),i])}},{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 e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}},{key:"updateBuffered",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasBuffered){this.hasBuffered=t;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasPlayed){this.hasPlayed=t;var n="cv-point-of-interest-indicator-played";t?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(e){var t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}},{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(e){e.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 e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var e=this.getTimeTooltip();null==e||e.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var e,t,n=null===(e=this.getSeekBar())||void 0===e?void 0:e.el();if(n){var i=o.Z.dom.findPosition(n),r=this.getPointOfInterestTime()/this.player().duration();null===(t=this.getMouseTimeDisplay())||void 0===t||t.update(i,r)}}},{key:"showMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.removeForceShow()}},{key:"getSeekBar",value:function(){var e;return null===(e=this.player().controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var e;return null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var e;return null===(e=this.getMouseTimeDisplay())||void 0===e?void 0:e.getChild("TimeTooltip")}}])&&z(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("Component"));function J(e){return J="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},J(e)}function Q(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,K(i.key),i)}}function K(e){var t=function(e){if("object"!=J(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==J(t)?t:t+""}function ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ee=function(){return!!e})()}function te(){return te="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},te.apply(null,arguments)}function ne(e){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ne(e)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}var re=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=ne(t),function(e,t){if(t&&("object"==J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ee()?Reflect.construct(t,n||[],ne(e).constructor):t.apply(e,n))}(this,t,[e,n])).pointsOfInterestVisible=n.pointsOfInterestVisible,i.toggle(i.pointsOfInterestVisible),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(t,e),n=t,i=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(e){e?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){o.Z.dom.addClass(this.toggleEl,"on"),o.Z.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){o.Z.dom.removeClass(this.toggleEl,"on"),o.Z.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(e){e.stopImmediatePropagation()}},{key:"createEl",value:function(e,n,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),o.Z.dom.setAttribute(this.toggleEl,"id","poi-toggle"),o.Z.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);var r,a,s,c=(r=t,a=this,"function"==typeof(s=te(ne(1&3?r.prototype:r),"createEl",a))?function(e){return s.apply(a,e)}:s)([e,{className:"vjs-menu-item cv-cog-menu-item cv-poi-toggle",innerHTML:'\n <span for="poi-toggle" class="vjs-menu-item-text">Points of Interest</span>\n <span class="cv-toggle-container"></span>'},i]);return c.children[1].appendChild(this.toggleEl),c}}],i&&Q(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("MenuItem"));function oe(e){return oe="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},oe(e)}function ae(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,se(i.key),i)}}function se(e){var t=function(e){if("object"!=oe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oe(t)?t:t+""}function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ce=function(){return!!e})()}function ue(e){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ue(e)}function le(e,t){return le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},le(e,t)}o.Z.registerComponent("PointsOfInterestMenuItem",re);var fe=o.Z.getPlugin("plugin"),pe="cvplayer-points-of-interest",de=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=ue(t),function(e,t){if(t&&("object"==oe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ce()?Reflect.construct(t,n||[],ue(e).constructor):t.apply(e,n))}(this,t,[e])).pointOfInterestIndicators=[],i.enabled=!0,i.pointsOfInterest=null==n?void 0:n.pointsOfInterest,i.initialize=i.initialize.bind(i),i.updateBuffered=i.updateBuffered.bind(i),i.updatePlaybackProgress=i.updatePlaybackProgress.bind(i),i.player.one("loadedmetadata",function(){return i.player.ready(i.initialize)}),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&le(e,t)}(t,e),n=t,(i=[{key:"initialize",value:function(){this.pointsOfInterest&&(L.S.hasLocalStorage()&&"false"===L.S.get(pe)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var e=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",function(){var t,n;null===(t=e.player)||void 0===t||t.off("progress",e.updateBuffered),null===(n=e.player)||void 0===n||n.off("timeupdate",e.updatePlaybackProgress)})}},{key:"togglePointsOfInterest",value:function(e){L.S.set(pe,e.toString()),this.pointOfInterestIndicators.forEach(function(t){return t.toggleVisibility(e)})}},{key:"setupTrack",value:function(){var e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach(function(t){e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})}),e.trigger({type:"loadeddata",target:e})}},{key:"createPointOfInterestIndicators",value:function(){var e,t=this,n=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.pointsOfInterest.forEach(function(e){var i=new $(t.player,{pointOfInterest:e});t.pointOfInterestIndicators.push(i),n.addChild(i)})}},{key:"addMenuItem",value:function(){var e;(null===(e=this.player.getChild("collapserator"))||void 0===e?void 0:e.getChild("cogButton")).addItem({index:0,ctor:re,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var e=this;this.pointOfInterestIndicators.forEach(function(t){return t.updateBuffered((0,A.b)(e.player))})}},{key:"updatePlaybackProgress",value:function(){var e=this;this.pointOfInterestIndicators.forEach(function(t){return t.updatePlaybackProgress(e.player.currentTime())})}}])&&ae(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(fe);function he(e){return he="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},he(e)}function ye(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ve(i.key),i)}}function ve(e){var t=function(e){if("object"!=he(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==he(t)?t:t+""}function be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(be=function(){return!!e})()}function me(e,t,n,i){var r=ge(we(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function ge(){return ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=we(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},ge.apply(null,arguments)}function we(e){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(e)}function Oe(e,t){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oe(e,t)}o.Z.registerPlugin("pointsOfInterestPlugin",de),n(59253);var Pe=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=we(t),function(e,t){if(t&&("object"==he(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,be()?Reflect.construct(t,n||[],we(e).constructor):t.apply(e,n))}(this,t,[e,n])).initialize(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oe(e,t)}(t,e),n=t,(i=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(me(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,i){return me(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),i])}},{key:"setPosition",value:function(){var e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}])&&ye(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("Component"));function Se(e){return Se="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},Se(e)}function ke(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,je(i.key),i)}}function je(e){var t=function(e){if("object"!=Se(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Se(t)?t:t+""}function Ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ce=function(){return!!e})()}function Te(e,t,n,i){var r=_e(Ee(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function _e(){return _e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Ee(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},_e.apply(null,arguments)}function Ee(e){return Ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ee(e)}function Ie(e,t){return Ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ie(e,t)}var Re=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Ee(t),function(e,t){if(t&&("object"==Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ce()?Reflect.construct(t,n||[],Ee(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ie(e,t)}(t,e),n=t,(i=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(Te(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,i){return Te(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{innerHTML:'<span class="'.concat(this.options_.iconClassName,'"></span><span>').concat(this.options_.label,"</span>"),className:this.buildCSSClass()}),i])}},{key:"handleClick",value:function(){this.options_.onPress()}}])&&ke(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("ClickableComponent"));function Me(e){return Me="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},Me(e)}function De(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,xe(i.key),i)}}function xe(e){var t=function(e){if("object"!=Me(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Me(t)?t:t+""}function Be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Be=function(){return!!e})()}function Ne(e,t,n,i){var r=Ve(Fe(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function Ve(){return Ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Fe(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},Ve.apply(null,arguments)}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}function Ae(e,t){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ae(e,t)}var Le=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Fe(t),function(e,t){if(t&&("object"==Me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Be()?Reflect.construct(t,n||[],Fe(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ae(e,t)}(t,e),n=t,(i=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(Ne(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,i){var r=Ne(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),i]),a=o.Z.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),s=o.Z.dom.createEl("div",{className:"cv-button-container"}),c=new Re(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),u=new Re(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return r.appendChild(a),r.appendChild(s),s.appendChild(c.el()),s.appendChild(u.el()),r}}])&&De(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("Component"));function Ze(e){return Ze="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},Ze(e)}function Ue(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ze(i.key),i)}}function ze(e){var t=function(e){if("object"!=Ze(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ze(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ze(t)?t:t+""}function Ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ge=function(){return!!e})()}function qe(){return qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=We(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},qe.apply(null,arguments)}function We(e){return We=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},We(e)}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},He(e,t)}var Ye=function(e){function t(e,n){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=We(t),function(e,t){if(t&&("object"==Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ge()?Reflect.construct(t,n||[],We(e).constructor):t.apply(e,n))}(this,t,[e,n])).startTime=parseFloat(n.startTime.toPrecision(4)),i.endTime=parseFloat(n.endTime.toPrecision(4)),i.dismissed=!1,i.startTime>i.endTime)throw Error("Range start cannot be greater than range end");return i.bindFunctions(),i.initialize(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&He(e,t)}(t,e),n=t,i=[{key:"bindFunctions",value:function(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}},{key:"initialize",value:function(){var e=this;this.player.one("loadedmetadata",function(){return e.player.ready(e.onReady)}),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}},{key:"onReady",value:function(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}},{key:"onTimeUpdateOrSeeked",value:function(){if(!this.dismissed){var e=this.player.currentTime();if(!(e<this.startTime))return e>this.endTime?(this.showReplayView(),this.disablePlayToggle(),this.player.pause(),void this.player.currentTime(this.endTime)):void 0;this.player.currentTime(this.startTime)}}},{key:"onReplayPress",value:function(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}},{key:"onContinuePress",value:function(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}},{key:"showRangeIndicators",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new Pe(this.player,{time:this.startTime}),null==t||t.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new Pe(this.player,{time:this.endTime}),null==t||t.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var e,t;null===(e=this.startTimeIndicator)||void 0===e||e.hide(),null===(t=this.endTimeIndicator)||void 0===t||t.hide()}},{key:"addMaskToProgressBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar"),n=null==t?void 0:t.el().getElementsByClassName("cv-chapter-bar-items");if(n&&n.length){var i=n[0],r=this.player.duration(),o=this.startTime/r*100,a=100-this.endTime/r*100;i.style.clipPath="inset(".concat(-5,"em ").concat(a,"% ").concat(-5,"em ").concat(o,"%)")}}},{key:"removeMaskFromProgressBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar"),n=null==t?void 0:t.el().getElementsByClassName("cv-chapter-bar-items");n&&n.length&&(n[0].style.clipPath="")}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new Le(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var e;null===(e=this.replayView)||void 0===e||e.hide()}},{key:"getPlayToggle",value:function(){var e=this.player.getChild("collapserator");return null==e?void 0:e.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.enable()}},{key:"disablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.disable()}},{key:"addCssClasses",value:function(){this.player.addClass("cv-range-indicator-plugin")}},{key:"removeCssClasses",value:function(){this.player.removeClass("cv-range-indicator-plugin")}},{key:"dispose",value:function(){var e,n,i,r,o,a;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(e=this.startTimeIndicator)||void 0===e||e.dispose(),null===(n=this.endTimeIndicator)||void 0===n||n.dispose(),null===(i=this.replayView)||void 0===i||i.dispose(),(r=t,o=this,"function"==typeof(a=qe(We(1&3?r.prototype:r),"dispose",o))?function(e){return a.apply(o,e)}:a)([])}}],i&&Ue(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("rangeIndicatorPlugin",Ye),n(6088),n(16284);var Xe=function(){var e,t,n;return null!==(n=null===(t=null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)||void 0===t?void 0:t.call(e))&&void 0!==n?n:Math.random().toString()},$e=n(10463);function Je(e){return Je="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},Je(e)}function Qe(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var c=i&&i.prototype instanceof s?i:s,u=Object.create(c.prototype);return Ke(u,"_invoke",function(n,i,r){var o,s,c,u=0,l=r||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,s=0,c=e,p.n=n,a}};function d(n,i){for(s=n,c=i,t=0;!f&&u&&!r&&t<l.length;t++){var r,o=l[t],d=p.p,h=o[2];n>3?(r=h===i)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((r=n<2&&d<o[1])?(s=0,p.v=i,p.n=o[1]):d<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw f=!0,i}return function(r,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){o||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=p.n<0)?c:n.call(i,p))!==a)break}catch(t){o=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,r,o),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(Ke(t={},i,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ke(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,Ke(f,"constructor",u),Ke(u,"constructor",c),c.displayName="GeneratorFunction",Ke(u,r,"GeneratorFunction"),Ke(f),Ke(f,r,"Generator"),Ke(f,i,function(){return this}),Ke(f,"toString",function(){return"[object Generator]"}),(Qe=function(){return{w:o,m:p}})()}function Ke(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}Ke=function(e,t,n,i){if(t)r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n;else{var o=function(t,n){Ke(e,t,function(e){return this._invoke(t,n,e)})};o("next",0),o("throw",1),o("return",2)}},Ke(e,t,n,i)}function et(e){return function(e){if(Array.isArray(e))return tt(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 tt(e,t);var n={}.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)?tt(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.")}()}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function nt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,it(i.key),i)}}function it(e){var t=function(e){if("object"!=Je(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Je(t)?t:t+""}function rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(rt=function(){return!!e})()}function ot(e,t,n,i){var r=at(st(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function at(){return at="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=st(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},at.apply(null,arguments)}function st(e){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},st(e)}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ct(e,t)}var ut=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=st(t),function(e,t){if(t&&("object"==Je(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rt()?Reflect.construct(t,n||[],st(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ct(e,t)}(t,e),n=t,(i=[{key:"getPlayerOptions",value:function(){var e,n=ot(t,"getPlayerOptions",this,3)([]);return this.options.allowTranscript&&(n.allowTranscript=!0),(null===(e=n.devicesConfig)||void 0===e?void 0:e.canUserCastToDevices)?Object.assign(Object.assign({},n),{techOrder:["devices"].concat(et(n.techOrder)),devices:{instanceId:Xe()}}):n}},{key:"configurePlugins",value:function(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(e=this.options.pointsOfInterest)||void 0===e?void 0:e.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest}),this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}catch(e){console.log("failed to register plugins",e)}}},{key:"setNextVideo",value:function(e,t,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(e,t,n)}},{key:"togglePictureInPicture",value:function(e){var t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}},{key:"toggleTheatreMode",value:function(e){var t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}},{key:"toggleTranscript",value:function(e){if(this.player.viewTranscriptPlugin){var t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}}},{key:"hasStarted",value:function(){return this.player.hasStarted()}},{key:"additionalSetup",value:function(e){var n,i,r,o,a=this,s=Object.create(null,{additionalSetup:{get:function(){return ot(t,"additionalSetup",a,1)}}});return n=this,i=void 0,r=void 0,o=Qe().m(function t(){var n;return Qe().w(function(t){for(;;)switch(t.n){case 0:if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),s.additionalSetup.call(this,e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==e.mediaType){t.n=2;break}if(null!==(n=e.additionalData)){t.n=1;break}throw Error("Invalid clip data");case 1:this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime});case 2:"MasterVideo"===e.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 3:return t.a(2)}},t,this)}),new(r||(r=Promise))(function(e,t){function a(e){try{c(o.next(e))}catch(e){t(e)}}function s(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(n,i||[])).next())})}},{key:"setupAnalyticsDependentPlugins",value:function(e){var n;ot(t,"setupAnalyticsDependentPlugins",this,3)([e]),this.options.allowTranscript&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),(null===(n=this.options.devicesConfig)||void 0===n?void 0:n.canUserCastToDevices)&&this.player.devicesPlugin&&this.player.devicesPlugin(Object.assign(Object.assign({},this.options.devicesConfig),{userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService}))}},{key:"setActivityStatus",value:function(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}},{key:"addTranscript",value:function(e){return $e.O.getTrack(this.player,"metadata","transcript",e)?null:this.player.addTextTrack("metadata","transcript",e)}},{key:"useCurrentTranscript",value:function(e,t){return $e.O.useMetadataTracks(this.player,"transcript",e,t)}}])&&nt(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(r.r),lt=n(63816),ft=n(65858),pt=n(86086),dt=n(12399),ht=n(6156),yt=n(11707);function vt(e){return vt="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},vt(e)}function bt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,mt(i.key),i)}}function mt(e){var t=function(e){if("object"!=vt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vt(t)?t:t+""}var gt={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},wt=function(){return e=function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gt;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bindFunctions(),this.url=t,this.options=Object.assign(Object.assign({},gt),i),this.webSocket=this.connect(),this.heartbeat=(new yt.b).schedule(function(){return n.send(n.options.heartbeatMessage)}).every(this.options.heartbeatIntervalInMillseconds)},(t=[{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(e){var t;null===(t=this.onOpen)||void 0===t||t.call(this,e),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(e){var t;null===(t=this.onMessage)||void 0===t||t.call(this,e)}},{key:"handleClose",value:function(e){var t,n=this;null===(t=this.onClose)||void 0===t||t.call(this,e),this.cleanup(),setTimeout(function(){n.webSocket=n.connect()},this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(e){var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.handleClose()}},{key:"connect",value:function(){var e=new WebSocket(this.url);return e.addEventListener("open",this.handleOpen),e.addEventListener("message",this.handleMessage),e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),e}},{key:"send",value:function(e){this.webSocket.send(e)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&bt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Ot=n(95569),Pt=n(35884);function St(e){return St="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},St(e)}function kt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,jt(i.key),i)}}function jt(e){var t=function(e){if("object"!=St(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=St(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==St(t)?t:t+""}var Ct,Tt=function(){return e=function e(t,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=t,this.device=n,this.ready=!1,this.playbackFinished=!1,this.debounced=Pt.l.withDebouncedSetters(this,2e3),Pt.l.withTimestampedSetters(this)},(t=[{key:"position",get:function(){return this._position+this.getTimerDurationInSeconds()},set:function(e){this._position=e,this.restartTimer()}},{key:"playing",get:function(){return this._playing},set:function(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}},{key:"restartTimer",value:function(){this._timerStartedAt=Date.now()}},{key:"stopTimer",value:function(){this._timerStartedAt=0}},{key:"getTimerDurationInSeconds",value:function(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}])&&kt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function _t(e){return _t="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},_t(e)}function Et(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var c=i&&i.prototype instanceof s?i:s,u=Object.create(c.prototype);return It(u,"_invoke",function(n,i,r){var o,s,c,u=0,l=r||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,s=0,c=e,p.n=n,a}};function d(n,i){for(s=n,c=i,t=0;!f&&u&&!r&&t<l.length;t++){var r,o=l[t],d=p.p,h=o[2];n>3?(r=h===i)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((r=n<2&&d<o[1])?(s=0,p.v=i,p.n=o[1]):d<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw f=!0,i}return function(r,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){o||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=p.n<0)?c:n.call(i,p))!==a)break}catch(t){o=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,r,o),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(It(t={},i,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,It(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,It(f,"constructor",u),It(u,"constructor",c),c.displayName="GeneratorFunction",It(u,r,"GeneratorFunction"),It(f),It(f,r,"Generator"),It(f,i,function(){return this}),It(f,"toString",function(){return"[object Generator]"}),(Et=function(){return{w:o,m:p}})()}function It(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}It=function(e,t,n,i){if(t)r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n;else{var o=function(t,n){It(e,t,function(e){return this._invoke(t,n,e)})};o("next",0),o("throw",1),o("return",2)}},It(e,t,n,i)}function Rt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Mt(i.key),i)}}function Mt(e){var t=function(e){if("object"!=_t(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_t(t)?t:t+""}function Dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Dt=function(){return!!e})()}function xt(){return xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Bt(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},xt.apply(null,arguments)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bt(e)}function Nt(e,t){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nt(e,t)}!function(e){e.Update="update",e.Volume="volume",e.Playing="playing",e.Paused="paused",e.NewChapter="new_chapter",e.Stopped="stopped",e.Ready="ready",e.Mute="mute",e.Finished="finished",e.Subtitles="subtitles"}(Ct||(Ct={}));var Vt=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((i=i.apply(e,t||[])).next())})},Ft=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=Bt(t),function(e,t){if(t&&("object"==_t(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dt()?Reflect.construct(t,n||[],Bt(e).constructor):t.apply(e,n))}(this,t)).client=e,i.localState=new Tt(n.title,n.device),i.bindFunctions(),i.initialize(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nt(e,t)}(t,e),n=t,i=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.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 e=this;this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter(function(t){return t.source===e.getDevice().id&&"disconnect"===t.message.type}),this.client.on("message",this.handleAllVideoMessages).filter(function(t){return t.source===e.getDevice().id&&"video_event"===t.message.type})}},{key:"dispose",value:function(){var e,n,i;this.client.off("dispose",this.dispose),this.client.off("connected",this.handleClientConnected),this.client.off("message",this.handleDisconnectMessage),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(function(e){return console.error(e)}),(e=t,n=this,"function"==typeof(i=xt(Bt(1&3?e.prototype:e),"dispose",n))?function(e){return i.apply(n,e)}:i)([])}},{key:"handleClientConnected",value:function(){return Vt(this,void 0,void 0,Et().m(function e(){var t;return Et().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,this.client.joinRoom(this.getDevice().id);case 1:e.n=3;break;case 2:e.p=2,t=e.v,this.trigger("error",t);case 3:return e.a(2)}},e,this,[[0,2]])}))}},{key:"handleDisconnectMessage",value:function(){this.dispose()}},{key:"handleAllVideoMessages",value:function(e){var t=this.localState.debounced,n=e.message.payload.params||{};switch(e.message.payload.event){case Ct.Update:this.handleUpdateMessage(t,n);break;case Ct.NewChapter:this.handleNewChapterMessage(t,n);break;case Ct.Volume:this.handleVolumeMessage(t,n);break;case Ct.Playing:this.handlePlayingMessage(t);break;case Ct.Paused:this.handlePausedMessage(t);break;case Ct.Finished:this.handleFinishedMessage(t);break;case Ct.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",ht.j.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",ht.j.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",ht.j.void))}},{key:"handleVolumeMessage",value:function(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=0===t.level,this.trigger("volumechange",ht.j.void))}},{key:"handlePlayingMessage",value:function(e){!0!==e.playing&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",ht.j.void))}},{key:"handlePausedMessage",value:function(e){!1!==e.playing&&(e.playing=!1,this.trigger("playingchange",ht.j.void))}},{key:"handleFinishedMessage",value:function(e){!0!==e.playbackFinished&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",ht.j.void))}},{key:"handleNewChapterMessage",value:function(e,t){var n,i=(null!==(n=t.queue)&&void 0!==n?n:[]).find(function(t){return t.url===e.videoSource});if(!i)return console.info("The device is no longer playing the source we loaded - disposing the session"),void this.dispose();e.subtitleSource!==i.suburl&&(e.subtitleSource=i.suburl,this.trigger("subtitleschange",ht.j.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(e,t){return Vt(this,void 0,void 0,Et().m(function n(){var i,r,o;return Et().w(function(n){for(;;)switch(n.n){case 0:if(this.localState.videoSource!==e||this.localState.subtitleSource!==t){n.n=1;break}return n.a(2);case 1:return n.p=1,i=this.getDevice().id,r=this.getPosition(),this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,n.n=2,this.client.joinRoom(i);case 2:return n.n=3,this.client.loadQueue({title:this.getTitle(),roomId:i,videoSource:e,subtitleSource:t});case 3:this.localState.ready=!0,this.trigger("sourceloaded",ht.j.void),r>0&&this.seek(r),t&&this.setSubtitles(t),n.n=5;break;case 4:n.p=4,o=n.v,console.error(o),this.trigger("error",new Error("Could not load video on Vivi device"));case 5:return n.a(2)}},n,this,[[1,4]])}))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",ht.j.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",ht.j.void))}},{key:"seek",value:function(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",ht.j.void))}},{key:"setVolume",value:function(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",ht.j.void))}},{key:"setMuted",value:function(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",ht.j.void))}},{key:"setSubtitles",value:function(e){return Vt(this,void 0,void 0,Et().m(function t(){var n;return Et().w(function(t){for(;;)switch(t.n){case 0:if(this.localState.ready){t.n=1;break}return t.a(2);case 1:if(!e){t.n=2;break}return t.n=2,this.loadSource(this.localState.videoSource,e);case 2:n=!!e,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",ht.j.void));case 3:return t.a(2)}},t,this)}))}},{key:"isPlaying",value:function(){return this.localState.playing}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackFinished}},{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}}],i&&Rt(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(ht.N);function At(e){return At="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},At(e)}function Lt(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var c=i&&i.prototype instanceof s?i:s,u=Object.create(c.prototype);return Zt(u,"_invoke",function(n,i,r){var o,s,c,u=0,l=r||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,s=0,c=e,p.n=n,a}};function d(n,i){for(s=n,c=i,t=0;!f&&u&&!r&&t<l.length;t++){var r,o=l[t],d=p.p,h=o[2];n>3?(r=h===i)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((r=n<2&&d<o[1])?(s=0,p.v=i,p.n=o[1]):d<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw f=!0,i}return function(r,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){o||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=p.n<0)?c:n.call(i,p))!==a)break}catch(t){o=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,r,o),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(Zt(t={},i,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Zt(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,Zt(f,"constructor",u),Zt(u,"constructor",c),c.displayName="GeneratorFunction",Zt(u,r,"GeneratorFunction"),Zt(f),Zt(f,r,"Generator"),Zt(f,i,function(){return this}),Zt(f,"toString",function(){return"[object Generator]"}),(Lt=function(){return{w:o,m:p}})()}function Zt(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}Zt=function(e,t,n,i){if(t)r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n;else{var o=function(t,n){Zt(e,t,function(e){return this._invoke(t,n,e)})};o("next",0),o("throw",1),o("return",2)}},Zt(e,t,n,i)}function Ut(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,zt(i.key),i)}}function zt(e){var t=function(e){if("object"!=At(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==At(t)?t:t+""}function Gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gt=function(){return!!e})()}function qt(){return qt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Wt(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},qt.apply(null,arguments)}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wt(e)}function Ht(e,t){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ht(e,t)}var Yt=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((i=i.apply(e,t||[])).next())})},Xt=1e4,$t=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Wt(t),function(e,t){if(t&&("object"==At(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gt()?Reflect.construct(t,n||[],Wt(e).constructor):t.apply(e,n))}(this,t)).options=e,n.accessToken="",n.devices=[],n.devicesFingerprint="",n.deviceDiscovery=new yt.b,n.bindFunctions(),n.initialize(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ht(e,t)}(t,e),n=t,i=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=(0,Ot.Ds)(this.sendMessage,500,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.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 e=this;this.webSocket=new wt(this.options.url),this.webSocket.onMessage=function(t){return e.trigger("message",JSON.parse(t.data))},this.webSocket.onOpen=function(){return Yt(e,void 0,void 0,Lt().m(function e(){var t;return Lt().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,this.options.fetchAccessToken();case 1:return this.accessToken=e.v,e.n=2,this.authenticateWithVivi();case 2:this.beginDeviceDiscovery(),this.trigger("connected",ht.j.void),e.n=4;break;case 3:e.p=3,t=e.v,console.error(t),this.trigger("error",new Error("Could not connect to Vivi"));case 4:return e.a(2)}},e,this,[[0,3]])}))}}},{key:"sendMessage",value:function(e){var t;null===(t=this.webSocket)||void 0===t||t.send(JSON.stringify(e))}},{key:"beginDeviceDiscovery",value:function(){var e=this;this.deviceDiscovery.every(1e4).schedule(function(){return Yt(e,void 0,void 0,Lt().m(function e(){var n,i,r,o,a;return Lt().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,this.getRoomList();case 1:if(n=e.v,(i=t.calculateFingerprint(n))!==this.devicesFingerprint){e.n=2;break}return e.a(2);case 2:r=new Set(n.map(function(e){var t;return null!==(t=e.organisation)&&void 0!==t?t:""})).size,o=new Set(n.map(function(e){var t;return null!==(t=e.location)&&void 0!==t?t:""})).size,this.devices=n.map(function(e){return{id:e.id,name:e.name,schoolName:r>1?e.organisation:"",description:o>1?e.location:"",type:dt.Y.Vivi,status:dt.L.Available}}),this.devicesFingerprint=i,this.trigger("deviceschange",ht.j.void),e.n=4;break;case 3:e.p=3,a=e.v,console.warn(a);case 4:return e.a(2)}},e,this,[[0,3]])}))}).trigger().start()}},{key:"dispose",value:function(){var e,n,i,r;this.deviceDiscovery.stop(),null===(e=this.webSocket)||void 0===e||e.dipose(),(n=t,i=this,"function"==typeof(r=qt(Wt(1&3?n.prototype:n),"dispose",i))?function(e){return r.apply(i,e)}:r)([])}},{key:"canCastToDevice",value:function(e){return e===dt.Y.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(e){return new Ft(this,e)}},{key:"authenticateWithVivi",value:function(){return Yt(this,void 0,void 0,Lt().m(function e(){return Lt().w(function(e){for(;;)switch(e.n){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),e.n=1,this.one("message",function(e){return"video_api_identified"===e.message.type}).timeout(Xt).catch(function(){throw new Error("Failed to authenticate with Vivi")});case 1:return e.a(2)}},e,this)}))}},{key:"getRoomList",value:function(){return Yt(this,void 0,void 0,Lt().m(function e(){var t;return Lt().w(function(e){for(;;)switch(e.n){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),e.n=1,this.one("message",function(e){return"video_api_rooms"===e.message.type}).timeout(Xt).catch(function(){throw new Error("Failed to fetch rooms")});case 1:return t=e.v,e.a(2,t.message.rooms||[])}},e,this)}))}},{key:"joinRoom",value:function(e){return Yt(this,void 0,void 0,Lt().m(function t(){return Lt().w(function(t){for(;;)switch(t.n){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:e,token:this.accessToken,type:"connect"}}),t.n=1,this.one("message",function(t){return t.source===e&&"connect"===t.message.type||"error"===t.message.type&&"already_connected"===t.message.error_type||void 0}).timeout(Xt).catch(function(){throw new Error("Failed to join room")});case 1:return t.a(2)}},t,this)}))}},{key:"query",value:function(e){return Yt(this,void 0,void 0,Lt().m(function n(){var i;return Lt().w(function(n){for(;;)switch(n.n){case 0:return i=t.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:i,name:"query"}}),n.n=1,this.one("message",function(e){return e.message.ack_id===i}).timeout(Xt).catch(function(){throw new Error("Failed to fetch query")});case 1:return n.a(2,n.v)}},n,this)}))}},{key:"loadQueue",value:function(e){var n=e.roomId,i=e.title,r=e.videoSource,o=e.subtitleSource;return Yt(this,void 0,void 0,Lt().m(function e(){return Lt().w(function(e){for(;;)switch(e.n){case 0:return this.sendMessage({destination:n,message:{type:"message_with_ack",ack_id:t.createAckId(),name:"queue_load",payload:{urls:[{title:i,url:r,suburl:o}]}}}),e.n=1,this.one("message",function(e){var t;return e.source===n&&"ready"===(null===(t=e.message.payload)||void 0===t?void 0:t.event)}).timeout(Xt).catch(function(){throw new Error("Failed to load media")});case 1:return e.a(2)}},e,this)}))}},{key:"play",value:function(e){return Yt(this,void 0,void 0,Lt().m(function t(){return Lt().w(function(t){for(;;)switch(t.n){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_play",payload:{}}}),t.n=1,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(Xt).catch(function(){throw new Error("Failed to play video")});case 1:return t.a(2)}},t,this)}))}},{key:"pause",value:function(e){return Yt(this,void 0,void 0,Lt().m(function t(){return Lt().w(function(t){for(;;)switch(t.n){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_pause"}}),t.n=1,this.one("message",function(t){var n;return t.source===e&&"paused"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)}).timeout(Xt).catch(function(){throw new Error("Failed to pause video")});case 1:return t.a(2)}},t,this)}))}},{key:"stop",value:function(e){return Yt(this,void 0,void 0,Lt().m(function t(){return Lt().w(function(t){for(;;)switch(t.n){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_stop"}}),t.n=1,this.one("message",function(t){var n;return t.source===e&&"stopped"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)}).timeout(Xt).catch(function(){throw new Error("Failed to stop video")});case 1:return t.a(2)}},t,this)}))}},{key:"seek",value:function(e,t){return Yt(this,void 0,void 0,Lt().m(function n(){return Lt().w(function(n){for(;;)switch(n.n){case 0:if(!this.sendMessageDebounced({destination:e,message:{type:"message",name:"video_seek",payload:{position:t}}})){n.n=1;break}return n.n=1,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(Xt).catch(function(){throw new Error("Failed to seek video")});case 1:return n.a(2)}},n,this)}))}},{key:"setVolume",value:function(e,t){return Yt(this,void 0,void 0,Lt().m(function n(){return Lt().w(function(n){for(;;)switch(n.n){case 0:if(!this.sendMessageDebounced({destination:e,message:{type:"message",name:"set_volume",payload:{volume:t}}})){n.n=1;break}return n.n=1,this.one("message",function(t){var n;return t.source===e&&"volume"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)}).timeout(Xt).catch(function(){throw new Error("Failed to set volume")});case 1:return n.a(2)}},n,this)}))}},{key:"setMuted",value:function(e,t){return Yt(this,void 0,void 0,Lt().m(function n(){return Lt().w(function(n){for(;;)switch(n.n){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"set_mute",payload:{mute:t}}}),n.n=1,this.one("message",function(t){var n;return t.source===e&&"mute"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)}).timeout(Xt).catch(function(){throw new Error("Failed to set mute")});case 1:return n.a(2)}},n,this)}))}},{key:"setSubtitles",value:function(e,n){return Yt(this,void 0,void 0,Lt().m(function i(){var r;return Lt().w(function(i){for(;;)switch(i.n){case 0:return r=t.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:r,name:"set_subtitles",payload:{subtitles:n}}}),i.n=1,this.one("message",function(t){var n;return t.source===e&&"subtitles"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)}).timeout(Xt).catch(function(){throw new Error("Failed to set subtitles")});case 1:return i.a(2)}},i,this)}))}}],r=[{key:"createAckId",value:function(){return Xe()}},{key:"calculateFingerprint",value:function(e){return e.map(function(e){return e.id}).sort().join(",")}}],i&&Ut(n.prototype,i),r&&Ut(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,r}(ht.N);function Jt(e){return Jt="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},Jt(e)}function Qt(e){return function(e){if(Array.isArray(e))return Kt(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 Kt(e,t);var n={}.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)?Kt(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.")}()}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function en(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,tn(i.key),i)}}function tn(e){var t=function(e){if("object"!=Jt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jt(t)?t:t+""}function nn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nn=function(){return!!e})()}function rn(){return rn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=on(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},rn.apply(null,arguments)}function on(e){return on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},on(e)}function an(e,t){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},an(e,t)}var sn=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=on(t),function(e,t){if(t&&("object"==Jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nn()?Reflect.construct(t,n||[],on(e).constructor):t.apply(e,n))}(this,t)).instanceId=e,n.clients=[],n.bindFunctions(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&an(e,t)}(t,e),n=t,i=[{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(e){var t=this;e.on("deviceschange",this.gatherAndPublishDevices),e.on("error",function(e){return t.trigger("error",e)}),this.clients.push(e)}},{key:"hasInstanceOfClient",value:function(e){return this.clients.some(function(t){return t instanceof e})}},{key:"startCastSession",value:function(e){var t=this;if(this.castSession){if(this.castSession.getDevice().id===e.device.id)return void console.info("A session with device ".concat(e.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find(function(t){return t.canCastToDevice(e.device.type)});n&&(this.castSession=n.startCastSession(e),this.castSession.on("error",function(e){t.castSession.dispose(),t.trigger("error",e)}),this.castSession.on("dispose",function(){t.castSession=void 0,t.trigger("castsessionchange",void 0)}),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var e=this.clients.map(function(e){return e.getDevices()}).reduce(function(e,t){return[].concat(Qt(e),Qt(t))},[]);this.trigger("deviceschange",e)}},{key:"dispose",value:function(){var e,n,i,r;null===(e=this.castSession)||void 0===e||e.dispose(),this.clients.forEach(function(e){return e.dispose()}),this.castSession=void 0,this.clients=[],(n=t,i=this,"function"==typeof(r=rn(on(1&3?n.prototype:n),"dispose",i))?function(e){return r.apply(i,e)}:r)([])}}],r=[{key:"getOrCreateInstance",value:function(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new t(e)),this.instances[e]}},{key:"disposeAndRemoveInstance",value:function(e){e.dispose(),delete this.instances[e.instanceId]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],i&&en(n.prototype,i),r&&en(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,r}(ht.N);sn.instances={};var cn=n(30050),un=n(61384);function ln(e){return ln="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},ln(e)}function fn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,pn(i.key),i)}}function pn(e){var t=function(e){if("object"!=ln(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ln(t)?t:t+""}function dn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(dn=function(){return!!e})()}function hn(e,t,n,i){var r=yn(vn(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function yn(){return yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=vn(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},yn.apply(null,arguments)}function vn(e){return vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vn(e)}function bn(e,t){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bn(e,t)}var mn=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=vn(t),function(e,t){if(t&&("object"==ln(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dn()?Reflect.construct(t,n||[],vn(e).constructor):t.apply(e,n))}(this,t,[e,n])).isVisible=i.isVisible.bind(i),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bn(e,t)}(t,e),n=t,(i=[{key:"createEl",value:function(){var e,n,i=hn(t,"createEl",this,3)(["li",{className:"vjs-menu-item cv-device-menu-item"}]),r=o.Z.dom.createEl("div",{className:"cv-device-menu-item-body",innerHTML:'\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <div>\n <span class="vjs-menu-item-text">').concat(this.options_.label,'</span>\n <span class="vjs-menu-item-text cv-device-truncated-text">').concat(null!==(e=this.options_.schoolName)&&void 0!==e?e:"",'</span>\n <span class="vjs-menu-item-text cv-device-truncated-text cv-device-description">').concat(null!==(n=this.options_.description)&&void 0!==n?n:"","</span>\n </div>\n ")});return i.replaceChildren(r),i}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){hn(t,"show",this,3)([])}},{key:"hide",value:function(){hn(t,"hide",this,3)([])}},{key:"isVisible",value:function(){return!hn(t,"hasClass",this,3)(["vjs-hidden"])}}])&&fn(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("MenuItem")),gn=n(86777),wn=n(78651);function On(e){return On="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},On(e)}function Pn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Sn(i.key),i)}}function Sn(e){var t=function(e){if("object"!=On(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==On(t)?t:t+""}function kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kn=function(){return!!e})()}function jn(e){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jn(e)}function Cn(e,t){return Cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cn(e,t)}var Tn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=jn(t),function(e,t){if(t&&("object"==On(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kn()?Reflect.construct(t,n||[],jn(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(t,e),n=t,(i=[{key:"createEl",value:function(){var e=wn.W.apply(this),t=this.contentEl_;return this.contentWrapper=o.Z.dom.createEl("div",{className:"vjs-menu-content"}),e.className="vjs-menu cv-devices-menu",t.className="cv-devices-menu-item-list",e.removeChild(t),e.appendChild(this.contentWrapper),this.contentWrapper.appendChild(t),this.simpleBar=new gn.Z(t,{autoHide:!1}),e}},{key:"addCta",value:function(e){this.ctaElement?console.warn("CTA has already been added to the menu - this is a no-op"):(this.ctaElement=e.el(),this.contentWrapper.prepend(this.ctaElement),this.el().classList.add("has-cta"))}},{key:"removeCta",value:function(){this.ctaElement&&(this.contentWrapper.removeChild(this.ctaElement),this.el().classList.remove("has-cta"))}}])&&Pn(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("Menu"));o.Z.registerComponent("DevicesMenu",Tn);var _n=n(14735);function En(e){var t=e.inactiveIntegrations,n=e.canUserManageIntegrations,r=e.player,o=e.onDismiss,a=e.onInstall,s=e.onLearnMore,c=e.onContactSupport;if(0===t.length)return i.createElement(i.Fragment,null);var u,l=function(e){return r.localize(e)},f=function(e){return-1!==t.indexOf(e)};return u=f(dt.Y.AppleTv)&&f(dt.Y.Vivi)?"vivi_and_apple_tv":f(dt.Y.Vivi)?"vivi":"apple_tv",i.createElement("div",{className:"cv-devices-cta",tabIndex:-1},i.createElement(In,{context:u,localize:l,onDismiss:function(){return o(u)}}),i.createElement(Rn,{context:u}),i.createElement(Mn,{context:u,canUserManageIntegrations:n,localize:l,onContactSupport:function(){return c(u)},onInstall:function(){return a(u)},onLearnMore:function(){return s(u)}}))}function In(e){var t=e.context,n=e.localize,r=e.onDismiss;return i.createElement("div",{className:"cv-devices-cta-header"},i.createElement("span",{className:"cv-devices-badge"},n("New")),i.createElement("span",{className:"cv-devices-title"},"vivi_and_apple_tv"===t&&n("Cast to Vivi and Apple TV"),"vivi"===t&&n("Cast to Vivi"),"apple_tv"===t&&n("Cast to Apple TV")),i.createElement("span",{className:"cv-devices-close",onClick:r},i.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"white",d:"M11.9588 10.6413L16.3612 6.34478C16.7361 5.97191 17.3439 5.97191 17.7188 6.34478C18.0937 6.71764 18.0937 7.32218 17.7188 7.69505L13.3165 11.9916L17.7188 16.3701C18.0937 16.7429 18.0937 17.3475 17.7188 17.7203C17.3439 18.0932 16.7361 18.0932 16.3612 17.7203L11.9588 13.3419L7.63882 17.7203C7.26392 18.0932 6.65608 18.0932 6.28118 17.7203C5.90627 17.3475 5.90627 16.7429 6.28118 16.3701L10.6012 11.9916L6.28118 7.62993C5.90627 7.25706 5.90627 6.65252 6.28118 6.27965C6.65608 5.90678 7.26392 5.90678 7.63882 6.27965L11.9588 10.6413Z"}))))}function Rn(e){var t=e.context,n="vivi_and_apple_tv"===t?"bg-vivi-and-apple":"vivi"===t?"bg-vivi":"bg-apple";return i.createElement("div",{className:"cv-devices-cta-body ".concat(n)},("vivi_and_apple_tv"===t||"apple_tv"===t)&&i.createElement("div",{className:"cv-devices-icon-container"},i.createElement("span",{className:"cv-devices-icon apple"})),("vivi_and_apple_tv"===t||"vivi"===t)&&i.createElement("div",{className:"cv-devices-icon-container"},i.createElement("span",{className:"cv-devices-icon vivi"})))}function Mn(e){var t=e.context,n=e.canUserManageIntegrations,r=e.localize,o=e.onInstall,a=e.onLearnMore,s=e.onContactSupport;return n?i.createElement("div",{className:"cv-devices-cta-footer"},i.createElement("span",null,"vivi_and_apple_tv"===t&&r("Discover our new device integrations to make presenting in the classroom easy!"),"vivi"===t&&r("Discover our new Vivi integration."),"apple_tv"===t&&r("Discover our new Apple TV integration.")),i.createElement("br",null),i.createElement("span",{className:"cv-devices-link",onClick:o},r("Click here to install"))):i.createElement("div",{className:"cv-devices-cta-footer"},i.createElement("span",null,"vivi_and_apple_tv"===t&&r("Cast to Vivi and Apple TV is now available! Please contact "),"vivi"===t&&r("Cast to Vivi is now available! Please contact "),"apple_tv"===t&&r("Cast to Apple TV is now available! Please contact ")),i.createElement("span",{className:"cv-devices-link",onClick:s},"ClickView Support"),i.createElement("span",null,"vivi_and_apple_tv"===t&&r(" or your administrator to set up Apple TV and Vivi."),"vivi"===t&&r(" or your administrator to set up Vivi."),"apple_tv"===t&&r(" or your administrator to set up Apple TV.")),i.createElement("br",null),i.createElement("span",{className:"cv-devices-link",onClick:a},"Learn more"))}function Dn(e){return Dn="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},Dn(e)}function xn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Bn(i.key),i)}}function Bn(e){var t=function(e){if("object"!=Dn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dn(t)?t:t+""}function Nn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Nn=function(){return!!e})()}function Vn(e,t,n,i){var r=Fn(An(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function Fn(){return Fn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=An(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},Fn.apply(null,arguments)}function An(e){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},An(e)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ln(e,t)}o.Z.registerComponent("DevicesCta",(0,_n.Z)(function(e,t){return i.createElement(En,Object.assign({player:e},t))},{properties:{className:"cv-devices-cta-wrapper"}}));var Zn=o.Z.getComponent("DevicesCta"),Un=o.Z.getComponent("MenuButton"),zn=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=An(t),function(e,t){if(t&&("object"==Dn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Nn()?Reflect.construct(t,n||[],An(e).constructor):t.apply(e,n))}(this,t,[e,n])).alwaysCollapsed=!1,i.isCollapsed=!1,i.isCollabsible=!0,i.className="cv-devices-menu-button",i.searchText="",i.devices=[],i.castSession=void 0,i.bindFunctions(),i.bindEventListeners(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ln(e,t)}(t,e),n=t,i=[{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.showNotificationBadge=this.showNotificationBadge.bind(this),this.hideNotificationBadge=this.hideNotificationBadge.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 e=this,t=this.$("button"),n=function(t){e.menu.handleBlur(t)};t.addEventListener("blur",n),this.one("dispose",function(){var i;t.removeEventListener("blur",n),null===(i=e.cta)||void 0===i||i.dispose()})}},{key:"createEl",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=Un.prototype.createEl).apply.apply(e,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(Vn(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createMenu",value:function(){var e=this,t=new Tn(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){var n=this.options_.ctaOptions,i=n.onDismiss,r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(n,["onDismiss"]);this.cta=new Zn(this.player(),Object.assign(Object.assign({},r),{onDismiss:function(n){e.hideNotificationBadge(),t.removeCta(),i(n)}})),this.showNotificationBadge(),t.addCta(this.cta)}return this.createItems().forEach(function(e){return t.addItem(e)}),t}},{key:"createItems",value:function(){var e=this,t=[];return this.headingItem=new cn.Z(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new un.Z(this.player_,{menuButton:this,search:function(t){return e.setSearchText(t)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new un.C(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),t.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),t}},{key:"pressButton",value:function(){var e;Vn(t,"pressButton",this,3)([]),this.shouldShowSearchInput()&&(null===(e=this.searchInputItem)||void 0===e||e.focus())}},{key:"setDevices",value:function(e){this.devices=e,this.render()}},{key:"setCastSession",value:function(e){this.castSession=e,this.render()}},{key:"setSearchText",value:function(e){this.searchText=e,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter(function(e){return e instanceof mn})}},{key:"showNotificationBadge",value:function(){this.addClass("notification-badge")}},{key:"hideNotificationBadge",value:function(){this.removeClass("notification-badge")}},{key:"render",value:function(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(e){var t=this;e.forEach(function(e){t.menu.removeChild(e),e.dispose()})}},{key:"addMenuItemsForDevices",value:function(e){var t=this;e.sort(function(e,t){var n,i,r,o,a="".concat(e.type).concat(null!==(n=e.schoolName)&&void 0!==n?n:"").concat(null!==(i=e.description)&&void 0!==i?i:"").concat(e.name),s="".concat(t.type).concat(null!==(r=t.schoolName)&&void 0!==r?r:"").concat(null!==(o=t.description)&&void 0!==o?o:"").concat(t.name);return a.localeCompare(s)}).forEach(function(e){var n=new mn(t.player(),{id:e.id,label:e.name,schoolName:e.schoolName,description:e.description,selected:!1,multiSelectable:!1,selectable:!0,available:e.status===dt.L.Available,type:e.type,onClick:function(){t.options_.onDeviceMenuItemClick(n,e)}});t.menu.addItem(n)})}},{key:"shouldShowSearchInput",value:function(){return this.getDeviceMenuItems().length>=20}},{key:"toggleSearchInput",value:function(){this.shouldShowSearchInput()?(this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}},{key:"toggleDeviceMenuItems",value:function(){var e=this,t=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),i=this.searchText.toLowerCase();t.forEach(function(t){var r,o,a,s=e.devices.find(function(e){return e.id===t.options_.id});if(s){var c=s.status===dt.L.Available,u=s.id===(null===(r=e.castSession)||void 0===r?void 0:r.getDevice().id),l=!n||-1!=="".concat(s.name," ").concat(null!==(o=s.schoolName)&&void 0!==o?o:""," ").concat(null!==(a=s.description)&&void 0!==a?a:"").trim().toLowerCase().indexOf(i);c?t.enable():t.disable(),l?t.show():t.hide(),u?t.selected(!0):t.selected(!1)}})}},{key:"toggleEmptyStatePlaceholder",value:function(){var e=this.getDeviceMenuItems();e.filter(function(e){return e.isVisible()}).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),e.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 e,t;return null!==(t=null===(e=this.castSession)||void 0===e?void 0:e.getDevice().name)&&void 0!==t?t:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){Vn(t,"handleClick",this,3)([null]),this.options_.onClick()}}],i&&xn(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(Un);function Gn(e){return Gn="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},Gn(e)}function qn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Wn(i.key),i)}}function Wn(e){var t=function(e){if("object"!=Gn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Gn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gn(t)?t:t+""}function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Hn=function(){return!!e})()}function Yn(){return Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Xn(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},Yn.apply(null,arguments)}function Xn(e){return Xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xn(e)}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$n(e,t)}zn.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",zn);var Jn=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Xn(t),function(e,t){if(t&&("object"==Gn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Hn()?Reflect.construct(t,n||[],Xn(e).constructor):t.apply(e,n))}(this,t,[null,e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$n(e,t)}(t,e),n=t,i=[{key:"createEl",value:function(){return(e=t,n=this,"function"==typeof(i=Yn(Xn(1&3?e.prototype:e),"createEl",n))?function(e){return i.apply(n,e)}:i)(["div",{className:"cv-devices-tech"}]);var e,n,i}},{key:"setPoster",value:function(e){this.poster=e,this.update()}},{key:"setDevice",value:function(e){this.device=e,this.update()}},{key:"update",value:function(){var e,t,n,i,r=this;this.el_.innerHTML='\n <div class="cv-devices-content">\n <p>'.concat(this.localize("Currently playing on"),'</p>\n <h2><span class="cv-device-icon ').concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[null!==(t=null===(e=this.device)||void 0===e?void 0:e.type)&&void 0!==t?t:dt.Y.Vivi],'"></span>').concat(null!==(i=null===(n=this.device)||void 0===n?void 0:n.name)&&void 0!==i?i:"",'</h2>\n </div>\n <div class="cv-devices-background" style="background-image: url(').concat(this.poster,')"></div>\n ');var o=document.createElement("button"),a=function(e){e.stopPropagation(),r.options_.onStopCasting()};o.onclick=a,o.ontouchstart=a,o.className="stop-casting-button",o.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(o)}},{key:"play",value:function(){}}],i&&qn(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("Component"));function Qn(e){return Qn="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},Qn(e)}function Kn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ei(i.key),i)}}function ei(e){var t=function(e){if("object"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qn(t)?t:t+""}function ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ti=function(){return!!e})()}function ni(e,t,n,i){var r=ii(ri(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function ii(){return ii="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ri(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},ii.apply(null,arguments)}function ri(e){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ri(e)}function oi(e,t){return oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oi(e,t)}var ai=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=ri(t),function(e,t){if(t&&("object"==Qn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ti()?Reflect.construct(t,n||[],ri(e).constructor):t.apply(e,n))}(this,t,[e,n])).featuresVolumeControl=!0,i.featuresPlaybackRate=!1,i.movingMediaElementInDOM=!1,i.featuresFullscreenResize=!0,i.featuresTimeupdateEvents=!0,i.featuresProgressEvents=!1,i.featuresNativeTextTracks=!1,i.featuresNativeAudioTracks=!1,i.featuresNativeVideoTracks=!1,i.featuresMuteControl=!0,i.featuresSourceset=!1,i.videojsPlayer=(0,o.Z)(i.options_.playerId),i.bindFunctions(),i.bindEventListeners(),i.ready(function(){i.setSource(i.options_.source)}),i.triggerReady(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oi(e,t)}(t,e),n=t,i=[{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 e=this,t=this.getCastSession();t&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",function(){t.dispose()}),t.on("durationchange",function(){e.trigger("durationchange")}),t.on("dispose",function(){e.trigger("ended"),e.hideUI()}),t.on("playingchange",function(){t.isPlaying()?(e.trigger("play"),e.trigger("playing")):e.trigger("pause")}),t.on("volumechange",function(){e.trigger("volumechange")}),t.on("sourceloaded",function(){e.trigger("loadeddata")}),t.on("subtitleschange",function(){e.setSelectedTextTrack(t.getSubtitles())}))}},{key:"onTextTrackChanged",value:function(){var e,t=this.getSelectedTextTrack();null===(e=this.getCastSession())||void 0===e||e.setSubtitles(null==t?void 0:t.src)}},{key:"getSelectedTextTrack",value:function(){return $e.O.findTrackByPredicate(this.videojsPlayer.player_,function(e){return"showing"===e.mode&&!!e.src})}},{key:"setSelectedTextTrack",value:function(e){$e.O.forEachTrack(this.videojsPlayer.player_,function(t){t.src===e?t.mode="showing":t.mode="hidden"})}},{key:"showUI",value:function(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}},{key:"hideUI",value:function(){var e;null===(e=this.ui)||void 0===e||e.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged);var e=this.getCastSession();e&&e.dispose(),ni(t,"cleanupAutoTextTracks",this,3)([]),ni(t,"dispose",this,3)([])}},{key:"createEl",value:function(){var e=this;return this.ui=this.ui||new Jn({onStopCasting:function(){var t;null===(t=e.getCastSession())||void 0===t||t.dispose()}}),this.ui.el()}},{key:"setSource",value:function(e){var t=this.getCastSession();if(t){this.showUI(t.getDevice()),this.trigger("loadstart");var n=this.getSelectedTextTrack();t.loadSource(e.src,null==n?void 0:n.src)}}},{key:"addRemoteTextTrack",value:function(e){return ni(t,"addRemoteTextTrack",this,3)([e,!0])}},{key:"getCastSession",value:function(){var e;return sn.getOrCreateInstance(null!==(e=this.options_.instanceId)&&void 0!==e?e:"").getCastSession()}},{key:"play",value:function(){var e;null===(e=this.getCastSession())||void 0===e||e.play()}},{key:"pause",value:function(){var e;null===(e=this.getCastSession())||void 0===e||e.pause()}},{key:"paused",value:function(){var e;return!1===(null===(e=this.getCastSession())||void 0===e?void 0:e.isPlaying())}},{key:"ended",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.isPlaybackFinished())&&void 0!==t&&t}},{key:"setCurrentTime",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.seek(null!=e?e:0)}},{key:"currentTime",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}},{key:"duration",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getDuration())&&void 0!==t?t:this.videojsPlayer.duration()}},{key:"volume",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getVolume())&&void 0!==t?t:1}},{key:"setVolume",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.setVolume(e)}},{key:"muted",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getMuted())&&void 0!==t&&t}},{key:"setMuted",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.setMuted(e)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return o.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(){}}],r=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(e,t){var n;return!!sn.getOrCreateInstance(null!==(n=null==t?void 0:t.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return sn.isActive()}}],i&&Kn(n.prototype,i),r&&Kn(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,r}(o.Z.getComponent("Tech"));function si(e){return si="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},si(e)}function ci(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ui(i.key),i)}}function ui(e){var t=function(e){if("object"!=si(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==si(t)?t:t+""}function li(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(li=function(){return!!e})()}function fi(){return fi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=pi(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},fi.apply(null,arguments)}function pi(e){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pi(e)}function di(e,t){return di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},di(e,t)}o.Z.registerTech("devices",ai);var hi=function(e){function t(e,n){var i,r,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=pi(t),function(e,t){if(t&&("object"==si(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,li()?Reflect.construct(t,n||[],pi(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,i.instanceId=null!==(o=null===(r=i.player.options_.devices)||void 0===r?void 0:r.instanceId)&&void 0!==o?o:"",i.bindFunctions(),i.initialize(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&di(e,t)}(t,e),n=t,i=[{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.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.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 e=this,t=this.player.getChild("collapserator"),n=null==t?void 0:t.children().findIndex(function(e){return"CustomControlSpacer"===e.name()}),i=null==t?void 0:t.children().findIndex(function(e){return"OpenExternallyButton"===e.name()}),r=Math.max(n,i)+1,o=this.getSessionManager();if(t&&n&&-1!==n&&o){o.on("deviceschange",this.onDevicesChanged),o.on("castsessionchange",this.onCastSessionChanged),o.on("error",this.onDevicesError);var a=this.options.ctaOptions,s=this.options.vivi,c=[];this.options.appleTv.enabled||c.push(dt.Y.AppleTv),s.enabled&&s.accountConnected||c.push(dt.Y.Vivi);var u={onClick:function(){e.addViviClient(o),e.addAppleTvClient(o)},onDeviceMenuItemClick:function(t,n){var i;o.startCastSession({device:n,title:e.options.title}),null===(i=e.options.analyticsService)||void 0===i||i.logUserAction(n,{actionType:ft.Vw.Select,workflowPhase:ft.eu.Complete,descriptor:ft.UX.ChangeDevice,entity:ft.py.Device,eventVersion:ft.eq.V3})},ctaOptions:Object.assign(Object.assign({},a),{inactiveIntegrations:c})};this.devicesButton=t.addChild("DevicesButton",u,r)}}},{key:"onDevicesChanged",value:function(e){var t;null===(t=this.devicesButton)||void 0===t||t.setDevices(e)}},{key:"onCastSessionChanged",value:function(e){var t;null===(t=this.devicesButton)||void 0===t||t.setCastSession(e),this.reloadTech(),e?(this.player.addClass("cv-device-casting"),this.player.addClass("cv-device-".concat(e.getDevice().type)),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass("cv-device-".concat(dt.Y.AppleTv)),this.player.removeClass("cv-device-".concat(dt.Y.Vivi)))}},{key:"onDevicesError",value:function(e){this.player.error(e.message),this.player.pause()}},{key:"addViviClient",value:function(e){if(this.options.vivi.enabled&&this.options.vivi.accountConnected&&this.options.vivi.apiUrl&&!e.hasInstanceOfClient($t)){var t=new $t({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}}},{key:"addAppleTvClient",value:function(e){if(this.options.appleTv.enabled&&this.options.trackingCode&&this.options.userId&&!e.hasInstanceOfClient(pt.w)){var t=new pt.w({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}}},{key:"reloadTech",value:function(){var e=this.player,t=e.currentSources(),n=e.volume(),i=e.muted(),r=e.currentTime(),o=e.paused();e.src(t),e.one("playing",function(){e.volume(n),e.muted(i),e.currentTime(r),o?e.pause():e.play()})}},{key:"getSessionManager",value:function(){if(this.instanceId)return sn.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var e,n,i,r=this.getSessionManager();r&&(r.off("deviceschange",this.onDevicesChanged),r.off("castsessionchange",this.onCastSessionChanged),r.off("error",this.onDevicesError),sn.disposeAndRemoveInstance(r),(e=t,n=this,"function"==typeof(i=fi(pi(1&3?e.prototype:e),"dispose",n))?function(e){return i.apply(n,e)}:i)([]))}}],i&&ci(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("devicesPlugin",hi),n(14340);var yi=n(6044),vi=n(25023);function bi(e){return bi="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},bi(e)}function mi(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,gi(i.key),i)}}function gi(e){var t=function(e){if("object"!=bi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bi(t)?t:t+""}function wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(wi=function(){return!!e})()}function Oi(){return Oi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Pi(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},Oi.apply(null,arguments)}function Pi(e){return Pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pi(e)}function Si(e,t){return Si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Si(e,t)}function ki(e){return i.createElement("div",{className:"cv-resource-item"},i.createElement(vi.s,{data:e.resource,imageCdnUrl:e.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0}))}var ji=(0,_n.Z)(function(e,t){return i.createElement(ki,Object.assign({},t))}),Ci=function(e){function t(e,n){var i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=function(e,t,n){return t=Pi(t),function(e,t){if(t&&("object"==bi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wi()?Reflect.construct(t,n||[],Pi(e).constructor):t.apply(e,n))}(this,t,[e,n]);var r=new ji(e,{resource:n.resource,imageCdnUrl:n.imageCdnUrl});return i.addChild(r),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Si(e,t)}(t,e),n=t,i=[{key:"createEl",value:function(e){var n,i,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;return(n=t,i=this,"function"==typeof(r=Oi(Pi(1&3?n.prototype:n),"createEl",i))?function(e){return r.apply(i,e)}:r)([e,Object.assign(Object.assign({},o),{className:"".concat(o.className," cv-resource-menu-item")}),a])}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}],i&&mi(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("MenuItem"));function Ti(e){return Ti="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},Ti(e)}function _i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Ei(i.key),i)}}function Ei(e){var t=function(e){if("object"!=Ti(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ti(t)?t:t+""}function Ii(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ii=function(){return!!e})()}function Ri(e,t,n,i){var r=Mi(Di(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function Mi(){return Mi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Di(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},Mi.apply(null,arguments)}function Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Di(e)}function xi(e,t){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xi(e,t)}var Bi=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Di(t),function(e,t){if(t&&("object"==Ti(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ii()?Reflect.construct(t,n||[],Di(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xi(e,t)}(t,e),n=t,(i=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-resources-button-wrapper ".concat(Ri(t,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(Ri(t,"buildCSSClass",this,3)([]))}},{key:"update",value:function(){Ri(t,"update",this,3)([])}},{key:"createItems",value:function(){var e=this,t=[];return t.push(new cn.Z(this.player_,{label:"Resources"})),this.options_.resources.forEach(function(n){var i=new Ci(e.player(),{resource:n,imageCdnUrl:e.options_.imageCdnUrl,downloadResource:function(t){return e.downloadResource(t)},label:n.name});t.push(i)}),t}},{key:"downloadResource",value:function(e){"link"!==e.type?this.getDownloadIframe().src=e.url:yi.Ab.PageLoad(e.url,!0)}},{key:"getDownloadIframe",value:function(){return this.downloadIframe||(this.downloadIframe=o.Z.dom.createEl("iframe"),this.downloadIframe.style.display="none",o.Z.dom.appendContent(o.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(){Ri(t,"handleClick",this,3)([null])}}])&&_i(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getComponent("MenuButton"));function Ni(e){return Ni="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},Ni(e)}function Vi(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Fi(i.key),i)}}function Fi(e){var t=function(e){if("object"!=Ni(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ni(t)?t:t+""}function Ai(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ai=function(){return!!e})()}function Li(e){return Li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Li(e)}function Zi(e,t){return Zi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zi(e,t)}Bi.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",Bi);var Ui=function(e){function t(e,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=Li(t),function(e,t){if(t&&("object"==Ni(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ai()?Reflect.construct(t,n||[],Li(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,e.ready(function(){return i.onReady()}),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zi(e,t)}(t,e),n=t,(i=[{key:"onReady",value:function(){if(this.options.resources.length){var e=this.player.getChild("collapserator");e.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},e.children_.length-4)}}}])&&Vi(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",Ui),n(62315);var zi=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Gi(e){var t=e.className,n=void 0===t?"":t,r=e.playerApi,o=e.onReady,a=e.onDispose,s=zi(e,["className","playerApi","onReady","onDispose"]),c=i.useRef(null);return i.useEffect(function(){if(c){var e=new ut(c.current,Object.assign(Object.assign({},s),{playerApi:r}));return o&&e.ready(function(){o((0,lt.G)(e))}),a&&e.one("dispose",a),function(){null==e||e.dispose()}}},[e.viewKey]),i.createElement("div",{ref:c,className:n})}}}]);
|
|
3
|
+
//# sourceMappingURL=5987-ece2ee4793-lite.chunk.js.map
|