@cuemath/leap 3.3.28 → 3.3.29-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
  2. package/dist/features/auth/pla-signup/pla-analytics-events.js +9 -3
  3. package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
  4. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
  5. package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
  6. package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
  7. package/dist/features/circle-games/sign-up/sign-up.js +6 -6
  8. package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
  9. package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
  10. package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
  11. package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
  12. package/dist/features/milestone/create/milestone-create-helpers.js +13 -7
  13. package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
  14. package/dist/features/parent-dashboard/api/cancel-subscription.js +9 -0
  15. package/dist/features/parent-dashboard/api/cancel-subscription.js.map +1 -0
  16. package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +20 -0
  17. package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +1 -0
  18. package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +96 -0
  19. package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +1 -0
  20. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps-constants.js +1 -1
  21. package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +1 -0
  22. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps-styled.js +1 -1
  23. package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +1 -0
  24. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps.js +5 -5
  25. package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +1 -0
  26. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +28 -22
  27. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
  28. package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +34 -0
  29. package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +1 -0
  30. package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +137 -0
  31. package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +1 -0
  32. package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +20 -0
  33. package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +1 -0
  34. package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +19 -0
  35. package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +1 -0
  36. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-status/session-status-styled.js +2 -2
  37. package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +1 -0
  38. package/dist/features/parent-dashboard/comps/session-status/session-status.js +124 -0
  39. package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +1 -0
  40. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-summary/session-summary-constants.js +2 -2
  41. package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +1 -0
  42. package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +53 -0
  43. package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +1 -0
  44. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-summary/summary-card/summary-card-styled.js +1 -1
  45. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +1 -0
  46. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +63 -0
  47. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +1 -0
  48. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
  49. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
  50. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
  51. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
  52. package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions.js +14 -14
  53. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +1 -0
  54. package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
  55. package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
  56. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +48 -46
  57. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
  58. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +21 -0
  59. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +1 -0
  60. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +85 -0
  61. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +1 -0
  62. package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +23 -0
  63. package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +1 -0
  64. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +55 -0
  65. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +1 -0
  66. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +59 -0
  67. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +1 -0
  68. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +93 -0
  69. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +1 -0
  70. package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +66 -0
  71. package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +1 -0
  72. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
  73. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
  74. package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +76 -0
  75. package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +1 -0
  76. package/dist/features/parent-dashboard/parent-dashboard-constants.js +45 -4
  77. package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
  78. package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
  79. package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
  80. package/dist/features/parent-dashboard/parent-dashboard-view.js +197 -173
  81. package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
  82. package/dist/features/student-details/class-details/class-details-utils.js +6 -6
  83. package/dist/features/student-username/add/add-student-username-constants.js +6 -0
  84. package/dist/features/student-username/add/add-student-username-constants.js.map +1 -0
  85. package/dist/features/student-username/add/add-student-username-helpers.js +6 -0
  86. package/dist/features/student-username/add/add-student-username-helpers.js.map +1 -0
  87. package/dist/features/student-username/add/add-student-username-styled.js +10 -0
  88. package/dist/features/student-username/add/add-student-username-styled.js.map +1 -0
  89. package/dist/features/student-username/add/add-student-username.js +78 -0
  90. package/dist/features/student-username/add/add-student-username.js.map +1 -0
  91. package/dist/features/student-username/add/api/update-username.js +9 -0
  92. package/dist/features/student-username/add/api/update-username.js.map +1 -0
  93. package/dist/features/student-username/add/api/username-availability.js +10 -0
  94. package/dist/features/student-username/add/api/username-availability.js.map +1 -0
  95. package/dist/features/student-username/add/hooks/use-check-username-availability.js +41 -0
  96. package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +1 -0
  97. package/dist/features/trial-session/api/teacher-availability.js +9 -0
  98. package/dist/features/trial-session/api/teacher-availability.js.map +1 -0
  99. package/dist/features/trial-session/comps/class-preference/class-preference.js +61 -49
  100. package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
  101. package/dist/features/trial-session/comps/class-preference/helpers.js +28 -0
  102. package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -0
  103. package/dist/features/trial-session/comps/navigation-bar/index.js +24 -24
  104. package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
  105. package/dist/features/trial-session/comps/school-goals/school-goals.js +51 -50
  106. package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
  107. package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
  108. package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
  109. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +39 -38
  110. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
  111. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +5 -0
  112. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
  113. package/dist/features/trial-session/comps/student-feedback/student-feedback.js +96 -51
  114. package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
  115. package/dist/features/trial-session/comps/student-profile/student-profile.js +70 -63
  116. package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
  117. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +43 -44
  118. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
  119. package/dist/features/trial-session/comps/test-prep/test-prep.js +40 -39
  120. package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
  121. package/dist/features/trial-session/helper.js +69 -53
  122. package/dist/features/trial-session/helper.js.map +1 -1
  123. package/dist/features/trial-session/hooks/use-slide-config-update.js +49 -0
  124. package/dist/features/trial-session/hooks/use-slide-config-update.js.map +1 -0
  125. package/dist/features/trial-session/hooks/use-trial-session-navigation.js +150 -130
  126. package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
  127. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  128. package/dist/features/trial-session/trial-session-view.js +103 -112
  129. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  130. package/dist/features/utils/utils.js +1 -1
  131. package/dist/features/utils/utils.js.map +1 -1
  132. package/dist/index.d.ts +77 -77
  133. package/dist/index.js +310 -309
  134. package/package.json +2 -3
  135. package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +0 -1
  136. package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +0 -1
  137. package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +0 -1
  138. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +0 -29
  139. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +0 -1
  140. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +0 -132
  141. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +0 -1
  142. package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +0 -11
  143. package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +0 -1
  144. package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +0 -19
  145. package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +0 -1
  146. package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +0 -1
  147. package/dist/features/trial-session/comps/pla/session-status/session-status.js +0 -127
  148. package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +0 -1
  149. package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +0 -1
  150. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +0 -53
  151. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +0 -1
  152. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +0 -1
  153. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +0 -56
  154. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +0 -1
  155. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
  156. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
  157. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
  158. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +0 -1
  159. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +0 -10
  160. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +0 -1
  161. package/dist/node_modules/date-fns/differenceInMilliseconds.js +0 -9
  162. package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +0 -1
  163. package/dist/node_modules/date-fns/differenceInSeconds.js +0 -11
  164. package/dist/node_modules/date-fns/differenceInSeconds.js.map +0 -1
  165. /package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
  166. /package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-types.js +0 -0
