@cuemath/leap 3.3.30-beta.1 → 3.3.30

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 (111) hide show
  1. package/dist/features/auth/pla-signup/pla-analytics-events.js +3 -9
  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 +7 -13
  7. package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
  8. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +30 -32
  9. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
  10. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +16 -17
  11. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +1 -1
  12. package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +4 -8
  13. package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +1 -1
  14. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
  15. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
  16. package/dist/features/parent-dashboard/parent-dashboard-constants.js +4 -5
  17. package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
  18. package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
  19. package/dist/features/parent-dashboard/parent-dashboard-view.js +145 -170
  20. package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
  21. package/dist/features/trial-session/comps/class-preference/class-preference.js +49 -61
  22. package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
  23. package/dist/features/trial-session/comps/navigation-bar/index.js +25 -25
  24. package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
  25. package/dist/features/trial-session/comps/school-goals/school-goals.js +53 -55
  26. package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
  27. package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
  28. package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
  29. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +43 -44
  30. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
  31. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +0 -5
  32. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
  33. package/dist/features/trial-session/comps/student-feedback/student-feedback.js +51 -96
  34. package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
  35. package/dist/features/trial-session/comps/student-profile/student-profile.js +63 -70
  36. package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
  37. package/dist/features/trial-session/comps/test-prep/test-prep.js +39 -40
  38. package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
  39. package/dist/features/trial-session/helper.js +53 -69
  40. package/dist/features/trial-session/helper.js.map +1 -1
  41. package/dist/features/trial-session/hooks/use-trial-session-navigation.js +130 -150
  42. package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
  43. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  44. package/dist/features/trial-session/trial-session-view.js +112 -103
  45. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  46. package/dist/features/utils/utils.js +1 -1
  47. package/dist/features/utils/utils.js.map +1 -1
  48. package/dist/index.d.ts +5 -45
  49. package/dist/index.js +106 -116
  50. package/dist/index.js.map +1 -1
  51. package/dist/node_modules/decode-uri-component/index.js.map +1 -0
  52. package/dist/node_modules/query-string/base.js +1 -1
  53. package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
  54. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
  55. package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
  56. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  57. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
  58. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  59. package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
  60. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  61. package/package.json +3 -2
  62. package/dist/features/parent-dashboard/api/cancel-subscription.js +0 -9
  63. package/dist/features/parent-dashboard/api/cancel-subscription.js.map +0 -1
  64. package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +0 -20
  65. package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +0 -1
  66. package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +0 -96
  67. package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +0 -1
  68. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +0 -21
  69. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +0 -1
  70. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +0 -85
  71. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +0 -1
  72. package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +0 -23
  73. package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +0 -1
  74. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +0 -55
  75. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +0 -1
  76. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +0 -59
  77. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +0 -1
  78. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +0 -93
  79. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +0 -1
  80. package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +0 -66
  81. package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +0 -1
  82. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +0 -12
  83. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +0 -1
  84. package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +0 -76
  85. package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +0 -1
  86. package/dist/features/student-username/add/add-student-username-constants.js +0 -6
  87. package/dist/features/student-username/add/add-student-username-constants.js.map +0 -1
  88. package/dist/features/student-username/add/add-student-username-helpers.js +0 -6
  89. package/dist/features/student-username/add/add-student-username-helpers.js.map +0 -1
  90. package/dist/features/student-username/add/add-student-username-styled.js +0 -10
  91. package/dist/features/student-username/add/add-student-username-styled.js.map +0 -1
  92. package/dist/features/student-username/add/add-student-username.js +0 -78
  93. package/dist/features/student-username/add/add-student-username.js.map +0 -1
  94. package/dist/features/student-username/add/api/update-username.js +0 -9
  95. package/dist/features/student-username/add/api/update-username.js.map +0 -1
  96. package/dist/features/student-username/add/api/username-availability.js +0 -10
  97. package/dist/features/student-username/add/api/username-availability.js.map +0 -1
  98. package/dist/features/student-username/add/hooks/use-check-username-availability.js +0 -41
  99. package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +0 -1
  100. package/dist/features/trial-session/api/teacher-availability.js +0 -9
  101. package/dist/features/trial-session/api/teacher-availability.js.map +0 -1
  102. package/dist/features/trial-session/comps/class-preference/helpers.js +0 -28
  103. package/dist/features/trial-session/comps/class-preference/helpers.js.map +0 -1
  104. package/dist/features/trial-session/hooks/use-slide-config-update.js +0 -49
  105. package/dist/features/trial-session/hooks/use-slide-config-update.js.map +0 -1
  106. package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
  107. package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
  108. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
  109. package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
  110. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
  111. /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
