@cuemath/leap 3.3.31 → 3.3.32-j2

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 (76) hide show
  1. package/dist/features/auth/pla-signup/pla-analytics-events.js +7 -1
  2. package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
  3. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
  4. package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
  5. package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
  6. package/dist/features/milestone/create/milestone-create-helpers.js +13 -7
  7. package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
  8. package/dist/features/student-username/add/add-student-username-constants.js +6 -0
  9. package/dist/features/student-username/add/add-student-username-constants.js.map +1 -0
  10. package/dist/features/student-username/add/add-student-username-helpers.js +6 -0
  11. package/dist/features/student-username/add/add-student-username-helpers.js.map +1 -0
  12. package/dist/features/student-username/add/add-student-username-styled.js +10 -0
  13. package/dist/features/student-username/add/add-student-username-styled.js.map +1 -0
  14. package/dist/features/student-username/add/add-student-username.js +78 -0
  15. package/dist/features/student-username/add/add-student-username.js.map +1 -0
  16. package/dist/features/student-username/add/api/update-username.js +9 -0
  17. package/dist/features/student-username/add/api/update-username.js.map +1 -0
  18. package/dist/features/student-username/add/api/username-availability.js +10 -0
  19. package/dist/features/student-username/add/api/username-availability.js.map +1 -0
  20. package/dist/features/student-username/add/hooks/use-check-username-availability.js +41 -0
  21. package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +1 -0
  22. package/dist/features/trial-session/api/teacher-availability.js +9 -0
  23. package/dist/features/trial-session/api/teacher-availability.js.map +1 -0
  24. package/dist/features/trial-session/comps/class-preference/class-preference.js +61 -49
  25. package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
  26. package/dist/features/trial-session/comps/class-preference/helpers.js +28 -0
  27. package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -0
  28. package/dist/features/trial-session/comps/navigation-bar/index.js +25 -25
  29. package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
  30. package/dist/features/trial-session/comps/school-goals/school-goals.js +55 -53
  31. package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
  32. package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
  33. package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
  34. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +44 -43
  35. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
  36. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +5 -0
  37. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
  38. package/dist/features/trial-session/comps/student-feedback/student-feedback.js +96 -51
  39. package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
  40. package/dist/features/trial-session/comps/student-profile/student-profile.js +70 -63
  41. package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
  42. package/dist/features/trial-session/comps/test-prep/test-prep.js +40 -39
  43. package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
  44. package/dist/features/trial-session/helper.js +69 -53
  45. package/dist/features/trial-session/helper.js.map +1 -1
  46. package/dist/features/trial-session/hooks/use-slide-config-update.js +49 -0
  47. package/dist/features/trial-session/hooks/use-slide-config-update.js.map +1 -0
  48. package/dist/features/trial-session/hooks/use-trial-session-navigation.js +150 -130
  49. package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
  50. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  51. package/dist/features/trial-session/trial-session-view.js +103 -112
  52. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  53. package/dist/features/ui/accordion/accordion-items/accordion-items.js +13 -13
  54. package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -1
  55. package/dist/features/utils/utils.js +1 -1
  56. package/dist/features/utils/utils.js.map +1 -1
  57. package/dist/index.d.ts +20 -4
  58. package/dist/index.js +32 -30
  59. package/dist/index.js.map +1 -1
  60. package/dist/node_modules/decode-uri-component/index.js.map +1 -0
  61. package/dist/node_modules/query-string/base.js +1 -1
  62. package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
  63. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
  64. package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
  65. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  66. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
  67. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  68. package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
  69. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  70. package/package.json +3 -2
  71. package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
  72. package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
  73. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
  74. package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
  75. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
  76. /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