@@ -0,0 +1,78 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { memo as b, useState as y, useRef as A, useCallback as i, useMemo as N } from "react";
3
+ import { LOTTIE as g } from "../../../assets/lottie/lottie.js";
4
+ import O from "../../auth/signup/circular-step-wrapper/circular-step-wrapper.js";
5
+ import _ from "../../auth/signup/custom-input-field/custom-input-field.js";
6
+ import F from "../../ui/layout/flex-view.js";
7
+ import { Container as L } from "./add-student-username-styled.js";
8
+ import { useUpdateUsernamePost as P } from "./api/update-username.js";
9
+ import $ from "./hooks/use-check-username-availability.js";
10
+ const k = (U) => {
11
+ const { studentId: c, onSuccess: o, onGoBack: n } = U, [e, S] = y(""), r = A(null), {
12
+ isValid: s,
13
+ isProcessing: l,
14
+ error: m,
15
+ setError: p
16
+ } = $(e), w = i((t) => {
17
+ S(t);
18
+ }, []), x = i(
19
+ async (t) => {
20
+ var C;
21
+ if (t) {
22
+ p(t);
23
+ return;
24
+ }
25
+ r && await ((C = r.current) == null ? void 0 : C.playOutroAndFadeOut()), o == null || o(e);
26
+ },
27
+ [o, p, e]
28
+ ), { post: h, isProcessing: u } = P({
29
+ onComplete: x
30
+ }), E = i(async () => {
31
+ var t;
32
+ r && await ((t = r.current) == null ? void 0 : t.playOutroAndFadeOut()), n == null || n();
33
+ }, [n]), d = N(
34
+ () => e.trim().length === 0 || !s || !!m || l || u,
35
+ [e, s, m, l, u]
36
+ ), f = i(() => {
37
+ d || h(
38
+ { username: e.toLowerCase(), create_circle_profile_only: !0 },
39
+ { studentId: c }
40
+ );
41
+ }, [d, c, h, e]);
42
+ return /* @__PURE__ */ a(L, { $width: "100%", $height: "100%", children: /* @__PURE__ */ a(F, { $background: "BLACK_1", $width: "100%", $height: "100%", $flex: 1, children: /* @__PURE__ */ a(
43
+ O,
44
+ {
45
+ label: "Create a unique username for your child",
46
+ showNext: !0,
47
+ showPrevious: !0,
48
+ animation: g.USERNAME,
49
+ introFrames: [0, 23],
50
+ outroFrames: [23, 40],
51
+ isNextLoading: u,
52
+ onGoBack: E,
53
+ onNext: f,
54
+ isNextDisabled: d,
55
+ animationSrcMobile: g.USERNAME_RESPONSIVE,
56
+ ref: r,
57
+ children: /* @__PURE__ */ a(
58
+ _,
59
+ {
60
+ value: e,
61
+ error: m,
62
+ onChange: w,
63
+ helperText: `Only letters, _ , & digits allowed.
64
+ Upto 25 characters.`,
65
+ isLoading: l,
66
+ onEnter: f,
67
+ isValid: s,
68
+ placeholder: "username_1412",
69
+ textTransform: "lowercase"
70
+ }
71
+ )
72
+ }
73
+ ) }) });
74
+ }, D = b(k);
75
+ export {
76
+ D as default
77
+ };
78
+ //# sourceMappingURL=add-student-username.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-student-username.js","sources":["../../../../src/features/student-username/add/add-student-username.tsx"],"sourcesContent":["import type { ICircularStepRef } from '../../auth/signup/circular-step-wrapper/circular-step-wrapper-types';\nimport type { IAddStudentUsernameProps } from './add-student-username-types';\n\nimport { memo, useCallback, useMemo, useRef, useState, type FC } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport CircularStepWrapper from '../../auth/signup/circular-step-wrapper/circular-step-wrapper';\nimport CustomInputField from '../../auth/signup/custom-input-field/custom-input-field';\nimport FlexView from '../../ui/layout/flex-view';\nimport * as Styled from './add-student-username-styled';\nimport { useUpdateUsernamePost } from './api/update-username';\nimport useCheckUsernameAvailability from './hooks/use-check-username-availability';\n\nconst AddStudentUsername: FC<IAddStudentUsernameProps> = props => {\n const { studentId, onSuccess, onGoBack } = props;\n const [username, setUsername] = useState('');\n\n const circularStepRef = useRef<ICircularStepRef>(null);\n const {\n isValid: isValidUsername,\n isProcessing: isCheckingUsername,\n error,\n setError,\n } = useCheckUsernameAvailability(username);\n\n const handleChange = useCallback((value: string) => {\n setUsername(value);\n }, []);\n\n const handleComplete = useCallback(\n async (errorMessage: string | null) => {\n if (errorMessage) {\n setError(errorMessage);\n\n return;\n }\n\n if (circularStepRef) {\n await circularStepRef.current?.playOutroAndFadeOut();\n }\n\n onSuccess?.(username);\n },\n [onSuccess, setError, username],\n );\n\n const { post: updateUsernamePost, isProcessing: isSubmitLoading } = useUpdateUsernamePost({\n onComplete: handleComplete,\n });\n\n const handleGoBack = useCallback(async () => {\n if (circularStepRef) {\n await circularStepRef.current?.playOutroAndFadeOut();\n }\n onGoBack?.();\n }, [onGoBack]);\n\n const isNextDisabled = useMemo(\n () =>\n username.trim().length === 0 ||\n !isValidUsername ||\n !!error ||\n isCheckingUsername ||\n isSubmitLoading,\n [username, isValidUsername, error, isCheckingUsername, isSubmitLoading],\n );\n\n const handleSubmit = useCallback(() => {\n if (!isNextDisabled) {\n updateUsernamePost(\n { username: username.toLowerCase(), create_circle_profile_only: true },\n { studentId },\n );\n }\n }, [isNextDisabled, studentId, updateUsernamePost, username]);\n\n return (\n <Styled.Container $width=\"100%\" $height=\"100%\">\n <FlexView $background=\"BLACK_1\" $width=\"100%\" $height={'100%'} $flex={1}>\n <CircularStepWrapper\n label=\"Create a unique username for your child\"\n showNext\n showPrevious\n animation={LOTTIE.USERNAME}\n introFrames={[0, 23]}\n outroFrames={[23, 40]}\n isNextLoading={isSubmitLoading}\n onGoBack={handleGoBack}\n onNext={handleSubmit}\n isNextDisabled={isNextDisabled}\n animationSrcMobile={LOTTIE.USERNAME_RESPONSIVE}\n ref={circularStepRef}\n >\n <CustomInputField\n value={username}\n error={error}\n onChange={handleChange}\n helperText={`Only letters, _ , & digits allowed.\\nUpto 25 characters.`}\n isLoading={isCheckingUsername}\n onEnter={handleSubmit}\n isValid={isValidUsername}\n placeholder=\"username_1412\"\n textTransform=\"lowercase\"\n />\n </CircularStepWrapper>\n </FlexView>\n </Styled.Container>\n );\n};\n\nexport default memo(AddStudentUsername);\n"],"names":["AddStudentUsername","props","studentId","onSuccess","onGoBack","username","setUsername","useState","circularStepRef","useRef","isValidUsername","isCheckingUsername","error","setError","useCheckUsernameAvailability","handleChange","useCallback","value","handleComplete","errorMessage","_a","updateUsernamePost","isSubmitLoading","useUpdateUsernamePost","handleGoBack","isNextDisabled","useMemo","handleSubmit","Styled.Container","jsx","FlexView","CircularStepWrapper","LOTTIE","CustomInputField","addStudentUsername","memo"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAmD,CAASC,MAAA;AAChE,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,EAAA,IAAaH,GACrC,CAACI,GAAUC,CAAW,IAAIC,EAAS,EAAE,GAErCC,IAAkBC,EAAyB,IAAI,GAC/C;AAAA,IACJ,SAASC;AAAA,IACT,cAAcC;AAAA,IACd,OAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEC,EAA6BT,CAAQ,GAEnCU,IAAeC,EAAY,CAACC,MAAkB;AAClD,IAAAX,EAAY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AC,IAAI,EAAE;AAAA,MACpB,eAAeV;AAAA,MACf,UAAUE;AAAA,MACV,QAAQG;AAAA,MACR,gBAAAF;AAAA,MACA,oBAAoBO,EAAO;AAAA,MAC3B,KAAKxB;AAAA,MAEL,UAAA,gBAAAqB;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,OAAO5B;AAAA,UACP,OAAAO;AAAA,UACA,UAAUG;AAAA,UACV,YAAY;AAAA;AAAA,UACZ,WAAWJ;AAAA,UACX,SAASgB;AAAA,UACT,SAASjB;AAAA,UACT,aAAY;AAAA,UACZ,eAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA;AAEJ,GAEewB,IAAAC,EAAKnC,CAAkB;"}
@@ -0,0 +1,9 @@
1
+ import { createPostAPI as e } from "@cuemath/rest-api";
2
+ import { BASE_URL_V1 as o } from "../../../../constants/api.js";
3
+ const { usePost: p } = e({
4
+ getURL: (s, { studentId: t }) => `${o}/students/${t}/`
5
+ });
6
+ export {
7
+ p as useUpdateUsernamePost
8
+ };
9
+ //# sourceMappingURL=update-username.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-username.js","sources":["../../../../../src/features/student-username/add/api/update-username.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\n\ntype TResponse = Record<string, string>;\ninterface IPayload {\n username: string;\n create_circle_profile_only?: boolean;\n}\n\nconst { usePost: useUpdateUsernamePost } = createPostAPI<\n TResponse,\n IPayload,\n { studentId: string }\n>({\n getURL: (_, { studentId }) => `${BASE_URL_V1}/students/${studentId}/`,\n});\n\nexport { useUpdateUsernamePost };\n"],"names":["useUpdateUsernamePost","createPostAPI","_","studentId","BASE_URL_V1"],"mappings":";;AAUA,MAAM,EAAE,SAASA,EAAsB,IAAIC,EAIzC;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,WAAAC,EAAgB,MAAA,GAAGC,CAAW,aAAaD,CAAS;AACpE,CAAC;"}
@@ -0,0 +1,10 @@
1
+ import { createGetAPI as t } from "@cuemath/rest-api";
2
+ import * as r from "../../../../node_modules/query-string/base.js";
3
+ import { BASE_URL_V1 as a } from "../../../../constants/api.js";
4
+ const { useGet: s } = t({
5
+ getURL: (i, e) => `${a}/available-username?${r.stringify(e)}`
6
+ });
7
+ export {
8
+ s as useUsernameAvailabilityGet
9
+ };
10
+ //# sourceMappingURL=username-availability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"username-availability.js","sources":["../../../../../src/features/student-username/add/api/username-availability.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\nimport querystring from 'query-string';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\n\ninterface IUsernameAvailabilityParam {\n username: string;\n}\n\ninterface IUsernameAvailabilityData {\n is_valid: boolean;\n}\n\nconst { useGet: useUsernameAvailabilityGet } = createGetAPI<\n IUsernameAvailabilityData,\n IUsernameAvailabilityParam\n>({\n getURL: (_, queryParams) =>\n `${BASE_URL_V1}/available-username?${querystring.stringify(queryParams)}`,\n});\n\nexport { useUsernameAvailabilityGet };\n"],"names":["useUsernameAvailabilityGet","createGetAPI","_","queryParams","BASE_URL_V1","querystring"],"mappings":";;;AAaA,MAAM,EAAE,QAAQA,EAA2B,IAAIC,EAG7C;AAAA,EACA,QAAQ,CAACC,GAAGC,MACV,GAAGC,CAAW,uBAAuBC,EAAY,UAAUF,CAAW,CAAC;AAC3E,CAAC;"}
@@ -0,0 +1,41 @@
1
+ import g from "../../../../node_modules/lodash.debounce/index.js";
2
+ import { useState as c, useMemo as v, useEffect as f } from "react";
3
+ import { validateUsername as b } from "../add-student-username-helpers.js";
4
+ import { useUsernameAvailabilityGet as h } from "../api/username-availability.js";
5
+ const k = (s) => {
6
+ const [m, e] = c(""), [d, a] = c(!1), {
7
+ get: o,
8
+ data: t,
9
+ isProcessing: u,
10
+ isProcessed: l,
11
+ isProcessingFailed: n
12
+ } = h(), r = v(
13
+ () => g((i) => {
14
+ o("", { username: i });
15
+ }, 300),
16
+ [o]
17
+ );
18
+ return f(() => {
19
+ if (a(!1), s && s.length >= 1) {
20
+ const i = b(s);
21
+ if (i) {
22
+ e(i);
23
+ return;
24
+ }
25
+ e(""), r(s);
26
+ } else
27
+ e("");
28
+ return () => {
29
+ r.cancel();
30
+ };
31
+ }, [s, r]), f(() => {
32
+ if (l && t) {
33
+ const i = t == null ? void 0 : t.is_valid;
34
+ e(i ? "" : "This username is already taken"), a(i);
35
+ } else n && e("Something went wrong");
36
+ }, [t, l, e, n]), { isValid: d, isProcessing: u, error: m, setError: e };
37
+ };
38
+ export {
39
+ k as default
40
+ };
41
+ //# sourceMappingURL=use-check-username-availability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-check-username-availability.js","sources":["../../../../../src/features/student-username/add/hooks/use-check-username-availability.ts"],"sourcesContent":["import debounce from 'lodash.debounce';\nimport { useEffect, useMemo, useState } from 'react';\n\nimport { validateUsername } from '../add-student-username-helpers';\nimport { useUsernameAvailabilityGet } from '../api/username-availability';\n\ninterface IUseCheckUsernameAvailability {\n isValid: boolean;\n isProcessing: boolean;\n error: string;\n setError: (error: string) => void;\n}\n\nconst useCheckUsernameAvailability = (username: string): IUseCheckUsernameAvailability => {\n const [error, setError] = useState('');\n const [isValid, setIsValid] = useState(false);\n\n const {\n get: getUsernameAvailability,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useUsernameAvailabilityGet();\n\n const checkAvailability = useMemo(\n () =>\n debounce((usernameVal: string) => {\n getUsernameAvailability('', { username: usernameVal });\n }, 300),\n [getUsernameAvailability],\n );\n\n useEffect(() => {\n setIsValid(false);\n if (username && username.length >= 1) {\n const err = validateUsername(username);\n\n if (err) {\n setError(err);\n\n return;\n }\n setError('');\n checkAvailability(username);\n } else {\n setError('');\n }\n\n return () => {\n checkAvailability.cancel();\n };\n }, [username, checkAvailability]);\n\n useEffect(() => {\n if (isProcessed && data) {\n const isValidUsername = data?.is_valid;\n\n setError(isValidUsername ? '' : 'This username is already taken');\n setIsValid(isValidUsername);\n } else if (isProcessingFailed) {\n setError('Something went wrong');\n }\n }, [data, isProcessed, setError, isProcessingFailed]);\n\n return { isValid, isProcessing, error, setError };\n};\n\nexport default useCheckUsernameAvailability;\n"],"names":["useCheckUsernameAvailability","username","error","setError","useState","isValid","setIsValid","getUsernameAvailability","data","isProcessing","isProcessed","isProcessingFailed","useUsernameAvailabilityGet","checkAvailability","useMemo","debounce","usernameVal","useEffect","err","validateUsername","isValidUsername"],"mappings":";;;;AAaM,MAAAA,IAA+B,CAACC,MAAoD;AACxF,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE,GAC/B,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GAEtC;AAAA,IACJ,KAAKG;AAAA,IACL,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAA2B,GAEzBC,IAAoBC;AAAA,IACxB,MACEC,EAAS,CAACC,MAAwB;AAChC,MAAAT,EAAwB,IAAI,EAAE,UAAUS,EAAa,CAAA;AAAA,OACpD,GAAG;AAAA,IACR,CAACT,CAAuB;AAAA,EAAA;AAG1B,SAAAU,EAAU,MAAM;AAEV,QADJX,EAAW,EAAK,GACZL,KAAYA,EAAS,UAAU,GAAG;AAC9B,YAAAiB,IAAMC,EAAiBlB,CAAQ;AAErC,UAAIiB,GAAK;AACP,QAAAf,EAASe,CAAG;AAEZ;AAAA,MACF;AACA,MAAAf,EAAS,EAAE,GACXU,EAAkBZ,CAAQ;AAAA,IAAA;AAE1B,MAAAE,EAAS,EAAE;AAGb,WAAO,MAAM;AACX,MAAAU,EAAkB,OAAO;AAAA,IAAA;AAAA,EAC3B,GACC,CAACZ,GAAUY,CAAiB,CAAC,GAEhCI,EAAU,MAAM;AACd,QAAIP,KAAeF,GAAM;AACvB,YAAMY,IAAkBZ,KAAA,gBAAAA,EAAM;AAErB,MAAAL,EAAAiB,IAAkB,KAAK,gCAAgC,GAChEd,EAAWc,CAAe;AAAA,WACjBT,KACTR,EAAS,sBAAsB;AAAA,KAEhC,CAACK,GAAME,GAAaP,GAAUQ,CAAkB,CAAC,GAE7C,EAAE,SAAAN,GAAS,cAAAI,GAAc,OAAAP,GAAO,UAAAC,EAAS;AAClD;"}
@@ -0,0 +1,9 @@
1
+ import { createPostAPI as t } from "@cuemath/rest-api";
2
+ import { BASE_URL_V1 as e } from "../../../constants/api.js";
3
+ const { usePost: i } = t({
4
+ getURL: () => `${e}/teacher-slot-availability/`
5
+ });
6
+ export {
7
+ i as usePostTeacherAvailability
8
+ };
9
+ //# sourceMappingURL=teacher-availability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teacher-availability.js","sources":["../../../../src/features/trial-session/api/teacher-availability.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\n\ntype TSessionList = {\n weekday: string;\n start_time: string;\n};\n\ntype TTeacherAvailabilityBody = {\n teacher_id: string;\n session_list: TSessionList[];\n};\n\nexport type TTeacherAvailabilityResponse = {\n is_available: boolean;\n reason: string;\n}[];\n\nconst { usePost: usePostTeacherAvailability } = createPostAPI<\n TTeacherAvailabilityResponse,\n TTeacherAvailabilityBody\n>({\n getURL: () => `${BASE_URL_V1}/teacher-slot-availability/`,\n});\n\nexport { usePostTeacherAvailability };\n"],"names":["usePostTeacherAvailability","createPostAPI","BASE_URL_V1"],"mappings":";;AAmBA,MAAM,EAAE,SAASA,EAA2B,IAAIC,EAG9C;AAAA,EACA,QAAQ,MAAM,GAAGC,CAAW;AAC9B,CAAC;"}
@@ -1,49 +1,61 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { memo as A, useCallback as O, useEffect as w } from "react";
1
+ import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
+ import { memo as H, useMemo as j, useCallback as F, useEffect as P } from "react";
3
3
  import { DAYS as f } from "../../../../constants/date-time.js";
