@cuemath/leap 3.2.17-j1 → 3.2.17-mb

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 (241) hide show
  1. package/dist/assets/illustrations/illustrations.js +0 -5
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/lottie/lottie.js +1 -11
  4. package/dist/assets/lottie/lottie.js.map +1 -1
  5. package/dist/features/auth/account-selector/account-selector.js +25 -26
  6. package/dist/features/auth/account-selector/account-selector.js.map +1 -1
  7. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +14 -20
  8. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  9. package/dist/features/auth/comps/resend-otp/resend-otp.js +47 -54
  10. package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
  11. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +17 -29
  12. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
  13. package/dist/features/auth/comps/tabs/tabs-styled.js +10 -22
  14. package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
  15. package/dist/features/auth/comps/tabs/tabs.js +5 -5
  16. package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
  17. package/dist/features/auth/comps/user-list/user-item/user-item.js +31 -30
  18. package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
  19. package/dist/features/auth/comps/user-list/user-list.js +34 -35
  20. package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
  21. package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -14
  22. package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
  23. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +7 -6
  24. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
  25. package/dist/features/auth/login/login-styled.js +9 -8
  26. package/dist/features/auth/login/login-styled.js.map +1 -1
  27. package/dist/features/chapters-v2/utils/node-card-utils.js +7 -7
  28. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  29. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
  30. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
  31. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
  32. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  33. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +98 -121
  34. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  35. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +28 -29
  36. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
  37. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +42 -43
  38. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  39. package/dist/features/circle-games/games/tutorial/tutorial.js +35 -43
  40. package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
  41. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
  42. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
  43. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
  44. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
  45. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +24 -26
  46. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
  47. package/dist/features/circle-games/sign-up/constants.js +1 -3
  48. package/dist/features/circle-games/sign-up/constants.js.map +1 -1
  49. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
  50. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
  51. package/dist/features/hooks/use-viewport/use-viewport.js +22 -0
  52. package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
  53. package/dist/features/journey/comps/coachmark/coachmark.js +27 -29
  54. package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
  55. package/dist/features/journey/journey-id/journey-id-student.js +2 -2
  56. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  57. package/dist/features/journey/use-journey/journey-context-provider.js +72 -73
  58. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  59. package/dist/features/journey/use-journey/journey-styled.js +4 -6
  60. package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
  61. package/dist/features/stickers/sticker-data.js +234 -0
  62. package/dist/features/stickers/sticker-data.js.map +1 -0
  63. package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +4 -3
  64. package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
  65. package/dist/features/stickers/sticker-selector/sticker-selector.js +25 -0
  66. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
  67. package/dist/features/stickers/sticker-selector/sticker.js +57 -0
  68. package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
  69. package/dist/features/{ui/stickers/stickers-effects.js → stickers/stickers-effects/effects.js} +6 -6
  70. package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
  71. package/dist/features/{ui/stickers/stickers-styled.js → stickers/stickers-effects/stickers-effects-styled.js} +2 -2
  72. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
  73. package/dist/features/{ui/stickers/stickers-utils.js → stickers/stickers-effects/stickers-effects-utils.js} +6 -6
  74. package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +1 -0
  75. package/dist/features/stickers/stickers-effects/stickers-effects.js +39 -0
  76. package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
  77. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
  78. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
  79. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
  80. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
  81. package/dist/features/ui/error/error.js +27 -65
  82. package/dist/features/ui/error/error.js.map +1 -1
  83. package/dist/features/ui/image/image.js +1 -1
  84. package/dist/features/ui/image/image.js.map +1 -1
  85. package/dist/features/ui/lottie-animation/lottie-animation.js +29 -25
  86. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  87. package/dist/features/ui/modals/modal-styled.js +58 -34
  88. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  89. package/dist/features/ui/modals/modal.js +14 -40
  90. package/dist/features/ui/modals/modal.js.map +1 -1
  91. package/dist/features/ui/nudge/nudge-styled.js +7 -14
  92. package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
  93. package/dist/features/ui/nudge/nudge.js +12 -13
  94. package/dist/features/ui/nudge/nudge.js.map +1 -1
  95. package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
  96. package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
  97. package/dist/features/ui/streak-icon/streak-icon.js +15 -17
  98. package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
  99. package/dist/features/ui/text/text.js +36 -40
  100. package/dist/features/ui/text/text.js.map +1 -1
  101. package/dist/features/ui/theme/button.js +78 -78
  102. package/dist/features/ui/theme/button.js.map +1 -1
  103. package/dist/features/ui/theme/constants.js +2 -4
  104. package/dist/features/ui/theme/constants.js.map +1 -1
  105. package/dist/features/ui/theme/get-device.js +3 -3
  106. package/dist/features/ui/theme/get-device.js.map +1 -1
  107. package/dist/features/worksheet/worksheet/constants.js +13 -12
  108. package/dist/features/worksheet/worksheet/constants.js.map +1 -1
  109. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +24 -24
  110. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  111. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +260 -246
  112. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  113. package/dist/features/worksheet/worksheet/worksheet-styled.js +28 -37
  114. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  115. package/dist/features/worksheet/worksheet/worksheet.js +164 -166
  116. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  117. package/dist/index.d.ts +55 -184
  118. package/dist/index.js +541 -579
  119. package/dist/index.js.map +1 -1
  120. package/dist/node_modules/query-string/base.js +1 -1
  121. package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
  122. package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
  123. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
  124. package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
  125. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  126. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
  127. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  128. package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
  129. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  130. package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
  131. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
  132. package/dist/static/nudge-tap.5cb30093.json +1057 -0
  133. package/package.json +1 -1
  134. package/dist/assets/line-icons/icons/after-noon.js +0 -34
  135. package/dist/assets/line-icons/icons/after-noon.js.map +0 -1
  136. package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
  137. package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
  138. package/dist/assets/line-icons/icons/cue-board-filled.js +0 -33
  139. package/dist/assets/line-icons/icons/cue-board-filled.js.map +0 -1
  140. package/dist/assets/line-icons/icons/cue-board.js +0 -23
  141. package/dist/assets/line-icons/icons/cue-board.js.map +0 -1
  142. package/dist/assets/line-icons/icons/evening.js +0 -35
  143. package/dist/assets/line-icons/icons/evening.js.map +0 -1
  144. package/dist/assets/line-icons/icons/hint-fill.js +0 -35
  145. package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
  146. package/dist/assets/line-icons/icons/morning.js +0 -35
  147. package/dist/assets/line-icons/icons/morning.js.map +0 -1
  148. package/dist/assets/line-icons/icons/screen-grab-filled.js +0 -35
  149. package/dist/assets/line-icons/icons/screen-grab-filled.js.map +0 -1
  150. package/dist/assets/line-icons/icons/screen-grab.js +0 -23
  151. package/dist/assets/line-icons/icons/screen-grab.js.map +0 -1
  152. package/dist/assets/line-icons/icons/sticker-filled.js +0 -64
  153. package/dist/assets/line-icons/icons/sticker-filled.js.map +0 -1
  154. package/dist/assets/line-icons/icons/sticker.js +0 -46
  155. package/dist/assets/line-icons/icons/sticker.js.map +0 -1
  156. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +0 -9
  157. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +0 -1
  158. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +0 -52
  159. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +0 -1
  160. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +0 -95
  161. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +0 -1
  162. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js +0 -10
  163. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js.map +0 -1
  164. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js +0 -17
  165. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js.map +0 -1
  166. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
  167. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
  168. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
  169. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
  170. package/dist/features/auth/comps/otp-input/otp-input-styled.js +0 -22
  171. package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +0 -1
  172. package/dist/features/auth/comps/otp-input/otp-input.js +0 -51
  173. package/dist/features/auth/comps/otp-input/otp-input.js.map +0 -1
  174. package/dist/features/auth/comps/pill-button/pill-button-styled.js +0 -44
  175. package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +0 -1
  176. package/dist/features/auth/comps/pill-button/pill-button.js +0 -75
  177. package/dist/features/auth/comps/pill-button/pill-button.js.map +0 -1
  178. package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +0 -17
  179. package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +0 -1
  180. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +0 -67
  181. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +0 -1
  182. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js +0 -19
  183. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js.map +0 -1
  184. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js +0 -32
  185. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js.map +0 -1
  186. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +0 -44
  187. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +0 -1
  188. package/dist/features/auth/pla-signup/signup-header/signup-header.js +0 -54
  189. package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +0 -1
  190. package/dist/features/auth/pla-signup/signup-options/signup-options.js +0 -83
  191. package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +0 -1
  192. package/dist/features/puzzles/app/puzzle-app-styled.js +0 -81
  193. package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
  194. package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
  195. package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
  196. package/dist/features/puzzles/app/puzzle-app.js +0 -62
  197. package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
  198. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
  199. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
  200. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
  201. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
  202. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
  203. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
  204. package/dist/features/ui/drawer/drawer-styled.js +0 -34
  205. package/dist/features/ui/drawer/drawer-styled.js.map +0 -1
  206. package/dist/features/ui/drawer/drawer.js +0 -42
  207. package/dist/features/ui/drawer/drawer.js.map +0 -1
  208. package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
  209. package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
  210. package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
  211. package/dist/features/ui/sticker-grid/sticker.js +0 -57
  212. package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
  213. package/dist/features/ui/stickers/constants.js +0 -6
  214. package/dist/features/ui/stickers/constants.js.map +0 -1
  215. package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
  216. package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
  217. package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
  218. package/dist/features/ui/stickers/stickers.js +0 -40
  219. package/dist/features/ui/stickers/stickers.js.map +0 -1
  220. package/dist/node_modules/decode-uri-component/index.js.map +0 -1
  221. package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
  222. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
  223. package/dist/static/animated-avatar.1ad58b1d.json +0 -1
  224. package/dist/static/animated-avatar.69b07505.json +0 -1
  225. package/dist/static/animated-avatar.9c560b46.json +0 -1
  226. package/dist/static/calendar-purple.1a840b41.svg +0 -1
  227. package/dist/static/flying-disk.c7f6ed39.json +0 -1
  228. package/dist/static/graduation-cap.3be3340a.json +0 -1
  229. package/dist/static/handshake.287e7dfb.svg +0 -1
  230. package/dist/static/light-bulb.c6db0b23.json +0 -1
  231. package/dist/static/money.332aacf1.svg +0 -1
  232. package/dist/static/muscle.9bcfb8a7.json +0 -1
  233. package/dist/static/nudge-tap.0591aef4.json +0 -1
  234. package/dist/static/parent-avatar.822c7b9b.svg +0 -1
  235. package/dist/static/pencil.23df9da0.json +0 -1
  236. package/dist/static/plus-sign.de6af957.json +0 -1
  237. package/dist/static/racing-car.2cbf864e.json +0 -1
  238. package/dist/static/rocket.0a3ccab0.json +0 -1
  239. package/dist/static/shovel.abeec04c.json +0 -1
  240. package/dist/static/trustpilot.bd3d79e1.svg +0 -1
  241. /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
