@techstuff-dev/foundation-api-utils 1.47.0 → 1.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/cjs/chunks/index-CfrYa4U_.js +9 -0
  2. package/dist/cjs/chunks/index-CfrYa4U_.js.map +1 -0
  3. package/dist/cjs/chunks/shared-2Qy1c7Qz.js +19 -0
  4. package/dist/cjs/chunks/shared-2Qy1c7Qz.js.map +1 -0
  5. package/dist/cjs/chunks/slice-CkWobkWw.js +125 -0
  6. package/dist/cjs/chunks/slice-CkWobkWw.js.map +1 -0
  7. package/dist/{index.js → cjs/chunks/slice-DsZzY7T7.js} +618 -875
  8. package/dist/cjs/chunks/slice-DsZzY7T7.js.map +1 -0
  9. package/dist/cjs/chunks/useAuth-DKhvUX_r.js +13 -0
  10. package/dist/cjs/chunks/useAuth-DKhvUX_r.js.map +1 -0
  11. package/dist/cjs/hooks/index.native.js +19 -0
  12. package/dist/cjs/hooks/index.native.js.map +1 -0
  13. package/dist/cjs/hooks/index.web.js +19 -0
  14. package/dist/cjs/hooks/index.web.js.map +1 -0
  15. package/dist/cjs/index.js +96 -0
  16. package/dist/cjs/index.js.map +1 -0
  17. package/dist/cjs/store/index.native.js +415 -0
  18. package/dist/cjs/store/index.native.js.map +1 -0
  19. package/dist/cjs/store/index.web.js +188 -0
  20. package/dist/cjs/store/index.web.js.map +1 -0
  21. package/dist/esm/chunks/index-KjhWa1AL.js +6 -0
  22. package/dist/esm/chunks/index-KjhWa1AL.js.map +1 -0
  23. package/dist/esm/chunks/shared--CrxBBZ8.js +16 -0
  24. package/dist/esm/chunks/shared--CrxBBZ8.js.map +1 -0
  25. package/dist/{index.esm.js → esm/chunks/slice-3o-PH5Gz.js} +619 -855
  26. package/dist/esm/chunks/slice-3o-PH5Gz.js.map +1 -0
  27. package/dist/esm/chunks/slice-ChJ8ZvmP.js +107 -0
  28. package/dist/esm/chunks/slice-ChJ8ZvmP.js.map +1 -0
  29. package/dist/esm/chunks/useAuth-8d6DlERn.js +11 -0
  30. package/dist/esm/chunks/useAuth-8d6DlERn.js.map +1 -0
  31. package/dist/esm/hooks/index.native.js +14 -0
  32. package/dist/esm/hooks/index.native.js.map +1 -0
  33. package/dist/esm/hooks/index.web.js +14 -0
  34. package/dist/esm/hooks/index.web.js.map +1 -0
  35. package/dist/esm/index.js +9 -0
  36. package/dist/esm/index.js.map +1 -0
  37. package/dist/esm/store/index.native.js +412 -0
  38. package/dist/esm/store/index.native.js.map +1 -0
  39. package/dist/esm/store/index.web.js +185 -0
  40. package/dist/esm/store/index.web.js.map +1 -0
  41. package/dist/types/hooks/index.d.ts +3 -0
  42. package/dist/types/index-BDQnFTra.d.ts +1299 -0
  43. package/dist/{index.d.ts → types/index.d.ts} +64 -1301
  44. package/dist/types/store/index.d.ts +3 -0
  45. package/package.json +37 -9
  46. package/dist/index.esm.js.map +0 -1
  47. package/dist/index.js.map +0 -1
  48. package/dist/lib/api/index.d.ts +0 -21
  49. package/dist/lib/hooks/index.d.ts +0 -4
  50. package/dist/lib/hooks/useAuth.d.ts +0 -1
  51. package/dist/lib/index.d.ts +0 -6
  52. package/dist/lib/services/auth/index.d.ts +0 -2027
  53. package/dist/lib/services/auth/slice.d.ts +0 -91
  54. package/dist/lib/services/cart/slice.d.ts +0 -155
  55. package/dist/lib/services/content/content.interfaces.d.ts +0 -801
  56. package/dist/lib/services/content/index.d.ts +0 -532
  57. package/dist/lib/services/index.d.ts +0 -7
  58. package/dist/lib/services/orders/index.d.ts +0 -271
  59. package/dist/lib/services/payment/index.d.ts +0 -1063
  60. package/dist/lib/store/index.d.ts +0 -2
  61. package/dist/lib/store/index.native.d.ts +0 -68
  62. package/dist/lib/store/index.web.d.ts +0 -68
  63. package/dist/lib/store/storage.d.ts +0 -2
  64. package/dist/lib/types/index.interfaces.d.ts +0 -428
  65. package/dist/lib/utils/dataFormat/index.d.ts +0 -86
  66. package/dist/lib/utils/helpers/index.d.ts +0 -14
  67. package/dist/node_modules/@reduxjs/toolkit/dist/uncheckedindexed.d.ts +0 -5
@@ -1,90 +1,9 @@
1
+ import { Auth } from 'aws-amplify';
2
+ import { r as resetCreating, s as setCredentials, l as logout } from './slice-ChJ8ZvmP.js';
1
3
  import { isPlainObject as isPlainObject$1, nanoid, formatProdErrorMessage, createAction, createSelector as createSelector$1, createNextState, createAsyncThunk, createSlice, prepareAutoBatched, isAnyOf, isFulfilled, isRejectedWithValue, combineReducers, SHOULD_AUTOBATCH, isAllOf, isRejected, isPending, isAction, isAsyncThunkAction } from '@reduxjs/toolkit';
2
4
  import { useStore, useSelector, useDispatch, batch, shallowEqual } from 'react-redux';
3
5
  import { useCallback, useDebugValue, useMemo, useState, useEffect, useRef, useLayoutEffect } from 'react';
4
- import { Auth } from 'aws-amplify';
5
6
  import { jwtDecode } from 'jwt-decode';
6
- import { NativeModules } from 'react-native';
7
-
8
- /******************************************************************************
9
- Copyright (c) Microsoft Corporation.
10
-
11
- Permission to use, copy, modify, and/or distribute this software for any
12
- purpose with or without fee is hereby granted.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- PERFORMANCE OF THIS SOFTWARE.
21
- ***************************************************************************** */
22
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
-
24
-
25
- var __assign = function() {
26
- __assign = Object.assign || function __assign(t) {
27
- for (var s, i = 1, n = arguments.length; i < n; i++) {
28
- s = arguments[i];
29
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
30
- }
31
- return t;
32
- };
33
- return __assign.apply(this, arguments);
34
- };
35
-
36
- function __awaiter(thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- }
45
-
46
- function __generator(thisArg, body) {
47
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
48
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
49
- function verb(n) { return function (v) { return step([n, v]); }; }
50
- function step(op) {
51
- if (f) throw new TypeError("Generator is already executing.");
52
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
53
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
54
- if (y = 0, t) op = [op[0] & 2, t.value];
55
- switch (op[0]) {
56
- case 0: case 1: t = op; break;
57
- case 4: _.label++; return { value: op[1], done: false };
58
- case 5: _.label++; y = op[1]; op = [0]; continue;
59
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
60
- default:
61
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
62
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
63
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
64
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
65
- if (t[2]) _.ops.pop();
66
- _.trys.pop(); continue;
67
- }
68
- op = body.call(thisArg, _);
69
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
70
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
71
- }
72
- }
73
-
74
- function __spreadArray(to, from, pack) {
75
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
76
- if (ar || !(i in from)) {
77
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
78
- ar[i] = from[i];
79
- }
80
- }
81
- return to.concat(ar || Array.prototype.slice.call(from));
82
- }
83
-
84
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
85
- var e = new Error(message);
86
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
87
- };
88
7
 
89
8
  // src/utils/env.ts
90
9
  var NOTHING = Symbol.for("immer-nothing");
@@ -2429,7 +2348,7 @@ function updateMutationSubstateIfExists(state, id, update) {
2429
2348
  update(substate);
2430
2349
  }
2431
2350
  }