4
- import { getTimeUnits as j, getOffsetBetweenTimezone as v, convertEpochToDateTime as g, convertToMilliseconds as H } from "../../../../helpers/date-time.js";
5
- import $ from "../../../ui/inputs/select-input/select-input.js";
4
+ import { getTimeUnits as W, getOffsetBetweenTimezone as z, convertEpochToDateTime as $, convertToMilliseconds as B } from "../../../../helpers/date-time.js";
5
+ import C from "../../../ui/inputs/select-input/select-input.js";
6
6
  import u from "../../../ui/layout/flex-view.js";
7
- import P from "../../../ui/separator/separator.js";
8
- import W from "../../../ui/text/text.js";
9
- import { useTrialSessionContext as z } from "../../context/use-trial-session-context.js";
10
- import { TEACHER_TIMEZONE as y } from "../../trial-session-constants.js";
11
- import B from "../slide-header/index.js";
12
- import { timeSlots as Y } from "./class-preference-constants.js";
13
- import { Container as F, PreferenceWrapper as K, FixedLineSeparator as M } from "./class-preference-styled.js";
14
- const C = [
7
+ import M from "../../../ui/separator/separator.js";
8
+ import Y from "../../../ui/text/text.js";
9
+ import { useTrialSessionContext as K } from "../../context/use-trial-session-context.js";
10
+ import { TEACHER_TIMEZONE as x } from "../../trial-session-constants.js";
11
+ import G from "../slide-header/index.js";
12
+ import { timeSlots as N } from "./class-preference-constants.js";
13
+ import { Container as R, PreferenceWrapper as U, FixedLineSeparator as Z } from "./class-preference-styled.js";
14
+ import { extractDayAndTimeFromEpoch as q } from "./helpers.js";
15
+ const h = [
15
16
  { id: 1, selectedDay: "", selectedTime: "" },
16
17
  { id: 2, selectedDay: "", selectedTime: "" }
17
- ], se = A(({ miniScreenDevice: D }) => {
18
- const { isTeacher: n, formData: x, updateSlideConfig: p } = z(), { preferences: o, studentTimezone: c } = x || {}, b = f.map((e) => ({ id: e, label: e })), h = n ? y : c, T = (e, t, s) => {
19
- p({
20
- preferences: (o ?? C).map(
18
+ ], pe = H(({ miniScreenDevice: _ }) => {
19
+ const { isTeacher: o, formData: b, trialHomeData: S, updateSlideConfig: T } = K(), { preferences: m, studentTimezone: n = "Asia/Calcutta" } = b || {}, { demo_info: E } = S || {}, { scheduled_start_time: y } = E || {}, A = f.map((e) => ({ id: e, label: e })), g = o ? x : n, l = j(
20
+ () => o ? q(y, n) : void 0,
21
+ [o, y, n]
22
+ ), D = (e, t, s) => {
23
+ T({
24
+ preferences: (m ?? h).map(
21
25
  (r) => r.id === e ? { ...r, [t]: s } : r
22
26
  )
23
27
  });
24
- }, _ = (e, t) => {
25
- T(e, "selectedDay", t);
26
- }, S = (e, t) => {
27
- T(e, "selectedTime", t);
28
- }, E = O(
28
+ }, I = (e, t) => {
29
+ D(e, "selectedDay", t);
30
+ }, L = (e, t) => {
31
+ D(e, "selectedTime", t);
32
+ }, X = F(
29
33
  (e, t) => {
30
- if (e && t && c) {
31
- const { hours: s, minutes: r } = j(t), m = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), l = v(y, c), i = n ? m + l : m, { day: L = "" } = g(i, c), I = f.indexOf(L), X = (f.indexOf(e) - I + 7) % 7, k = i + H({ days: X, hours: s, minutes: r });
32
- return g(k, h);
34
+ if (e && t && n) {
35
+ const { hours: s, minutes: r } = W(t), c = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), p = z(x, n), a = o ? c + p : c, { day: k = "" } = $(a, n), O = f.indexOf(k), w = (f.indexOf(e) - O + 7) % 7, v = a + B({ days: w, hours: s, minutes: r });
36
+ return $(v, g);
33
37
  }
34
38
  return {};
35
39
  },
36
- [n, c, h]
40
+ [o, n, g]
37
41
  );
38
- return w(() => {
39
- n && !o && p({ preferences: C });
40
- }, [n, o, p]), /* @__PURE__ */ d(F, { children: [
41
- /* @__PURE__ */ a(P, { height: 60 }),
42
- /* @__PURE__ */ a(B, {}),
42
+ return P(() => {
43
+ o && !m && T({
44
+ preferences: l ? h.map(
45
+ (e) => e.id === 1 ? {
46
+ ...e,
47
+ selectedDay: l.day,
48
+ selectedTime: l.time
49
+ } : e
50
+ ) : h
51
+ });
52
+ }, [l]), /* @__PURE__ */ d(R, { children: [
53
+ /* @__PURE__ */ i(M, { height: 60 }),
54
+ /* @__PURE__ */ i(G, {}),
43
55
  /* @__PURE__ */ d(
44
- K,
56
+ U,
45
57
  {
46
- $gapX: D ? 2.2 : 3.75,
58
+ $gapX: _ ? 2.2 : 3.75,
47
59
  $gutterX: 4.6875,
48
60
  $background: "YELLOW_4",
49
61
  $borderColor: "BLACK_1",
@@ -51,51 +63,51 @@ const C = [
51
63
  $justifyContent: "space-between",
52
64
  $alignItems: "center",
53
65
  children: [
54
- /* @__PURE__ */ a(M, {}),
55
- o == null ? void 0 : o.map((e) => {
56
- const { id: t, selectedDay: s, selectedTime: r } = e, { day: m, time: l } = E(s, r);
66
+ /* @__PURE__ */ i(Z, {}),
67
+ m == null ? void 0 : m.map((e) => {
68
+ const { id: t, selectedDay: s, selectedTime: r } = e, { day: c, time: p } = X(s, r);
57
69
  return /* @__PURE__ */ d(u, { $widthX: 15, $background: "YELLOW_1", $borderColor: "BLACK_1", children: [
58
70
  /* @__PURE__ */ d(u, { $gapX: 1.65, $gutterX: 2, $flexGapX: 0.25, children: [
59
- /* @__PURE__ */ a(
60
- $,
71
+ /* @__PURE__ */ i(
72
+ C,
61
73
  {
62
74
  renderAs: "primary",
63
75
  label: `Day ${t}`,
64
76
  value: s,
65
- options: b,
77
+ options: A,
66
78
  theme: "dark",
67
79
  shape: "borderLess",
68
80
  isTransparent: !0,
69
- onChange: (i) => _(t, i)
81
+ onChange: (a) => I(t, a)
70
82
  }
71
83
  ),
72
- /* @__PURE__ */ a(
73
- $,
84
+ /* @__PURE__ */ i(
85
+ C,
74
86
  {
75
87
  renderAs: "primary",
76
88
  label: "Time",
77
89
  value: r,
78
- options: Y,
90
+ options: N,
79
91
  shape: "borderLess",
80
92
  isTransparent: !0,
81
93
  theme: "dark",
82
- onChange: (i) => S(t, i)
94
+ onChange: (a) => L(t, a)
83
95
  }
84
96
  )
85
97
  ] }),
86
- /* @__PURE__ */ a(
98
+ /* @__PURE__ */ i(
87
99
  u,
88
100
  {
89
101
  $heightX: 3.125,
90
102
  $gutterX: 2,
91
103
  $justifyContent: "center",
92
104
  $background: "WHITE_T_60",
93
- children: n ? /* @__PURE__ */ d(W, { $renderAs: "ac4-black", $align: "center", children: [
94
- m ? m.slice(0, 3) : "__",
105
+ children: o ? /* @__PURE__ */ d(Y, { $renderAs: "ac4-black", $align: "center", children: [
106
+ c ? c.slice(0, 3) : "__",
95
107
  ", ",
96
- l || "__",
108
+ p || "__",
97
109
  " ",
98
- n ? "(IST)" : ""
110
+ o ? "(IST)" : ""
99
111
  ] }) : null
100
112
  }
101
113
  )
@@ -107,6 +119,6 @@ const C = [
107
119
  ] });
108
120
  });
109
121
  export {
110
- se as default
122
+ pe as default
111
123
  };
112
124
  //# sourceMappingURL=class-preference.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone } = formData || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({ preferences: defaultPreferences });\n }\n }, [isTeacher, preferences, updateSlideConfig]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","updateSlideConfig","useTrialSessionContext","preferences","studentTimezone","daySlots","DAYS","day","timezone","teacherTimezone","handlePreferenceChange","id","field","value","preference","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","jsxs","Styled.Container","jsx","Separator","Sl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gBAAAR;AAAA,kBAACS;AAAA,kBAAA;AAAA,oBACC,UAAS;AAAA,oBACT,OAAO,OAAOnC,CAAE;AAAA,oBAChB,OAAO+B;AAAA,oBACP,SAASrC;AAAA,oBACT,OAAM;AAAA,oBACN,OAAM;AAAA,oBACN,eAAa;AAAA,oBACb,UAAU,CAAAQ,MAASE,EAAgBJ,GAAIE,CAAK;AAAA,kBAAA;AAAA,gBAC9C;AAAA,gBACA,gBAAAwB;AAAA,kBAACS;AAAA,kBAAA;AAAA,oBACC,UAAS;AAAA,oBACT,OAAM;AAAA,oBACN,OAAOH;AAAA,oBACP,SAASI;AAAA,oBACT,OAAM;AAAA,oBACN,eAAa;AAAA,oBACb,OAAM;AAAA,oBACN,UAAU,CAAAlC,MAASG,EAAiBL,GAAIE,CAAK;AAAA,kBAAA;AAAA,gBAC/C;AAAA,cAAA,GACF;AAAA,cACA,gBAAAwB;AAAA,gBAACQ;AAAA,gBAAA;AAAA,kBACC,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,iBAAgB;AAAA,kBAChB,aAAY;AAAA,kBAEX,cACE,gBAAAV,EAAAa,GAAA,EAAK,WAAU,aAAY,QAAO,UAChC,UAAA;AAAA,oBAAAzC,IAAMA,EAAI,MAAM,GAAG,CAAC,IAAI;AAAA,oBAAK;AAAA,oBAAGqC,KAAc;AAAA,oBAAK;AAAA,oBAAE7C,IAAY,UAAU;AAAA,kBAAA,EAAA,CAC9E,IACE;AAAA,gBAAA;AAAA,cACN;AAAA,YAlCa,EAAA,GAAA,QAAQY,CAAE,EAmCzB;AAAA,UAAA;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\nimport { extractDayAndTimeFromEpoch } from './helpers';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, trialHomeData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone = 'Asia/Calcutta' } = formData || {};\n const { demo_info: demoInfo } = trialHomeData || {};\n const { scheduled_start_time: scheduledStartTime } = demoInfo || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const preSelectedDateTimeFromEpoch = useMemo(\n () => (isTeacher ? extractDayAndTimeFromEpoch(scheduledStartTime, studentTimezone) : undefined),\n [isTeacher, scheduledStartTime, studentTimezone],\n );\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({\n preferences: preSelectedDateTimeFromEpoch\n ? defaultPreferences.map((preference: TPreference) =>\n preference.id === 1\n ? {\n ...preference,\n selectedDay: preSelectedDateTimeFromEpoch.day,\n selectedTime: preSelectedDateTimeFromEpoch.time,\n }\n : preference,\n )\n : defaultPreferences,\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [preSelectedDateTimeFromEpoch]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","trialHomeData","updateSlideConfig","useTrialSessionContext","preferences","studentTimezone","demoInfo","scheduledStartTime","daySlots","DAYS","day","timezone","teacherTimezone","preSelectedDateTimeFromEpoch","useMemo","extractDayAndTimeFromEpoch","handlePreferenceChange","id","field","value","preference","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.PreferenceWrapper","Styled.FixedLineSeparator","selectedDay","selectedTime","time","FlexView","SelectInput","timeSlots","Text"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,IAAqB;AAAA,EACzB,EA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;AAAA,UAAA;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -0,0 +1,28 @@
1
+ const m = (o, n) => {
2
+ let r = typeof o == "string" ? parseInt(o, 10) : o, t = typeof n == "string" ? parseInt(n, 10) : n;
3
+ const a = t % 15;
4
+ return a >= 8 ? (t += 15 - a, t === 60 && (t = 0, r += 1, r === 24 && (r = 0))) : t -= a, {
5
+ roundedHour: r.toString().padStart(2, "0"),
6
+ roundedMinute: t.toString().padStart(2, "0")
7
+ };
8
+ }, c = (o, n) => {
9
+ const r = new Date(o), t = {
10
+ weekday: "long",
11
+ hour: "2-digit",
12
+ minute: "2-digit",
13
+ hour12: !0,
14
+ timeZone: n
15
+ }, p = new Intl.DateTimeFormat("en-US", t).formatToParts(r);
16
+ let i = "", d = "", u = "", s = "";
17
+ for (const e of p)
18
+ e.type === "weekday" && (i = e.value), e.type === "hour" && (d = e.value), e.type === "minute" && (u = e.value), e.type === "dayPeriod" && (s = e.value);
19
+ const { roundedHour: f, roundedMinute: l } = m(d, u);
20
+ return {
21
+ day: i,
22
+ time: `${f}:${l} ${s}`
23
+ };
24
+ };
25
+ export {
26
+ c as extractDayAndTimeFromEpoch
27
+ };
28
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../src/features/trial-session/comps/class-preference/helpers.ts"],"sourcesContent":["/**\n * Rounds a given hour and minute to the nearest 15-minute interval.\n * @param hour string or number\n * @param minute string or number\n * @returns { roundedHour: string, roundedMinute: string }\n */\nconst roundToNearest15Min = (\n hour: string | number,\n minute: string | number,\n): { roundedHour: string; roundedMinute: string } => {\n let h = typeof hour === 'string' ? parseInt(hour, 10) : hour;\n let m = typeof minute === 'string' ? parseInt(minute, 10) : minute;\n // Round down to nearest 15\n const remainder = m % 15;\n\n if (remainder >= 8) {\n m += 15 - remainder;\n if (m === 60) {\n m = 0;\n h += 1;\n if (h === 24) h = 0;\n }\n } else {\n m -= remainder;\n }\n\n return {\n roundedHour: h.toString().padStart(2, '0'),\n roundedMinute: m.toString().padStart(2, '0'),\n };\n};\n\n/**\n * Extracts day and time in 'hh:mm AM/PM' format from epoch and timezone.\n * @param epoch Epoch timestamp (number)\n * @param timezone IANA timezone string (e.g., 'Asia/Kolkata')\n * @returns { day: string, time: string }\n */\nconst extractDayAndTimeFromEpoch = (\n epoch: number,\n timezone: string,\n): { day: string; time: string } => {\n // Use Intl.DateTimeFormat for timezone conversion\n const date = new Date(epoch);\n const options: Intl.DateTimeFormatOptions = {\n weekday: 'long',\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n timeZone: timezone,\n };\n const formatter = new Intl.DateTimeFormat('en-US', options);\n const parts = formatter.formatToParts(date);\n let day = '';\n let hour = '';\n let minute = '';\n let period = '';\n\n for (const part of parts) {\n if (part.type === 'weekday') day = part.value;\n\n if (part.type === 'hour') hour = part.value;\n\n if (part.type === 'minute') minute = part.value;\n\n if (part.type === 'dayPeriod') period = part.value;\n }\n const { roundedHour, roundedMinute } = roundToNearest15Min(hour, minute);\n\n return {\n day,\n time: `${roundedHour}:${roundedMinute} ${period}`,\n };\n};\n\nexport { extractDayAndTimeFromEpoch };\n"],"names":["roundToNearest15Min","hour","minute","h","m","remainder","extractDayAndTimeFromEpoch","epoch","timezone","date","options","parts","day","period","part","roundedHour","roundedMinute"],"mappings":"AAMA,MAAMA,IAAsB,CAC1BC,GACAC,MACmD;AACnD,MAAIC,IAAI,OAAOF,KAAS,WAAW,SAASA,GAAM,EAAE,IAAIA,GACpDG,IAAI,OAAOF,KAAW,WAAW,SAASA,GAAQ,EAAE,IAAIA;AAE5D,QAAMG,IAAYD,IAAI;AAEtB,SAAIC,KAAa,KACfD,KAAK,KAAKC,GACND,MAAM,OACJA,IAAA,GACCD,KAAA,GACDA,MAAM,OAAQA,IAAA,OAGfC,KAAAC,GAGA;AAAA,IACL,aAAaF,EAAE,SAAA,EAAW,SAAS,GAAG,GAAG;AAAA,IACzC,eAAeC,EAAE,SAAA,EAAW,SAAS,GAAG,GAAG;AAAA,EAAA;AAE/C,GAQME,IAA6B,CACjCC,GACAC,MACkC;AAE5B,QAAAC,IAAO,IAAI,KAAKF,CAAK,GACrBG,IAAsC;AAAA,IAC1C,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAUF;AAAA,EAAA,GAGNG,IADY,IAAI,KAAK,eAAe,SAASD,CAAO,EAClC,cAAcD,CAAI;AAC1C,MAAIG,IAAM,IACNX,IAAO,IACPC,IAAS,IACTW,IAAS;AAEb,aAAWC,KAAQH;AACjB,IAAIG,EAAK,SAAS,cAAWF,IAAME,EAAK,QAEpCA,EAAK,SAAS,WAAQb,IAAOa,EAAK,QAElCA,EAAK,SAAS,aAAUZ,IAASY,EAAK,QAEtCA,EAAK,SAAS,gBAAaD,IAASC,EAAK;AAE/C,QAAM,EAAE,aAAAC,GAAa,eAAAC,EAAA,IAAkBhB,EAAoBC,GAAMC,CAAM;AAEhE,SAAA;AAAA,IACL,KAAAU;AAAA,IACA,MAAM,GAAGG,CAAW,IAAIC,CAAa,IAAIH,CAAM;AAAA,EAAA;AAEnD;"}
@@ -1,36 +1,36 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import { useCallback as l } from "react";
3
- import y from "../../../ui/arrow-tooltip/arrow-tooltip.js";
4
- import A from "../../../ui/buttons/button/button.js";
3
+ import D from "../../../ui/arrow-tooltip/arrow-tooltip.js";
4
+ import P from "../../../ui/buttons/button/button.js";
5
5
  import d from "../../../ui/buttons/icon-button/icon-button.js";
6
6
  import c from "../../../ui/layout/flex-view.js";
7
7
  import m from "../../../ui/text/text.js";
8
- import { useTrialSessionContext as v } from "../../context/use-trial-session-context.js";
9
- import { useTrialSessionNavigation as w } from "../../hooks/use-trial-session-navigation.js";
10
- import { Container as D, ForwardArrow as j } from "./navigation-bar-styled.js";
11
- import P from "../../../../assets/line-icons/icons/back2.js";
12
- const q = () => {
13
- const { slideConfig: p, buttonState: f, openEndClassModal: b, studentAbsentInClass: a } = v(), {
14
- left: { isDisabled: g, isLoading: u },
15
- right: { isDisabled: x, isLoading: h }
16
- } = f || {}, { prevPage: L, nextPage: $ } = p || {}, { buttonLabel: i, pageId: t } = L || {}, { buttonLabel: r, pageId: n } = $ || {}, { handleNavigation: o } = w(), C = t && !n, I = l(() => {
8
+ import { useTrialSessionContext as j } from "../../context/use-trial-session-context.js";
9
+ import { useTrialSessionNavigation as T } from "../../hooks/use-trial-session-navigation.js";
10
+ import { Container as k, ForwardArrow as _ } from "./navigation-bar-styled.js";
11
+ import z from "../../../../assets/line-icons/icons/back2.js";
12
+ const W = () => {
13
+ const { slideConfig: p, buttonState: f, openEndClassModal: b, studentAbsentInClass: a, trialHomeData: g } = j(), {
14
+ left: { isDisabled: u, isLoading: h },
15
+ right: { isDisabled: x, isLoading: L }
16
+ } = f || {}, { prevPage: I, nextPage: $ } = p || {}, { buttonLabel: i, pageId: t } = I || {}, { buttonLabel: r, pageId: n } = $ || {}, { handleNavigation: o } = T(), C = t && !n, { demo_info: A } = g, { source: B } = A, y = B === "PLA", v = l(() => {
17
17
  o("next", n);
18
- }, [o, n]), B = l(() => {
18
+ }, [o, n]), w = l(() => {
19
19
  o("prev", t);
20
20
  }, [o, t]);
21
21
  return /* @__PURE__ */ s(
22
- D,
22
+ k,
23
23
  {
24
24
  $flexDirection: "row-reverse",
25
25
  $justifyContent: "space-between",
26
26
  $alignItems: "center",
27
27
  children: [
28
28
  C && /* @__PURE__ */ e(
29
- A,
29
+ P,
30
30
  {
31
31
  renderAs: "tertiary",
32
32
  size: "small",
33
- label: "End the class",
33
+ label: y ? "End the session" : "End the class",
34
34
  shape: "square",
35
35
  onClick: b
36
36
  }
@@ -38,7 +38,7 @@ const q = () => {
38
38
  n && r && /* @__PURE__ */ s(c, { $flexDirection: "row", $alignItems: "center", $justifyContent: "center", $flexGap: 12, children: [
39
39
  /* @__PURE__ */ e(m, { $renderAs: "ab2", $color: "BLACK_T_60", children: r }),
40
40
  /* @__PURE__ */ e(
41
- y,
41
+ D,
42
42
  {
43
43
  widthX: 8,
44
44
  zIndex: 2,
@@ -49,13 +49,13 @@ const q = () => {
49
49
  children: /* @__PURE__ */ e(
50
50
  d,
51
51
  {
52
- Icon: j,
52
+ Icon: _,
53
53
  renderAs: "primary",
54
54
  analyticsLabel: r,
55
55
  size: "small",
56
- onClick: I,
56
+ onClick: v,
57
57
  disabled: x || a,
58
- busy: h
58
+ busy: L
59
59
  }
60
60
  )
61
61
  }
@@ -65,13 +65,13 @@ const q = () => {
65
65
  /* @__PURE__ */ e(
66
66
  d,
67
67
  {
68
- Icon: P,
68
+ Icon: z,
69
69
  renderAs: "secondary",
70
70
  analyticsLabel: i,
71
71
  size: "small",
72
- onClick: B,
73
- disabled: g,
74
- busy: u
72
+ onClick: w,
73
+ disabled: u,
74
+ busy: h
75
75
  }
76
76
  ),
77
77
  /* @__PURE__ */ e(m, { $renderAs: "ab2", $color: "BLACK_T_60", children: i })
@@ -81,6 +81,6 @@ const q = () => {
81
81
  );
82
82
  };
83
83
  export {
84
- q as default
84
+ W as default
85
85
  };
86
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/navigation-bar/index.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { useTrialSessionNavigation } from '../../hooks/use-trial-session-navigation';\nimport * as Styled from './navigation-bar-styled';\n\nconst NavigationBar: React.FC = () => {\n const { slideConfig, buttonState, openEndClassModal, studentAbsentInClass } =\n useTrialSessionContext();\n const {\n left: { isDisabled: isLeftBtnDisabled, isLoading: isLeftBtnLoading },\n right: { isDisabled: isRightBtnDisabled, isLoading: isRightBtnLoading },\n } = buttonState || {};\n const { prevPage, nextPage } = slideConfig || {};\n const { buttonLabel: prevButtonLabel, pageId: prevPageId } = prevPage || {};\n const { buttonLabel: nextButtonLabel, pageId: nextPageId } = nextPage || {};\n const { handleNavigation } = useTrialSessionNavigation();\n const isLastPage = prevPageId && !nextPageId;\n\n const handleNext = useCallback(() => {\n handleNavigation('next', nextPageId);\n }, [handleNavigation, nextPageId]);\n\n const handlePrev = useCallback(() => {\n handleNavigation('prev', prevPageId);\n }, [handleNavigation, prevPageId]);\n\n return (\n <Styled.Container\n $flexDirection=\"row-reverse\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n {isLastPage && (\n <Button\n renderAs=\"tertiary\"\n size=\"small\"\n label=\"End the class\"\n shape=\"square\"\n onClick={openEndClassModal}\n />\n )}\n {nextPageId && nextButtonLabel && (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={12}>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n {nextButtonLabel}\n </Text>\n <ArrowTooltip\n widthX={8}\n zIndex={2}\n position=\"top-left\"\n renderAs=\"primary\"\n tooltipItem=\"Waiting for student to join...\"\n hidden={!studentAbsentInClass}\n children={\n <IconButton\n Icon={Styled.ForwardArrow}\n renderAs=\"primary\"\n analyticsLabel={nextButtonLabel}\n size=\"small\"\n onClick={handleNext}\n disabled={isRightBtnDisabled || studentAbsentInClass}\n busy={isRightBtnLoading}\n />\n }\n />\n </FlexView>\n )}\n {prevPageId && prevButtonLabel && (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={12}>\n <IconButton\n Icon={Styled.BackwardArrow}\n renderAs=\"secondary\"\n analyticsLabel={prevButtonLabel}\n size=\"small\"\n onClick={handlePrev}\n disabled={isLeftBtnDisabled}\n busy={isLeftBtnLoading}\n />\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n {prevButtonLabel}\n </Text>\n </FlexView>\n )}\n </Styled.Container>\n );\n};\n\nexport default NavigationBar;\n"],"names":["NavigationBar","slideConfig","buttonState","openEndClassModal","studentAbsentInClass","useTrialSessionContext","isLeftBtnDisabled","isLeftBtnLoading","isRightBtnDisabled","isRightBtnLoading","prevPage","nextPage","prevButtonLabel","prevPageId","nextButtonLabel","nextPageId","handleNavigation","useTrialSessionNavigation","isLastPage","handleNext","useCallback","handlePrev","jsxs","Styled.Container","jsx","Button","FlexView","Text","ArrowTooltip","IconButton","Styled.ForwardArrow","Styled.BackwardArrow"],"mappings":";;;;;;;;;;;AAWA,MAAMA,IAA0B,MAAM;AACpC,QAAM,EAAE,aAAAC,GAAa,aAAAC,GAAa,mBAAAC,GAAmB,sBAAAC,EAAA,IACnDC,KACI;AAAA,IACJ,MAAM,EAAE,YAAYC,GAAmB,WAAWC,EAAiB;AAAA,IACnE,OAAO,EAAE,YAAYC,GAAoB,WAAWC,EAAkB;AAAA,EAAA,IACpEP,KAAe,CAAA,GACb,EAAE,UAAAQ,GAAU,UAAAC,MAAaV,KAAe,CAAA,GACxC,EAAE,aAAaW,GAAiB,QAAQC,EAAW,IAAIH,KAAY,IACnE,EAAE,aAAaI,GAAiB,QAAQC,EAAW,IAAIJ,KAAY,IACnE,EAAE,kBAAAK,MAAqBC,KACvBC,IAAaL,KAAc,CAACE,GAE5BI,IAAaC,EAAY,MAAM;AACnC,IAAAJ,EAAiB,QAAQD,CAAU;AAAA,EAAA,GAClC,CAACC,GAAkBD,CAAU,CAAC,GAE3BM,IAAaD,EAAY,MAAM;AACnC,IAAAJ,EAAiB,QAAQH,CAAU;AAAA,EAAA,GAClC,CAACG,GAAkBH,CAAU,CAAC;AAG/B,SAAA,gBAAAS;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,iBAAgB;AAAA,MAChB,aAAY;AAAA,MAEX,UAAA;A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features/trial-session/comps/navigation-bar/index.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { useTrialSessionNavigation } from '../../hooks/use-trial-session-navigation';\nimport * as Styled from './navigation-bar-styled';\n\nconst NavigationBar: React.FC = () => {\n const { slideConfig, buttonState, openEndClassModal, studentAbsentInClass, trialHomeData } =\n useTrialSessionContext();\n const {\n left: { isDisabled: isLeftBtnDisabled, isLoading: isLeftBtnLoading },\n right: { isDisabled: isRightBtnDisabled, isLoading: isRightBtnLoading },\n } = buttonState || {};\n const { prevPage, nextPage } = slideConfig || {};\n const { buttonLabel: prevButtonLabel, pageId: prevPageId } = prevPage || {};\n const { buttonLabel: nextButtonLabel, pageId: nextPageId } = nextPage || {};\n const { handleNavigation } = useTrialSessionNavigation();\n const isLastPage = prevPageId && !nextPageId;\n\n const { demo_info: demoInfo } = trialHomeData;\n const { source } = demoInfo;\n const isPLASource = source === 'PLA';\n\n const handleNext = useCallback(() => {\n handleNavigation('next', nextPageId);\n }, [handleNavigation, nextPageId]);\n\n const handlePrev = useCallback(() => {\n handleNavigation('prev', prevPageId);\n }, [handleNavigation, prevPageId]);\n\n return (\n <Styled.Container\n $flexDirection=\"row-reverse\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n {isLastPage && (\n <Button\n renderAs=\"tertiary\"\n size=\"small\"\n label={isPLASource ? 'End the session' : 'End the class'}\n shape=\"square\"\n onClick={openEndClassModal}\n />\n )}\n {nextPageId && nextButtonLabel && (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={12}>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n {nextButtonLabel}\n </Text>\n <ArrowTooltip\n widthX={8}\n zIndex={2}\n position=\"top-left\"\n renderAs=\"primary\"\n tooltipItem=\"Waiting for student to join...\"\n hidden={!studentAbsentInClass}\n children={\n <IconButton\n Icon={Styled.ForwardArrow}\n renderAs=\"primary\"\n analyticsLabel={nextButtonLabel}\n size=\"small\"\n onClick={handleNext}\n disabled={isRightBtnDisabled || studentAbsentInClass}\n busy={isRightBtnLoading}\n />\n }\n />\n </FlexView>\n )}\n {prevPageId && prevButtonLabel && (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={12}>\n <IconButton\n Icon={Styled.BackwardArrow}\n renderAs=\"secondary\"\n analyticsLabel={prevButtonLabel}\n size=\"small\"\n onClick={handlePrev}\n disabled={isLeftBtnDisabled}\n busy={isLeftBtnLoading}\n />\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n {prevButtonLabel}\n </Text>\n </FlexView>\n )}\n </Styled.Container>\n );\n};\n\nexport default NavigationBar;\n"],"names":["NavigationBar","slideConfig","buttonState","openEndClassModal","studentAbsentInClass","trialHomeData","useTrialSessionContext","isLeftBtnDisabled","isLeftBtnLoading","isRightBtnDisabled","isRightBtnLoading","prevPage","nextPage","prevButtonLabel","prevPageId","nextButtonLabel","nextPageId","handleNavigation","useTrialSessionNavigation","isLastPage","demoInfo","source","isPLASource","handleNext","useCallback","handlePrev","jsxs","Styled.Container","jsx","Button","FlexView","Text","ArrowTooltip","IconButton","Styled.ForwardArrow","Styled.BackwardArrow"],"mappings":";;;;;;;;;;;AAWA,MAAMA,IAA0B,MAAM;AACpC,QAAM,EAAE,aAAAC,GAAa,aAAAC,GAAa,mBAAAC,GAAmB,sBAAAC,GAAsB,eAAAC,EAAA,IACzEC,KACI;AAAA,IACJ,MAAM,EAAE,YAAYC,GAAmB,WAAWC,EAAiB;AAAA,IACnE,OAAO,EAAE,YAAYC,GAAoB,WAAWC,EAAkB;AAAA,EAAA,IACpER,KAAe,CAAA,GACb,EAAE,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