@tivio/sdk-react 2.5.0-alpha → 2.5.0-alpha3

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @tivio/sdk-react
2
2
 
3
3
  ## Changelog
4
- * v2.5.0-alpha
4
+ * v2.5.0-alpha3
5
5
  * minor: device limit support
6
6
  * minor: drm (Widevine, PlayReady) support
7
7
  * minor: watermarking support
@@ -2,7 +2,9 @@ export * from './useUser';
2
2
  export * from './useTaggedVideos';
3
3
  export * from './useScreens';
4
4
  export * from './useScreen';
5
+ export * from './useSearch';
5
6
  export * from './useItemsInRow';
7
+ export * from './useCancelSubscription';
6
8
  export * from './useTransactionPayment';
7
9
  export * from './usePurchaseSubscription';
8
10
  export * from './contentHooks';
@@ -0,0 +1,2 @@
1
+ import { UseCancelSubscription } from '@tivio/common';
2
+ export declare const useCancelSubscription: UseCancelSubscription;
@@ -0,0 +1,8 @@
1
+ import { ALGOLIA_INDEX_NAME, UseSearch } from '@tivio/common';
2
+ /**
3
+ * Full text search that returns entities based on search query.
4
+ * @param indexName - index that search would be performed on ('videos', 'tags', etc.)
5
+ * @param options - pagination options
6
+ */
7
+ export declare const useSearch: UseSearch;
8
+ export { ALGOLIA_INDEX_NAME };
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(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
+ !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"),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","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"),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,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,i,o,a,s,u,c,l,f,d,p,h,v,g,b,y){return m={194:function(e,t,n){var r,i,o;e.exports=(r=n(2965),i=n(7005),o=n(9297),function(){var e={2096:function(e){"use strict";function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,i){"string"!=typeof r&&(i=r,r=e.exports.ISO8601_FORMAT),i||(i=e.exports.now());var o,a,s,u,c=n(i.getDate()),l=n(i.getMonth()+1),f=n(i.getFullYear()),d=n(f.substring(2,4)),p=r.indexOf("yyyy")>-1?f:d,h=n(i.getHours()),v=n(i.getMinutes()),g=n(i.getSeconds()),b=t(i.getMilliseconds(),3),y=(o=i.getTimezoneOffset(),a=Math.abs(o),s=String(Math.floor(a/60)),u=String(a%60),1===s.length&&(s="0"+s),1===u.length&&(u="0"+u),o<0?"+"+s+u:"-"+s+u);return r.replace(/dd/g,c).replace(/MM/g,l).replace(/y{1,4}/g,p).replace(/hh/g,h).replace(/mm/g,v).replace(/ss/g,g).replace(/SSS/g,b).replace(/O/g,y)}function i(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,a=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){i(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){i(e,"Month",t-1,o)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){i(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){i(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){i(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){i(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{3,4}|Z",fn:function(e,t){"Z"===t&&(t=0);var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],s=a.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),u=a.filter((function(e){return e.index>-1}));u.sort((function(e,t){return e.index-t.index}));var c=new RegExp(s.regexp).exec(n);if(c){var l=r||e.exports.now();return u.forEach((function(e,t){e.fn(l,c[t+1])})),l}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"},187:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.gtag=t.install=void 0,t.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="ga-gtag";if(!document.getElementById(r)){var i=document.head,o=document.createElement("script");o.id=r,o.type="text/javascript",o.async=!0,o.src="https://www.googletagmanager.com/gtag/js?id=".concat(e),i.insertBefore(o,i.firstChild),window.dataLayer=window.dataLayer||[],n("js",new Date),n("config",e,t)}};var n=function(){window.dataLayer.push(arguments)};t.gtag=n;var r=n;t.default=r},421:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}n.r(t),n.d(t,{default:function(){return z}});var h={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},v=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.init(t,n)}return u(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||h,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,o({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),g=function(){function e(){a(this,e),this.observers={}}return u(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function b(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function y(e){return null==e?"":""+e}function m(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function O(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function _(e,t,n){var r=O(e,t,Object);r.obj[r.k]=n}function P(e,t){var n=O(e,t),r=n.obj,i=n.k;if(r)return r[i]}function S(e,t,n){var r=P(e,n);return void 0!==r?r:P(t,n)}function x(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):x(e[r],t[r],n):e[r]=t[r]);return e}function E(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function j(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return w[e]})):e}var C="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,L=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return a(this,t),n=l(this,f(t).call(this)),C&&g.call(c(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return p(t,e),u(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),P(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),_(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var u=P(this.data,s)||{};r?x(u,n,i):u=o({},u,n),_(this.data,s,u),a.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(g),T={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},M={},k=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(this,t),n=l(this,f(t).call(this)),C&&g.call(c(n)),m(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,c(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=v.create("translator"),n}return p(t,e),u(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,i){var a=this;if("object"!==r(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],n),c=u.key,l=u.namespaces,f=l[l.length-1],d=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=n.nsSeparator||this.options.nsSeparator;return f+h+c}return c}var v=this.resolve(e,n),g=v&&v.res,b=v&&v.usedKey||c,y=v&&v.exactUsedKey||c,m=Object.prototype.toString.apply(g),O=["[object Number]","[object Function]","[object RegExp]"],_=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject;if(P&&g&&"string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g&&O.indexOf(m)<0&&("string"!=typeof _||"[object Array]"!==m)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,g,n):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(s){var S="[object Array]"===m,x=S?[]:{},E=S?y:b;for(var w in g)if(Object.prototype.hasOwnProperty.call(g,w)){var j="".concat(E).concat(s).concat(w);x[w]=this.translate(j,o({},n,{joinArrays:!1,ns:l})),x[w]===j&&(x[w]=g[w])}g=x}}else if(P&&"string"==typeof _&&"[object Array]"===m)(g=g.join(_))&&(g=this.extendTranslation(g,e,n,i));else{var C=!1,L=!1,T=void 0!==n.count&&"string"!=typeof n.count,M=t.hasDefaultValue(n),k=T?this.pluralResolver.getSuffix(d,n.count):"",I=n["defaultValue".concat(k)]||n.defaultValue;!this.isValidLookup(g)&&M&&(C=!0,g=I),this.isValidLookup(g)||(L=!0,g=c);var R=M&&I!==g&&this.options.updateMissing;if(L||C||R){if(this.logger.log(R?"updateKey":"missingKey",d,f,c,R?I:g),s){var A=this.resolve(c,o({},n,{keySeparator:!1}));A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var N=[],D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&D&&D[0])for(var V=0;V<D.length;V++)N.push(D[V]);else"all"===this.options.saveMissingTo?N=this.languageUtils.toResolveHierarchy(n.lng||this.language):N.push(n.lng||this.language);var F=function(e,t,r){a.options.missingKeyHandler?a.options.missingKeyHandler(e,f,t,R?r:g,R,n):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(e,f,t,R?r:g,R,n),a.emit("missingKey",e,f,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?N.forEach((function(e){a.pluralResolver.getSuffixes(e).forEach((function(t){F([e],c+t,n["defaultValue".concat(t)]||I)}))})):F(N,c,I))}g=this.extendTranslation(g,e,n,v,i),L&&g===c&&this.options.appendNamespaceToMissingKey&&(g="".concat(f,":").concat(c)),L&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(g))}return g}},{key:"extendTranslation",value:function(e,t,n,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(o({},n,{interpolation:o({},this.options.interpolation,n.interpolation)}));var s,u=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(u){var c=e.match(this.interpolator.nestingRegexp);s=c&&c.length}var l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l=o({},this.options.interpolation.defaultVariables,l)),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),u){var f=e.match(this.interpolator.nestingRegexp);s<(f&&f.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):a.translate.apply(a,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==n.applyPostProcessor&&(e=T.handle(p,e,t,this.options&&this.options.postProcessPassResolved?o({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s),c=u.key;n=c;var l=u.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(o=e,!M["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(M["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){i=n;var o,u,l=c,p=[l];for(a.i18nFormat&&a.i18nFormat.addLookupKeys?a.i18nFormat.addLookupKeys(p,c,n,e,s):(f&&(o=a.pluralResolver.getSuffix(n,s.count)),f&&d&&p.push(l+o),d&&p.push(l+="".concat(a.options.contextSeparator).concat(s.context)),f&&p.push(l+=o));u=p.pop();)a.isValidLookup(t)||(r=u,t=a.getResource(n,e,u,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),t}(g);function I(e){return e.charAt(0).toUpperCase()+e.slice(1)}var R=function(){function e(t){a(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=v.create("languageUtils")}return u(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=I(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=I(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=I(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),A=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],N={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function D(){var e={};return A.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:N[t.fc]}}))})),e}var V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.languageUtils=t,this.options=n,this.logger=v.create("pluralResolver"),this.rules=D()}return u(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),F=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.logger=v.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return u(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:j,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?E(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?E(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?E(t.nestingPrefix):t.nestingPrefixEscaped||E("$t("),this.nestingSuffix=t.nestingSuffix?E(t.nestingSuffix):t.nestingSuffixEscaped||E(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var i=S(t,u,e);return s.alwaysFormat?s.format(i,void 0,n):i}var o=e.split(s.formatSeparator),a=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(S(t,u,a),c,n,r)};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){if(void 0===(o=l(i[1].trim())))if("function"==typeof f){var n=f(e,i,r);o="string"==typeof n?n:""}else{if(d){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=y(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o({},a);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,s)).replace(/'/g,'"');try{s=JSON.parse(i),t&&(s=o({},t,s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var f=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=f.shift(),c=f,l=!0}if((r=t(u.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=y(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),l&&(r=c.reduce((function(e,t){return i.format(e,t,a.lng,a)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),B=function(e){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(this,t),i=l(this,f(t).call(this)),C&&g.call(c(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=v.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return p(t,e),u(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],a=[],s=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),o.indexOf(s)<0&&o.push(s),u.indexOf(t)<0&&u.push(t)))})),r||s.push(e)})),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:o,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var r,s,u,c,l;r=n.loaded,s=o,(c=(u=O(r,[i],Object)).obj)[l=u.k]=c[l]||[],c[l].push(s),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,u){s&&u&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,a)}),o):a(s,u)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,o({},a,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(g);function U(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===r(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===r(e[2])||"object"===r(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function W(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function H(){}var z=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(a(this,t),e=l(this,f(t).call(this)),C&&g.call(c(e)),e.options=W(n),e.services={},e.logger=v,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),l(e,c(e));setTimeout((function(){e.init(n,r)}),0)}return e}return p(t,e),u(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},U(),this.options,W(t)),this.format=this.options.interpolation.format,n||(n=H),!this.options.isClone){this.modules.logger?v.init(r(this.modules.logger),this.options):v.init(null,this.options);var i=new R(this.options);this.store=new L(this.options.resources,this.options);var a=this.services;a.logger=v,a.resourceStore=this.store,a.languageUtils=i,a.pluralResolver=new V(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new F(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new B(r(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=r(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=r(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new k(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.length>0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var u=b(),c=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),u}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};r?o(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return o(e)})),this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=b();return e||(e=this.languages),t||(t=this.options.ns),n||(n=H),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&T.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=b();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var a;if("object"!==r(i)){for(var s=arguments.length,u=new Array(s>2?s-2:0),c=2;c<s;c++)u[c-2]=arguments[c];a=n.options.overloadTranslationOptionHandler([t,i].concat(u))}else a=o({},i);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,n.t(t,a)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!a(r,e)||i&&!a(o,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=b();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=b();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H,i=o({},this.options,n,{isClone:!0}),a=new t(i);return["store","services","language"].forEach((function(t){a[t]=e[t]})),a.services=o({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new k(a.services,a.options),a.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.emit.apply(a,[e].concat(n))})),a.init(i,r),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}}]),t}(g))},6160:function(e,t,n){e=n.nmd(e);var r,i,o,a="[object Map]",s="[object Promise]",u="[object Set]",c="[object WeakMap]",l="[object DataView]",f=/^\[object .+?Constructor\]$/,d="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,p="object"==typeof self&&self&&self.Object===Object&&self,h=d||p||Function("return this")(),v=t&&!t.nodeType&&t,g=v&&e&&!e.nodeType&&e,b=g&&g.exports===v,y=Function.prototype,m=Object.prototype,O=h["__core-js_shared__"],_=(r=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",P=y.toString,S=m.hasOwnProperty,x=m.toString,E=RegExp("^"+P.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=b?h.Buffer:void 0,j=m.propertyIsEnumerable,C=w?w.isBuffer:void 0,L=(i=Object.keys,o=Object,function(e){return i(o(e))}),T=U(h,"DataView"),M=U(h,"Map"),k=U(h,"Promise"),I=U(h,"Set"),R=U(h,"WeakMap"),A=!j.call({valueOf:1},"valueOf"),N=H(T),D=H(M),V=H(k),F=H(I),B=H(R);function U(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Y(e)||function(e){return!!_&&_ in e}(e))&&(q(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?E:f).test(H(e))}(n)?n:void 0}var W=function(e){return x.call(e)};function H(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(T&&W(new T(new ArrayBuffer(1)))!=l||M&&W(new M)!=a||k&&W(k.resolve())!=s||I&&W(new I)!=u||R&&W(new R)!=c)&&(W=function(e){var t=x.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?H(n):void 0;if(r)switch(r){case N:return l;case D:return a;case V:return s;case F:return u;case B:return c}return t});var z=Array.isArray;function K(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!q(e)}var G=C||function(){return!1};function q(e){var t=Y(e)?x.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function Y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(K(e)&&(z(e)||"string"==typeof e||"function"==typeof e.splice||G(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&K(e)}(e)&&S.call(e,"callee")&&(!j.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var t=W(e);if(t==a||t==u)return!e.size;if(A||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||m)}(e))return!L(e).length;for(var n in e)if(S.call(e,n))return!1;return!0}},4337:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiesSettings=void 0;var u=a(n(9297));t.CookiesSettings=function(e){var t=e.as,n=s(e,["as"]),i=(0,u.useRef)(null);return u.default.createElement(u.default.Fragment,null,u.default.createElement("button",{id:"ot-sdk-btn",className:"ot-sdk-show-settings",ref:i,style:{display:"none"}}),u.default.createElement(t,r({onClick:function(){var e;return null===(e=null==i?void 0:i.current)||void 0===e?void 0:e.click()}},n)))}},9281:function(e,t,n){"use strict";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]}),i=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}),i(n(4337),t)},7723:function(e,t,n){"use strict";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]}),i=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}),i(n(3902),t)},3902:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.VAST_PROVIDERS=t.VastProvider=void 0,function(e){e.ETARGET_PREBID="etarget-prebid",e.MALL_TV_PREBID="malltv-prebid",e.IMPRESSION_MEDIA_PREBID="impressionMedia-prebid",e.MALL_TV="malltv",e.FALLBACK_MP4="fallback",e.FALLBACK_HLS="fallback-hls"}(n=t.VastProvider||(t.VastProvider={})),t.VAST_PROVIDERS=[{id:n.ETARGET_PREBID,name:"Etarget Prebid"},{id:n.MALL_TV_PREBID,name:"MALL.TV Prebid"},{id:n.IMPRESSION_MEDIA_PREBID,name:"Impression Media Prebid"},{id:n.MALL_TV,name:"MALL.TV"},{id:n.FALLBACK_MP4,name:"Fallback (MP4)",development:!0},{id:n.FALLBACK_HLS,name:"Fallback (HLS)",development:!0}]},2509:function(e,t,n){"use strict";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]}),i=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}),i(n(2951),t)},2951:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firestoreJavascriptFilters=t.firestoreArrayFilters=t.firestoreObjectFilters=void 0;var r=n(543);t.firestoreObjectFilters={isTranscoded:{field:"transcodingStatus",operator:"==",value:r.VIDEO_STATUS.ENCODING_DONE},isPublished:{field:"publishedStatus",operator:"==",value:r.PUBLISHED_STATUS.PUBLISHED}},t.firestoreArrayFilters={isTranscoded:Object.values(t.firestoreObjectFilters.isTranscoded),isPublished:Object.values(t.firestoreObjectFilters.isPublished)},t.firestoreJavascriptFilters={isTranscoded:function(e){return e===r.VIDEO_STATUS.ENCODING_DONE},isPublished:function(e){return e===r.PUBLISHED_STATUS.PUBLISHED}}},7515:function(e,t,n){"use strict";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]}),i=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}),i(n(3556),t),i(n(6557),t),i(n(1321),t),i(n(3370),t)},3556:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useBottomListener=void 0;var r=n(9297);t.useBottomListener=function(e){var t=e.onBottom,n=e.onCloseToBottom,i=e.closeThreshold,o=void 0===i?400:i,a=(0,r.useState)(!1),s=a[0],u=a[1],c=(0,r.useState)(!1),l=c[0],f=c[1],d=(0,r.useCallback)((function(){var e=("innerHeight"in window?window.innerHeight:document.documentElement.offsetHeight)+window.pageYOffset,t=document.body,n=document.documentElement,r=Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight);u(e>=r),f(e+o>=r)}),[s,u]);return(0,r.useEffect)((function(){return window.addEventListener("scroll",d),function(){window.removeEventListener("scroll",d)}}),[]),(0,r.useEffect)((function(){l&&(null==n||n())}),[l]),(0,r.useEffect)((function(){s&&(null==t||t())}),[s]),{isBottom:s,isCloseToBottom:l}}},1321:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useImageLoader=void 0;var r=n(9297);t.useImageLoader=function(e,t){var n=(0,r.useState)(e),i=n[0],o=n[1],a=(0,r.useState)(!1),s=a[0],u=a[1];return(0,r.useEffect)((function(){if(t){var e=new Image;e.src=t,e.onload=function(){o(t),u(!0)}}}),[t]),{loadedImageSrc:i,imageIsLoaded:s}}},6557:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useLoading=void 0;var r=n(9297);t.useLoading=function(e){void 0===e&&(e=!1);var t=(0,r.useState)(e),n=t[0],i=t[1],o=(0,r.useRef)(n),a=function(e){i(e),o.current=e};return{loading:n,startLoading:function(){o.current||a(!0)},stopLoading:function(){o.current&&a(!1)}}}},3370:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOnChange=t.usePrevious=void 0;var r=n(9297);function i(e){var t,n=(0,r.useState)([]),i=n[0],o=n[1];return(0,r.useEffect)((function(){o(i.concat(e).slice(-2))}),[e]),null!==(t=i[i.length-2])&&void 0!==t?t:null}t.usePrevious=i,t.useOnChange=function(e,t){var n=i(e);n!==e&&t(n,e)}},3895:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LanguagePicker=void 0;var a=o(n(9297)),s=n(6915);t.LanguagePicker=function(){var e=(0,s.useLanguageOptions)(),t=e.language,n=e.languages,r=e.selectLanguage,i=(0,a.useCallback)((function(e){r(e.target.value)}),[r]);return a.default.createElement("select",{name:"tivio-language-select","data-e2e":"tivio-language-select",value:t,onChange:i},n.map((function(e){return a.default.createElement("option",{key:e,value:e},e)})))}},6915:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useCurrency=t.useLanguage=t.useLanguageOptions=t.useT=t.useI18n=void 0;var i=n(9297),o=n(6255),a=n(6009),s=n(5318);t.useI18n=function(){return(0,i.useContext)(a.I18nContext).i18n},t.useT=function(){var e=(0,t.useI18n)();return e?e.t.bind(e):function(e){return e}},t.useLanguageOptions=function(){var e=(0,i.useContext)(s.LanguageContext);return r(r({},e),{languages:o.languages})},t.useLanguage=function(){return(0,i.useContext)(s.LanguageContext).language};var u={cs:"CZK",sk:"EUR",en:"USD"};t.useCurrency=function(){var e,n=(0,t.useLanguageOptions)().language;return null!==(e=u[n])&&void 0!==e?e:"CZK"}},6009:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.I18nContextProvider=t.I18nContext=void 0;var s=a(n(421)),u=o(n(9297)),c=n(6797),l=n(5318),f=new c.Logger("language");t.I18nContext=(0,u.createContext)({i18n:null}),t.I18nContextProvider=function(e){var n=e.children,r=e.translations,i=(0,u.useState)({i18n:null}),o=i[0],a=i[1],c=(0,u.useContext)(l.LanguageContext).language;return(0,u.useLayoutEffect)((function(){f.info("initializing language",c),function(e,t){return new Promise((function(n,r){n(s.default.createInstance({lng:t,resources:e},(function(e){e&&r(e)})))}))}(r,c).then((function(e){a({i18n:e})}))}),[]),(0,u.useLayoutEffect)((function(){o.i18n&&(f.info("changing language",c),o.i18n.changeLanguage(c),a({i18n:o.i18n}))}),[c]),u.default.createElement(t.I18nContext.Provider,{value:o},n)}},4045:function(e,t,n){"use strict";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]}),i=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}),i(n(6915),t),i(n(6009),t),i(n(5318),t),i(n(8133),t),i(n(3895),t)},5318:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageContextProvider=t.LanguageContext=void 0;var a=o(n(9297)),s=n(6255),u=n(6797),c=n(8683),l=new u.Logger("language");t.LanguageContext=(0,a.createContext)({language:s.Language.EN,selectLanguage:function(){}}),t.LanguageContextProvider=function(e){var n=e.language,r=e.children,i=(0,a.useState)((0,c.normalizeLanguage)(n)),o=i[0],s=i[1];(0,a.useLayoutEffect)((function(){var e=(0,c.normalizeLanguage)(n);s(e),l.info("Setting language (passed as prop): "+e+" (before normalization: "+n+")")}),[n]);var u=(0,a.useCallback)((function(e){l.info("Setting language: "+e),s(e)}),[]);return a.default.createElement(t.LanguageContext.Provider,{value:{language:o,selectLanguage:u}},r)}},8133:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8683:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeLanguage=void 0;var r=n(6255),i=new(n(6797).Logger)("i18n");t.normalizeLanguage=function(e){if(null==e)return r.Language.EN;var t=e.toLocaleLowerCase();return"cs"===t||"cz"===t||"cze"===t||"ces"===t?r.Language.CS:"sk"===t||"slk"===t||"slo"===t?r.Language.SK:("en"===t||"eng"===t||i.warn("Unrecognized language (input: "+e+"). Falling back to ENG"),r.Language.EN)}},1920:function(e,t,n){"use strict";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]}),i=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.VAST_PROVIDERS=t.VastProvider=t.useCurrency=t.LanguagePicker=t.useLanguageOptions=t.I18nContextProvider=t.LanguageContextProvider=t.useT=t.firestoreObjectFilters=t.firestoreJavascriptFilters=t.firestoreArrayFilters=t.onceAsync=t.once=t.executeAsNewEventLoopJob=t.removeAccents=t.normalizeText=t.formatLanguage=t.formatCurrency=t.formatEpisode=t.toTwoPlaces=t.preloadImages=t.preloadImage=t.Cache=t.twoPlaces=t.parseCzechDate=t.getQueryByFilter=t.isInThePast=t.getSecs=t.getRelativeTime=t.getMinsSecsHours=t.getMinsSecs=t.getMins=t.getHours=t.getDuration=t.addSeconds=t.addMs=t.addMinutes=t.addHours=t.addDays=t.Analytics=t.createLogger=t.Logger=t.replaceWithoutOverwritingValues=t.notEmptyFilter=t.chunkArray=t.Pagination=t.RefsPagination=void 0;var o=n(1645),a=n(4291);Object.defineProperty(t,"RefsPagination",{enumerable:!0,get:function(){return a.RefsPagination}}),Object.defineProperty(t,"Pagination",{enumerable:!0,get:function(){return a.Pagination}}),i(n(7515),t);var s=n(6797);Object.defineProperty(t,"chunkArray",{enumerable:!0,get:function(){return s.chunkArray}}),Object.defineProperty(t,"notEmptyFilter",{enumerable:!0,get:function(){return s.notEmptyFilter}}),Object.defineProperty(t,"replaceWithoutOverwritingValues",{enumerable:!0,get:function(){return s.replaceWithoutOverwritingValues}}),Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return s.Logger}}),Object.defineProperty(t,"createLogger",{enumerable:!0,get:function(){return s.createLogger}}),Object.defineProperty(t,"Analytics",{enumerable:!0,get:function(){return s.Analytics}}),Object.defineProperty(t,"addDays",{enumerable:!0,get:function(){return s.addDays}}),Object.defineProperty(t,"addHours",{enumerable:!0,get:function(){return s.addHours}}),Object.defineProperty(t,"addMinutes",{enumerable:!0,get:function(){return s.addMinutes}}),Object.defineProperty(t,"addMs",{enumerable:!0,get:function(){return s.addMs}}),Object.defineProperty(t,"addSeconds",{enumerable:!0,get:function(){return s.addSeconds}}),Object.defineProperty(t,"getDuration",{enumerable:!0,get:function(){return s.getDuration}}),Object.defineProperty(t,"getHours",{enumerable:!0,get:function(){return s.getHours}}),Object.defineProperty(t,"getMins",{enumerable:!0,get:function(){return s.getMins}}),Object.defineProperty(t,"getMinsSecs",{enumerable:!0,get:function(){return s.getMinsSecs}}),Object.defineProperty(t,"getMinsSecsHours",{enumerable:!0,get:function(){return s.getMinsSecsHours}}),Object.defineProperty(t,"getRelativeTime",{enumerable:!0,get:function(){return s.getRelativeTime}}),Object.defineProperty(t,"getSecs",{enumerable:!0,get:function(){return s.getSecs}}),Object.defineProperty(t,"isInThePast",{enumerable:!0,get:function(){return s.isInThePast}}),Object.defineProperty(t,"getQueryByFilter",{enumerable:!0,get:function(){return s.getQueryByFilter}}),Object.defineProperty(t,"parseCzechDate",{enumerable:!0,get:function(){return s.parseCzechDate}}),Object.defineProperty(t,"twoPlaces",{enumerable:!0,get:function(){return s.twoPlaces}}),Object.defineProperty(t,"Cache",{enumerable:!0,get:function(){return s.Cache}}),Object.defineProperty(t,"preloadImage",{enumerable:!0,get:function(){return s.preloadImage}}),Object.defineProperty(t,"preloadImages",{enumerable:!0,get:function(){return s.preloadImages}}),Object.defineProperty(t,"toTwoPlaces",{enumerable:!0,get:function(){return s.toTwoPlaces}}),Object.defineProperty(t,"formatEpisode",{enumerable:!0,get:function(){return s.formatEpisode}}),Object.defineProperty(t,"formatCurrency",{enumerable:!0,get:function(){return s.formatCurrency}}),Object.defineProperty(t,"formatLanguage",{enumerable:!0,get:function(){return s.formatLanguage}}),Object.defineProperty(t,"normalizeText",{enumerable:!0,get:function(){return s.normalizeText}}),Object.defineProperty(t,"removeAccents",{enumerable:!0,get:function(){return s.removeAccents}}),Object.defineProperty(t,"executeAsNewEventLoopJob",{enumerable:!0,get:function(){return s.executeAsNewEventLoopJob}}),Object.defineProperty(t,"once",{enumerable:!0,get:function(){return s.once}}),Object.defineProperty(t,"onceAsync",{enumerable:!0,get:function(){return s.onceAsync}}),i(n(3854),t);var u=n(2509);Object.defineProperty(t,"firestoreArrayFilters",{enumerable:!0,get:function(){return u.firestoreArrayFilters}}),Object.defineProperty(t,"firestoreJavascriptFilters",{enumerable:!0,get:function(){return u.firestoreJavascriptFilters}}),Object.defineProperty(t,"firestoreObjectFilters",{enumerable:!0,get:function(){return u.firestoreObjectFilters}});var c=n(4045);Object.defineProperty(t,"useT",{enumerable:!0,get:function(){return c.useT}}),Object.defineProperty(t,"LanguageContextProvider",{enumerable:!0,get:function(){return c.LanguageContextProvider}}),Object.defineProperty(t,"I18nContextProvider",{enumerable:!0,get:function(){return c.I18nContextProvider}}),Object.defineProperty(t,"useLanguageOptions",{enumerable:!0,get:function(){return c.useLanguageOptions}}),Object.defineProperty(t,"LanguagePicker",{enumerable:!0,get:function(){return c.LanguagePicker}}),Object.defineProperty(t,"useCurrency",{enumerable:!0,get:function(){return c.useCurrency}});var l=n(7723);Object.defineProperty(t,"VastProvider",{enumerable:!0,get:function(){return l.VastProvider}}),Object.defineProperty(t,"VAST_PROVIDERS",{enumerable:!0,get:function(){return l.VAST_PROVIDERS}}),i(n(6895),t),i(n(9281),t),(0,o.polyfill)()},3331:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pagination=void 0;var o=n(2965),a=(0,n(6797).createLogger)("Pagination");t.Pagination=function(e,t,n){var s,u,c=this;this.query=e,this.creator=t,this.options=n,this.lastDocumentSnapshot=null,this.items=[],this.hasNextPage=!0,this.loading=!1,this.limit=10,this.fetchMore=function(){c.loading?a.info("loading ..."):c.hasNextPage?(a.info("fetch more"),c.fetchData()):a.info("no more data")},this.fetchData=function(){return r(c,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:a.info("fetch data"),n.label=1;case 1:return n.trys.push([1,3,4,5]),this.startLoading(),[4,this.makeQuery()];case 2:return e=n.sent(),a.info("fetched "+e.size+" docs, going to create entities"),this.items=this.items.concat(this.querySnapshotToEntities(e)),this.lastDocumentSnapshot=this.getLastSnapshotFromQuerySnapshot(e),[3,5];case 3:return t=n.sent(),console.error(t),[3,5];case 4:return this.stopLoading(),[7];case 5:return[2]}}))}))},this.querySnapshotToEntities=function(e){return e.docs.map((function(e){return c.creator(e.ref,e.data())}))},this.makeQuery=function(){return r(c,void 0,void 0,(function(){var e,t;return i(this,(function(n){return e=this.query,(null===(t=this.options)||void 0===t?void 0:t.noLimit)?(a.info("fetch all documents without pagination"),this.hasNextPage=!1):this.lastDocumentSnapshot?(a.info("making query with limit",this.limit),e=e.limit(this.limit).startAfter(this.lastDocumentSnapshot)):(a.info("making first query with limit",this.limit),e=e.limit(this.limit)),[2,e.get()]}))}))},this.getLastSnapshotFromQuerySnapshot=function(e){var t=e.size;return c.hasNextPage=!e.empty&&e.size==c.limit,t>0?e.docs[t-1]:null},this.startLoading=function(){c.loading=!0},this.stopLoading=function(){c.loading=!1},this.addItemToEnd=function(e){c.hasNextPage?a.info("ignoring of adding an item to pagination locally because not all items are loaded"):(a.info("add item to end"),c.items=c.items.concat([e]))},this.addItemToStart=function(e){a.info("add item to start"),c.items=[e].concat(c.items)},(0,o.makeObservable)(this,{items:o.observable}),this.limit=null!==(u=null===(s=this.options)||void 0===s?void 0:s.limit)&&void 0!==u?u:this.limit,this.fetchData()}},4291:function(e,t,n){"use strict";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]}),i=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}),i(n(2523),t),i(n(3331),t)},2523:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RefsPagination=void 0;var o=n(2965),a=n(6797),s=(0,a.createLogger)("RefsPagination"),u=function(){function e(e,t,n,u,c){var l=this;if(void 0===n&&(n=!0),void 0===u&&(u=10),void 0===c&&(c=!0),this.refs=e,this.creator=t,this.initialized=n,this.limit=u,this.items=[],this.currentItems=[],this.currentPage=0,this.hasNextPage=!0,this.loading=!1,this.error=null,this.fetchMore=function(){return r(l,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.isLoading?[2]:(this.currentPage++,[4,this.fetchData()]);case 1:return e.sent(),[2]}}))}))},this.fetchData=function(){return r(l,void 0,void 0,(function(){var e,t,n,o,u,c,l=this;return i(this,(function(f){switch(f.label){case 0:if(this.isLoading||!this.hasNextPage)return[2];f.label=1;case 1:return f.trys.push([1,4,5,6]),s.info("fetchData"),e=this.currentPage*this.limit,t=e+this.limit,0!==this.items.slice(e,t).length?[3,3]:(n=this.refs.slice(e,t),t>=this.refs.length&&(this.hasNextPage=!1),this.startLoading(),[4,Promise.all(n.map((function(e){return r(l,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.get()];case 1:return t=r.sent(),(n=t.data())?[2,this.creator(e,n)]:[2,null]}}))}))})))]);case 2:return o=f.sent(),u=o.filter(a.notEmptyFilter),s.info("fetched "+u.length+" items of "+n.length+" refs"),this.endLoading(),this.setCurrentItems=u,this.setItems=this.items.concat(u),[3,3];case 3:return[3,6];case 4:return c=f.sent(),s.error(c),this.setError=c,[3,6];case 5:return this.endLoading(),[7];case 6:return[2]}}))}))},this.addItemToStart=function(e,t){l.refs=l.refs.concat([t]),l.getItems.unshift(e)},this.addItem=function(e,t){l.refs.length===l.items.length&&(l.setItems=l.items.concat([e])),l.refs=l.refs.concat([t])},this.getItem=function(e){return r(l,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return(t=this.refs.find((function(t){return t.id===e})))?[4,t.get()]:[3,2];case 1:return n=i.sent(),(r=n.data())?[2,this.creator(n.ref,r)]:[3,3];case 2:throw new Error("ref-not-found");case 3:return[2]}}))}))},this.limit>1e3)throw new Error("Limit cannot be greater than 1000");c&&this.fetchData(),(0,o.makeObservable)(this,{items:o.observable,refs:o.observable,loading:o.observable,error:o.observable,hasNextPage:o.observable})}return e.prototype.startLoading=function(){this.setLoading=!0},e.prototype.endLoading=function(){this.setLoading=!1},Object.defineProperty(e.prototype,"getError",{get:function(){return this.error},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getCurrentItems",{get:function(){return this.currentItems},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getItems",{get:function(){return this.items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getRefs",{get:function(){return this.refs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getHasNextPage",{get:function(){return this.hasNextPage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getItemsCount",{get:function(){return this.refs.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInitialized",{get:function(){return this.initialized},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setItems",{set:function(e){this.items=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setLoading",{set:function(e){this.loading=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setCurrentItems",{set:function(e){this.currentItems=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setIsInitialized",{set:function(e){this.initialized=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setError",{set:function(e){this.error=e},enumerable:!1,configurable:!0}),e}();t.RefsPagination=u},1645:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.polyfill=void 0,t.polyfill=function(){"object"==typeof window&&"object"==typeof document&&window.addEventListener("load",(function(){var e=document.createElement("script");e.src="https://polyfill.io/v3/polyfill.min.js?features=String.prototype.normalize",e.id="tivio-polyfill-string-prototype-normalize",document.head.appendChild(e)}))}},3690:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CUSTOMER_BUILD=void 0,function(e){e.OKTAGON="OKTAGON",e.JOJ="JOJ",e.MALL="MALL"}(n||(n={})),t.CUSTOMER_BUILD=n},9352:function(e,t,n){"use strict";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]}),i=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}),i(n(8757),t),i(n(3690),t)},8757:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6255:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.languages=t.Language=void 0,function(e){e.CS="cs",e.SK="sk",e.EN="en"}(n=t.Language||(t.Language={})),t.languages=Object.values(n)},7245:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ASSET_PRESET_PLACEMENTS=t.AssetPresetPlacement=void 0,function(e){e.TV_CHANNEL="tvChannel",e.CHANNEL="channel",e.SECTION="section",e.VIDEO="video",e.TAG="tag"}(n=t.AssetPresetPlacement||(t.AssetPresetPlacement={})),t.ASSET_PRESET_PLACEMENTS=Object.values(n)},5761:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},543:function(e,t,n){"use strict";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]}),i=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}),i(n(7245),t),i(n(5761),t),i(n(1435),t),i(n(2778),t),i(n(8496),t),i(n(5925),t),i(n(2226),t),i(n(1281),t),i(n(7371),t),i(n(800),t),i(n(2062),t),i(n(557),t),i(n(4338),t),i(n(4757),t)},1435:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2778:function(e,t){"use strict";var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.AdProfileType=t.OnlineSkippability=t.StreamSkippability=t.MONETIZATION_FREQUENCY=void 0,(o=t.MONETIZATION_FREQUENCY||(t.MONETIZATION_FREQUENCY={})).ONE_TIME_PAYMENT="ONE_TIME_PAYMENT",o.DAILY="DAILY",o.WEEKLY="WEEKLY",o.MONTHLY="MONTHLY",(i=t.StreamSkippability||(t.StreamSkippability={})).SKIPPABLE="SKIPPABLE",i.NOT_SKIPPABLE="NOT_SKIPPABLE",i.AUTO_SKIP="AUTO_SKIP",(r=t.OnlineSkippability||(t.OnlineSkippability={})).SKIPPABLE="SKIPPABLE",r.NOT_SKIPPABLE="NOT_SKIPPABLE",r.VAST_BASED="VAST_BASED",(n=t.AdProfileType||(t.AdProfileType={})).ONLINE="ONLINE",n.STREAM="STREAM"},8496:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4757:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentGateway=t.PurchaseStatus=t.CURRENCIES=void 0,t.CURRENCIES=["CZK","EUR","USD"],(n=t.PurchaseStatus||(t.PurchaseStatus={})).NEW="NEW",n.PAID="PAID",n.CANCELLED="CANCELLED",n.ERROR="ERROR",(t.PaymentGateway||(t.PaymentGateway={})).QERKO="qerko"},557:function(e,t){"use strict";var n,r,i,o,a,s,u,c;Object.defineProperty(t,"__esModule",{value:!0}),t.ORDER_BY_FIELD_PATH=t.WHERE_FILTER_FIELD_PATH=t.WHERE_FILTER_OPERATOR=t.ORDER_BY_DIRECTION=t.ROW_TYPE=t.FILTER_COLLECTION=t.ROW_ITEM_COMPONENT=t.ROW_COMPONENT=void 0,function(e){e.ROW="ROW",e.BANNER="BANNER"}(n||(n={})),t.ROW_COMPONENT=n,function(e){e.ROW_ITEM_PORTRAIT="ROW_ITEM_PORTRAIT",e.ROW_ITEM_LANDSCAPE="ROW_ITEM_LANDSCAPE",e.ROW_ITEM_CIRCLED="ROW_ITEM_CIRCLED"}(r||(r={})),t.ROW_ITEM_COMPONENT=r,function(e){e.VIDEOS="videos",e.TAGS="tags"}(i||(i={})),t.ROW_TYPE=i,function(e){e.DESC="desc",e.ASC="asc"}(o||(o={})),t.ORDER_BY_DIRECTION=o,function(e){e.LESS="<",e.LESS_OR_EQUAL="<=",e.EQUAL="==",e.NOT_EQUAL="!=",e.GREATER_OR_EQUAL=">=",e.GREATER=">",e.ARRAY_CONTAINS="array-contains",e.IN="in",e.ARRAY_CONTAINS_ANY="array-contains-any",e.NOT_IN="not-in"}(a||(a={})),t.WHERE_FILTER_OPERATOR=a,function(e){e.CREATED="created",e.TAGS="tags",e.TAG_TYPE_REF="tagTypeRef"}(s||(s={})),t.WHERE_FILTER_FIELD_PATH=s,function(e){e.VIDEOS="videos",e.TAGS="tags"}(u||(u={})),t.FILTER_COLLECTION=u,function(e){e.CREATED="created"}(c||(c={})),t.ORDER_BY_FIELD_PATH=c},2062:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5925:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4338:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TagMetadataFieldType=void 0,(n=t.TagMetadataFieldType||(t.TagMetadataFieldType={})).STRING="STRING",n.TRANSLATION="TRANSLATION",n.NUMBER="NUMBER",n.BOOLEAN="BOOLEAN"},2226:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TvStream=void 0,(n=t.TvStream||(t.TvStream={})).STARTOVER="startover",n.TIMESHIFT="timeshift",n.LIVE="live",n.ALL="all"},1281:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7371:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.USER_TYPE=void 0,function(e){e.ORGANIZATION_USER="ORGANIZATION_USER",e.TIVIO_USER="TIVIO_USER"}(n||(n={})),t.USER_TYPE=n},800:function(e,t){"use strict";var n,r,i,o,a,s,u,c;Object.defineProperty(t,"__esModule",{value:!0}),t.NewVideoSourceCodec=t.NewVideoSourceEncrytion=t.NewVideoSourceProtocol=t.ELEMENT_TYPE=t.DATA_SOURCE=t.VIDEO_STATUS=t.PUBLISHED_STATUS=t.PlacementType=void 0,function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"}(n||(n={})),t.PUBLISHED_STATUS=n,function(e){e.CREATED="CREATED",e.ENCODING="ENCODING",e.ENCODING_DONE="ENCODING_DONE",e.ERROR="ERROR"}(r||(r={})),t.VIDEO_STATUS=r,function(e){e.MALL_TV="MALL_TV",e.TIVIO_ADMIN="TIVIO_ADMIN",e.EPG_IMPORT="EPG_IMPORT"}(i||(i={})),t.DATA_SOURCE=i,function(e){e.PLAYLIST="PLAYLIST",e.VIDEO="VIDEO",e.TV_PROGRAM="TV_PROGRAM"}(o||(o={})),t.ELEMENT_TYPE=o,(c=t.PlacementType||(t.PlacementType={})).VIDEO="video",c.SECTION="section",c.CHANNEL="channel",function(e){e.HLS="hls",e.DASH="dash",e.MP4="mp4"}(a||(a={})),t.NewVideoSourceProtocol=a,function(e){e.NONE="none",e.WIDEVINE="widevine",e.FAIRPLAY="fairplay"}(s||(s={})),t.NewVideoSourceEncrytion=s,function(e){e.H264="h264",e.H265="h265"}(u||(u={})),t.NewVideoSourceCodec=u},9396:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},786:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5129:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9786:function(e,t,n){"use strict";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]}),i=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}),i(n(9363),t),i(n(2635),t),i(n(786),t),i(n(3910),t),i(n(190),t),i(n(4906),t),i(n(3948),t),i(n(7535),t),i(n(3161),t),i(n(5656),t),i(n(9614),t),i(n(9396),t),i(n(1738),t),i(n(5129),t),i(n(3959),t),i(n(7605),t)},3959:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3910:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1738:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7535:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ROW_ITEM_TYPES=void 0,(n=t.ROW_ITEM_TYPES||(t.ROW_ITEM_TYPES={})).VIDEO="VIDEO",n.TAG="TAG"},3161:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7605:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ALGOLIA_INDEX_NAME=void 0,(n=t.ALGOLIA_INDEX_NAME||(t.ALGOLIA_INDEX_NAME={})).VIDEOS="videos",n.TAGS="tags",n.TV_CHANNELS="tvChannels"},190:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9614:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5656:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4906:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9363:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3948:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2635:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2010:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.newFirestoreTimestamp=void 0;var i=r(n(7005));t.newFirestoreTimestamp=function(e){return void 0===e&&(e=new Date),i.default.firestore.Timestamp.fromDate(e)}},6895:function(e,t,n){"use strict";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]}),i=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}),i(n(2010),t),i(n(543),t),i(n(9786),t),i(n(9352),t),i(n(6255),t)},9075:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Analytics=void 0;var i=n(187),o=new(n(6222).Logger)("analytics"),a=function(){function e(){this.eventNames=null,this.gaMeasurementId=null}return e.prototype.init=function(e,t){this.gaMeasurementId=e,this.eventNames=t,(0,i.install)(e)},e.prototype.trackAnalytic=function(e,t,n){if(this.isInitialized()){var r=this.eventNames[e];r&&(o.info("Tracking analytic "+e+" under "+r,t,n),this.trackEvent(r,t,n))}else o.warn("Failed to track event, because analytics are not initialized yet",e,t)},e.prototype.isInitialized=function(){return null!=this.eventNames&&null!=this.gaMeasurementId},e.prototype.trackEvent=function(e,t,n){var o=r(r({},null!=t?t:{}),{send_to:this.gaMeasurementId});n?(0,i.gtag)("event",e,o,n):(0,i.gtag)("event",e,o)},e}();t.Analytics=a},4511:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replaceWithoutOverwritingValues=t.chunkArray=t.notEmptyFilter=void 0,t.notEmptyFilter=function(e){return!!e},t.chunkArray=function(e,t){var n,r=e.length,i=[];for(n=0;n<r;n+=t){var o=e.slice(n,n+t);i.push(o)}return i},t.replaceWithoutOverwritingValues=function(e,t,n){var r=[];return t.forEach((function(t){var i=e.find((function(e){return n(t,e)}));r.push(null!=i?i:t)})),r}},7607:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0;var n=function(){function e(e){var t,n;this.enabled=!0,this.map=new Map,this.max=null!==(t=null==e?void 0:e.max)&&void 0!==t?t:1e3,this.convertKey=null!==(n=null==e?void 0:e.convertKey)&&void 0!==n?n:function(e){return e}}return e.prototype.set=function(e,t){this.enabled&&(this.map.size>this.max&&this.map.clear(),this.map.set(this.convertKey(e),t))},e.prototype.get=function(e){var t;return null!==(t=this.map.get(this.convertKey(e)))&&void 0!==t?t:null},e.prototype.has=function(e){return!!this.enabled&&this.map.has(this.convertKey(e))},e.prototype.getSize=function(){return this.map.size},e.prototype.disable=function(){this.enabled=!1},e}();t.Cache=n},3489:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.onceAsync=t.once=void 0,t.once=function(e){var t=!1;return function(){t||(e(),t=!0)}},t.onceAsync=function(e){var t=!1;return function(){return n(void 0,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return t?[3,2]:(t=!0,[4,e()]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}},7500:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.stringComparator=t.booleanComparator=t.numberComparator=t.SortDirection=void 0,function(e){e.ASC="ASC",e.DESC="DESC"}(n=t.SortDirection||(t.SortDirection={})),t.numberComparator=function(e,t,r){return r===n.ASC?e-t:t-e},t.booleanComparator=function(e,t){return e&&t?0:e&&!t?-1:!e&&t?1:0},t.stringComparator=function(e,t){return e<t?-1:1}},3854:function(e,t,n){"use strict";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]}),i=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}),i(n(7500),t),i(n(9153),t),i(n(9924),t)},9153:function(e,t,n){"use strict";var r,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.strategiesComparator=t.priceComparator=t.expirationComparator=t.placementTypeComparator=t.PLACEMENT_TYPE_PRIORITIES=void 0;var o=n(7500),a=n(6895),s=i(n(6160));t.PLACEMENT_TYPE_PRIORITIES=((r={})[a.PlacementType.VIDEO]=2,r[a.PlacementType.SECTION]=1,r[a.PlacementType.CHANNEL]=0,r),t.placementTypeComparator=function(e,n,r){return void 0===r&&(r=o.SortDirection.DESC),(0,o.numberComparator)(t.PLACEMENT_TYPE_PRIORITIES[e.placementType],t.PLACEMENT_TYPE_PRIORITIES[n.placementType],r)},t.expirationComparator=function(e,t,n){var r,i;return void 0===n&&(n=o.SortDirection.ASC),(0,o.numberComparator)(null!==(r=e.expirationDaysSincePublished)&&void 0!==r?r:Number.MAX_VALUE,null!==(i=t.expirationDaysSincePublished)&&void 0!==i?i:Number.MAX_VALUE,n)},t.priceComparator=function(e,t){var n,r,i,a;return e.prices?(0,o.numberComparator)(null!==(r=null===(n=e.prices)||void 0===n?void 0:n.CZK)&&void 0!==r?r:0,null!==(a=null===(i=t.prices)||void 0===i?void 0:i.CZK)&&void 0!==a?a:0,o.SortDirection.ASC):0},t.strategiesComparator=function(e,t){return(0,o.numberComparator)((0,s.default)(e.strategies)?0:1,(0,s.default)(t.strategies)?0:1,o.SortDirection.ASC)}},9924:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalsFirstRestAlphabeticallyComparator=t.alphabeticComparator=t.sortAlphabetically=void 0;var r=n(7500);t.sortAlphabetically=function(e){return e.sort((function(e,t){return(0,r.stringComparator)(e.name,t.name)}))},t.alphabeticComparator=function(e,t){return(0,r.stringComparator)(e.name,t.name)},t.globalsFirstRestAlphabeticallyComparator=function(e,t){var n,i;return(0,r.booleanComparator)(null!==(n=e.isGlobal)&&void 0!==n&&n,null!==(i=t.isGlobal)&&void 0!==i&&i)||(0,r.stringComparator)(e.name,t.name)}},711:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeAsNewEventLoopJob=void 0,t.executeAsNewEventLoopJob=function(e){setTimeout(e)}},8399:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLanguage=t.formatCurrency=t.formatEpisode=t.toTwoPlaces=void 0;var r=n(6895);t.toTwoPlaces=function(e){return e<10?"0"+e:""+e},t.formatEpisode=function(e,n){return"S"+(0,t.toTwoPlaces)(e)+"E"+(0,t.toTwoPlaces)(n)},t.formatCurrency=function(e){switch(e){case"CZK":return"Kč";case"EUR":return"€";case"USD":return"$"}},t.formatLanguage=function(e){switch(e){case r.Language.CS:return"CZ";case r.Language.EN:return"EN";case r.Language.SK:return"SK"}}},3434:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadImages=t.preloadImage=void 0,t.preloadImage=function(e){return new Promise((function(t,n){var r=new Image;r.src=e,r.onload=t,r.onerror=function(){n("image failed to load (uri:"+e+")")}}))},t.preloadImages=function(e){return Promise.all(e.map(t.preloadImage))}},6797:function(e,t,n){"use strict";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]}),i=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}),i(n(4511),t),i(n(9075),t),i(n(6222),t),i(n(8029),t),i(n(7607),t),i(n(3854),t),i(n(6845),t),i(n(3434),t),i(n(8399),t),i(n(2729),t),i(n(711),t),i(n(3489),t)},6222:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=t.Logger=void 0;var r=function(){function e(e){this.name=e,this.isEnabled=!0}return e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.log.apply(this,n(["error"],e,!1))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.log.apply(this,n(["info"],e,!1))},e.prototype.off=function(){this.isEnabled=!1},e.prototype.on=function(){this.isEnabled=!0},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.log.apply(this,n(["warn"],e,!1))},e.prototype.forceInfo=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];console.info.apply(console,n([e.prefix+":"+this.name],t,!1))},e.prototype.log=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];e.enabled&&this.isEnabled&&console[t].apply(console,n([e.prefix+":"+this.name],r,!1))},e.enabled=!0,e.prefix="tivio",e}();t.Logger=r,t.createLogger=function(e){return new r(e)}},6845:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQueryByFilter=void 0,t.getQueryByFilter=function(e,t){return e.where.reduce((function(e,t){return Array.isArray(t.value)&&0===t.value.length?e:e.where(t.fieldPath,t.opStr,t.value)}),t).orderBy(e.orderBy.fieldPath,e.orderBy.directionStr)}},2729:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeText=t.toKebabCase=t.toSnakeCase=t.removeAccents=void 0,t.removeAccents=function(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")},t.toSnakeCase=function(e){return e.trim().toLocaleLowerCase().replace(/\s+/g,"_")},t.toKebabCase=function(e){return e.trim().toLocaleLowerCase().replace(/\s+/g,"-")},t.normalizeText=function(e,n){void 0===n&&(n="snake-case");var r=(0,t.removeAccents)(e);return"snake-case"===n?(0,t.toSnakeCase)(r):(0,t.toKebabCase)(r)}},8029:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getRelativeTime=t.getDuration=t.getMinsSecsHours=t.getMinsSecs=t.twoPlaces=t.getHours=t.getMins=t.getSecs=t.parseCzechDate=t.isInThePast=t.addSeconds=t.addMs=t.addMinutes=t.addHours=t.addDays=void 0;var a=o(n(2096));function s(e,t){return u(e,60*t)}function u(e,t){return l(e,60*t)}function c(e,t){return new Date(e.getTime()+t)}function l(e,t){return c(e,1e3*t)}function f(e,t){var n=null!=e?Math.floor(e/1e3):0;return t?n%60:n}function d(e,t){var n=null!=e?Math.floor(f(e)/60):0;return t?n%60:n}function p(e,t){var n=null!=e?Math.floor(d(e)/60):0;return t?n%24:n}function h(e){return e>=10?e:"0"+e}t.addDays=function(e,t){return s(e,24*t)},t.addHours=s,t.addMinutes=u,t.addMs=c,t.addSeconds=l,t.isInThePast=function(e){return e<new Date},t.parseCzechDate=function(e){var t=a.parse("dd.MM.yyyy hh:mm",e),n=1e3*t.getSeconds()+t.getMilliseconds();return new Date(t.getTime()-n)},t.getSecs=f,t.getMins=d,t.getHours=p,t.twoPlaces=h,t.getMinsSecs=function(e){if(e<0)return{mins:0,secs:0,text:"",textWordy:""};var t=d(e),n=f(e,!0),r="";return n&&(r=n+" s"),t&&(r=t+" min"+(r.length>0?" "+r:"")),{mins:t,secs:n,text:t+":"+h(n),textWordy:r}},t.getMinsSecsHours=function(e){var t=p(e),n=d(e,!0),r=f(e,!0),i=n+":"+h(r);return t>0&&(4===i.length&&(i="0"+i),i=t+":"+i),{hours:t,mins:n,secs:r,text:i}},t.getDuration=function(e){return null==e||e<0?null:Math.round(e/60)+" MIN"},t.getRelativeTime=function(e){if(null==e)return"";var t=((new Date).getTime()-e.getTime())/36e5,n=Math.floor(t);if(n<1)return"";if(n<24)return n+" HOURS AGO";var r=t/24,i=Math.floor(r);if(i<7)return i+" DAYS AGO";var o=r/7,a=Math.floor(o);if(a<5)return a+" WEEKS AGO";var s=r/30,u=Math.floor(s);if(u<12)return u+" MONTHS AGO";var c=r/365;return Math.ceil(c)+" YEARS AGO"}},7005:function(e){"use strict";e.exports=i},2965:function(e){"use strict";e.exports=r},9297:function(e){"use strict";e.exports=o}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n(1920)}())},1903:function(e,t,n){"use strict";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 i=r(n(9297)),o=n(5925);t.ContextProvider=function(e){return i.default.createElement(o.UserContextProvider,null,i.default.createElement(o.OrganizationSubscriptionsContextProvider,null,i.default.createElement(o.PurchasesWithVideosContextProvider,null,i.default.createElement(o.ScreensContextProvider,null,i.default.createElement(o.RowItemsContextProvider,null,e.children)))))}},2585:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.withPlayerContext=t.PlayerProvider=t.PlayerContext=void 0;var s=a(n(9297)),u=n(9517);t.PlayerContext=s.default.createContext(void 0),t.PlayerProvider=function(e){var n=e.children,r=e.playerWrapperId,i=c(void 0===r?"default":r),o=l(),a=s.default.createElement(t.PlayerContext.Provider,{value:i},n);return o&&(a=s.default.createElement(o.Provider,{value:{player:i}},a)),a};var c=function(e){var t=(0,s.useState)(null),n=t[0],r=t[1];return(0,s.useEffect)((function(){u.bundlePromise.then((function(t){var n,i=null===(n=t.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:e});r(i)})).catch((function(){}))}),[e]),n},l=function(){var e=(0,s.useState)(null),t=e[0],n=e[1];return(0,s.useEffect)((function(){u.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(i){return s.default.createElement(t.PlayerProvider,{playerWrapperId:e},s.default.createElement(n,r({},i)))}}}},6602:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioContext=t.TivioProvider=void 0;var a=o(n(9297)),s=n(9111),u=n(8643),c=n(5256),l=n(1903),f=(0,u.createUseRemoteBundle)(),d=a.default.createContext(null);t.TivioContext=d,t.TivioProvider=function(e){var t=e.children,n=e.conf,r=(0,a.useMemo)((function(){return(0,s.createInternalConf)(null!=n?n:null)}),[]),i=f(r);(0,a.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]);var o="ready"===(null==i?void 0:i.state)&&i.components?a.default.createElement(i.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},t):t;return a.default.createElement(l.ContextProvider,null,a.default.createElement(d.Provider,{value:i},o))}},2411:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TivioWidget=void 0;var a=o(n(9297)),s=n(8682),u=n(8057);t.TivioWidget=a.default.forwardRef((function(e,t){var n=e.id,r=e.onBlur,i=e.onEnabled;if("string"!=typeof n||!n.length)return a.default.createElement(u.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var o=(0,s.useTivioData)(),c=o.state,l=o.error,f=o.components,d=o.config,p=d.ErrorComponent,h=d.LoaderComponent;switch((0,a.useEffect)((function(){"error"===c&&(null==i||i(!1))}),[c]),c){case"error":return a.default.createElement(p,{error:l});case"loading":return a.default.createElement(h,null);case"ready":return f?a.default.createElement(f.Widget,{id:n,ref:t,onEnabled:i,onBlur:r}):null}}))},8057:function(e,t,n){"use strict";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 i=r(n(9297));t.TivioWidgetError=function(e){var t=e.error;return i.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},t)}},6868:function(e,t,n){"use strict";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 i=r(n(9297));t.TivioWidgetLoader=function(){return i.default.createElement("div",null,"loading...")}},664:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TvTivioProvider=void 0;var a=o(n(9297)),s=n(9111),u=n(8643),c=n(5256),l=n(1903),f=n(6602),d=(0,u.createUseRemoteBundle)();t.TvTivioProvider=function(e){var t=e.children,n=e.conf,r=(0,s.createInternalConf)(null!=n?n:null),i=d(r);return(0,a.useEffect)((function(){!1===(null==r?void 0:r.enable)||!1===(null==r?void 0:r.enableSentry)?(0,c.disableSentry)():(0,c.initSentry)()}),[]),a.default.createElement(l.ContextProvider,null,a.default.createElement(f.TivioContext.Provider,{value:i},t))}},9448:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelsContextProvider=t.ChannelsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});t.ChannelsContext=u,t.ChannelsContextProvider=function(e){var t=(0,s.useState)({}),n=t[0],i=t[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(e,t){var n,a=r(r({},o.current),((n={})[e]=t,n));o.current=a,i(a)}}},e.children)}},7571:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSubscriptionsContext=t.OrganizationSubscriptionsContextProvider=void 0;var a=o(n(9297)),s=(0,a.createContext)({subscriptions:[],setSubscriptions:function(){return null}});t.OrganizationSubscriptionsContext=s,t.OrganizationSubscriptionsContextProvider=function(e){var t=(0,a.useState)([]),n=t[0],r=t[1];return a.default.createElement(s.Provider,{value:{subscriptions:n,setSubscriptions:r}},e.children)}},2860:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PurchasesWithVideosContextProvider=t.PurchasesWithVideosContext=void 0;var a=o(n(9297)),s=(0,a.createContext)({purchases:[],setPurchases:function(){return null}});t.PurchasesWithVideosContext=s,t.PurchasesWithVideosContextProvider=function(e){var t=(0,a.useState)([]),n=t[0],r=t[1];return a.default.createElement(s.Provider,{value:{purchases:n,setPurchases:r}},e.children)}},988:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RowItemsContextProvider=t.RowItemsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)(null);t.RowItemsContext=u,t.RowItemsContextProvider=function(e){var t=(0,s.useState)({}),n=t[0],i=t[1],o=(0,s.useCallback)((function(e,t){i((function(n){var i;return r(r({},n),((i={})[e]=t,i))}))}),[n]);return s.default.createElement(u.Provider,{value:{data:n,setData:o}},e.children)}},853:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ScreensContextProvider=t.ScreensContext=void 0;var s=a(n(9297)),u=(0,s.createContext)(null);t.ScreensContext=u,t.ScreensContextProvider=function(e){var t=(0,s.useState)({}),n=t[0],i=t[1],o=(0,s.useCallback)((function(e,t){var o,a=r(r({},n),((o={})[e]=t,o));i(a)}),[n]);return s.default.createElement(u.Provider,{value:{data:n,setData:o}},e.children)}},2141:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SectionsContextProvider=t.SectionsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});t.SectionsContext=u,t.SectionsContextProvider=function(e){var t=(0,s.useState)({}),n=t[0],i=t[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(e,t){var n,a=r(r({},o.current),((n={})[e]=t,n));o.current=a,i(a)}}},e.children)}},7661:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.UserContext=t.UserContextProvider=void 0;var a=o(n(9297)),s=(0,a.createContext)({user:null,setUser:function(){return null}});t.UserContext=s,t.UserContextProvider=function(e){var t=(0,a.useState)(null),n=t[0],r=t[1];return a.default.createElement(s.Provider,{value:{user:n,setUser:r}},e.children)}},661:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=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}),a=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)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideosContextProvider=t.VideosContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});t.VideosContext=u,t.VideosContextProvider=function(e){var t=(0,s.useState)({}),n=t[0],i=t[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(e,t){var n,a=r(r({},o.current),((n={})[e]=t,n));o.current=a,i(a)}}},e.children)}},5925:function(e,t,n){"use strict";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]}),i=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}),i(n(9448),t),i(n(7571),t),i(n(2860),t),i(n(853),t),i(n(2141),t),i(n(7661),t),i(n(661),t),i(n(988),t)},6766:function(e,t,n){"use strict";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),i=n(1920),o=n(2782),a=n(5925);Object.defineProperty(t,"ChannelsContext",{enumerable:!0,get:function(){return a.ChannelsContext}}),Object.defineProperty(t,"SectionsContext",{enumerable:!0,get:function(){return a.SectionsContext}}),Object.defineProperty(t,"VideosContext",{enumerable:!0,get:function(){return a.VideosContext}});var s=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useWidget=function(e){var t=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(""),o=n[0],a=n[1],s=(0,r.useState)(null),u=s[0],c=s[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return t&&t.subscribeToWidget(e,(function(e,t,n){var r,i,o;e&&a(e.message),t&&(null===(r=t.lastVideo)||void 0===r||r.transaction,null===(i=t.lastVideo)||void 0===i||i.subscriptions,null===(o=t.lastVideo)||void 0===o||o.monetizations,c(t)),n&&(l.current=n)})),function(){var e;null===(e=l.current)||void 0===e||e.call(l)}}),[t]),{error:o,widget:u}},t.useChannel=function(e){var t=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],u=(0,r.useState)(null),c=u[0],l=u[1];return(0,r.useEffect)((function(){t&&(s.info("subscribe to channel with id "+e),t.subscribeToChannel(e,(function(e,t){e&&(s.error("failed to subscribe to channel: ",e),a(e.message)),t&&(s.error("channel data received"),l(t))})))}),[t]),{error:o,data:c}},t.useSection=function(e){var t=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],u=(0,r.useState)(null),c=u[0],l=u[1];return(0,r.useEffect)((function(){t&&(s.info("subscribe to section with id "+e),t.subscribeToSection(e,(function(e,t){e&&(s.error("failed to subscribe to section: ",e),a(e.message)),t&&(s.info("section data received"),l(t))})))}),[t]),{error:o,data:c}},t.useVideo=function(e){var t=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],s=(0,r.useState)(null),u=s[0],c=s[1],l=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(e)return t?(t.subscribeToVideo(e,(function(e,t,n){e&&a(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;a("not-found")}),[t,e]),{error:o,data:u}},t.useVideosInSection=function(e,t){void 0===t&&(t=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.VideosContext),u=o.data[null!=e?e:""];return(0,r.useEffect)((function(){n&&e&&(u||(s.info("subscribe to videos in section "+e),n.subscribeToVideosInSection(e,(function(t,n,r,i){t&&(s.error("failed to subscribe to videos in section: ",t),o.setData(e,{error:t,data:null,isLoading:i})),n&&(s.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})),o.setData(e,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:t,isLoading:i}))}),t)))}),[n,e,o]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},t.useSectionsInChannel=function(e,t){void 0===t&&(t=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.SectionsContext),u=o.data[e];return(0,r.useEffect)((function(){n&&(u||(s.info("subscribe to sections in channel with id "+e),n.subscribeToSectionsInChannel(e,(function(t,n,r,i){t&&(s.error("failed to subscribe to sections in channel: ",t),o.setData(e,{error:t,data:null,isLoading:i})),n&&(s.info("sections data received"),o.setData(e,{error:t,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:i}))}),t)))}),[n]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},t.useChannelsInWidget=function(e,t){void 0===t&&(t=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.ChannelsContext),u=o.data[e];return(0,r.useEffect)((function(){n&&(u||(s.info("subscribe to channels in widget with id: "+e),n.subscribeToChannelsInWidget(e,(function(t,n,r,i){t&&(s.error("failed to subscribe to channels in widget: ",t),o.setData(e,{error:t,data:null,isLoading:i})),n&&(s.info("channels data received"),o.setData(e,{error:t,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:i}))}),t)))}),[n]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},t.useIsLoaded=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],o=(0,i.useTivioData)();return(0,r.useEffect)((function(){o.getters&&o.getters.isTivioLoaded(n)}),[o]),{isTivioLoaded:t}}},8682:function(e,t,n){"use strict";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]}),i=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}),i(n(2883),t),i(n(3354),t),i(n(2596),t),i(n(5469),t),i(n(2134),t),i(n(2639),t),i(n(3650),t),i(n(7802),t),i(n(1350),t),i(n(6766),t),i(n(6862),t),i(n(6311),t),i(n(1197),t),i(n(3419),t),i(n(9814),t),i(n(9302),t)},6862:function(e,t,n){"use strict";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),i=n(2585);t.usePlayerEvent=function(e){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),o=n[0],a=n[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener(e,a),function(){return t.events.removeListener(e,a)}}),[null==t?void 0:t.events]),o},t.useMarkers=function(){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("useMarkers must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("markers",o),function(){return e.events.removeListener("markers",o)}}),[null==e?void 0:e.events]),n},t.useBetOffer=function(){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("useBetOffer must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("bet-offer",o),function(){return e.events.removeListener("bet-offer",o)}}),[null==e?void 0:e.events]),n},t.useIntro=function(){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("useIntro must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("intro",o),function(){return e.events.removeListener("intro",o)}}),[null==e?void 0:e.events]),n},t.useAd=function(){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("useAd must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1],a=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",o);var t="ad-rerender",n="ad-seconds-to-skippable-changed";return e.events.isSupported(t)&&e.events.addListener(t,a),e.events.isSupported(n)&&e.events.addListener(n,a),function(){e.events.removeListener("ad",o),e.events.isSupported(t)&&e.events.removeListener(t,a),e.events.isSupported(n)&&e.events.addListener(n,a)}}}),[null==e?void 0:e.events]),n},t.useCurrentMarker=function(){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("useCurrentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("current-marker",o),function(){return e.events.removeListener("current-marker",o)}}),[null==e?void 0:e.events]),n},t.useSeekState=function(){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("useSeekState must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events){var t=function(){return o(!1)},n=function(){return o(!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)(i.PlayerContext);if(void 0===e)throw new Error("useAdSegmentMarker must be inside PlayerContext");var t=(0,r.useState)(null),n=t[0],o=t[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener("ad-segment-changed",o),function(){return e.events.removeListener("ad-segment-changed",o)}}),[null==e?void 0:e.events]),n}},3650:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useCancelSubscription=void 0;var r=n(9302);t.useCancelSubscription=function(e){var t,n,i=(0,r.useTivioData)().hooks,o=null!==(n=null===(t=null==i?void 0:i.useCancelSubscription)||void 0===t?void 0:t.call(i,e))&&void 0!==n?n:{},a=o.cancelSubscription,s=o.cancellationInfo;return{cancelSubscription:null!=a?a:function(){return Promise.resolve()},cancellationInfo:null!=s?s:null,error:o.error}}},6201:function(e,t,n){"use strict";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){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFreePurchase=void 0;var o=n(9302);t.useFreePurchase=function(){var e=(0,o.useTivioData)().auth;return{purchase:function(t){return r(void 0,void 0,void 0,(function(){return i(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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useItemsInRow=void 0;var r=n(9297),i=n(6201),o=n(9302);t.useItemsInRow=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,a=(0,r.useState)(null),s=a[0],u=a[1],c=(0,i.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}}))})),u({items:t.items.slice(),fetchMore:t.fetchMore}))}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:s,error:l}}},6311:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useOrganizationSubscriptions=void 0;var o=n(9297),a=n(7571),s=n(6766),u=n(9302);t.useOrganizationSubscriptions=function(){var e=(0,o.useContext)(a.OrganizationSubscriptionsContext),t=e.setSubscriptions,n=e.subscriptions,c=(0,u.useTivioData)().getters,l=(0,s.useIsLoaded)().isTivioLoaded;return(0,o.useEffect)((function(){r(void 0,void 0,void 0,(function(){var e;return i(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){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchaseSubscription=void 0;var o=n(9877),a=n(9297),s=n(9302),u=n(2883);t.usePurchaseSubscription=function(e){var t=(0,a.useState)(null),n=t[0],c=t[1],l=(0,a.useState)(""),f=l[0],d=l[1],p=(0,s.useTivioData)().purchaseSubscriptionWithQerko,h=(0,u.useUser)().user,v=(0,a.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:d(""),r.label=1;case 1:if(r.trys.push([1,3,,4]),!p)throw new Error("purchaseVideoWithQerko not in bundle");return[4,p(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]}}))}))}),[p]),g=(0,o.useObserver)((function(){if(h){var t=h.purchases.find((function(t){return t.monetizationId===e}));if(t)return t.status}return"NEW"}));return(0,a.useEffect)((function(){v()}),[v]),{paymentError:f,paymentInfo:n,paymentStatus:g,getPaymentInfo:v}}},1197:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePurchasesWithVideos=void 0;var o=n(9297),a=n(2860),s=n(9302),u=n(2883);t.usePurchasesWithVideos=function(){var e=(0,u.useUser)().user,t=(0,s.useTivioData)().auth,n=(0,o.useContext)(a.PurchasesWithVideosContext),c=n.purchases,l=n.setPurchases;return(0,o.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return i(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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRowsInScreen=void 0;var r=n(9297),i=n(6201),o=n(9302);t.useRowsInScreen=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,a=(0,r.useState)(null),s=a[0],u=a[1],c=(0,i.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&&u({fetchMore:t.fetchMore,items:t.items})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:s,error:l}}},5469:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useScreen=void 0;var r=n(2965),i=n(9297),o=n(5925),a=n(9302);t.useScreen=function(e,t){var n,s,u,c=(0,a.useTivioData)().subscriptions,l=(0,i.useContext)(o.ScreensContext),f=null==l?void 0:l.data[e],d=(0,i.useRef)(null);return(0,i.useEffect)((function(){return c&&l&&null==d.current&&(d.current=null==c?void 0:c.subscribeToScreen(e,(function(t,n){var i;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!==(i=n.rows)&&void 0!==i?i:[]).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!==(s=null==f?void 0:f.data)&&void 0!==s?s:null,isLoading:null===(u=null==f?void 0:f.isLoading)||void 0===u||u}}},2596:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useScreens=void 0;var o=n(9297),a=n(9302);t.useScreens=function(){var e=(0,a.useTivioData)().getters,t=(0,o.useState)([]),n=t[0],s=t[1];return(0,o.useEffect)((function(){e&&r(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,e.getOrganizationScreens()];case 1:return t=n.sent(),s(t),[2]}}))}))}),[e]),{screens:n}}},2134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ALGOLIA_INDEX_NAME=t.useSearch=void 0;var r=n(194);Object.defineProperty(t,"ALGOLIA_INDEX_NAME",{enumerable:!0,get:function(){return r.ALGOLIA_INDEX_NAME}});var i=n(9302);t.useSearch=function(e,t){var n,r,o=(0,i.useTivioData)().hooks,a=null!==(r=null===(n=null==o?void 0:o.useSearch)||void 0===n?void 0:n.call(o,e,t))&&void 0!==r?r:{},s=a.search,u=a.pagination,c=a.isLoading,l=a.error;return{search:null!=s?s:function(){return Promise.resolve()},pagination:(null==u?void 0:u.items)?{items:u.items,fetchMore:u.fetchMore}:null,isLoading:null==c||c,error:null!=l?l:null}}},3354:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useTaggedVideos=void 0;var r=n(9297),i=n(6201),o=n(9302);t.useTaggedVideos=function(e,t){void 0===t&&(t={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,a=(0,r.useState)(null),s=a[0],u=a[1],c=(0,i.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&&u({items:t.items,fetchMore:t.fetchMore})}),t)),function(){var e;null===(e=d.current)||void 0===e||e.call(d)}}),[n]),{pagination:s,error:l}}},9302:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useTivioReadyData=t.useTivioData=void 0;var r=n(9297),i=n(6602),o=function(){var e=(0,r.useContext)(i.TivioContext);if(null===e)throw new Error("Make sure to wrap your app in TivioProvider");return e};t.useTivioData=o,t.useTivioReadyData=function(){var e=o();return"ready"===e.state?e:null}},7802:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTransactionPayment=void 0;var o=n(194),a=n(9877),s=n(9297),u=n(1920);t.useTransactionPayment=function(e,t){var n=(0,s.useState)(null),c=n[0],l=n[1],f=(0,s.useState)(""),d=f[0],p=f[1],h=(0,u.useTivioData)().purchaseVideoWithQerko,v=(0,u.useUser)().user,g=(0,s.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:p(""),i.label=1;case 1:if(i.trys.push([1,3,,4]),!h)throw new Error("purchaseVideoWithQerko not in bundle");return[4,h(e,t)];case 2:return n=i.sent(),l(n),[3,4];case 3:return r=i.sent(),p(r.message),[3,4];case 4:return[2]}}))}))}),[h]);(0,s.useEffect)((function(){g()}),[g]);var b=(0,a.useObserver)((function(){if(c&&v){var n=v.purchases.find((function(n){return n.monetizationId===t&&n.videoId===e}));if(n)return n.status}return o.PurchaseStatus.NEW}));return{paymentInfo:c,paymentError:d,paymentStatus:b,getPaymentInfo:g}}},2883:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUser=void 0;var r=n(9297),i=n(2782),o=n(5925),a=n(9302),s=(0,i.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});t.useUser=function(){var e=(0,r.useContext)(o.UserContext),t=e.user,n=e.setUser,i=(0,a.useTivioData)().subscriptions,u=(0,r.useState)(null),c=u[0],l=u[1];return(0,r.useEffect)((function(){i&&!t&&i.subscribeToUser((function(e,t){e&&(s.error(e),l(e)),t&&n(t)}))}),[i]),{user:t,error:c}}},9111:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var i=n(8057),o=n(6868),a=n(2782),s=n(9373),u=n(1675);t.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:s.fetchPackage,pubSub:(0,u.getPubSub)(),LoaderComponent:o.TivioWidgetLoader,ErrorComponent:i.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,a.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.5.0-alpha3"})}},1920:function(e,t,n){"use strict";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]}),i=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 o=n(2585);Object.defineProperty(t,"PlayerProvider",{enumerable:!0,get:function(){return o.PlayerProvider}}),Object.defineProperty(t,"withPlayerContext",{enumerable:!0,get:function(){return o.withPlayerContext}});var a=n(9517);Object.defineProperty(t,"bundlePromise",{enumerable:!0,get:function(){return a.bundlePromise}}),i(n(8682),t),i(n(6602),t),i(n(2411),t),i(n(8057),t),i(n(664),t),i(n(6868),t),i(n(2738),t),i(n(8643),t),i(n(1675),t),i(n(6946),t)},8643:function(e,t,n){"use strict";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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUseRemoteBundle=t.createRemotePackageLoader=t.fetchBundle=void 0;var a=n(9297),s=n(2229),u=n(6614),c=function(e){var t=e.resolverUrl;return(0,e.fetchPackage)(t)},l=function(e,t){return i(void 0,void 0,void 0,(function(){return o(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,i={},o={exports:i};try{new Function("require","module","exports",n)(s.resolveShared,o,i)}catch(e){return Promise.reject("Cannot load Tivio Resolver "+e)}return"function"!=typeof(null===(r=o.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):o.exports.tivio.fetch(e,t.sdkVersion)}))]}}))}))};t.fetchBundle=l;var f=function(){return function(e,t){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){return[2,l(e,t).then((function(e){var t={},n={exports:t};try{new Function("require","module","exports",e)(s.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 s=(0,u.createSettings)(n),c=(0,a.useState)({auth:null,components:null,config:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:s,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),l=c[0],f=c[1];return(0,a.useEffect)((function(){null!=n.secret&&!1!==n.enable&&e(n.secret,n).then((function(e){return i(void 0,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:return t?[3,2]:[4,e.init(n)];case 1:i.sent(),t=!0,i.label=2;case 2:return s.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:s,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:s,state:"error"})),n.pubSub.publish("on-error",e)}))}),[]),l}}},9517:function(e,t,n){"use strict";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){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var s=o(n(1731)),u=o(n(7985)),c=a(n(9421));n(5942),n(9714);var l=o(n(7717)),f=o(n(8528)),d=o(n(2965)),p=o(n(9877)),h=o(n(9297)),v=o(n(2268)),g=o(n(7789)),b=o(n(2146)),y=o(n(6821)),m=o(n(3634)),O=o(n(9914)),_=o(n(9440)),P={mobx:d,"mobx-react":p,firebase:c.default,"firebase/app":c.default,"firebase/auth":null,"firebase/firestore":null,react:h,React:h,"react-dom":v,"styled-components":O,"@material-ui/core":s,"@material-ui/icons":u,formik:l,i18next:f,"react-i18next":g,"react-router-dom":b,"react-virtualized":m,"react-spring":y,yup:_};t.resolveShared=function(e){if(!(e in P))throw new Error("Could not resolve shared dependency "+e);return P[e]}},2782:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var i=n(5256);t.createLogger=function(e){var t=!1!==e.isSentryEnabled,n=function(n,o){e.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],o,!1)),t&&(null===i.Sentry||void 0===i.Sentry||i.Sentry.captureMessage(""+o,i.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===i.Sentry||void 0===i.Sentry||i.Sentry.captureException(n))}}}},9373:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var i={cache:"no-store"},o=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.')},a=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,i).then(o).catch(a)]}))}))}},1675:function(e,t){"use strict";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,i=null!==(n=e.get(t))&&void 0!==n?n:[],o=i.findIndex((function(e){return e.id===r}));-1!==o&&i.splice(o,1)}}}};var n=null;t.getPubSub=function(){return null===n&&(n=(0,t.createPubSub)()),n}},5256:function(e,t,n){"use strict";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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.initSentry=t.disableSentry=t.Sentry=void 0;var a=o(n(3736)),s="true"===process.env.DISABLE_SENTRY;t.Sentry=s?null:a,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-alpha3",tracesSampleRate:1}),console.info("@tivio: Sentry enabled"),u())};var u=function(){window.sentry=t.Sentry,console.info("@tivio: Sentry added to window")}},6614:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,n=null;return{onSetUser:function(r){var i;"function"!=typeof r?null===(i=e.logger)||void 0===i||i.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){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6946:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1731:function(t){"use strict";t.exports=e},7985:function(e){"use strict";e.exports=t},3736:function(e){"use strict";e.exports=n},7005:function(e){"use strict";e.exports=r},9421:function(e){"use strict";e.exports=i},5942:function(e){"use strict";e.exports=o},9714:function(e){"use strict";e.exports=a},7717:function(e){"use strict";e.exports=s},8528:function(e){"use strict";e.exports=u},2965:function(e){"use strict";e.exports=c},9877:function(e){"use strict";e.exports=l},9297:function(e){"use strict";e.exports=f},2268:function(e){"use strict";e.exports=d},7789:function(e){"use strict";e.exports=p},2146:function(e){"use strict";e.exports=h},6821:function(e){"use strict";e.exports=v},3634:function(e){"use strict";e.exports=g},9914:function(e){"use strict";e.exports=b},9440:function(e){"use strict";e.exports=y}},O={},function e(t){var n=O[t];if(void 0!==n)return n.exports;var r=O[t]={exports:{}};return m[t].call(r.exports,r,r.exports,e),r.exports}(1920);var m,O}));
@@ -1,11 +1,11 @@
1
- import { SubscribeToTaggedVideos } from '@tivio/common';
1
+ import { SubscribeToTaggedVideos, UseCancelSubscription } from '@tivio/common';
2
2
  import { ComponentType } from 'react';
