@cuemath/leap 2.8.61-rj-23 → 2.8.61-rj-XX

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.
@@ -1,60 +1,72 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as v, useRef as S, useCallback as i, useMemo as T, useImperativeHandle as x } from "react";
3
- import { LOTTIE as z } from "../../../assets/lottie/lottie.js";
4
- import { CircularLoader as D } from "../../ui/loader/circular-loader/circular-loader.js";
5
- import O from "../../ui/lottie-animation/lottie-animation.js";
6
- import { useCircleSounds as K } from "../hooks/use-circle-sounds/use-circle-sounds.js";
7
- import { CircleSoundKey as n } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
8
- import { GAME_LAUNCHER_SIZE as B } from "./comps/card-container/constants.js";
9
- import { Carousel as _ } from "./comps/carousel/carousel.js";
10
- import { GAME_LAUNCHER_ASSET_PADDING as H } from "./comps/segmented-game-card/constants.js";
11
- import { SegmentedGameCard as f } from "./comps/segmented-game-card/segmented-game-card.js";
12
- import { TablesCard as J } from "./comps/tables-card/tables-card.js";
13
- import { GAME_LAUNCHER_ANALYTICS_EVENTS as P } from "./game-launcher-analytics-events.js";
14
- import { useGameLauncherJourney as U } from "./hooks/use-game-launcher-journey/use-game-launcher-journey.js";
15
- import { useTableLauncherJourney as Y } from "./hooks/use-table-launcher-journey/use-table-launcher-journey.js";
16
- import { ProjectType as m } from "../games/web-view/enums/project-type-enum.js";
17
- const h = B + H, oe = v(
18
- ({ onSegmentClick: r, isError: R, data: e, isLoading: I, defaultIndex: g = 0 }, G) => {
19
- const o = S(null), { playSwipSound: p, play: a } = K(), u = i(
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { memo as g, useRef as x, useCallback as m, useMemo as z, useEffect as D } from "react";
3
+ import { LOTTIE as U } from "../../../assets/lottie/lottie.js";
4
+ import { JOURNEY_ID_STUDENT as G } from "../../journey/journey-id/journey-id-student.js";
5
+ import { useJourney as Y } from "../../journey/use-journey/use-journey.js";
6
+ import { CircularLoader as B } from "../../ui/loader/circular-loader/circular-loader.js";
7
+ import K from "../../ui/lottie-animation/lottie-animation.js";
8
+ import { useCircleSounds as H } from "../hooks/use-circle-sounds/use-circle-sounds.js";
9
+ import { CircleSoundKey as t } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
10
+ import { GAME_LAUNCHER_SIZE as Z } from "./comps/card-container/constants.js";
11
+ import { Carousel as V } from "./comps/carousel/carousel.js";
12
+ import { GAME_LAUNCHER_ASSET_PADDING as w } from "./comps/segmented-game-card/constants.js";
13
+ import { SegmentedGameCard as E } from "./comps/segmented-game-card/segmented-game-card.js";
14
+ import { TablesCard as X } from "./comps/tables-card/tables-card.js";
15
+ import { GAME_LAUNCHER_ANALYTICS_EVENTS as S } from "./game-launcher-analytics-events.js";
16
+ import { useGameLauncherJourney as j } from "./hooks/use-game-launcher-journey/use-game-launcher-journey.js";
17
+ import { useTableLauncherJourney as q } from "./hooks/use-table-launcher-journey/use-table-launcher-journey.js";
18
+ import { ProjectType as n } from "../games/web-view/enums/project-type-enum.js";
19
+ const M = Z + w, ce = g(
20
+ ({
21
+ onSegmentClick: r,
22
+ journeyId: u,
23
+ data: e,
24
+ isLoading: f,
25
+ isTutorialOnboardingDone: a,
26
+ defaultIndex: J = 0,
27
+ onJourneyComplete: C
28
+ }) => {
29
+ const p = x(null), { isJourneyActive: L } = Y(), { playSwipSound: _, play: o } = H(), c = m(
20
30
  (l) => {
21
- a(n.GAME_CARD_CLICK), r(l, m.TABLE);
31
+ o(t.GAME_CARD_CLICK), r(l, n.TABLE);
22
32
  },
23
- [r, a]
24
- ), c = i(
33
+ [r, o]
34
+ ), A = m(
25
35
  (l) => {
26
- l.status !== "completed" && (a(n.GAME_CARD_CLICK), r(l, m.LESSON));
36
+ l.status !== "completed" && (o(t.GAME_CARD_CLICK), r(l, n.LESSON));
27
37
  },
28
- [r, a]
29
- ), L = i(
38
+ [r, o]
39
+ ), b = m(
30
40
  (l) => {
31
- a(n.GAME_CARD_CLICK), r(l, m.GAME);
41
+ o(t.GAME_CARD_CLICK), r(l, n.GAME);
32
42
  },
33
- [r, a]
34
- ), b = i(
43
+ [r, o]
44
+ ), T = m(
35
45
  (l) => {
36
- a(n.GAME_CARD_CLICK), r(l, m.PUZZLE);
46
+ o(t.GAME_CARD_CLICK), r(l, n.PUZZLE);
37
47
  },
38
- [r, a]
48
+ [r, o]
39
49
  ), {
40
- gameRefs: A,
41
- lessonRefs: C,
42
- puzzleRefs: E,
43
- startJourney: V
44
- } = U({
45
- carouselRefs: o,
46
- onSegmentClick: r
47
- }), { startJourney: d, tableRef: y } = Y({
48
- carouselRefs: o,
49
- onTableSegmentClick: u
50
- }), M = T(() => {
50
+ gameRefs: y,
51
+ lessonRefs: R,
52
+ puzzleRefs: I,
53
+ startJourney: P
54
+ } = j({
55
+ carouselRefs: p,
56
+ onSegmentClick: r,
57
+ onJourneyComplete: C
58
+ }), { startJourney: N, tableRef: h } = q({
59
+ carouselRefs: p,
60
+ onTableSegmentClick: c,
61
+ onJourneyComplete: C
62
+ }), v = z(() => {
51
63
  let l = [];
52
64
  return e && (e.lessons && (l = [
53
65
  ...l,
54
- /* @__PURE__ */ t(
55
- f,
66
+ /* @__PURE__ */ i(
67
+ E,
56
68
  {
57
- ref: C,
69
+ ref: R,
58
70
  label: e.lessons.label,
59
71
  value: e.lessons.data.filter((s) => s.status === "completed").length,
60
72
  maxValue: e.lessons.data.length,
@@ -63,16 +75,16 @@ const h = B + H, oe = v(
63
75
  card: s.cardLottie,
64
76
  name: s.name,
65
77
  isCompleted: s.status === "completed",
66
- onPress: () => c(s)
78
+ onPress: () => A(s)
67
79
  }))
68
80
  }
69
81
  )
70
82
  ]), l = [
71
83
  ...l,
72
- /* @__PURE__ */ t(
73
- f,
84
+ /* @__PURE__ */ i(
85
+ E,
74
86
  {
75
- ref: A,
87
+ ref: y,
76
88
  label: e.games.label,
77
89
  value: e.games.data.filter((s) => s.isPlayed).length,
78
90
  maxValue: e.games.data.length,
@@ -81,14 +93,14 @@ const h = B + H, oe = v(
81
93
  card: s.cardLottie,
82
94
  name: s.name,
83
95
  isCompleted: !1,
84
- onPress: () => L(s)
96
+ onPress: () => b(s)
85
97
  }))
86
98
  }
87
99
  ),
88
- /* @__PURE__ */ t(
89
- f,
100
+ /* @__PURE__ */ i(
101
+ E,
90
102
  {
91
- ref: E,
103
+ ref: I,
92
104
  label: e.puzzles.label,
93
105
  value: e.puzzles.data.filter((s) => s.solved).length,
94
106
  maxValue: e.puzzles.data.length,
@@ -97,84 +109,92 @@ const h = B + H, oe = v(
97
109
  card: s.cardLottie,
98
110
  name: s.name,
99
111
  isCompleted: s.solved,
100
- onPress: () => b(s)
112
+ onPress: () => T(s)
101
113
  }))
102
114
  }
103
115
  )
104
116
  ], e.tables && (l = [
105
117
  ...l,
106
- /* @__PURE__ */ t(
107
- J,
118
+ /* @__PURE__ */ i(
119
+ X,
108
120
  {
109
- ref: y,
121
+ ref: h,
110
122
  label: e.tables.label,
111
123
  data: e.tables.data,
112
- onPress: u,
124
+ onPress: c,
113
125
  openModesOfTable: e.tables.openModesOfTable
114
126
  }
115
127
  )
116
128
  ])), l;
117
129
  }, [
118
130
  e,
131
+ y,
132
+ I,
133
+ R,
119
134
  A,
120
- E,
121
- C,
122
- c,
123
- L,
124
135
  b,
125
- y,
126
- u
127
- ]), N = T(
136
+ T,
137
+ h,
138
+ c
139
+ ]), O = z(
128
140
  () => [
129
- /* @__PURE__ */ t(
130
- O,
141
+ /* @__PURE__ */ i(
142
+ K,
131
143
  {
132
- src: z.SLEEPY_BOI,
133
- width: h,
134
- height: h
144
+ src: U.SLEEPY_BOI,
145
+ width: M,
146
+ height: M
135
147
  }
136
148
  )
137
149
  ],
138
150
  []
139
151
  );
140
- return x(
141
- G,
142
- () => ({
143
- startActivityOnboarding: V,
144
- startTablesOnboarding: d,
145
- gameLauncherRef: o
146
- }),
147
- [d]
148
- ), I ? /* @__PURE__ */ t(D, {}) : R ? /* @__PURE__ */ t(
149
- _,
152
+ return D(() => {
153
+ if (!(f || !e || L)) {
154
+ if (e != null && e.puzzles && u === G.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {
155
+ P(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons));
156
+ return;
157
+ }
158
+ e != null && e.tables && u === G.CIRCLE_TABLES_INTRO_JOURNEY && N(e == null ? void 0 : e.tables, a);
159
+ }
160
+ }, [
161
+ e,
162
+ L,
163
+ f,
164
+ a,
165
+ u,
166
+ P,
167
+ N
168
+ ]), f ? /* @__PURE__ */ i(B, {}) : e ? /* @__PURE__ */ i(
169
+ V,
150
170
  {
151
- items: N,
171
+ ref: p,
172
+ items: v,
173
+ defaultIndex: J,
174
+ onNext: _,
175
+ onPrev: _,
152
176
  analyticsNext: {
153
- analyticsLabel: ""
177
+ analyticsLabel: S.NEXT_ACTIVITY
154
178
  },
155
179
  analyticsPrev: {
156
- analyticsLabel: ""
180
+ analyticsLabel: S.PREV_ACTIVITY
157
181
  }
158
182
  }
159
- ) : /* @__PURE__ */ t(
160
- _,
183
+ ) : /* @__PURE__ */ i(
184
+ V,
161
185
  {
162
- ref: o,
163
- items: M,
164
- defaultIndex: g,
165
- onNext: p,
166
- onPrev: p,
186
+ items: O,
167
187
  analyticsNext: {
168
- analyticsLabel: P.NEXT_ACTIVITY
188
+ analyticsLabel: ""
169
189
  },
170
190
  analyticsPrev: {
171
- analyticsLabel: P.PREV_ACTIVITY
191
+ analyticsLabel: ""
172
192
  }
173
193
  }
174
194
  );
175
195
  }
176
196
  );
177
197
  export {
178
- oe as GameLauncher
198
+ ce as GameLauncher
179
199
  };
180
200
  //# sourceMappingURL=game-launcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport type { ICarouselRefs } from './comps/carousel/carousel-types';\nimport type { ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps, IGameLauncherRef } from './game-launcher-types';\n\nimport { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher = forwardRef<IGameLauncherRef, IGameLauncherProps>(\n ({ onSegmentClick, isError, data, isLoading, defaultIndex = 0 }, ref) => {\n const carouselRefs = useRef<ICarouselRefs>(null);\n\n const { playSwipSound, play } = useCircleSounds();\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startActivityOnboarding,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n });\n\n const { startJourney: startTablesOnboarding, tableRef } = useTableLauncherJourney({\n carouselRefs,\n onTableSegmentClick,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n tableRef,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n startActivityOnboarding,\n startTablesOnboarding,\n gameLauncherRef: carouselRefs,\n }),\n [startTablesOnboarding],\n );\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (isError) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","forwardRef","onSegmentClick","isError","data","isLoading","defaultIndex","ref","carouselRefs","useRef","playSwipSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startActivityOnboarding","useGameLauncherJourney","startTablesOnboarding","tableRef","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useImperativeHandle","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAeC;AAAA,EAC1B,CAAC,EAAE,gBAAAC,GAAgB,SAAAC,GAAS,MAAAC,GAAM,WAAAC,GAAW,cAAAC,IAAe,EAAE,GAAGC,MAAQ;AACjE,UAAAC,IAAeC,EAAsB,IAAI,GAEzC,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAE1CC,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAJ,EAAKK,EAAe,eAAe,GACpBd,EAAAa,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAACf,GAAgBS,CAAI;AAAA,IAAA,GAGjBO,IAA2BJ;AAAA,MAC/B,CAACK,MAAmB;AACd,QAAAA,EAAO,WAAW,gBACpBR,EAAKK,EAAe,eAAe,GACpBd,EAAAiB,GAAQF,EAAY,MAAM;AAAA,MAE7C;AAAA,MACA,CAACf,GAAgBS,CAAI;AAAA,IAAA,GAGjBS,IAAyBN;AAAA,MAC7B,CAACO,MAAe;AACd,QAAAV,EAAKK,EAAe,eAAe,GACpBd,EAAAmB,GAAMJ,EAAY,IAAI;AAAA,MACvC;AAAA,MACA,CAACf,GAAgBS,CAAI;AAAA,IAAA,GAGjBW,IAA2BR;AAAA,MAC/B,CAACS,MAAmB;AAClB,QAAAZ,EAAKK,EAAe,eAAe,GACpBd,EAAAqB,GAAQN,EAAY,MAAM;AAAA,MAC3C;AAAA,MACA,CAACf,GAAgBS,CAAI;AAAA,IAAA,GAGjB;AAAA,MACJ,UAAAa;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,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QACA,iBAAiBrB;AAAA,MAAA;AAAA,MAEnB,CAACqB,CAAqB;AAAA,IAAA,GAGpBxB,sBACMqC,GAAe,CAAA,CAAA,IAGrBvC,IAEA,gBAAAgC;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,OAAOL;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA,IAMJ,gBAAAH;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,KAAKnC;AAAA,QACL,OAAAwB;AAAA,QACA,cAAA1B;AAAA,QACA,QAAQI;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBkC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ICarouselRefs } from './comps/carousel/carousel-types';\nimport type { ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null);\n\n const { isJourneyActive } = useJourney();\n\n const { playSwipSound, play } = useCircleSounds();\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const { startJourney: startTablesJourney, tableRef } = useTableLauncherJourney({\n carouselRefs,\n onTableSegmentClick,\n onJourneyComplete,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n tableRef,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n startLessonPuzzleGamesJourney(data?.puzzles, !!data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isTutorialOnboardingDone","defaultIndex","onJourneyComplete","carouselRefs","useRef","isJourneyActive","useJourney","playSwipSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startTablesJourney","tableRef","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAsB,IAAI,GAEzC,EAAE,iBAAAC,MAAoBC,KAEtB,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAE1CC,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAJ,EAAKK,EAAe,eAAe,GACpBjB,EAAAgB,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAAClB,GAAgBY,CAAI;AAAA,IAAA,GAGjBO,IAA2BJ;AAAA,MAC/B,CAACK,MAAmB;AACd,QAAAA,EAAO,WAAW,gBACpBR,EAAKK,EAAe,eAAe,GACpBjB,EAAAoB,GAAQF,EAAY,MAAM;AAAA,MAE7C;AAAA,MACA,CAAClB,GAAgBY,CAAI;AAAA,IAAA,GAGjBS,IAAyBN;AAAA,MAC7B,CAACO,MAAe;AACd,QAAAV,EAAKK,EAAe,eAAe,GACpBjB,EAAAsB,GAAMJ,EAAY,IAAI;AAAA,MACvC;AAAA,MACA,CAAClB,GAAgBY,CAAI;AAAA,IAAA,GAGjBW,IAA2BR;AAAA,MAC/B,CAACS,MAAmB;AAClB,QAAAZ,EAAKK,EA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AA;AAAA,YACC,KAAKC,EAAO;AAAA,YACZ,OAAO9C;AAAA,YACP,QAAQA;AAAA,UAAA;AAAA,QACV;AAAA,MACF;AAAA,MACA,CAAC;AAAA,IAAA;AA4BH,WAxBA+C,EAAU,MAAM;AACV,UAAA,EAAAvC,KAAa,CAACD,KAAQO,IAI1B;AAAA,YAAIP,KAAA,QAAAA,EAAM,WAAWD,MAAc0C,EAAmB,iCAAiC;AACrF,UAAAf,EAA8B1B,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,QAAO;AAE5D;AAAA,QACF;AAEA,QAAIA,KAAA,QAAAA,EAAM,UAAUD,MAAc0C,EAAmB,+BAChCb,EAAA5B,KAAA,gBAAAA,EAAM,QAAQE,CAAwB;AAAA;AAAA,IAC3D,GACC;AAAA,MACDF;AAAA,MACAO;AAAA,MACAN;AAAA,MACAC;AAAA,MACAH;AAAA,MACA2B;AAAA,MACAE;AAAA,IAAA,CACD,GAEG3B,sBACMyC,GAAe,CAAA,CAAA,IAGpB1C,IAeH,gBAAAkC;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,KAAKtC;AAAA,QACL,OAAA0B;AAAA,QACA,cAAA5B;AAAA,QACA,QAAQM;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBmC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAxBA,gBAAAV;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,OAAON;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
@@ -1,79 +1,79 @@
1
- import { jsx as t, Fragment as y } from "react/jsx-runtime";
2
- import { useRef as T, useCallback as E, useMemo as le, useEffect as ce } from "react";
1
+ import { jsx as t, Fragment as O } from "react/jsx-runtime";
2
+ import { useRef as A, useCallback as T, useMemo as le, useEffect as ce } from "react";
3
3
  import z from "../../../../../assets/line-icons/icons/carat-right.js";
4
4
  import { PLATFORM_EVENTS_STUDENT as ee } from "../../../../analytics-events/platform-events-student.js";
5
5
  import { JOURNEY_ID_STUDENT as ae } from "../../../../journey/journey-id/journey-id-student.js";
6
6
  import { IndicatorType as c } from "../../../../journey/use-journey/constants.js";
7
7
  import { useJourney as de } from "../../../../journey/use-journey/use-journey.js";
8
8
  import te from "../../../../ui/buttons/icon-button/icon-button.js";
9
- import { useUIContext as se } from "../../../../ui/context/context.js";
9
+ import { useUIContext as he } from "../../../../ui/context/context.js";
10
10
  import L from "../../../../ui/layout/flex-view.js";
11
11
  import a from "../../../../ui/text/text.js";
12
- import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as p } from "../../../enum/circle-onboarding-steps.js";
13
- import { useCircleSounds as ue } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
- import { SegmentedGameCard as he } from "../../comps/segmented-game-card/segmented-game-card.js";
12
+ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as E } from "../../../enum/circle-onboarding-steps.js";
13
+ import { useCircleSounds as se } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
+ import { SegmentedGameCard as me } from "../../comps/segmented-game-card/segmented-game-card.js";
15
15
  import { GAME_LAUNCHER_ANALYTICS_EVENTS as re } from "../../game-launcher-analytics-events.js";
16
- import { GO_TO_NEXT_SLIDE_AFTER_MS as me, SHOW_LABEL_HIGHLIGHT_AFTER_MS as ge, SHOW_NUDGE_AFTER_MS as Te, SLIDE_TO_LESSON_MS as Ee } from "./constants.js";
16
+ import { GO_TO_NEXT_SLIDE_AFTER_MS as ue, SHOW_LABEL_HIGHLIGHT_AFTER_MS as ge, SHOW_NUDGE_AFTER_MS as Te, SLIDE_TO_LESSON_MS as Ee } from "./constants.js";
17
17
  import { ProjectType as pe } from "../../../games/web-view/enums/project-type-enum.js";
18
18
  const ke = ({
19
19
  carouselRefs: n,
20
- onSegmentClick: R
20
+ onSegmentClick: R,
21
+ onJourneyComplete: y
21
22
  }) => {
22
- const i = ae.CIRCLE_ACTIVITIES_INTRO_JOURNEY, o = T(null), r = T(null), l = T(null), I = T([]), O = T(!1), { playButtonSound: S } = ue(), { nextCoachmark: d, setJourney: N, endJourney: b } = de(), { onEvent: _ } = se(), P = E(
23
+ const i = ae.CIRCLE_ACTIVITIES_INTRO_JOURNEY, o = A(null), r = A(null), l = A(null), p = A([]), { playButtonSound: S } = se(), { nextCoachmark: d, setJourney: N, endJourney: b } = de(), { onEvent: I } = he(), P = T(
23
24
  (e) => {
24
- _(ee.ONBOARDING_STEP_VIEWED, {
25
+ I(ee.ONBOARDING_STEP_VIEWED, {
25
26
  step: e
26
27
  });
27
28
  },
28
- [_]
29
- ), H = E(
29
+ [I]
30
+ ), H = T(
30
31
  (e) => {
31
- _(ee.ONBOARDING_STEP_COMPLETED, {
32
+ I(ee.ONBOARDING_STEP_COMPLETED, {
32
33
  step: e
33
34
  });
34
35
  },
35
- [_]
36
- ), s = E(
37
- (e, f, C, A = !1) => {
38
- var h, m;
39
- A || (S(), (m = n.current) == null || m.goToIndex(((h = n.current) == null ? void 0 : h.currentIndex) + 1), d(i, !1, me)), P(e);
40
- const u = setTimeout(() => {
41
- clearTimeout(u), f.startLabelAnimation(C);
36
+ [I]
37
+ ), h = T(
38
+ (e, _, C, f = !1) => {
39
+ var m, u;
40
+ f || (S(), (u = n.current) == null || u.goToIndex(((m = n.current) == null ? void 0 : m.currentIndex) + 1), d(i, !1, ue)), P(e);
41
+ const s = setTimeout(() => {
42
+ clearTimeout(s), _.startLabelAnimation(C);
42
43
  }, ge);
43
- I.current.push(u), d(i, !0, Te);
44
+ p.current.push(s), d(i, !0, Te);
44
45
  },
45
46
  [n, i, d, S, P]
46
- ), G = E(
47
+ ), G = T(
47
48
  (e) => {
48
- R(e, pe.PUZZLE), H(p.PUZZLE_ACTIVITY), b(i);
49
+ R(e, pe.PUZZLE), H(E.PUZZLE_ACTIVITY), b(i), y(i);
49
50
  },
50
- [b, i, R, H]
51
- ), U = E(
52
- (e, f) => {
53
- var k, w, v, B, V, x, D, J, M, W, X, $, F, Z, j, K, q, Q;
54
- if (O.current || !((k = n == null ? void 0 : n.current) != null && k.nextBtnRef.current) || !((w = r == null ? void 0 : r.current) != null && w.segmentedCardWrapperRef.current) || !((v = o == null ? void 0 : o.current) != null && v.labelRef.current) || !((B = r == null ? void 0 : r.current) != null && B.labelRef.current) || !e)
51
+ [b, i, y, R, H]
52
+ ), U = T(
53
+ (e, _) => {
54
+ var k, w, v, B, V, x, D, M, J, W, X, $, F, Z, j, K, q, Q;
55
+ if (!((k = n == null ? void 0 : n.current) != null && k.nextBtnRef.current) || !((w = r == null ? void 0 : r.current) != null && w.segmentedCardWrapperRef.current) || !((v = o == null ? void 0 : o.current) != null && v.labelRef.current) || !((B = r == null ? void 0 : r.current) != null && B.labelRef.current) || !e)
55
56
  return;
56
- O.current = !0;
57
57
  const C = ((D = (x = (V = l.current) == null ? void 0 : V.labelRef) == null ? void 0 : x.current) == null ? void 0 : D.getBoundingClientRect()) || {
58
58
  height: 0,
59
59
  width: 0
60
- }, A = ((W = (M = (J = o.current) == null ? void 0 : J.labelRef) == null ? void 0 : M.current) == null ? void 0 : W.getBoundingClientRect()) || {
60
+ }, f = ((W = (J = (M = o.current) == null ? void 0 : M.labelRef) == null ? void 0 : J.current) == null ? void 0 : W.getBoundingClientRect()) || {
61
61
  height: 0,
62
62
  width: 0
63
- }, u = ((F = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : F.getBoundingClientRect()) || {
63
+ }, s = ((F = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : F.getBoundingClientRect()) || {
64
64
  height: 0,
65
65
  width: 0
66
- }, h = ((K = (j = (Z = r.current) == null ? void 0 : Z.segmentedCardWrapperRef) == null ? void 0 : j.current) == null ? void 0 : K.getBoundingClientRect()) || {
66
+ }, m = ((K = (j = (Z = r.current) == null ? void 0 : Z.segmentedCardWrapperRef) == null ? void 0 : j.current) == null ? void 0 : K.getBoundingClientRect()) || {
67
67
  height: 0,
68
68
  width: 0
69
69
  };
70
- let m = [];
71
- f && l.current && (m = [
70
+ let u = [];
71
+ _ && l.current && (u = [
72
72
  {
73
73
  originalElementToHighlightRef: l.current.labelRef,
74
74
  isActive: !1,
75
75
  type: c.TOOLTIP,
76
- elementToHighlight: /* @__PURE__ */ t(y, {}),
76
+ elementToHighlight: /* @__PURE__ */ t(O, {}),
77
77
  indicator: {
78
78
  position: "right",
79
79
  backgroundColor: "BLUE_4",
@@ -92,8 +92,8 @@ const ke = ({
92
92
  {
93
93
  renderAs: "secondary",
94
94
  Icon: z,
95
- onClick: () => s(
96
- p.GAMES_ACTIVITY,
95
+ onClick: () => h(
96
+ E.GAMES_ACTIVITY,
97
97
  o.current,
98
98
  "ORANGE_4"
99
99
  ),
@@ -113,14 +113,14 @@ const ke = ({
113
113
  originalElementToHighlightRef: o.current.labelRef,
114
114
  isActive: !1,
115
115
  type: c.TOOLTIP,
116
- elementToHighlight: /* @__PURE__ */ t(y, {}),
116
+ elementToHighlight: /* @__PURE__ */ t(O, {}),
117
117
  indicator: {
118
118
  position: "right",
119
119
  backgroundColor: "ORANGE_4",
120
120
  width: 264,
121
121
  tooltipItem: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(a, { $renderAs: "ab2-bold", children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
122
- tooltipXCoOrdinates: A.width + 50,
123
- tooltipYCoOrdinates: A.height / 2
122
+ tooltipXCoOrdinates: f.width + 50,
123
+ tooltipYCoOrdinates: f.height / 2
124
124
  }
125
125
  },
126
126
  {
@@ -132,8 +132,8 @@ const ke = ({
132
132
  {
133
133
  renderAs: "secondary",
134
134
  Icon: z,
135
- onClick: () => s(
136
- p.PUZZLE_ACTIVITY,
135
+ onClick: () => h(
136
+ E.PUZZLE_ACTIVITY,
137
137
  r.current,
138
138
  "PURPLE_4"
139
139
  ),
@@ -152,14 +152,14 @@ const ke = ({
152
152
  originalElementToHighlightRef: r.current.labelRef,
153
153
  isActive: !1,
154
154
  type: c.TOOLTIP,
155
- elementToHighlight: /* @__PURE__ */ t(y, {}),
155
+ elementToHighlight: /* @__PURE__ */ t(O, {}),
156
156
  indicator: {
157
157
  position: "right",
158
158
  backgroundColor: "PURPLE_4",
159
159
  width: 264,
160
160
  tooltipItem: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(a, { $renderAs: "ab2-bold", children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
161
- tooltipXCoOrdinates: u.width + 50,
162
- tooltipYCoOrdinates: u.height / 2
161
+ tooltipXCoOrdinates: s.width + 50,
162
+ tooltipYCoOrdinates: s.height / 2
163
163
  }
164
164
  },
165
165
  {
@@ -167,7 +167,7 @@ const ke = ({
167
167
  isActive: !1,
168
168
  type: c.NUDGE,
169
169
  elementToHighlight: /* @__PURE__ */ t(
170
- he,
170
+ me,
171
171
  {
172
172
  label: "",
173
173
  value: e.data.filter((g) => g.solved).length,
@@ -185,18 +185,18 @@ const ke = ({
185
185
  indicator: {
186
186
  nudge: "click",
187
187
  content: /* @__PURE__ */ t(a, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
188
- nudgePointerX: h.width * 0.6,
189
- nudgePointerY: h.height * 0.4
188
+ nudgePointerX: m.width * 0.6,
189
+ nudgePointerY: m.height * 0.4
190
190
  }
191
191
  }
192
192
  ];
193
- N(i, [...m, ...ie, ...oe]), (Q = n.current) == null || Q.goToIndex(0);
193
+ N(i, [...u, ...ie, ...oe]), (Q = n.current) == null || Q.goToIndex(0);
194
194
  const Y = setTimeout(() => {
195
195
  clearTimeout(Y), d(i);
196
196
  }, Ee);
197
- I.current.push(Y), f && l.current ? s(p.SKILL_ACTIVITY, l.current, "BLUE_4", !0) : s(p.GAMES_ACTIVITY, o.current, "ORANGE_4", !0);
197
+ p.current.push(Y), _ && l.current ? h(E.SKILL_ACTIVITY, l.current, "BLUE_4", !0) : h(E.GAMES_ACTIVITY, o.current, "ORANGE_4", !0);
198
198
  },
199
- [n, N, i, s, G, d]
199
+ [n, N, i, h, G, d]
200
200
  ), ne = le(
201
201
  () => ({
202
202
  gameRefs: o,
@@ -207,7 +207,7 @@ const ke = ({
207
207
  [U]
208
208
  );
209
209
  return ce(() => () => {
210
- I.current.forEach((e) => clearTimeout(e)), I.current = [], O.current = !1;
210
+ p.current.forEach((e) => clearTimeout(e)), p.current = [];
211
211
  }, [n]), ne;
212
212
  };
213
213
  export {