@@ -1,106 +1,98 @@
1
- import { jsx as t, Fragment as B } from "react/jsx-runtime";
2
- import { useRef as U, useCallback as h, useMemo as _e, useEffect as Ie } from "react";
3
- import { useTheme as Ce } from "styled-components";
1
+ import { jsx as t, Fragment as G } from "react/jsx-runtime";
2
+ import { useRef as H, useCallback as m, useMemo as pe, useEffect as _e } from "react";
4
3
  import ae from "../../../../../assets/line-icons/icons/carat-right.js";
5
- import { PLATFORM_EVENTS_STUDENT as de } from "../../../../analytics-events/platform-events-student.js";
6
- import { JOURNEY_ID_STUDENT as Y } from "../../../../journey/journey-id/journey-id-student.js";
4
+ import { PLATFORM_EVENTS_STUDENT as ce } from "../../../../analytics-events/platform-events-student.js";
5
+ import { JOURNEY_ID_STUDENT as U } from "../../../../journey/journey-id/journey-id-student.js";
7
6
  import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
8
- import { useJourney as Ae } from "../../../../journey/use-journey/use-journey.js";
9
- import Te from "../../../../ui/buttons/icon-button/icon-button.js";
10
- import { useUIContext as fe } from "../../../../ui/context/context.js";
11
- import k from "../../../../ui/layout/flex-view.js";
7
+ import { useJourney as Ie } from "../../../../journey/use-journey/use-journey.js";
8
+ import de from "../../../../ui/buttons/icon-button/icon-button.js";
9
+ import { useUIContext as Ce } from "../../../../ui/context/context.js";
10
+ import B from "../../../../ui/layout/flex-view.js";
12
11
  import T from "../../../../ui/text/text.js";