3
3
  import { Logger } from '../services/logger';
4
4
  import { FetchPackage } from '../services/packageLoader';
5
5
  import { Disposer, Empty, Nullable } from './common';
6
6
  import { Channel, Language, RemoteProviderProps, Section, TivioSources, TivioWidgetProps, UserData, WebPlayerProps, Widget } from './types';
7
7
  import type { AdSource, PlayerWrapper } from './customPlayer.types';
8
- import type { Monetization, QerkoPaymentInfo, Screen, SubscribeToItemsInRow, SubscribeToRowsInScreen, SubscribeToScreen, TvAppProps, Video, User, Purchase } from '@tivio/common';
8
+ import type { Monetization, QerkoPaymentInfo, Screen, SubscribeToItemsInRow, SubscribeToRowsInScreen, SubscribeToScreen, TvAppProps, Video, User, Purchase, UseSearch } from '@tivio/common';
9
9
  import type React from 'react';
10
10
  declare type Settings = {
11
11
  onSetUser: (handler: (userId: string, userPayload: unknown) => void) => void;
@@ -142,22 +142,6 @@ declare type TivioGetters = {
142
142
  * @returns {Promise<Widget | null>} widget or null if widget does not exists
143
143
  */
144
144
  getWidgetById: (widgetId: string) => Promise<Widget | null>;
145
- /**
146
- * Search channels by its name.
147
- * Returns array of channels.
148
- * @param query - channel name query
149
- * @param limit - max count of returned channels
150
- * @returns {Promise<Channel[] | null>} channels array
151
- */
152
- searchChannels: (query: string, limit?: number) => Promise<Channel[]>;
153
- /**
154
- * Search videos by its name.
155
- * Returns array of videos. Video section will be always null
156
- * @param query - video name query
157
- * @param limit - max count of returned videos
158
- * @returns {Promise<Video[] | null>} videos array
159
- */
160
- searchVideos: (query: string, limit?: number) => Promise<Video[]>;
161
145
  };
162
146
  interface TivioAuth {
163
147
  changePassword: (newPassword: string) => Promise<void>;
@@ -203,6 +187,8 @@ declare type TivioComponents = {
203
187
  };
204
188
  declare type TivioHooks = {
205
189
  useAd: () => [(AdSource | null)];
190
+ useCancelSubscription: UseCancelSubscription;
191
+ useSearch: UseSearch;
206
192
  };
207
193
  declare type TivioBundle = {
208
194
  components: TivioComponents;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "2.5.0-alpha",
3
+ "version": "2.5.0-alpha3",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -14,7 +14,7 @@
14
14
  "start": "bash ./scripts/start.sh",
15
15
  "test": "jest --config=./jest.config.js --coverage",
16
16
  "clean": "rm -rf dist",
17
- "prepublishOnly": "yarn && yarn ts-node ./scripts/prepublish.ts && yarn run build",
17
+ "prepublishOnly": "yarn && yarn run build",
18
18
  "postpublish": "yarn ts-node ./scripts/postpublish.ts",
19
19
  "publish:alpha": "npm publish --tag alpha",
20
20
  "check:cycles ": "npx madge --circular src/**/*"
@@ -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.42",
30
+ "@tivio/common": "*",
31
31
  "firebase": "^8.2.3",
32
32
  "formik": "^2.2.7",
33
33
  "i18next": "^19.8.4",