@tivio/sdk-react 2.4.0-alpha → 2.5.0-alpha
Sign up to get free protection for your applications and to get access to all the features.
package/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# @tivio/sdk-react
|
2
2
|
|
3
3
|
## Changelog
|
4
|
-
* v2.
|
5
|
-
*
|
4
|
+
* v2.5.0-alpha
|
5
|
+
* minor: device limit support
|
6
|
+
* minor: drm (Widevine, PlayReady) support
|
7
|
+
* minor: watermarking support
|
8
|
+
* minor: TivioProvider requires playerCapabilities
|
9
|
+
* patch: price on video is 0 when purchased
|
6
10
|
* v2.3.4
|
7
11
|
* patch: fix of usePurchaseSubscription not reactive
|
8
12
|
* v2.3.3
|
@@ -3,7 +3,6 @@ export * from './useTaggedVideos';
|
|
3
3
|
export * from './useScreens';
|
4
4
|
export * from './useScreen';
|
5
5
|
export * from './useItemsInRow';
|
6
|
-
export * from './useCancelSubscription';
|
7
6
|
export * from './useTransactionPayment';
|
8
7
|
export * from './usePurchaseSubscription';
|
9
8
|
export * from './contentHooks';
|
package/dist/index.d.ts
CHANGED
@@ -21,3 +21,4 @@ export { TivioComponents } from './types/bundle.types';
|
|
21
21
|
export { TivioAuth } from './types/bundle.types';
|
22
22
|
export { TivioGetters } from './types/bundle.types';
|
23
23
|
export { TivioSubscriptions } from './types/bundle.types';
|
24
|
+
export { PlayerCapability } from './types/bundle.types';
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@material-ui/core"),require("@material-ui/icons"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("formik"),require("i18next"),require("mobx"),require("mobx-react"),require("react"),require("react-dom"),require("react-i18next"),require("react-router-dom"),require("react-spring"),require("react-virtualized"),require("styled-components"),require("yup")):"function"==typeof define&&define.amd?define("@tivio/sdk-react",["@material-ui/core","@material-ui/icons","@sentry/browser","firebase/app","firebase/auth","firebase/firestore","formik","i18next","mobx","mobx-react","react","react-dom","react-i18next","react-router-dom","react-spring","react-virtualized","styled-components","yup"],t):"object"==typeof exports?exports["@tivio/sdk-react"]=t(require("@material-ui/core"),require("@material-ui/icons"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("formik"),require("i18next"),require("mobx"),require("mobx-react"),require("react"),require("react-dom"),require("react-i18next"),require("react-router-dom"),require("react-spring"),require("react-virtualized"),require("styled-components"),require("yup")):e["@tivio/sdk-react"]=t(e["@material-ui/core"],e["@material-ui/icons"],e["@sentry/browser"],e["firebase/app"],e["firebase/auth"],e["firebase/firestore"],e.formik,e.i18next,e.mobx,e["mobx-react"],e.react,e["react-dom"],e["react-i18next"],e["react-router-dom"],e["react-spring"],e["react-virtualized"],e["styled-components"],e.yup)}(this,(function(e,t,n,r,o,i,u,a,s,c,l,f,d,v,p,h,b,y){return function(){"use strict";var m={1903:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextProvider=void 0;var o=r(n(9297)),i=n(5925);t.ContextProvider=function(e){return o.default.createElement(i.UserContextProvider,null,o.default.createElement(i.OrganizationSubscriptionsContextProvider,null,o.default.createElement(i.PurchasesWithVideosContextProvider,null,o.default.createElement(i.ScreensContextProvider,null,o.default.createElement(i.RowItemsContextProvider,null,e.children)))))}},2585:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.withPlayerContext=t.PlayerProvider=t.PlayerContext=void 0;var a=u(n(9297)),s=n(9517);t.PlayerContext=a.default.createContext(void 0),t.PlayerProvider=function(e){var n=e.children,r=e.playerWrapperId,o=c(void 0===r?"default":r),i=l(),u=a.default.createElement(t.PlayerContext.Provider,{value:o},n);return i&&(u=a.default.createElement(i.Provider,{value:{player:o}},u)),u};var c=function(e){var t=(0,a.useState)(null),n=t[0],r=t[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(t){var n,o=null===(n=t.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:e});r(o)})).catch((function(){}))}),[e]),n},l=function(){var e=(0,a.useState)(null),t=e[0],n=e[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(e){var t,r=null===(t=e.components)||void 0===t?void 0:t.PlayerDataContext;n(r)})).catch((function(){}))}),[]),t};t.withPlayerContext=function(e){return function(n){return function(o){return a.default.createElement(t.PlayerProvider,{playerWrapperId:e},a.default.createElement(n,r({},o)))}}}},6602:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioContext=t.TivioProvider=void 0;var u=i(n(9297)),a=n(9111),s=n(8643),c=n(5256),l=n(1903),f=(0,s.createUseRemoteBundle)(),d=u.default.createContext(null);t.TivioContext=d,t.TivioProvider=function(e){var t=e.children,n=e.conf,r=(0,u.useMemo)((function(){return(0,a.createInternalConf)(null!=n?n:null)}),[]),o=f(r);(0,u.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]);var i="ready"===(null==o?void 0:o.state)&&o.components?u.default.createElement(o.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},t):t;return u.default.createElement(l.ContextProvider,null,u.default.createElement(d.Provider,{value:o},i))}},2411:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidget=void 0;var u=i(n(9297)),a=n(8682),s=n(8057);t.TivioWidget=u.default.forwardRef((function(e,t){var n=e.id,r=e.onBlur,o=e.onEnabled;if("string"!=typeof n||!n.length)return u.default.createElement(s.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var i=(0,a.useTivioData)(),c=i.state,l=i.error,f=i.components,d=i.config,v=d.ErrorComponent,p=d.LoaderComponent;switch((0,u.useEffect)((function(){"error"===c&&(null==o||o(!1))}),[c]),c){case"error":return u.default.createElement(v,{error:l});case"loading":return u.default.createElement(p,null);case"ready":return f?u.default.createElement(f.Widget,{id:n,ref:t,onEnabled:o,onBlur:r}):null}}))},8057:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetError=void 0;var o=r(n(9297));t.TivioWidgetError=function(e){var t=e.error;return o.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},t)}},6868:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetLoader=void 0;var o=r(n(9297));t.TivioWidgetLoader=function(){return o.default.createElement("div",null,"loading...")}},664:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TvTivioProvider=void 0;var u=i(n(9297)),a=n(9111),s=n(8643),c=n(5256),l=n(1903),f=n(6602),d=(0,s.createUseRemoteBundle)();t.TvTivioProvider=function(e){var t=e.children,n=e.conf,r=(0,a.createInternalConf)(null!=n?n:null),o=d(r);return(0,u.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]),u.default.createElement(l.ContextProvider,null,u.default.createElement(f.TivioContext.Provider,{value:o},t))}},9448:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContextProvider=t.ChannelsContext=void 0;var a=u(n(9297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.ChannelsContext=s,t.ChannelsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},7571:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSubscriptionsContext=t.OrganizationSubscriptionsContextProvider=void 0;var u=i(n(9297)),a=(0,u.createContext)({subscriptions:[],setSubscriptions:function(){return null}});t.OrganizationSubscriptionsContext=a,t.OrganizationSubscriptionsContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{subscriptions:n,setSubscriptions:r}},e.children)}},2860:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PurchasesWithVideosContextProvider=t.PurchasesWithVideosContext=void 0;var u=i(n(9297)),a=(0,u.createContext)({purchases:[],setPurchases:function(){return null}});t.PurchasesWithVideosContext=a,t.PurchasesWithVideosContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{purchases:n,setPurchases:r}},e.children)}},988:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RowItemsContextProvider=t.RowItemsContext=void 0;var a=u(n(9297)),s=(0,a.createContext)(null);t.RowItemsContext=s,t.RowItemsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){o((function(n){var o;return r(r({},n),((o={})[e]=t,o))}))}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},853:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ScreensContextProvider=t.ScreensContext=void 0;var a=u(n(9297)),s=(0,a.createContext)(null);t.ScreensContext=s,t.ScreensContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){var i,u=r(r({},n),((i={})[e]=t,i));o(u)}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},2141:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SectionsContextProvider=t.SectionsContext=void 0;var a=u(n(9297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.SectionsContext=s,t.SectionsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},7661:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.UserContext=t.UserContextProvider=void 0;var u=i(n(9297)),a=(0,u.createContext)({user:null,setUser:function(){return null}});t.UserContext=a,t.UserContextProvider=function(e){var t=(0,u.useState)(null),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{user:n,setUser:r}},e.children)}},661:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideosContextProvider=t.VideosContext=void 0;var a=u(n(9297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.VideosContext=s,t.VideosContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},5925:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9448),t),o(n(7571),t),o(n(2860),t),o(n(853),t),o(n(2141),t),o(n(7661),t),o(n(661),t),o(n(988),t)},6766:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContext=t.SectionsContext=t.VideosContext=t.useChannelsInWidget=t.useSectionsInChannel=t.useVideosInSection=t.useVideo=t.useSection=t.useIsLoaded=t.useChannel=t.useWidget=void 0;var r=n(9297),o=n(1920),i=n(2782),u=n(5925);Object.defineProperty(t,"ChannelsContext",{enumerable:!0,get:function(){return u.ChannelsContext}}),Object.defineProperty(t,"SectionsContext",{enumerable:!0,get:function(){return u.SectionsContext}}),Object.defineProperty(t,"VideosContext",{enumerable:!0,get:function(){return u.VideosContext}});var a=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useWidget=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(""),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return t&&t.subscribeToWidget(e,(function(e,t,n){var r,o,i;e&&u(e.message),t&&(null===(r=t.lastVideo)||void 0===r||r.transaction,null===(o=t.lastVideo)||void 0===o||o.subscriptions,null===(i=t.lastVideo)||void 0===i||i.monetizations,c(t)),n&&(l.current=n)})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}}),[t]),{error:i,widget:s}},t.useChannel=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to channel with id "+e),t.subscribeToChannel(e,(function(e,t){e&&(a.error("failed to subscribe to channel: ",e),u(e.message)),t&&(a.error("channel data received"),l(t))})))}),[t]),{error:i,data:c}},t.useSection=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to section with id "+e),t.subscribeToSection(e,(function(e,t){e&&(a.error("failed to subscribe to section: ",e),u(e.message)),t&&(a.info("section data received"),l(t))})))}),[t]),{error:i,data:c}},t.useVideo=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(e)return t?(t.subscribeToVideo(e,(function(e,t,n){e&&u(e.message),t&&(t.transaction,t.subscriptions,t.monetizations,c({id:t.id,cover:t.cover,assets:t.assets,created:t.created,sectionId:t.sectionId,channelId:t.channelId,duration:t.duration,path:t.path,image:t.image,tags:t.tags,itemType:t.itemType,isPlayable:t.isPlayable,monetization:t.monetization,transaction:t.transaction,transactionId:t.transactionId,subscriptions:t.subscriptions,subscriptionIds:t.subscriptionIds,monetizations:t.monetizations,isPlaylist:t.isPlaylist,name:t.name,description:t.description,price:t.price,uri:t.uri,url:t.url})),l.current=n})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}):void 0;u("not-found")}),[t,e]),{error:i,data:s}},t.useVideosInSection=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.VideosContext),s=i.data[null!=e?e:""];return(0,r.useEffect)((function(){n&&e&&(s||(a.info("subscribe to videos in section "+e),n.subscribeToVideosInSection(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to videos in section: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("videos data received"),n.videos.forEach((function(e){return e.monetization})),n.videos.forEach((function(e){return e.subscriptions.map((function(e){return e.price}))})),n.videos.forEach((function(e){var t;return null===(t=e.transaction)||void 0===t?void 0:t.price})),i.setData(e,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:t,isLoading:o}))}),t)))}),[n,e,i]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useSectionsInChannel=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.SectionsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to sections in channel with id "+e),n.subscribeToSectionsInChannel(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to sections in channel: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("sections data received"),i.setData(e,{error:t,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useChannelsInWidget=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.ChannelsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to channels in widget with id: "+e),n.subscribeToChannelsInWidget(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to channels in widget: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("channels data received"),i.setData(e,{error:t,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useIsLoaded=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],i=(0,o.useTivioData)();return(0,r.useEffect)((function(){i.getters&&i.getters.isTivioLoaded(n)}),[i]),{isTivioLoaded:t}}},8682:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(2883),t),o(n(3354),t),o(n(2596),t),o(n(5469),t),o(n(2639),t),o(n(3650),t),o(n(7802),t),o(n(1350),t),o(n(6766),t),o(n(6862),t),o(n(6311),t),o(n(1197),t),o(n(3419),t),o(n(9814),t),o(n(9302),t)},6862:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useAdSegment=t.useSeekState=t.useCurrentMarker=t.useAd=t.useIntro=t.useBetOffer=t.useMarkers=t.usePlayerEvent=void 0;var r=n(9297),o=n(2585);t.usePlayerEvent=function(e){var t=(0,r.useContext)(o.PlayerContext);if(void 0===t)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),i=n[0],u=n[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener(e,u),function(){return t.events.removeListener(e,u)}}),[null==t?void 0:t.events]),i},t.useMarkers=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useMarkers must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("markers",i),function(){return e.events.removeListener("markers",i)}}),[null==e?void 0:e.events]),n},t.useBetOffer=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useBetOffer must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("bet-offer",i),function(){return e.events.removeListener("bet-offer",i)}}),[null==e?void 0:e.events]),n},t.useIntro=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useIntro must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("intro",i),function(){return e.events.removeListener("intro",i)}}),[null==e?void 0:e.events]),n},t.useAd=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAd must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1],u=function(){var e=(0,r.useRef)(0),t=(0,r.useState)(null),n=(t[0],t[1]);return(0,r.useCallback)((function(){e.current++,n(e.current)}),[])}();return(0,r.useEffect)((function(){if(null==e?void 0:e.events){e.events.addListener("ad",i);var t="ad-rerender",n="ad-seconds-to-skippable-changed";return e.events.isSupported(t)&&e.events.addListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u),function(){e.events.removeListener("ad",i),e.events.isSupported(t)&&e.events.removeListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u)}}}),[null==e?void 0:e.events]),n},t.useCurrentMarker=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useCurrentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("current-marker",i),function(){return e.events.removeListener("current-marker",i)}}),[null==e?void 0:e.events]),n},t.useSeekState=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useSeekState must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events){var t=function(){return i(!1)},n=function(){return i(!0)};return e.events.addListener("disable-seek",t),e.events.addListener("enable-seek",n),function(){e.events.removeListener("disable-seek",t),e.events.removeListener("enable-seek",n)}}}),[null==e?void 0:e.events]),n},t.useAdSegment=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAdSegmentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("ad-segment-changed",i),function(){return e.events.removeListener("ad-segment-changed",i)}}),[null==e?void 0:e.events]),n}},3650:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useCancelSubscription=void 0;var r=n(9302);t.useCancelSubscription=function(e){var t,n,o=(0,r.useTivioData)().hooks,i=null!==(n=null===(t=null==o?void 0:o.useCancelSubscription)||void 0===t?void 0:t.call(o,e))&&void 0!==n?n:{},u=i.cancelSubscription,a=i.cancellationInfo;return{cancelSubscription:null!=u?u:function(){return Promise.resolve()},cancellationInfo:null!=a?a:null,error:i.error}}},6201:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useError=void 0;var r=n(9297);t.useError=function(){var e=(0,r.useState)(null),t=e[0],n=e[1];return{error:t,raiseError:function(e){n(e)},resetError:function(){return n(null)}}}},3419:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFreePurchase=void 0;var i=n(9302);t.useFreePurchase=function(){var e=(0,i.useTivioData)().auth;return{purchase:function(t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return e?[4,e.createFreePurchase(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}}},2639:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useItemsInRow=void 0;var r=n(9297),o=n(6201),i=n(9302);t.useItemsInRow=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,o.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToItemsInRow(e,(function(e,t){var n;e&&f(e),t&&(null===(n=t.items)||void 0===n||n.forEach((function(e){var t,n;null===(n=null===(t=e.tags)||void 0===t?void 0:t.forEach)||void 0===n||n.call(t,(function(e){return{name:e.name,type:e.type,metadata:e.metadata,color:e.color}}))})),s({items:t.items.slice(),fetchMore:t.fetchMore}))}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},6311:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useOrganizationSubscriptions=void 0;var i=n(9297),u=n(7571),a=n(6766),s=n(9302);t.useOrganizationSubscriptions=function(){var e=(0,i.useContext)(u.OrganizationSubscriptionsContext),t=e.setSubscriptions,n=e.subscriptions,c=(0,s.useTivioData)().getters,l=(0,a.useIsLoaded)().isTivioLoaded;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return c&&l&&0===n.length?[4,c.getOrganizationSubscriptions()]:[3,2];case 1:(e=r.sent())&&t(e),r.label=2;case 2:return[2]}}))}))}),[l]),{subscriptions:n}}},1350:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchaseSubscription=void 0;var i=n(9877),u=n(9297),a=n(9302),s=n(2883);t.usePurchaseSubscription=function(e){var t=(0,u.useState)(null),n=t[0],c=t[1],l=(0,u.useState)(""),f=l[0],d=l[1],v=(0,a.useTivioData)().purchaseSubscriptionWithQerko,p=(0,s.useUser)().user,h=(0,u.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:d(""),r.label=1;case 1:if(r.trys.push([1,3,,4]),!v)throw new Error("purchaseVideoWithQerko not in bundle");return[4,v(e)];case 2:return t=r.sent(),c(t),[3,4];case 3:return(n=r.sent())instanceof Error&&d(n.message),[3,4];case 4:return[2]}}))}))}),[v]),b=(0,i.useObserver)((function(){if(p){var t=p.purchases.find((function(t){return t.monetizationId===e}));if(t)return t.status}return"NEW"}));return(0,u.useEffect)((function(){h()}),[h]),{paymentError:f,paymentInfo:n,paymentStatus:b,getPaymentInfo:h}}},1197:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchasesWithVideos=void 0;var i=n(9297),u=n(2860),a=n(9302),s=n(2883);t.usePurchasesWithVideos=function(){var e=(0,s.useUser)().user,t=(0,a.useTivioData)().auth,n=(0,i.useContext)(u.PurchasesWithVideosContext),c=n.purchases,l=n.setPurchases;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return t?e&&e.purchasedVods.length!==c.length?(n=l,[4,t.getPurchasedVodsWithInitializedVideos()]):[3,2]:[2];case 1:n.apply(void 0,[r.sent()]),r.label=2;case 2:return[2]}}))}))}),[e,t]),{purchases:c}}},9814:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useRowsInScreen=void 0;var r=n(9297),o=n(6201),i=n(9302);t.useRowsInScreen=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,o.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToRowsInScreen(e,(function(e,t){e&&f(e),t&&s({fetchMore:t.fetchMore,items:t.items})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},5469:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useScreen=void 0;var r=n(2965),o=n(9297),i=n(5925),u=n(9302);t.useScreen=function(e,t){var n,a,s,c=(0,u.useTivioData)().subscriptions,l=(0,o.useContext)(i.ScreensContext),f=null==l?void 0:l.data[e],d=(0,o.useRef)(null);return(0,o.useEffect)((function(){return c&&l&&null==d.current&&(d.current=null==c?void 0:c.subscribeToScreen(e,(function(t,n){var o;t&&l.setData(e,{error:t,data:null,isLoading:!1}),n&&l.setData(e,{error:t,data:{id:n.screenId,name:n.name,description:n.description,assets:(0,r.toJS)(n.assets),rows:(null!==(o=n.rows)&&void 0!==o?o:[]).map((function(e){return{id:e.rowId,name:e.name,rowId:e.rowId,description:e.description,assets:(0,r.toJS)(e.assets),itemComponent:e.itemComponent,rowComponent:e.rowComponent}}))},isLoading:!1})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[c]),{error:null!==(n=null==f?void 0:f.error)&&void 0!==n?n:null,data:null!==(a=null==f?void 0:f.data)&&void 0!==a?a:null,isLoading:null===(s=null==f?void 0:f.isLoading)||void 0===s||s}}},2596:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useScreens=void 0;var i=n(9297),u=n(9302);t.useScreens=function(){var e=(0,u.useTivioData)().getters,t=(0,i.useState)([]),n=t[0],a=t[1];return(0,i.useEffect)((function(){e&&r(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,e.getOrganizationScreens()];case 1:return t=n.sent(),a(t),[2]}}))}))}),[e]),{screens:n}}},3354:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useTaggedVideos=void 0;var r=n(9297),o=n(6201),i=n(9302);t.useTaggedVideos=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,o.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToTaggedVideos(e,(function(e,t){e&&f(e),t&&s({items:t.items,fetchMore:t.fetchMore})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},9302:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useTivioReadyData=t.useTivioData=void 0;var r=n(9297),o=n(6602),i=function(){var e=(0,r.useContext)(o.TivioContext);if(null===e)throw new Error("Make sure to wrap your app in TivioProvider");return e};t.useTivioData=i,t.useTivioReadyData=function(){var e=i();return"ready"===e.state?e:null}},7802:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTransactionPayment=void 0;var i=n(9877),u=n(9297),a=n(1920);t.useTransactionPayment=function(e,t){var n=(0,u.useState)(null),s=n[0],c=n[1],l=(0,u.useState)(""),f=l[0],d=l[1],v=(0,a.useTivioData)().purchaseVideoWithQerko,p=(0,a.useUser)().user,h=(0,u.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:d(""),o.label=1;case 1:if(o.trys.push([1,3,,4]),!v)throw new Error("purchaseVideoWithQerko not in bundle");return[4,v(e,t)];case 2:return n=o.sent(),c(n),[3,4];case 3:return r=o.sent(),d(r.message),[3,4];case 4:return[2]}}))}))}),[v]);(0,u.useEffect)((function(){h()}),[h]);var b=(0,i.useObserver)((function(){if(s&&p){var n=p.purchases.find((function(n){return n.monetizationId===t&&n.videoId===e}));if(n)return n.status}return"new"}));return{paymentInfo:s,paymentError:f,paymentStatus:b,getPaymentInfo:h}}},2883:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useUser=void 0;var r=n(9297),o=n(2782),i=n(5925),u=n(9302),a=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useUser=function(){var e=(0,r.useContext)(i.UserContext),t=e.user,n=e.setUser,o=(0,u.useTivioData)().subscriptions,s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){o&&!t&&o.subscribeToUser((function(e,t){e&&(a.error(e),l(e)),t&&n(t)}))}),[o]),{user:t,error:c}}},9111:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var o=n(8057),i=n(6868),u=n(2782),a=n(9373),s=n(1675);t.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:a.fetchPackage,pubSub:(0,s.getPubSub)(),LoaderComponent:i.TivioWidgetLoader,ErrorComponent:o.TivioWidgetError},t.createInternalConf=function(e){return r(r(r(r({},t.defaultConf),null!=e?e:{}),null==(null==e?void 0:e.secret)?{enable:!1}:{}),{logger:void 0!==(null==e?void 0:e.logger)?e.logger:(0,u.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.4.0-alpha"})}},1920:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=t.withPlayerContext=t.PlayerProvider=void 0;var i=n(2585);Object.defineProperty(t,"PlayerProvider",{enumerable:!0,get:function(){return i.PlayerProvider}}),Object.defineProperty(t,"withPlayerContext",{enumerable:!0,get:function(){return i.withPlayerContext}});var u=n(9517);Object.defineProperty(t,"bundlePromise",{enumerable:!0,get:function(){return u.bundlePromise}}),o(n(8682),t),o(n(6602),t),o(n(2411),t),o(n(8057),t),o(n(664),t),o(n(6868),t),o(n(2738),t),o(n(8643),t),o(n(1675),t),o(n(6946),t)},8643:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUseRemoteBundle=t.createRemotePackageLoader=t.fetchBundle=void 0;var u=n(9297),a=n(2229),s=n(6614),c=function(e){var t=e.resolverUrl;return(0,e.fetchPackage)(t)},l=function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return t.bundleUrlOverride?(console.info("@tivio: Fetching bundle directly based on config.bundleUrlOverride",t.bundleUrlOverride),[4,fetch(t.bundleUrlOverride)]):[3,3];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()];case 3:return[2,c(t).then((function(n){var r,o={},i={exports:o};try{new Function("require","module","exports",n)(a.resolveShared,i,o)}catch(e){return Promise.reject("Cannot load Tivio Resolver "+e)}return"function"!=typeof(null===(r=i.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):i.exports.tivio.fetch(e,t.sdkVersion)}))]}}))}))};t.fetchBundle=l;var f=function(){return function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){return[2,l(e,t).then((function(e){var t={},n={exports:t};try{new Function("require","module","exports",e)(a.resolveShared,n,t)}catch(e){return Promise.reject("Cannot load module "+e)}return"object"!=typeof n.exports.Tivio?Promise.reject('Tivio package does not export "Tivio" namespace'):"object"!=typeof n.exports.Tivio.components?Promise.reject('Tivio namespace does not export "components" member'):"function"!=typeof n.exports.Tivio.setUser?Promise.reject('Tivio namespace does not export "setUser" member'):"function"!=typeof n.exports.Tivio.init?Promise.reject('Tivio namespace does not export "init" member'):n.exports.Tivio}))]}))}))}};t.createRemotePackageLoader=f,t.createUseRemoteBundle=function(){var e=f(),t=!1;return function(n){var a=(0,s.createSettings)(n),c=(0,u.useState)({auth:null,components:null,config:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:a,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),l=c[0],f=c[1];return(0,u.useEffect)((function(){null!=n.secret&&!1!==n.enable&&e(n.secret,n).then((function(e){return o(void 0,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return t?[3,2]:[4,e.init(n)];case 1:o.sent(),t=!0,o.label=2;case 2:return a.onSetUser(e.setUser),r={auth:e.auth,components:e.components,config:n,error:null,getters:e.getters,init:e.init,purchaseSubscriptionWithQerko:e.purchaseSubscriptionWithQerko,purchaseVideoWithQerko:e.purchaseVideoWithQerko,setLanguage:e.setLanguage,settings:a,setUser:e.setUser,sources:e.sources,hooks:e.hooks,state:"ready",subscriptions:e.subscriptions},f(r),n.pubSub.publish("on-ready",r),[2]}}))}))})).catch((function(e){var t;null===(t=n.logger)||void 0===t||t.exception(e),f(r(r({},l),{config:n,error:""+e,settings:a,state:"error"})),n.pubSub.publish("on-error",e)}))}),[]),l}}},9517:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=void 0;var r=n(1675);t.bundlePromise=new Promise((function(e,t){(0,r.getPubSub)().subscribe("on-ready",(function(t){e(t)})),(0,r.getPubSub)().subscribe("on-error",(function(e){t(e)}))})).catch((function(e){throw console.error("@tivio/sdk-react failed to load. Reason:",e),e})).then((function(e){return console.info("@tivio/sdk-react loaded successfully."),e}))},2229:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var a=i(n(1731)),s=i(n(7985)),c=u(n(9421));n(5942),n(9714);var l=i(n(7717)),f=i(n(8528)),d=i(n(2965)),v=i(n(9877)),p=i(n(9297)),h=i(n(2268)),b=i(n(7789)),y=i(n(2146)),m=i(n(6821)),g=i(n(3634)),_=i(n(9914)),P=i(n(9440)),x={mobx:d,"mobx-react":v,firebase:c.default,"firebase/app":c.default,"firebase/auth":null,"firebase/firestore":null,react:p,React:p,"react-dom":h,"styled-components":_,"@material-ui/core":a,"@material-ui/icons":s,formik:l,i18next:f,"react-i18next":b,"react-router-dom":y,"react-virtualized":g,"react-spring":m,yup:P};t.resolveShared=function(e){if(!(e in x))throw new Error("Could not resolve shared dependency "+e);return x[e]}},2782:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var o=n(5256);t.createLogger=function(e){var t=!1!==e.isSentryEnabled,n=function(n,i){e.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],i,!1)),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureMessage(""+i,o.Sentry.Severity.fromString(n)))};return{error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("error",e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("info",e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("warn",e)},debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("debug",e)},exception:function(n){e.isConsoleEnabled&&console.error(n),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureException(n))}}}},9373:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var o={cache:"no-store"},i=function(e){var t=e.headers.get("content-type");return 200!==e.status?Promise.reject('Incorrect status "'+e.status+'" was obtained while fetching the module.'):t&&(t.includes("application/javascript")||t.includes("text/javascript"))?e.text():Promise.reject('Incorrect content "'+t+'" was obtained while fetching the module.')},u=function(e){return Promise.reject("Network failure: "+e)};t.fetchPackage=function(e){return n(void 0,void 0,void 0,(function(){return r(this,(function(t){return[2,fetch(e,o).then(i).catch(u)]}))}))}},1675:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getPubSub=t.createPubSub=void 0,t.createPubSub=function(){var e=new Map;return{publish:function(t,n){var r;null===(r=e.get(t))||void 0===r||r.forEach((function(e){(0,e.onMessage)(n)}))},subscribe:function(t,n){var r=(new Date).getTime();return e.has(t)||e.set(t,[]),e.get(t).push({id:r,onMessage:n}),function(){var n,o=null!==(n=e.get(t))&&void 0!==n?n:[],i=o.findIndex((function(e){return e.id===r}));-1!==i&&o.splice(i,1)}}}};var n=null;t.getPubSub=function(){return null===n&&(n=(0,t.createPubSub)()),n}},5256:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.initSentry=t.disableSentry=t.Sentry=void 0;var u=i(n(3736)),a="true"===process.env.DISABLE_SENTRY;t.Sentry=a?null:u,t.disableSentry=function(){t.Sentry=null,console.info("@tivio: Sentry disabled")},t.initSentry=function(){t.Sentry&&(t.Sentry.init({dsn:"https://8b9d489695004b0da95481f939b0455d@o507550.ingest.sentry.io/5600271",release:"@tivio/sdk-react@2.4.0-alpha",tracesSampleRate:1}),console.info("@tivio: Sentry enabled"),s())};var s=function(){window.sentry=t.Sentry,console.info("@tivio: Sentry added to window")}},6614:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,n=null;return{onSetUser:function(r){var o;"function"!=typeof r?null===(o=e.logger)||void 0===o||o.exception("Tivio Bundle setUser handler must be a function"):(t=r,null!==n&&r(n.userId,n.userPayload))},setUser:function(e,r){"function"==typeof t?(n=null,t(e,r)):n={userId:e,userPayload:r}}}}},2738:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},6946:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},1731:function(t){t.exports=e},7985:function(e){e.exports=t},3736:function(e){e.exports=n},9421:function(e){e.exports=r},5942:function(e){e.exports=o},9714:function(e){e.exports=i},7717:function(e){e.exports=u},8528:function(e){e.exports=a},2965:function(e){e.exports=s},9877:function(e){e.exports=c},9297:function(e){e.exports=l},2268:function(e){e.exports=f},7789:function(e){e.exports=d},2146:function(e){e.exports=v},6821:function(e){e.exports=p},3634:function(e){e.exports=h},9914:function(e){e.exports=b},9440:function(e){e.exports=y}},g={};return function e(t){var n=g[t];if(void 0!==n)return n.exports;var r=g[t]={exports:{}};return m[t].call(r.exports,r,r.exports,e),r.exports}(1920)}()}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@material-ui/core"),require("@material-ui/icons"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("formik"),require("i18next"),require("mobx"),require("mobx-react"),require("react"),require("react-dom"),require("react-i18next"),require("react-router-dom"),require("react-spring"),require("react-virtualized"),require("styled-components"),require("yup")):"function"==typeof define&&define.amd?define("@tivio/sdk-react",["@material-ui/core","@material-ui/icons","@sentry/browser","firebase/app","firebase/auth","firebase/firestore","formik","i18next","mobx","mobx-react","react","react-dom","react-i18next","react-router-dom","react-spring","react-virtualized","styled-components","yup"],t):"object"==typeof exports?exports["@tivio/sdk-react"]=t(require("@material-ui/core"),require("@material-ui/icons"),require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("formik"),require("i18next"),require("mobx"),require("mobx-react"),require("react"),require("react-dom"),require("react-i18next"),require("react-router-dom"),require("react-spring"),require("react-virtualized"),require("styled-components"),require("yup")):e["@tivio/sdk-react"]=t(e["@material-ui/core"],e["@material-ui/icons"],e["@sentry/browser"],e["firebase/app"],e["firebase/auth"],e["firebase/firestore"],e.formik,e.i18next,e.mobx,e["mobx-react"],e.react,e["react-dom"],e["react-i18next"],e["react-router-dom"],e["react-spring"],e["react-virtualized"],e["styled-components"],e.yup)}(this,(function(e,t,n,r,o,i,u,a,s,c,l,f,d,v,p,h,b,y){return function(){"use strict";var m={1903:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextProvider=void 0;var o=r(n(9297)),i=n(5925);t.ContextProvider=function(e){return o.default.createElement(i.UserContextProvider,null,o.default.createElement(i.OrganizationSubscriptionsContextProvider,null,o.default.createElement(i.PurchasesWithVideosContextProvider,null,o.default.createElement(i.ScreensContextProvider,null,o.default.createElement(i.RowItemsContextProvider,null,e.children)))))}},2585:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.withPlayerContext=t.PlayerProvider=t.PlayerContext=void 0;var a=u(n(9297)),s=n(9517);t.PlayerContext=a.default.createContext(void 0),t.PlayerProvider=function(e){var n=e.children,r=e.playerWrapperId,o=c(void 0===r?"default":r),i=l(),u=a.default.createElement(t.PlayerContext.Provider,{value:o},n);return i&&(u=a.default.createElement(i.Provider,{value:{player:o}},u)),u};var c=function(e){var t=(0,a.useState)(null),n=t[0],r=t[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(t){var n,o=null===(n=t.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:e});r(o)})).catch((function(){}))}),[e]),n},l=function(){var e=(0,a.useState)(null),t=e[0],n=e[1];return(0,a.useEffect)((function(){s.bundlePromise.then((function(e){var t,r=null===(t=e.components)||void 0===t?void 0:t.PlayerDataContext;n(r)})).catch((function(){}))}),[]),t};t.withPlayerContext=function(e){return function(n){return function(o){return a.default.createElement(t.PlayerProvider,{playerWrapperId:e},a.default.createElement(n,r({},o)))}}}},6602:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioContext=t.TivioProvider=void 0;var u=i(n(9297)),a=n(9111),s=n(8643),c=n(5256),l=n(1903),f=(0,s.createUseRemoteBundle)(),d=u.default.createContext(null);t.TivioContext=d,t.TivioProvider=function(e){var t=e.children,n=e.conf,r=(0,u.useMemo)((function(){return(0,a.createInternalConf)(null!=n?n:null)}),[]),o=f(r);(0,u.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]);var i="ready"===(null==o?void 0:o.state)&&o.components?u.default.createElement(o.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},t):t;return u.default.createElement(l.ContextProvider,null,u.default.createElement(d.Provider,{value:o},i))}},2411:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidget=void 0;var u=i(n(9297)),a=n(8682),s=n(8057);t.TivioWidget=u.default.forwardRef((function(e,t){var n=e.id,r=e.onBlur,o=e.onEnabled;if("string"!=typeof n||!n.length)return u.default.createElement(s.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var i=(0,a.useTivioData)(),c=i.state,l=i.error,f=i.components,d=i.config,v=d.ErrorComponent,p=d.LoaderComponent;switch((0,u.useEffect)((function(){"error"===c&&(null==o||o(!1))}),[c]),c){case"error":return u.default.createElement(v,{error:l});case"loading":return u.default.createElement(p,null);case"ready":return f?u.default.createElement(f.Widget,{id:n,ref:t,onEnabled:o,onBlur:r}):null}}))},8057:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetError=void 0;var o=r(n(9297));t.TivioWidgetError=function(e){var t=e.error;return o.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},t)}},6868:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidgetLoader=void 0;var o=r(n(9297));t.TivioWidgetLoader=function(){return o.default.createElement("div",null,"loading...")}},664:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TvTivioProvider=void 0;var u=i(n(9297)),a=n(9111),s=n(8643),c=n(5256),l=n(1903),f=n(6602),d=(0,s.createUseRemoteBundle)();t.TvTivioProvider=function(e){var t=e.children,n=e.conf,r=(0,a.createInternalConf)(null!=n?n:null),o=d(r);return(0,u.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]),u.default.createElement(l.ContextProvider,null,u.default.createElement(f.TivioContext.Provider,{value:o},t))}},9448:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContextProvider=t.ChannelsContext=void 0;var a=u(n(9297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.ChannelsContext=s,t.ChannelsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},7571:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSubscriptionsContext=t.OrganizationSubscriptionsContextProvider=void 0;var u=i(n(9297)),a=(0,u.createContext)({subscriptions:[],setSubscriptions:function(){return null}});t.OrganizationSubscriptionsContext=a,t.OrganizationSubscriptionsContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{subscriptions:n,setSubscriptions:r}},e.children)}},2860:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PurchasesWithVideosContextProvider=t.PurchasesWithVideosContext=void 0;var u=i(n(9297)),a=(0,u.createContext)({purchases:[],setPurchases:function(){return null}});t.PurchasesWithVideosContext=a,t.PurchasesWithVideosContextProvider=function(e){var t=(0,u.useState)([]),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{purchases:n,setPurchases:r}},e.children)}},988:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RowItemsContextProvider=t.RowItemsContext=void 0;var a=u(n(9297)),s=(0,a.createContext)(null);t.RowItemsContext=s,t.RowItemsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){o((function(n){var o;return r(r({},n),((o={})[e]=t,o))}))}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},853:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ScreensContextProvider=t.ScreensContext=void 0;var a=u(n(9297)),s=(0,a.createContext)(null);t.ScreensContext=s,t.ScreensContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useCallback)((function(e,t){var i,u=r(r({},n),((i={})[e]=t,i));o(u)}),[n]);return a.default.createElement(s.Provider,{value:{data:n,setData:i}},e.children)}},2141:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SectionsContextProvider=t.SectionsContext=void 0;var a=u(n(9297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.SectionsContext=s,t.SectionsContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},7661:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.UserContext=t.UserContextProvider=void 0;var u=i(n(9297)),a=(0,u.createContext)({user:null,setUser:function(){return null}});t.UserContext=a,t.UserContextProvider=function(e){var t=(0,u.useState)(null),n=t[0],r=t[1];return u.default.createElement(a.Provider,{value:{user:n,setUser:r}},e.children)}},661:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideosContextProvider=t.VideosContext=void 0;var a=u(n(9297)),s=(0,a.createContext)({data:{},setData:function(){return null}});t.VideosContext=s,t.VideosContextProvider=function(e){var t=(0,a.useState)({}),n=t[0],o=t[1],i=(0,a.useRef)(n);return a.default.createElement(s.Provider,{value:{data:n,setData:function(e,t){var n,u=r(r({},i.current),((n={})[e]=t,n));i.current=u,o(u)}}},e.children)}},5925:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9448),t),o(n(7571),t),o(n(2860),t),o(n(853),t),o(n(2141),t),o(n(7661),t),o(n(661),t),o(n(988),t)},6766:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContext=t.SectionsContext=t.VideosContext=t.useChannelsInWidget=t.useSectionsInChannel=t.useVideosInSection=t.useVideo=t.useSection=t.useIsLoaded=t.useChannel=t.useWidget=void 0;var r=n(9297),o=n(1920),i=n(2782),u=n(5925);Object.defineProperty(t,"ChannelsContext",{enumerable:!0,get:function(){return u.ChannelsContext}}),Object.defineProperty(t,"SectionsContext",{enumerable:!0,get:function(){return u.SectionsContext}}),Object.defineProperty(t,"VideosContext",{enumerable:!0,get:function(){return u.VideosContext}});var a=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useWidget=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(""),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return t&&t.subscribeToWidget(e,(function(e,t,n){var r,o,i;e&&u(e.message),t&&(null===(r=t.lastVideo)||void 0===r||r.transaction,null===(o=t.lastVideo)||void 0===o||o.subscriptions,null===(i=t.lastVideo)||void 0===i||i.monetizations,c(t)),n&&(l.current=n)})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}}),[t]),{error:i,widget:s}},t.useChannel=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to channel with id "+e),t.subscribeToChannel(e,(function(e,t){e&&(a.error("failed to subscribe to channel: ",e),u(e.message)),t&&(a.error("channel data received"),l(t))})))}),[t]),{error:i,data:c}},t.useSection=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){t&&(a.info("subscribe to section with id "+e),t.subscribeToSection(e,(function(e,t){e&&(a.error("failed to subscribe to section: ",e),u(e.message)),t&&(a.info("section data received"),l(t))})))}),[t]),{error:i,data:c}},t.useVideo=function(e){var t=(0,o.useTivioData)().subscriptions,n=(0,r.useState)(null),i=n[0],u=n[1],a=(0,r.useState)(null),s=a[0],c=a[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(e)return t?(t.subscribeToVideo(e,(function(e,t,n){e&&u(e.message),t&&(t.transaction,t.subscriptions,t.monetizations,c({id:t.id,cover:t.cover,assets:t.assets,created:t.created,sectionId:t.sectionId,channelId:t.channelId,duration:t.duration,path:t.path,image:t.image,tags:t.tags,itemType:t.itemType,isPlayable:t.isPlayable,monetization:t.monetization,transaction:t.transaction,transactionId:t.transactionId,subscriptions:t.subscriptions,subscriptionIds:t.subscriptionIds,monetizations:t.monetizations,isPlaylist:t.isPlaylist,name:t.name,description:t.description,price:t.price,uri:t.uri,url:t.url})),l.current=n})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}):void 0;u("not-found")}),[t,e]),{error:i,data:s}},t.useVideosInSection=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.VideosContext),s=i.data[null!=e?e:""];return(0,r.useEffect)((function(){n&&e&&(s||(a.info("subscribe to videos in section "+e),n.subscribeToVideosInSection(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to videos in section: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("videos data received"),n.videos.forEach((function(e){return e.monetization})),n.videos.forEach((function(e){return e.subscriptions.map((function(e){return e.price}))})),n.videos.forEach((function(e){var t;return null===(t=e.transaction)||void 0===t?void 0:t.price})),i.setData(e,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:t,isLoading:o}))}),t)))}),[n,e,i]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useSectionsInChannel=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.SectionsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to sections in channel with id "+e),n.subscribeToSectionsInChannel(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to sections in channel: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("sections data received"),i.setData(e,{error:t,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useChannelsInWidget=function(e,t){void 0===t&&(t=10);var n=(0,o.useTivioData)().subscriptions,i=(0,r.useContext)(u.ChannelsContext),s=i.data[e];return(0,r.useEffect)((function(){n&&(s||(a.info("subscribe to channels in widget with id: "+e),n.subscribeToChannelsInWidget(e,(function(t,n,r,o){t&&(a.error("failed to subscribe to channels in widget: ",t),i.setData(e,{error:t,data:null,isLoading:o})),n&&(a.info("channels data received"),i.setData(e,{error:t,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:o}))}),t)))}),[n]),{error:s?s.error:null,data:s?s.data:null,isLoading:!!s&&s.isLoading}},t.useIsLoaded=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],i=(0,o.useTivioData)();return(0,r.useEffect)((function(){i.getters&&i.getters.isTivioLoaded(n)}),[i]),{isTivioLoaded:t}}},8682:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(2883),t),o(n(3354),t),o(n(2596),t),o(n(5469),t),o(n(2639),t),o(n(7802),t),o(n(1350),t),o(n(6766),t),o(n(6862),t),o(n(6311),t),o(n(1197),t),o(n(3419),t),o(n(9814),t),o(n(9302),t)},6862:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useAdSegment=t.useSeekState=t.useCurrentMarker=t.useAd=t.useIntro=t.useBetOffer=t.useMarkers=t.usePlayerEvent=void 0;var r=n(9297),o=n(2585);t.usePlayerEvent=function(e){var t=(0,r.useContext)(o.PlayerContext);if(void 0===t)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),i=n[0],u=n[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener(e,u),function(){return t.events.removeListener(e,u)}}),[null==t?void 0:t.events]),i},t.useMarkers=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useMarkers must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("markers",i),function(){return e.events.removeListener("markers",i)}}),[null==e?void 0:e.events]),n},t.useBetOffer=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useBetOffer must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("bet-offer",i),function(){return e.events.removeListener("bet-offer",i)}}),[null==e?void 0:e.events]),n},t.useIntro=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useIntro must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("intro",i),function(){return e.events.removeListener("intro",i)}}),[null==e?void 0:e.events]),n},t.useAd=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAd must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1],u=function(){var e=(0,r.useRef)(0),t=(0,r.useState)(null),n=(t[0],t[1]);return(0,r.useCallback)((function(){e.current++,n(e.current)}),[])}();return(0,r.useEffect)((function(){if(null==e?void 0:e.events){e.events.addListener("ad",i);var t="ad-rerender",n="ad-seconds-to-skippable-changed";return e.events.isSupported(t)&&e.events.addListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u),function(){e.events.removeListener("ad",i),e.events.isSupported(t)&&e.events.removeListener(t,u),e.events.isSupported(n)&&e.events.addListener(n,u)}}}),[null==e?void 0:e.events]),n},t.useCurrentMarker=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useCurrentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("current-marker",i),function(){return e.events.removeListener("current-marker",i)}}),[null==e?void 0:e.events]),n},t.useSeekState=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useSeekState must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events){var t=function(){return i(!1)},n=function(){return i(!0)};return e.events.addListener("disable-seek",t),e.events.addListener("enable-seek",n),function(){e.events.removeListener("disable-seek",t),e.events.removeListener("enable-seek",n)}}}),[null==e?void 0:e.events]),n},t.useAdSegment=function(){var e=(0,r.useContext)(o.PlayerContext);if(void 0===e)throw new Error("useAdSegmentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],i=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("ad-segment-changed",i),function(){return e.events.removeListener("ad-segment-changed",i)}}),[null==e?void 0:e.events]),n}},6201:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useError=void 0;var r=n(9297);t.useError=function(){var e=(0,r.useState)(null),t=e[0],n=e[1];return{error:t,raiseError:function(e){n(e)},resetError:function(){return n(null)}}}},3419:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFreePurchase=void 0;var i=n(9302);t.useFreePurchase=function(){var e=(0,i.useTivioData)().auth;return{purchase:function(t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return e?[4,e.createFreePurchase(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}}},2639:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useItemsInRow=void 0;var r=n(9297),o=n(6201),i=n(9302);t.useItemsInRow=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,o.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToItemsInRow(e,(function(e,t){var n;e&&f(e),t&&(null===(n=t.items)||void 0===n||n.forEach((function(e){var t,n;null===(n=null===(t=e.tags)||void 0===t?void 0:t.forEach)||void 0===n||n.call(t,(function(e){return{name:e.name,type:e.type,metadata:e.metadata,color:e.color}}))})),s({items:t.items.slice(),fetchMore:t.fetchMore}))}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},6311:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useOrganizationSubscriptions=void 0;var i=n(9297),u=n(7571),a=n(6766),s=n(9302);t.useOrganizationSubscriptions=function(){var e=(0,i.useContext)(u.OrganizationSubscriptionsContext),t=e.setSubscriptions,n=e.subscriptions,c=(0,s.useTivioData)().getters,l=(0,a.useIsLoaded)().isTivioLoaded;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return c&&l&&0===n.length?[4,c.getOrganizationSubscriptions()]:[3,2];case 1:(e=r.sent())&&t(e),r.label=2;case 2:return[2]}}))}))}),[l]),{subscriptions:n}}},1350:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchaseSubscription=void 0;var i=n(9877),u=n(9297),a=n(9302),s=n(2883);t.usePurchaseSubscription=function(e){var t=(0,u.useState)(null),n=t[0],c=t[1],l=(0,u.useState)(""),f=l[0],d=l[1],v=(0,a.useTivioData)().purchaseSubscriptionWithQerko,p=(0,s.useUser)().user,h=(0,u.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:d(""),r.label=1;case 1:if(r.trys.push([1,3,,4]),!v)throw new Error("purchaseVideoWithQerko not in bundle");return[4,v(e)];case 2:return t=r.sent(),c(t),[3,4];case 3:return(n=r.sent())instanceof Error&&d(n.message),[3,4];case 4:return[2]}}))}))}),[v]),b=(0,i.useObserver)((function(){if(p){var t=p.purchases.find((function(t){return t.monetizationId===e}));if(t)return t.status}return"NEW"}));return(0,u.useEffect)((function(){h()}),[h]),{paymentError:f,paymentInfo:n,paymentStatus:b,getPaymentInfo:h}}},1197:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchasesWithVideos=void 0;var i=n(9297),u=n(2860),a=n(9302),s=n(2883);t.usePurchasesWithVideos=function(){var e=(0,s.useUser)().user,t=(0,a.useTivioData)().auth,n=(0,i.useContext)(u.PurchasesWithVideosContext),c=n.purchases,l=n.setPurchases;return(0,i.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return t?e&&e.purchasedVods.length!==c.length?(n=l,[4,t.getPurchasedVodsWithInitializedVideos()]):[3,2]:[2];case 1:n.apply(void 0,[r.sent()]),r.label=2;case 2:return[2]}}))}))}),[e,t]),{purchases:c}}},9814:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useRowsInScreen=void 0;var r=n(9297),o=n(6201),i=n(9302);t.useRowsInScreen=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,o.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToRowsInScreen(e,(function(e,t){e&&f(e),t&&s({fetchMore:t.fetchMore,items:t.items})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},5469:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useScreen=void 0;var r=n(2965),o=n(9297),i=n(5925),u=n(9302);t.useScreen=function(e,t){var n,a,s,c=(0,u.useTivioData)().subscriptions,l=(0,o.useContext)(i.ScreensContext),f=null==l?void 0:l.data[e],d=(0,o.useRef)(null);return(0,o.useEffect)((function(){return c&&l&&null==d.current&&(d.current=null==c?void 0:c.subscribeToScreen(e,(function(t,n){var o;t&&l.setData(e,{error:t,data:null,isLoading:!1}),n&&l.setData(e,{error:t,data:{id:n.screenId,name:n.name,description:n.description,assets:(0,r.toJS)(n.assets),rows:(null!==(o=n.rows)&&void 0!==o?o:[]).map((function(e){return{id:e.rowId,name:e.name,rowId:e.rowId,description:e.description,assets:(0,r.toJS)(e.assets),itemComponent:e.itemComponent,rowComponent:e.rowComponent}}))},isLoading:!1})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[c]),{error:null!==(n=null==f?void 0:f.error)&&void 0!==n?n:null,data:null!==(a=null==f?void 0:f.data)&&void 0!==a?a:null,isLoading:null===(s=null==f?void 0:f.isLoading)||void 0===s||s}}},2596:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useScreens=void 0;var i=n(9297),u=n(9302);t.useScreens=function(){var e=(0,u.useTivioData)().getters,t=(0,i.useState)([]),n=t[0],a=t[1];return(0,i.useEffect)((function(){e&&r(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,e.getOrganizationScreens()];case 1:return t=n.sent(),a(t),[2]}}))}))}),[e]),{screens:n}}},3354:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useTaggedVideos=void 0;var r=n(9297),o=n(6201),i=n(9302);t.useTaggedVideos=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,u=(0,r.useState)(null),a=u[0],s=u[1],c=(0,o.useError)(),l=c.error,f=c.raiseError,d=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(d.current=n.subscribeToTaggedVideos(e,(function(e,t){e&&f(e),t&&s({items:t.items,fetchMore:t.fetchMore})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:a,error:l}}},9302:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useTivioReadyData=t.useTivioData=void 0;var r=n(9297),o=n(6602),i=function(){var e=(0,r.useContext)(o.TivioContext);if(null===e)throw new Error("Make sure to wrap your app in TivioProvider");return e};t.useTivioData=i,t.useTivioReadyData=function(){var e=i();return"ready"===e.state?e:null}},7802:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTransactionPayment=void 0;var i=n(9877),u=n(9297),a=n(1920);t.useTransactionPayment=function(e,t){var n=(0,u.useState)(null),s=n[0],c=n[1],l=(0,u.useState)(""),f=l[0],d=l[1],v=(0,a.useTivioData)().purchaseVideoWithQerko,p=(0,a.useUser)().user,h=(0,u.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:d(""),o.label=1;case 1:if(o.trys.push([1,3,,4]),!v)throw new Error("purchaseVideoWithQerko not in bundle");return[4,v(e,t)];case 2:return n=o.sent(),c(n),[3,4];case 3:return r=o.sent(),d(r.message),[3,4];case 4:return[2]}}))}))}),[v]);(0,u.useEffect)((function(){h()}),[h]);var b=(0,i.useObserver)((function(){if(s&&p){var n=p.purchases.find((function(n){return n.monetizationId===t&&n.videoId===e}));if(n)return n.status}return"new"}));return{paymentInfo:s,paymentError:f,paymentStatus:b,getPaymentInfo:h}}},2883:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useUser=void 0;var r=n(9297),o=n(2782),i=n(5925),u=n(9302),a=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useUser=function(){var e=(0,r.useContext)(i.UserContext),t=e.user,n=e.setUser,o=(0,u.useTivioData)().subscriptions,s=(0,r.useState)(null),c=s[0],l=s[1];return(0,r.useEffect)((function(){o&&!t&&o.subscribeToUser((function(e,t){e&&(a.error(e),l(e)),t&&n(t)}))}),[o]),{user:t,error:c}}},9111:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var o=n(8057),i=n(6868),u=n(2782),a=n(9373),s=n(1675);t.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:a.fetchPackage,pubSub:(0,s.getPubSub)(),LoaderComponent:i.TivioWidgetLoader,ErrorComponent:o.TivioWidgetError},t.createInternalConf=function(e){return r(r(r(r({},t.defaultConf),null!=e?e:{}),null==(null==e?void 0:e.secret)?{enable:!1}:{}),{logger:void 0!==(null==e?void 0:e.logger)?e.logger:(0,u.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.5.0-alpha"})}},1920:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=t.withPlayerContext=t.PlayerProvider=void 0;var i=n(2585);Object.defineProperty(t,"PlayerProvider",{enumerable:!0,get:function(){return i.PlayerProvider}}),Object.defineProperty(t,"withPlayerContext",{enumerable:!0,get:function(){return i.withPlayerContext}});var u=n(9517);Object.defineProperty(t,"bundlePromise",{enumerable:!0,get:function(){return u.bundlePromise}}),o(n(8682),t),o(n(6602),t),o(n(2411),t),o(n(8057),t),o(n(664),t),o(n(6868),t),o(n(2738),t),o(n(8643),t),o(n(1675),t),o(n(6946),t)},8643:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUseRemoteBundle=t.createRemotePackageLoader=t.fetchBundle=void 0;var u=n(9297),a=n(2229),s=n(6614),c=function(e){var t=e.resolverUrl;return(0,e.fetchPackage)(t)},l=function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return t.bundleUrlOverride?(console.info("@tivio: Fetching bundle directly based on config.bundleUrlOverride",t.bundleUrlOverride),[4,fetch(t.bundleUrlOverride)]):[3,3];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()];case 3:return[2,c(t).then((function(n){var r,o={},i={exports:o};try{new Function("require","module","exports",n)(a.resolveShared,i,o)}catch(e){return Promise.reject("Cannot load Tivio Resolver "+e)}return"function"!=typeof(null===(r=i.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):i.exports.tivio.fetch(e,t.sdkVersion)}))]}}))}))};t.fetchBundle=l;var f=function(){return function(e,t){return o(void 0,void 0,void 0,(function(){return i(this,(function(n){return[2,l(e,t).then((function(e){var t={},n={exports:t};try{new Function("require","module","exports",e)(a.resolveShared,n,t)}catch(e){return Promise.reject("Cannot load module "+e)}return"object"!=typeof n.exports.Tivio?Promise.reject('Tivio package does not export "Tivio" namespace'):"object"!=typeof n.exports.Tivio.components?Promise.reject('Tivio namespace does not export "components" member'):"function"!=typeof n.exports.Tivio.setUser?Promise.reject('Tivio namespace does not export "setUser" member'):"function"!=typeof n.exports.Tivio.init?Promise.reject('Tivio namespace does not export "init" member'):n.exports.Tivio}))]}))}))}};t.createRemotePackageLoader=f,t.createUseRemoteBundle=function(){var e=f(),t=!1;return function(n){var a=(0,s.createSettings)(n),c=(0,u.useState)({auth:null,components:null,config:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:a,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),l=c[0],f=c[1];return(0,u.useEffect)((function(){null!=n.secret&&!1!==n.enable&&e(n.secret,n).then((function(e){return o(void 0,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return t?[3,2]:[4,e.init(n)];case 1:o.sent(),t=!0,o.label=2;case 2:return a.onSetUser(e.setUser),r={auth:e.auth,components:e.components,config:n,error:null,getters:e.getters,init:e.init,purchaseSubscriptionWithQerko:e.purchaseSubscriptionWithQerko,purchaseVideoWithQerko:e.purchaseVideoWithQerko,setLanguage:e.setLanguage,settings:a,setUser:e.setUser,sources:e.sources,hooks:e.hooks,state:"ready",subscriptions:e.subscriptions},f(r),n.pubSub.publish("on-ready",r),[2]}}))}))})).catch((function(e){var t;null===(t=n.logger)||void 0===t||t.exception(e),f(r(r({},l),{config:n,error:""+e,settings:a,state:"error"})),n.pubSub.publish("on-error",e)}))}),[]),l}}},9517:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.bundlePromise=void 0;var r=n(1675);t.bundlePromise=new Promise((function(e,t){(0,r.getPubSub)().subscribe("on-ready",(function(t){e(t)})),(0,r.getPubSub)().subscribe("on-error",(function(e){t(e)}))})).catch((function(e){throw console.error("@tivio/sdk-react failed to load. Reason:",e),e})).then((function(e){return console.info("@tivio/sdk-react loaded successfully."),e}))},2229:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var a=i(n(1731)),s=i(n(7985)),c=u(n(9421));n(5942),n(9714);var l=i(n(7717)),f=i(n(8528)),d=i(n(2965)),v=i(n(9877)),p=i(n(9297)),h=i(n(2268)),b=i(n(7789)),y=i(n(2146)),m=i(n(6821)),g=i(n(3634)),_=i(n(9914)),P=i(n(9440)),x={mobx:d,"mobx-react":v,firebase:c.default,"firebase/app":c.default,"firebase/auth":null,"firebase/firestore":null,react:p,React:p,"react-dom":h,"styled-components":_,"@material-ui/core":a,"@material-ui/icons":s,formik:l,i18next:f,"react-i18next":b,"react-router-dom":y,"react-virtualized":g,"react-spring":m,yup:P};t.resolveShared=function(e){if(!(e in x))throw new Error("Could not resolve shared dependency "+e);return x[e]}},2782:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var o=n(5256);t.createLogger=function(e){var t=!1!==e.isSentryEnabled,n=function(n,i){e.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],i,!1)),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureMessage(""+i,o.Sentry.Severity.fromString(n)))};return{error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("error",e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("info",e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("warn",e)},debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n("debug",e)},exception:function(n){e.isConsoleEnabled&&console.error(n),t&&(null===o.Sentry||void 0===o.Sentry||o.Sentry.captureException(n))}}}},9373:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var o={cache:"no-store"},i=function(e){var t=e.headers.get("content-type");return 200!==e.status?Promise.reject('Incorrect status "'+e.status+'" was obtained while fetching the module.'):t&&(t.includes("application/javascript")||t.includes("text/javascript"))?e.text():Promise.reject('Incorrect content "'+t+'" was obtained while fetching the module.')},u=function(e){return Promise.reject("Network failure: "+e)};t.fetchPackage=function(e){return n(void 0,void 0,void 0,(function(){return r(this,(function(t){return[2,fetch(e,o).then(i).catch(u)]}))}))}},1675:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getPubSub=t.createPubSub=void 0,t.createPubSub=function(){var e=new Map;return{publish:function(t,n){var r;null===(r=e.get(t))||void 0===r||r.forEach((function(e){(0,e.onMessage)(n)}))},subscribe:function(t,n){var r=(new Date).getTime();return e.has(t)||e.set(t,[]),e.get(t).push({id:r,onMessage:n}),function(){var n,o=null!==(n=e.get(t))&&void 0!==n?n:[],i=o.findIndex((function(e){return e.id===r}));-1!==i&&o.splice(i,1)}}}};var n=null;t.getPubSub=function(){return null===n&&(n=(0,t.createPubSub)()),n}},5256:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.initSentry=t.disableSentry=t.Sentry=void 0;var u=i(n(3736)),a="true"===process.env.DISABLE_SENTRY;t.Sentry=a?null:u,t.disableSentry=function(){t.Sentry=null,console.info("@tivio: Sentry disabled")},t.initSentry=function(){t.Sentry&&(t.Sentry.init({dsn:"https://8b9d489695004b0da95481f939b0455d@o507550.ingest.sentry.io/5600271",release:"@tivio/sdk-react@2.5.0-alpha",tracesSampleRate:1}),console.info("@tivio: Sentry enabled"),s())};var s=function(){window.sentry=t.Sentry,console.info("@tivio: Sentry added to window")}},6614:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,n=null;return{onSetUser:function(r){var o;"function"!=typeof r?null===(o=e.logger)||void 0===o||o.exception("Tivio Bundle setUser handler must be a function"):(t=r,null!==n&&r(n.userId,n.userPayload))},setUser:function(e,r){"function"==typeof t?(n=null,t(e,r)):n={userId:e,userPayload:r}}}}},2738:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},6946:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},1731:function(t){t.exports=e},7985:function(e){e.exports=t},3736:function(e){e.exports=n},9421:function(e){e.exports=r},5942:function(e){e.exports=o},9714:function(e){e.exports=i},7717:function(e){e.exports=u},8528:function(e){e.exports=a},2965:function(e){e.exports=s},9877:function(e){e.exports=c},9297:function(e){e.exports=l},2268:function(e){e.exports=f},7789:function(e){e.exports=d},2146:function(e){e.exports=v},6821:function(e){e.exports=p},3634:function(e){e.exports=h},9914:function(e){e.exports=b},9440:function(e){e.exports=y}},g={};return function e(t){var n=g[t];if(void 0!==n)return n.exports;var r=g[t]={exports:{}};return m[t].call(r.exports,r,r.exports,e),r.exports}(1920)}()}));
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SubscribeToTaggedVideos
|
1
|
+
import { SubscribeToTaggedVideos } from '@tivio/common';
|
2
2
|
import { ComponentType } from 'react';
|
3
3
|
import { Logger } from '../services/logger';
|
4
4
|
import { FetchPackage } from '../services/packageLoader';
|
@@ -11,7 +11,13 @@ declare type Settings = {
|
|
11
11
|
onSetUser: (handler: (userId: string, userPayload: unknown) => void) => void;
|
12
12
|
setUser: (userId: string, userPayload: unknown) => void;
|
13
13
|
};
|
14
|
+
interface PlayerCapability {
|
15
|
+
codec: 'h264' | 'h265';
|
16
|
+
encryption: 'fairplay' | 'none' | 'playready' | 'widevine';
|
17
|
+
protocol: 'dash' | 'hls';
|
18
|
+
}
|
14
19
|
declare type InternalConfig = {
|
20
|
+
playerCapabilities?: Array<PlayerCapability>;
|
15
21
|
enable?: boolean;
|
16
22
|
secret: string | null;
|
17
23
|
verbose?: boolean;
|
@@ -37,7 +43,7 @@ interface PubSub {
|
|
37
43
|
publish: <K extends keyof Events>(triggerName: K, payload: Events[K]) => Empty;
|
38
44
|
subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
|
39
45
|
}
|
40
|
-
declare type Config = Pick<InternalConfig, 'enable' | 'secret' | 'verbose' | 'logger' | 'disableUnmounting' | 'bundleUrlOverride' | 'LoaderComponent' | 'ErrorComponent' | 'language' | 'enableSentry'>;
|
46
|
+
declare type Config = Pick<InternalConfig, 'playerCapabilities' | 'enable' | 'secret' | 'verbose' | 'logger' | 'disableUnmounting' | 'bundleUrlOverride' | 'LoaderComponent' | 'ErrorComponent' | 'language' | 'enableSentry'>;
|
41
47
|
declare type TivioSubscriptions = {
|
42
48
|
subscribeToUser: (cb: (error: string | null, user: User | null) => void) => void;
|
43
49
|
/**
|
@@ -197,7 +203,6 @@ declare type TivioComponents = {
|
|
197
203
|
};
|
198
204
|
declare type TivioHooks = {
|
199
205
|
useAd: () => [(AdSource | null)];
|
200
|
-
useCancelSubscription: UseCancelSubscription;
|
201
206
|
};
|
202
207
|
declare type TivioBundle = {
|
203
208
|
components: TivioComponents;
|
@@ -218,4 +223,4 @@ declare type RemoteBundleState = {
|
|
218
223
|
settings: Settings;
|
219
224
|
state: 'loading' | 'error' | 'ready';
|
220
225
|
} & Nullable<TivioBundle>;
|
221
|
-
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, Events, PubSub, };
|
226
|
+
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, Events, PubSub, PlayerCapability, };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.5.0-alpha",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"typings": "dist/index.d.ts",
|
6
6
|
"source": "src/index.ts",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"@material-ui/core": "^4.11.2",
|
28
28
|
"@material-ui/icons": "^4.11.2",
|
29
29
|
"@sentry/browser": "^6.1.0",
|
30
|
-
"@tivio/common": "1.1.
|
30
|
+
"@tivio/common": "1.1.42",
|
31
31
|
"firebase": "^8.2.3",
|
32
32
|
"formik": "^2.2.7",
|
33
33
|
"i18next": "^19.8.4",
|