13
- import { EDeviceType as Le } from "../../../../ui/theme/constants.js";
12
+ import { getTheme as fe } from "../../../../ui/theme/get-theme.js";
14
13
  import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as s } from "../../../enum/circle-onboarding-steps.js";
15
- import { useCircleSounds as Oe } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
16
- import { SegmentedGameCard as me } from "../../comps/segmented-game-card/segmented-game-card.js";
14
+ import { useCircleSounds as Ae } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
15
+ import { SegmentedGameCard as Te } from "../../comps/segmented-game-card/segmented-game-card.js";
17
16
  import { GAME_LAUNCHER_ANALYTICS_EVENTS as he } from "../../game-launcher-analytics-events.js";
18
- import { GO_TO_NEXT_SLIDE_AFTER_MS as Re, SHOW_LABEL_HIGHLIGHT_AFTER_MS as Ne, SHOW_NUDGE_AFTER_MS as se, SLIDE_TO_LESSON_MS as be } from "./constants.js";
19
- import { ProjectType as ge } from "../../../games/web-view/enums/project-type-enum.js";
20
- const Fe = ({
17
+ import { GO_TO_NEXT_SLIDE_AFTER_MS as Le, SHOW_LABEL_HIGHLIGHT_AFTER_MS as Re, SHOW_NUDGE_AFTER_MS as ge, SLIDE_TO_LESSON_MS as Oe } from "./constants.js";
18
+ import { ProjectType as me } from "../../../games/web-view/enums/project-type-enum.js";
19
+ const $e = ({
21
20
  carouselRefs: i,
22
- onSegmentClick: A,
23
- onJourneyComplete: f
21
+ onSegmentClick: f,
22
+ onJourneyComplete: A
24
23
  }) => {
25
- const { device: ue } = Ce(), g = ue < Le.TABLET, L = "ab3-bold", O = "ab2-bold", n = U(null), l = U(null), c = U(null), u = U([]), { playButtonSound: w } = Oe(), { nextCoachmark: m, setJourney: V, endJourney: R } = Ae(), { onEvent: N } = fe(), x = h(
24
+ const { device: se } = fe(), h = se === "mobile", L = h ? "ab3-bold" : "ab2-bold", n = H(null), l = H(null), a = H(null), u = H([]), { playButtonSound: k } = Ae(), { nextCoachmark: g, setJourney: Y, endJourney: R } = Ie(), { onEvent: O } = Ce(), w = m(
26
25
  (e) => {
27
- N(de.ONBOARDING_STEP_VIEWED, {
26
+ O(ce.ONBOARDING_STEP_VIEWED, {
28
27
  step: e
29
28
  });
30
29
  },
31
- [N]
32
- ), b = h(
30
+ [O]
31
+ ), N = m(
33
32
  (e) => {
34
- N(de.ONBOARDING_STEP_COMPLETED, {
33
+ O(ce.ONBOARDING_STEP_COMPLETED, {
35
34
  step: e
36
35
  });
37
36
  },
38
- [N]
39
- ), E = h(
40
- (e, r, a, S = !1, P) => {
37
+ [O]
38
+ ), E = m(
39
+ (e, r, c, S = !1, b) => {
41
40
  var _, I;
42
- S || (w(), (I = i.current) == null || I.goToIndex(((_ = i.current) == null ? void 0 : _.currentIndex) + 1), m(P, !1, Re)), x(e);
41
+ S || (k(), (I = i.current) == null || I.goToIndex(((_ = i.current) == null ? void 0 : _.currentIndex) + 1), g(b, !1, Le)), w(e);
43
42
  const p = setTimeout(() => {
44
- clearTimeout(p), r.startLabelAnimation(a);
45
- }, Ne);
46
- u.current.push(p), m(P, !0, se);
43
+ clearTimeout(p), r.startLabelAnimation(c);
44
+ }, Re);
45
+ u.current.push(p), g(b, !0, ge);
47
46
  },
48
- [i, m, w, x]
49
- ), v = h(
47
+ [i, g, k, w]
48
+ ), x = m(
50
49
  (e, r) => {
51
- A(e, ge.PUZZLE), b(s.PUZZLE_ACTIVITY), R(r), f(r);
50
+ f(e, me.PUZZLE), N(s.PUZZLE_ACTIVITY), R(r), A(r);
52
51
  },
53
- [R, f, A, b]
54
- ), y = h(
52
+ [R, A, f, N]
53
+ ), v = m(
55
54
  (e, r) => {
56
- A(e, ge.LESSON), b(s.SKILL_ACTIVITY), R(r), f(r);
55
+ f(e, me.LESSON), N(s.SKILL_ACTIVITY), R(r), A(r);
57
56
  },
58
- [R, f, A, b]
59
- ), M = h(
60
- (e, r, a) => {
61
- var D, J, W, X, F, Z, K, q, Q, z, j, ee, te, re, ne, ie, oe, le, ce;
62
- const S = !!a, P = !!r;
63
- if (!((D = n == null ? void 0 : n.current) != null && D.segmentedCardWrapperRef.current) || (!((J = i == null ? void 0 : i.current) != null && J.nextBtnRef.current) || !((W = l == null ? void 0 : l.current) != null && W.labelRef.current) || !((X = c == null ? void 0 : c.current) != null && X.labelRef.current) || !r) && e === Y.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
57
+ [R, A, f, N]
58
+ ), y = m(
59
+ (e, r, c) => {
60
+ var M, W, $, D, X, F, Z, K, q, Q, z, j, ee, te, re, ne, ie, oe, le;
61
+ const S = !!c, b = !!r;
62
+ if (!((M = n == null ? void 0 : n.current) != null && M.segmentedCardWrapperRef.current) || (!((W = i == null ? void 0 : i.current) != null && W.nextBtnRef.current) || !(($ = l == null ? void 0 : l.current) != null && $.labelRef.current) || !((D = a == null ? void 0 : a.current) != null && D.labelRef.current) || !r) && e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
64
63
  return;
65
- const p = ((K = (Z = (F = n.current) == null ? void 0 : F.labelRef) == null ? void 0 : Z.current) == null ? void 0 : K.getBoundingClientRect()) || {
64
+ const p = ((Z = (F = (X = n.current) == null ? void 0 : X.labelRef) == null ? void 0 : F.current) == null ? void 0 : Z.getBoundingClientRect()) || {
66
65
  height: 0,
67
66
  width: 0
68
- }, _ = ((z = (Q = (q = l.current) == null ? void 0 : q.labelRef) == null ? void 0 : Q.current) == null ? void 0 : z.getBoundingClientRect()) || {
67
+ }, _ = ((Q = (q = (K = l.current) == null ? void 0 : K.labelRef) == null ? void 0 : q.current) == null ? void 0 : Q.getBoundingClientRect()) || {
69
68
  height: 0,
70
69
  width: 0
71
- }, I = ((te = (ee = (j = c.current) == null ? void 0 : j.labelRef) == null ? void 0 : ee.current) == null ? void 0 : te.getBoundingClientRect()) || {
70
+ }, I = ((ee = (j = (z = a.current) == null ? void 0 : z.labelRef) == null ? void 0 : j.current) == null ? void 0 : ee.getBoundingClientRect()) || {
72
71
  height: 0,
73
72
  width: 0
74
- }, H = ((ie = (ne = (re = n.current) == null ? void 0 : re.segmentedCardWrapperRef) == null ? void 0 : ne.current) == null ? void 0 : ie.getBoundingClientRect()) || {
73
+ }, P = ((ne = (re = (te = n.current) == null ? void 0 : te.segmentedCardWrapperRef) == null ? void 0 : re.current) == null ? void 0 : ne.getBoundingClientRect()) || {
75
74
  height: 0,
76
75
  width: 0
77
76
  };
78
- let G = [];
79
- if (S && n.current && (G = [
77
+ let V = [];
78
+ if (S && n.current && (V = [
80
79
  {
81
80
  originalElementToHighlightRef: n.current.labelRef,
82
81
  type: d.TOOLTIP,
83
- elementToHighlight: /* @__PURE__ */ t(B, {}),
82
+ elementToHighlight: /* @__PURE__ */ t(G, {}),
84
83
  indicator: {
85
84
  position: "top",
86
85
  backgroundColor: "BLUE_4",
87
- tooltipItem: /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
88
- T,
89
- {
90
- $renderOnMobileAs: L,
91
- $renderAs: O,
92
- children: "Get faster & stay ahead in school. Practice 3 new skills everyday."
93
- }
94
- ) }),
86
+ tooltipItem: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, { $renderAs: L, children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
95
87
  tooltipXCoOrdinates: p.width / 2,
96
88
  tooltipYCoOrdinates: p.height + 10
97
89
  }
98
90
  },
99
- e === Y.CIRCLE_ACTIVITIES_INTRO_JOURNEY ? {
100
- originalElementToHighlightRef: (oe = i.current) == null ? void 0 : oe.nextBtnRef,
91
+ e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY ? {
92
+ originalElementToHighlightRef: (ie = i.current) == null ? void 0 : ie.nextBtnRef,
101
93
  type: d.NUDGE,
102
94
  elementToHighlight: /* @__PURE__ */ t(
103
- Te,
95
+ de,
104
96
  {
105
97
  renderAs: "secondary",
106
98
  Icon: ae,
@@ -116,7 +108,7 @@ const Fe = ({
116
108
  ),
117
109
  indicator: {
118
110
  nudge: "click",
119
- content: !g && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
111
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
120
112
  nudgePointerX: 0,
121
113
  nudgePointerY: 0
122
114
  }
@@ -124,45 +116,38 @@ const Fe = ({
124
116
  originalElementToHighlightRef: n.current.segmentedCardWrapperRef,
125
117
  type: d.NUDGE,
126
118
  elementToHighlight: /* @__PURE__ */ t(
127
- me,
119
+ Te,
128
120
  {
129
121
  label: "",
130
- value: a.data.filter((o) => o.status === "completed").length,
131
- maxValue: a.data.length,
132
- initialValue: a.initialProgressValue,
133
- data: a.data.map((o) => ({
122
+ value: c.data.filter((o) => o.status === "pending").length,
123
+ maxValue: c.data.length,
124
+ initialValue: c.initialProgressValue,
125
+ data: c.data.map((o) => ({
134
126
  card: o.cardLottie,
135
127
  name: "",
136
128
  // We dont want to show the name of the puzzle in onboarding
137
129
  isCompleted: o.status === "completed",
138
- onPress: () => y(o, e)
130
+ onPress: () => v(o, e)
139
131
  }))
140
132
  }
141
133
  ),
142
134
  indicator: {
143
135
  nudge: "click",
144
- content: !g && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Tap here to get started" }),
145
- nudgePointerX: H.width * 0.6,
146
- nudgePointerY: H.height * 0.4
136
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Tap here to get started" }),
137
+ nudgePointerX: P.width * 0.6,
138
+ nudgePointerY: P.height * 0.4
147
139
  }
148
140
  }
149
- ]), e === Y.CIRCLE_ACTIVITIES_INTRO_JOURNEY && l.current && c.current && P) {
141
+ ]), e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY && l.current && a.current && b) {
150
142
  const o = [
151
143
  {
152
144
  originalElementToHighlightRef: l.current.labelRef,
153
145
  type: d.TOOLTIP,
154
- elementToHighlight: /* @__PURE__ */ t(B, {}),
146
+ elementToHighlight: /* @__PURE__ */ t(G, {}),
155
147
  indicator: {
156
148
  position: "top",
157
149
  backgroundColor: "ORANGE_4",
158
- tooltipItem: /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
159
- T,
160
- {
161
- $renderOnMobileAs: L,
162
- $renderAs: O,
163
- children: "Train to think deeper & plan ahead. Play 3 new games everyday."
164
- }
165
- ) }),
150
+ tooltipItem: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, { $renderAs: L, children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
166
151
  tooltipXCoOrdinates: _.width / 2,
167
152
  tooltipYCoOrdinates: _.height + 10
168
153
  }
@@ -171,13 +156,13 @@ const Fe = ({
171
156
  originalElementToHighlightRef: i.current.nextBtnRef,
172
157
  type: d.NUDGE,
173
158
  elementToHighlight: /* @__PURE__ */ t(
174
- Te,
159
+ de,
175
160
  {
176
161
  renderAs: "secondary",
177
162
  Icon: ae,
178
163
  onClick: () => E(
179
164
  s.PUZZLE_ACTIVITY,
180
- c.current,
165
+ a.current,
181
166
  "PURPLE_4",
182
167
  !1,
183
168
  e
@@ -187,36 +172,29 @@ const Fe = ({
187
172
  ),
188
173
  indicator: {
189
174
  nudge: "click",
190
- content: !g && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
175
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
191
176
  nudgePointerX: 0,
192
177
  nudgePointerY: 0
193
178
  }
194
179
  }
195
- ], pe = [
180
+ ], Ee = [
196
181
  {
197
- originalElementToHighlightRef: c.current.labelRef,
182
+ originalElementToHighlightRef: a.current.labelRef,
198
183
  type: d.TOOLTIP,
199
- elementToHighlight: /* @__PURE__ */ t(B, {}),
184
+ elementToHighlight: /* @__PURE__ */ t(G, {}),
200
185
  indicator: {
201
186
  position: "top",
202
187
  backgroundColor: "PURPLE_4",
203
- tooltipItem: /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
204
- T,
205
- {
206
- $renderOnMobileAs: L,
207
- $renderAs: O,
208
- children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday."
209
- }
210
- ) }),
188
+ tooltipItem: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, { $renderAs: L, children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
211
189
  tooltipXCoOrdinates: I.width / 2,
212
190
  tooltipYCoOrdinates: I.height + 10
213
191
  }
214
192
  },
215
193
  {
216
- originalElementToHighlightRef: c.current.segmentedCardWrapperRef,
194
+ originalElementToHighlightRef: a.current.segmentedCardWrapperRef,
217
195
  type: d.NUDGE,
218
196
  elementToHighlight: /* @__PURE__ */ t(
219
- me,
197
+ Te,
220
198
  {
221
199
  label: "",
222
200
  value: r.data.filter((C) => C.solved).length,
@@ -227,60 +205,59 @@ const Fe = ({
227
205
  name: "",
228
206
  // We dont want to show the name of the puzzle in onboarding
229
207
  isCompleted: C.solved,
230
- onPress: () => v(C, e)
208
+ onPress: () => x(C, e)
231
209
  }))
232
210
  }
233
211
  ),
234
212
  indicator: {
235
213
  nudge: "click",
236
- content: !g && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
237
- nudgePointerX: H.width * 0.6,
238
- nudgePointerY: H.height * 0.4
214
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
215
+ nudgePointerX: P.width * 0.6,
216
+ nudgePointerY: P.height * 0.4
239
217
  }
240
218
  }
241
219
  ];
242
- V(e, [...G, ...o, ...pe]);
220
+ Y(e, [...V, ...o, ...Ee]);
243
221
  } else
244
- V(e, G);
245
- (le = i.current) == null || le.goToIndex(0);
246
- const $ = setTimeout(() => {
247
- clearTimeout($), m(e);
248
- }, be);
249
- if (u.current.push($), e === Y.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
222
+ Y(e, V);
223
+ (oe = i.current) == null || oe.goToIndex(0);
224
+ const J = setTimeout(() => {
225
+ clearTimeout(J), g(e);
226
+ }, Oe);
227
+ if (u.current.push(J), e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
250
228
  S && n.current ? E(s.SKILL_ACTIVITY, n.current, "BLUE_4", !0, e) : E(s.GAMES_ACTIVITY, l.current, "ORANGE_4", !0, e);
251
229
  else {
252
- (ce = n.current) == null || ce.startLabelAnimation("BLUE_4");
230
+ (le = n.current) == null || le.startLabelAnimation("BLUE_4");
253
231
  const o = setTimeout(() => {
254
- clearTimeout(o), m(e, !0);
255
- }, se);
232
+ clearTimeout(o), g(e, !0);
233
+ }, ge);
256
234
  u.current.push(o);
257
235
  }
258
236
  },
259
237
  [
260
238
  i,
261
239
  L,
262
- O,
263
- g,
264
- V,
240
+ h,
241
+ Y,
265
242
  E,
266
- y,
267
243
  v,
268
- m
244
+ x,
245
+ g
269
246
  ]
270
- ), Ee = _e(
247
+ ), ue = pe(
271
248
  () => ({
272
249
  gameRefs: l,
273
250
  lessonRefs: n,
274
- puzzleRefs: c,
275
- startJourney: M
251
+ puzzleRefs: a,
252
+ startJourney: y
276
253
  }),
277
- [M]
254
+ [y]
278
255
  );
279
- return Ie(() => () => {
256
+ return _e(() => () => {
280
257
  u.current.forEach((e) => clearTimeout(e)), u.current = [];
281
- }, [i]), Ee;
258
+ }, [i]), ue;
282
259
  };
283
260
  export {
284
- Fe as useGameLauncherJourney
261
+ $e as useGameLauncherJourney
285
262
  };
286
263
  //# sourceMappingURL=use-game-launcher-journey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { ISegmentedGameCardRefs } from '../../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n SLIDE_TO_LESSON_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isMobile = device < EDeviceType.TABLET;\n const tooltipTextRenderAsOnMobile = 'ab3-bold';\n const tooltipTextRenderAs = 'ab2-bold';\n\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n isFirstSlide: boolean = false,\n journeyId: JOURNEY_ID_STUDENT,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n carouselRefs.current?.goToIndex(carouselRefs.current?.currentIndex + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer); // Store to cleanup later\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [carouselRefs, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (\n journeyId: JOURNEY_ID_STUDENT,\n puzzlesData?: IProject<Puzzle>,\n lessonsData?: IProject<Lesson>,\n ) => {\n // If element refs are not available return, this is just for type safety\n const isLessonAvailable = !!lessonsData;\n const isPuzzleAvailable = !!puzzlesData;\n\n if (!lessonRefs?.current?.segmentedCardWrapperRef.current) return;\n\n if (\n (!carouselRefs?.current?.nextBtnRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData) &&\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n lessonRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: TCoachmarkJourneyProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'BLUE_4',\n tooltipItem: (\n <FlexView>\n <Text\n $renderOnMobileAs={tooltipTextRenderAsOnMobile}\n $renderAs={tooltipTextRenderAs}\n >\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width / 2,\n tooltipYCoOrdinates: lessonLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ? {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: lessonRefs.current.segmentedCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={lessonsData.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={lessonsData.data.length}\n initialValue={lessonsData.initialProgressValue}\n data={lessonsData.data.map(lesson => ({\n card: lesson.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: lesson.status === 'completed',\n onPress: () => handleEndJourneyForLesson(lesson, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Tap here to get started\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n }\n\n if (\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY &&\n gameRefs.current &&\n puzzleRefs.current &&\n isPuzzleAvailable\n ) {\n const gameSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'ORANGE_4',\n tooltipItem: (\n <FlexView>\n <Text\n $renderOnMobileAs={tooltipTextRenderAsOnMobile}\n $renderAs={tooltipTextRenderAs}\n >\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width / 2,\n tooltipYCoOrdinates: gameLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'PURPLE_4',\n tooltipItem: (\n <FlexView>\n <Text\n $renderOnMobileAs={tooltipTextRenderAsOnMobile}\n $renderAs={tooltipTextRenderAs}\n >\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width / 2,\n tooltipYCoOrdinates: puzzleLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => handleEndJourneyForPuzzle(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n } else {\n setJourney(journeyId, lessonSteps);\n }\n carouselRefs.current?.goToIndex(0); // Always start from 0th Index no matter what the current index is\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n\n if (journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true, journeyId);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current!, 'ORANGE_4', true, journeyId);\n }\n } else {\n lessonRefs.current?.startLabelAnimation('BLUE_4');\n const delayBeforeShowingNudge = setTimeout(() => {\n clearTimeout(delayBeforeShowingNudge);\n nextCoachmark(journeyId, true);\n }, SHOW_NUDGE_AFTER_MS);\n\n timerRefs.current.push(delayBeforeShowingNudge); // Store to cleanup later\n }\n },\n [\n carouselRefs,\n tooltipTextRenderAsOnMobile,\n tooltipTextRenderAs,\n isMobile,\n setJourney,\n goToNextCard,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n nextCoachmark,\n ],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isMobile","EDeviceType","tooltipTextRenderAsOnMobile","tooltipTextRenderAs","lessonRefs","useRef","gameRefs","puzzleRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","journeyId","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourneyForPuzzle","puzzlesData","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","isLessonAvailable","isPuzzleAvailable","_c","_d","JOURNEY_ID_STUDENT","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","SegmentedGameCard","lesson","gameSteps","puzzleSteps","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","_s","delayBeforeShowingNudge","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,KAASG,GAAY,QAChCC,IAA8B,YAC9BC,IAAsB,YAEtBC,IAAaC,EAA+B,IAAI,GAChDC,IAAWD,EAA+B,IAAI,GAC9CE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAI,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,MAAeC,GAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,GAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,wBAAwB;AAAA,QACpD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAEXM,IAAsBH;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXO,IAAeJ;AAAA,IACnB,CACEK,GACAC,GACAC,GACAC,IAAwB,IACxBC,MACG;;AACH,MAAKD,MACajB,MAChBmB,IAAAjC,EAAa,YAAb,QAAAiC,EAAsB,YAAUC,IAAAlC,EAAa,YAAb,gBAAAkC,EAAsB,gBAAe,IACvDlB,EAAAgB,GAAW,IAAOG,EAAyB,IAG3Db,EAAiBM,CAAoB;AAE/B,YAAAQ,IAAoB,WAAW,MAAM;AACzC,qBAAaA,CAAiB,GAC9B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,QAAQ,KAAKsE,CAAgB,GAEnCnD,MAAckB,EAAmB;AAC/B,QAAAJ,KAAqBrC,EAAW,UAClCkB,EAAae,EAAY,gBAAgBjC,EAAW,SAAS,UAAU,IAAMuB,CAAS,IAEtFL,EAAae,EAAY,gBAAgB/B,EAAS,SAAU,YAAY,IAAMqB,CAAS;AAAA,WAEpF;AACM,SAAAqD,KAAA5E,EAAA,YAAA,QAAA4E,GAAS,oBAAoB;AAClC,cAAAC,IAA0B,WAAW,MAAM;AAC/C,uBAAaA,CAAuB,GACpCtE,EAAcgB,GAAW,EAAI;AAAA,WAC5BM,EAAmB;AAEZ,QAAAzB,EAAA,QAAQ,KAAKyE,CAAuB;AAAA,MAChD;AAAA,IACF;AAAA,IACA;AAAA,MACEtF;AAAA,MACAO;AAAA,MACAC;AAAA,MACAH;AAAA,MACAY;AAAA,MACAU;AAAA,MACAgB;AAAA,MACAJ;AAAA,MACAvB;AAAA,IACF;AAAA,EAAA,GAGIuE,KAAOC;AAAA,IACX,OAAO;AAAA,MACL,UAAA7E;AAAA,MACA,YAAAF;AAAA,MACA,YAAAG;AAAA,MACA,cAAAiC;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA4C,GAAU,MACD,MAAM;AACX,IAAA5E,EAAU,QAAQ,QAAQ,CAAS6E,MAAA,aAAaA,CAAK,CAAC,GACtD7E,EAAU,UAAU;EAAC,GAEtB,CAACb,CAAY,CAAC,GAEVuF;AACT;"}
1
+ {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { ISegmentedGameCardRefs } from '../../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { getTheme } from '../../../../ui/theme/get-theme';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n SLIDE_TO_LESSON_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n isFirstSlide: boolean = false,\n journeyId: JOURNEY_ID_STUDENT,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n carouselRefs.current?.goToIndex(carouselRefs.current?.currentIndex + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer); // Store to cleanup later\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [carouselRefs, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (\n journeyId: JOURNEY_ID_STUDENT,\n puzzlesData?: IProject<Puzzle>,\n lessonsData?: IProject<Lesson>,\n ) => {\n // If element refs are not available return, this is just for type safety\n const isLessonAvailable = !!lessonsData;\n const isPuzzleAvailable = !!puzzlesData;\n\n if (!lessonRefs?.current?.segmentedCardWrapperRef.current) return;\n\n if (\n (!carouselRefs?.current?.nextBtnRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData) &&\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n lessonRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: TCoachmarkJourneyProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'BLUE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width / 2,\n tooltipYCoOrdinates: lessonLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ? {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: lessonRefs.current.segmentedCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={lessonsData.data.filter(lesson => lesson.status === 'pending').length}\n maxValue={lessonsData.data.length}\n initialValue={lessonsData.initialProgressValue}\n data={lessonsData.data.map(lesson => ({\n card: lesson.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: lesson.status === 'completed',\n onPress: () => handleEndJourneyForLesson(lesson, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Tap here to get started\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n }\n\n if (\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY &&\n gameRefs.current &&\n puzzleRefs.current &&\n isPuzzleAvailable\n ) {\n const gameSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'ORANGE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width / 2,\n tooltipYCoOrdinates: gameLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'PURPLE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width / 2,\n tooltipYCoOrdinates: puzzleLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => handleEndJourneyForPuzzle(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n } else {\n setJourney(journeyId, lessonSteps);\n }\n carouselRefs.current?.goToIndex(0); // Always start from 0th Index no matter what the current index is\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n\n if (journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true, journeyId);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current!, 'ORANGE_4', true, journeyId);\n }\n } else {\n lessonRefs.current?.startLabelAnimation('BLUE_4');\n const delayBeforeShowingNudge = setTimeout(() => {\n clearTimeout(delayBeforeShowingNudge);\n nextCoachmark(journeyId, true);\n }, SHOW_NUDGE_AFTER_MS);\n\n timerRefs.current.push(delayBeforeShowingNudge); // Store to cleanup later\n }\n },\n [\n carouselRefs,\n tooltipTextRenderAs,\n isMobile,\n setJourney,\n goToNextCard,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n nextCoachmark,\n ],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","getTheme","isMobile","tooltipTextRenderAs","lessonRefs","useRef","gameRefs","puzzleRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","journeyId","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourneyForPuzzle","puzzlesData","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","isLessonAvailable","isPuzzleAvailable","_c","_d","JOURNEY_ID_STUDENT","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","SegmentedGameCard","lesson","gameSteps","puzzleSteps","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","_s","delayBeforeShowingNudge","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;AAoCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,OAAW,UACtBG,IAAsBD,IAAW,aAAa,YAE9CE,IAAaC,EAA+B,IAAI,GAChDC,IAAWD,EAA+B,IAAI,GAC9CE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,C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A,cAAAiC;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA4C,GAAU,MACD,MAAM;AACX,IAAA5E,EAAU,QAAQ,QAAQ,CAAS6E,MAAA,aAAaA,CAAK,CAAC,GACtD7E,EAAU,UAAU;EAAC,GAEtB,CAACX,CAAY,CAAC,GAEVqF;AACT;"}
@@ -1,33 +1,32 @@
1
- import { jsx as o, Fragment as M } from "react/jsx-runtime";
1
+ import { jsx as o, Fragment as B } from "react/jsx-runtime";
2
2
  import { useRef as Y, useCallback as E, useEffect as w } from "react";
3
- import { useTheme as G } from "styled-components";
4
- import { PLATFORM_EVENTS_STUDENT as x } from "../../../../analytics-events/platform-events-student.js";
5
- import { JOURNEY_ID_STUDENT as J } from "../../../../journey/journey-id/journey-id-student.js";
3
+ import { PLATFORM_EVENTS_STUDENT as M } from "../../../../analytics-events/platform-events-student.js";
4
+ import { JOURNEY_ID_STUDENT as G } from "../../../../journey/journey-id/journey-id-student.js";
6
5
  import { IndicatorType as p } from "../../../../journey/use-journey/constants.js";
7
- import { useJourney as b } from "../../../../journey/use-journey/use-journey.js";
8
- import { useUIContext as X } from "../../../../ui/context/context.js";
6
+ import { useJourney as J } from "../../../../journey/use-journey/use-journey.js";
7
+ import { useUIContext as b } from "../../../../ui/context/context.js";
9
8
  import P from "../../../../ui/layout/flex-view.js";
10
9
  import R from "../../../../ui/text/text.js";
11
- import { EDeviceType as $ } from "../../../../ui/theme/constants.js";
10
+ import { getTheme as X } from "../../../../ui/theme/get-theme.js";
12
11
  import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as W } from "../../../enum/circle-onboarding-steps.js";
13
- import { useCircleSounds as v } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
- import { INFINITE_MODE_TEXT as V } from "../../comps/tables-card/constants.js";
15
- import j from "../../comps/tables-card/infinite-button/infinite-mode-launcher-button.js";
16
- import { TABLE_CARD_INDEX as l, GO_TO_TABLE_LAUNCHER_DURATION_MS as K, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as k, LESSON_CARD_INDEX as q, SHOW_INITIAL_COACHMARK_AFTER_MS as z, SHOW_INITIAL_TOOLTIP_AFTER_MS as Q } from "./constants.js";
17
- import { Indicator as Z } from "./use-table-infinite-launcher-journey-styled.js";
18
- const tt = {
12
+ import { useCircleSounds as $ } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
13
+ import { INFINITE_MODE_TEXT as v } from "../../comps/tables-card/constants.js";
14
+ import V from "../../comps/tables-card/infinite-button/infinite-mode-launcher-button.js";
15
+ import { TABLE_CARD_INDEX as l, GO_TO_TABLE_LAUNCHER_DURATION_MS as j, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as k, LESSON_CARD_INDEX as K, SHOW_INITIAL_COACHMARK_AFTER_MS as q, SHOW_INITIAL_TOOLTIP_AFTER_MS as z } from "./constants.js";
16
+ import { Indicator as Q } from "./use-table-infinite-launcher-journey-styled.js";
17
+ const Z = {
19
18
  top: 6,
20
19
  left: 8,
21
20
  cursor: "pointer"
22
- }, Nt = ({
21
+ }, lt = ({
23
22
  carouselRefs: n,
24
23
  originalTableRef: t,
25
24
  onTableInfiniteModeClick: O,
26
25
  onJourneyComplete: N
27
26
  }) => {
28
- const e = J.CIRCLE_TABLES_INFINTE_JOURNEY, { device: F } = G(), I = F === $.MOBILE ? "ab3-bold" : "ab2-bold", _ = Y([]), { playButtonSound: C } = v(), { nextCoachmark: c, setJourney: T, addCoachmark: h, endJourney: A } = b(), { onEvent: d } = X(), L = E(() => {
27
+ const e = G.CIRCLE_TABLES_INFINTE_JOURNEY, { device: F } = X(), I = F === "mobile" ? "ab3-bold" : "ab2-bold", _ = Y([]), { playButtonSound: C } = $(), { nextCoachmark: c, setJourney: T, addCoachmark: h, endJourney: A } = J(), { onEvent: d } = b(), L = E(() => {
29
28
  var r;
30
- A(e), O(), d(x.ONBOARDING_STEP_COMPLETED, {
29
+ A(e), O(), d(M.ONBOARDING_STEP_COMPLETED, {
31
30
  step: W.INFINITE_MODE
32
31
  }), (r = t == null ? void 0 : t.current) == null || r.stopLabelAnimation(), N(e);
33
32
  }, [
@@ -39,30 +38,30 @@ const tt = {
39
38
  d
40
39
  ]), s = E(
41
40
  (r, u) => {
42
- c(e, !1, r), d(x.ONBOARDING_STEP_VIEWED, {
41
+ c(e, !1, r), d(M.ONBOARDING_STEP_VIEWED, {
43
42
  step: W.INFINITE_MODE
44
43
  });
45
44
  const i = setTimeout(() => {
46
45
  var m;
47
- clearTimeout(i), (m = t.current) == null || m.startLabelAnimation("YELLOW_4"), t.current && t.current.labelRef.current && (t.current.labelRef.current.innerText = V), c(e, !0);
46
+ clearTimeout(i), (m = t.current) == null || m.startLabelAnimation("YELLOW_4"), t.current && t.current.labelRef.current && (t.current.labelRef.current.innerText = v), c(e, !0);
48
47
  }, u);
49
48
  _.current.push(i);
50
49
  },
51
50
  [e, c, t, d]
52
51
  ), a = E(() => {
53
52
  var r;
54
- C(), (r = n.current) == null || r.goToIndex(l), s(K, k);
53
+ C(), (r = n.current) == null || r.goToIndex(l), s(j, k);
55
54
  }, [n, C, s]), U = E(() => {
56
- var f, g, D, S, y, B, H;
57
- const r = (f = n.current) == null ? void 0 : f.indicatorRefs, u = (g = n.current) == null ? void 0 : g.nextBtnRef, i = r == null ? void 0 : r[l];
55
+ var g, f, D, S, y, H, x;
56
+ const r = (g = n.current) == null ? void 0 : g.indicatorRefs, u = (f = n.current) == null ? void 0 : f.nextBtnRef, i = r == null ? void 0 : r[l];
58
57
  if (!((D = t.current) != null && D.segmentedCardWrapperRef.current) || !((S = t.current) != null && S.labelRef.current) || !r || !(u != null && u.current) || !i || !i.current)
59
58
  return;
60
59
  const m = (y = t.current) == null ? void 0 : y.segmentedCardWrapperRef.current.getBoundingClientRect();
61
- ((B = n.current) == null ? void 0 : B.currentIndex) === l ? (T(e, []), s(0, k)) : (T(e, [
60
+ ((H = n.current) == null ? void 0 : H.currentIndex) === l ? (T(e, []), s(0, k)) : (T(e, [
62
61
  {
63
62
  originalElementToHighlightRef: i,
64
63
  type: p.TOOLTIP,
65
- elementToHighlight: /* @__PURE__ */ o(Z, { $isActive: !1 }),
64
+ elementToHighlight: /* @__PURE__ */ o(Q, { $isActive: !1 }),
66
65
  indicator: {
67
66
  position: "bottom",
68
67
  backgroundColor: "YELLOW_4",
@@ -72,7 +71,7 @@ const tt = {
72
71
  {
73
72
  $position: "absolute",
74
73
  $flexDirection: "row",
75
- style: tt,
74
+ style: Z,
76
75
  onClick: a,
77
76
  children: /* @__PURE__ */ o(R, { $renderAs: I, children: "NEW" })
78
77
  }
@@ -89,12 +88,12 @@ const tt = {
89
88
  content: "",
90
89
  nudgePointerY: 20
91
90
  },
92
- elementToHighlight: /* @__PURE__ */ o(M, {})
91
+ elementToHighlight: /* @__PURE__ */ o(B, {})
93
92
  }
94
- ]), (H = n.current) == null || H.goToIndex(q), c(e, !1, z), c(e, !0, Q)), h(e, {
93
+ ]), (x = n.current) == null || x.goToIndex(K), c(e, !1, q), c(e, !0, z)), h(e, {
95
94
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
96
95
  type: p.TOOLTIP,
97
- elementToHighlight: /* @__PURE__ */ o(M, {}),
96
+ elementToHighlight: /* @__PURE__ */ o(B, {}),
98
97
  indicator: {
99
98
  position: "top",
100
99
  backgroundColor: "YELLOW_4",
@@ -111,7 +110,7 @@ const tt = {
111
110
  nudgePointerX: 0,
112
111
  nudgePointerY: 10
113
112
  },
114
- elementToHighlight: /* @__PURE__ */ o(j, { onClick: L })
113
+ elementToHighlight: /* @__PURE__ */ o(V, { onClick: L })
115
114
  });
116
115
  }, [
117
116
  h,
@@ -132,6 +131,6 @@ const tt = {
132
131
  };
133
132
  };
134
133
  export {
135
- Nt as useTableInfiniteLauncherJourney
134
+ lt as useTableInfiniteLauncherJourney
136
135
  };
137
136
  //# sourceMappingURL=use-table-infinite-launcher-journey.js.map