2432
- var initialState$2 = {};
2351
+ var initialState$1 = {};
2433
2352
  function buildSlice({
2434
2353
  reducerPath,
2435
2354
  queryThunk,
@@ -2505,7 +2424,7 @@ function buildSlice({
2505
2424
  }
2506
2425
  const querySlice = createSlice({
2507
2426
  name: `${reducerPath}/queries`,
2508
- initialState: initialState$2,
2427
+ initialState: initialState$1,
2509
2428
  reducers: {
2510
2429
  removeQueryResult: {
2511
2430
  reducer(draft, {
@@ -2639,7 +2558,7 @@ function buildSlice({
2639
2558
  });
2640
2559
  const mutationSlice = createSlice({
2641
2560
  name: `${reducerPath}/mutations`,
2642
- initialState: initialState$2,
2561
+ initialState: initialState$1,
2643
2562
  reducers: {
2644
2563
  removeMutationResult: {
2645
2564
  reducer(draft, {
@@ -2808,7 +2727,7 @@ function buildSlice({
2808
2727
  }
2809
2728
  const subscriptionSlice = createSlice({
2810
2729
  name: `${reducerPath}/subscriptions`,
2811
- initialState: initialState$2,
2730
+ initialState: initialState$1,
2812
2731
  reducers: {
2813
2732
  updateSubscriptionOptions(d, a) {
2814
2733
  },
@@ -2820,7 +2739,7 @@ function buildSlice({
2820
2739
  });
2821
2740
  const internalSubscriptionsSlice = createSlice({
2822
2741
  name: `${reducerPath}/internalSubscriptions`,
2823
- initialState: initialState$2,
2742
+ initialState: initialState$1,
2824
2743
  reducers: {
2825
2744
  subscriptionsUpdated: {
2826
2745
  reducer(state, action) {
@@ -4763,110 +4682,30 @@ Hook ${hookName} was either not provided or not a function.`);
4763
4682
  // src/query/react/index.ts
4764
4683
  var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());
4765
4684
 
4766
- var _a$2, _b$2;
4767
- var initialState$1 = {
4768
- authenticated: false,
4769
- verifying: false,
4770
- user: {
4771
- details: {
4772
- userSub: '',
4773
- uuid: '',
4774
- subscription: '',
4775
- subscriptionDetails: undefined,
4776
- firstName: '',
4777
- lastName: '',
4778
- userEmail: '',
4779
- termsAccepted: '',
4780
- contactPreference: false,
4781
- dateOfBirth: '',
4782
- picture: '',
4783
- },
4784
- accessToken: '',
4785
- idToken: '',
4786
- accessTokenExpiry: null,
4787
- refreshToken: '',
4788
- email: '',
4789
- sub: '',
4790
- },
4791
- loading: false,
4792
- error: false,
4793
- session: undefined,
4794
- };
4795
- var authSlice = createSlice({
4796
- name: 'auth',
4797
- initialState: initialState$1,
4798
- reducers: {
4799
- setCredentials: function (state, data) {
4800
- return __assign(__assign({}, state), { session: data.payload.accessToken, authenticated: true, verifying: true, user: __assign(__assign({}, state.user), data.payload) });
4801
- },
4802
- resetCreating: function (state) {
4803
- return __assign(__assign({}, state), { creating: {
4804
- details: '',
4805
- payment: '',
4806
- } });
4807
- },
4808
- updateSubscription: function (state, data) {
4809
- return __assign(__assign({}, state), { user: __assign(__assign({}, state.user), { details: __assign(__assign({}, state.user.details), { customerId: data.payload.customerId, subscription: data.payload.subscription, subscriptionDetails: data.payload.subscriptionDetails }) }) });
4810
- },
4811
- logout: function () { return initialState$1; },
4812
- },
4813
- selectors: {
4814
- isAuthenticated: function (auth) { return auth.authenticated; },
4815
- selectAccessToken: function (auth) { return auth.user.accessToken; },
4816
- selectRefreshToken: function (auth) { return auth.user.refreshToken; },
4817
- selectCurrentUser: function (auth) { return auth.user.details; },
4818
- isVerifying: function (auth) { return auth.verifying; },
4819
- getUserSession: function (auth) { return (auth.authenticated ? auth.session : false); },
4820
- // TODO: override this selector directly in the CNBCMEDIA app.
4821
- selectCurrentUserSub: function (auth) { var _a, _b, _c; return ((_c = (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c["custom:legacySub"]) || auth.user.sub; },
4822
- selectCurrentUserRefreshToken: function (auth) { return auth.user.refreshToken; },
4823
- selectUserTokens: function (auth) {
4824
- return {
4825
- accessToken: auth.user.accessToken,
4826
- refreshToken: auth.user.refreshToken,
4827
- idToken: auth.user.idToken,
4828
- };
4829
- },
4830
- selectUserSubscriptionStatus: function (auth) {
4831
- var _a, _b, _c;
4832
- return (_c = (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.subscriptionDetails) === null || _c === void 0 ? void 0 : _c.status;
4833
- },
4834
- selectSubscription: function (auth) {
4835
- var _a, _b;
4836
- return (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.subscriptionDetails;
4837
- },
4838
- selectSubscriptionPrice: function (auth) {
4839
- var _a, _b, _c;
4840
- return (_c = (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.subscriptionDetails) === null || _c === void 0 ? void 0 : _c.amount;
4841
- },
4842
- },
4843
- });
4844
- // Action creators are generated for each case reducer function.
4845
- var setCredentials = (_a$2 = authSlice.actions, _a$2.setCredentials), resetCreating = _a$2.resetCreating, logout = _a$2.logout, updateSubscription = _a$2.updateSubscription;
4846
- // Selectors returned by `slice.selectors` take the root state as their first argument.
4847
- var isAuthenticated = (_b$2 = authSlice.selectors, _b$2.isAuthenticated), selectAccessToken = _b$2.selectAccessToken, selectRefreshToken = _b$2.selectRefreshToken, selectCurrentUser = _b$2.selectCurrentUser, isVerifying = _b$2.isVerifying, getUserSession = _b$2.getUserSession, selectCurrentUserSub = _b$2.selectCurrentUserSub, selectCurrentUserRefreshToken = _b$2.selectCurrentUserRefreshToken, selectUserTokens = _b$2.selectUserTokens, selectUserSubscriptionStatus = _b$2.selectUserSubscriptionStatus, selectSubscription = _b$2.selectSubscription, selectSubscriptionPrice = _b$2.selectSubscriptionPrice;
4848
- authSlice.reducer;
4849
-
4850
4685
  function applyCoupon(coupon, netTotal) {
4851
- var discountedAmount = netTotal * (Number(coupon.discount) / 100);
4852
- var discountedTotal = netTotal - discountedAmount;
4853
- var data = __assign(__assign({}, coupon), { discountedTotal: discountedTotal, discountedAmount: discountedAmount });
4686
+ const discountedAmount = netTotal * (Number(coupon.discount) / 100);
4687
+ const discountedTotal = netTotal - discountedAmount;
4688
+ const data = {
4689
+ ...coupon,
4690
+ discountedTotal,
4691
+ discountedAmount,
4692
+ };
4854
4693
  return data;
4855
4694
  }
4856
4695
  function applyTax(taxRate, netTotal) {
4857
- var taxAmount = netTotal * (taxRate.percentage / 100);
4696
+ const taxAmount = netTotal * (taxRate.percentage / 100);
4858
4697
  return taxAmount;
4859
4698
  }
4860
4699
  function toCamelCaseObject(obj) {
4861
- var toCamelCase = function (str) {
4862
- return str.replace(/([-_][a-z])/gi, function (match) {
4700
+ const toCamelCase = (str) => {
4701
+ return str.replace(/([-_][a-z])/gi, (match) => {
4863
4702
  return match.toUpperCase().replace(/[-_]/, '');
4864
4703
  });
4865
4704
  };
4866
- var camelCaseObject = {};
4867
- for (var key in obj) {
4705
+ const camelCaseObject = {};
4706
+ for (const key in obj) {
4868
4707
  if (obj.hasOwnProperty(key)) {
4869
- var camelKey = toCamelCase(key);
4708
+ const camelKey = toCamelCase(key);
4870
4709
  camelCaseObject[camelKey] = obj[key];
4871
4710
  }
4872
4711
  }
@@ -4874,44 +4713,43 @@ function toCamelCaseObject(obj) {
4874
4713
  }
4875
4714
 
4876
4715
  // TODO: typing.
4877
- var formatUserPayload = function (payload) {
4878
- var userEmail = payload.email, firstName = payload.given_name, lastName = payload.family_name, dateOfBirth = payload.birthdate, picture = payload.picture, uuid = payload["cognito:username"], termsAccepted = payload["custom:termsAccepted"], subscriptionId = payload["custom:subscriptionId"], contactPreference = payload["custom:contactPreferences"], customerId = payload["custom:customerId"];
4879
- var parsedTermsAccepted = termsAccepted ? JSON.parse(termsAccepted) : null;
4880
- var parsedContactPreference = contactPreference
4716
+ const formatUserPayload = (payload) => {
4717
+ const { email: userEmail, given_name: firstName, family_name: lastName, birthdate: dateOfBirth, picture: picture, 'cognito:username': uuid, 'custom:termsAccepted': termsAccepted, 'custom:subscriptionId': subscriptionId, 'custom:contactPreferences': contactPreference, 'custom:customerId': customerId, } = payload;
4718
+ const parsedTermsAccepted = termsAccepted ? JSON.parse(termsAccepted) : null;
4719
+ const parsedContactPreference = contactPreference
4881
4720
  ? JSON.parse(contactPreference)
4882
4721
  : null;
4883
- var data = {
4884
- userEmail: userEmail,
4885
- lastName: lastName,
4886
- firstName: firstName,
4887
- dateOfBirth: dateOfBirth,
4722
+ const data = {
4723
+ userEmail,
4724
+ lastName,
4725
+ firstName,
4726
+ dateOfBirth,
4888
4727
  /** Handles the auth micro service/Cognito serving boolean options as a string. */
4889
4728
  termsAccepted: parsedTermsAccepted,
4890
4729
  contactPreference: parsedContactPreference,
4891
- uuid: uuid,
4730
+ uuid,
4892
4731
  subscription: subscriptionId || null,
4893
- customerId: customerId,
4894
- picture: picture,
4732
+ customerId,
4733
+ picture,
4895
4734
  };
4896
4735
  return data;
4897
4736
  };
4898
4737
  function formatPromos(data) {
4899
- return data.map(function (item) {
4900
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
4738
+ return data.map((item) => {
4901
4739
  return {
4902
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
4903
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
4904
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
4905
- image: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.image) === null || _h === void 0 ? void 0 : _h[0],
4906
- imageFormatted: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.image_formatted) === null || _k === void 0 ? void 0 : _k[0],
4907
- description: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.description) === null || _m === void 0 ? void 0 : _m[0],
4908
- created: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.created) === null || _p === void 0 ? void 0 : _p[0],
4909
- updated: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.updated) === null || _r === void 0 ? void 0 : _r[0],
4910
- weight: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.weight) === null || _t === void 0 ? void 0 : _t[0],
4911
- buttonText: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.button_text) === null || _v === void 0 ? void 0 : _v[0],
4912
- link: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.link) === null || _x === void 0 ? void 0 : _x[0],
4913
- linkMobile: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.link_mobile) === null || _z === void 0 ? void 0 : _z[0],
4914
- term: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.term) === null || _1 === void 0 ? void 0 : _1[0],
4740
+ uuid: item?._source?.uuid?.[0],
4741
+ id: item?._source?.uuid?.[0],
4742
+ title: item?._source?.title?.[0],
4743
+ image: item?._source?.image?.[0],
4744
+ imageFormatted: item?._source?.image_formatted?.[0],
4745
+ description: item?._source?.description?.[0],
4746
+ created: item?._source?.created?.[0],
4747
+ updated: item?._source?.updated?.[0],
4748
+ weight: item?._source?.weight?.[0],
4749
+ buttonText: item?._source?.button_text?.[0],
4750
+ link: item?._source?.link?.[0],
4751
+ linkMobile: item?._source?.link_mobile?.[0],
4752
+ term: item?._source?.term?.[0],
4915
4753
  // video: item?._source?.video?.[0],
4916
4754
  // align: item?._source?.align?.[0],
4917
4755
  // section: item?._source?.section?.[0],
@@ -4924,28 +4762,27 @@ function formatPromos(data) {
4924
4762
  });
4925
4763
  }
4926
4764
  function formatWorkout(data) {
4927
- return data.map(function (item) {
4928
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
4765
+ return data.map((item) => {
4929
4766
  return {
4930
- changed: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.changed) === null || _b === void 0 ? void 0 : _b[0],
4931
- created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
4932
- uuid: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.uuid) === null || _f === void 0 ? void 0 : _f[0],
4933
- description: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.description) === null || _h === void 0 ? void 0 : _h[0],
4934
- duration: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.duration_filter) === null || _k === void 0 ? void 0 : _k[0],
4767
+ changed: item?._source?.changed?.[0],
4768
+ created: item?._source?.created?.[0],
4769
+ uuid: item?._source?.uuid?.[0],
4770
+ description: item?._source?.description?.[0],
4771
+ duration: item?._source?.duration_filter?.[0],
4935
4772
  // duration_filter: item?._source?.duration_filter?.[0],
4936
- level: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.level) === null || _m === void 0 ? void 0 : _m[0],
4937
- published: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.published) === null || _p === void 0 ? void 0 : _p[0],
4938
- targeted_section: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.targeted_section) === null || _r === void 0 ? void 0 : _r[0],
4939
- uid: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.uid) === null || _t === void 0 ? void 0 : _t[0],
4940
- imageStyled: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.image_16_9) === null || _v === void 0 ? void 0 : _v[0],
4941
- image: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.image) === null || _x === void 0 ? void 0 : _x[0],
4942
- title: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.title) === null || _z === void 0 ? void 0 : _z[0],
4943
- video: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.video_url) === null || _1 === void 0 ? void 0 : _1[0],
4944
- videoDownload: (_3 = (_2 = item === null || item === void 0 ? void 0 : item._source) === null || _2 === void 0 ? void 0 : _2.video_download) === null || _3 === void 0 ? void 0 : _3[0],
4945
- videoPoster: (_5 = (_4 = item === null || item === void 0 ? void 0 : item._source) === null || _4 === void 0 ? void 0 : _4.video_poster) === null || _5 === void 0 ? void 0 : _5[0],
4946
- workoutCategory: (_7 = (_6 = item === null || item === void 0 ? void 0 : item._source) === null || _6 === void 0 ? void 0 : _6.workout_category) === null || _7 === void 0 ? void 0 : _7[0],
4947
- workoutType: (_9 = (_8 = item === null || item === void 0 ? void 0 : item._source) === null || _8 === void 0 ? void 0 : _8.workout_type) === null || _9 === void 0 ? void 0 : _9[0],
4948
- livestreamSection: (_11 = (_10 = item === null || item === void 0 ? void 0 : item._source) === null || _10 === void 0 ? void 0 : _10.livestream_section) === null || _11 === void 0 ? void 0 : _11[0],
4773
+ level: item?._source?.level?.[0],
4774
+ published: item?._source?.published?.[0],
4775
+ targeted_section: item?._source?.targeted_section?.[0],
4776
+ uid: item?._source?.uid?.[0],
4777
+ imageStyled: item?._source?.image_16_9?.[0],
4778
+ image: item?._source?.image?.[0],
4779
+ title: item?._source?.title?.[0],
4780
+ video: item?._source?.video_url?.[0],
4781
+ videoDownload: item?._source?.video_download?.[0],
4782
+ videoPoster: item?._source?.video_poster?.[0],
4783
+ workoutCategory: item?._source?.workout_category?.[0],
4784
+ workoutType: item?._source?.workout_type?.[0],
4785
+ livestreamSection: item?._source?.livestream_section?.[0],
4949
4786
  };
4950
4787
  });
4951
4788
  }
@@ -4968,8 +4805,8 @@ function formatWorkout(data) {
4968
4805
  // return formattedSeriesSelection;
4969
4806
  // }
4970
4807
  function formatShortform(data) {
4971
- return data.map(function (item) {
4972
- var _source = item._source;
4808
+ return data.map((item) => {
4809
+ const { _source } = item;
4973
4810
  return {
4974
4811
  uuid: _source.uuid && _source.uuid[0],
4975
4812
  id: _source.uuid && _source.uuid[0],
@@ -5018,8 +4855,8 @@ function formatShortform(data) {
5018
4855
  // });
5019
4856
  // }
5020
4857
  function formatFaqs(data) {
5021
- return data.map(function (item) {
5022
- var _source = item._source;
4858
+ return data.map((item) => {
4859
+ const { _source } = item;
5023
4860
  return {
5024
4861
  uuid: _source.uuid && _source.uuid[0],
5025
4862
  id: _source.uuid && _source.uuid[0],
@@ -5031,24 +4868,23 @@ function formatFaqs(data) {
5031
4868
  });
5032
4869
  }
5033
4870
  function formatPages(data) {
5034
- return data.map(function (item) {
5035
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
4871
+ return data.map((item) => {
5036
4872
  return {
5037
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5038
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5039
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
5040
- body: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h[0],
5041
- created: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.created) === null || _k === void 0 ? void 0 : _k[0],
5042
- updated: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.updated) === null || _m === void 0 ? void 0 : _m[0],
5043
- langcode: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.langcode) === null || _p === void 0 ? void 0 : _p[0],
5044
- url: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.url) === null || _r === void 0 ? void 0 : _r[0],
4873
+ uuid: item?._source?.uuid?.[0],
4874
+ id: item?._source?.uuid?.[0],
4875
+ title: item?._source?.title?.[0],
4876
+ body: item?._source?.body?.[0],
4877
+ created: item?._source?.created?.[0],
4878
+ updated: item?._source?.updated?.[0],
4879
+ langcode: item?._source?.langcode?.[0],
4880
+ url: item?._source?.url?.[0],
5045
4881
  };
5046
4882
  });
5047
4883
  }
5048
4884
  function formatSettings(data) {
5049
- return data.map(function (item) {
5050
- var _source = item._source;
5051
- var fieldset = _source.fieldset && _source.fieldset[0].toLowerCase();
4885
+ return data.map((item) => {
4886
+ const { _source } = item;
4887
+ const fieldset = _source.fieldset && _source.fieldset[0].toLowerCase();
5052
4888
  return {
5053
4889
  uuid: _source.uuid && _source.uuid[0],
5054
4890
  created: _source.created && _source.created[0],
@@ -5058,13 +4894,13 @@ function formatSettings(data) {
5058
4894
  video: _source.video && _source.video[0],
5059
4895
  number: _source.number && _source.number[0],
5060
4896
  pass: _source.pass && _source.pass[0],
5061
- fieldset: fieldset,
4897
+ fieldset,
5062
4898
  };
5063
4899
  });
5064
4900
  }
5065
4901
  function formatPress(data) {
5066
- return data.map(function (item) {
5067
- var _source = item._source;
4902
+ return data.map((item) => {
4903
+ const { _source } = item;
5068
4904
  return {
5069
4905
  uuid: _source.uuid && _source.uuid[0],
5070
4906
  created: _source.created && _source.created[0],
@@ -5075,8 +4911,8 @@ function formatPress(data) {
5075
4911
  });
5076
4912
  }
5077
4913
  function formatGuests(data) {
5078
- return data.map(function (item) {
5079
- var _source = item._source;
4914
+ return data.map((item) => {
4915
+ const { _source } = item;
5080
4916
  return {
5081
4917
  uuid: _source.uuid && _source.uuid[0],
5082
4918
  id: _source.id && _source.id[0],
@@ -5089,27 +4925,26 @@ function formatGuests(data) {
5089
4925
  });
5090
4926
  }
5091
4927
  function formatVideos(data) {
5092
- return data.map(function (item) {
5093
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
4928
+ return data.map((item) => {
5094
4929
  return {
5095
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5096
- title: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.title) === null || _d === void 0 ? void 0 : _d[0],
5097
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5098
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5099
- description: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.description) === null || _k === void 0 ? void 0 : _k[0],
5100
- image: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.image) === null || _m === void 0 ? void 0 : _m[0],
5101
- duration: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.duration) === null || _p === void 0 ? void 0 : _p[0],
5102
- section: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.section) === null || _r === void 0 ? void 0 : _r[0],
5103
- videoPoster: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.video_poster) === null || _t === void 0 ? void 0 : _t[0],
5104
- video: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.video_url) === null || _v === void 0 ? void 0 : _v[0],
5105
- videoDownload: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.video_download) === null || _x === void 0 ? void 0 : _x[0],
5106
- sectionId: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.section_id) === null || _z === void 0 ? void 0 : _z[0],
4930
+ uuid: item?._source?.uuid?.[0],
4931
+ title: item?._source?.title?.[0],
4932
+ created: item?._source?.created?.[0],
4933
+ updated: item?._source?.updated?.[0],
4934
+ description: item?._source?.description?.[0],
4935
+ image: item?._source?.image?.[0],
4936
+ duration: item?._source?.duration?.[0],
4937
+ section: item?._source?.section?.[0],
4938
+ videoPoster: item?._source?.video_poster?.[0],
4939
+ video: item?._source?.video_url?.[0],
4940
+ videoDownload: item?._source?.video_download?.[0],
4941
+ sectionId: item?._source?.section_id?.[0],
5107
4942
  };
5108
4943
  });
5109
4944
  }
5110
4945
  function formatSections(data) {
5111
- return data.map(function (item) {
5112
- var _source = item._source;
4946
+ return data.map((item) => {
4947
+ const { _source } = item;
5113
4948
  return {
5114
4949
  uuid: _source.uuid && _source.uuid[0],
5115
4950
  title: _source.title && _source.title[0],
@@ -5122,95 +4957,87 @@ function formatSections(data) {
5122
4957
  });
5123
4958
  }
5124
4959
  function formatSchedule(data) {
5125
- return data.map(function (item) {
5126
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
4960
+ return data.map((item) => {
5127
4961
  return {
5128
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5129
- created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
5130
- langcode: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.langcode) === null || _f === void 0 ? void 0 : _f[0],
5131
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
4962
+ uuid: item?._source?.uuid?.[0],
4963
+ created: item?._source?.created?.[0],
4964
+ langcode: item?._source?.langcode?.[0],
4965
+ updated: item?._source?.updated?.[0],
5132
4966
  days: [
5133
4967
  {
5134
- monday: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.monday_title) === null || _k === void 0 ? void 0 : _k.map(function (title, index) {
5135
- var _a, _b, _c, _d, _e, _f, _g, _h;
4968
+ monday: item?._source?.monday_title?.map((title, index) => {
5136
4969
  return {
5137
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.monday_end) === null || _b === void 0 ? void 0 : _b[index],
5138
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.monday_start) === null || _d === void 0 ? void 0 : _d[index],
4970
+ end: item?._source?.monday_end?.[index],
4971
+ start: item?._source?.monday_start?.[index],
5139
4972
  title: title,
5140
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.monday_video) === null || _f === void 0 ? void 0 : _f[index],
5141
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.monday_live) === null || _h === void 0 ? void 0 : _h[index],
4973
+ video: item?._source?.monday_video?.[index],
4974
+ live: item?._source?.monday_live?.[index],
5142
4975
  };
5143
4976
  }),
5144
4977
  },
5145
4978
  {
5146
- tuesday: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.tuesday_title) === null || _m === void 0 ? void 0 : _m.map(function (title, index) {
5147
- var _a, _b, _c, _d, _e, _f, _g, _h;
4979
+ tuesday: item?._source?.tuesday_title?.map((title, index) => {
5148
4980
  return {
5149
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.tuesday_end) === null || _b === void 0 ? void 0 : _b[index],
5150
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.tuesday_start) === null || _d === void 0 ? void 0 : _d[index],
4981
+ end: item?._source?.tuesday_end?.[index],
4982
+ start: item?._source?.tuesday_start?.[index],
5151
4983
  title: title,
5152
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.tuesday_video) === null || _f === void 0 ? void 0 : _f[index],
5153
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.tuesday_live) === null || _h === void 0 ? void 0 : _h[index],
4984
+ video: item?._source?.tuesday_video?.[index],
4985
+ live: item?._source?.tuesday_live?.[index],
5154
4986
  };
5155
4987
  }),
5156
4988
  },
5157
4989
  {
5158
- wednesday: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.wednesday_title) === null || _p === void 0 ? void 0 : _p.map(function (title, index) {
5159
- var _a, _b, _c, _d, _e, _f, _g, _h;
4990
+ wednesday: item?._source?.wednesday_title?.map((title, index) => {
5160
4991
  return {
5161
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.wednesday_end) === null || _b === void 0 ? void 0 : _b[index],
5162
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.wednesday_start) === null || _d === void 0 ? void 0 : _d[index],
4992
+ end: item?._source?.wednesday_end?.[index],
4993
+ start: item?._source?.wednesday_start?.[index],
5163
4994
  title: title,
5164
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.wednesday_video) === null || _f === void 0 ? void 0 : _f[index],
5165
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.wednesday_live) === null || _h === void 0 ? void 0 : _h[index],
4995
+ video: item?._source?.wednesday_video?.[index],
4996
+ live: item?._source?.wednesday_live?.[index],
5166
4997
  };
5167
4998
  }),
5168
4999
  },
5169
5000
  {
5170
- thursday: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.thursday_title) === null || _r === void 0 ? void 0 : _r.map(function (title, index) {
5171
- var _a, _b, _c, _d, _e, _f, _g, _h;
5001
+ thursday: item?._source?.thursday_title?.map((title, index) => {
5172
5002
  return {
5173
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.thursday_end) === null || _b === void 0 ? void 0 : _b[index],
5174
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.thursday_start) === null || _d === void 0 ? void 0 : _d[index],
5003
+ end: item?._source?.thursday_end?.[index],
5004
+ start: item?._source?.thursday_start?.[index],
5175
5005
  title: title,
5176
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.thursday_video) === null || _f === void 0 ? void 0 : _f[index],
5177
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.thursday_live) === null || _h === void 0 ? void 0 : _h[index],
5006
+ video: item?._source?.thursday_video?.[index],
5007
+ live: item?._source?.thursday_live?.[index],
5178
5008
  };
5179
5009
  }),
5180
5010
  },
5181
5011
  {
5182
- friday: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.friday_title) === null || _t === void 0 ? void 0 : _t.map(function (title, index) {
5183
- var _a, _b, _c, _d, _e, _f, _g, _h;
5012
+ friday: item?._source?.friday_title?.map((title, index) => {
5184
5013
  return {
5185
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.friday_end) === null || _b === void 0 ? void 0 : _b[index],
5186
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.friday_start) === null || _d === void 0 ? void 0 : _d[index],
5014
+ end: item?._source?.friday_end?.[index],
5015
+ start: item?._source?.friday_start?.[index],
5187
5016
  title: title,
5188
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.friday_video) === null || _f === void 0 ? void 0 : _f[index],
5189
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.friday_live) === null || _h === void 0 ? void 0 : _h[index],
5017
+ video: item?._source?.friday_video?.[index],
5018
+ live: item?._source?.friday_live?.[index],
5190
5019
  };
5191
5020
  }),
5192
5021
  },
5193
5022
  {
5194
- saturday: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.saturday_title) === null || _v === void 0 ? void 0 : _v.map(function (title, index) {
5195
- var _a, _b, _c, _d, _e, _f, _g, _h;
5023
+ saturday: item?._source?.saturday_title?.map((title, index) => {
5196
5024
  return {
5197
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.saturday_end) === null || _b === void 0 ? void 0 : _b[index],
5198
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.saturday_start) === null || _d === void 0 ? void 0 : _d[index],
5025
+ end: item?._source?.saturday_end?.[index],
5026
+ start: item?._source?.saturday_start?.[index],
5199
5027
  title: title,
5200
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.saturday_video) === null || _f === void 0 ? void 0 : _f[index],
5201
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.saturday_live) === null || _h === void 0 ? void 0 : _h[index],
5028
+ video: item?._source?.saturday_video?.[index],
5029
+ live: item?._source?.saturday_live?.[index],
5202
5030
  };
5203
5031
  }),
5204
5032
  },
5205
5033
  {
5206
- sunday: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.sunday_title) === null || _x === void 0 ? void 0 : _x.map(function (title, index) {
5207
- var _a, _b, _c, _d, _e, _f, _g, _h;
5034
+ sunday: item?._source?.sunday_title?.map((title, index) => {
5208
5035
  return {
5209
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.sunday_end) === null || _b === void 0 ? void 0 : _b[index],
5210
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.sunday_start) === null || _d === void 0 ? void 0 : _d[index],
5036
+ end: item?._source?.sunday_end?.[index],
5037
+ start: item?._source?.sunday_start?.[index],
5211
5038
  title: title,
5212
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.sunday_video) === null || _f === void 0 ? void 0 : _f[index],
5213
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.sunday_live) === null || _h === void 0 ? void 0 : _h[index],
5039
+ video: item?._source?.sunday_video?.[index],
5040
+ live: item?._source?.sunday_live?.[index],
5214
5041
  };
5215
5042
  }),
5216
5043
  },
@@ -5219,11 +5046,10 @@ function formatSchedule(data) {
5219
5046
  });
5220
5047
  }
5221
5048
  function formatChallenges(data) {
5222
- return data.map(function (item) {
5223
- var _a;
5224
- var _source = item._source;
5049
+ return data.map((item) => {
5050
+ const { _source } = item;
5225
5051
  return {
5226
- uuid: (_a = _source === null || _source === void 0 ? void 0 : _source.uuid) === null || _a === void 0 ? void 0 : _a[0],
5052
+ uuid: _source?.uuid?.[0],
5227
5053
  title: _source.title && _source.title[0],
5228
5054
  body: _source.body && _source.body[0],
5229
5055
  image: _source.image && _source.image[0],
@@ -5237,17 +5063,16 @@ function formatChallenges(data) {
5237
5063
  });
5238
5064
  }
5239
5065
  function formatChallengeDays(data) {
5240
- return data.map(function (item) {
5241
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
5066
+ return data.map((item) => {
5242
5067
  return {
5243
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5244
- title: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.title) === null || _d === void 0 ? void 0 : _d[0],
5245
- body: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.body) === null || _f === void 0 ? void 0 : _f[0],
5246
- image: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.image) === null || _h === void 0 ? void 0 : _h[0],
5247
- created: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.created) === null || _k === void 0 ? void 0 : _k[0],
5248
- updated: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.updated) === null || _m === void 0 ? void 0 : _m[0],
5249
- video: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.video) === null || _p === void 0 ? void 0 : _p[0],
5250
- workout: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.workout) === null || _r === void 0 ? void 0 : _r[0],
5068
+ uuid: item?._source?.uuid?.[0],
5069
+ title: item?._source?.title?.[0],
5070
+ body: item?._source?.body?.[0],
5071
+ image: item?._source?.image?.[0],
5072
+ created: item?._source?.created?.[0],
5073
+ updated: item?._source?.updated?.[0],
5074
+ video: item?._source?.video?.[0],
5075
+ workout: item?._source?.workout?.[0],
5251
5076
  };
5252
5077
  });
5253
5078
  }
@@ -5255,360 +5080,328 @@ function formatSecondsToISO8601Duration(seconds) {
5255
5080
  if (!seconds)
5256
5081
  return '';
5257
5082
  // Calculate hours, minutes, and remaining seconds
5258
- var hours = Math.floor(seconds / 3600);
5259
- var minutes = Math.floor((seconds % 3600) / 60);
5260
- var remainingSeconds = seconds % 60;
5083
+ const hours = Math.floor(seconds / 3600);
5084
+ const minutes = Math.floor((seconds % 3600) / 60);
5085
+ const remainingSeconds = seconds % 60;
5261
5086
  // Build the ISO 8601 duration string
5262
- var duration = 'PT';
5087
+ let duration = 'PT';
5263
5088
  if (hours > 0) {
5264
- duration += "".concat(hours, "H");
5089
+ duration += `${hours}H`;
5265
5090
  }
5266
5091
  if (minutes > 0) {
5267
- duration += "".concat(minutes, "M");
5092
+ duration += `${minutes}M`;
5268
5093
  }
5269
5094
  if (remainingSeconds > 0 || duration === 'PT') {
5270
- duration += "".concat(remainingSeconds, "S");
5095
+ duration += `${remainingSeconds}S`;
5271
5096
  }
5272
5097
  return duration;
5273
5098
  }
5274
5099
  function formatAuthSession(session) {
5275
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
5276
5100
  return {
5277
- accessToken: (_a = session === null || session === void 0 ? void 0 : session.tokens) === null || _a === void 0 ? void 0 : _a.accessToken.toString(),
5278
- idToken: (_c = (_b = session === null || session === void 0 ? void 0 : session.tokens) === null || _b === void 0 ? void 0 : _b.idToken) === null || _c === void 0 ? void 0 : _c.toString(),
5101
+ accessToken: session?.tokens?.accessToken.toString(),
5102
+ idToken: session?.tokens?.idToken?.toString(),
5279
5103
  refreshToken: undefined,
5280
- accessTokenExpiry: (_f = (_e = (_d = session === null || session === void 0 ? void 0 : session.tokens) === null || _d === void 0 ? void 0 : _d.idToken) === null || _e === void 0 ? void 0 : _e.payload) === null || _f === void 0 ? void 0 : _f.exp,
5281
- expires: (_j = (_h = (_g = session === null || session === void 0 ? void 0 : session.tokens) === null || _g === void 0 ? void 0 : _g.idToken) === null || _h === void 0 ? void 0 : _h.payload) === null || _j === void 0 ? void 0 : _j.exp,
5282
- sub: (_o = (_m = (_l = (_k = session === null || session === void 0 ? void 0 : session.tokens) === null || _k === void 0 ? void 0 : _k.idToken) === null || _l === void 0 ? void 0 : _l.payload) === null || _m === void 0 ? void 0 : _m['cognito:username']) === null || _o === void 0 ? void 0 : _o.toString(),
5104
+ accessTokenExpiry: session?.tokens?.idToken?.payload?.exp,
5105
+ expires: session?.tokens?.idToken?.payload?.exp,
5106
+ sub: session?.tokens?.idToken?.payload?.['cognito:username']?.toString(),
5283
5107
  details: {
5284
- userEmail: (_s = (_r = (_q = (_p = session === null || session === void 0 ? void 0 : session.tokens) === null || _p === void 0 ? void 0 : _p.idToken) === null || _q === void 0 ? void 0 : _q.payload) === null || _r === void 0 ? void 0 : _r.email) === null || _s === void 0 ? void 0 : _s.toString(),
5285
- firstName: (_w = (_v = (_u = (_t = session === null || session === void 0 ? void 0 : session.tokens) === null || _t === void 0 ? void 0 : _t.idToken) === null || _u === void 0 ? void 0 : _u.payload) === null || _v === void 0 ? void 0 : _v.given_name) === null || _w === void 0 ? void 0 : _w.toString(),
5286
- lastName: (_0 = (_z = (_y = (_x = session === null || session === void 0 ? void 0 : session.tokens) === null || _x === void 0 ? void 0 : _x.idToken) === null || _y === void 0 ? void 0 : _y.payload) === null || _z === void 0 ? void 0 : _z.family_name) === null || _0 === void 0 ? void 0 : _0.toString(),
5287
- dateOfBirth: (_4 = (_3 = (_2 = (_1 = session === null || session === void 0 ? void 0 : session.tokens) === null || _1 === void 0 ? void 0 : _1.idToken) === null || _2 === void 0 ? void 0 : _2.payload) === null || _3 === void 0 ? void 0 : _3.birthdate) === null || _4 === void 0 ? void 0 : _4.toString(),
5288
- 'cognito:username': (_8 = (_7 = (_6 = (_5 = session === null || session === void 0 ? void 0 : session.tokens) === null || _5 === void 0 ? void 0 : _5.idToken) === null || _6 === void 0 ? void 0 : _6.payload) === null || _7 === void 0 ? void 0 : _7['cognito:username']) === null || _8 === void 0 ? void 0 : _8.toString(),
5289
- 'custom:termsAccepted': (_12 = (_11 = (_10 = (_9 = session === null || session === void 0 ? void 0 : session.tokens) === null || _9 === void 0 ? void 0 : _9.idToken) === null || _10 === void 0 ? void 0 : _10.payload) === null || _11 === void 0 ? void 0 : _11['custom:termsAccepted']) === null || _12 === void 0 ? void 0 : _12.toString(),
5290
- 'custom:subscriptionId': (_16 = (_15 = (_14 = (_13 = session === null || session === void 0 ? void 0 : session.tokens) === null || _13 === void 0 ? void 0 : _13.idToken) === null || _14 === void 0 ? void 0 : _14.payload) === null || _15 === void 0 ? void 0 : _15['custom:subscriptionId']) === null || _16 === void 0 ? void 0 : _16.toString(),
5291
- 'custom:contactPreferences': (_20 = (_19 = (_18 = (_17 = session === null || session === void 0 ? void 0 : session.tokens) === null || _17 === void 0 ? void 0 : _17.idToken) === null || _18 === void 0 ? void 0 : _18.payload) === null || _19 === void 0 ? void 0 : _19['custom:contactPreferences']) === null || _20 === void 0 ? void 0 : _20.toString(),
5292
- 'custom:customerId': (_24 = (_23 = (_22 = (_21 = session === null || session === void 0 ? void 0 : session.tokens) === null || _21 === void 0 ? void 0 : _21.idToken) === null || _22 === void 0 ? void 0 : _22.payload) === null || _23 === void 0 ? void 0 : _23['custom:customerId']) === null || _24 === void 0 ? void 0 : _24.toString(),
5293
- picture: (_28 = (_27 = (_26 = (_25 = session === null || session === void 0 ? void 0 : session.tokens) === null || _25 === void 0 ? void 0 : _25.idToken) === null || _26 === void 0 ? void 0 : _26.payload) === null || _27 === void 0 ? void 0 : _27.picture) === null || _28 === void 0 ? void 0 : _28.toString(),
5108
+ userEmail: session?.tokens?.idToken?.payload?.email?.toString(),
5109
+ firstName: session?.tokens?.idToken?.payload?.given_name?.toString(),
5110
+ lastName: session?.tokens?.idToken?.payload?.family_name?.toString(),
5111
+ dateOfBirth: session?.tokens?.idToken?.payload?.birthdate?.toString(),
5112
+ 'cognito:username': session?.tokens?.idToken?.payload?.['cognito:username']?.toString(),
5113
+ 'custom:termsAccepted': session?.tokens?.idToken?.payload?.['custom:termsAccepted']?.toString(),
5114
+ 'custom:subscriptionId': session?.tokens?.idToken?.payload?.['custom:subscriptionId']?.toString(),
5115
+ 'custom:contactPreferences': session?.tokens?.idToken?.payload?.['custom:contactPreferences']?.toString(),
5116
+ 'custom:customerId': session?.tokens?.idToken?.payload?.['custom:customerId']?.toString(),
5117
+ picture: session?.tokens?.idToken?.payload?.picture?.toString(),
5294
5118
  },
5295
5119
  };
5296
5120
  }
5297
5121
  function formatFedaratedSession(session) {
5298
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
5299
5122
  return {
5300
- accessToken: (_a = session === null || session === void 0 ? void 0 : session.accessToken) === null || _a === void 0 ? void 0 : _a.jwtToken,
5301
- idToken: (_b = session === null || session === void 0 ? void 0 : session.idToken) === null || _b === void 0 ? void 0 : _b.jwtToken,
5302
- refreshToken: (_c = session === null || session === void 0 ? void 0 : session.refreshToken) === null || _c === void 0 ? void 0 : _c.token,
5303
- accessTokenExpiry: (_e = (_d = session === null || session === void 0 ? void 0 : session.accessToken) === null || _d === void 0 ? void 0 : _d.payload) === null || _e === void 0 ? void 0 : _e.exp,
5304
- expires: (_g = (_f = session === null || session === void 0 ? void 0 : session.accessToken) === null || _f === void 0 ? void 0 : _f.payload) === null || _g === void 0 ? void 0 : _g.exp,
5305
- sub: (_j = (_h = session === null || session === void 0 ? void 0 : session.idToken) === null || _h === void 0 ? void 0 : _h.payload) === null || _j === void 0 ? void 0 : _j.sub,
5123
+ accessToken: session?.accessToken?.jwtToken,
5124
+ idToken: session?.idToken?.jwtToken,
5125
+ refreshToken: session?.refreshToken?.token,
5126
+ accessTokenExpiry: session?.accessToken?.payload?.exp,
5127
+ expires: session?.accessToken?.payload?.exp,
5128
+ sub: session?.idToken?.payload?.sub,
5306
5129
  details: {
5307
- userEmail: (_l = (_k = session === null || session === void 0 ? void 0 : session.idToken) === null || _k === void 0 ? void 0 : _k.payload) === null || _l === void 0 ? void 0 : _l.email,
5308
- firstName: (_o = (_m = session === null || session === void 0 ? void 0 : session.idToken) === null || _m === void 0 ? void 0 : _m.payload) === null || _o === void 0 ? void 0 : _o.given_name,
5309
- lastName: (_q = (_p = session === null || session === void 0 ? void 0 : session.idToken) === null || _p === void 0 ? void 0 : _p.payload) === null || _q === void 0 ? void 0 : _q.family_name,
5310
- dateOfBirth: (_s = (_r = session === null || session === void 0 ? void 0 : session.idToken) === null || _r === void 0 ? void 0 : _r.payload) === null || _s === void 0 ? void 0 : _s.birthdate,
5311
- 'cognito:username': (_u = (_t = session === null || session === void 0 ? void 0 : session.idToken) === null || _t === void 0 ? void 0 : _t.payload) === null || _u === void 0 ? void 0 : _u.sub,
5312
- 'custom:termsAccepted': (_w = (_v = session === null || session === void 0 ? void 0 : session.idToken) === null || _v === void 0 ? void 0 : _v.payload) === null || _w === void 0 ? void 0 : _w['custom:termsAccepted'],
5313
- 'custom:subscriptionId': (_y = (_x = session === null || session === void 0 ? void 0 : session.idToken) === null || _x === void 0 ? void 0 : _x.payload) === null || _y === void 0 ? void 0 : _y['custom:subscriptionId'],
5314
- 'custom:contactPreferences': (_0 = (_z = session === null || session === void 0 ? void 0 : session.idToken) === null || _z === void 0 ? void 0 : _z.payload) === null || _0 === void 0 ? void 0 : _0['custom:contactPreferences'],
5315
- 'custom:customerId': (_2 = (_1 = session === null || session === void 0 ? void 0 : session.idToken) === null || _1 === void 0 ? void 0 : _1.payload) === null || _2 === void 0 ? void 0 : _2['custom:customerId'],
5316
- picture: (_4 = (_3 = session === null || session === void 0 ? void 0 : session.idToken) === null || _3 === void 0 ? void 0 : _3.payload) === null || _4 === void 0 ? void 0 : _4.picture,
5317
- id: toCamelCaseObject((_5 = session === null || session === void 0 ? void 0 : session.idToken) === null || _5 === void 0 ? void 0 : _5.payload),
5130
+ userEmail: session?.idToken?.payload?.email,
5131
+ firstName: session?.idToken?.payload?.given_name,
5132
+ lastName: session?.idToken?.payload?.family_name,
5133
+ dateOfBirth: session?.idToken?.payload?.birthdate,
5134
+ 'cognito:username': session?.idToken?.payload?.sub,
5135
+ 'custom:termsAccepted': session?.idToken?.payload?.['custom:termsAccepted'],
5136
+ 'custom:subscriptionId': session?.idToken?.payload?.['custom:subscriptionId'],
5137
+ 'custom:contactPreferences': session?.idToken?.payload?.['custom:contactPreferences'],
5138
+ 'custom:customerId': session?.idToken?.payload?.['custom:customerId'],
5139
+ picture: session?.idToken?.payload?.picture,
5140
+ id: toCamelCaseObject(session?.idToken?.payload),
5318
5141
  },
5319
5142
  };
5320
5143
  }
5321
5144
  function formatSocialAuthSession(tokens) {
5322
- var idToken = jwtDecode(tokens.idToken);
5145
+ const idToken = jwtDecode(tokens.idToken);
5323
5146
  return {
5324
5147
  socialSignin: true,
5325
5148
  accessToken: tokens.accessToken,
5326
5149
  idToken: tokens.idToken,
5327
5150
  refreshToken: tokens.refreshToken,
5328
- accessTokenExpiry: idToken === null || idToken === void 0 ? void 0 : idToken.exp,
5329
- expires: idToken === null || idToken === void 0 ? void 0 : idToken.exp,
5151
+ accessTokenExpiry: idToken?.exp,
5152
+ expires: idToken?.exp,
5330
5153
  sub: idToken.sub,
5331
5154
  details: {
5332
5155
  userEmail: idToken.email,
5333
5156
  firstName: idToken.given_name,
5334
5157
  lastName: idToken.family_name,
5335
- dateOfBirth: idToken === null || idToken === void 0 ? void 0 : idToken.birthdate,
5336
- 'cognito:username': idToken === null || idToken === void 0 ? void 0 : idToken['cognito:username'],
5337
- 'custom:termsAccepted': idToken === null || idToken === void 0 ? void 0 : idToken['custom:termsAccepted'],
5338
- 'custom:subscriptionId': idToken === null || idToken === void 0 ? void 0 : idToken['custom:subscriptionId'],
5339
- 'custom:contactPreferences': idToken === null || idToken === void 0 ? void 0 : idToken['custom:contactPreferences'],
5340
- 'custom:customerId': idToken === null || idToken === void 0 ? void 0 : idToken['custom:customerId'],
5341
- picture: idToken === null || idToken === void 0 ? void 0 : idToken.picture,
5158
+ dateOfBirth: idToken?.birthdate,
5159
+ 'cognito:username': idToken?.['cognito:username'],
5160
+ 'custom:termsAccepted': idToken?.['custom:termsAccepted'],
5161
+ 'custom:subscriptionId': idToken?.['custom:subscriptionId'],
5162
+ 'custom:contactPreferences': idToken?.['custom:contactPreferences'],
5163
+ 'custom:customerId': idToken?.['custom:customerId'],
5164
+ picture: idToken?.picture,
5342
5165
  },
5343
5166
  };
5344
5167
  }
5345
5168
  function formatConfig(data) {
5346
- return data.map(function (item) {
5347
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
5169
+ return data.map((item) => {
5348
5170
  return {
5349
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5350
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5351
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5352
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5353
- type: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.type) === null || _k === void 0 ? void 0 : _k[0],
5354
- cla: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.cla) === null || _m === void 0 ? void 0 : _m[0],
5355
- enabled: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.enabled) === null || _p === void 0 ? void 0 : _p[0],
5356
- name: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.name) === null || _r === void 0 ? void 0 : _r[0],
5357
- price: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.price) === null || _t === void 0 ? void 0 : _t[0],
5358
- video: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.video) === null || _v === void 0 ? void 0 : _v[0],
5359
- imageHomepage: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.image_homepage) === null || _x === void 0 ? void 0 : _x[0],
5360
- imageSectionBanner: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.image_section_banner) === null || _z === void 0 ? void 0 : _z[0],
5171
+ uuid: item?._source?.uuid?.[0],
5172
+ id: item?._source?.uuid?.[0],
5173
+ created: item?._source?.created?.[0],
5174
+ updated: item?._source?.updated?.[0],
5175
+ type: item?._source?.type?.[0],
5176
+ cla: item?._source?.cla?.[0],
5177
+ enabled: item?._source?.enabled?.[0],
5178
+ name: item?._source?.name?.[0],
5179
+ price: item?._source?.price?.[0],
5180
+ video: item?._source?.video?.[0],
5181
+ imageHomepage: item?._source?.image_homepage?.[0],
5182
+ imageSectionBanner: item?._source?.image_section_banner?.[0],
5361
5183
  };
5362
5184
  });
5363
5185
  }
5364
5186
  function formatSectionPanels(data) {
5365
- return data.map(function (item) {
5366
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
5187
+ return data.map((item) => {
5367
5188
  return {
5368
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5369
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5370
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
5371
- created: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.created) === null || _h === void 0 ? void 0 : _h[0],
5372
- updated: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.updated) === null || _k === void 0 ? void 0 : _k[0],
5373
- weight: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.weight) === null || _m === void 0 ? void 0 : _m[0],
5374
- items: (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.item_uuid,
5375
- type: (_q = (_p = item === null || item === void 0 ? void 0 : item._source) === null || _p === void 0 ? void 0 : _p.type) === null || _q === void 0 ? void 0 : _q[0],
5189
+ uuid: item?._source?.uuid?.[0],
5190
+ id: item?._source?.uuid?.[0],
5191
+ title: item?._source?.title?.[0],
5192
+ created: item?._source?.created?.[0],
5193
+ updated: item?._source?.updated?.[0],
5194
+ weight: item?._source?.weight?.[0],
5195
+ items: item?._source?.item_uuid,
5196
+ type: item?._source?.type?.[0],
5376
5197
  };
5377
5198
  });
5378
5199
  }
5379
5200
  function formatSectionItems(data) {
5380
- return data.map(function (item) {
5381
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
5201
+ return data.map((item) => {
5382
5202
  return {
5383
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5384
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5385
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
5386
- created: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.created) === null || _h === void 0 ? void 0 : _h[0],
5387
- updated: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.updated) === null || _k === void 0 ? void 0 : _k[0],
5388
- type: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.type) === null || _m === void 0 ? void 0 : _m[0],
5389
- term: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.term) === null || _p === void 0 ? void 0 : _p[0],
5390
- image: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.custom_image_formatted) === null || _r === void 0 ? void 0 : _r[0],
5391
- bannerImage: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.banner_image_formatted) === null || _t === void 0 ? void 0 : _t[0],
5203
+ uuid: item?._source?.uuid?.[0],
5204
+ id: item?._source?.uuid?.[0],
5205
+ title: item?._source?.title?.[0],
5206
+ created: item?._source?.created?.[0],
5207
+ updated: item?._source?.updated?.[0],
5208
+ type: item?._source?.type?.[0],
5209
+ term: item?._source?.term?.[0],
5210
+ image: item?._source?.custom_image_formatted?.[0],
5211
+ bannerImage: item?._source?.banner_image_formatted?.[0],
5392
5212
  };
5393
5213
  });
5394
5214
  }
5395
- var formatTaxonomies = function (data) {
5396
- return data.map(function (item) {
5397
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
5215
+ const formatTaxonomies = (data) => {
5216
+ return data.map((item) => {
5398
5217
  return {
5399
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5400
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5401
- updated: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.updated) === null || _f === void 0 ? void 0 : _f[0],
5402
- vocabulary: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.vocabulary) === null || _h === void 0 ? void 0 : _h[0],
5403
- name: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.name) === null || _k === void 0 ? void 0 : _k[0],
5404
- description: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.description) === null || _m === void 0 ? void 0 : _m[0],
5405
- image: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image) === null || _p === void 0 ? void 0 : _p[0],
5406
- imageBanner: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_banner) === null || _r === void 0 ? void 0 : _r[0],
5407
- imageBannerTaxonomy: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.image_banner_taxonomy) === null || _t === void 0 ? void 0 : _t[0],
5408
- imageLarge: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.image_large_16_9) === null || _v === void 0 ? void 0 : _v[0],
5409
- weight: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.weight) === null || _x === void 0 ? void 0 : _x[0],
5410
- parentName: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.parent_name) === null || _z === void 0 ? void 0 : _z[0],
5411
- color: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.color) === null || _1 === void 0 ? void 0 : _1[0],
5218
+ uuid: item?._source?.uuid?.[0],
5219
+ id: item?._source?.uuid?.[0],
5220
+ updated: item?._source?.updated?.[0],
5221
+ vocabulary: item?._source?.vocabulary?.[0],
5222
+ name: item?._source?.name?.[0],
5223
+ description: item?._source?.description?.[0],
5224
+ image: item?._source?.image?.[0],
5225
+ imageBanner: item?._source?.image_banner?.[0],
5226
+ imageBannerTaxonomy: item?._source?.image_banner_taxonomy?.[0],
5227
+ imageLarge: item?._source?.image_large_16_9?.[0],
5228
+ weight: item?._source?.weight?.[0],
5229
+ parentName: item?._source?.parent_name?.[0],
5230
+ color: item?._source?.color?.[0],
5412
5231
  };
5413
5232
  });
5414
5233
  };
5415
- var formatSeries = function (data) {
5416
- return data.map(function (item) {
5417
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
5234
+ const formatSeries = (data) => {
5235
+ return data.map((item) => {
5418
5236
  return {
5419
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5420
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5421
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5422
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5423
- title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
5424
- synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
5425
- imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
5426
- imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
5427
- category: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.category) === null || _t === void 0 ? void 0 : _t[0],
5428
- categoryId: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.category_id) === null || _v === void 0 ? void 0 : _v[0],
5429
- seasons: ((_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.seasons) || [],
5237
+ uuid: item?._source?.uuid?.[0],
5238
+ id: item?._source?.uuid?.[0],
5239
+ created: item?._source?.created?.[0],
5240
+ updated: item?._source?.updated?.[0],
5241
+ title: item?._source?.display_title?.[0],
5242
+ synopsis: item?._source?.synopsis?.[0],
5243
+ imagePoster: item?._source?.image_style_poster?.[0],
5244
+ imageThumb: item?._source?.image_style_thumb?.[0],
5245
+ category: item?._source?.category?.[0],
5246
+ categoryId: item?._source?.category_id?.[0],
5247
+ seasons: item?._source?.seasons || [],
5430
5248
  };
5431
5249
  });
5432
5250
  };
5433
- var formatSeasons = function (data) {
5434
- return data.map(function (item) {
5435
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
5251
+ const formatSeasons = (data) => {
5252
+ return data.map((item) => {
5436
5253
  return {
5437
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5438
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5439
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5440
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5441
- title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
5442
- synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
5443
- imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
5444
- imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
5445
- episodes: ((_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.episodes) || [],
5446
- seasonNumber: (_u = (_t = item === null || item === void 0 ? void 0 : item._source) === null || _t === void 0 ? void 0 : _t.season_number) === null || _u === void 0 ? void 0 : _u[0],
5447
- showId: (_w = (_v = item === null || item === void 0 ? void 0 : item._source) === null || _v === void 0 ? void 0 : _v.show) === null || _w === void 0 ? void 0 : _w[0],
5254
+ uuid: item?._source?.uuid?.[0],
5255
+ id: item?._source?.uuid?.[0],
5256
+ created: item?._source?.created?.[0],
5257
+ updated: item?._source?.updated?.[0],
5258
+ title: item?._source?.display_title?.[0],
5259
+ synopsis: item?._source?.synopsis?.[0],
5260
+ imagePoster: item?._source?.image_style_poster?.[0],
5261
+ imageThumb: item?._source?.image_style_thumb?.[0],
5262
+ episodes: item?._source?.episodes || [],
5263
+ seasonNumber: item?._source?.season_number?.[0],
5264
+ showId: item?._source?.show?.[0],
5448
5265
  };
5449
5266
  });
5450
5267
  };
5451
- var formatLongform = function (data) {
5452
- return data.map(function (item) {
5453
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
5268
+ const formatLongform = (data) => {
5269
+ return data.map((item) => {
5454
5270
  return {
5455
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5456
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5457
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5458
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5459
- title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
5460
- synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
5461
- imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
5462
- imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
5463
- duration: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.duration) === null || _t === void 0 ? void 0 : _t[0],
5464
- releaseDate: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.release_date) === null || _v === void 0 ? void 0 : _v[0],
5465
- video: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.video) === null || _x === void 0 ? void 0 : _x[0],
5466
- imageUrl: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.image_url) === null || _z === void 0 ? void 0 : _z[0],
5467
- episodeNumber: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.episode_number) === null || _1 === void 0 ? void 0 : _1[0],
5271
+ uuid: item?._source?.uuid?.[0],
5272
+ id: item?._source?.uuid?.[0],
5273
+ created: item?._source?.created?.[0],
5274
+ updated: item?._source?.updated?.[0],
5275
+ title: item?._source?.display_title?.[0],
5276
+ synopsis: item?._source?.synopsis?.[0],
5277
+ imagePoster: item?._source?.image_style_poster?.[0],
5278
+ imageThumb: item?._source?.image_style_thumb?.[0],
5279
+ duration: item?._source?.duration?.[0],
5280
+ releaseDate: item?._source?.release_date?.[0],
5281
+ video: item?._source?.video?.[0],
5282
+ imageUrl: item?._source?.image_url?.[0],
5283
+ episodeNumber: item?._source?.episode_number?.[0],
5468
5284
  };
5469
5285
  });
5470
5286
  };
5471
- var formatMediaItem = function (data) {
5472
- return data.map(function (item) {
5473
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
5287
+ const formatMediaItem = (data) => {
5288
+ return data.map((item) => {
5474
5289
  return {
5475
- changed: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.changed) === null || _b === void 0 ? void 0 : _b[0],
5476
- created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
5477
- image: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.image) === null || _f === void 0 ? void 0 : _f[0],
5478
- customThumbnail: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.custom_thumbnail) === null || _h === void 0 ? void 0 : _h[0],
5479
- price: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k[0],
5480
- priceTwoYear: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.price_2_year) === null || _m === void 0 ? void 0 : _m[0],
5481
- revisionTimestamp: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.revision_timestamp) === null || _p === void 0 ? void 0 : _p[0],
5482
- sku: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.sku) === null || _r === void 0 ? void 0 : _r[0],
5483
- status: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.status) === null || _t === void 0 ? void 0 : _t[0],
5484
- uuid: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.uuid) === null || _v === void 0 ? void 0 : _v[0],
5485
- description: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.description) === null || _x === void 0 ? void 0 : _x[0],
5486
- transcript: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.transcript) === null || _z === void 0 ? void 0 : _z[0],
5487
- entities: (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.entities,
5488
- phrases: (_1 = item === null || item === void 0 ? void 0 : item._source) === null || _1 === void 0 ? void 0 : _1.phrases,
5489
- video: (_3 = (_2 = item === null || item === void 0 ? void 0 : item._source) === null || _2 === void 0 ? void 0 : _2.video) === null || _3 === void 0 ? void 0 : _3[0],
5490
- title: (_5 = (_4 = item === null || item === void 0 ? void 0 : item._source) === null || _4 === void 0 ? void 0 : _4.title) === null || _5 === void 0 ? void 0 : _5[0],
5491
- generatedTitle: (_7 = (_6 = item === null || item === void 0 ? void 0 : item._source) === null || _6 === void 0 ? void 0 : _6.generated_title) === null || _7 === void 0 ? void 0 : _7[0],
5492
- projectPricing: (_9 = (_8 = item === null || item === void 0 ? void 0 : item._source) === null || _8 === void 0 ? void 0 : _8.project_pricing) === null || _9 === void 0 ? void 0 : _9[0],
5493
- related_items: (_10 = item === null || item === void 0 ? void 0 : item._source) === null || _10 === void 0 ? void 0 : _10.related_uuids,
5494
- franchises: (_11 = item === null || item === void 0 ? void 0 : item._source) === null || _11 === void 0 ? void 0 : _11.franchise_name,
5495
- franchisesIds: (_12 = item === null || item === void 0 ? void 0 : item._source) === null || _12 === void 0 ? void 0 : _12.franchise_tid,
5496
- original: (_14 = (_13 = item === null || item === void 0 ? void 0 : item._source) === null || _13 === void 0 ? void 0 : _13.original) === null || _14 === void 0 ? void 0 : _14[0],
5497
- script: (_16 = (_15 = item === null || item === void 0 ? void 0 : item._source) === null || _15 === void 0 ? void 0 : _15.script) === null || _16 === void 0 ? void 0 : _16[0],
5498
- hideThumbnailTitle: (_18 = (_17 = item === null || item === void 0 ? void 0 : item._source) === null || _17 === void 0 ? void 0 : _17.hide_thumbnail_title) === null || _18 === void 0 ? void 0 : _18[0],
5290
+ changed: item?._source?.changed?.[0],
5291
+ created: item?._source?.created?.[0],
5292
+ image: item?._source?.image?.[0],
5293
+ customThumbnail: item?._source?.custom_thumbnail?.[0],
5294
+ price: item?._source?.price?.[0],
5295
+ priceTwoYear: item?._source?.price_2_year?.[0],
5296
+ revisionTimestamp: item?._source?.revision_timestamp?.[0],
5297
+ sku: item?._source?.sku?.[0],
5298
+ status: item?._source?.status?.[0],
5299
+ uuid: item?._source?.uuid?.[0],
5300
+ description: item?._source?.description?.[0],
5301
+ transcript: item?._source?.transcript?.[0],
5302
+ entities: item?._source?.entities,
5303
+ phrases: item?._source?.phrases,
5304
+ video: item?._source?.video?.[0],
5305
+ title: item?._source?.title?.[0],
5306
+ generatedTitle: item?._source?.generated_title?.[0],
5307
+ projectPricing: item?._source?.project_pricing?.[0],
5308
+ related_items: item?._source?.related_uuids,
5309
+ franchises: item?._source?.franchise_name,
5310
+ franchisesIds: item?._source?.franchise_tid,
5311
+ original: item?._source?.original?.[0],
5312
+ script: item?._source?.script?.[0],
5313
+ hideThumbnailTitle: item?._source?.hide_thumbnail_title?.[0],
5499
5314
  };
5500
5315
  });
5501
5316
  };
5502
5317
 
5503
- var _a$1, _b$1, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
5504
5318
  // Render the store based on the environment.
5505
- var isWeb = process.env.NEXT_PUBLIC_WEB_APP;
5506
- var ENV = isWeb ? process.env : Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.default; }).catch(function () { return ({}); });
5319
+ const isWeb = process.env.NEXT_PUBLIC_WEB_APP;
5320
+ const ENV = isWeb ? process.env : import('./index-KjhWa1AL.js').then((mod) => mod.default).catch(() => ({}));
5507
5321
  // export const ENV = process.env;
5508
- ((_a$1 = process.env) === null || _a$1 === void 0 ? void 0 : _a$1.NEXT_PUBLIC_API_PREFIX) || ENV.API_PREFIX;
5322
+ process.env?.NEXT_PUBLIC_API_PREFIX || ENV.API_PREFIX;
5509
5323
  // Auth specific API
5510
- var API_AUTH_PREFIX = ((_b$1 = process.env) === null || _b$1 === void 0 ? void 0 : _b$1.NEXT_PUBLIC_API_AUTH_PREFIX) || ENV.API_AUTH_PREFIX;
5324
+ const API_AUTH_PREFIX = process.env?.NEXT_PUBLIC_API_AUTH_PREFIX || ENV.API_AUTH_PREFIX;
5511
5325
  // Payments specific API
5512
- var API_PAYMENTS_PREFIX = ((_c = process.env) === null || _c === void 0 ? void 0 : _c.NEXT_PUBLIC_API_PAYMENTS_PREFIX) || ENV.API_PAYMENTS_PREFIX;
5326
+ const API_PAYMENTS_PREFIX = process.env?.NEXT_PUBLIC_API_PAYMENTS_PREFIX || ENV.API_PAYMENTS_PREFIX;
5513
5327
  // Orders specific API
5514
- var API_ORDERS_PREFIX = ((_d = process.env) === null || _d === void 0 ? void 0 : _d.NEXT_PUBLIC_API_ORDERS_PREFIX) || ENV.API_ORDERS_PREFIX;
5515
- ((_e = process.env) === null || _e === void 0 ? void 0 : _e.NEXT_PUBLIC_APP_BASE_URL) || ENV.APP_BASE_URL;
5516
- var APP_ES_INSTANCE = ((_f = process.env) === null || _f === void 0 ? void 0 : _f.NEXT_PUBLIC_APP_ES_INSTANCE) || ENV.APP_ES_INSTANCE;
5517
- var APP_ES_AUTH = ((_g = process.env) === null || _g === void 0 ? void 0 : _g.NEXT_PUBLIC_APP_ES_AUTH) || ENV.APP_ES_AUTH;
5518
- ((_h = process.env) === null || _h === void 0 ? void 0 : _h.NEXT_PUBLIC_APP_ES_PROMO_PANEL_INDEX) ||
5328
+ const API_ORDERS_PREFIX = process.env?.NEXT_PUBLIC_API_ORDERS_PREFIX || ENV.API_ORDERS_PREFIX;
5329
+ process.env?.NEXT_PUBLIC_APP_BASE_URL || ENV.APP_BASE_URL;
5330
+ const APP_ES_INSTANCE = process.env?.NEXT_PUBLIC_APP_ES_INSTANCE || ENV.APP_ES_INSTANCE;
5331
+ const APP_ES_AUTH = process.env?.NEXT_PUBLIC_APP_ES_AUTH || ENV.APP_ES_AUTH;
5332
+ process.env?.NEXT_PUBLIC_APP_ES_PROMO_PANEL_INDEX ||
5519
5333
  ENV.APP_ES_PROMO_PANEL_INDEX;
5520
- ((_j = process.env) === null || _j === void 0 ? void 0 : _j.NEXT_PUBLIC_APP_ES_FAQ_INDEX) || ENV.APP_ES_FAQ_INDEX;
5521
- ((_k = process.env) === null || _k === void 0 ? void 0 : _k.NEXT_PUBLIC_APP_ES_PAGES_INDEX) || ENV.APP_ES_PAGES_INDEX;
5522
- ((_l = process.env) === null || _l === void 0 ? void 0 : _l.NEXT_PUBLIC_APP_ES_SETTINGS_INDEX) || ENV.APP_ES_SETTINGS_INDEX;
5523
- ((_m = process.env) === null || _m === void 0 ? void 0 : _m.NEXT_PUBLIC_APP_ES_PRESS_INDEX) || ENV.APP_ES_PRESS_INDEX;
5524
- ((_o = process.env) === null || _o === void 0 ? void 0 : _o.NEXT_PUBLIC_APP_ES_GUESTS_INDEX) || ENV.APP_ES_GUESTS_INDEX;
5525
- ((_p = process.env) === null || _p === void 0 ? void 0 : _p.NEXT_PUBLIC_APP_ES_VIDEOS_INDEX) || ENV.APP_ES_VIDEOS_INDEX;
5526
- ((_q = process.env) === null || _q === void 0 ? void 0 : _q.NEXT_PUBLIC_APP_ES_SECTIONS_INDEX) || ENV.APP_ES_SECTIONS_INDEX;
5527
- ((_r = process.env) === null || _r === void 0 ? void 0 : _r.NEXT_PUBLIC_APP_ES_WORKOUTS_INDEX) || ENV.APP_ES_WORKOUTS_INDEX;
5528
- ((_s = process.env) === null || _s === void 0 ? void 0 : _s.NEXT_PUBLIC_APP_ES_SCHEDULE_INDEX) || ENV.APP_ES_SCHEDULE_INDEX;
5529
- ((_t = process.env) === null || _t === void 0 ? void 0 : _t.NEXT_PUBLIC_APP_ES_CHALLENGES_INDEX) ||
5334
+ process.env?.NEXT_PUBLIC_APP_ES_FAQ_INDEX || ENV.APP_ES_FAQ_INDEX;
5335
+ process.env?.NEXT_PUBLIC_APP_ES_PAGES_INDEX || ENV.APP_ES_PAGES_INDEX;
5336
+ process.env?.NEXT_PUBLIC_APP_ES_SETTINGS_INDEX || ENV.APP_ES_SETTINGS_INDEX;
5337
+ process.env?.NEXT_PUBLIC_APP_ES_PRESS_INDEX || ENV.APP_ES_PRESS_INDEX;
5338
+ process.env?.NEXT_PUBLIC_APP_ES_GUESTS_INDEX || ENV.APP_ES_GUESTS_INDEX;
5339
+ process.env?.NEXT_PUBLIC_APP_ES_VIDEOS_INDEX || ENV.APP_ES_VIDEOS_INDEX;
5340
+ process.env?.NEXT_PUBLIC_APP_ES_SECTIONS_INDEX || ENV.APP_ES_SECTIONS_INDEX;
5341
+ process.env?.NEXT_PUBLIC_APP_ES_WORKOUTS_INDEX || ENV.APP_ES_WORKOUTS_INDEX;
5342
+ process.env?.NEXT_PUBLIC_APP_ES_SCHEDULE_INDEX || ENV.APP_ES_SCHEDULE_INDEX;
5343
+ process.env?.NEXT_PUBLIC_APP_ES_CHALLENGES_INDEX ||
5530
5344
  ENV.APP_ES_CHALLENGES_INDEX;
5531
- ((_u = process.env) === null || _u === void 0 ? void 0 : _u.NEXT_PUBLIC_APP_ES_CHALLENGE_DAYS_INDEX) ||
5345
+ process.env?.NEXT_PUBLIC_APP_ES_CHALLENGE_DAYS_INDEX ||
5532
5346
  ENV.APP_ES_CHALLENGE_DAYS_INDEX;
5533
5347
 
5534
- var authDataBaseQuery = fetchBaseQuery({
5348
+ const authDataBaseQuery = fetchBaseQuery({
5535
5349
  baseUrl: API_AUTH_PREFIX,
5536
- prepareHeaders: function (headers_1, _a) { return __awaiter(void 0, [headers_1, _a], void 0, function (headers, _b) {
5537
- var session, idToken, accessToken, error_1;
5538
- return __generator(this, function (_c) {
5539
- switch (_c.label) {
5540
- case 0:
5541
- headers.set('Content-Type', 'application/json');
5542
- _c.label = 1;
5543
- case 1:
5544
- _c.trys.push([1, 3, , 4]);
5545
- return [4 /*yield*/, Auth.currentSession()];
5546
- case 2:
5547
- session = _c.sent();
5548
- idToken = session.getIdToken().getJwtToken();
5549
- accessToken = session.getAccessToken().getJwtToken();
5550
- if (accessToken && idToken) {
5551
- headers.set('accesstoken', accessToken);
5552
- headers.set('idtoken', idToken);
5553
- // headers.set('refreshtoken', tokens.refreshToken);
5554
- }
5555
- return [2 /*return*/, headers];
5556
- case 3:
5557
- error_1 = _c.sent();
5558
- console.error('authDataBaseQuery: ', error_1);
5559
- return [2 /*return*/, headers];
5560
- case 4: return [2 /*return*/];
5350
+ prepareHeaders: async (headers, {}) => {
5351
+ headers.set('Content-Type', 'application/json');
5352
+ try {
5353
+ // add accessToken to headers from slice using selectAccessToken selector
5354
+ const session = await Auth.currentSession();
5355
+ const idToken = session.getIdToken().getJwtToken(); // ID token
5356
+ const accessToken = session.getAccessToken().getJwtToken(); // Access token
5357
+ if (accessToken && idToken) {
5358
+ headers.set('accesstoken', accessToken);
5359
+ headers.set('idtoken', idToken);
5360
+ // headers.set('refreshtoken', tokens.refreshToken);
5561
5361
  }
5562
- });
5563
- }); },
5362
+ return headers;
5363
+ }
5364
+ catch (error) {
5365
+ console.error('authDataBaseQuery: ', error);
5366
+ return headers;
5367
+ }
5368
+ },
5564
5369
  credentials: 'include',
5565
5370
  });
5566
5371
  /**
5567
5372
  * This function is used to retry a request if we get a 401 error.
5568
5373
  */
5569
- var authDataBaseQueryWithReauth = function (args, api, extraOptions) { return __awaiter(void 0, void 0, void 0, function () {
5570
- var result, authSession, user;
5571
- var _a;
5572
- return __generator(this, function (_b) {
5573
- switch (_b.label) {
5574
- case 0: return [4 /*yield*/, authDataBaseQuery(args, api, extraOptions)];
5575
- case 1:
5576
- result = _b.sent();
5577
- if (!(((_a = result === null || result === void 0 ? void 0 : result.error) === null || _a === void 0 ? void 0 : _a.status) === 401)) return [3 /*break*/, 6];
5578
- return [4 /*yield*/, Auth.currentAuthenticatedUser({
5579
- bypassCache: true, // Ensures that the user is refreshed from the server
5580
- })];
5581
- case 2:
5582
- authSession = _b.sent();
5583
- user = formatAuthSession(authSession);
5584
- api.dispatch(setCredentials(user));
5585
- if (!(authSession === null || authSession === void 0 ? void 0 : authSession.tokens)) return [3 /*break*/, 4];
5586
- return [4 /*yield*/, authDataBaseQuery(args, api, extraOptions)];
5587
- case 3:
5588
- // If we get a new access token, retry the original request.
5589
- result = _b.sent();
5590
- return [3 /*break*/, 6];
5591
- case 4:
5374
+ const authDataBaseQueryWithReauth = async (args, api, extraOptions) => {
5375
+ let result = await authDataBaseQuery(args, api, extraOptions);
5376
+ // If we get a 401 error
5377
+ if (result?.error?.status === 401) {
5378
+ const authSession = await Auth.currentAuthenticatedUser({
5379
+ bypassCache: true, // Ensures that the user is refreshed from the server
5380
+ });
5381
+ const user = formatAuthSession(authSession);
5382
+ api.dispatch(setCredentials(user));
5383
+ if (authSession?.tokens) {
5384
+ // If we get a new access token, retry the original request.
5385
+ result = await authDataBaseQuery(args, api, extraOptions);
5386
+ }
5387
+ else {
5592
5388
  // TODO; require full data reset?
5593
- return [4 /*yield*/, Auth.signOut()];
5594
- case 5:
5595
- // TODO; require full data reset?
5596
- _b.sent();
5597
- api.dispatch(logout());
5598
- // If no access token throw error.
5599
- throw new Error('No access token found');
5600
- case 6: return [2 /*return*/, result];
5389
+ await Auth.signOut();
5390
+ api.dispatch(logout());
5391
+ // If no access token throw error.
5392
+ throw new Error('No access token found');
5601
5393
  }
5602
- });
5603
- }); };
5604
- var authApi = createApi({
5394
+ }
5395
+ return result;
5396
+ };
5397
+ const authApi = createApi({
5605
5398
  reducerPath: 'authApi',
5606
5399
  baseQuery: authDataBaseQueryWithReauth,
5607
5400
  tagTypes: ['UserToken', 'UserData'],
5608
5401
  // keepUnusedDataFor: 300,
5609
- endpoints: function (builder) { return ({
5402
+ endpoints: (builder) => ({
5610
5403
  resetPassword: builder.mutation({
5611
- query: function (data) { return ({
5404
+ query: (data) => ({
5612
5405
  url: '/user/password/reset',
5613
5406
  method: 'POST',
5614
5407
  body: {
@@ -5617,10 +5410,10 @@ var authApi = createApi({
5617
5410
  currentPassword: data.currentPassword,
5618
5411
  newPassword: data.newPassword,
5619
5412
  },
5620
- }); },
5413
+ }),
5621
5414
  }),
5622
5415
  resetPasswordAuth: builder.mutation({
5623
- query: function (data) { return ({
5416
+ query: (data) => ({
5624
5417
  url: '/user/password/reset-auth',
5625
5418
  method: 'POST',
5626
5419
  body: {
@@ -5628,54 +5421,41 @@ var authApi = createApi({
5628
5421
  currentPassword: data.currentPassword,
5629
5422
  newPassword: data.newPassword,
5630
5423
  },
5631
- }); },
5424
+ }),
5632
5425
  }),
5633
5426
  forgottenPassword: builder.mutation({
5634
- query: function (data) { return ({
5427
+ query: (data) => ({
5635
5428
  url: '/user/password/forgot',
5636
5429
  method: 'POST',
5637
5430
  body: {
5638
5431
  email: data.email,
5639
5432
  },
5640
- }); },
5433
+ }),
5641
5434
  }),
5642
5435
  register: builder.mutation({
5643
- query: function (data) { return ({
5436
+ query: (data) => ({
5644
5437
  url: '/user/register',
5645
5438
  method: 'POST',
5646
5439
  body: data,
5647
- }); },
5648
- onQueryStarted: function (arg_1, _a) {
5649
- return __awaiter(this, arguments, void 0, function (arg, _b) {
5650
- var err_1;
5651
- var dispatch = _b.dispatch, queryFulfilled = _b.queryFulfilled;
5652
- return __generator(this, function (_c) {
5653
- switch (_c.label) {
5654
- case 0:
5655
- _c.trys.push([0, 2, , 3]);
5656
- return [4 /*yield*/, queryFulfilled];
5657
- case 1:
5658
- _c.sent();
5659
- dispatch(resetCreating());
5660
- return [3 /*break*/, 3];
5661
- case 2:
5662
- err_1 = _c.sent();
5663
- console.error('REGISTER: ', err_1);
5664
- return [3 /*break*/, 3];
5665
- case 3: return [2 /*return*/];
5666
- }
5667
- });
5668
- });
5440
+ }),
5441
+ async onQueryStarted(arg, { dispatch, queryFulfilled }) {
5442
+ try {
5443
+ await queryFulfilled;
5444
+ dispatch(resetCreating());
5445
+ }
5446
+ catch (err) {
5447
+ console.error('REGISTER: ', err);
5448
+ }
5669
5449
  },
5670
5450
  }),
5671
5451
  verifyUser: builder.query({
5672
- query: function (data) { return ({
5452
+ query: (data) => ({
5673
5453
  url: '/user/verify',
5674
5454
  method: 'POST',
5675
5455
  body: data,
5676
- }); },
5677
- transformErrorResponse: function (rawResult) {
5678
- var status = rawResult.status, data = rawResult.data, message = rawResult.message;
5456
+ }),
5457
+ transformErrorResponse: (rawResult) => {
5458
+ const { status, data, message } = rawResult;
5679
5459
  switch (status) {
5680
5460
  case 429:
5681
5461
  // Toast.info(TOO_MANY_REQUESTS_MESSAGE);
@@ -5687,7 +5467,7 @@ var authApi = createApi({
5687
5467
  */
5688
5468
  return {
5689
5469
  route: 'resend',
5690
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5470
+ message: data?.message || message,
5691
5471
  };
5692
5472
  case 404:
5693
5473
  /**
@@ -5695,7 +5475,7 @@ var authApi = createApi({
5695
5475
  */
5696
5476
  return {
5697
5477
  route: 'failed',
5698
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5478
+ message: data?.message || message,
5699
5479
  };
5700
5480
  case 401:
5701
5481
  /**
@@ -5703,159 +5483,146 @@ var authApi = createApi({
5703
5483
  */
5704
5484
  return {
5705
5485
  route: 'error',
5706
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5486
+ message: data?.message || message,
5707
5487
  };
5708
5488
  default:
5709
5489
  return {
5710
5490
  route: 'error',
5711
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5491
+ message: data?.message || message,
5712
5492
  };
5713
5493
  }
5714
5494
  },
5715
- transformResponse: function (rawResult) {
5716
- var data = rawResult.data;
5717
- return { route: 'success', message: data === null || data === void 0 ? void 0 : data.message };
5495
+ transformResponse: (rawResult) => {
5496
+ const { data } = rawResult;
5497
+ return { route: 'success', message: data?.message };
5718
5498
  },
5719
5499
  }),
5720
5500
  verifyUserAttributes: builder.query({
5721
- query: function (data) { return ({
5501
+ query: (data) => ({
5722
5502
  url: '/user/verify/email',
5723
5503
  method: 'POST',
5724
5504
  body: data,
5725
- }); },
5505
+ }),
5726
5506
  }),
5727
5507
  verifyUserResend: builder.query({
5728
- query: function (data) { return ({
5508
+ query: (data) => ({
5729
5509
  url: '/user/verify/resend',
5730
5510
  method: 'POST',
5731
5511
  body: data,
5732
- }); },
5512
+ }),
5733
5513
  }),
5734
5514
  getUserInfo: builder.query({
5735
- query: function (uuid) { return ({
5736
- url: "/data/user/".concat(uuid),
5515
+ query: (uuid) => ({
5516
+ url: `/data/user/${uuid}`,
5737
5517
  method: 'GET',
5738
- }); },
5518
+ }),
5739
5519
  providesTags: ['UserData'],
5740
5520
  }),
5741
5521
  updateUserInfo: builder.mutation({
5742
- query: function (expressions) { return ({
5522
+ query: (expressions) => ({
5743
5523
  url: '/data/user',
5744
5524
  method: 'PATCH',
5745
5525
  body: expressions,
5746
- }); },
5526
+ }),
5747
5527
  invalidatesTags: ['UserData'],
5748
5528
  }),
5749
5529
  updateUser: builder.mutation({
5750
- query: function (data) { return ({
5530
+ query: (data) => ({
5751
5531
  url: '/user',
5752
5532
  method: 'PATCH',
5753
5533
  body: data,
5754
- }); },
5534
+ }),
5755
5535
  invalidatesTags: ['UserData'],
5756
5536
  }),
5757
- }); },
5537
+ }),
5758
5538
  });
5759
5539
  // Export hooks for usage in functional components.
5760
- var // useLoginQuery,
5540
+ const {
5541
+ // useLoginQuery,
5761
5542
  // useLazyLoginQuery,
5762
5543
  // useRefreshTokenQuery,
5763
5544
  // useLazyRefreshTokenQuery,
5764
5545
  // useLogoutQuery,
5765
5546
  // useLazyLogoutQuery,
5766
- useResetPasswordMutation = authApi.useResetPasswordMutation, // Use this for mobile app.
5767
- useResetPasswordAuthMutation = authApi.useResetPasswordAuthMutation, useRegisterMutation = authApi.useRegisterMutation, useVerifyUserQuery = authApi.useVerifyUserQuery, useLazyVerifyUserQuery = authApi.useLazyVerifyUserQuery, useGetUserInfoQuery = authApi.useGetUserInfoQuery, useLazyGetUserInfoQuery = authApi.useLazyGetUserInfoQuery, useUpdateUserInfoMutation = authApi.useUpdateUserInfoMutation, useForgottenPasswordMutation = authApi.useForgottenPasswordMutation, useVerifyUserAttributesQuery = authApi.useVerifyUserAttributesQuery, useLazyVerifyUserAttributesQuery = authApi.useLazyVerifyUserAttributesQuery, useVerifyUserResendQuery = authApi.useVerifyUserResendQuery, useLazyVerifyUserResendQuery = authApi.useLazyVerifyUserResendQuery, useUpdateUserMutation = authApi.useUpdateUserMutation;
5547
+ useResetPasswordMutation, // Use this for mobile app.
5548
+ useResetPasswordAuthMutation, useRegisterMutation, useVerifyUserQuery, useLazyVerifyUserQuery, useGetUserInfoQuery, useLazyGetUserInfoQuery, useUpdateUserInfoMutation, useForgottenPasswordMutation, useVerifyUserAttributesQuery, useLazyVerifyUserAttributesQuery, useVerifyUserResendQuery, useLazyVerifyUserResendQuery, useUpdateUserMutation, } = authApi;
5768
5549
 
5769
- var contentApi = createApi({
5550
+ const contentApi = createApi({
5770
5551
  reducerPath: 'contentApi',
5771
5552
  baseQuery: fetchBaseQuery({
5772
5553
  baseUrl: APP_ES_INSTANCE,
5773
- prepareHeaders: function (headers) {
5554
+ prepareHeaders: (headers) => {
5774
5555
  headers.set('Authorization', APP_ES_AUTH);
5775
5556
  return headers;
5776
5557
  },
5777
5558
  }),
5778
5559
  tagTypes: ['Data', 'Workout'],
5779
5560
  // keepUnusedDataFor: 300,
5780
- endpoints: function (builder) { return ({
5561
+ endpoints: (builder) => ({
5781
5562
  getData: builder.query({
5782
- query: function (_a) {
5783
- var index = _a.index, _b = _a.options, options = _b === void 0 ? {} : _b;
5784
- return ({
5785
- url: "".concat(index, "/_search"),
5786
- method: 'POST',
5787
- body: {
5788
- from: 0,
5789
- size: options.size || 1000,
5790
- sort: options.sort || [{ created: { order: 'desc' } }],
5791
- query: options.query || {
5792
- match_all: {},
5793
- },
5563
+ query: ({ index, options = {} }) => ({
5564
+ url: `${index}/_search`,
5565
+ method: 'POST',
5566
+ body: {
5567
+ from: 0,
5568
+ size: options.size || 1000,
5569
+ sort: options.sort || [{ created: { order: 'desc' } }],
5570
+ query: options.query || {
5571
+ match_all: {},
5794
5572
  },
5795
- });
5796
- },
5797
- transformResponse: function (response) { var _a; return (_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits; },
5573
+ },
5574
+ }),
5575
+ transformResponse: (response) => response?.hits?.hits,
5798
5576
  providesTags: ['Data'],
5799
5577
  }),
5800
5578
  getDataById: builder.query({
5801
- query: function (_a) {
5802
- var _b;
5803
- var index = _a.index, ids = _a.ids;
5804
- return ({
5805
- url: "".concat(index, "/_search"),
5806
- method: 'POST',
5807
- body: {
5808
- from: 0,
5809
- size: ids.length,
5810
- query: {
5811
- terms: (_b = {},
5812
- _b['uuid.keyword'] = ids,
5813
- _b),
5579
+ query: ({ index, ids }) => ({
5580
+ url: `${index}/_search`,
5581
+ method: 'POST',
5582
+ body: {
5583
+ from: 0,
5584
+ size: ids.length,
5585
+ query: {
5586
+ terms: {
5587
+ ['uuid.keyword']: ids,
5814
5588
  },
5815
5589
  },
5816
- });
5817
- },
5818
- transformResponse: function (response) { var _a; return (_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits; },
5590
+ },
5591
+ }),
5592
+ transformResponse: (response) => response?.hits?.hits,
5819
5593
  providesTags: ['Workout'],
5820
5594
  }),
5821
- }); },
5595
+ }),
5822
5596
  });
5823
- contentApi.useGetDataQuery; contentApi.useLazyGetDataQuery; contentApi.useGetDataByIdQuery; contentApi.useLazyGetDataByIdQuery;
5597
+ const { useGetDataQuery, useLazyGetDataQuery, useGetDataByIdQuery, useLazyGetDataByIdQuery, } = contentApi;
5824
5598
 
5825
- var paymentApi = createApi({
5599
+ const paymentApi = createApi({
5826
5600
  reducerPath: 'paymentApi',
5827
5601
  baseQuery: fetchBaseQuery({
5828
5602
  baseUrl: API_PAYMENTS_PREFIX,
5829
- prepareHeaders: function (headers_1, _a) { return __awaiter(void 0, [headers_1, _a], void 0, function (headers, _b) {
5830
- var session, idToken, accessToken;
5831
- return __generator(this, function (_c) {
5832
- switch (_c.label) {
5833
- case 0:
5834
- headers.set('Content-Type', 'application/json');
5835
- return [4 /*yield*/, Auth.currentSession()];
5836
- case 1:
5837
- session = _c.sent();
5838
- idToken = session.getIdToken().getJwtToken();
5839
- accessToken = session.getAccessToken().getJwtToken();
5840
- if (accessToken && idToken) {
5841
- headers.set('accesstoken', accessToken);
5842
- headers.set('idtoken', idToken);
5843
- // headers.set('refreshtoken', tokens.refreshToken);
5844
- }
5845
- return [2 /*return*/, headers];
5846
- }
5847
- });
5848
- }); },
5603
+ prepareHeaders: async (headers, {}) => {
5604
+ headers.set('Content-Type', 'application/json');
5605
+ // add accessToken to headers from slice using selectAccessToken selector
5606
+ const session = await Auth.currentSession();
5607
+ const idToken = session.getIdToken().getJwtToken(); // ID token
5608
+ const accessToken = session.getAccessToken().getJwtToken(); // Access token
5609
+ if (accessToken && idToken) {
5610
+ headers.set('accesstoken', accessToken);
5611
+ headers.set('idtoken', idToken);
5612
+ // headers.set('refreshtoken', tokens.refreshToken);
5613
+ }
5614
+ return headers;
5615
+ },
5849
5616
  credentials: 'include',
5850
5617
  }),
5851
5618
  tagTypes: ['UserSubscription', 'Plans', 'TaxRates', 'PromoCodes'],
5852
5619
  // keepUnusedDataFor: 300,
5853
- endpoints: function (builder) { return ({
5620
+ endpoints: (builder) => ({
5854
5621
  /**
5855
5622
  * USER API.
5856
5623
  */
5857
5624
  checkUserSubscription: builder.query({
5858
- query: function (data) { return ({
5625
+ query: (data) => ({
5859
5626
  url: '/payment/subscriber',
5860
5627
  method: 'POST',
5861
5628
  body: {
@@ -5863,119 +5630,99 @@ var paymentApi = createApi({
5863
5630
  email: data.email,
5864
5631
  sub: data.sub,
5865
5632
  },
5866
- }); },
5633
+ }),
5867
5634
  providesTags: ['UserSubscription'],
5868
5635
  }),
5869
5636
  getPaymentPlans: builder.query({
5870
- query: function () { return '/payment/plans'; },
5637
+ query: () => '/payment/plans',
5871
5638
  providesTags: ['Plans'],
5872
5639
  }),
5873
5640
  getTaxRates: builder.query({
5874
- query: function () { return ({
5641
+ query: () => ({
5875
5642
  url: '/payment/tax-rates',
5876
5643
  method: 'GET',
5877
- }); },
5644
+ }),
5878
5645
  providesTags: ['TaxRates'],
5879
5646
  }),
5880
5647
  checkPromoCode: builder.query({
5881
- query: function (promoCode) { return ({
5882
- url: "/payment/coupon/".concat(promoCode),
5648
+ query: (promoCode) => ({
5649
+ url: `/payment/coupon/${promoCode}`,
5883
5650
  method: 'GET',
5884
- }); },
5651
+ }),
5885
5652
  providesTags: ['PromoCodes'],
5886
5653
  }),
5887
- }); },
5654
+ }),
5888
5655
  });
5889
5656
  // Export hooks for usage in functional components.
5890
- paymentApi.useCheckUserSubscriptionQuery; paymentApi.useLazyCheckUserSubscriptionQuery; paymentApi.useGetPaymentPlansQuery; paymentApi.useLazyGetPaymentPlansQuery; paymentApi.useGetTaxRatesQuery; paymentApi.useLazyGetTaxRatesQuery; paymentApi.useCheckPromoCodeQuery; paymentApi.useLazyCheckPromoCodeQuery;
5657
+ const { useCheckUserSubscriptionQuery, useLazyCheckUserSubscriptionQuery, useGetPaymentPlansQuery, useLazyGetPaymentPlansQuery, useGetTaxRatesQuery, useLazyGetTaxRatesQuery, useCheckPromoCodeQuery, useLazyCheckPromoCodeQuery, } = paymentApi;
5891
5658
 
5892
- var dataBaseQuery = fetchBaseQuery({
5659
+ const dataBaseQuery = fetchBaseQuery({
5893
5660
  baseUrl: API_ORDERS_PREFIX,
5894
- prepareHeaders: function (headers_1, _a) { return __awaiter(void 0, [headers_1, _a], void 0, function (headers, _b) {
5895
- var session, idToken, accessToken;
5896
- return __generator(this, function (_c) {
5897
- switch (_c.label) {
5898
- case 0:
5899
- headers.set('Content-Type', 'application/json');
5900
- return [4 /*yield*/, Auth.currentSession()];
5901
- case 1:
5902
- session = _c.sent();
5903
- idToken = session.getIdToken().getJwtToken();
5904
- accessToken = session.getAccessToken().getJwtToken();
5905
- if (accessToken && idToken) {
5906
- headers.set('accesstoken', accessToken);
5907
- headers.set('idtoken', idToken);
5908
- // headers.set('refreshtoken', tokens.refreshToken);
5909
- }
5910
- return [2 /*return*/, headers];
5911
- }
5912
- });
5913
- }); },
5661
+ prepareHeaders: async (headers, {}) => {
5662
+ headers.set('Content-Type', 'application/json');
5663
+ // add accessToken to headers from slice using selectAccessToken selector
5664
+ const session = await Auth.currentSession();
5665
+ const idToken = session.getIdToken().getJwtToken(); // ID token
5666
+ const accessToken = session.getAccessToken().getJwtToken(); // Access token
5667
+ if (accessToken && idToken) {
5668
+ headers.set('accesstoken', accessToken);
5669
+ headers.set('idtoken', idToken);
5670
+ // headers.set('refreshtoken', tokens.refreshToken);
5671
+ }
5672
+ return headers;
5673
+ },
5914
5674
  credentials: 'include',
5915
5675
  });
5916
5676
  /**
5917
5677
  * This function is used to retry a request if we get a 401 error.
5918
5678
  */
5919
- var dataBaseQueryWithReauth = function (args, api, extraOptions) { return __awaiter(void 0, void 0, void 0, function () {
5920
- var result, authSession, user;
5921
- var _a;
5922
- return __generator(this, function (_b) {
5923
- switch (_b.label) {
5924
- case 0: return [4 /*yield*/, dataBaseQuery(args, api, extraOptions)];
5925
- case 1:
5926
- result = _b.sent();
5927
- if (!(((_a = result === null || result === void 0 ? void 0 : result.error) === null || _a === void 0 ? void 0 : _a.status) === 401)) return [3 /*break*/, 6];
5928
- return [4 /*yield*/, Auth.currentAuthenticatedUser({
5929
- bypassCache: true, // Ensures that the user is refreshed from the server
5930
- })];
5931
- case 2:
5932
- authSession = _b.sent();
5933
- user = formatAuthSession(authSession);
5934
- api.dispatch(setCredentials(user));
5935
- if (!(authSession === null || authSession === void 0 ? void 0 : authSession.tokens)) return [3 /*break*/, 4];
5936
- return [4 /*yield*/, dataBaseQuery(args, api, extraOptions)];
5937
- case 3:
5938
- // If we get a new access token, retry the original request.
5939
- result = _b.sent();
5940
- return [3 /*break*/, 6];
5941
- case 4:
5679
+ const dataBaseQueryWithReauth = async (args, api, extraOptions) => {
5680
+ let result = await dataBaseQuery(args, api, extraOptions);
5681
+ // If we get a 401 error
5682
+ if (result?.error?.status === 401) {
5683
+ const authSession = await Auth.currentAuthenticatedUser({
5684
+ bypassCache: true, // Ensures that the user is refreshed from the server
5685
+ });
5686
+ const user = formatAuthSession(authSession);
5687
+ api.dispatch(setCredentials(user));
5688
+ if (authSession?.tokens) {
5689
+ // If we get a new access token, retry the original request.
5690
+ result = await dataBaseQuery(args, api, extraOptions);
5691
+ }
5692
+ else {
5942
5693
  // TODO; require full data reset?
5943
- return [4 /*yield*/, Auth.signOut()];
5944
- case 5:
5945
- // TODO; require full data reset?
5946
- _b.sent();
5947
- api.dispatch(logout());
5948
- // If no access token throw error.
5949
- throw new Error('No access token found');
5950
- case 6: return [2 /*return*/, result];
5694
+ await Auth.signOut();
5695
+ api.dispatch(logout());
5696
+ // If no access token throw error.
5697
+ throw new Error('No access token found');
5951
5698
  }
5952
- });
5953
- }); };
5954
- var ordersApi = createApi({
5699
+ }
5700
+ return result;
5701
+ };
5702
+ const ordersApi = createApi({
5955
5703
  reducerPath: 'ordersApi',
5956
5704
  baseQuery: dataBaseQueryWithReauth,
5957
5705
  tagTypes: ['Orders'],
5958
5706
  // keepUnusedDataFor: 300,
5959
- endpoints: function (builder) { return ({
5707
+ endpoints: (builder) => ({
5960
5708
  /**
5961
5709
  * USER API.
5962
5710
  */
5963
5711
  fetchOrders: builder.query({
5964
- query: function (ids) { return ({
5712
+ query: (ids) => ({
5965
5713
  url: '/order/search',
5966
5714
  method: 'POST',
5967
5715
  body: {
5968
- ids: ids,
5716
+ ids,
5969
5717
  },
5970
- }); },
5718
+ }),
5971
5719
  }),
5972
- }); },
5720
+ }),
5973
5721
  });
5974
5722
  // Export hooks for usage in functional components.
5975
- ordersApi.useFetchOrdersQuery; ordersApi.useLazyFetchOrdersQuery;
5723
+ const { useFetchOrdersQuery, useLazyFetchOrdersQuery } = ordersApi;
5976
5724
 
5977
- var _a, _b;
5978
- var initialState = {
5725
+ const initialState = {
5979
5726
  addedItems: [],
5980
5727
  netTotal: 0,
5981
5728
  taxRate: {
@@ -5994,121 +5741,138 @@ var initialState = {
5994
5741
  error: false,
5995
5742
  open: false,
5996
5743
  };
5997
- var cartSlice = createSlice({
5744
+ const cartSlice = createSlice({
5998
5745
  name: 'cart',
5999
- initialState: initialState,
5746
+ initialState,
6000
5747
  reducers: {
6001
- setTaxRate: function (state, action) {
6002
- var netTotal = state.netTotal, promoCode = state.promoCode;
6003
- var currentTotal = netTotal;
6004
- if (promoCode === null || promoCode === void 0 ? void 0 : promoCode.code) {
6005
- var data = applyCoupon(promoCode, currentTotal);
5748
+ setTaxRate: (state, action) => {
5749
+ const { netTotal, promoCode } = state;
5750
+ let currentTotal = netTotal;
5751
+ if (promoCode?.code) {
5752
+ const data = applyCoupon(promoCode, currentTotal);
6006
5753
  currentTotal = data.discountedTotal;
6007
5754
  }
6008
- var taxAmount = applyTax(action.payload, currentTotal);
6009
- var grossTotal = currentTotal + taxAmount;
6010
- return __assign(__assign({}, state), { taxRate: action.payload, taxAmount: taxAmount, grossTotal: grossTotal });
5755
+ const taxAmount = applyTax(action.payload, currentTotal);
5756
+ const grossTotal = currentTotal + taxAmount;
5757
+ return {
5758
+ ...state,
5759
+ taxRate: action.payload,
5760
+ taxAmount,
5761
+ grossTotal,
5762
+ };
6011
5763
  },
6012
- resetTaxRate: function (state, action) {
6013
- return __assign(__assign({}, state), { taxRate: {
5764
+ resetTaxRate: (state, action) => {
5765
+ return {
5766
+ ...state,
5767
+ taxRate: {
6014
5768
  country: 'none',
6015
5769
  percentage: 0,
6016
- }, taxAmount: 0 });
5770
+ },
5771
+ taxAmount: 0,
5772
+ };
6017
5773
  },
6018
- setPromoCode: function (state, action) {
6019
- var netTotal = state.netTotal, taxRate = state.taxRate;
6020
- var data = applyCoupon(action.payload, netTotal);
6021
- var taxAmount = applyTax(taxRate, data.discountedTotal);
6022
- var grossTotal = data.discountedTotal + taxAmount;
6023
- return __assign(__assign({}, state), { promoCode: {
5774
+ setPromoCode: (state, action) => {
5775
+ const { netTotal, taxRate } = state;
5776
+ const data = applyCoupon(action.payload, netTotal);
5777
+ const taxAmount = applyTax(taxRate, data.discountedTotal);
5778
+ const grossTotal = data.discountedTotal + taxAmount;
5779
+ return {
5780
+ ...state,
5781
+ promoCode: {
6024
5782
  code: data.code,
6025
5783
  name: data.code,
6026
5784
  discount: data.discount,
6027
5785
  discountedAmount: data.discountedAmount,
6028
- }, taxAmount: taxAmount, grossTotal: grossTotal });
5786
+ },
5787
+ taxAmount,
5788
+ grossTotal,
5789
+ };
6029
5790
  },
6030
- removePromoCode: function (state, action) {
6031
- var netTotal = state.netTotal, taxRate = state.taxRate;
6032
- var taxAmount = applyTax(taxRate, netTotal);
6033
- var grossTotal = netTotal + taxAmount;
6034
- return __assign(__assign({}, state), { promoCode: initialState.promoCode, taxAmount: taxAmount, grossTotal: grossTotal });
5791
+ removePromoCode: (state, action) => {
5792
+ const { netTotal, taxRate } = state;
5793
+ const taxAmount = applyTax(taxRate, netTotal);
5794
+ const grossTotal = netTotal + taxAmount;
5795
+ return {
5796
+ ...state,
5797
+ promoCode: initialState.promoCode,
5798
+ taxAmount,
5799
+ grossTotal,
5800
+ };
6035
5801
  },
6036
- addToCart: function (state, action) {
6037
- var _a = action.payload, options = _a.options, item = _a.item;
6038
- var newTotal = state.netTotal + options.selectedPrice;
6039
- var taxAmount = newTotal * (state.taxRate.percentage / 100);
6040
- var grossTotal = newTotal + taxAmount;
6041
- var addItem = item ? __assign(__assign({}, item), { options: options }) : null;
5802
+ addToCart: (state, action) => {
5803
+ const { options, item } = action.payload;
5804
+ const newTotal = state.netTotal + options.selectedPrice;
5805
+ const taxAmount = newTotal * (state.taxRate.percentage / 100);
5806
+ const grossTotal = newTotal + taxAmount;
5807
+ const addItem = item ? { ...item, options } : null;
6042
5808
  if (!addItem) {
6043
5809
  return state;
6044
5810
  }
6045
- var addedItems = __spreadArray(__spreadArray([], state.addedItems, true), [addItem], false);
6046
- return __assign(__assign({}, state), { addedItems: addedItems, netTotal: newTotal, grossTotal: grossTotal });
5811
+ const addedItems = [...state.addedItems, addItem];
5812
+ return {
5813
+ ...state,
5814
+ addedItems: addedItems,
5815
+ netTotal: newTotal,
5816
+ grossTotal: grossTotal,
5817
+ };
6047
5818
  },
6048
- updateCart: function (state, action) {
6049
- var options = action.payload.options;
6050
- return __assign(__assign({}, state), { addedItems: state.addedItems.map(function (item) {
6051
- return item && __assign(__assign({}, item), { options: options });
6052
- }) });
5819
+ updateCart: (state, action) => {
5820
+ const { options } = action.payload;
5821
+ return {
5822
+ ...state,
5823
+ addedItems: state.addedItems.map((item) => item && {
5824
+ ...item,
5825
+ options: options,
5826
+ }),
5827
+ };
6053
5828
  },
6054
- removeFromCart: function (state, action) {
6055
- var _a = action.payload, id = _a.id, price = _a.price;
6056
- var newTotal = state.netTotal - price;
6057
- var taxAmount = newTotal * (state.taxRate.percentage / 100);
6058
- var grossTotal = newTotal + taxAmount;
6059
- return __assign(__assign({}, state), { addedItems: state.addedItems.filter(function (item) { return item && item.uuid !== id; }), netTotal: newTotal, grossTotal: grossTotal });
5829
+ removeFromCart: (state, action) => {
5830
+ const { id, price } = action.payload;
5831
+ const newTotal = state.netTotal - price;
5832
+ const taxAmount = newTotal * (state.taxRate.percentage / 100);
5833
+ const grossTotal = newTotal + taxAmount;
5834
+ return {
5835
+ ...state,
5836
+ addedItems: state.addedItems.filter((item) => item && item.uuid !== id),
5837
+ netTotal: newTotal,
5838
+ grossTotal: grossTotal,
5839
+ };
6060
5840
  },
6061
- toggleCart: function (state, action) {
6062
- return __assign(__assign({}, state), { open: action.payload });
5841
+ toggleCart: (state, action) => {
5842
+ return {
5843
+ ...state,
5844
+ open: action.payload,
5845
+ };
6063
5846
  },
6064
- emptyCart: function () { return initialState; },
5847
+ emptyCart: () => initialState,
6065
5848
  },
6066
5849
  selectors: {
6067
- selectMediaInCart: function (cart) { return cart.addedItems; },
6068
- selectCartTotal: function (cart) { return cart.grossTotal; },
6069
- selectCartNetTotal: function (cart) { return cart.netTotal; },
6070
- selectCartTaxRate: function (cart) { return cart.taxRate; },
6071
- selectCartTaxAmount: function (cart) { return cart.taxAmount; },
6072
- selectCartCount: function (cart) { return cart.addedItems.length; },
6073
- selectCartStatus: function (cart) { return cart.open; },
6074
- selectPromoCode: function (cart) { return cart.promoCode; },
5850
+ selectMediaInCart: (cart) => cart.addedItems,
5851
+ selectCartTotal: (cart) => cart.grossTotal,
5852
+ selectCartNetTotal: (cart) => cart.netTotal,
5853
+ selectCartTaxRate: (cart) => cart.taxRate,
5854
+ selectCartTaxAmount: (cart) => cart.taxAmount,
5855
+ selectCartCount: (cart) => cart.addedItems.length,
5856
+ selectCartStatus: (cart) => cart.open,
5857
+ selectPromoCode: (cart) => cart.promoCode,
6075
5858
  },
6076
5859
  });
6077
- var setTaxRate = (_a = cartSlice.actions, _a.setTaxRate), resetTaxRate = _a.resetTaxRate, setPromoCode = _a.setPromoCode, removePromoCode = _a.removePromoCode, addToCart = _a.addToCart, updateCart = _a.updateCart, removeFromCart = _a.removeFromCart, emptyCart = _a.emptyCart, toggleCart = _a.toggleCart;
6078
- var selectMediaInCart = (_b = cartSlice.selectors, _b.selectMediaInCart), selectCartTotal = _b.selectCartTotal, selectCartNetTotal = _b.selectCartNetTotal, selectCartTaxRate = _b.selectCartTaxRate, selectCartTaxAmount = _b.selectCartTaxAmount, selectCartCount = _b.selectCartCount, selectCartStatus = _b.selectCartStatus, selectPromoCode = _b.selectPromoCode;
6079
- var selectCartItems = createSelector$1([selectMediaInCart], function (items) {
6080
- return items.map(function (item) {
5860
+ const { setTaxRate, resetTaxRate, setPromoCode, removePromoCode, addToCart, updateCart, removeFromCart, emptyCart, toggleCart, } = cartSlice.actions;
5861
+ const { selectMediaInCart, selectCartTotal, selectCartNetTotal, selectCartTaxRate, selectCartTaxAmount, selectCartCount, selectCartStatus, selectPromoCode, } = cartSlice.selectors;
5862
+ const selectCartItems = createSelector$1([selectMediaInCart], (items) => {
5863
+ return items.map((item) => {
6081
5864
  return {
6082
5865
  title: item.title || item.generatedTitle,
6083
- file: "".concat(item.sku, ".mp4"),
5866
+ file: `${item.sku}.mp4`,
6084
5867
  options: item.options,
6085
5868
  script: item.script,
6086
5869
  };
6087
5870
  });
6088
5871
  });
6089
- var selectCartItemsIds = createSelector$1([selectMediaInCart], function (items) {
6090
- return items.map(function (item) { return item.uuid; });
5872
+ const selectCartItemsIds = createSelector$1([selectMediaInCart], (items) => {
5873
+ return items.map((item) => item.uuid);
6091
5874
  });
6092
5875
  cartSlice.reducer;
6093
5876
 
6094
- var useLoggedIn = function () {
6095
- var isLoggedIn = useSelector(isAuthenticated);
6096
- return useMemo(function () { return isLoggedIn; }, [isLoggedIn]);
6097
- };
6098
-
6099
- // This file serves as a central hub for re-exporting pre-typed Redux hooks.
6100
- // Use throughout your app instead of plain `useDispatch` and `useSelector`
6101
- var useAppDispatch = isWeb ? useDispatch.withTypes() : useDispatch.withTypes();
6102
- var useAppSelector = isWeb ? useSelector.withTypes() : useSelector.withTypes();
6103
- var useAppStore = isWeb ? useStore.withTypes() : useStore.withTypes();
6104
-
6105
- const Config = NativeModules.RNCConfigModule || {};
6106
-
6107
- var index = /*#__PURE__*/Object.freeze({
6108
- __proto__: null,
6109
- Config: Config,
6110
- default: Config
6111
- });
6112
-
6113
- export { addToCart, authApi, authSlice, cartSlice, contentApi, emptyCart, formatAuthSession, formatChallengeDays, formatChallenges, formatConfig, formatFaqs, formatFedaratedSession, formatGuests, formatLongform, formatMediaItem, formatPages, formatPress, formatPromos, formatSchedule, formatSeasons, formatSecondsToISO8601Duration, formatSectionItems, formatSectionPanels, formatSections, formatSeries, formatSettings, formatShortform, formatSocialAuthSession, formatTaxonomies, formatUserPayload, formatVideos, formatWorkout, getUserSession, isAuthenticated, isVerifying, logout, ordersApi, paymentApi, removeFromCart, removePromoCode, resetCreating, resetTaxRate, selectAccessToken, selectCartCount, selectCartItems, selectCartItemsIds, selectCartNetTotal, selectCartStatus, selectCartTaxAmount, selectCartTaxRate, selectCartTotal, selectCurrentUser, selectCurrentUserRefreshToken, selectCurrentUserSub, selectMediaInCart, selectPromoCode, selectRefreshToken, selectSubscription, selectSubscriptionPrice, selectUserSubscriptionStatus, selectUserTokens, setCredentials, setPromoCode, setTaxRate, toggleCart, updateCart, updateSubscription, useAppDispatch, useAppSelector, useAppStore, useForgottenPasswordMutation, useGetUserInfoQuery, useLazyGetUserInfoQuery, useLazyVerifyUserAttributesQuery, useLazyVerifyUserQuery, useLazyVerifyUserResendQuery, useLoggedIn, useRegisterMutation, useResetPasswordAuthMutation, useResetPasswordMutation, useUpdateUserInfoMutation, useUpdateUserMutation, useVerifyUserAttributesQuery, useVerifyUserQuery, useVerifyUserResendQuery };
6114
- //# sourceMappingURL=index.esm.js.map
5877
+ export { formatAuthSession as $, emptyCart as A, toggleCart as B, selectMediaInCart as C, selectCartTotal as D, selectCartNetTotal as E, selectCartTaxRate as F, selectCartTaxAmount as G, selectCartCount as H, selectCartStatus as I, selectPromoCode as J, selectCartItems as K, selectCartItemsIds as L, formatUserPayload as M, formatPromos as N, formatWorkout as O, formatShortform as P, formatFaqs as Q, formatPages as R, formatSettings as S, formatPress as T, formatGuests as U, formatVideos as V, formatSections as W, formatSchedule as X, formatChallenges as Y, formatChallengeDays as Z, formatSecondsToISO8601Duration as _, authApi as a, formatFedaratedSession as a0, formatSocialAuthSession as a1, formatConfig as a2, formatSectionPanels as a3, formatSectionItems as a4, formatTaxonomies as a5, formatSeries as a6, formatSeasons as a7, formatLongform as a8, formatMediaItem as a9, useResetPasswordAuthMutation as b, contentApi as c, useRegisterMutation as d, useVerifyUserQuery as e, useLazyVerifyUserQuery as f, useGetUserInfoQuery as g, useLazyGetUserInfoQuery as h, useUpdateUserInfoMutation as i, useForgottenPasswordMutation as j, useVerifyUserAttributesQuery as k, useLazyVerifyUserAttributesQuery as l, useVerifyUserResendQuery as m, useLazyVerifyUserResendQuery as n, ordersApi as o, paymentApi as p, useUpdateUserMutation as q, cartSlice as r, setTaxRate as s, resetTaxRate as t, useResetPasswordMutation as u, setPromoCode as v, removePromoCode as w, addToCart as x, updateCart as y, removeFromCart as z };
5878
+ //# sourceMappingURL=slice-3o-PH5Gz.js.map