@cuemath/leap 3.5.51-as2 → 3.5.51-as4
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/features/homework/homework-card.js +96 -96
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +36 -27
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +4 -5
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/math-fit/math-fit/math-fit.js +1 -15
- package/dist/features/math-fit/math-fit/math-fit.js.map +1 -1
- package/dist/features/math-fit/math-fit-card/math-fit-card.js +32 -31
- package/dist/features/math-fit/math-fit-card/math-fit-card.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js +5 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js +66 -57
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js +3 -3
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js +13 -11
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js +60 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js +3 -2
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js +37 -43
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +38 -36
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js +16 -15
- package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/math-fit-report.js +19 -25
- package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/package.json +1 -1
- package/dist/features/math-fit/math-fit-overview/helpers.js +0 -46
- package/dist/features/math-fit/math-fit-overview/helpers.js.map +0 -1
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as p, useMemo as l } from "react";
|
|
3
3
|
import e from "../../ui/layout/flex-view.js";
|
|
4
4
|
import i from "../../ui/text/text.js";
|
|
5
|
-
import
|
|
5
|
+
import a from "./comps/report-header/report-header.js";
|
|
6
6
|
import g from "./comps/score-section/score-section.js";
|
|
7
|
-
import { transformSectionsToReportData as
|
|
8
|
-
|
|
7
|
+
import { transformSectionsToReportData as f, getQuestionStatusBgColor as c } from "./math-fit-report-helpers.js";
|
|
8
|
+
import { EQuestionState as s } from "../math-fit-overview/math-fit-overview-types.js";
|
|
9
|
+
const C = p(function({
|
|
9
10
|
data: o,
|
|
10
|
-
onReviewClick:
|
|
11
|
-
studentName:
|
|
11
|
+
onReviewClick: m,
|
|
12
|
+
studentName: u
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
+
const $ = l(() => f(o.sections), [o.sections]), h = l(() => {
|
|
14
15
|
if (o.previous_score)
|
|
15
16
|
return o.score - o.previous_score;
|
|
16
17
|
}, [o.score, o.previous_score]);
|
|
17
18
|
return /* @__PURE__ */ t(e, { $background: "BLACK_T_04", children: [
|
|
18
19
|
/* @__PURE__ */ r(
|
|
19
|
-
|
|
20
|
+
a,
|
|
20
21
|
{
|
|
21
22
|
score: o.score ?? 0,
|
|
22
23
|
maxScore: 10,
|
|
23
|
-
scoreChange:
|
|
24
|
+
scoreChange: h,
|
|
24
25
|
createdOnTs: o.created_on_ts,
|
|
25
|
-
studentName:
|
|
26
|
+
studentName: u
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
|
|
29
|
-
/* @__PURE__ */ r(e, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
section: n,
|
|
33
|
-
onReviewSection: l,
|
|
34
|
-
sheet: n.sheet
|
|
35
|
-
}
|
|
36
|
-
) }),
|
|
37
|
-
h !== s.length - 1 && /* @__PURE__ */ r(e, { $height: 1, $background: "BLACK_T_08" })
|
|
29
|
+
$.map((n, d) => /* @__PURE__ */ t(e, { $background: "WHITE", children: [
|
|
30
|
+
/* @__PURE__ */ r(e, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(g, { section: n, onReviewSection: m, sheet: n.sheet }) }),
|
|
31
|
+
d !== $.length - 1 && /* @__PURE__ */ r(e, { $height: 1, $background: "BLACK_T_08" })
|
|
38
32
|
] }, n.title)),
|
|
39
33
|
/* @__PURE__ */ r(e, { $gutterX: 1, $flexColumnGapX: 1, $gapX: 1, $alignItems: "center", children: /* @__PURE__ */ t(e, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: [
|
|
40
34
|
/* @__PURE__ */ t(e, { $flexDirection: "row", $flexColumnGapX: 0.25, $alignItems: "center", children: [
|
|
@@ -44,7 +38,7 @@ const f = d(function({
|
|
|
44
38
|
{
|
|
45
39
|
$width: 10,
|
|
46
40
|
$height: 10,
|
|
47
|
-
$background: c(
|
|
41
|
+
$background: c(s.CORRECT),
|
|
48
42
|
$borderRadiusX: 1
|
|
49
43
|
}
|
|
50
44
|
)
|
|
@@ -57,7 +51,7 @@ const f = d(function({
|
|
|
57
51
|
$width: 10,
|
|
58
52
|
$height: 10,
|
|
59
53
|
$borderRadiusX: 1,
|
|
60
|
-
$background: c(
|
|
54
|
+
$background: c(s.INCORRECT)
|
|
61
55
|
}
|
|
62
56
|
)
|
|
63
57
|
] }),
|
|
@@ -69,14 +63,14 @@ const f = d(function({
|
|
|
69
63
|
$borderRadiusX: 1,
|
|
70
64
|
$width: 10,
|
|
71
65
|
$height: 10,
|
|
72
|
-
$background: c(
|
|
66
|
+
$background: c(s.SKIPPED)
|
|
73
67
|
}
|
|
74
68
|
)
|
|
75
69
|
] })
|
|
76
70
|
] }) })
|
|
77
71
|
] });
|
|
78
|
-
}),
|
|
72
|
+
}), S = C;
|
|
79
73
|
export {
|
|
80
|
-
|
|
74
|
+
S as default
|
|
81
75
|
};
|
|
82
76
|
//# sourceMappingURL=math-fit-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport { getQuestionStatusBgColor, transformSectionsToReportData } from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\n\nconst MathFitReport: FC<IMathFitReportProps> = memo(function MathFitReport({\n data,\n onReviewClick,\n studentName,\n}) {\n const sectionData = useMemo(() => transformSectionsToReportData(data.sections), [data.sections]);\n\n const scoreChange = useMemo(() => {\n if (data.previous_score) {\n return data.score - data.previous_score;\n }\n\n return undefined;\n }, [data.score, data.previous_score]);\n\n return (\n <FlexView $background=\"BLACK_T_04\">\n <ReportHeader\n score={data.score ?? 0}\n maxScore={10}\n scoreChange={scoreChange}\n createdOnTs={data.created_on_ts}\n studentName={studentName}\n />\n\n {sectionData.map((section, index) => (\n <FlexView key={section.title} $background=\"WHITE\">\n <FlexView $gapX={1.5} $gutterX={1.25}>\n <ScoreSection
|
|
1
|
+
{"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport { getQuestionStatusBgColor, transformSectionsToReportData } from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\nimport { EQuestionState } from '../math-fit-overview/math-fit-overview-types';\n\nconst MathFitReport: FC<IMathFitReportProps> = memo(function MathFitReport({\n data,\n onReviewClick,\n studentName,\n}) {\n const sectionData = useMemo(() => transformSectionsToReportData(data.sections), [data.sections]);\n\n const scoreChange = useMemo(() => {\n if (data.previous_score) {\n return data.score - data.previous_score;\n }\n\n return undefined;\n }, [data.score, data.previous_score]);\n\n return (\n <FlexView $background=\"BLACK_T_04\">\n <ReportHeader\n score={data.score ?? 0}\n maxScore={10}\n scoreChange={scoreChange}\n createdOnTs={data.created_on_ts}\n studentName={studentName}\n />\n\n {sectionData.map((section, index) => (\n <FlexView key={section.title} $background=\"WHITE\">\n <FlexView $gapX={1.5} $gutterX={1.25}>\n <ScoreSection section={section} onReviewSection={onReviewClick} sheet={section.sheet} />\n </FlexView>\n {index !== sectionData.length - 1 && <FlexView $height={1} $background=\"BLACK_T_08\" />}\n </FlexView>\n ))}\n\n <FlexView $gutterX={1} $flexColumnGapX={1} $gapX={1} $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1} $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $flexColumnGapX={0.25} $alignItems=\"center\">\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n Correct\n </Text>\n <FlexView\n $width={10}\n $height={10}\n $background={getQuestionStatusBgColor(EQuestionState.CORRECT)}\n $borderRadiusX={1}\n />\n </FlexView>\n <FlexView $flexDirection=\"row\" $flexColumnGapX={0.25} $alignItems=\"center\">\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n Incorrect\n </Text>\n <FlexView\n $width={10}\n $height={10}\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(EQuestionState.INCORRECT)}\n />\n </FlexView>\n <FlexView $flexDirection=\"row\" $flexColumnGapX={0.25} $alignItems=\"center\">\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n Not Attempted\n </Text>\n <FlexView\n $borderRadiusX={1}\n $width={10}\n $height={10}\n $background={getQuestionStatusBgColor(EQuestionState.SKIPPED)}\n />\n </FlexView>\n </FlexView>\n </FlexView>\n </FlexView>\n );\n});\n\nexport default MathFitReport;\n"],"names":["MathFitReport","memo","data","onReviewClick","studentName","sectionData","useMemo","transformSectionsToReportData","scoreChange","jsxs","FlexView","jsx","ReportHeader","section","index","ScoreSection","Text","getQuestionStatusBgColor","EQuestionState","MathFitReport$1"],"mappings":";;;;;;;;AAUA,MAAMA,IAAyCC,EAAK,SAAuB;AAAA,EACzE,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AACF,GAAG;AACK,QAAAC,IAAcC,EAAQ,MAAMC,EAA8BL,EAAK,QAAQ,GAAG,CAACA,EAAK,QAAQ,CAAC,GAEzFM,IAAcF,EAAQ,MAAM;AAChC,QAAIJ,EAAK;AACA,aAAAA,EAAK,QAAQA,EAAK;AAAA,KAI1B,CAACA,EAAK,OAAOA,EAAK,cAAc,CAAC;AAGlC,SAAA,gBAAAO,EAACC,GAAS,EAAA,aAAY,cACpB,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOV,EAAK,SAAS;AAAA,QACrB,UAAU;AAAA,QACV,aAAAM;AAAA,QACA,aAAaN,EAAK;AAAA,QAClB,aAAAE;AAAA,MAAA;AAAA,IACF;AAAA,IAECC,EAAY,IAAI,CAACQ,GAASC,MACxB,gBAAAL,EAAAC,GAAA,EAA6B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Aa,UAE1C,iBAAA;AAAA,QACA,gBAAAL;AAAA,UAACD;AAAA,UAAA;AAAA,YACC,gBAAgB;AAAA,YAChB,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,aAAaO,EAAyBC,EAAe,OAAO;AAAA,UAAA;AAAA,QAC9D;AAAA,MAAA,GACF;AAAA,IAAA,EAAA,CACF,EACF,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDC,IAAenB;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -621,6 +621,12 @@ export declare enum EPostGameStat {
|
|
|
621
621
|
|
|
622
622
|
export declare const EPResourceAssign: FC<IEPResourceAssign>;
|
|
623
623
|
|
|
624
|
+
declare enum EQuestionState {
|
|
625
|
+
CORRECT = "CORRECT",
|
|
626
|
+
INCORRECT = "INCORRECT",
|
|
627
|
+
SKIPPED = "SKIPPED"
|
|
628
|
+
}
|
|
629
|
+
|
|
624
630
|
export declare const EraserIcon: FC<SVGProps<SVGSVGElement>>;
|
|
625
631
|
|
|
626
632
|
declare const Error_2: FC<IErrorProps>;
|
|
@@ -3204,7 +3210,6 @@ export declare interface INodeDataProps {
|
|
|
3204
3210
|
course_type: TCourseType;
|
|
3205
3211
|
desmos_calculator_enabled: boolean;
|
|
3206
3212
|
due_date_ts: number | null;
|
|
3207
|
-
homework_id?: string;
|
|
3208
3213
|
id: string;
|
|
3209
3214
|
image_hue: THueNames;
|
|
3210
3215
|
image_url: string | null;
|
|
@@ -3680,7 +3685,7 @@ export declare interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncabl
|
|
|
3680
3685
|
|
|
3681
3686
|
declare interface IQuestionDetail {
|
|
3682
3687
|
item_reference: string;
|
|
3683
|
-
state:
|
|
3688
|
+
state: EQuestionState;
|
|
3684
3689
|
order: number;
|
|
3685
3690
|
}
|
|
3686
3691
|
|
package/package.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { NODE_CARD_STATES as i } from "../../chapters-v2/constants/node-constants.js";
|
|
2
|
-
import { TSectionStatus as r } from "./math-fit-overview-types.js";
|
|
3
|
-
const a = 1e3 * 60 * 60, f = (t) => {
|
|
4
|
-
const e = t * 1e3 - Date.now();
|
|
5
|
-
if (e <= 0) return;
|
|
6
|
-
const n = Math.floor(e / a), o = Math.floor(n / 24);
|
|
7
|
-
return o < 1 ? `${n} ${n === 1 ? "hour" : "hours"} left` : `${o} ${o === 1 ? "day" : "days"} left`;
|
|
8
|
-
}, T = (t) => {
|
|
9
|
-
const { sheet: e } = t;
|
|
10
|
-
let n;
|
|
11
|
-
return e.state === "LOCKED" ? n = r.LOCKED : e.state === "COMPLETED" ? n = r.COMPLETED : e.state === "IN_PROGRESS" ? n = r.ACTIVE : n = r.ACTIVE, n;
|
|
12
|
-
}, S = (t) => {
|
|
13
|
-
const e = t.find(
|
|
14
|
-
(o) => o.sheet.state === i.NOT_STARTED || o.sheet.state === i.IN_PROGRESS
|
|
15
|
-
);
|
|
16
|
-
return e ? `${e.sheet.state === i.IN_PROGRESS ? "Resume" : "Start"} Section ${e.section_number}` : "Start Section";
|
|
17
|
-
}, C = (t) => {
|
|
18
|
-
const e = t.find(
|
|
19
|
-
(s) => s.sheet.state === i.NOT_STARTED || s.sheet.state === i.IN_PROGRESS
|
|
20
|
-
);
|
|
21
|
-
if (!e) return null;
|
|
22
|
-
const n = t.findIndex((s) => s.id === e.id) === 0, o = t.some((s) => s.sheet.state === r.COMPLETED);
|
|
23
|
-
return [n && !o ? "Do each section whenever it suits you, before the deadline." : `Start Section ${e.section_number} now, or later before the deadline.`, "Questions come from what you just learned"];
|
|
24
|
-
}, d = (t) => {
|
|
25
|
-
switch (t) {
|
|
26
|
-
case r.COMPLETED:
|
|
27
|
-
return "GREEN_2";
|
|
28
|
-
case r.ACTIVE:
|
|
29
|
-
return "YELLOW_1";
|
|
30
|
-
case r.LOCKED:
|
|
31
|
-
return "BLACK_T_08";
|
|
32
|
-
default:
|
|
33
|
-
return "WHITE";
|
|
34
|
-
}
|
|
35
|
-
}, l = (t) => t === r.COMPLETED ? "GREEN_1" : t === r.ACTIVE ? "YELLOW_1" : "WHITE_1", L = (t) => t === r.COMPLETED ? "GREEN_4" : t === r.ACTIVE ? "BLACK_1" : "BLACK_T_08", _ = (t) => t === r.COMPLETED ? "completed" : t === r.ACTIVE ? "active" : "disabled";
|
|
36
|
-
export {
|
|
37
|
-
f as calculateTimeLeftText,
|
|
38
|
-
d as getBackgroundColor,
|
|
39
|
-
C as getBeforeYouStartText,
|
|
40
|
-
l as getCardBackgroundColor,
|
|
41
|
-
L as getCardBorderColor,
|
|
42
|
-
_ as getCardVariant,
|
|
43
|
-
S as getStartButtonText,
|
|
44
|
-
T as mapSectionStatus
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../src/features/math-fit/math-fit-overview/helpers.ts"],"sourcesContent":["import { NODE_CARD_STATES } from '../../chapters-v2/constants/node-constants';\nimport {\n type IMathFitSection,\n TSectionStatus,\n type TSectionCardVariant,\n} from './math-fit-overview-types';\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n\nexport const calculateTimeLeftText = (dueDateTs: number): string | undefined => {\n const timeLeftMs = dueDateTs * 1000 - Date.now();\n\n if (timeLeftMs <= 0) return undefined;\n\n const hoursLeft = Math.floor(timeLeftMs / MS_PER_HOUR);\n const daysLeft = Math.floor(hoursLeft / 24);\n\n if (daysLeft < 1) {\n return `${hoursLeft} ${hoursLeft === 1 ? 'hour' : 'hours'} left`;\n }\n\n return `${daysLeft} ${daysLeft === 1 ? 'day' : 'days'} left`;\n};\n\nexport const mapSectionStatus = (section: IMathFitSection): TSectionStatus => {\n const { sheet } = section;\n\n let status: TSectionStatus;\n\n if (sheet.state === 'LOCKED') {\n status = TSectionStatus.LOCKED;\n } else if (sheet.state === 'COMPLETED') {\n status = TSectionStatus.COMPLETED;\n } else if (sheet.state === 'IN_PROGRESS') {\n status = TSectionStatus.ACTIVE;\n } else {\n status = TSectionStatus.ACTIVE;\n }\n\n return status;\n};\n\nexport const getStartButtonText = (sections: IMathFitSection[]): string => {\n const activeSection = sections.find(\n s =>\n s.sheet.state === NODE_CARD_STATES.NOT_STARTED ||\n s.sheet.state === NODE_CARD_STATES.IN_PROGRESS,\n );\n\n if (!activeSection) return 'Start Section';\n\n const action = activeSection.sheet.state === NODE_CARD_STATES.IN_PROGRESS ? 'Resume' : 'Start';\n\n return `${action} Section ${activeSection.section_number}`;\n};\n\nexport const getBeforeYouStartText = (sections: IMathFitSection[]): string[] | null => {\n const activeSection = sections.find(\n s =>\n s.sheet.state === NODE_CARD_STATES.NOT_STARTED ||\n s.sheet.state === NODE_CARD_STATES.IN_PROGRESS,\n );\n\n if (!activeSection) return null;\n\n const isFirstSection = sections.findIndex(s => s.id === activeSection.id) === 0;\n const hasCompletedSections = sections.some(s => s.sheet.state === TSectionStatus.COMPLETED);\n\n const firstLine =\n isFirstSection && !hasCompletedSections\n ? 'Do each section whenever it suits you, before the deadline.'\n : `Start Section ${activeSection.section_number} now, or later before the deadline.`;\n\n return [firstLine, 'Questions come from what you just learned'];\n};\n\nexport const getBackgroundColor = (status: TSectionStatus) => {\n switch (status) {\n case TSectionStatus.COMPLETED:\n return 'GREEN_2';\n case TSectionStatus.ACTIVE:\n return 'YELLOW_1';\n case TSectionStatus.LOCKED:\n return 'BLACK_T_08';\n default:\n return 'WHITE';\n }\n};\n\nexport const getCardBackgroundColor = (status: TSectionStatus) => {\n if (status === TSectionStatus.COMPLETED) return 'GREEN_1';\n\n if (status === TSectionStatus.ACTIVE) return 'YELLOW_1';\n\n return 'WHITE_1';\n};\n\nexport const getCardBorderColor = (status: TSectionStatus) => {\n if (status === TSectionStatus.COMPLETED) return 'GREEN_4';\n\n if (status === TSectionStatus.ACTIVE) return 'BLACK_1';\n\n return 'BLACK_T_08';\n};\n\nexport const getCardVariant = (status: TSectionStatus): TSectionCardVariant => {\n if (status === TSectionStatus.COMPLETED) return 'completed';\n\n if (status === TSectionStatus.ACTIVE) return 'active';\n\n return 'disabled';\n};\n"],"names":["MS_PER_HOUR","calculateTimeLeftText","dueDateTs","timeLeftMs","hoursLeft","daysLeft","mapSectionStatus","section","sheet","status","TSectionStatus","getStartButtonText","sections","activeSection","s","NODE_CARD_STATES","getBeforeYouStartText","isFirstSection","hasCompletedSections","getBackgroundColor","getCardBackgroundColor","getCardBorderColor","getCardVariant"],"mappings":";;AAOA,MAAMA,IAAc,MAAO,KAAK,IAEnBC,IAAwB,CAACC,MAA0C;AAC9E,QAAMC,IAAaD,IAAY,MAAO,KAAK,IAAI;AAE3C,MAAAC,KAAc,EAAU;AAE5B,QAAMC,IAAY,KAAK,MAAMD,IAAaH,CAAW,GAC/CK,IAAW,KAAK,MAAMD,IAAY,EAAE;AAE1C,SAAIC,IAAW,IACN,GAAGD,CAAS,IAAIA,MAAc,IAAI,SAAS,OAAO,UAGpD,GAAGC,CAAQ,IAAIA,MAAa,IAAI,QAAQ,MAAM;AACvD,GAEaC,IAAmB,CAACC,MAA6C;AACtE,QAAA,EAAE,OAAAC,EAAU,IAAAD;AAEd,MAAAE;AAEA,SAAAD,EAAM,UAAU,WAClBC,IAASC,EAAe,SACfF,EAAM,UAAU,cACzBC,IAASC,EAAe,YACfF,EAAM,UAAU,gBACzBC,IAASC,EAAe,SAExBD,IAASC,EAAe,QAGnBD;AACT,GAEaE,IAAqB,CAACC,MAAwC;AACzE,QAAMC,IAAgBD,EAAS;AAAA,IAC7B,CAAAE,MACEA,EAAE,MAAM,UAAUC,EAAiB,eACnCD,EAAE,MAAM,UAAUC,EAAiB;AAAA,EAAA;AAGnC,SAACF,IAIE,GAFQA,EAAc,MAAM,UAAUE,EAAiB,cAAc,WAAW,OAEvE,YAAYF,EAAc,cAAc,KAJ7B;AAK7B,GAEaG,IAAwB,CAACJ,MAAiD;AACrF,QAAMC,IAAgBD,EAAS;AAAA,IAC7B,CAAA,MACE,EAAE,MAAM,UAAUG,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