@cuemath/leap 2.8.49 → 2.8.50-link.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,98 +8,98 @@ 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
10
  import G from "../../../ui/loader/app-loader/app-loader.js";
11
- import C from "../../../ui/separator/separator.js";
11
+ import A from "../../../ui/separator/separator.js";
12
12
  import h from "../../../ui/text/text.js";
13
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";
17
17
  import { studentLevels as J } from "../student-feedback/student-feedback-constants.js";
18
- import n from "./report-card.js";
18
+ import o 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
- const Ie = W(() => {
21
- const { onEvent: P } = Y(), { formData: O, milestoneConfig: d } = V(), { name: p, grade: I, attemptId: u = "shg", personalizedLevel: i = [] } = O || {}, {
22
- data: A,
20
+ const Ce = W(() => {
21
+ const { onEvent: P } = Y(), { formData: O, milestoneConfig: d } = V(), { name: p, grade: C, attemptId: u = "shg", personalizedLevel: a = [] } = O || {}, {
22
+ data: I,
23
23
  get: L,
24
24
  isProcessing: k,
25
25
  isProcessingFailed: y
26
26
  } = K(), f = w(() => {
27
27
  var r, m;
28
- const o = ((m = (r = U(d, {
29
- grade: I ?? "",
28
+ const i = ((m = (r = U(d, {
29
+ grade: C ?? "",
30
30
  courseStream: F.MATH,
31
31
  preferenceCategory: H.LEVEL
32
- })) == null ? void 0 : r.find((_) => _.id === (i == null ? void 0 : i[0]))) == null ? void 0 : m.label) ?? "";
33
- return J[o.toLowerCase()];
34
- }, [I, d, i]), {
32
+ })) == null ? void 0 : r.find((_) => _.id === (a == null ? void 0 : a[0]))) == null ? void 0 : m.label) ?? "";
33
+ return J[i.toLowerCase()];
34
+ }, [C, d, a]), {
35
35
  next_steps: M,
36
36
  topic_data: g,
37
37
  solved_with_help: l,
38
- problems_attempted: a,
38
+ problems_attempted: n,
39
39
  new_concepts_learnt: c,
40
40
  solved_independently: s,
41
41
  default_topic_image_url: N
42
- } = A || {}, $ = B(() => {
42
+ } = I || {}, $ = B(() => {
43
43
  var r;
44
- const o = q(
44
+ const i = q(
45
45
  d,
46
- i
46
+ a
47
47
  );
48
- u && p && o.length > 0 && L(u, {
49
- student_level: ((r = o[0]) == null ? void 0 : r.preference_name) ?? "",
48
+ u && p && i.length > 0 && L(u, {
49
+ student_level: ((r = i[0]) == null ? void 0 : r.preference_name) ?? "",
50
50
  student_name: p
51
51
  });
52
- }, [u, L, d, p, i]);
52
+ }, [u, L, d, p, a]);
53
53
  D(() => {
54
54
  $();
55
55
  }, [$]);
56
- const T = w(() => a ? a === s || !l && s ? /* @__PURE__ */ t(E, { children: [
57
- /* @__PURE__ */ e(n, { title: "Problems Attempted", value: a }),
58
- /* @__PURE__ */ e(n, { title: "Solved without help", value: s }),
56
+ const v = w(() => n ? n === s || !l && s ? /* @__PURE__ */ t(E, { children: [
57
+ /* @__PURE__ */ e(o, { title: "Problems Attempted", value: n }),
58
+ /* @__PURE__ */ e(o, { title: "Solved without help", value: s }),
59
59
  /* @__PURE__ */ e(
60
- n,
60
+ o,
61
61
  {
62
62
  title: "Performance",
63
- value: `${Math.round(s / a * 100)}%`
63
+ value: `${Math.round(s / n * 100)}%`
64
64
  }
65
65
  )
66
- ] }) : l && c ? /* @__PURE__ */ t(E, { children: [
67
- /* @__PURE__ */ e(n, { title: "Problems Attempted", value: a }),
68
- /* @__PURE__ */ e(n, { title: "Needed help in", value: c }),
69
- /* @__PURE__ */ e(n, { title: "Improvement shown in", value: l }),
66
+ ] }) : !l && !s ? /* @__PURE__ */ e(o, { title: "Problems Attempted", value: n }) : l && c ? /* @__PURE__ */ t(E, { children: [
67
+ /* @__PURE__ */ e(o, { title: "Problems Attempted", value: n }),
68
+ /* @__PURE__ */ e(o, { title: "Needed help in", value: c }),
69
+ /* @__PURE__ */ e(o, { title: "Improvement shown in", value: l }),
70
70
  /* @__PURE__ */ e(
71
- n,
71
+ o,
72
72
  {
73
73
  title: "Improvement",
74
74
  value: `${Math.round(l / c * 100)}%`
75
75
  }
76
76
  )
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
- /* @__PURE__ */ e(C, { height: 60 }),
77
+ ] }) : null : null, [c, n, s, l]);
78
+ return y ? /* @__PURE__ */ e(j, { height: "70vh", onTryAgain: $ }) : k || !I ? /* @__PURE__ */ e(G, { height: "100vh" }) : /* @__PURE__ */ t(Q, { children: [
79
+ /* @__PURE__ */ e(A, { height: 60 }),
80
80
  /* @__PURE__ */ e(z, { textToInsert: (f == null ? void 0 : f.title) ?? "" }),
81
- T ? /* @__PURE__ */ t(S, { $width: 750, $borderColor: "BLACK_1", children: [
82
- /* @__PURE__ */ e(X, { $flexDirection: "row", $height: 100, $background: "YELLOW_1", children: T }),
83
- /* @__PURE__ */ e(Z, { $flexDirection: "row", $background: "WHITE_1", children: g && g.length > 0 && g.map((o) => {
81
+ v ? /* @__PURE__ */ t(S, { $width: 750, $borderColor: "BLACK_1", children: [
82
+ /* @__PURE__ */ e(X, { $flexDirection: "row", $height: 100, $background: "YELLOW_1", children: v }),
83
+ /* @__PURE__ */ e(Z, { $flexDirection: "row", $background: "WHITE_1", children: g && g.length > 0 && g.map((i) => {
84
84
  const {
85
85
  topic_name: r,
86
86
  topic_image: m,
87
87
  summary: _,
88
- is_attempted: v
89
- } = o;
90
- return m || P("TOPIC_THUMBNAIL_NOT_AVAILABLE", o), /* @__PURE__ */ t(
88
+ is_attempted: T
89
+ } = i;
90
+ return m || P("TOPIC_THUMBNAIL_NOT_AVAILABLE", i), /* @__PURE__ */ t(
91
91
  b,
92
92
  {
93
93
  $gap: 35,
94
94
  $gutter: 29,
95
95
  $flex: 1,
96
96
  $alignItems: "center",
97
- $opacity: v ? 1 : 0.4,
97
+ $opacity: T ? 1 : 0.4,
98
98
  children: [
99
99
  /* @__PURE__ */ e(
100
100
  ee,
101
101
  {
102
- $active: !!v,
102
+ $active: !!T,
103
103
  src: m || N,
104
104
  borderRadius: 96,
105
105
  height: 96,
@@ -108,9 +108,9 @@ const Ie = W(() => {
108
108
  withLoader: !0
109
109
  }
110
110
  ),
111
- /* @__PURE__ */ e(C, { height: 12 }),
111
+ /* @__PURE__ */ e(A, { height: 12 }),
112
112
  /* @__PURE__ */ e(h, { $renderAs: "ab3-black", $align: "center", children: r }),
113
- /* @__PURE__ */ e(C, { height: 2 }),
113
+ /* @__PURE__ */ e(A, { height: 2 }),
114
114
  /* @__PURE__ */ e(h, { $renderAs: "ub3", $align: "center", children: _ })
115
115
  ]
116
116
  },
@@ -177,6 +177,6 @@ const Ie = W(() => {
177
177
  ] });
178
178
  });
179
179
  export {
180
- Ie as default
180
+ Ce as default
181
181
  };
182
182
  //# sourceMappingURL=session-report.js.map
@@ -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! {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","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-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 && !solvedIndependently) {\n return <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />;\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,EAAcP,EAAc,YAAA,CAAa;AAAA,EAC/C,GAAA,CAAC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F,IAEA,gBAAAa;AAAA,MAACS;AAAAA,MAAA;AAAA,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;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "2.8.49",
3
+ "version": "2.8.50-link.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -15,7 +15,7 @@
15
15
  "ts-watch": "tsc --noEmit -watch",
16
16
  "preview": "vite preview",
17
17
  "prepare": "husky install",
18
- "build-storybook": "storybook build",
18
+ "build-storybook": "rm -rf storybook-static && storybook build",
19
19
  "prepublishOnly": "yarn build",
20
20
  "hash-image": "node scripts/hash-images.js"
21
21
  },
@@ -93,6 +93,5 @@
93
93
  "vite-plugin-dts": "3.6.4",
94
94
  "vite-plugin-svgr": "3.2.0",
95
95
  "vite-tsconfig-paths": "^4.2.2"
96
- },
97
- "packageManager": "yarn@4.4.1"
96
+ }
98
97
  }