@cuemath/leap 2.8.38-hg4 → 2.8.39
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.
- package/dist/assets/line-icons/icons/sheet.js +54 -0
- package/dist/assets/line-icons/icons/sheet.js.map +1 -0
- package/dist/assets/lottie/lottie.js +0 -6
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +15 -13
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +3 -3
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +35 -29
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js +11 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js +16 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +42 -35
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +212 -223
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js +7 -8
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +24 -25
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js +3 -8
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds-enums.js +2 -2
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds-enums.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +17 -22
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +2 -1
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +11 -9
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/edit/comps/milestone-edit-loader/milestone-edit-loader-styled.js +6 -8
- package/dist/features/milestone/edit/comps/milestone-edit-loader/milestone-edit-loader-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +130 -117
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js +205 -0
- package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/api/get-resource.js +11 -0
- package/dist/features/milestone/milestone-resources/resources-assign/api/get-resource.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js +9 -0
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/api/lpar-resource-assign.js +9 -0
- package/dist/features/milestone/milestone-resources/resources-assign/api/lpar-resource-assign.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.js +19 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js +47 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item-styled.js +22 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item-styled.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item.js +60 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/utils.js +6 -0
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/utils.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/constant.js +6 -0
- package/dist/features/milestone/milestone-resources/resources-assign/constant.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-assign-analytics-events.js +19 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-assign-analytics-events.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/no-resource-screen.js +32 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/no-resource-screen.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items-styled.js +19 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items-styled.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js +85 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign-styled.js +65 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign-styled.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +233 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/utils.js +12 -0
- package/dist/features/milestone/milestone-resources/resources-assign/utils.js.map +1 -0
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js.map +1 -1
- package/dist/features/post-game-stats/points/points.js +10 -15
- package/dist/features/post-game-stats/points/points.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +61 -83
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/features/trial-session/comps/about-cuemath/about-cuemath-constants.js +1 -1
- package/dist/features/trial-session/comps/about-cuemath/about-cuemath-constants.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/class-preference.js +10 -10
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals-view.js +7 -7
- package/dist/features/trial-session/comps/school-goals/school-goals-view.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +23 -21
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +5 -5
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +37 -39
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +11 -11
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/left-panel/index.js +1 -1
- package/dist/features/trial-session/left-panel/index.js.map +1 -1
- package/dist/features/ui/grade-selector/grade-tab.js +15 -15
- package/dist/features/ui/grade-selector/grade-tab.js.map +1 -1
- package/dist/features/ui/inputs/searchable-input/searchable-input-styled.js +28 -0
- package/dist/features/ui/inputs/searchable-input/searchable-input-styled.js.map +1 -0
- package/dist/features/ui/inputs/searchable-input/searchable-input.js +101 -0
- package/dist/features/ui/inputs/searchable-input/searchable-input.js.map +1 -0
- package/dist/features/ui/tab/tab-styled.js +7 -8
- package/dist/features/ui/tab/tab-styled.js.map +1 -1
- package/dist/features/ui/tab/tab.js +36 -31
- package/dist/features/ui/tab/tab.js.map +1 -1
- package/dist/features/ui/theme/tab.js +3 -3
- package/dist/features/ui/theme/tab.js.map +1 -1
- package/dist/index.d.ts +46 -53
- package/dist/index.js +345 -343
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star-styled.js +0 -25
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js +0 -57
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star-styled.js +0 -27
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js +0 -37
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js +0 -17
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js +0 -47
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js +0 -6
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/constants.js +0 -16
- package/dist/features/post-game-stats/digital-meter/constants.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +0 -87
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter.js +0 -188
- package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/helper.js +0 -33
- package/dist/features/post-game-stats/digital-meter/helper.js.map +0 -1
- package/dist/features/post-game-stats/number-count-animation/number-count-animation.js +0 -27
- package/dist/features/post-game-stats/number-count-animation/number-count-animation.js.map +0 -1
- package/dist/static/point2.7cec6e24.json +0 -1
- package/dist/static/point3.f96fe7aa.json +0 -1
- package/dist/static/point4.fe04fb83.json +0 -1
- package/dist/static/table-mode-star.b8a1d762.json +0 -1
- package/dist/static/table-segment-star.78e851d6.json +0 -1
- package/dist/static/target-achieved-text.053bd142.json +0 -2830
- package/dist/static/target-achieved-text.10db8475.json +0 -1
@@ -15,9 +15,9 @@ const C = [
|
|
15
15
|
{ id: 1, selectedDay: "", selectedTime: "" },
|
16
16
|
{ id: 2, selectedDay: "", selectedTime: "" }
|
17
17
|
], se = A(({ miniScreenDevice: D }) => {
|
18
|
-
const { isTeacher:
|
18
|
+
const { isTeacher: n, formData: x, updateSlideConfig: p } = z(), { preferences: o, studentTimezone: c } = x || {}, b = f.map((e) => ({ id: e, label: e })), h = n ? y : c, T = (e, t, s) => {
|
19
19
|
p({
|
20
|
-
preferences: (
|
20
|
+
preferences: (o ?? C).map(
|
21
21
|
(r) => r.id === e ? { ...r, [t]: s } : r
|
22
22
|
)
|
23
23
|
});
|
@@ -28,16 +28,16 @@ const C = [
|
|
28
28
|
}, E = O(
|
29
29
|
(e, t) => {
|
30
30
|
if (e && t && c) {
|
31
|
-
const { hours: s, minutes: r } = j(t), m = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), l = v(y, c), i =
|
31
|
+
const { hours: s, minutes: r } = j(t), m = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), l = v(y, c), i = n ? m + l : m, { day: L = "" } = g(i, c), I = f.indexOf(L), X = (f.indexOf(e) - I + 7) % 7, k = i + H({ days: X, hours: s, minutes: r });
|
32
32
|
return g(k, h);
|
33
33
|
}
|
34
34
|
return {};
|
35
35
|
},
|
36
|
-
[
|
36
|
+
[n, c, h]
|
37
37
|
);
|
38
38
|
return w(() => {
|
39
|
-
|
40
|
-
}, [
|
39
|
+
n && !o && p({ preferences: C });
|
40
|
+
}, [n, o, p]), /* @__PURE__ */ d(F, { children: [
|
41
41
|
/* @__PURE__ */ a(P, { height: 60 }),
|
42
42
|
/* @__PURE__ */ a(B, {}),
|
43
43
|
/* @__PURE__ */ d(
|
@@ -52,7 +52,7 @@ const C = [
|
|
52
52
|
$alignItems: "center",
|
53
53
|
children: [
|
54
54
|
/* @__PURE__ */ a(M, {}),
|
55
|
-
|
55
|
+
o == null ? void 0 : o.map((e) => {
|
56
56
|
const { id: t, selectedDay: s, selectedTime: r } = e, { day: m, time: l } = E(s, r);
|
57
57
|
return /* @__PURE__ */ d(u, { $widthX: 15, $background: "YELLOW_1", $borderColor: "BLACK_1", children: [
|
58
58
|
/* @__PURE__ */ d(u, { $gapX: 1.65, $gutterX: 2, $flexGapX: 0.25, children: [
|
@@ -90,13 +90,13 @@ const C = [
|
|
90
90
|
$gutterX: 2,
|
91
91
|
$justifyContent: "center",
|
92
92
|
$background: "WHITE_T_60",
|
93
|
-
children: /* @__PURE__ */ d(W, { $renderAs: "ac4-black", $align: "center", children: [
|
93
|
+
children: n ? /* @__PURE__ */ d(W, { $renderAs: "ac4-black", $align: "center", children: [
|
94
94
|
m ? m.slice(0, 3) : "__",
|
95
95
|
", ",
|
96
96
|
l || "__",
|
97
97
|
" ",
|
98
|
-
|
99
|
-
] })
|
98
|
+
n ? "(IST)" : ""
|
99
|
+
] }) : null
|
100
100
|
}
|
101
101
|
)
|
102
102
|
] }, `slot-${t}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone } = formData || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({ preferences: defaultPreferences });\n }\n }, [isTeacher, preferences, updateSlideConfig]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n
|
1
|
+
{"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone } = formData || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({ preferences: defaultPreferences });\n }\n }, [isTeacher, preferences, updateSlideConfig]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","updateSlideConfig","useTrialSessionContext","preferences","studentTimezone","daySlots","DAYS","day","timezone","teacherTimezone","handlePreferenceChange","id","field","value","preference","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.PreferenceWrapper","Styled.FixedLineSeparator","selectedDay","selectedTime","time","FlexView","SelectInput","timeSlots","Text"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAqB;AAAA,EACzB,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAAA,EAC3C,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAC7C,GAEMC,KAAwCC,EAAK,CAAC,EAAE,kBAAAC,QAAuB;AAC3E,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,MAAsBC,EAAuB,GACpE,EAAE,aAAAC,GAAa,iBAAAC,MAAoBJ,KAAY,CAAA,GAE/CK,IAAWC,EAAK,IAAI,CAAAC,OAAQ,EAAE,IAAIA,GAAK,OAAOA,EAAA,EAAM,GACpDC,IAAWT,IAAYU,IAAkBL,GAEzCM,IAAyB,CAC7BC,GAC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AwB;AAAA,gBAACQ;AAAA,gBAAA;AAAA,kBACC,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,iBAAgB;AAAA,kBAChB,aAAY;AAAA,kBAEX,cACE,gBAAAV,EAAAa,GAAA,EAAK,WAAU,aAAY,QAAO,UAChC,UAAA;AAAA,oBAAAzC,IAAMA,EAAI,MAAM,GAAG,CAAC,IAAI;AAAA,oBAAK;AAAA,oBAAGqC,KAAc;AAAA,oBAAK;AAAA,oBAAE7C,IAAY,UAAU;AAAA,kBAAA,EAAA,CAC9E,IACE;AAAA,gBAAA;AAAA,cACN;AAAA,YAlCa,EAAA,GAAA,QAAQY,CAAE,EAmCzB;AAAA,UAAA;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -3,8 +3,8 @@ import { GIF as c } from "../../../../assets/gif/gif.js";
|
|
3
3
|
import f from "../../../ui/image/image.js";
|
4
4
|
import C from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
5
5
|
import o from "../../../ui/inputs/select-input/select-input.js";
|
6
|
-
import
|
7
|
-
import
|
6
|
+
import S from "../../../ui/inputs/text-input/text-input.js";
|
7
|
+
import b from "../../../ui/layout/flex-view.js";
|
8
8
|
import g from "../../../ui/separator/separator.js";
|
9
9
|
import x from "../slide-header/index.js";
|
10
10
|
import { Container as $, ContentWrapper as w, ImageWrapper as L, InputContainer as y } from "./school-goals-styled.js";
|
@@ -35,9 +35,9 @@ const D = ({
|
|
35
35
|
$gapX: 2.5,
|
36
36
|
$gutterX: 2.5,
|
37
37
|
children: [
|
38
|
-
/* @__PURE__ */ r(
|
38
|
+
/* @__PURE__ */ r(b, { $flexDirection: "row", $flexColumnGapX: 1.5, children: [
|
39
39
|
/* @__PURE__ */ e(
|
40
|
-
|
40
|
+
S,
|
41
41
|
{
|
42
42
|
renderAs: "primary",
|
43
43
|
label: "Student name",
|
@@ -54,7 +54,7 @@ const D = ({
|
|
54
54
|
o,
|
55
55
|
{
|
56
56
|
renderAs: "primary",
|
57
|
-
label: "Grade",
|
57
|
+
label: "Select Grade",
|
58
58
|
value: t,
|
59
59
|
options: s,
|
60
60
|
shape: "borderLess",
|
@@ -69,7 +69,7 @@ const D = ({
|
|
69
69
|
o,
|
70
70
|
{
|
71
71
|
renderAs: "primary",
|
72
|
-
label: "Curriculum",
|
72
|
+
label: "Select Curriculum",
|
73
73
|
value: a,
|
74
74
|
options: l,
|
75
75
|
disabled: !t,
|
@@ -84,7 +84,7 @@ const D = ({
|
|
84
84
|
C,
|
85
85
|
{
|
86
86
|
renderAs: "primary",
|
87
|
-
label: "Goal",
|
87
|
+
label: "Select a Goal",
|
88
88
|
value: d,
|
89
89
|
options: h,
|
90
90
|
shape: "borderLess",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"school-goals-view.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals-view.tsx"],"sourcesContent":["import type { TCurriculumStandardOption } from '../../../milestone/create/milestone-create-types';\nimport type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\nimport type { ISectionOption } from '../../../ui/section-list/section-list-types';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './school-goals-styled';\n\ninterface ISchoolGoals {\n header?: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n grades: ISelectOption<string>[];\n curriculumStandards: ISectionOption<TCurriculumStandardOption>[];\n goalsList: ISelectOption<string>[];\n selectedGoal?: string;\n onNameChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n onGradeChange: (value: string) => void;\n onCurriculumChange: (value: string) => void;\n onGoalChange: (value: string, option: ISelectOption<string | number>) => void;\n}\n\nconst SchoolGoalsView = ({\n name,\n onNameChange,\n grade,\n grades,\n onGradeChange,\n curriculum,\n curriculumStandards,\n onCurriculumChange,\n selectedGoal,\n goalsList,\n onGoalChange,\n}: ISchoolGoals) => {\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.SCHOOL_SUCCESS} 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 <FlexView $flexDirection=\"row\" $flexColumnGapX={1.5}>\n <TextInput\n renderAs=\"primary\"\n label=\"Student name\"\n value={name}\n type=\"text\"\n name=\"name\"\n shape=\"borderLess\"\n onChange={onNameChange}\n width=\"100%\"\n isTransparent\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Grade\"\n value={grade}\n options={grades}\n shape=\"borderLess\"\n onChange={onGradeChange}\n theme=\"dark\"\n widthX={10}\n isTransparent\n />\n </FlexView>\n <SelectInput\n renderAs=\"primary\"\n label=\"Curriculum\"\n value={curriculum}\n options={curriculumStandards}\n disabled={!grade}\n shape=\"borderLess\"\n renderOptionsAs=\"section-list\"\n theme=\"dark\"\n onChange={onCurriculumChange}\n isTransparent\n />\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Goal\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={onGoalChange}\n isTransparent\n disabled={!grade || !curriculum}\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n};\n\nexport default SchoolGoalsView;\n"],"names":["SchoolGoalsView","name","onNameChange","grade","grades","onGradeChange","curriculum","curriculumStandards","onCurriculumChange","selectedGoal","goalsList","onGoalChange","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","FlexView","TextInput","SelectInput","SearchableSelectInput"],"mappings":";;;;;;;;;;AA6BA,MAAMA,IAAkB,CAAC;AAAA,EACvB,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AACF,MAEI,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,EAAC,gBAAAC,EAAAC,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,oBACtBC,GAAY,EAAA;AAAA,oBACZC,GAAA,EAAsB,gBAAe,OAAM,iBAAgB,UAC1D,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EAAM,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKC,EAAI,gBAAgB,WAAU,QAAQ,CAAA,GACxF;AAAA,IACA,gBAAAR;AAAA,MAACS;AAAAA,MAAA;AAAA,QACC,UAAU;AAAA,QACV,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,cAAa;AAAA,QACb,OAAO;AAAA,QACP,UAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAT,EAACU,GAAS,EAAA,gBAAe,OAAM,iBAAiB,KAC9C,UAAA;AAAA,YAAA,gBAAAR;AAAA,cAACS;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAOtB;AAAA,gBACP,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,UAAUC;AAAA,gBACV,OAAM;AAAA,gBACN,eAAa;AAAA,cAAA;AAAA,YACf;AAAA,YACA,gBAAAY;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAOrB;AAAA,gBACP,SAASC;AAAA,gBACT,OAAM;AAAA,gBACN,UAAUC;AAAA,gBACV,OAAM;AAAA,gBACN,QAAQ;AAAA,gBACR,eAAa;AAAA,cAAA;AAAA,YACf;AAAA,UAAA,GACF;AAAA,UACA,gBAAAS;AAAA,YAACU;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOlB;AAAA,cACP,SAASC;AAAA,cACT,UAAU,CAACJ;AAAA,cACX,OAAM;AAAA,cACN,iBAAgB;AAAA,cAChB,OAAM;AAAA,cACN,UAAUK;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,UACA,gBAAAM;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOhB;AAAA,cACP,SAASC;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUC;AAAA,cACV,eAAa;AAAA,cACb,UAAU,CAACR,KAAS,CAACG;AAAA,YAAA;AAAA,UACvB;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,GACF;AACF,EAAA,CAAA;"}
|
1
|
+
{"version":3,"file":"school-goals-view.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals-view.tsx"],"sourcesContent":["import type { TCurriculumStandardOption } from '../../../milestone/create/milestone-create-types';\nimport type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\nimport type { ISectionOption } from '../../../ui/section-list/section-list-types';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './school-goals-styled';\n\ninterface ISchoolGoals {\n header?: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n grades: ISelectOption<string>[];\n curriculumStandards: ISectionOption<TCurriculumStandardOption>[];\n goalsList: ISelectOption<string>[];\n selectedGoal?: string;\n onNameChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n onGradeChange: (value: string) => void;\n onCurriculumChange: (value: string) => void;\n onGoalChange: (value: string, option: ISelectOption<string | number>) => void;\n}\n\nconst SchoolGoalsView = ({\n name,\n onNameChange,\n grade,\n grades,\n onGradeChange,\n curriculum,\n curriculumStandards,\n onCurriculumChange,\n selectedGoal,\n goalsList,\n onGoalChange,\n}: ISchoolGoals) => {\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.SCHOOL_SUCCESS} 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 <FlexView $flexDirection=\"row\" $flexColumnGapX={1.5}>\n <TextInput\n renderAs=\"primary\"\n label=\"Student name\"\n value={name}\n type=\"text\"\n name=\"name\"\n shape=\"borderLess\"\n onChange={onNameChange}\n width=\"100%\"\n isTransparent\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Select Grade\"\n value={grade}\n options={grades}\n shape=\"borderLess\"\n onChange={onGradeChange}\n theme=\"dark\"\n widthX={10}\n isTransparent\n />\n </FlexView>\n <SelectInput\n renderAs=\"primary\"\n label=\"Select Curriculum\"\n value={curriculum}\n options={curriculumStandards}\n disabled={!grade}\n shape=\"borderLess\"\n renderOptionsAs=\"section-list\"\n theme=\"dark\"\n onChange={onCurriculumChange}\n isTransparent\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={onGoalChange}\n isTransparent\n disabled={!grade || !curriculum}\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n};\n\nexport default SchoolGoalsView;\n"],"names":["SchoolGoalsView","name","onNameChange","grade","grades","onGradeChange","curriculum","curriculumStandards","onCurriculumChange","selectedGoal","goalsList","onGoalChange","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","FlexView","TextInput","SelectInput","SearchableSelectInput"],"mappings":";;;;;;;;;;AA6BA,MAAMA,IAAkB,CAAC;AAAA,EACvB,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AACF,MAEI,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,EAAC,gBAAAC,EAAAC,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,oBACtBC,GAAY,EAAA;AAAA,oBACZC,GAAA,EAAsB,gBAAe,OAAM,iBAAgB,UAC1D,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EAAM,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKC,EAAI,gBAAgB,WAAU,QAAQ,CAAA,GACxF;AAAA,IACA,gBAAAR;AAAA,MAACS;AAAAA,MAAA;AAAA,QACC,UAAU;AAAA,QACV,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,cAAa;AAAA,QACb,OAAO;AAAA,QACP,UAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAT,EAACU,GAAS,EAAA,gBAAe,OAAM,iBAAiB,KAC9C,UAAA;AAAA,YAAA,gBAAAR;AAAA,cAACS;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAOtB;AAAA,gBACP,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,UAAUC;AAAA,gBACV,OAAM;AAAA,gBACN,eAAa;AAAA,cAAA;AAAA,YACf;AAAA,YACA,gBAAAY;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAOrB;AAAA,gBACP,SAASC;AAAA,gBACT,OAAM;AAAA,gBACN,UAAUC;AAAA,gBACV,OAAM;AAAA,gBACN,QAAQ;AAAA,gBACR,eAAa;AAAA,cAAA;AAAA,YACf;AAAA,UAAA,GACF;AAAA,UACA,gBAAAS;AAAA,YAACU;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOlB;AAAA,cACP,SAASC;AAAA,cACT,UAAU,CAACJ;AAAA,cACX,OAAM;AAAA,cACN,iBAAgB;AAAA,cAChB,OAAM;AAAA,cACN,UAAUK;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,UACA,gBAAAM;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOhB;AAAA,cACP,SAASC;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUC;AAAA,cACV,eAAa;AAAA,cACb,UAAU,CAACR,KAAS,CAACG;AAAA,YAAA;AAAA,UACvB;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,GACF;AACF,EAAA,CAAA;"}
|
@@ -3,14 +3,14 @@ import { memo as W, useMemo as w, useCallback as B, useEffect as D } from "react
|
|
3
3
|
import { ILLUSTRATIONS as x } from "../../../../assets/illustrations/illustrations.js";
|
4
4
|
import { COURSE_STREAMS as F, PREFERENCE_CATEGORY as H } from "../../../milestone/constants.js";
|
5
5
|
import { getPreferencesFromConfig as U } from "../../../milestone/create/milestone-create-helpers.js";
|
6
|
-
import { useUIContext as
|
7
|
-
import
|
6
|
+
import { useUIContext as Y } from "../../../ui/context/context.js";
|
7
|
+
import j from "../../../ui/error/error.js";
|
8
8
|
import R from "../../../ui/image/image.js";
|
9
9
|
import b from "../../../ui/layout/flex-view.js";
|
10
|
-
import
|
10
|
+
import G from "../../../ui/loader/app-loader/app-loader.js";
|
11
11
|
import C from "../../../ui/separator/separator.js";
|
12
|
-
import
|
13
|
-
import { useGetSessionReports as
|
12
|
+
import h from "../../../ui/text/text.js";
|
13
|
+
import { useGetSessionReports as K } from "../../api/trial-home.js";
|
14
14
|
import { useTrialSessionContext as V } from "../../context/use-trial-session-context.js";
|
15
15
|
import { getFormattedStudentPersonalizedPreference as q } from "../../helper.js";
|
16
16
|
import z from "../slide-header/index.js";
|
@@ -18,12 +18,12 @@ import { studentLevels as J } from "../student-feedback/student-feedback-constan
|
|
18
18
|
import n from "./report-card.js";
|
19
19
|
import { Container as Q, ContentWrapper as S, ReportWrapper as X, TopicWrapper as Z, TopicImage as ee, InlineText as te } from "./session-report-styled.js";
|
20
20
|
const Ie = W(() => {
|
21
|
-
const { onEvent: P } =
|
21
|
+
const { onEvent: P } = Y(), { formData: O, milestoneConfig: d } = V(), { name: p, grade: I, attemptId: u = "shg", personalizedLevel: i = [] } = O || {}, {
|
22
22
|
data: A,
|
23
23
|
get: L,
|
24
24
|
isProcessing: k,
|
25
25
|
isProcessingFailed: y
|
26
|
-
} =
|
26
|
+
} = K(), f = w(() => {
|
27
27
|
var r, m;
|
28
28
|
const o = ((m = (r = U(d, {
|
29
29
|
grade: I ?? "",
|
@@ -36,7 +36,7 @@ const Ie = W(() => {
|
|
36
36
|
topic_data: g,
|
37
37
|
solved_with_help: l,
|
38
38
|
problems_attempted: a,
|
39
|
-
new_concepts_learnt:
|
39
|
+
new_concepts_learnt: c,
|
40
40
|
solved_independently: s,
|
41
41
|
default_topic_image_url: N
|
42
42
|
} = A || {}, $ = B(() => {
|
@@ -45,11 +45,11 @@ const Ie = W(() => {
|
|
45
45
|
d,
|
46
46
|
i
|
47
47
|
);
|
48
|
-
u &&
|
48
|
+
u && p && o.length > 0 && L(u, {
|
49
49
|
student_level: ((r = o[0]) == null ? void 0 : r.preference_name) ?? "",
|
50
|
-
student_name:
|
50
|
+
student_name: p
|
51
51
|
});
|
52
|
-
}, [u, L, d,
|
52
|
+
}, [u, L, d, p, i]);
|
53
53
|
D(() => {
|
54
54
|
$();
|
55
55
|
}, [$]);
|
@@ -63,19 +63,19 @@ const Ie = W(() => {
|
|
63
63
|
value: `${Math.round(s / a * 100)}%`
|
64
64
|
}
|
65
65
|
)
|
66
|
-
] }) : l &&
|
66
|
+
] }) : l && c ? /* @__PURE__ */ t(E, { children: [
|
67
67
|
/* @__PURE__ */ e(n, { title: "Problems Attempted", value: a }),
|
68
|
-
/* @__PURE__ */ e(n, { title: "Needed help in", value:
|
68
|
+
/* @__PURE__ */ e(n, { title: "Needed help in", value: c }),
|
69
69
|
/* @__PURE__ */ e(n, { title: "Improvement shown in", value: l }),
|
70
70
|
/* @__PURE__ */ e(
|
71
71
|
n,
|
72
72
|
{
|
73
73
|
title: "Improvement",
|
74
|
-
value: `${Math.round(l /
|
74
|
+
value: `${Math.round(l / c * 100)}%`
|
75
75
|
}
|
76
76
|
)
|
77
|
-
] }) : null : null, [
|
78
|
-
return y ? /* @__PURE__ */ e(
|
77
|
+
] }) : null : null, [c, a, s, l]);
|
78
|
+
return y ? /* @__PURE__ */ e(j, { height: "70vh", onTryAgain: $ }) : k || !A ? /* @__PURE__ */ e(G, { height: "100vh" }) : /* @__PURE__ */ t(Q, { children: [
|
79
79
|
/* @__PURE__ */ e(C, { height: 60 }),
|
80
80
|
/* @__PURE__ */ e(z, { textToInsert: (f == null ? void 0 : f.title) ?? "" }),
|
81
81
|
T ? /* @__PURE__ */ t(S, { $width: 750, $borderColor: "BLACK_1", children: [
|
@@ -109,9 +109,9 @@ const Ie = W(() => {
|
|
109
109
|
}
|
110
110
|
),
|
111
111
|
/* @__PURE__ */ e(C, { height: 12 }),
|
112
|
-
/* @__PURE__ */ e(
|
112
|
+
/* @__PURE__ */ e(h, { $renderAs: "ab3-black", $align: "center", children: r }),
|
113
113
|
/* @__PURE__ */ e(C, { height: 2 }),
|
114
|
-
/* @__PURE__ */ e(
|
114
|
+
/* @__PURE__ */ e(h, { $renderAs: "ub3", $align: "center", children: _ })
|
115
115
|
]
|
116
116
|
},
|
117
117
|
r
|
@@ -137,7 +137,7 @@ const Ie = W(() => {
|
|
137
137
|
alt: "bulb"
|
138
138
|
}
|
139
139
|
),
|
140
|
-
/* @__PURE__ */ e(b, { $flex: 1, children: /* @__PURE__ */ t(
|
140
|
+
/* @__PURE__ */ e(b, { $flex: 1, children: /* @__PURE__ */ t(h, { $renderAs: "ab2-black", children: [
|
141
141
|
"Next Steps: ",
|
142
142
|
/* @__PURE__ */ e(te, { $renderAs: "ab2", children: M })
|
143
143
|
] }) })
|
@@ -164,8 +164,10 @@ const Ie = W(() => {
|
|
164
164
|
alt: "report-404"
|
165
165
|
}
|
166
166
|
),
|
167
|
-
/* @__PURE__ */ t(
|
168
|
-
"Oops!
|
167
|
+
/* @__PURE__ */ t(h, { $renderAs: "ab1-bold", $color: "BLACK_T_60", $align: "center", children: [
|
168
|
+
"Oops! ",
|
169
|
+
p,
|
170
|
+
" didn’t attempt",
|
169
171
|
/* @__PURE__ */ e("br", {}),
|
170
172
|
"any problems."
|
171
173
|
] })
|
@@ -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 { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport { useUIContext } from '../../../ui/context/context';\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 { 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 ReportCard from './report-card';\nimport * as Styled from './session-report-styled';\n\nconst SessionReport = memo(() => {\n const { onEvent: trackEvent } = useUIContext();\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 {\n next_steps: nextSteps,\n topic_data: topicData,\n solved_with_help: solvedWithHelp,\n problems_attempted: problemsAttempted,\n new_concepts_learnt: newConceptsLearnt,\n solved_independently: solvedIndependently,\n default_topic_image_url: defaultTopicImage,\n } = sessionReports || {};\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 const renderReportsInfoCard = useMemo(() => {\n if (!problemsAttempted) return null;\n\n if (problemsAttempted === solvedIndependently || (!solvedWithHelp && solvedIndependently)) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />\n <ReportCard title=\"Solved without help\" value={solvedIndependently} />\n <ReportCard\n title=\"Performance\"\n value={`${Math.round((solvedIndependently / problemsAttempted) * 100)}%`}\n />\n </>\n );\n }\n\n if (solvedWithHelp && newConceptsLearnt) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />\n <ReportCard title=\"Needed help in\" value={newConceptsLearnt} />\n <ReportCard title=\"Improvement shown in\" value={solvedWithHelp} />\n <ReportCard\n title=\"Improvement\"\n value={`${Math.round((solvedWithHelp / newConceptsLearnt) * 100)}%`}\n />\n </>\n );\n }\n\n return null;\n }, [newConceptsLearnt, problemsAttempted, solvedIndependently, solvedWithHelp]);\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 {renderReportsInfoCard ? (\n <Styled.ContentWrapper $width={750} $borderColor=\"BLACK_1\">\n <Styled.ReportWrapper $flexDirection=\"row\" $height={100} $background=\"YELLOW_1\">\n {renderReportsInfoCard}\n </Styled.ReportWrapper>\n <Styled.TopicWrapper $flexDirection=\"row\" $background=\"WHITE_1\">\n {topicData &&\n topicData.length > 0 &&\n topicData.map(topic => {\n const {\n topic_name: topicName,\n topic_image: topicImage,\n summary,\n is_attempted: isAttempted,\n } = topic;\n\n if (!topicImage) {\n trackEvent('TOPIC_THUMBNAIL_NOT_AVAILABLE', topic);\n }\n\n return (\n <FlexView\n key={topicName}\n $gap={35}\n $gutter={29}\n $flex={1}\n $alignItems=\"center\"\n $opacity={isAttempted ? 1 : 0.4}\n >\n <Styled.TopicImage\n $active={!!isAttempted}\n src={topicImage || defaultTopicImage}\n borderRadius={96}\n height={96}\n width={96}\n alt=\"topic\"\n withLoader\n />\n <Separator height={12} />\n <Text $renderAs=\"ab3-black\" $align=\"center\">\n {topicName}\n </Text>\n <Separator height={2} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n {summary}\n </Text>\n </FlexView>\n );\n })}\n </Styled.TopicWrapper>\n <FlexView\n $flexDirection=\"row\"\n $background=\"YELLOW_3\"\n $flexGap={4}\n $alignItems=\"center\"\n $gap={9}\n $gutter={8}\n >\n <Image\n src={ILLUSTRATIONS.COMMUNITY_BULB}\n width={80}\n height={80}\n withLoader\n alt=\"bulb\"\n />\n <FlexView $flex={1}>\n <Text $renderAs=\"ab2-black\">\n Next Steps: <Styled.InlineText $renderAs=\"ab2\">{nextSteps}</Styled.InlineText>\n </Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper\n $width={750}\n $height={400}\n $borderColor=\"BLACK_1\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n >\n <Image\n src={ILLUSTRATIONS.REPORT_404}\n height={152}\n width={152}\n withLoader\n alt=\"report-404\"\n />\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_T_60\" $align=\"center\">\n Oops! Kaniska didn’t attempt\n <br />\n any problems.\n </Text>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default SessionReport;\n"],"names":["SessionReport","memo","trackEvent","useUIContext","formData","milestoneConfig","useTrialSessionContext","name","grade","attemptId","personalizedLevel","sessionReports","getSessionReports","isProcessing","isProcessingFailed","useGetSessionReports","selectedSessionLevel","useMemo","selectedLabel","_b","_a","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","sessionLevel","studentLevels","nextSteps","topicData","solvedWithHelp","problemsAttempted","newConceptsLearnt","solvedIndependently","defaultTopicImage","fetchData","useCallback","studentLevel","getFormattedStudentPersonalizedPreference","useEffect","renderReportsInfoCard","jsxs","Fragment","jsx","ReportCard","Error","AppLoader","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","Styled.ReportWrapper","Styled.TopicWrapper","topic","topicName","topicImage","summary","isAttempted","FlexView","Styled.TopicImage","Text","Image","ILLUSTRATIONS","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAgBC,EAAK,MAAM;AAC/B,QAAM,EAAE,SAASC,EAAW,IAAIC,EAAa,GACvC,EAAE,UAAAC,GAAU,iBAAAC,EAAgB,IAAIC,EAAuB,GACvD,EAAE,MAAAC,GAAM,OAAAC,GAAO,WAAAC,IAAY,OAAO,mBAAAC,IAAoB,CAAC,EAAA,IAAMN,KAAY,IAEzE;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,GAExC;AAAA,IACJ,YAAYgB;AAAA,IACZ,YAAYC;AAAA,IACZ,kBAAkBC;AAAA,IAClB,oBAAoBC;AAAA,IACpB,qBAAqBC;AAAA,IACrB,sBAAsBC;AAAA,IACtB,yBAAyBC;AAAA,EAAA,IACvBrB,KAAkB,CAAA,GAEhBsB,IAAYC,EAAY,MAAM;;AAClC,UAAMC,IAAeC;AAAA,MACnB/B;AAAA,MACAK;AAAA,IAAA;AAGF,IAAID,KAAaF,KAAQ4B,EAAa,SAAS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A,YAAE;AAAA,UAAA,GAER;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,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 { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport { useUIContext } from '../../../ui/context/context';\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 { 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 ReportCard from './report-card';\nimport * as Styled from './session-report-styled';\n\nconst SessionReport = memo(() => {\n const { onEvent: trackEvent } = useUIContext();\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 {\n next_steps: nextSteps,\n topic_data: topicData,\n solved_with_help: solvedWithHelp,\n problems_attempted: problemsAttempted,\n new_concepts_learnt: newConceptsLearnt,\n solved_independently: solvedIndependently,\n default_topic_image_url: defaultTopicImage,\n } = sessionReports || {};\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 const renderReportsInfoCard = useMemo(() => {\n if (!problemsAttempted) return null;\n\n if (problemsAttempted === solvedIndependently || (!solvedWithHelp && solvedIndependently)) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />\n <ReportCard title=\"Solved without help\" value={solvedIndependently} />\n <ReportCard\n title=\"Performance\"\n value={`${Math.round((solvedIndependently / problemsAttempted) * 100)}%`}\n />\n </>\n );\n }\n\n if (solvedWithHelp && newConceptsLearnt) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />\n <ReportCard title=\"Needed help in\" value={newConceptsLearnt} />\n <ReportCard title=\"Improvement shown in\" value={solvedWithHelp} />\n <ReportCard\n title=\"Improvement\"\n value={`${Math.round((solvedWithHelp / newConceptsLearnt) * 100)}%`}\n />\n </>\n );\n }\n\n return null;\n }, [newConceptsLearnt, problemsAttempted, solvedIndependently, solvedWithHelp]);\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 {renderReportsInfoCard ? (\n <Styled.ContentWrapper $width={750} $borderColor=\"BLACK_1\">\n <Styled.ReportWrapper $flexDirection=\"row\" $height={100} $background=\"YELLOW_1\">\n {renderReportsInfoCard}\n </Styled.ReportWrapper>\n <Styled.TopicWrapper $flexDirection=\"row\" $background=\"WHITE_1\">\n {topicData &&\n topicData.length > 0 &&\n topicData.map(topic => {\n const {\n topic_name: topicName,\n topic_image: topicImage,\n summary,\n is_attempted: isAttempted,\n } = topic;\n\n if (!topicImage) {\n trackEvent('TOPIC_THUMBNAIL_NOT_AVAILABLE', topic);\n }\n\n return (\n <FlexView\n key={topicName}\n $gap={35}\n $gutter={29}\n $flex={1}\n $alignItems=\"center\"\n $opacity={isAttempted ? 1 : 0.4}\n >\n <Styled.TopicImage\n $active={!!isAttempted}\n src={topicImage || defaultTopicImage}\n borderRadius={96}\n height={96}\n width={96}\n alt=\"topic\"\n withLoader\n />\n <Separator height={12} />\n <Text $renderAs=\"ab3-black\" $align=\"center\">\n {topicName}\n </Text>\n <Separator height={2} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n {summary}\n </Text>\n </FlexView>\n );\n })}\n </Styled.TopicWrapper>\n <FlexView\n $flexDirection=\"row\"\n $background=\"YELLOW_3\"\n $flexGap={4}\n $alignItems=\"center\"\n $gap={9}\n $gutter={8}\n >\n <Image\n src={ILLUSTRATIONS.COMMUNITY_BULB}\n width={80}\n height={80}\n withLoader\n alt=\"bulb\"\n />\n <FlexView $flex={1}>\n <Text $renderAs=\"ab2-black\">\n Next Steps: <Styled.InlineText $renderAs=\"ab2\">{nextSteps}</Styled.InlineText>\n </Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper\n $width={750}\n $height={400}\n $borderColor=\"BLACK_1\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n >\n <Image\n src={ILLUSTRATIONS.REPORT_404}\n height={152}\n width={152}\n withLoader\n alt=\"report-404\"\n />\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_T_60\" $align=\"center\">\n Oops! {name} didn’t attempt\n <br />\n any problems.\n </Text>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default SessionReport;\n"],"names":["SessionReport","memo","trackEvent","useUIContext","formData","milestoneConfig","useTrialSessionContext","name","grade","attemptId","personalizedLevel","sessionReports","getSessionReports","isProcessing","isProcessingFailed","useGetSessionReports","selectedSessionLevel","useMemo","selectedLabel","_b","_a","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","sessionLevel","studentLevels","nextSteps","topicData","solvedWithHelp","problemsAttempted","newConceptsLearnt","solvedIndependently","defaultTopicImage","fetchData","useCallback","studentLevel","getFormattedStudentPersonalizedPreference","useEffect","renderReportsInfoCard","jsxs","Fragment","jsx","ReportCard","Error","AppLoader","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","Styled.ReportWrapper","Styled.TopicWrapper","topic","topicName","topicImage","summary","isAttempted","FlexView","Styled.TopicImage","Text","Image","ILLUSTRATIONS","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAgBC,EAAK,MAAM;AAC/B,QAAM,EAAE,SAASC,EAAW,IAAIC,EAAa,GACvC,EAAE,UAAAC,GAAU,iBAAAC,EAAgB,IAAIC,EAAuB,GACvD,EAAE,MAAAC,GAAM,OAAAC,GAAO,WAAAC,IAAY,OAAO,mBAAAC,IAAoB,CAAC,EAAA,IAAMN,KAAY,IAEzE;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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AAA,QACC,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,cAAa;AAAA,QACb,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACkB;AAAA,YAAA;AAAA,cACC,KAAKC,EAAc;AAAA,cACnB,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,YAAU;AAAA,cACV,KAAI;AAAA,YAAA;AAAA,UACN;AAAA,4BACCF,GAAK,EAAA,WAAU,YAAW,QAAO,cAAa,QAAO,UAAS,UAAA;AAAA,YAAA;AAAA,YACtDnD;AAAA,YAAK;AAAA,8BACX,MAAG,EAAA;AAAA,YAAE;AAAA,UAAA,GAER;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -2,8 +2,8 @@ import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { memo as _, useMemo as l, useCallback as $ } from "react";
|
3
3
|
import { GIF as G } from "../../../../assets/gif/gif.js";
|
4
4
|
import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
|
5
|
-
import { getGoalsFromConfig as
|
6
|
-
import
|
5
|
+
import { getGoalsFromConfig as S } from "../../../milestone/create/milestone-create-helpers.js";
|
6
|
+
import b from "../../../ui/image/image.js";
|
7
7
|
import y from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
8
8
|
import c from "../../../ui/separator/separator.js";
|
9
9
|
import x from "../../../ui/text/text.js";
|
@@ -14,7 +14,7 @@ import A from "../slide-header/index.js";
|
|
14
14
|
import { Container as M, ContentWrapper as j, ImageWrapper as k, InputContainer as w } from "./student-enrichment-styled.js";
|
15
15
|
const Q = _(() => {
|
16
16
|
const { formData: p, milestoneConfig: n, updateSlideConfig: a, trialHomeData: d } = L(), { grade: i, goals: e } = p || {}, { demo_info: f } = d, { stream: m } = f || {}, g = l(
|
17
|
-
() =>
|
17
|
+
() => S(n, {
|
18
18
|
countryCode: "US",
|
19
19
|
grade: i ?? "",
|
20
20
|
goalCategory: r.ENRICHMENT,
|
@@ -47,7 +47,7 @@ const Q = _(() => {
|
|
47
47
|
/* @__PURE__ */ o(c, { height: 60 }),
|
48
48
|
/* @__PURE__ */ o(A, {}),
|
49
49
|
/* @__PURE__ */ s(j, { $width: 750, $flexDirection: "row", $justifyContent: "center", children: [
|
50
|
-
/* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(
|
50
|
+
/* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(b, { withLoader: !0, height: 402, width: 302, src: G.ENRICHMENT, className: "image" }) }),
|
51
51
|
/* @__PURE__ */ o(
|
52
52
|
w,
|
53
53
|
{
|
@@ -61,7 +61,7 @@ const Q = _(() => {
|
|
61
61
|
y,
|
62
62
|
{
|
63
63
|
renderAs: "primary",
|
64
|
-
label: "Goal",
|
64
|
+
label: "Select a Goal",
|
65
65
|
value: h,
|
66
66
|
options: g,
|
67
67
|
shape: "borderLess",
|
@@ -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 } = trialHomeData;\n const { stream } = demoInfo || {};\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode: 'US',\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.ENRICHMENT,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, 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=\"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","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,EAAA,IAAWD,KAAY,IACzBE,IAAYC;AAAA,IAChB,MACEC,EAAmBV,GAAiB;AAAA,MAClC,aAAa;AAAA,MACb,OAAOI,KAAS;AAAA,MAChB,cAAcO,EAAc;AAAA,MAC5B,cAAcJ;AAAA,MACd,gBAAgB;AAAA,IAAA,CACjB;AAAA,IACH,CAACP,GAAiBI,GAAOG,CAAM;AAAA,EAAA,GAG3B,EAAE,WAAWK,EAAA,IAAiBH;AAAA,IAClC,OAAMJ,KAAA,gBAAAA,EAAO,KAAK,CAAAQ,MAAQA,EAAK,kBAAkBF,EAAc,gBAAe,CAAC;AAAA,IAC/E,CAACN,CAAK;AAAA,EAAA,GAGFS,IAAmBC;AAAA,IACvB,CAACC,GAAeC,MAA2C;AACzD,UAAI,CAACD,GAAO;AACV,cAAME,IAAyBb,KAAA,gBAAAA,EAAO;AAAA,UACpC,CAAAQ,MAAQA,EAAK,kBAAkBF,EAAc;AAAA;AAG7B,QAAAV,EAAA,EAAE,OAAOiB,EA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AAC;"}
|
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 } = demoInfo || {};\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode: 'US',\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.ENRICHMENT,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, 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","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,EAAA,IAAWD,K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K,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,48 +1,48 @@
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
2
|
-
import { memo as b, useMemo as
|
3
|
-
import { GOAL_CATEGORY as
|
4
|
-
import
|
2
|
+
import { memo as b, useMemo as A, useCallback as E, useEffect as s } from "react";
|
3
|
+
import { GOAL_CATEGORY as g } from "../../../milestone/constants.js";
|
4
|
+
import w from "../../../ui/error/error.js";
|
5
5
|
import G from "../../../ui/image/image.js";
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import { useGetStudentProfileSummary as
|
11
|
-
import { useTrialSessionContext as
|
12
|
-
import
|
13
|
-
import { Container as
|
14
|
-
import { getMilestoneGoalName as P, getDummyProfileImage as
|
6
|
+
import h from "../../../ui/layout/flex-view.js";
|
7
|
+
import L from "../../../ui/loader/app-loader/app-loader.js";
|
8
|
+
import D from "../../../ui/separator/separator.js";
|
9
|
+
import S from "../../../ui/text/text.js";
|
10
|
+
import { useGetStudentProfileSummary as X } from "../../api/student-profile-summary.js";
|
11
|
+
import { useTrialSessionContext as M } from "../../context/use-trial-session-context.js";
|
12
|
+
import O from "../slide-header/index.js";
|
13
|
+
import { Container as k, ContentWrapper as B, AbsoluteImage as H, ImageWrapper as R } from "./student-profile-styled.js";
|
14
|
+
import { getMilestoneGoalName as P, getDummyProfileImage as W } from "./student-profile-utils.js";
|
15
15
|
const re = b(() => {
|
16
|
-
const { isTeacher: t, studentId:
|
17
|
-
school_success_goal: P(r,
|
18
|
-
test_prep_goal: P(r,
|
16
|
+
const { isTeacher: t, studentId: l, formData: $, updateSlideConfig: d, updateButtonState: f } = M(), { name: y, goals: r, studentProfile: o } = $ || {}, { dummyProfileImageIndex: I, profileSummary: x } = o || {}, C = W(I), m = A(() => r && r.length > 0 ? {
|
17
|
+
school_success_goal: P(r, g.SCHOOL_SUCCESS),
|
18
|
+
test_prep_goal: P(r, g.TEST_PREP)
|
19
19
|
} : null, [r]), {
|
20
|
-
get:
|
21
|
-
data:
|
22
|
-
isProcessing:
|
23
|
-
isProcessed:
|
20
|
+
get: u,
|
21
|
+
data: _,
|
22
|
+
isProcessing: a,
|
23
|
+
isProcessed: c,
|
24
24
|
isProcessingFailed: T
|
25
|
-
} =
|
26
|
-
|
27
|
-
}, [
|
25
|
+
} = X(), { profile_summary: p } = _ || {}, n = E(() => {
|
26
|
+
m && u(l, m);
|
27
|
+
}, [u, m, l]);
|
28
28
|
return s(() => {
|
29
|
-
|
30
|
-
}, [
|
29
|
+
f("right", { isDisabled: a, isLoading: !1 });
|
30
|
+
}, [a, f]), s(() => {
|
31
31
|
t && !o && n();
|
32
32
|
}, [n, t, o]), s(() => {
|
33
|
-
t &&
|
33
|
+
t && c && d({
|
34
34
|
studentProfile: {
|
35
|
-
profileSummary:
|
35
|
+
profileSummary: p || "",
|
36
36
|
dummyProfileImageIndex: Math.floor(Math.random() * 6)
|
37
37
|
}
|
38
38
|
});
|
39
|
-
}, [
|
40
|
-
/* @__PURE__ */ e(
|
41
|
-
/* @__PURE__ */ e(
|
42
|
-
/* @__PURE__ */ i(
|
43
|
-
/* @__PURE__ */ e(
|
39
|
+
}, [c, t, p, d]), T ? /* @__PURE__ */ e(w, { height: "70vh", onTryAgain: n }) : a || !o ? /* @__PURE__ */ e(L, { height: "100vh" }) : /* @__PURE__ */ i(k, { children: [
|
40
|
+
/* @__PURE__ */ e(D, { height: 60 }),
|
41
|
+
/* @__PURE__ */ e(O, { marginBottom: 100 }),
|
42
|
+
/* @__PURE__ */ i(B, { $widthX: 46.875, children: [
|
43
|
+
/* @__PURE__ */ e(H, {}),
|
44
44
|
/* @__PURE__ */ i(
|
45
|
-
|
45
|
+
h,
|
46
46
|
{
|
47
47
|
$width: "100%",
|
48
48
|
$heightX: 21.875,
|
@@ -54,16 +54,14 @@ const re = b(() => {
|
|
54
54
|
$borderColor: "BLACK_T_87",
|
55
55
|
$borderRadiusX: 0.5,
|
56
56
|
children: [
|
57
|
-
/* @__PURE__ */ e(
|
58
|
-
/* @__PURE__ */ i(
|
59
|
-
/* @__PURE__ */ e(
|
60
|
-
/* @__PURE__ */ e(
|
57
|
+
/* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(G, { withLoader: !0, height: 200, width: 200, src: C }) }),
|
58
|
+
/* @__PURE__ */ i(h, { $flexGap: 16, children: [
|
59
|
+
/* @__PURE__ */ e(S, { $renderAs: "ac2-black", children: y }),
|
60
|
+
/* @__PURE__ */ e(S, { $renderAs: "ab1", children: x || "" })
|
61
61
|
] })
|
62
62
|
]
|
63
63
|
}
|
64
|
-
)
|
65
|
-
/* @__PURE__ */ e($, { heightX: 1 }),
|
66
|
-
/* @__PURE__ */ e(l, { $renderAs: "ub2", $align: "right", $color: "BLACK_T_60", children: "We can always update this later" })
|
64
|
+
)
|
67
65
|
] })
|
68
66
|
] });
|
69
67
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\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 SlideHeader from '../slide-header';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\nconst StudentProfile = memo(() => {\n const { isTeacher, studentId, formData, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { name, goals, studentProfile } = 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) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile]);\n\n useEffect(() => {\n if (isTeacher && isProcessed) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, studentProfileSummary, updateSlideConfig]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !studentProfile) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={100} />\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
|
1
|
+
{"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\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 SlideHeader from '../slide-header';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\nconst StudentProfile = memo(() => {\n const { isTeacher, studentId, formData, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { name, goals, studentProfile } = 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) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile]);\n\n useEffect(() => {\n if (isTeacher && isProcessed) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, studentProfileSummary, updateSlideConfig]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !studentProfile) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={100} />\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 </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","updateSlideConfig","updateButtonState","useTrialSessionContext","name","goals","studentProfile","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,KAAiBC,EAAK,MAAM;AAChC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,GAAmB,mBAAAC,EAAA,IACzDC,KAEI,EAAE,MAAAC,GAAM,OAAAC,GAAO,gBAAAC,EAAe,IAAIN,KAAY,CAAA,GAC9C,EAAE,wBAAAO,GAAwB,gBAAAC,MAAmBF,KAAkB,CAAA,GAC/DG,IAAoBC,EAAqBH,CAAsB,GAE/DI,IAAUC,EAA+C,MACzDP,KAASA,EAAM,SAAS,IACnB;AAAA,IACL,qBAAqBQ,EAAqBR,GAAOS,EAAc,cAAc;AAAA,IAC7E,gBAAgBD,EAAqBR,GAAOS,EAAc,SAAS;AAAA,EAAA,IAIhE,MACN,CAACT,CAAK,CAAC,GAEJ;AAAA,IACJ,KAAKU;AAAA,IACL,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAA4B,GA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