@@ -1,44 +1,44 @@
1
- import { jsx as R } from "react/jsx-runtime";
2
- import { memo as Y, useMemo as S, useCallback as s, useEffect as f } from "react";
3
- import { GOAL_CATEGORY as m } from "../../../milestone/constants.js";
4
- import { getCategorizedCurriculumStandards as j } from "../../../milestone/create/comps/class-details-step/class-details-utils.js";
5
- import { getGradesFromConfig as q, getGoalsFromConfig as v } from "../../../milestone/create/milestone-create-helpers.js";
6
- import { epochTimestampAfterOneYear as O } from "../../../utils/utils.js";
7
- import { useTrialSessionContext as z } from "../../context/use-trial-session-context.js";
8
- import { updateGoalInFormData as E } from "../../helper.js";
9
- import M from "./school-goals-view.js";
10
- const oo = Y(() => {
1
+ import { jsx as w } from "react/jsx-runtime";
2
+ import { memo as B, useMemo as C, useCallback as m, useEffect as S } from "react";
3
+ import { GOAL_CATEGORY as s } from "../../../milestone/constants.js";
4
+ import { getCategorizedCurriculumStandards as R } from "../../../milestone/create/comps/class-details-step/class-details-utils.js";
5
+ import { getGradesFromConfig as Y, getGoalsFromConfig as j } from "../../../milestone/create/milestone-create-helpers.js";
6
+ import { epochTimestampAfterOneYear as G } from "../../../utils/utils.js";
7
+ import { useTrialSessionContext as q } from "../../context/use-trial-session-context.js";
8
+ import { updateGoalInFormData as O } from "../../helper.js";
9
+ import v from "./school-goals-view.js";
10
+ const Z = B(() => {
11
11
  const {
12
12
  milestoneConfig: n,
13
- formData: L,
13
+ formData: E,
14
14
  updateSlideConfig: a,
15
- updateButtonState: p,
15
+ updateButtonState: f,
16
16
  onRemoveOptionalSlides: g,
17
- trialHomeData: b
18
- } = z(), { name: h, grade: e, goals: t, curriculum: u, numberInNameError: N } = L || {}, { demo_info: I, intel_student: T } = b, { source: U } = T || {}, { stream: i, region_data: y } = I || {}, { opportunity_country: c = "US" } = y || {}, A = q(n), C = U === "PLA", H = S(
19
- () => j(n, {
17
+ trialHomeData: L
18
+ } = q(), { name: p, grade: e, goals: t, curriculum: i, numberInNameError: N } = E || {}, { demo_info: I } = L, { stream: u, region_data: T } = I || {}, { opportunity_country: c = "US" } = T || {}, U = Y(n), b = C(
19
+ () => R(n, {
20
20
  countryCode: c,
21
21
  grade: e ?? "",
22
- goalCategory: m.SCHOOL_SUCCESS,
23
- courseStream: i,
22
+ goalCategory: s.SCHOOL_SUCCESS,
23
+ courseStream: u,
24
24
  enrollmentType: "ONLINE",
25
25
  flow: "CREATE"
26
26
  }),
27
- [n, c, e, i]
28
- ), d = S(
29
- () => v(n, {
27
+ [n, c, e, u]
28
+ ), d = C(
29
+ () => j(n, {
30
30
  countryCode: c,
31
31
  grade: e ?? "",
32
- goalCategory: m.SCHOOL_SUCCESS,
33
- courseStream: i,
34
- curriculumStandard: u,
32
+ goalCategory: s.SCHOOL_SUCCESS,
33
+ courseStream: u,
34
+ curriculumStandard: i,
35
35
  enrollmentType: "ONLINE"
36
36
  }),
37
- [n, c, e, i, u]
38
- ), { goal_code: _ } = S(
39
- () => (t == null ? void 0 : t.find((o) => o.goal_category === m.SCHOOL_SUCCESS)) ?? {},
37
+ [n, c, e, u, i]
38
+ ), { goal_code: _ } = C(
39
+ () => (t == null ? void 0 : t.find((o) => o.goal_category === s.SCHOOL_SUCCESS)) ?? {},
40
40
  [t]
41
- ), G = !!(h && e && u && _), r = s(
41
+ ), h = !!(p && e && i && _), r = m(
42
42
  (o, l) => {
43
43
  a({
44
44
  [o]: l,
@@ -46,65 +46,63 @@ const oo = Y(() => {
46
46
  });
47
47
  },
48
48
  [a]
49
- ), D = s(
49
+ ), y = m(
50
50
  (o) => {
51
51
  a({ numberInNameError: !1 }), r("name", o.target.value);
52
52
  },
53
53
  [a, r]
54
- ), F = s(
54
+ ), H = m(
55
55
  (o, l) => {
56
- const { label: B } = l, P = E(t, m.SCHOOL_SUCCESS, {
56
+ const { label: F } = l, x = O(t, s.SCHOOL_SUCCESS, {
57
57
  goal_code: o,
58
- milestone_name: B,
59
- milestone_date_ts: O(),
60
- publish: C
58
+ milestone_name: F,
59
+ milestone_date_ts: G()
61
60
  });
62
- a({ goals: P });
61
+ a({ goals: x });
63
62
  },
64
- [t, C, a]
65
- ), x = s(
63
+ [t, a]
64
+ ), D = m(
66
65
  (o) => r("curriculum", o),
67
66
  [r]
68
- ), w = s(
67
+ ), A = m(
69
68
  (o) => {
70
69
  r("grade", o), r("curriculum", "");
71
70
  },
72
71
  [r]
73
72
  );
74
- return f(() => {
75
- p("right", { isDisabled: !G, isLoading: !1 });
76
- }, [G, p]), f(() => {
73
+ return S(() => {
74
+ f("right", { isDisabled: !h, isLoading: !1 });
75
+ }, [h, f]), S(() => {
77
76
  e && (g == null || g(e));
78
- }, [e]), f(() => {
77
+ }, [e]), S(() => {
79
78
  const o = d.length === 1 ? d[0] : void 0;
80
79
  if (o) {
81
- const l = E(t, m.SCHOOL_SUCCESS, {
80
+ const l = O(t, s.SCHOOL_SUCCESS, {
82
81
  goal_code: o.id ?? "",
83
82
  milestone_name: o.label ?? "",
84
- milestone_date_ts: O(),
85
- publish: C
83
+ milestone_date_ts: G()
86
84
  });
87
85
  a({ goals: l });
88
86
  }
89
- }, [d]), /* @__PURE__ */ R(
90
- M,
87
+ }, [d]), /* @__PURE__ */ w(
88
+ v,
91
89
  {
92
- name: h,
90
+ name: p,
93
91
  grade: e,
94
- grades: A,
92
+ grades: U,
95
93
  goalsList: d,
96
- curriculum: u,
94
+ curriculum: i,
97
95
  selectedGoal: _,
98
96
  numberInNameError: N,
99
- curriculumStandards: H,
100
- onNameChange: D,
101
- onGoalChange: F,
102
- onGradeChange: w,
103
- onCurriculumChange: x
97
+ curriculumStandards: b,
98
+ onNameChange: y,
99
+ onGoalChange: H,
100
+ onGradeChange: A,
101
+ onCurriculumChange: D
104
102
  }
105
103
  );
106
104
  });
107
105
  export {
108
- oo as default
106
+ Z as default
109
107
  };
110
108
  //# sourceMappingURL=school-goals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"school-goals.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport {\n getGoalsFromConfig,\n getGradesFromConfig,\n} from '../../../milestone/create/milestone-create-helpers';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SchoolGoalsView from './school-goals-view';\n\nconst SchoolGoals = memo(() => {\n const {\n milestoneConfig,\n formData,\n updateSlideConfig,\n updateButtonState,\n onRemoveOptionalSlides,\n trialHomeData,\n } = useTrialSessionContext();\n const { name, grade, goals, curriculum, numberInNameError } = formData || {};\n\n const { demo_info: demoInfo, intel_student: intelStudent } = trialHomeData;\n const { source } = intelStudent || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n const isPLASource = source === 'PLA';\n\n const curriculumStandards = useMemo(\n () =>\n getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n flow: 'CREATE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n curriculumStandard: curriculum,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream, curriculum],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.SCHOOL_SUCCESS) ?? {},\n [goals],\n );\n\n const hasRequiredFields = Boolean(name && grade && curriculum && selectedGoal);\n\n const updateStudentInformation = useCallback(\n (key: string, value: string) => {\n updateSlideConfig({\n [key]: value,\n ...(key === 'grade' || key === 'curriculum' ? { goals: [] } : {}),\n });\n },\n [updateSlideConfig],\n );\n\n const handleNameChange = useCallback<\n NonNullable<React.InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(\n event => {\n updateSlideConfig({ numberInNameError: false });\n updateStudentInformation('name', event.target.value);\n },\n [updateSlideConfig, updateStudentInformation],\n );\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.SCHOOL_SUCCESS, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n publish: isPLASource,\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, isPLASource, updateSlideConfig],\n );\n\n const handleCurriculumChange = useCallback(\n (value: string) => updateStudentInformation('curriculum', value),\n [updateStudentInformation],\n );\n\n const handleGradeChange = useCallback(\n (value: string) => {\n updateStudentInformation('grade', value);\n updateStudentInformation('curriculum', '');\n },\n [updateStudentInformation],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n useEffect(() => {\n if (grade) {\n onRemoveOptionalSlides?.(grade);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [grade]);\n\n useEffect(() => {\n // If there is only one goal in the list, set it as the selected goal\n // and update the form data with the goal code, milestone name, and date\n const defaultGoal = goalsList.length === 1 ? goalsList[0] : undefined;\n\n if (defaultGoal) {\n const goalToUpdate = updateGoalInFormData(goals, GOAL_CATEGORY.SCHOOL_SUCCESS, {\n goal_code: defaultGoal.id ?? '',\n milestone_name: defaultGoal.label ?? '',\n milestone_date_ts: epochTimestampAfterOneYear(),\n publish: isPLASource,\n });\n\n updateSlideConfig({ goals: goalToUpdate });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [goalsList]);\n\n return (\n <SchoolGoalsView\n name={name}\n grade={grade}\n grades={grades}\n goalsList={goalsList}\n curriculum={curriculum}\n selectedGoal={selectedGoal}\n numberInNameError={numberInNameError}\n curriculumStandards={curriculumStandards}\n onNameChange={handleNameChange}\n onGoalChange={handleGoalChange}\n onGradeChange={handleGradeChange}\n onCurriculumChange={handleCurriculumChange}\n />\n );\n});\n\nexport default SchoolGoals;\n"],"names":["SchoolGoals","memo","milestoneConfig","formData","updateSlideConfig","updateButtonState","onRemoveOptionalSlides","trialHomeData","useTrialSessionContext","name","grade","goals","curriculum","numberInNameError","demoInfo","intelStudent","source","stream","regionData","countryCode","grades","getGradesFromConfig","isPLASource","curriculumStandards","useMemo","getCategorizedCurriculumStandards","GOAL_CATEGORY","goalsList","getGoalsFromConfig","selectedGoal","goal","hasRequiredFields","updateStudentInformation","useCallback","key","value","handleNameChange","event","handleGoalChange","option","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","handleCurriculumChange","handleGradeChange","useEffect","defaultGoal","goalToUpdate","jsx","SchoolGoalsView"],"mappings":";;;;;;;;;AAeM,MAAAA,KAAcC,EAAK,MAAM;AACvB,QAAA;AAAA,IACJ,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,eAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,MAAAC,GAAM,OAAAC,GAAO,OAAAC,GAAO,YAAAC,GAAY,mBAAAC,EAAkB,IAAIV,KAAY,IAEpE,EAAE,WAAWW,GAAU,eAAeC,MAAiBR,GACvD,EAAE,QAAAS,EAAA,IAAWD,KAAgB,IAC7B,EAAE,QAAAE,GAAQ,aAAaC,EAAW,IAAIJ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E,OAAO4C,EAAA,CAAc;AAAA,IAC3C;AAAA,EAAA,GAEC,CAACrB,CAAS,CAAC,GAGZ,gBAAAsB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAzC;AAAA,MACA,OAAAC;AAAA,MACA,QAAAU;AAAA,MACA,WAAAO;AAAA,MACA,YAAAf;AAAA,MACA,cAAAiB;AAAA,MACA,mBAAAhB;AAAA,MACA,qBAAAU;AAAA,MACA,cAAca;AAAA,MACd,cAAcE;AAAA,MACd,eAAeO;AAAA,MACf,oBAAoBD;AAAA,IAAA;AAAA,EAAA;AAG1B,CAAC;"}
1
+ {"version":3,"file":"school-goals.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport {\n getGoalsFromConfig,\n getGradesFromConfig,\n} from '../../../milestone/create/milestone-create-helpers';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SchoolGoalsView from './school-goals-view';\n\nconst SchoolGoals = memo(() => {\n const {\n milestoneConfig,\n formData,\n updateSlideConfig,\n updateButtonState,\n onRemoveOptionalSlides,\n trialHomeData,\n } = useTrialSessionContext();\n const { name, grade, goals, curriculum, numberInNameError } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const curriculumStandards = useMemo(\n () =>\n getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n flow: 'CREATE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n curriculumStandard: curriculum,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream, curriculum],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.SCHOOL_SUCCESS) ?? {},\n [goals],\n );\n\n const hasRequiredFields = Boolean(name && grade && curriculum && selectedGoal);\n\n const updateStudentInformation = useCallback(\n (key: string, value: string) => {\n updateSlideConfig({\n [key]: value,\n ...(key === 'grade' || key === 'curriculum' ? { goals: [] } : {}),\n });\n },\n [updateSlideConfig],\n );\n\n const handleNameChange = useCallback<\n NonNullable<React.InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(\n event => {\n updateSlideConfig({ numberInNameError: false });\n updateStudentInformation('name', event.target.value);\n },\n [updateSlideConfig, updateStudentInformation],\n );\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.SCHOOL_SUCCESS, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, updateSlideConfig],\n );\n\n const handleCurriculumChange = useCallback(\n (value: string) => updateStudentInformation('curriculum', value),\n [updateStudentInformation],\n );\n\n const handleGradeChange = useCallback(\n (value: string) => {\n updateStudentInformation('grade', value);\n updateStudentInformation('curriculum', '');\n },\n [updateStudentInformation],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n useEffect(() => {\n if (grade) {\n onRemoveOptionalSlides?.(grade);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [grade]);\n\n useEffect(() => {\n // If there is only one goal in the list, set it as the selected goal\n // and update the form data with the goal code, milestone name, and date\n const defaultGoal = goalsList.length === 1 ? goalsList[0] : undefined;\n\n if (defaultGoal) {\n const goalToUpdate = updateGoalInFormData(goals, GOAL_CATEGORY.SCHOOL_SUCCESS, {\n goal_code: defaultGoal.id ?? '',\n milestone_name: defaultGoal.label ?? '',\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: goalToUpdate });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [goalsList]);\n\n return (\n <SchoolGoalsView\n name={name}\n grade={grade}\n grades={grades}\n goalsList={goalsList}\n curriculum={curriculum}\n selectedGoal={selectedGoal}\n numberInNameError={numberInNameError}\n curriculumStandards={curriculumStandards}\n onNameChange={handleNameChange}\n onGoalChange={handleGoalChange}\n onGradeChange={handleGradeChange}\n onCurriculumChange={handleCurriculumChange}\n />\n );\n});\n\nexport default SchoolGoals;\n"],"names":["SchoolGoals","memo","milestoneConfig","formData","updateSlideConfig","updateButtonState","onRemoveOptionalSlides","trialHomeData","useTrialSessionContext","name","grade","goals","curriculum","numberInNameError","demoInfo","stream","regionData","countryCode","grades","getGradesFromConfig","curriculumStandards","useMemo","getCategorizedCurriculumStandards","GOAL_CATEGORY","goalsList","getGoalsFromConfig","selectedGoal","goal","hasRequiredFields","updateStudentInformation","useCallback","key","value","handleNameChange","event","handleGoalChange","option","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","handleCurriculumChange","handleGradeChange","useEffect","defaultGoal","goalToUpdate","jsx","SchoolGoalsView"],"mappings":";;;;;;;;;AAeM,MAAAA,IAAcC,EAAK,MAAM;AACvB,QAAA;AAAA,IACJ,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,eAAAC;AAAA,MACEC,EAA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B,gBAAgBA,EAAY,SAAS;AAAA,QACrC,mBAAmBJ,EAA2B;AAAA,MAAA,CAC/C;AAEiB,MAAApC,EAAA,EAAE,OAAOyC,EAAA,CAAc;AAAA,IAC3C;AAAA,EAAA,GAEC,CAACrB,CAAS,CAAC,GAGZ,gBAAAsB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAtC;AAAA,MACA,OAAAC;AAAA,MACA,QAAAQ;AAAA,MACA,WAAAM;AAAA,MACA,YAAAZ;AAAA,MACA,cAAAc;AAAA,MACA,mBAAAb;AAAA,MACA,qBAAAO;AAAA,MACA,cAAca;AAAA,MACd,cAAcE;AAAA,MACd,eAAeO;AAAA,MACf,oBAAoBD;AAAA,IAAA;AAAA,EAAA;AAG1B,CAAC;"}
@@ -13,35 +13,35 @@ import { studentLevels as M } from "../student-feedback/student-feedback-constan
13
13
  import N from "./report-information/report-information.js";
14
14
  import { Container as j, ContentWrapper as w } from "./session-report-styled.js";
15
15
  const D = E(() => {
16
- const { formData: u, milestoneConfig: o } = v(), { name: s = "", grade: f, attemptId: n = "shg", personalizedLevel: e = [] } = u || {}, {
16
+ const { formData: g, milestoneConfig: o } = v(), { name: s = "", grade: f, attemptId: i = "shg", personalizedLevel: e = [] } = g || {}, {
17
17
  data: p,
18
18
  get: d,
19
- isProcessing: g,
20
- isProcessingFailed: l
21
- } = b(), i = R(() => {
19
+ isProcessing: l,
20
+ isProcessingFailed: u
21
+ } = b(), m = R(() => {
22
22
  var r, c;
23
- const a = ((c = (r = A(o, {
23
+ const n = ((c = (r = A(o, {
24
24
  grade: f ?? "",
25
25
  courseStream: T.MATH,
26
26
  preferenceCategory: x.LEVEL
27
27
  })) == null ? void 0 : r.find((h) => h.id === (e == null ? void 0 : e[0]))) == null ? void 0 : c.label) ?? "";
28
- return M[a.toLowerCase()];
29
- }, [f, o, e]), m = S(() => {
28
+ return M[n.toLowerCase()];
29
+ }, [f, o, e]), a = S(() => {
30
30
  var r;
31
- const a = y(
31
+ const n = y(
32
32
  o,
33
33
  e
34
34
  );
35
- n && d(n, {
36
- student_level: ((r = a[0]) == null ? void 0 : r.preference_name) ?? "",
37
- student_name: s ?? ""
35
+ i && s && n.length > 0 && d(i, {
36
+ student_level: ((r = n[0]) == null ? void 0 : r.preference_name) ?? "",
37
+ student_name: s
38
38
  });
39
- }, [n, d, o, s, e]);
39
+ }, [i, d, o, s, e]);
40
40
  return P(() => {
41
- m();
42
- }, [m]), l ? /* @__PURE__ */ t(L, { height: "70vh", onTryAgain: m }) : g || !p ? /* @__PURE__ */ t(_, { height: "100vh" }) : /* @__PURE__ */ C(j, { children: [
41
+ a();
42
+ }, [a]), u ? /* @__PURE__ */ t(L, { height: "70vh", onTryAgain: a }) : l || !p ? /* @__PURE__ */ t(_, { height: "100vh" }) : /* @__PURE__ */ C(j, { children: [
43
43
  /* @__PURE__ */ t(F, { height: 60 }),
44
- /* @__PURE__ */ t(I, { textToInsert: (i == null ? void 0 : i.title) ?? "" }),
44
+ /* @__PURE__ */ t(I, { textToInsert: (m == null ? void 0 : m.title) ?? "" }),
45
45
  /* @__PURE__ */ t(w, { $width: 750, children: /* @__PURE__ */ t(N, { sessionReports: p, studentName: s }) })
46
46
  ] });
47
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"session-report.js","sources":["../../../../../src/features/trial-session/comps/session-report/session-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport { useGetSessionReports } from '../../api/trial-home';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { studentLevels } from '../student-feedback/student-feedback-constants';\nimport ReportInformation from './report-information/report-information';\nimport * as Styled from './session-report-styled';\n\nconst SessionReport = memo(() => {\n const { formData, milestoneConfig } = useTrialSessionContext();\n const { name = '', grade, attemptId = 'shg', personalizedLevel = [] } = formData || {};\n\n const {\n data: sessionReports,\n get: getSessionReports,\n isProcessing,\n isProcessingFailed,\n } = useGetSessionReports();\n\n const selectedSessionLevel = useMemo(() => {\n const selectedLabel =\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n })?.find(sessionLevel => sessionLevel.id === personalizedLevel?.[0])?.label ?? '';\n\n return studentLevels[selectedLabel.toLowerCase()];\n }, [grade, milestoneConfig, personalizedLevel]);\n\n const fetchData = useCallback(() => {\n const studentLevel = getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedLevel,\n );\n\n if (attemptId) {\n getSessionReports(attemptId, {\n student_level: studentLevel[0]?.preference_name ?? '',\n student_name: name ?? '',\n });\n }\n }, [attemptId, getSessionReports, milestoneConfig, name, personalizedLevel]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !sessionReports) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader textToInsert={selectedSessionLevel?.title ?? ''} />\n <Styled.ContentWrapper $width={750}>\n <ReportInformation sessionReports={sessionReports} studentName={name} />\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nSessionReport.displayName = 'SessionReport';\n\nexport default SessionReport;\n"],"names":["SessionReport","memo","formData","milestoneConfig","useTrialSessionContext","name","grade","attemptId","personalizedLevel","sessionReports","getSessionReports","isProcessing","isProcessingFailed","useGetSessionReports","selectedSessionLevel","useMemo","selectedLabel","_b","_a","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","sessionLevel","studentLevels","fetchData","useCallback","studentLevel","getFormattedStudentPersonalizedPreference","useEffect","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","ReportInformation"],"mappings":";;;;;;;;;;;;;;AAeM,MAAAA,IAAgBC,EAAK,MAAM;AAC/B,QAAM,EAAE,UAAAC,GAAU,iBAAAC,EAAgB,IAAIC,EAAuB,GACvD,EAAE,MAAAC,IAAO,IAAI,OAAAC,GAAO,WAAAC,IAAY,OAAO,mBAAAC,IAAoB,CAAC,EAAA,IAAMN,KAAY,IAE9E;AAAA,IACJ,MAAMO;AAAA,IACN,KAAKC;AAAA,IACL,cAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAuBC,EAAQ,MAAM;;AACnC,UAAAC,MACJC,KAAAC,IAAAC,EAAyBhB,GAAiB;AAAA,MACxC,OAAOG,KAAS;AAAA,MAChB,cAAcc,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IACzC,CAAA,MAJD,gBAAAH,EAII,KAAK,CAAgBI,MAAAA,EAAa,QAAOd,KAAA,gBAAAA,EAAoB,SAJjE,gBAAAS,EAIsE,UAAS;AAE1E,WAAAM,EAAcP,EAAc,YAAA,CAAa;AAAA,EAC/C,GAAA,CAACV,GAAOH,GAAiBK,CAAiB,CAAC,GAExCgB,IAAYC,EAAY,MAAM;;AAClC,UAAMC,IAAeC;AAAA,MACnBxB;AAAA,MACAK;AAAA,IAAA;AAGF,IAAID,KACFG,EAAkBH,GAAW;AAAA,MAC3B,iBAAeW,IAAAQ,EAAa,CAAC,MAAd,gBAAAR,EAAiB,oBAAmB;AAAA,MACnD,cAAcb,KAAQ;AAAA,IAAA,CACvB;AAAA,EACH,GACC,CAACE,GAAWG,GAAmBP,GAAiBE,GAAMG,CAAiB,CAAC;AAM3E,SAJAoB,EAAU,MAAM;AACJ,IAAAJ;EAAA,GACT,CAACA,CAAS,CAAC,GAEVZ,IACM,gBAAAiB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYN,EAAW,CAAA,IAGjDb,KAAgB,CAACF,IACZ,gBAAAoB,EAACE,GAAU,EAAA,QAAO,QAAQ,CAAA,IAIjC,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAJ,EAAAK,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,IACtB,gBAAAL,EAAAM,GAAA,EAAY,eAAcrB,KAAA,gBAAAA,EAAsB,UAAS,IAAI;AAAA,IAC9D,gBAAAe,EAACO,GAAA,EAAsB,QAAQ,KAC7B,UAAA,gBAAAP,EAACQ,GAAkB,EAAA,gBAAA5B,GAAgC,aAAaJ,EAAA,CAAM,EACxE,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;AAEDL,EAAc,cAAc;"}
1
+ {"version":3,"file":"session-report.js","sources":["../../../../../src/features/trial-session/comps/session-report/session-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport { useGetSessionReports } from '../../api/trial-home';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { studentLevels } from '../student-feedback/student-feedback-constants';\nimport ReportInformation from './report-information/report-information';\nimport * as Styled from './session-report-styled';\n\nconst SessionReport = memo(() => {\n const { formData, milestoneConfig } = useTrialSessionContext();\n const { name = '', grade, attemptId = 'shg', personalizedLevel = [] } = formData || {};\n\n const {\n data: sessionReports,\n get: getSessionReports,\n isProcessing,\n isProcessingFailed,\n } = useGetSessionReports();\n\n const selectedSessionLevel = useMemo(() => {\n const selectedLabel =\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n })?.find(sessionLevel => sessionLevel.id === personalizedLevel?.[0])?.label ?? '';\n\n return studentLevels[selectedLabel.toLowerCase()];\n }, [grade, milestoneConfig, personalizedLevel]);\n\n const fetchData = useCallback(() => {\n const studentLevel = getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedLevel,\n );\n\n if (attemptId && name && studentLevel.length > 0) {\n getSessionReports(attemptId, {\n student_level: studentLevel[0]?.preference_name ?? '',\n student_name: name,\n });\n }\n }, [attemptId, getSessionReports, milestoneConfig, name, personalizedLevel]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !sessionReports) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader textToInsert={selectedSessionLevel?.title ?? ''} />\n <Styled.ContentWrapper $width={750}>\n <ReportInformation sessionReports={sessionReports} studentName={name} />\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nSessionReport.displayName = 'SessionReport';\n\nexport default SessionReport;\n"],"names":["SessionReport","memo","formData","milestoneConfig","useTrialSessionContext","name","grade","attemptId","personalizedLevel","sessionReports","getSessionReports","isProcessing","isProcessingFailed","useGetSessionReports","selectedSessionLevel","useMemo","selectedLabel","_b","_a","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","sessionLevel","studentLevels","fetchData","useCallback","studentLevel","getFormattedStudentPersonalizedPreference","useEffect","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","ReportInformation"],"mappings":";;;;;;;;;;;;;;AAeM,MAAAA,IAAgBC,EAAK,MAAM;AAC/B,QAAM,EAAE,UAAAC,GAAU,iBAAAC,EAAgB,IAAIC,EAAuB,GACvD,EAAE,MAAAC,IAAO,IAAI,OAAAC,G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crB,KAAA,gBAAAA,EAAsB,UAAS,IAAI;AAAA,IAC9D,gBAAAe,EAACO,GAAA,EAAsB,QAAQ,KAC7B,UAAA,gBAAAP,EAACQ,GAAkB,EAAA,gBAAA5B,GAAgC,aAAaJ,EAAA,CAAM,EACxE,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;AAEDL,EAAc,cAAc;"}
@@ -1,56 +1,55 @@
1
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
- import { memo as G, useMemo as p, useCallback as L } from "react";
3
- import { GIF as A } from "../../../../assets/gif/gif.js";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { memo as y, useMemo as c, useCallback as G } from "react";
3
+ import { GIF as S } from "../../../../assets/gif/gif.js";
4
4
  import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
5
- import { getGoalsFromConfig as x } from "../../../milestone/create/milestone-create-helpers.js";
6
- import H from "../../../ui/image/image.js";
7
- import R from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
8
- import d from "../../../ui/separator/separator.js";
9
- import M from "../../../ui/text/text.js";
10
- import { epochTimestampAfterOneYear as D } from "../../../utils/utils.js";
11
- import { useTrialSessionContext as j } from "../../context/use-trial-session-context.js";
12
- import { updateGoalInFormData as k } from "../../helper.js";
13
- import w from "../slide-header/index.js";
14
- import { Container as O, ContentWrapper as P, ImageWrapper as F, InputContainer as W } from "./student-enrichment-styled.js";
15
- const te = G(() => {
16
- const { formData: f, milestoneConfig: a, updateSlideConfig: n, trialHomeData: g } = j(), { grade: i, goals: e } = f || {}, { demo_info: u, intel_student: h } = g, { source: C } = h || {}, { stream: s, region_data: E } = u || {}, { opportunity_country: m = "US" } = E || {}, l = C === "PLA", _ = p(
17
- () => x(a, {
18
- countryCode: m,
5
+ import { getGoalsFromConfig as b } from "../../../milestone/create/milestone-create-helpers.js";
6
+ import x from "../../../ui/image/image.js";
7
+ import H from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
8
+ import p from "../../../ui/separator/separator.js";
9
+ import L from "../../../ui/text/text.js";
10
+ import { epochTimestampAfterOneYear as R } from "../../../utils/utils.js";
11
+ import { useTrialSessionContext as A } from "../../context/use-trial-session-context.js";
12
+ import { updateGoalInFormData as M } from "../../helper.js";
13
+ import D from "../slide-header/index.js";
14
+ import { Container as j, ContentWrapper as k, ImageWrapper as w, InputContainer as O } from "./student-enrichment-styled.js";
15
+ const Z = y(() => {
16
+ const { formData: d, milestoneConfig: n, updateSlideConfig: a, trialHomeData: f } = A(), { grade: i, goals: e } = d || {}, { demo_info: g } = f, { stream: m, region_data: h } = g || {}, { opportunity_country: s = "US" } = h || {}, u = c(
17
+ () => b(n, {
18
+ countryCode: s,
19
19
  grade: i ?? "",
20
20
  goalCategory: r.ENRICHMENT,
21
- courseStream: s,
21
+ courseStream: m,
22
22
  enrollmentType: "ONLINE"
23
23
  }),
24
- [a, m, i, s]
25
- ), { goal_code: I } = p(
24
+ [n, s, i, m]
25
+ ), { goal_code: C } = c(
26
26
  () => (e == null ? void 0 : e.find((t) => t.goal_category === r.ENRICHMENT)) ?? {},
27
27
  [e]
28
- ), N = L(
29
- (t, S) => {
28
+ ), E = G(
29
+ (t, I) => {
30
30
  if (!t) {
31
- const b = e == null ? void 0 : e.filter(
32
- (y) => y.goal_category !== r.ENRICHMENT
31
+ const T = e == null ? void 0 : e.filter(
32
+ ($) => $.goal_category !== r.ENRICHMENT
33
33
  );
34
- n({ goals: b });
34
+ a({ goals: T });
35
35
  return;
36
36
  }
37
- const { label: T } = S, $ = k(e, r.ENRICHMENT, {
37
+ const { label: N } = I, _ = M(e, r.ENRICHMENT, {
38
38
  goal_code: t,
39
- milestone_name: T,
40
- milestone_date_ts: D(),
41
- publish: l
39
+ milestone_name: N,
40
+ milestone_date_ts: R()
42
41
  });
43
- n({ goals: $ });
42
+ a({ goals: _ });
44
43
  },
45
- [e, l, n]
44
+ [e, a]
46
45
  );
47
- return /* @__PURE__ */ c(O, { children: [
48
- /* @__PURE__ */ o(d, { height: 60 }),
49
- /* @__PURE__ */ o(w, {}),
50
- /* @__PURE__ */ c(P, { $width: 750, $flexDirection: "row", $justifyContent: "center", children: [
51
- /* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(H, { withLoader: !0, height: 402, width: 302, src: A.ENRICHMENT, className: "image" }) }),
46
+ return /* @__PURE__ */ l(j, { children: [
47
+ /* @__PURE__ */ o(p, { height: 60 }),
48
+ /* @__PURE__ */ o(D, {}),
49
+ /* @__PURE__ */ l(k, { $width: 750, $flexDirection: "row", $justifyContent: "center", children: [
50
+ /* @__PURE__ */ o(w, { children: /* @__PURE__ */ o(x, { withLoader: !0, height: 402, width: 302, src: S.ENRICHMENT, className: "image" }) }),
52
51
  /* @__PURE__ */ o(
53
- W,
52
+ O,
54
53
  {
55
54
  $flexGap: 24,
56
55
  $justifyContent: "center",
@@ -59,26 +58,26 @@ const te = G(() => {
59
58
  $gapX: 2.5,
60
59
  $gutterX: 2.5,
61
60
  children: /* @__PURE__ */ o(
62
- R,
61
+ H,
63
62
  {
64
63
  renderAs: "primary",
65
64
  label: "Select a Goal",
66
- value: I,
67
- options: _,
65
+ value: C,
66
+ options: u,
68
67
  shape: "borderLess",
69
68
  theme: "dark",
70
- onChange: N,
69
+ onChange: E,
71
70
  isTransparent: !0
72
71
  }
73
72
  )
74
73
  }
75
74
  )
76
75
  ] }),
77
- /* @__PURE__ */ o(d, { heightX: 1 }),
78
- /* @__PURE__ */ o(M, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
76
+ /* @__PURE__ */ o(p, { heightX: 1 }),
77
+ /* @__PURE__ */ o(L, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
79
78
  ] });
80
79
  });
81
80
  export {
82
- te as default
81
+ Z as default
83
82
  };
84
83
  //# sourceMappingURL=student-enrichment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-enrichment.js","sources":["../../../../../src/features/trial-session/comps/student-enrichment/student-enrichment.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-enrichment-styled';\n\nconst StudentEnrichment = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n const { grade, goals } = formData || {};\n\n const { demo_info: demoInfo, intel_student: intelStudent } = trialHomeData;\n const { source } = intelStudent || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const isPLASource = source === 'PLA';\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.ENRICHMENT,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.ENRICHMENT) ?? {},\n [goals],\n );\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n if (!value) {\n const goalsWithoutEnrichment = goals?.filter(\n goal => goal.goal_category !== GOAL_CATEGORY.ENRICHMENT,\n );\n\n updateSlideConfig({ goals: goalsWithoutEnrichment });\n\n return;\n }\n\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.ENRICHMENT, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n publish: isPLASource,\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, isPLASource, updateSlideConfig],\n );\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={750} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.ENRICHMENT} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={24}\n $justifyContent=\"center\"\n $background=\"PURPLE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Goal\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={handleGoalChange}\n isTransparent\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n <Separator heightX={1} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n This is optional and can be skipped.\n </Text>\n </Styled.Container>\n );\n});\n\nexport default StudentEnrichment;\n"],"names":["StudentEnrichment","memo","formData","milestoneConfig","updateSlideConfig","trialHomeData","useTrialSessionContext","grade","goals","demoInfo","intelStudent","source","stream","regionData","countryCode","isPLASource","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","goalsWithoutEnrichment","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,KAAoBC,EAAK,MAAM;AACnC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,eAAAC,EAAA,IAAkBC,KAClE,EAAE,OAAAC,GAAO,OAAAC,MAAUN,KAAY,CAAA,GAE/B,EAAE,WAAWO,G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;AAAA,sBACtBC,GAAY,EAAA;AAAA,IACb,gBAAAJ,EAACK,GAAA,EAAsB,QAAQ,KAAK,gBAAe,OAAM,iBAAgB,UACvE,UAAA;AAAA,MAAA,gBAAAH,EAACI,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EAAM,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKC,EAAI,YAAY,WAAU,QAAQ,CAAA,GACpF;AAAA,MACA,gBAAAN;AAAA,QAACO;AAAAA,QAAA;AAAA,UACC,UAAU;AAAA,UACV,iBAAgB;AAAA,UAChB,aAAY;AAAA,UACZ,cAAa;AAAA,UACb,OAAO;AAAA,UACP,UAAU;AAAA,UAEV,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOrB;AAAA,cACP,SAASJ;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUM;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAW,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBQ,GAAK,EAAA,WAAU,OAAM,QAAO,UAAS,UAEtC,wCAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"student-enrichment.js","sources":["../../../../../src/features/trial-session/comps/student-enrichment/student-enrichment.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-enrichment-styled';\n\nconst StudentEnrichment = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n const { grade, goals } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.ENRICHMENT,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.ENRICHMENT) ?? {},\n [goals],\n );\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n if (!value) {\n const goalsWithoutEnrichment = goals?.filter(\n goal => goal.goal_category !== GOAL_CATEGORY.ENRICHMENT,\n );\n\n updateSlideConfig({ goals: goalsWithoutEnrichment });\n\n return;\n }\n\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.ENRICHMENT, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, updateSlideConfig],\n );\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={750} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.ENRICHMENT} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={24}\n $justifyContent=\"center\"\n $background=\"PURPLE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Goal\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={handleGoalChange}\n isTransparent\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n <Separator heightX={1} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n This is optional and can be skipped.\n </Text>\n </Styled.Container>\n );\n});\n\nexport default StudentEnrichment;\n"],"names":["StudentEnrichment","memo","formData","milestoneConfig","updateSlideConfig","trialHomeData","useTrialSessionContext","grade","goals","demoInfo","stream","regionData","countryCode","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","goalsWithoutEnrichment","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,IAAoBC,EAAK,MAAM;AACnC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,eAAAC,EAAA,IAAkBC,KAClE,EAAE,OAAAC,GAAO,OAAAC,MAAUN,KAAY,CAAA,GAE/B,EAAE,WAAWO,EAAa,IAAAJ,GAC1B,EAAE,QAAAK,GAAQ,aAAaC,EAAW,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5DE,IAAYC;AAAA,IAChB,MACEC,EAAmBZ,GAAiB;AAAA,MAClC,aAAAS;AAAA,MACA,OAAOL,KAAS;AAAA,MAChB,cAAcS,EAAc;AAAA,MAC5B,cAAcN;AAAA,MACd,gBAAgB;AAAA,IAAA,CACjB;AAAA,IACH,CAACP,GAAiBS,GAAaL,GAAOG,CAAM;AAAA,EAAA,GAGxC,EAAE,WAAWO,EAAA,IAAiBH;AAAA,I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,cACT,OAAM;AAAA,cACN,OAAOrB;AAAA,cACP,SAASJ;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUM;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAW,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBQ,GAAK,EAAA,WAAU,OAAM,QAAO,UAAS,UAEtC,wCAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -15,13 +15,8 @@ const n = {
15
15
  description: "Student is ready to tackle challenging concepts and problems.",
16
16
  icon: e.GREEN_FACE
17
17
  }
18
- }, i = {
19
- "MATH.POS.PLA1": "MATH.LVL.BEGIN",
20
- "MATH.POS.PLA2": "MATH.LVL.INTERMEDIATE",
21
- "MATH.POS.PLA3": "MATH.LVL.ADVANCED"
22
18
  };
23
19
  export {
24
- i as PREFERENCE_CODE_MAP,
25
20
  n as studentLevels
26
21
  };
27
22
  //# sourceMappingURL=student-feedback-constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-feedback-constants.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback-constants.ts"],"sourcesContent":["import { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\n\nexport const studentLevels: Record<string, { title: string; description: string; icon: string }> = {\n beginner: {\n title: 'Basic',\n description: 'Student needs to focus on foundational concepts and skills',\n icon: ILLUSTRATIONS.ORANGE_FACE,\n },\n intermediate: {\n title: 'Intermediate',\n description: 'Student is comfortable with the basics, and is ready to apply them in problems',\n icon: ILLUSTRATIONS.YELLOW_FACE,\n },\n advanced: {\n title: 'Advanced',\n description: 'Student is ready to tackle challenging concepts and problems.',\n icon: ILLUSTRATIONS.GREEN_FACE,\n },\n};\n\nexport const PREFERENCE_CODE_MAP = {\n 'MATH.POS.PLA1': 'MATH.LVL.BEGIN',\n 'MATH.POS.PLA2': 'MATH.LVL.INTERMEDIATE',\n 'MATH.POS.PLA3': 'MATH.LVL.ADVANCED',\n};\n"],"names":["studentLevels","ILLUSTRATIONS","PREFERENCE_CODE_MAP"],"mappings":";AAEO,MAAMA,IAAsF;AAAA,EACjG,UAAU;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMC,EAAc;AAAA,EACtB;AAAA,EACA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMA,EAAc;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMA,EAAc;AAAA,EACtB;AACF,GAEaC,IAAsB;AAAA,EACjC,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;"}
1
+ {"version":3,"file":"student-feedback-constants.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback-constants.ts"],"sourcesContent":["import { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\n\nexport const studentLevels: Record<string, { title: string; description: string; icon: string }> = {\n beginner: {\n title: 'Basic',\n description: 'Student needs to focus on foundational concepts and skills',\n icon: ILLUSTRATIONS.ORANGE_FACE,\n },\n intermediate: {\n title: 'Intermediate',\n description: 'Student is comfortable with the basics, and is ready to apply them in problems',\n icon: ILLUSTRATIONS.YELLOW_FACE,\n },\n advanced: {\n title: 'Advanced',\n description: 'Student is ready to tackle challenging concepts and problems.',\n icon: ILLUSTRATIONS.GREEN_FACE,\n },\n};\n"],"names":["studentLevels","ILLUSTRATIONS"],"mappings":";AAEO,MAAMA,IAAsF;AAAA,EACjG,UAAU;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMC,EAAc;AAAA,EACtB;AAAA,EACA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMA,EAAc;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMA,EAAc;AAAA,EACtB;AACF;"}