@@ -1,38 +1,52 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { memo as E, useMemo as T, useCallback as _, useEffect as b } from "react";
3
- import { ILLUSTRATIONS as p } from "../../../../assets/illustrations/illustrations.js";
4
- import { COURSE_STREAMS as x, PREFERENCE_CATEGORY as S } from "../../../milestone/constants.js";
5
- import { getPreferencesFromConfig as A } from "../../../milestone/create/milestone-create-helpers.js";
6
- import l from "../../../ui/image/image.js";
7
- import w from "../../../ui/layout/flex-view.js";
8
- import k from "../../../ui/separator/separator.js";
9
- import B from "../../../ui/text/text.js";
10
- import { useTrialSessionContext as I } from "../../context/use-trial-session-context.js";
11
- import R from "../slide-header/index.js";
12
- import { studentLevels as N } from "./student-feedback-constants.js";
13
- import { Container as F, FeedbackWrapper as O, BalloonWrapper as X, Feedback as G, InlineText as H } from "./student-feedback-styled.js";
14
- const J = E(() => {
15
- const { formData: h, milestoneConfig: s, updateSlideConfig: c, updateButtonState: d } = I(), { grade: m, personalizedLevel: r = [] } = h || {}, f = r.length > 0, o = T(
16
- () => A(s, {
17
- grade: m ?? "",
18
- courseStream: x.MATH,
19
- preferenceCategory: S.LEVEL
1
+ import { jsxs as r, jsx as e, Fragment as H } from "react/jsx-runtime";
2
+ import { memo as P, useMemo as E, useCallback as v, useEffect as D } from "react";
3
+ import { ILLUSTRATIONS as _ } from "../../../../assets/illustrations/illustrations.js";
4
+ import { LOTTIE as W } from "../../../../assets/lottie/lottie.js";
5
+ import { COURSE_STREAMS as C, PREFERENCE_CATEGORY as $ } from "../../../milestone/constants.js";
6
+ import { getPreferencesFromConfig as b } from "../../../milestone/create/milestone-create-helpers.js";
7
+ import c from "../../../ui/image/image.js";
8
+ import X from "../../../ui/layout/flex-view.js";
9
+ import K from "../../../ui/lottie-animation/lottie-animation.js";
10
+ import y from "../../../ui/separator/separator.js";
11
+ import d from "../../../ui/text/text.js";
12
+ import { useTrialSessionContext as z } from "../../context/use-trial-session-context.js";
13
+ import { TrialPageId as G } from "../../trial-session-constants.js";
14
+ import M from "../slide-header/index.js";
15
+ import { studentLevels as j, PREFERENCE_CODE_MAP as U } from "./student-feedback-constants.js";
16
+ import { Container as V, FeedbackWrapper as q, BalloonWrapper as Y, Feedback as J, InlineText as Q } from "./student-feedback-styled.js";
17
+ const he = P(() => {
18
+ const { slideConfig: A, formData: S, milestoneConfig: a, updateSlideConfig: m, updateButtonState: p } = z(), { id: I } = A || {}, { grade: s, personalizedLevel: f = [], personalizedPosition: g = [] } = S || {}, t = I === G.STUDENT_LEVEL, h = t ? g.length > 0 : f.length > 0, k = E(
19
+ () => b(a, {
20
+ grade: s ?? "",
21
+ courseStream: C.MATH,
22
+ preferenceCategory: $.LEVEL
20
23
  }),
21
- [m, s]
22
- ), g = _(
24
+ [s, a]
25
+ ), x = E(
26
+ () => b(a, {
27
+ grade: s ?? "",
28
+ courseStream: C.MATH,
29
+ preferenceCategory: $.POSITION
30
+ }),
31
+ [s, a]
32
+ ), l = t ? x : k, N = v(
23
33
  (i) => {
24
- c({ personalizedLevel: [i] });
34
+ const n = t ? {
35
+ personalizedPosition: [i],
36
+ personalizedLevel: [U[i]]
37
+ } : { personalizedLevel: [i] };
38
+ m(n);
25
39
  },
26
- [c]
40
+ [t, m]
27
41
  );
28
- return b(() => {
29
- d("right", { isDisabled: !f, isLoading: !1 });
30
- }, [f, d]), /* @__PURE__ */ t(F, { children: [
31
- /* @__PURE__ */ e(k, { height: 60 }),
32
- /* @__PURE__ */ e(R, {}),
33
- /* @__PURE__ */ t(O, { $flexGapX: 1, $gapX: 2.25, $gutterX: 3.125, children: [
34
- /* @__PURE__ */ t(
35
- X,
42
+ return D(() => {
43
+ p("right", { isDisabled: !h, isLoading: !1 });
44
+ }, [h, p]), /* @__PURE__ */ r(V, { children: [
45
+ /* @__PURE__ */ e(y, { height: 60 }),
46
+ /* @__PURE__ */ e(M, {}),
47
+ /* @__PURE__ */ r(q, { $flexGapX: 1, $gapX: 2.25, $gutterX: 3.125, children: [
48
+ /* @__PURE__ */ r(
49
+ Y,
36
50
  {
37
51
  $flexDirection: "row",
38
52
  $justifyContent: "space-between",
@@ -40,20 +54,20 @@ const J = E(() => {
40
54
  $gutterX: 0.75,
41
55
  children: [
42
56
  /* @__PURE__ */ e(
43
- l,
57
+ c,
44
58
  {
45
59
  withLoader: !0,
46
- src: p.GREEN_BALLOON,
60
+ src: _.GREEN_BALLOON,
47
61
  width: 28,
48
62
  height: 34,
49
63
  alt: "balloon"
50
64
  }
51
65
  ),
52
66
  /* @__PURE__ */ e(
53
- l,
67
+ c,
54
68
  {
55
69
  withLoader: !0,
56
- src: p.GREEN_BALLOON,
70
+ src: _.GREEN_BALLOON,
57
71
  width: 28,
58
72
  height: 34,
59
73
  alt: "balloon"
@@ -62,39 +76,70 @@ const J = E(() => {
62
76
  ]
63
77
  }
64
78
  ),
65
- o && o.length > 0 && o.map((i) => {
66
- const { id: a, label: u } = i, { title: C, description: $, icon: L } = N[u.toLowerCase()] || {}, n = r == null ? void 0 : r.includes(a);
67
- return /* @__PURE__ */ t(
68
- G,
79
+ l && l.length > 0 && l.map((i) => {
80
+ var u;
81
+ const { id: n, label: T, lottie: L, description: w } = i, { title: O, description: B, icon: R } = j[T.toLowerCase()] || {}, o = (u = t ? g : f) == null ? void 0 : u.includes(n), F = {
82
+ loop: !1,
83
+ autoplay: o
84
+ };
85
+ return /* @__PURE__ */ r(
86
+ J,
69
87
  {
70
88
  $flexDirection: "row",
71
89
  $alignItems: "center",
72
90
  $justifyContent: "flex-start",
73
91
  $flexGapX: 1.25,
74
- onClick: () => g(a),
92
+ onClick: () => N(n),
75
93
  $gutterX: 0.75,
76
94
  $gapX: 1,
77
- $background: n ? "BLACK_T_87" : "WHITE_1",
95
+ $background: o ? "BLACK_T_87" : "WHITE_1",
78
96
  $borderColor: "BLACK_T_87",
79
97
  children: [
80
- /* @__PURE__ */ e(l, { withLoader: !0, src: L, height: 64, width: 64, alt: "icon" }),
81
- /* @__PURE__ */ e(w, { $flex: 1, children: /* @__PURE__ */ t(
82
- B,
98
+ L ? /* @__PURE__ */ e(
99
+ K,
100
+ {
101
+ src: W[L],
102
+ height: 64,
103
+ width: 64,
104
+ settings: F
105
+ }
106
+ ) : /* @__PURE__ */ e(c, { withLoader: !0, src: R, height: 64, width: 64, alt: "icon" }),
107
+ /* @__PURE__ */ e(X, { $flex: 1, children: t ? /* @__PURE__ */ r(H, { children: [
108
+ /* @__PURE__ */ e(
109
+ d,
110
+ {
111
+ className: "feedback-title",
112
+ $renderAs: "ac3-black",
113
+ $color: o ? "WHITE_T_87" : "BLACK_T_87",
114
+ children: T
115
+ }
116
+ ),
117
+ /* @__PURE__ */ e(
118
+ d,
119
+ {
120
+ className: "feedback-desc",
121
+ $renderAs: "ab2",
122
+ $color: o ? "WHITE_T_87" : "BLACK_T_87",
123
+ children: w
124
+ }
125
+ )
126
+ ] }) : /* @__PURE__ */ r(
127
+ d,
83
128
  {
84
129
  className: "feedback-title",
85
130
  $renderAs: "ac3-black",
86
- $color: n ? "WHITE_T_87" : "BLACK_T_87",
131
+ $color: o ? "WHITE_T_87" : "BLACK_T_87",
87
132
  children: [
88
- C,
133
+ O,
89
134
  ":",
90
135
  " ",
91
136
  /* @__PURE__ */ e(
92
- H,
137
+ Q,
93
138
  {
94
139
  className: "feedback-desc",
95
140
  $renderAs: "ab2",
96
- $color: n ? "WHITE_T_60" : "BLACK_T_60",
97
- children: $
141
+ $color: o ? "WHITE_T_60" : "BLACK_T_60",
142
+ children: B
98
143
  }
99
144
  )
100
145
  ]
@@ -102,13 +147,13 @@ const J = E(() => {
102
147
  ) })
103
148
  ]
104
149
  },
105
- a
150
+ n
106
151
  );
107
152
  })
108
153
  ] })
109
154
  ] });
110
155
  });
111
156
  export {
112
- J as default
157
+ he as default
113
158
  };
114
159
  //# sourceMappingURL=student-feedback.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-feedback.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\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 SlideHeader from '../slide-header';\nimport { studentLevels } from './student-feedback-constants';\nimport * as Styled from './student-feedback-styled';\n\nconst StudentFeedback = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { grade, personalizedLevel = [] } = formData || {};\n const hasRequiredFields = Boolean(personalizedLevel.length > 0);\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }),\n [grade, milestoneConfig],\n );\n\n const handleClick = useCallback(\n (id: string) => {\n updateSlideConfig({ personalizedLevel: [id] });\n },\n [updateSlideConfig],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.FeedbackWrapper $flexGapX={1} $gapX={2.25} $gutterX={3.125}>\n <Styled.BalloonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gutterX={0.75}\n >\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n </Styled.BalloonWrapper>\n {levelList &&\n levelList.length > 0 &&\n levelList.map(level => {\n const { id, label } = level;\n const { title, description, icon } = studentLevels[label.toLowerCase()] || {};\n const isSelected = personalizedLevel?.includes(id);\n\n return (\n <Styled.Feedback\n key={id}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $flexGapX={1.25}\n onClick={() => handleClick(id)}\n $gutterX={0.75}\n $gapX={1}\n $background={isSelected ? 'BLACK_T_87' : 'WHITE_1'}\n $borderColor=\"BLACK_T_87\"\n >\n <Image withLoader src={icon} height={64} width={64} alt=\"icon\" />\n <FlexView $flex={1}>\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {title}:{' '}\n <Styled.InlineText\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_60' : 'BLACK_T_60'}\n >\n {description}\n </Styled.InlineText>\n </Text>\n </FlexView>\n </Styled.Feedback>\n );\n })}\n </Styled.FeedbackWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentFeedback;\n"],"names":["StudentFeedback","memo","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","grade","personalizedLevel","hasRequiredFields","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","handleClick","useCallback","id","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.FeedbackWrapper","Styled.BalloonWrapper","Image","ILLUSTRATIONS","level","label","title","description","icon","studentLevels","isSelected","Styled.Feedback","FlexView","Text","Styled.InlineText"],"mappings":";;;;;;;;;;;;;AAcM,MAAAA,IAAkBC,EAAK,MAAM;AACjC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACpDC,KAEI,EAAE,OAAAC,GAAO,mBAAAC,IAAoB,CAAG,EAAA,IAAIN,KAAY,CAAA,GAChDO,IAA4BD,EAAkB,SAAS,GAEvDE,IAAYC;AAAA,IAChB,MACEC,EAAyBT,GAAiB;AAAA,MACxC,OAAOI,KAAS;AAAA,MAChB,cAAcM,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACP,GAAOJ,CAAe;AAAA,EAAA,GAGnBY,IAAcC;AAAA,IAClB,CAACC,MAAe;AACd,MAAAb,EAAkB,EAAE,mBAAmB,CAACa,CAAE,EAAG,CAAA;AAAA,IAC/C;AAAA,IACA,CAACb,CAAiB;AAAA,EAAA;AAGpB,SAAAc,EAAU,MAAM;AACd,IAAAb,EAAkB,SAAS,EAAE,YAAY,CAACI,GAAmB,WAAW,IAAO;AAAA,EAAA,GAC9E,CAACA,GAAmBJ,CAAiB,CAAC,GAGvC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Ab,EAAAK,GAAA,EAAM,YAAU,IAAC,KAAKM,GAAM,QAAQ,IAAI,OAAO,IAAI,KAAI,OAAO,CAAA;AAAA,cAC/D,gBAAAX,EAACe,GAAS,EAAA,OAAO,GACf,UAAA,gBAAAjB;AAAA,gBAACkB;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,WAAU;AAAA,kBACV,QAAQH,IAAa,eAAe;AAAA,kBAEnC,UAAA;AAAA,oBAAAJ;AAAA,oBAAM;AAAA,oBAAE;AAAA,oBACT,gBAAAT;AAAA,sBAACiB;AAAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,WAAU;AAAA,wBACV,QAAQJ,IAAa,eAAe;AAAA,wBAEnC,UAAAH;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,GAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,UA3BKd;AAAA,QAAA;AAAA,MA4BP,CAEH;AAAA,IAAA,GACL;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"student-feedback.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../../assets/lottie/lottie';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { PREFERENCE_CODE_MAP, studentLevels } from './student-feedback-constants';\nimport * as Styled from './student-feedback-styled';\n\nconst StudentFeedback = memo(() => {\n const { slideConfig, formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { id: slideId } = slideConfig || {};\n const { grade, personalizedLevel = [], personalizedPosition = [] } = formData || {};\n const isStudentLevel = slideId === TrialPageId.STUDENT_LEVEL;\n const hasRequiredFields = Boolean(\n isStudentLevel ? personalizedPosition.length > 0 : personalizedLevel.length > 0,\n );\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }),\n [grade, milestoneConfig],\n );\n\n const positionList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.POSITION,\n }),\n [grade, milestoneConfig],\n );\n\n const studentOptions = isStudentLevel ? positionList : levelList;\n\n const handleClick = useCallback(\n (id: string) => {\n const configToUpdate = isStudentLevel\n ? {\n personalizedPosition: [id],\n personalizedLevel: [PREFERENCE_CODE_MAP[id as keyof typeof PREFERENCE_CODE_MAP]],\n }\n : { personalizedLevel: [id] };\n\n updateSlideConfig(configToUpdate);\n },\n [isStudentLevel, updateSlideConfig],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.FeedbackWrapper $flexGapX={1} $gapX={2.25} $gutterX={3.125}>\n <Styled.BalloonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gutterX={0.75}\n >\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n </Styled.BalloonWrapper>\n {studentOptions &&\n studentOptions.length > 0 &&\n studentOptions.map(level => {\n const { id, label, lottie, description: levelDescription } = level;\n const { title, description, icon } = studentLevels[label.toLowerCase()] || {};\n const isSelected = (\n isStudentLevel ? personalizedPosition : personalizedLevel\n )?.includes(id);\n\n const animationSettings = {\n loop: false,\n autoplay: isSelected,\n };\n\n return (\n <Styled.Feedback\n key={id}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $flexGapX={1.25}\n onClick={() => handleClick(id)}\n $gutterX={0.75}\n $gapX={1}\n $background={isSelected ? 'BLACK_T_87' : 'WHITE_1'}\n $borderColor=\"BLACK_T_87\"\n >\n {lottie ? (\n <LottieAnimation\n src={LOTTIE[lottie]}\n height={64}\n width={64}\n settings={animationSettings}\n />\n ) : (\n <Image withLoader src={icon} height={64} width={64} alt=\"icon\" />\n )}\n <FlexView $flex={1}>\n {isStudentLevel ? (\n <>\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {label}\n </Text>\n <Text\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {levelDescription}\n </Text>\n </>\n ) : (\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {title}:{' '}\n <Styled.InlineText\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_60' : 'BLACK_T_60'}\n >\n {description}\n </Styled.InlineText>\n </Text>\n )}\n </FlexView>\n </Styled.Feedback>\n );\n })}\n </Styled.FeedbackWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentFeedback;\n"],"names":["StudentFeedback","memo","slideConfig","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","slideId","grade","personalizedLevel","personalizedPosition","isStudentLevel","TrialPageId","hasRequiredFields","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","positionList","studentOptions","handleClick","useCallback","id","configToUpdate","PREFERENCE_CODE_MAP","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.FeedbackWrapper","Styled.BalloonWrapper","Image","ILLUSTRATIONS","level","label","lottie","levelDescription","title","description","icon","studentLevels","isSelected","_a","animationSettings","Styled.Feedback","LottieAnimation","LOTTIE","FlexView","Fragment","Text","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;AAiBM,MAAAA,KAAkBC,EAAK,MAAM;AACjC,QAAM,EAAE,aAAAC,GAAa,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACjEC,KAEI,EAAE,IAAIC,MAAYN,KAAe,CAAA,GACjC,EAAE,OAAAO,GAAO,mBAAAC,IAAoB,CAAC,GAAG,sBAAAC,IAAuB,GAAO,IAAAR,KAAY,IAC3ES,IAAiBJ,MAAYK,EAAY,eACzCC,IACJF,IAAiBD,EAAqB,SAAS,IAAID,EAAkB,SAAS,GAG1EK,IAAYC;AAAA,IAChB,MACEC,EAAyBb,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcS,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACV,GAAOL,CAAe;AAAA,EAAA,GAGnBgB,IAAeJ;AAAA,IACnB,MACEC,EAAyBb,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcS,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACV,GAAOL,CAAe;AAAA,EAAA,GAGnBiB,IAAiBT,IAAiBQ,IAAeL,GAEjDO,IAAcC;AAAA,IAClB,CAACC,MAAe;AACd,YAAMC,IAAiBb,IACnB;AAAA,QACE,sBAAsB,CAACY,CAAE;AA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kBACV,QAAQR,IAAa,eAAe;AAAA,kBAEnC,UAAA;AAAA,oBAAAJ;AAAA,oBAAM;AAAA,oBAAE;AAAA,oBACT,gBAAAX;AAAA,sBAACwB;AAAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,WAAU;AAAA,wBACV,QAAQT,IAAa,eAAe;AAAA,wBAEnC,UAAAH;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,GAGN;AAAA,YAAA;AAAA,UAAA;AAAA,UAvDKlB;AAAA,QAAA;AAAA,MAwDP,CAEH;AAAA,IAAA,GACL;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,95 +1,102 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { memo as H, useMemo as L, useCallback as k, useEffect as d } from "react";
3
- import { ILLUSTRATIONS as f } from "../../../../assets/illustrations/illustrations.js";
4
- import { GOAL_CATEGORY as $ } from "../../../milestone/constants.js";
5
- import N from "../../../ui/error/error.js";
6
- import U from "../../../ui/image/image.js";
7
- import C from "../../../ui/layout/flex-view.js";
8
- import v from "../../../ui/loader/app-loader/app-loader.js";
9
- import M from "../../../ui/separator/separator.js";
10
- import I from "../../../ui/text/text.js";
11
- import { useGetStudentProfileSummary as W } from "../../api/student-profile-summary.js";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { memo as N, useMemo as C, useCallback as U, useEffect as f } from "react";
3
+ import { ILLUSTRATIONS as c } from "../../../../assets/illustrations/illustrations.js";
4
+ import { GOAL_CATEGORY as L } from "../../../milestone/constants.js";
5
+ import W from "../../../ui/error/error.js";
6
+ import v from "../../../ui/image/image.js";
7
+ import A from "../../../ui/layout/flex-view.js";
8
+ import K from "../../../ui/loader/app-loader/app-loader.js";
9
+ import I from "../../../ui/separator/separator.js";
10
+ import p from "../../../ui/text/text.js";
11
+ import { useGetStudentProfileSummary as M } from "../../api/student-profile-summary.js";
12
12
  import { useTrialSessionContext as X } from "../../context/use-trial-session-context.js";
13
- import { getFormattedStudentPersonalizedPreference as K } from "../../helper.js";
13
+ import { getFormattedStudentPersonalizedPreference as y } from "../../helper.js";
14
14
  import j from "../slide-header/index.js";
15
15
  import { GOAL_MAPPING as z } from "./constant.js";
16
16
  import F from "./student-profile-highlights/student-profile-highlights.js";
17
- import { Container as V, ContentWrapper as y, AbsoluteImage as Y, ImageWrapper as q } from "./student-profile-styled.js";
18
- import { getDummyProfileImage as J, getMilestoneGoalName as A } from "./student-profile-utils.js";
19
- const he = H(() => {
17
+ import { Container as V, ContentWrapper as b, AbsoluteImage as Y, ImageWrapper as q } from "./student-profile-styled.js";
18
+ import { getDummyProfileImage as J, getMilestoneGoalName as G } from "./student-profile-utils.js";
19
+ const he = N(() => {
20
20
  const {
21
- isTeacher: o,
21
+ isTeacher: n,
22
22
  studentId: u,
23
- formData: b,
24
- slideConfig: G,
25
- milestoneConfig: c,
26
- updateSlideConfig: p,
27
- updateButtonState: g
28
- } = X(), { showProfileHighlights: r } = G, {
29
- name: O,
23
+ formData: O,
24
+ slideConfig: T,
25
+ milestoneConfig: m,
26
+ updateSlideConfig: g,
27
+ updateButtonState: h
28
+ } = X(), { showProfileHighlights: r } = T, {
29
+ name: x,
30
30
  goals: t = [],
31
- studentProfile: i,
32
- personalizedLevel: h = [],
33
- personalizedObjectives: P = []
34
- } = b || {}, { dummyProfileImageIndex: x, profileSummary: R } = i || {}, T = J(x), m = L(() => t && t.length > 0 ? {
35
- school_success_goal: A(t, $.SCHOOL_SUCCESS),
36
- test_prep_goal: A(t, $.TEST_PREP)
31
+ studentProfile: a,
32
+ personalizedObjectives: P = [],
33
+ personalizedPosition: _ = []
34
+ } = O || {}, { dummyProfileImageIndex: R, profileSummary: w } = a || {}, B = J(R), l = C(() => t && t.length > 0 ? {
35
+ school_success_goal: G(t, L.SCHOOL_SUCCESS),
36
+ test_prep_goal: G(t, L.TEST_PREP)
37
37
  } : null, [t]), {
38
38
  get: S,
39
- data: w,
40
- isProcessing: l,
41
- isProcessed: _,
42
- isProcessingFailed: D
43
- } = W(), { profile_summary: E } = w || {}, s = k(() => {
44
- m && S(u, m);
45
- }, [S, m, u]);
46
- d(() => {
47
- g("right", { isDisabled: l, isLoading: !1 });
48
- }, [l, g]), d(() => {
49
- o && !i && !r && s();
50
- }, [s, o, i, r]), d(() => {
51
- o && _ && !r && p({
39
+ data: D,
40
+ isProcessing: s,
41
+ isProcessed: $,
42
+ isProcessingFailed: H
43
+ } = M(), { profile_summary: E } = D || {}, d = U(() => {
44
+ l && S(u, l);
45
+ }, [S, l, u]);
46
+ f(() => {
47
+ h("right", { isDisabled: s, isLoading: !1 });
48
+ }, [s, h]), f(() => {
49
+ n && !a && !r && d();
50
+ }, [d, n, a, r]), f(() => {
51
+ n && $ && !r && g({
52
52
  studentProfile: {
53
53
  profileSummary: E || "",
54
54
  dummyProfileImageIndex: Math.floor(Math.random() * 6)
55
55
  }
56
56
  });
57
- }, [_, o, r, E, p]);
58
- const B = L(
57
+ }, [$, n, r, E, g]);
58
+ const k = C(
59
59
  () => [
60
60
  {
61
- title: "Studnet Level",
62
- description: `Catching up: ${h[0]}`,
63
- illustration: f.KNOWLEDGE_BLUE,
61
+ title: "Student Level",
62
+ description: `Catching up: ${y(
63
+ m,
64
+ _
65
+ ).map((o) => o.preference_description)}`,
66
+ illustration: c.KNOWLEDGE_BLUE,
64
67
  background: "BLUE_1"
65
68
  },
66
69
  {
67
- illustration: f.ARROW_BOARD_GREEN,
70
+ illustration: c.ARROW_BOARD_GREEN,
68
71
  background: "GREEN_1",
69
72
  title: "Goals",
70
- description: K(
71
- c,
73
+ description: y(
74
+ m,
72
75
  P
73
- ).map((n) => n.preference_name)
76
+ ).map((o) => o.preference_name)
74
77
  },
75
78
  {
76
- illustration: f.BOOK_CHECKED_PURPLE,
79
+ illustration: c.BOOK_CHECKED_PURPLE,
77
80
  background: "PURPLE_1",
78
81
  title: "Learning Plan",
79
82
  description: t.map(
80
- (n) => `${z[n.goal_category]}: ${n.milestone_name}`
83
+ (o) => `${z[o.goal_category]}: ${o.milestone_name}`
81
84
  )
82
85
  }
83
86
  ],
84
- [t, c, h, P]
87
+ [t, m, P, _]
85
88
  );
86
- return D ? /* @__PURE__ */ e(N, { height: "70vh", onTryAgain: s }) : l || !i && !r ? /* @__PURE__ */ e(v, { height: "100vh" }) : /* @__PURE__ */ a(V, { children: [
87
- /* @__PURE__ */ e(M, { height: 60 }),
89
+ return H ? /* @__PURE__ */ e(W, { height: "70vh", onTryAgain: d }) : s || !a && !r ? /* @__PURE__ */ e(K, { height: "100vh" }) : /* @__PURE__ */ i(V, { children: [
90
+ /* @__PURE__ */ e(I, { height: 60 }),
88
91
  /* @__PURE__ */ e(j, { marginBottom: r ? 50 : 100 }),
89
- r ? /* @__PURE__ */ e(y, { $width: 650, children: /* @__PURE__ */ e(F, { profileHighlights: B }) }) : /* @__PURE__ */ a(y, { $widthX: 46.875, children: [
92
+ r ? /* @__PURE__ */ i(b, { $width: 650, children: [
93
+ /* @__PURE__ */ e(F, { profileHighlights: k }),
94
+ /* @__PURE__ */ e(I, { height: 16 }),
95
+ /* @__PURE__ */ e(p, { $renderAs: "ub3", $color: "BLACK_T_60", $align: "center", children: "We can always revisit this later" })
96
+ ] }) : /* @__PURE__ */ i(b, { $widthX: 46.875, children: [
90
97
  /* @__PURE__ */ e(Y, {}),
91
- /* @__PURE__ */ a(
92
- C,
98
+ /* @__PURE__ */ i(
99
+ A,
93
100
  {
94
101
  $width: "100%",
95
102
  $heightX: 21.875,
@@ -101,10 +108,10 @@ const he = H(() => {
101
108
  $borderColor: "BLACK_T_87",
102
109
  $borderRadiusX: 0.5,
103
110
  children: [
104
- /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(U, { withLoader: !0, height: 200, width: 200, src: T }) }),
105
- /* @__PURE__ */ a(C, { $flexGap: 16, children: [
106
- /* @__PURE__ */ e(I, { $renderAs: "ac2-black", children: O }),
107
- /* @__PURE__ */ e(I, { $renderAs: "ab1", children: R || "" })
111
+ /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(v, { withLoader: !0, height: 200, width: 200, src: B }) }),
112
+ /* @__PURE__ */ i(A, { $flexGap: 16, children: [
113
+ /* @__PURE__ */ e(p, { $renderAs: "ac2-black", children: x }),
114
+ /* @__PURE__ */ e(p, { $renderAs: "ab1", children: w || "" })
108
115
  ] })
109
116
  ]
110
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { TGoalCategory } from '../../../milestone/create/milestone-create-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetStudentProfileSummary } from '../../api/student-profile-summary';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { GOAL_MAPPING } from './constant';\nimport StudentProfileHighlights from './student-profile-highlights/student-profile-highlights';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst StudentProfile = memo(() => {\n const {\n isTeacher,\n studentId,\n formData,\n slideConfig,\n milestoneConfig,\n updateSlideConfig,\n updateButtonState,\n } = useTrialSessionContext();\n const { showProfileHighlights } = slideConfig;\n\n const {\n name,\n goals = [],\n studentProfile,\n personalizedLevel = [],\n personalizedObjectives = [],\n } = formData || {};\n const { dummyProfileImageIndex, profileSummary } = studentProfile || {};\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n\n const payload = useMemo<IGetStudentProfileSummaryQuery | null>(() => {\n if (goals && goals.length > 0) {\n return {\n school_success_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.SCHOOL_SUCCESS),\n test_prep_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.TEST_PREP),\n };\n }\n\n return null;\n }, [goals]);\n\n const {\n get: getStudentProfileSummary,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useGetStudentProfileSummary();\n const { profile_summary: studentProfileSummary } = data || {};\n\n const fetchData = useCallback(() => {\n if (payload) {\n getStudentProfileSummary(studentId, payload);\n }\n }, [getStudentProfileSummary, payload, studentId]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, updateButtonState]);\n\n useEffect(() => {\n if (isTeacher && !studentProfile && !showProfileHighlights) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile, showProfileHighlights]);\n\n useEffect(() => {\n if (isTeacher && isProcessed && !showProfileHighlights) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, showProfileHighlights, studentProfileSummary, updateSlideConfig]);\n\n const profileHighlights: TProfileHighlight[] = useMemo(\n () => [\n {\n title: 'Studnet Level',\n description: `Catching up: ${personalizedLevel[0]}`,\n illustration: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n background: 'BLUE_1',\n },\n {\n illustration: ILLUSTRATIONS.ARROW_BOARD_GREEN,\n background: 'GREEN_1',\n title: 'Goals',\n description: getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedObjectives,\n ).map(objectives => objectives.preference_name),\n },\n {\n illustration: ILLUSTRATIONS.BOOK_CHECKED_PURPLE,\n background: 'PURPLE_1',\n title: 'Learning Plan',\n description: goals.map(\n goal => `${GOAL_MAPPING[goal.goal_category as TGoalCategory]}: ${goal.milestone_name}`,\n ),\n },\n ],\n [goals, milestoneConfig, personalizedLevel, personalizedObjectives],\n );\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || (!studentProfile && !showProfileHighlights)) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={showProfileHighlights ? 50 : 100} />\n {showProfileHighlights ? (\n <Styled.ContentWrapper $width={650}>\n <StudentProfileHighlights profileHighlights={profileHighlights} />\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper $widthX={46.875}>\n <Styled.AbsoluteImage />\n <FlexView\n $width=\"100%\"\n $heightX={21.875}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={1.5}\n $gutterX={1.5}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.ImageWrapper>\n <Image withLoader height={200} width={200} src={dummyProfileImage} />\n </Styled.ImageWrapper>\n <FlexView $flexGap={16}>\n <Text $renderAs=\"ac2-black\">{name}</Text>\n <Text $renderAs=\"ab1\">{profileSummary || ''}</Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","slideConfig","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","showProfileHighlights","name","goals","studentProfile","personalizedLevel","personalizedObjectives","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","profileHighlights","ILLUSTRATIONS","getFormattedStudentPersonalizedPreference","objectives","goal","GOAL_MAPPING","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","StudentProfileHighlights","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image","Text"],"mappings":";;;;;;;;;;;;;;;;;;AA8BM,MAAAA,KAAiBC,EAAK,MAAM;AAC1B,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,uBAAAC,EAA0B,IAAAL,GAE5B;AAAA,IACJ,MAAAM;AAAA,IACA,OAAAC,IAAQ,CAAC;AAAA,IACT,gBAAAC;AAAA,IACA,mBAAAC,IAAoB,CAAC;AAAA,IACrB,wBAAAC,IAAyB,CAAC;AAAA,EAAA,IACxBX,KAAY,CAAA,GACV,EAAE,wBAAAY,GAAwB,gBAAAC,MAAmBJ,KAAkB,CAAA,GAC/DK,IAAoBC,EAAqBH,CAAsB,GAE/DI,IAAUC,EAA+C,MACzDT,KAASA,EAAM,SAAS,IACnB;AAAA,IACL,qBAAqBU,EAAqBV,GAAOW,EAAc,cAAc;AAAA,IAC7E,gBAAgBD,EAAqBV,GAAOW,EAAc,SAAS;AAAA,EAAA,IAIhE,MACN,CAACX,CAAK,CAAC,GAEJ;AAAA,IACJ,KAAKY;AAAA,IACL,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAA4B,GAC1B,EAAE,iBAAiBC,MAA0BL,KAAQ,CAAA,GAErDM,IAAYC,EAAY,MAAM;AAClC,IAAIZ,KACFI,EAAyBrB,GAAWiB,CAAO;AAAA,EAE5C,GAAA,CAACI,GAA0BJ,GAASjB,CAAS,CAAC;AAEjD,EAAA8B,EAAU,MAAM;AACd,IAAAzB,EAAkB,SAAS,EAAE,YAAYkB,GAAc,WAAW,IAAO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C,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAJ,EAAAK,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,IACtB,gBAAAL,EAAAM,GAAA,EAAY,cAAcpC,IAAwB,KAAK,KAAK;AAAA,IAC5DA,IACE,gBAAA8B,EAAAO,GAAA,EAAsB,QAAQ,KAC7B,UAAA,gBAAAP,EAACQ,GAAyB,EAAA,mBAAAd,EAAsC,CAAA,EAClE,CAAA,IAEA,gBAAAS,EAACI,GAAA,EAAsB,SAAS,QAC9B,UAAA;AAAA,MAAC,gBAAAP,EAAAS,GAAA,EAAqB;AAAA,MACtB,gBAAAN;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,QAAO;AAAA,UACP,UAAU;AAAA,UACV,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,WAAW;AAAA,UACX,UAAU;AAAA,UACV,aAAY;AAAA,UACZ,cAAa;AAAA,UACb,gBAAgB;AAAA,UAEhB,UAAA;AAAA,YAAA,gBAAAV,EAACW,GAAA,EACC,UAAA,gBAAAX,EAACY,GAAM,EAAA,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKlC,EAAmB,CAAA,GACrE;AAAA,YACA,gBAAAyB,EAACO,GAAS,EAAA,UAAU,IAClB,UAAA;AAAA,cAAC,gBAAAV,EAAAa,GAAA,EAAK,WAAU,aAAa,UAAK1C,GAAA;AAAA,cACjC,gBAAA6B,EAAAa,GAAA,EAAK,WAAU,OAAO,eAAkB,IAAG;AAAA,YAAA,GAC9C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { TGoalCategory } from '../../../milestone/create/milestone-create-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetStudentProfileSummary } from '../../api/student-profile-summary';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { GOAL_MAPPING } from './constant';\nimport StudentProfileHighlights from './student-profile-highlights/student-profile-highlights';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst StudentProfile = memo(() => {\n const {\n isTeacher,\n studentId,\n formData,\n slideConfig,\n milestoneConfig,\n updateSlideConfig,\n updateButtonState,\n } = useTrialSessionContext();\n const { showProfileHighlights } = slideConfig;\n\n const {\n name,\n goals = [],\n studentProfile,\n personalizedObjectives = [],\n personalizedPosition = [],\n } = formData || {};\n const { dummyProfileImageIndex, profileSummary } = studentProfile || {};\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n\n const payload = useMemo<IGetStudentProfileSummaryQuery | null>(() => {\n if (goals && goals.length > 0) {\n return {\n school_success_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.SCHOOL_SUCCESS),\n test_prep_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.TEST_PREP),\n };\n }\n\n return null;\n }, [goals]);\n\n const {\n get: getStudentProfileSummary,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useGetStudentProfileSummary();\n const { profile_summary: studentProfileSummary } = data || {};\n\n const fetchData = useCallback(() => {\n if (payload) {\n getStudentProfileSummary(studentId, payload);\n }\n }, [getStudentProfileSummary, payload, studentId]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, updateButtonState]);\n\n useEffect(() => {\n if (isTeacher && !studentProfile && !showProfileHighlights) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile, showProfileHighlights]);\n\n useEffect(() => {\n if (isTeacher && isProcessed && !showProfileHighlights) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, showProfileHighlights, studentProfileSummary, updateSlideConfig]);\n\n const profileHighlights: TProfileHighlight[] = useMemo(\n () => [\n {\n title: 'Student Level',\n description: `Catching up: ${getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedPosition,\n ).map(objectives => objectives.preference_description)}`,\n illustration: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n background: 'BLUE_1',\n },\n {\n illustration: ILLUSTRATIONS.ARROW_BOARD_GREEN,\n background: 'GREEN_1',\n title: 'Goals',\n description: getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedObjectives,\n ).map(objectives => objectives.preference_name),\n },\n {\n illustration: ILLUSTRATIONS.BOOK_CHECKED_PURPLE,\n background: 'PURPLE_1',\n title: 'Learning Plan',\n description: goals.map(\n goal => `${GOAL_MAPPING[goal.goal_category as TGoalCategory]}: ${goal.milestone_name}`,\n ),\n },\n ],\n [goals, milestoneConfig, personalizedObjectives, personalizedPosition],\n );\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || (!studentProfile && !showProfileHighlights)) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={showProfileHighlights ? 50 : 100} />\n {showProfileHighlights ? (\n <Styled.ContentWrapper $width={650}>\n <StudentProfileHighlights profileHighlights={profileHighlights} />\n <Separator height={16} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\" $align=\"center\">\n We can always revisit this later\n </Text>\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper $widthX={46.875}>\n <Styled.AbsoluteImage />\n <FlexView\n $width=\"100%\"\n $heightX={21.875}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={1.5}\n $gutterX={1.5}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.ImageWrapper>\n <Image withLoader height={200} width={200} src={dummyProfileImage} />\n </Styled.ImageWrapper>\n <FlexView $flexGap={16}>\n <Text $renderAs=\"ac2-black\">{name}</Text>\n <Text $renderAs=\"ab1\">{profileSummary || ''}</Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","slideConfig","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","showProfileHighlights","name","goals","studentProfile","personalizedObjectives","personalizedPosition","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","profileHighlights","getFormattedStudentPersonalizedPreference","objectives","ILLUSTRATIONS","goal","GOAL_MAPPING","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","StudentProfileHighlights","Text","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image"],"mappings":";;;;;;;;;;;;;;;;;;AA8BM,MAAAA,KAAiBC,EAAK,MAAM;AAC1B,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,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AP,EAACQ,KAAyB,mBAAAd,GAAsC;AAAA,MAChE,gBAAAM,EAACK,GAAU,EAAA,QAAQ,GAAI,CAAA;AAAA,MACvB,gBAAAL,EAACS,KAAK,WAAU,OAAM,QAAO,cAAa,QAAO,UAAS,UAE1D,mCAAA,CAAA;AAAA,IAAA,EACF,CAAA,IAEC,gBAAAN,EAAAI,GAAA,EAAsB,SAAS,QAC9B,UAAA;AAAA,MAAC,gBAAAP,EAAAU,GAAA,EAAqB;AAAA,MACtB,gBAAAP;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,QAAO;AAAA,UACP,UAAU;AAAA,UACV,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,WAAW;AAAA,UACX,UAAU;AAAA,UACV,aAAY;AAAA,UACZ,cAAa;AAAA,UACb,gBAAgB;AAAA,UAEhB,UAAA;AAAA,YAAA,gBAAAX,EAACY,GAAA,EACC,UAAA,gBAAAZ,EAACa,GAAM,EAAA,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKnC,EAAmB,CAAA,GACrE;AAAA,YACA,gBAAAyB,EAACQ,GAAS,EAAA,UAAU,IAClB,UAAA;AAAA,cAAC,gBAAAX,EAAAS,GAAA,EAAK,WAAU,aAAa,UAAKtC,GAAA;AAAA,cACjC,gBAAA6B,EAAAS,GAAA,EAAK,WAAU,OAAO,eAAkB,IAAG;AAAA,YAAA,GAC9C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,52 +1,53 @@
1
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import { memo as y, useMemo as $, useCallback as b } from "react";
3
- import { GIF as G } from "../../../../assets/gif/gif.js";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
+ import { memo as G, useMemo as L, useCallback as A } from "react";
3
+ import { GIF as I } from "../../../../assets/gif/gif.js";
4
4
  import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
5
- import { getGoalsFromConfig as I } from "../../../milestone/create/milestone-create-helpers.js";
6
- import x from "../../../ui/image/image.js";
7
- import L from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
5
+ import { getGoalsFromConfig as x } from "../../../milestone/create/milestone-create-helpers.js";
6
+ import R from "../../../ui/image/image.js";
7
+ import D from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
8
8
  import p from "../../../ui/separator/separator.js";
9
- import A from "../../../ui/text/text.js";
10
- import { epochTimestampAfterOneYear as R } from "../../../utils/utils.js";
11
- import { useTrialSessionContext as D } from "../../context/use-trial-session-context.js";
12
- import { updateGoalInFormData as j } from "../../helper.js";
13
- import k from "../slide-header/index.js";
14
- import { Container as O, ContentWrapper as w, ImageWrapper as F, InputContainer as N } from "./test-prep-styled.js";
15
- const Z = y(() => {
16
- const { milestoneConfig: n, formData: c, updateSlideConfig: a, trialHomeData: d } = D(), { demo_info: f } = d, { stream: i, region_data: g } = f || {}, { opportunity_country: m = "US" } = g || {}, { grade: s, goals: e } = c || {}, u = $(
17
- () => I(n, {
18
- countryCode: m,
19
- grade: s ?? "",
9
+ import j from "../../../ui/text/text.js";
10
+ import { epochTimestampAfterOneYear as k } from "../../../utils/utils.js";
11
+ import { useTrialSessionContext as O } from "../../context/use-trial-session-context.js";
12
+ import { updateGoalInFormData as w } from "../../helper.js";
13
+ import F from "../slide-header/index.js";
14
+ import { Container as N, ContentWrapper as W, ImageWrapper as X, InputContainer as B } from "./test-prep-styled.js";
15
+ const te = G(() => {
16
+ const { milestoneConfig: a, formData: d, updateSlideConfig: n, trialHomeData: f } = O(), { demo_info: g, intel_student: u } = f, { source: h } = u || {}, { stream: i, region_data: T } = g || {}, { opportunity_country: s = "US" } = T || {}, { grade: m, goals: e } = d || {}, l = h === "PLA", _ = L(
17
+ () => x(a, {
18
+ countryCode: s,
19
+ grade: m ?? "",
20
20
  goalCategory: r.TEST_PREP,
21
21
  courseStream: i,
22
22
  enrollmentType: "ONLINE"
23
23
  }),
24
- [m, s, n, i]
25
- ), { goal_code: h } = (e == null ? void 0 : e.find((t) => t.goal_category === r.TEST_PREP)) ?? {}, T = b(
26
- (t, _) => {
24
+ [s, m, a, i]
25
+ ), { goal_code: C } = (e == null ? void 0 : e.find((t) => t.goal_category === r.TEST_PREP)) ?? {}, S = A(
26
+ (t, P) => {
27
27
  if (!t) {
28
- const E = e == null ? void 0 : e.filter(
29
- (P) => P.goal_category !== r.TEST_PREP
28
+ const y = e == null ? void 0 : e.filter(
29
+ ($) => $.goal_category !== r.TEST_PREP
30
30
  );
31
- a({ goals: E });
31
+ n({ goals: y });
32
32
  return;
33
33
  }
34
- const { label: C } = _, S = j(e, r.TEST_PREP, {
34
+ const { label: E } = P, b = w(e, r.TEST_PREP, {
35
35
  goal_code: t,
36
- milestone_name: C,
37
- milestone_date_ts: R()
36
+ milestone_name: E,
37
+ milestone_date_ts: k(),
38
+ publish: l
38
39
  });
39
- a({ goals: S });
40
+ n({ goals: b });
40
41
  },
41
- [e, a]
42
+ [e, l, n]
42
43
  );
43
- return /* @__PURE__ */ l(O, { children: [
44
+ return /* @__PURE__ */ c(N, { children: [
44
45
  /* @__PURE__ */ o(p, { height: 60 }),
45
- /* @__PURE__ */ o(k, {}),
46
- /* @__PURE__ */ l(w, { $flexDirection: "row", $justifyContent: "center", children: [
47
- /* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(x, { withLoader: !0, height: 402, width: 302, src: G.TEST_PREP, className: "image" }) }),
46
+ /* @__PURE__ */ o(F, {}),
47
+ /* @__PURE__ */ c(W, { $flexDirection: "row", $justifyContent: "center", children: [
48
+ /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(R, { withLoader: !0, height: 402, width: 302, src: I.TEST_PREP, className: "image" }) }),
48
49
  /* @__PURE__ */ o(
49
- N,
50
+ B,
50
51
  {
51
52
  $flexGap: 40,
52
53
  $justifyContent: "center",
@@ -55,15 +56,15 @@ const Z = y(() => {
55
56
  $gapX: 2.5,
56
57
  $gutterX: 2.5,
57
58
  children: /* @__PURE__ */ o(
58
- L,
59
+ D,
59
60
  {
60
61
  renderAs: "primary",
61
62
  label: "Select a Test",
62
- value: h,
63
- options: u,
63
+ value: C,
64
+ options: _,
64
65
  shape: "borderLess",
65
66
  theme: "dark",
66
- onChange: T,
67
+ onChange: S,
67
68
  isTransparent: !0
68
69
  }
69
70
  )
@@ -71,10 +72,10 @@ const Z = y(() => {
71
72
  )
72
73
  ] }),
73
74
  /* @__PURE__ */ o(p, { heightX: 1 }),
74
- /* @__PURE__ */ o(A, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
75
+ /* @__PURE__ */ o(j, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
75
76
  ] });
76
77
  });
77
78
  export {
78
- Z as default
79
+ te as default
79
80
  };
80
81
  //# sourceMappingURL=test-prep.js.map