@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.
Files changed (35) hide show
  1. package/dist/features/homework/homework-card.js +96 -96
  2. package/dist/features/homework/homework-card.js.map +1 -1
  3. package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
  4. package/dist/features/homework/hw-card-list/hw-card-list-view.js +36 -27
  5. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  6. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +4 -5
  7. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
  8. package/dist/features/math-fit/math-fit/math-fit.js +1 -15
  9. package/dist/features/math-fit/math-fit/math-fit.js.map +1 -1
  10. package/dist/features/math-fit/math-fit-card/math-fit-card.js +32 -31
  11. package/dist/features/math-fit/math-fit-card/math-fit-card.js.map +1 -1
  12. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js +5 -0
  13. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js.map +1 -0
  14. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js +66 -57
  15. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js.map +1 -1
  16. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js +3 -3
  17. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js.map +1 -1
  18. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js +13 -11
  19. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js.map +1 -1
  20. package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js +60 -0
  21. package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js.map +1 -0
  22. package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js +3 -2
  23. package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js.map +1 -1
  24. package/dist/features/math-fit/math-fit-overview/math-fit-overview.js +37 -43
  25. package/dist/features/math-fit/math-fit-overview/math-fit-overview.js.map +1 -1
  26. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +38 -36
  27. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -1
  28. package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js +16 -15
  29. package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js.map +1 -1
  30. package/dist/features/math-fit/math-fit-report/math-fit-report.js +19 -25
  31. package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -1
  32. package/dist/index.d.ts +7 -2
  33. package/package.json +1 -1
  34. package/dist/features/math-fit/math-fit-overview/helpers.js +0 -46
  35. package/dist/features/math-fit/math-fit-overview/helpers.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import m from "styled-components";
2
2
  import t from "../../../../ui/image/image.js";
3
- const a = m(t)`
4
- opacity: ${({ $variant: o }) => o === "disabled" ? 0.5 : 1};
3
+ const p = m(t)`
4
+ opacity: ${({ $isDisabled: o }) => o ? 0.5 : 1};
5
5
  `;
6
6
  export {
7
- a as IconImage
7
+ p as IconImage
8
8
  };
9
9
  //# sourceMappingURL=stat-item-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stat-item-styled.js","sources":["../../../../../../src/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport type { TSectionCardVariant } from '../../math-fit-overview-types';\nimport Image from '../../../../ui/image/image';\n\nexport const IconImage = styled(Image)<{ $variant: TSectionCardVariant }>`\n opacity: ${({ $variant }) => ($variant === 'disabled' ? 0.5 : 1)};\n`;\n"],"names":["IconImage","styled","Image","$variant"],"mappings":";;AAKa,MAAAA,IAAYC,EAAOC,CAAK;AAAA,aACxB,CAAC,EAAE,UAAAC,QAAgBA,MAAa,aAAa,MAAM,CAAE;AAAA;"}
1
+ {"version":3,"file":"stat-item-styled.js","sources":["../../../../../../src/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Image from '../../../../ui/image/image';\n\nexport const IconImage = styled(Image)<{ $isDisabled: boolean }>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n`;\n"],"names":["IconImage","styled","Image","$isDisabled"],"mappings":";;AAIa,MAAAA,IAAYC,EAAOC,CAAK;AAAA,aACxB,CAAC,EAAE,aAAAC,EAAA,MAAmBA,IAAc,MAAM,CAAE;AAAA;"}
@@ -1,24 +1,26 @@
1
1
  import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { memo as a } from "react";
2
+ import { memo as l } from "react";
3
3
  import t from "../../../../ui/layout/flex-view.js";
4
- import m from "../../../../ui/text/text.js";
4
+ import i from "../../../../ui/text/text.js";
5
5
  import { IconImage as d } from "./stat-item-styled.js";
6
- const u = a(function({
7
- icon: i,
6
+ import { ESectionCardVariant as f } from "../section-card/section-card-types.js";
7
+ const b = l(function({
8
+ icon: m,
8
9
  value: n,
9
10
  label: c,
10
- variant: e,
11
- textColor: l
11
+ variant: s,
12
+ textColor: a
12
13
  }) {
13
- return /* @__PURE__ */ o(t, { $flexDirection: "row", $alignItems: "center", $width: "50%", $flexColumnGapX: 0.5, children: [
14
- /* @__PURE__ */ r(d, { src: i, $variant: e }),
14
+ const e = s === f.DISABLED;
15
+ return /* @__PURE__ */ o(t, { $flexDirection: "row", $alignItems: "center", $width: "50%", children: [
16
+ /* @__PURE__ */ r(d, { src: m, $isDisabled: e }),
15
17
  /* @__PURE__ */ o(t, { children: [
16
- /* @__PURE__ */ r(m, { $renderAs: "ac4-black", $color: e === "disabled" ? "BLACK_T_38" : "BLACK_1", children: n }),
17
- /* @__PURE__ */ r(m, { $renderAs: "ub3", $color: l, children: c })
18
+ /* @__PURE__ */ r(i, { $renderAs: "ac4-black", $color: e ? "BLACK_T_38" : "BLACK_1", children: n }),
19
+ /* @__PURE__ */ r(i, { $renderAs: "ub3", $color: a, children: c })
18
20
  ] })
19
21
  ] });
20
22
  });
21
23
  export {
22
- u as default
24
+ b as default
23
25
  };
24
26
  //# sourceMappingURL=stat-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stat-item.js","sources":["../../../../../../src/features/math-fit/math-fit-overview/comps/stat-item/stat-item.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport type { IStatItemProps } from './stat-item-types';\nimport * as Styled from './stat-item-styled';\n\nconst StatItem: FC<IStatItemProps> = memo(function StatItem({\n icon,\n value,\n label,\n variant,\n textColor,\n}) {\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $width=\"50%\" $flexColumnGapX={0.5}>\n <Styled.IconImage src={icon} $variant={variant} />\n <FlexView>\n <Text $renderAs=\"ac4-black\" $color={variant === 'disabled' ? 'BLACK_T_38' : 'BLACK_1'}>\n {value}\n </Text>\n <Text $renderAs=\"ub3\" $color={textColor}>\n {label}\n </Text>\n </FlexView>\n </FlexView>\n );\n});\n\nexport default StatItem;\n"],"names":["StatItem","memo","icon","value","label","variant","textColor","jsxs","FlexView","jsx","Styled.IconImage","Text"],"mappings":";;;;;AAOM,MAAAA,IAA+BC,EAAK,SAAkB;AAAA,EAC1D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,GAAG;AAEC,SAAA,gBAAAC,EAACC,KAAS,gBAAe,OAAM,aAAY,UAAS,QAAO,OAAM,iBAAiB,KAChF,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAiB,KAAKR,GAAM,UAAUG,GAAS;AAAA,sBAC/CG,GACC,EAAA,UAAA;AAAA,MAAC,gBAAAC,EAAAE,GAAA,EAAK,WAAU,aAAY,QAAQN,MAAY,aAAa,eAAe,WACzE,UACHF,EAAA,CAAA;AAAA,wBACCQ,GAAK,EAAA,WAAU,OAAM,QAAQL,GAC3B,UACHF,GAAA;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"stat-item.js","sources":["../../../../../../src/features/math-fit/math-fit-overview/comps/stat-item/stat-item.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport type { IStatItemProps } from './stat-item-types';\nimport * as Styled from './stat-item-styled';\nimport { ESectionCardVariant } from '../section-card/section-card-types';\n\nconst StatItem: FC<IStatItemProps> = memo(function StatItem({\n icon,\n value,\n label,\n variant,\n textColor,\n}) {\n const isDisabled = variant === ESectionCardVariant.DISABLED;\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $width=\"50%\">\n <Styled.IconImage src={icon} $isDisabled={isDisabled} />\n <FlexView>\n <Text $renderAs=\"ac4-black\" $color={isDisabled ? 'BLACK_T_38' : 'BLACK_1'}>\n {value}\n </Text>\n <Text $renderAs=\"ub3\" $color={textColor}>\n {label}\n </Text>\n </FlexView>\n </FlexView>\n );\n});\n\nexport default StatItem;\n"],"names":["StatItem","memo","icon","value","label","variant","textColor","isDisabled","ESectionCardVariant","FlexView","jsx","Styled.IconImage","Text"],"mappings":";;;;;;AAQM,MAAAA,IAA+BC,EAAK,SAAkB;AAAA,EAC1D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,GAAG;AACK,QAAAC,IAAaF,MAAYG,EAAoB;AAEnD,2BACGC,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,QAAO,OACzD,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAiB,KAAKT,GAAM,aAAaK,GAAY;AAAA,sBACrDE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC,EAACE,KAAK,WAAU,aAAY,QAAQL,IAAa,eAAe,WAC7D,UACHJ,EAAA,CAAA;AAAA,wBACCS,GAAK,EAAA,WAAU,OAAM,QAAQN,GAC3B,UACHF,GAAA;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -0,0 +1,60 @@
1
+ import { NODE_CARD_STATES as s } from "../../chapters-v2/constants/node-constants.js";
2
+ import { ESectionStatus as o } from "./math-fit-overview-types.js";
3
+ import { ESectionCardVariant as c } from "./comps/section-card/section-card-types.js";
4
+ const E = 1e3 * 60 * 60, d = {
5
+ [o.COMPLETED]: {
6
+ backgroundColor: "GREEN_2",
7
+ cardBackgroundColor: "GREEN_1",
8
+ cardBorderColor: "GREEN_4",
9
+ cardVariant: c.COMPLETED
10
+ },
11
+ [o.ACTIVE]: {
12
+ backgroundColor: "YELLOW_1",
13
+ cardBackgroundColor: "YELLOW_1",
14
+ cardBorderColor: "BLACK_1",
15
+ cardVariant: c.ACTIVE
16
+ },
17
+ [o.LOCKED]: {
18
+ backgroundColor: "BLACK_T_08",
19
+ cardBackgroundColor: "WHITE_1",
20
+ cardBorderColor: "BLACK_T_08",
21
+ cardVariant: c.DISABLED
22
+ }
23
+ }, i = (e) => e.find(
24
+ (t) => t.sheet.state === s.NOT_STARTED || t.sheet.state === s.IN_PROGRESS
25
+ ), T = (e) => {
26
+ const t = e * 1e3 - Date.now();
27
+ if (t <= 0) return;
28
+ const r = Math.floor(t / E), n = Math.floor(r / 24);
29
+ return n < 1 ? `${r} ${r === 1 ? "hour" : "hours"} left` : `${n} ${n === 1 ? "day" : "days"} left`;
30
+ }, l = (e) => {
31
+ const { sheet: t } = e;
32
+ switch (t.state) {
33
+ case "LOCKED":
34
+ return o.LOCKED;
35
+ case "COMPLETED":
36
+ return o.COMPLETED;
37
+ case "IN_PROGRESS":
38
+ return o.ACTIVE;
39
+ default:
40
+ return o.ACTIVE;
41
+ }
42
+ }, _ = (e) => {
43
+ const t = i(e);
44
+ return t ? `${t.sheet.state === s.IN_PROGRESS ? "Resume" : "Start"} Section ${t.section_number}` : "Start Section";
45
+ }, L = (e) => {
46
+ const t = i(e);
47
+ if (!t) return null;
48
+ const r = e.findIndex((a) => a.id === t.id) === 0, n = e.some((a) => a.sheet.state === o.COMPLETED);
49
+ return [r && !n ? "Do each section whenever it suits you, before the deadline." : `Start Section ${t.section_number} now, or later before the deadline.`, "Questions come from what you just learned"];
50
+ }, O = (e) => d[e];
51
+ export {
52
+ d as SECTION_STATUS_CONFIG,
53
+ T as calculateTimeLeftText,
54
+ i as findActiveSection,
55
+ L as getBeforeYouStartText,
56
+ O as getSectionStatusConfig,
57
+ _ as getStartButtonText,
58
+ l as mapSectionStatus
59
+ };
60
+ //# sourceMappingURL=math-fit-overview-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math-fit-overview-helpers.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-helpers.ts"],"sourcesContent":["import { NODE_CARD_STATES } from '../../chapters-v2/constants/node-constants';\nimport { type IMathFitSection, ESectionStatus } from './math-fit-overview-types';\nimport { ESectionCardVariant } from './comps/section-card/section-card-types';\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n\nexport const SECTION_STATUS_CONFIG = {\n [ESectionStatus.COMPLETED]: {\n backgroundColor: 'GREEN_2' as const,\n cardBackgroundColor: 'GREEN_1' as const,\n cardBorderColor: 'GREEN_4' as const,\n cardVariant: ESectionCardVariant.COMPLETED,\n },\n [ESectionStatus.ACTIVE]: {\n backgroundColor: 'YELLOW_1' as const,\n cardBackgroundColor: 'YELLOW_1' as const,\n cardBorderColor: 'BLACK_1' as const,\n cardVariant: ESectionCardVariant.ACTIVE,\n },\n [ESectionStatus.LOCKED]: {\n backgroundColor: 'BLACK_T_08' as const,\n cardBackgroundColor: 'WHITE_1' as const,\n cardBorderColor: 'BLACK_T_08' as const,\n cardVariant: ESectionCardVariant.DISABLED,\n },\n} as const;\n\nexport const findActiveSection = (sections: IMathFitSection[]) =>\n sections.find(\n s =>\n s.sheet.state === NODE_CARD_STATES.NOT_STARTED ||\n s.sheet.state === NODE_CARD_STATES.IN_PROGRESS,\n );\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): ESectionStatus => {\n const { sheet } = section;\n\n switch (sheet.state) {\n case 'LOCKED':\n return ESectionStatus.LOCKED;\n case 'COMPLETED':\n return ESectionStatus.COMPLETED;\n case 'IN_PROGRESS':\n return ESectionStatus.ACTIVE;\n default:\n return ESectionStatus.ACTIVE;\n }\n};\n\nexport const getStartButtonText = (sections: IMathFitSection[]): string => {\n const activeSection = findActiveSection(sections);\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 = findActiveSection(sections);\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 === ESectionStatus.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 getSectionStatusConfig = (status: ESectionStatus) => SECTION_STATUS_CONFIG[status];\n"],"names":["MS_PER_HOUR","SECTION_STATUS_CONFIG","ESectionStatus","ESectionCardVariant","findActiveSection","sections","s","NODE_CARD_STATES","calculateTimeLeftText","dueDateTs","timeLeftMs","hoursLeft","daysLeft","mapSectionStatus","section","sheet","getStartButtonText","activeSection","getBeforeYouStartText","isFirstSection","hasCompletedSections","getSectionStatusConfig","status"],"mappings":";;;AAIA,MAAMA,IAAc,MAAO,KAAK,IAEnBC,IAAwB;AAAA,EACnC,CAACC,EAAe,SAAS,GAAG;AAAA,IAC1B,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,aAAaC,EAAoB;AAAA,EACnC;AAAA,EACA,CAACD,EAAe,MAAM,GAAG;AAAA,IACvB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,aAAaC,EAAoB;AAAA,EACnC;AAAA,EACA,CAACD,EAAe,MAAM,GAAG;AAAA,IACvB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,aAAaC,EAAoB;AAAA,EACnC;AACF,GAEaC,IAAoB,CAACC,MAChCA,EAAS;AAAA,EACP,CAAAC,MACEA,EAAE,MAAM,UAAUC,EAAiB,eACnCD,EAAE,MAAM,UAAUC,EAAiB;AACvC,GAEWC,IAAwB,CAACC,MAA0C;AAC9E,QAAMC,IAAaD,IAAY,MAAO,KAAK,IAAI;AAE3C,MAAAC,KAAc,EAAU;AAE5B,QAAMC,IAAY,KAAK,MAAMD,IAAaV,CAAW,GAC/CY,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;AAElB,UAAQC,EAAM,OAAO;AAAA,IACnB,KAAK;AACH,aAAOb,EAAe;AAAA,IACxB,KAAK;AACH,aAAOA,EAAe;AAAA,IACxB,KAAK;AACH,aAAOA,EAAe;AAAA,IACxB;AACE,aAAOA,EAAe;AAAA,EAC1B;AACF,GAEac,IAAqB,CAACX,MAAwC;AACnE,QAAAY,IAAgBb,EAAkBC,CAAQ;AAE5C,SAACY,IAIE,GAFQA,EAAc,MAAM,UAAUV,EAAiB,cAAc,WAAW,OAEvE,YAAYU,EAAc,cAAc,KAJ7B;AAK7B,GAEaC,IAAwB,CAACb,MAAiD;AAC/E,QAAAY,IAAgBb,EAAkBC,CAAQ;AAE5C,MAAA,CAACY,EAAsB,QAAA;AAErB,QAAAE,IAAiBd,EAAS,UAAU,CAAAC,MAAKA,EAAE,OAAOW,EAAc,EAAE,MAAM,GACxEG,IAAuBf,EAAS,KAAK,CAAAC,MAAKA,EAAE,MAAM,UAAUJ,EAAe,SAAS;AAOnF,SAAA,CAJLiB,KAAkB,CAACC,IACf,gEACA,iBAAiBH,EAAc,cAAc,uCAEhC,2CAA2C;AAChE,GAEaI,IAAyB,CAACC,MAA2BrB,EAAsBqB,CAAM;"}
@@ -1,5 +1,6 @@
1
- var C = /* @__PURE__ */ ((E) => (E.COMPLETED = "COMPLETED", E.ACTIVE = "ACTIVE", E.LOCKED = "LOCKED", E))(C || {});
1
+ var E = /* @__PURE__ */ ((C) => (C.COMPLETED = "COMPLETED", C.ACTIVE = "ACTIVE", C.LOCKED = "LOCKED", C))(E || {}), O = /* @__PURE__ */ ((C) => (C.CORRECT = "CORRECT", C.INCORRECT = "INCORRECT", C.SKIPPED = "SKIPPED", C))(O || {});
2
2
  export {
3
- C as TSectionStatus
3
+ O as EQuestionState,
4
+ E as ESectionStatus
4
5
  };
5
6
  //# sourceMappingURL=math-fit-overview-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"math-fit-overview-types.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-types.ts"],"sourcesContent":["import type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\n\nexport enum TSectionStatus {\n COMPLETED = 'COMPLETED',\n ACTIVE = 'ACTIVE',\n LOCKED = 'LOCKED',\n}\n\nexport type TSectionCardVariant = 'completed' | 'active' | 'disabled';\n\nexport interface IQuestionDetail {\n item_reference: string;\n state: 'CORRECT' | 'INCORRECT' | 'SKIPPED';\n order: number;\n}\n\nexport interface IMiniGoalDetail {\n order: number;\n description: string;\n items: IQuestionDetail[];\n}\n\nexport interface IMathFitSection {\n id: string;\n section_number: number;\n score: number;\n previous_score: number;\n user_node_id: string;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sheet: INodeDataProps;\n summary: {\n [goalId: string]: IMiniGoalDetail;\n };\n}\n\nexport interface IMathFitAssessmentResponse {\n id: string;\n user_id: string;\n state: 'IN_PROGRESS' | 'COMPLETED' | 'NOT_STARTED';\n score: number;\n previous_score: number;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sections: IMathFitSection[];\n}\n\nexport interface IMathFitOverviewProps {\n data: IMathFitAssessmentResponse;\n onResumeClick: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n}\n\nexport interface IMathFitProps {\n mathfitTestId: string;\n userId: string;\n onResumeClick: (sheetData: INodeDataProps, sectionId: string) => void;\n onReviewClick: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n studentName: string;\n}\n"],"names":["TSectionStatus"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"math-fit-overview-types.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-types.ts"],"sourcesContent":["import type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\n\nexport enum ESectionStatus {\n COMPLETED = 'COMPLETED',\n ACTIVE = 'ACTIVE',\n LOCKED = 'LOCKED',\n}\n\nexport enum EQuestionState {\n CORRECT = 'CORRECT',\n INCORRECT = 'INCORRECT',\n SKIPPED = 'SKIPPED',\n}\n\nexport interface ISectionData {\n id: string;\n title: string;\n status: ESectionStatus;\n questionsCount: number;\n timeInMinutes: number;\n sheetData: INodeDataProps;\n}\n\nexport interface IQuestionDetail {\n item_reference: string;\n state: EQuestionState;\n order: number;\n}\n\nexport interface IMiniGoalDetail {\n order: number;\n description: string;\n items: IQuestionDetail[];\n}\n\nexport interface IMathFitSection {\n id: string;\n section_number: number;\n score: number;\n previous_score: number;\n user_node_id: string;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sheet: INodeDataProps;\n summary: {\n [goalId: string]: IMiniGoalDetail;\n };\n}\n\nexport interface IMathFitAssessmentResponse {\n id: string;\n user_id: string;\n state: 'IN_PROGRESS' | 'COMPLETED' | 'NOT_STARTED';\n score: number;\n previous_score: number;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sections: IMathFitSection[];\n}\n\nexport interface IMathFitOverviewProps {\n data: IMathFitAssessmentResponse;\n onResumeClick: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n}\n\nexport interface IMathFitProps {\n mathfitTestId: string;\n userId: string;\n onResumeClick: (sheetData: INodeDataProps, sectionId: string) => void;\n onReviewClick: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n studentName: string;\n}\n"],"names":["ESectionStatus","EQuestionState"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,YAAY,aACZA,EAAA,UAAU,WAHAA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,68 +1,62 @@
1
- import { jsxs as n, Fragment as x, jsx as e } from "react/jsx-runtime";
2
- import { memo as A, useMemo as a, useCallback as X } from "react";
1
+ import { jsxs as n, Fragment as X, jsx as e } from "react/jsx-runtime";
2
+ import { memo as _, useMemo as a, useCallback as A } from "react";
3
3
  import g from "../../ui/buttons/button/button.js";
4
- import o from "../../ui/layout/flex-view.js";
4
+ import i from "../../ui/layout/flex-view.js";
5
5
  import p from "../../ui/separator/separator.js";
6
6
  import l from "../../ui/text/text.js";
7
- import B from "./comps/section-card/section-card.js";
8
- import { calculateTimeLeftText as b, getStartButtonText as v, getBeforeYouStartText as E, mapSectionStatus as L } from "./helpers.js";
9
- import { CountdownBadge as O } from "./math-fit-overview-styled.js";
10
- import { NODE_CARD_STATES as T } from "../../chapters-v2/constants/node-constants.js";
11
- const w = A(function({
12
- data: _,
7
+ import S from "./comps/section-card/section-card.js";
8
+ import { calculateTimeLeftText as B, findActiveSection as b, getStartButtonText as v, getBeforeYouStartText as L, mapSectionStatus as w } from "./math-fit-overview-helpers.js";
9
+ import { CountdownBadge as k } from "./math-fit-overview-styled.js";
10
+ const F = _(function({
11
+ data: T,
13
12
  onResumeClick: d,
14
- onDoLater: S
13
+ onDoLater: x
15
14
  }) {
16
15
  var $, f;
17
- const { sections: r } = _, s = (f = ($ = r[0]) == null ? void 0 : $.sheet) == null ? void 0 : f.due_date_ts, m = a(() => {
18
- if (s)
19
- return b(s);
20
- }, [s]), i = a(
21
- () => r.find(
22
- (t) => t.sheet.state === T.NOT_STARTED || t.sheet.state === T.IN_PROGRESS
23
- ),
24
- [r]
25
- ), u = a(() => v(r), [r]), h = a(() => E(r), [r]), C = X(() => {
26
- i && d(i.sheet, i.id);
27
- }, [i, d]);
28
- return /* @__PURE__ */ n(x, { children: [
29
- /* @__PURE__ */ e(o, { $gutterX: 1.5, $gapX: 0.75, $background: "BLACK_T_04", children: /* @__PURE__ */ e(l, { $renderAs: "ac4", $color: "BLACK_1", children: "TEST STRUCTURE" }) }),
30
- /* @__PURE__ */ e(o, { $gutterX: 1, $gapX: 1.5, $flexGapX: 1, children: r.map((t, c) => /* @__PURE__ */ e(
31
- B,
16
+ const { sections: t } = T, c = (f = ($ = t[0]) == null ? void 0 : $.sheet) == null ? void 0 : f.due_date_ts, u = a(() => {
17
+ if (c)
18
+ return B(c);
19
+ }, [c]), o = a(() => b(t), [t]), m = a(() => v(t), [t]), h = a(() => L(t), [t]), C = A(() => {
20
+ o && d(o.sheet, o.id);
21
+ }, [o, d]);
22
+ return /* @__PURE__ */ n(X, { children: [
23
+ /* @__PURE__ */ e(i, { $gutterX: 1.5, $gapX: 0.75, $background: "BLACK_T_04", children: /* @__PURE__ */ e(l, { $renderAs: "ac4", $color: "BLACK_1", children: "TEST STRUCTURE" }) }),
24
+ /* @__PURE__ */ e(i, { $gutterX: 1, $gapX: 1.5, $flexGapX: 1, children: t.map((r, s) => /* @__PURE__ */ e(
25
+ S,
32
26
  {
33
- title: t.sheet.title,
34
- questionsCount: t.sheet.total_questions || 0,
35
- timeInMinutes: t.sheet.sheet_time ? t.sheet.sheet_time / 60 : 0,
36
- status: L(t),
37
- showDivider: c < r.length - 1
27
+ title: r.sheet.title,
28
+ questionsCount: r.sheet.total_questions || 0,
29
+ timeInMinutes: r.sheet.sheet_time ? r.sheet.sheet_time / 60 : 0,
30
+ status: w(r),
31
+ showDivider: s < t.length - 1
38
32
  },
39
- t.id
33
+ r.id
40
34
  )) }),
41
35
  /* @__PURE__ */ e(p, { heightX: 1 }),
42
- !!h && /* @__PURE__ */ n(o, { children: [
43
- /* @__PURE__ */ e(o, { $gutterX: 1.5, $gapX: 0.75, $background: "BLACK_T_04", children: /* @__PURE__ */ e(l, { $renderAs: "ac4", $color: "BLACK_1", children: "BEFORE YOU START" }) }),
44
- /* @__PURE__ */ e(o, { $gutterX: 2.5, $gapX: 1, $flexRowGapX: 0.5, children: h.map((t, c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(l, { $renderAs: "ub2", $color: "BLACK_1", children: t }) }, c)) })
36
+ !!h && /* @__PURE__ */ n(i, { children: [
37
+ /* @__PURE__ */ e(i, { $gutterX: 1.5, $gapX: 0.75, $background: "BLACK_T_04", children: /* @__PURE__ */ e(l, { $renderAs: "ac4", $color: "BLACK_1", children: "BEFORE YOU START" }) }),
38
+ /* @__PURE__ */ e(i, { $gutterX: 2.5, $gapX: 1, $flexRowGapX: 0.5, children: h.map((r, s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(l, { $renderAs: "ub2", $color: "BLACK_1", children: r }) }, s)) })
45
39
  ] }),
46
40
  /* @__PURE__ */ e(p, { heightX: 2.5 }),
47
41
  /* @__PURE__ */ n(
48
- o,
42
+ i,
49
43
  {
50
44
  $flexDirection: "row",
51
45
  $justifyContent: "center",
52
46
  $alignItems: "flex-end",
53
47
  $flexColumnGapX: 1,
54
48
  children: [
55
- /* @__PURE__ */ e(g, { label: "I'll do it later", renderAs: "secondary", size: "regular", onClick: S }),
56
- /* @__PURE__ */ n(o, { $alignItems: "center", $justifyContent: "center", children: [
57
- !!m && /* @__PURE__ */ e(O, { $background: "YELLOW_1", $gapX: 0.35, $gutterX: 0.5, children: /* @__PURE__ */ e(l, { $renderAs: "ac5-black", $color: "BLACK_T_60", children: m }) }),
58
- !!u && /* @__PURE__ */ e(
49
+ /* @__PURE__ */ e(g, { label: "I'll do it later", renderAs: "secondary", size: "regular", onClick: x }),
50
+ /* @__PURE__ */ n(i, { $alignItems: "center", $justifyContent: "center", children: [
51
+ !!u && /* @__PURE__ */ e(k, { $background: "YELLOW_1", $gapX: 0.35, $gutterX: 0.5, children: /* @__PURE__ */ e(l, { $renderAs: "ac5-black", $color: "BLACK_T_60", children: u }) }),
52
+ !!m && /* @__PURE__ */ e(
59
53
  g,
60
54
  {
61
- label: u,
55
+ label: m,
62
56
  renderAs: "primary",
63
57
  size: "regular",
64
58
  onClick: C,
65
- disabled: !i
59
+ disabled: !o
66
60
  }
67
61
  )
68
62
  ] })
@@ -70,8 +64,8 @@ const w = A(function({
70
64
  }
71
65
  )
72
66
  ] });
73
- }), N = w;
67
+ }), G = F;
74
68
  export {
75
- N as default
69
+ G as default
76
70
  };
77
71
  //# sourceMappingURL=math-fit-overview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"math-fit-overview.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport SectionCard from './comps/section-card/section-card';\nimport {\n calculateTimeLeftText,\n getBeforeYouStartText,\n getStartButtonText,\n mapSectionStatus,\n} from './helpers';\nimport { type IMathFitOverviewProps } from './math-fit-overview-types';\nimport * as Styled from './math-fit-overview-styled';\nimport { NODE_CARD_STATES } from '../../chapters-v2/constants/node-constants';\n\nconst MathFitOverview: FC<IMathFitOverviewProps> = memo(function MathFitOverview({\n data,\n onResumeClick,\n onDoLater,\n}) {\n const { sections } = data;\n\n const dueDateTS = sections[0]?.sheet?.due_date_ts;\n\n const timeleftText = useMemo(() => {\n if (!dueDateTS) return undefined;\n\n return calculateTimeLeftText(dueDateTS);\n }, [dueDateTS]);\n\n const activeSection = useMemo(\n () =>\n sections.find(\n s =>\n s.sheet.state === NODE_CARD_STATES.NOT_STARTED ||\n s.sheet.state === NODE_CARD_STATES.IN_PROGRESS,\n ),\n [sections],\n );\n\n const startButtonText = useMemo(() => getStartButtonText(sections), [sections]);\n\n const beforeYouStartText = useMemo(() => getBeforeYouStartText(sections), [sections]);\n\n const handleStartClick = useCallback(() => {\n if (activeSection) {\n onResumeClick(activeSection.sheet, activeSection.id);\n }\n }, [activeSection, onResumeClick]);\n\n return (\n <>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n TEST STRUCTURE\n </Text>\n </FlexView>\n <FlexView $gutterX={1} $gapX={1.5} $flexGapX={1}>\n {sections.map((section, index) => (\n <SectionCard\n key={section.id}\n title={section.sheet.title}\n questionsCount={section.sheet.total_questions || 0}\n timeInMinutes={section.sheet.sheet_time ? section.sheet.sheet_time / 60 : 0}\n status={mapSectionStatus(section)}\n showDivider={index < sections.length - 1}\n />\n ))}\n </FlexView>\n <Separator heightX={1} />\n {!!beforeYouStartText && (\n <FlexView>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n BEFORE YOU START\n </Text>\n </FlexView>\n <FlexView $gutterX={2.5} $gapX={1} $flexRowGapX={0.5}>\n {beforeYouStartText.map((item, index) => (\n <li key={index}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {item}\n </Text>\n </li>\n ))}\n </FlexView>\n </FlexView>\n )}\n <Separator heightX={2.5} />\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"flex-end\"\n $flexColumnGapX={1}\n >\n <Button label=\"I'll do it later\" renderAs=\"secondary\" size=\"regular\" onClick={onDoLater} />\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n {!!timeleftText && (\n <Styled.CountdownBadge $background=\"YELLOW_1\" $gapX={0.35} $gutterX={0.5}>\n <Text $renderAs=\"ac5-black\" $color=\"BLACK_T_60\">\n {timeleftText}\n </Text>\n </Styled.CountdownBadge>\n )}\n {!!startButtonText && (\n <Button\n label={startButtonText}\n renderAs=\"primary\"\n size=\"regular\"\n onClick={handleStartClick}\n disabled={!activeSection}\n />\n )}\n </FlexView>\n </FlexView>\n </>\n );\n});\n\nexport default MathFitOverview;\n"],"names":["MathFitOverview","memo","data","onResumeClick","onDoLater","sections","dueDateTS","_b","_a","timeleftText","useMemo","calculateTimeLeftText","activeSection","s","NODE_CARD_STATES","startButtonText","getStartButtonText","beforeYouStartText","getBeforeYouStartText","handleStartClick","useCallback","jsxs","Fragment","jsx","FlexView","Text","section","index","SectionCard","mapSectionStatus","Separator","item","Button","Styled.CountdownBadge","MathFitOverview$1"],"mappings":";;;;;;;;;;AAiBA,MAAMA,IAA6CC,EAAK,SAAyB;AAAA,EAC/E,MAAAC;AAAA,EACA,eAAAC;AAAA,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ACP,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,SAASI;AAAA,gBACT,UAAU,CAACP;AAAA,cAAA;AAAA,YACb;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDsB,IAAelC;"}
1
+ {"version":3,"file":"math-fit-overview.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport SectionCard from './comps/section-card/section-card';\nimport {\n calculateTimeLeftText,\n findActiveSection,\n getBeforeYouStartText,\n getStartButtonText,\n mapSectionStatus,\n} from './math-fit-overview-helpers';\nimport { type IMathFitOverviewProps } from './math-fit-overview-types';\nimport * as Styled from './math-fit-overview-styled';\n\nconst MathFitOverview: FC<IMathFitOverviewProps> = memo(function MathFitOverview({\n data,\n onResumeClick,\n onDoLater,\n}) {\n const { sections } = data;\n\n const dueDateTS = sections[0]?.sheet?.due_date_ts;\n\n const timeleftText = useMemo(() => {\n if (!dueDateTS) return undefined;\n\n return calculateTimeLeftText(dueDateTS);\n }, [dueDateTS]);\n\n const activeSection = useMemo(() => findActiveSection(sections), [sections]);\n const startButtonText = useMemo(() => getStartButtonText(sections), [sections]);\n const beforeYouStartText = useMemo(() => getBeforeYouStartText(sections), [sections]);\n\n const handleStartClick = useCallback(() => {\n if (activeSection) {\n onResumeClick(activeSection.sheet, activeSection.id);\n }\n }, [activeSection, onResumeClick]);\n\n return (\n <>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n TEST STRUCTURE\n </Text>\n </FlexView>\n <FlexView $gutterX={1} $gapX={1.5} $flexGapX={1}>\n {sections.map((section, index) => (\n <SectionCard\n key={section.id}\n title={section.sheet.title}\n questionsCount={section.sheet.total_questions || 0}\n timeInMinutes={section.sheet.sheet_time ? section.sheet.sheet_time / 60 : 0}\n status={mapSectionStatus(section)}\n showDivider={index < sections.length - 1}\n />\n ))}\n </FlexView>\n <Separator heightX={1} />\n {!!beforeYouStartText && (\n <FlexView>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n BEFORE YOU START\n </Text>\n </FlexView>\n <FlexView $gutterX={2.5} $gapX={1} $flexRowGapX={0.5}>\n {beforeYouStartText.map((item, index) => (\n <li key={index}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {item}\n </Text>\n </li>\n ))}\n </FlexView>\n </FlexView>\n )}\n <Separator heightX={2.5} />\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"flex-end\"\n $flexColumnGapX={1}\n >\n <Button label=\"I'll do it later\" renderAs=\"secondary\" size=\"regular\" onClick={onDoLater} />\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n {!!timeleftText && (\n <Styled.CountdownBadge $background=\"YELLOW_1\" $gapX={0.35} $gutterX={0.5}>\n <Text $renderAs=\"ac5-black\" $color=\"BLACK_T_60\">\n {timeleftText}\n </Text>\n </Styled.CountdownBadge>\n )}\n {!!startButtonText && (\n <Button\n label={startButtonText}\n renderAs=\"primary\"\n size=\"regular\"\n onClick={handleStartClick}\n disabled={!activeSection}\n />\n )}\n </FlexView>\n </FlexView>\n </>\n );\n});\n\nexport default MathFitOverview;\n"],"names":["MathFitOverview","memo","data","onResumeClick","onDoLater","sections","dueDateTS","_b","_a","timeleftText","useMemo","calculateTimeLeftText","activeSection","findActiveSection","startButtonText","getStartButtonText","beforeYouStartText","getBeforeYouStartText","handleStartClick","useCallback","jsxs","Fragment","jsx","FlexView","Text","section","index","SectionCard","mapSectionStatus","Separator","item","Button","Styled.CountdownBadge","MathFitOverview$1"],"mappings":";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AA,gBACT,MAAK;AAAA,gBACL,SAASI;AAAA,gBACT,UAAU,CAACN;AAAA,cAAA;AAAA,YACb;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDqB,IAAejC;"}
@@ -1,41 +1,42 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { memo as C, useCallback as x, Fragment as I } from "react";
3
- import A from "../../../../ui/buttons/button/button.js";
2
+ import { memo as x, useCallback as I, Fragment as A } from "react";
3
+ import S from "../../../../ui/buttons/button/button.js";
4
4
  import r from "../../../../ui/layout/flex-view.js";
5
- import i from "../../../../ui/text/text.js";
6
- import S from "../score-badge/score-badge.js";
7
- import { Divider as w } from "./score-section-styled.js";
8
- import h from "../../../../ui/separator/separator.js";
9
- import { getQuestionStatusBgColor as B } from "../../math-fit-report-helpers.js";
10
- const y = C(function({
11
- section: n,
5
+ import n from "../../../../ui/text/text.js";
6
+ import w from "../score-badge/score-badge.js";
7
+ import { Divider as B } from "./score-section-styled.js";
8
+ import f from "../../../../ui/separator/separator.js";
9
+ import { getQuestionStatusBgColor as _ } from "../../math-fit-report-helpers.js";
10
+ import { EQuestionState as h } from "../../../math-fit-overview/math-fit-overview-types.js";
11
+ const F = x(function({
12
+ section: l,
12
13
  sheet: m,
13
- onReviewSection: l
14
+ onReviewSection: c
14
15
  }) {
15
16
  const {
16
- title: f,
17
+ title: p,
17
18
  score: s,
18
- scoreChange: p,
19
+ scoreChange: g,
19
20
  sessionId: d,
20
21
  isIncomplete: o = !1,
21
- sectionNumber: g,
22
+ sectionNumber: b,
22
23
  topics: $
23
- } = n, b = x(() => {
24
- !o && n.sheet && l && l(m, d);
25
- }, [o, l, n.sheet, m, d]);
24
+ } = l, u = I(() => {
25
+ !o && l.sheet && c && c(m, d);
26
+ }, [o, c, l.sheet, m, d]);
26
27
  return /* @__PURE__ */ t(r, { children: [
27
28
  /* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", children: [
28
- /* @__PURE__ */ t(i, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
29
- f,
29
+ /* @__PURE__ */ t(n, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
30
+ p,
30
31
  ":"
31
32
  ] }),
32
- /* @__PURE__ */ e(h, { width: 4 }),
33
- o ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(i, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : s && /* @__PURE__ */ e(S, { score: s, maxScore: 10, scoreChange: p })
33
+ /* @__PURE__ */ e(f, { width: 4 }),
34
+ o ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(n, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : s && /* @__PURE__ */ e(w, { score: s, maxScore: 10, scoreChange: g })
34
35
  ] }),
35
- /* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: $.map((c, u) => /* @__PURE__ */ t(I, { children: [
36
+ /* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: $.map((a, C) => /* @__PURE__ */ t(A, { children: [
36
37
  /* @__PURE__ */ t(r, { $flexDirection: "row", $justifyContent: "space-between", $alignItems: "center", children: [
37
- /* @__PURE__ */ e(i, { $renderAs: "ub2", $color: o ? "BLACK_T_38" : "BLACK_1", children: c.name }),
38
- /* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", children: c.miniGoal.items.map((a) => /* @__PURE__ */ e(
38
+ /* @__PURE__ */ e(n, { $renderAs: "ub2", $color: o ? "BLACK_T_38" : "BLACK_1", children: a.name }),
39
+ /* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", children: a.miniGoal.items.map((i) => /* @__PURE__ */ e(
39
40
  r,
40
41
  {
41
42
  $widthX: 1.25,
@@ -43,31 +44,32 @@ const y = C(function({
43
44
  $alignItems: "center",
44
45
  $justifyContent: "center",
45
46
  $borderRadiusX: 2,
46
- $background: B(
47
- o ? "SKIPPED" : a.state
47
+ $background: _(
48
+ o ? h.SKIPPED : i.state
48
49
  ),
49
50
  children: /* @__PURE__ */ e(
50
- i,
51
+ n,
51
52
  {
52
53
  $renderAs: "ub3",
53
- $color: a.state === "SKIPPED" ? "BLACK_T_38" : "WHITE",
54
- children: a.order
54
+ $color: i.state === h.SKIPPED ? "BLACK_T_38" : "WHITE",
55
+ children: i.order
55
56
  }
56
57
  )
57
- }
58
+ },
59
+ i.item_reference
58
60
  )) })
59
61
  ] }),
60
- u !== $.length - 1 && /* @__PURE__ */ e(w, {})
61
- ] }, c.name)) }),
62
+ C !== $.length - 1 && /* @__PURE__ */ e(B, {})
63
+ ] }, a.name)) }),
62
64
  /* @__PURE__ */ t(r, { $alignItems: "center", children: [
63
- /* @__PURE__ */ e(h, { heightX: 0.75 }),
65
+ /* @__PURE__ */ e(f, { heightX: 0.75 }),
64
66
  /* @__PURE__ */ e(
65
- A,
67
+ S,
66
68
  {
67
- label: `Review Section ${g}`,
69
+ label: `Review Section ${b}`,
68
70
  renderAs: o ? "secondary" : "primary",
69
71
  size: "small",
70
- onClick: b,
72
+ onClick: u,
71
73
  disabled: o
72
74
  }
73
75
  )
@@ -75,6 +77,6 @@ const y = C(function({
75
77
  ] });
76
78
  });
77
79
  export {
78
- y as default
80
+ F as default
79
81
  };
80
82
  //# sourceMappingURL=score-section.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n section,\n sheet,\n onReviewSection,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {topics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\">\n {topic.miniGoal.items.map(question => (\n <FlexView\n $widthX={1.25}\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2}\n $background={getQuestionStatusBgColor(\n isIncomplete ? 'SKIPPED' : question.state,\n )}\n >\n <Text\n $renderAs=\"ub3\"\n $color={question.state === 'SKIPPED' ? 'BLACK_T_38' : 'WHITE'}\n >\n {question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== topics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","section","sheet","onReviewSection","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","Styled.Divider","Button"],"mappings":";;;;;;;;;AAWM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAT,GACEU,IAAgBC,EAAY,MAAM;AACtC,IAAI,CAACJ,KAAgBP,EAAQ,SAASE,KACpCA,EAAgBD,GAAOK,CAAS;AAAA,EAClC,GACC,CAACC,GAAcL,GAAiBF,EAAQ,OAAOC,GAAOK,CAAS,CAAC;AAEnE,2BACGM,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACD,GAAS,EAAA,gBAAe,OAAM,aAAY,UACzC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAC/B,UAAA;AAAA,QAAAX;AAAA,QAAM;AAAA,MAAA,GACT;AAAA,MACA,gBAAAY,EAACC,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,MACpBT,IACE,gBAAAQ,EAAAH,GAAA,EAAS,SAAS,GAAG,MAAM,KAAK,aAAY,WAC3C,UAAA,gBAAAG,EAACD,GAAK,EAAA,WAAU,YAAW,QAAO,SAAQ,UAE1C,aAAA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Aa;AAAA,UACtC,UAAUD,IAAe,cAAc;AAAA,UACvC,MAAK;AAAA,UACL,SAASG;AAAA,UACT,UAAUH;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n section,\n sheet,\n onReviewSection,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {topics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\">\n {topic.miniGoal.items.map(question => (\n <FlexView\n key={question.item_reference}\n $widthX={1.25}\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2}\n $background={getQuestionStatusBgColor(\n isIncomplete ? EQuestionState.SKIPPED : question.state,\n )}\n >\n <Text\n $renderAs=\"ub3\"\n $color={question.state === EQuestionState.SKIPPED ? 'BLACK_T_38' : 'WHITE'}\n >\n {question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== topics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","section","sheet","onReviewSection","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","EQuestionState","Styled.Divider","Button"],"mappings":";;;;;;;;;;AAYM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAT,GACEU,IAAgBC,EAAY,MAAM;AACtC,IAAI,CAACJ,KAAgBP,EAAQ,SAASE,KACpCA,E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nD;AAAA,YAEA,UAAA,gBAAAN;AAAA,cAACD;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,QAAQO,EAAS,UAAUE,EAAe,UAAU,eAAe;AAAA,gBAElE,UAASF,EAAA;AAAA,cAAA;AAAA,YACZ;AAAA,UAAA;AAAA,UAfKA,EAAS;AAAA,QAiBjB,CAAA,GACH;AAAA,MAAA,GACF;AAAA,MACCF,MAAUV,EAAO,SAAS,KAAM,gBAAAM,EAAAS,GAAA,EAAe;AAAA,IA5BnC,EAAA,GAAAN,EAAM,IA6BrB,CACD,GACH;AAAA,IACA,gBAAAL,EAACD,GAAS,EAAA,aAAY,UACpB,UAAA;AAAA,MAAC,gBAAAG,EAAAC,GAAA,EAAU,SAAS,KAAM,CAAA;AAAA,MAC1B,gBAAAD;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,OAAO,kBAAkBjB,CAAa;AAAA,UACtC,UAAUD,IAAe,cAAc;AAAA,UACvC,MAAK;AAAA,UACL,SAASG;AAAA,UACT,UAAUH;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,36 +1,37 @@
1
- const c = (t) => t.map((e, s) => {
2
- const r = e.summary, o = !r, a = r ? Object.entries(r).map(([, n]) => ({
3
- name: n.description,
4
- miniGoal: n
1
+ import { EQuestionState as o } from "../math-fit-overview/math-fit-overview-types.js";
2
+ const m = (t) => t.map((e, s) => {
3
+ const r = e.summary, n = !r, c = r ? Object.entries(r).map(([, a]) => ({
4
+ name: a.description,
5
+ miniGoal: a
5
6
  })) : [];
6
7
  return {
7
8
  title: e.sheet.title,
8
- score: o ? void 0 : e.score,
9
+ score: n ? void 0 : e.score,
9
10
  scoreChange: e.previous_score ? e.score - e.previous_score : void 0,
10
- isIncomplete: o,
11
+ isIncomplete: n,
11
12
  sectionNumber: s + 1,
12
- topics: a,
13
+ topics: c,
13
14
  sheet: e.sheet,
14
15
  sessionId: e.id
15
16
  };
16
- }), u = (t) => {
17
+ }), p = (t) => {
17
18
  switch (t) {
18
- case "CORRECT":
19
+ case o.CORRECT:
19
20
  return "GREEN_5";
20
- case "INCORRECT":
21
+ case o.INCORRECT:
21
22
  return "RED";
22
- case "SKIPPED":
23
+ case o.SKIPPED:
23
24
  return "BLACK_T_08";
24
25
  default:
25
26
  return "BLACK_T_08";
26
27
  }
27
- }, m = (t) => {
28
+ }, i = (t) => {
28
29
  const e = new Date(t * 1e3), s = e.toLocaleDateString("en-US", { month: "short" }).toUpperCase(), r = e.getFullYear();
29
30
  return `${s} ${r}`;
30
31
  };
31
32
  export {
32
- m as formatTestDate,
33
- u as getQuestionStatusBgColor,
34
- c as transformSectionsToReportData
33
+ i as formatTestDate,
34
+ p as getQuestionStatusBgColor,
35
+ m as transformSectionsToReportData
35
36
  };
36
37
  //# sourceMappingURL=math-fit-report-helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"math-fit-report-helpers.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report-helpers.ts"],"sourcesContent":["import { type TColorNames } from '../../ui/types';\nimport type { IMathFitSection } from '../math-fit-overview/math-fit-overview-types';\nimport { type ITransformedSection } from './math-fit-report-types';\n\nexport const transformSectionsToReportData = (\n sections: IMathFitSection[],\n): ITransformedSection[] => {\n return sections.map((section, index) => {\n const summary = section.summary;\n const isIncomplete = !summary;\n\n const topics = summary\n ? Object.entries(summary).map(([, miniGoal]) => ({\n name: miniGoal.description,\n miniGoal,\n }))\n : [];\n\n return {\n title: section.sheet.title,\n score: isIncomplete ? undefined : section.score,\n scoreChange: section.previous_score ? section.score - section.previous_score : undefined,\n isIncomplete,\n sectionNumber: index + 1,\n topics,\n sheet: section.sheet,\n sessionId: section.id,\n };\n });\n};\n\nexport const getQuestionStatusBgColor = (state: string): TColorNames => {\n switch (state) {\n case 'CORRECT':\n return 'GREEN_5';\n case 'INCORRECT':\n return 'RED';\n case 'SKIPPED':\n return 'BLACK_T_08';\n default:\n return 'BLACK_T_08';\n }\n};\n\nexport const formatTestDate = (timestamp: number): string => {\n const date = new Date(timestamp * 1000);\n const month = date.toLocaleDateString('en-US', { month: 'short' }).toUpperCase();\n const year = date.getFullYear();\n\n return `${month} ${year}`;\n};\n"],"names":["transformSectionsToReportData","sections","section","index","summary","isIncomplete","topics","miniGoal","getQuestionStatusBgColor","state","formatTestDate","timestamp","date","month","year"],"mappings":"AAIa,MAAAA,IAAgC,CAC3CC,MAEOA,EAAS,IAAI,CAACC,GAASC,MAAU;AACtC,QAAMC,IAAUF,EAAQ,SAClBG,IAAe,CAACD,GAEhBE,IAASF,IACX,OAAO,QAAQA,CAAO,EAAE,IAAI,CAAC,CAAG,EAAAG,CAAQ,OAAO;AAAA,IAC7C,MAAMA,EAAS;AAAA,IACf,UAAAA;AAAA,EAAA,EACA,IACF,CAAA;AAEG,SAAA;AAAA,IACL,OAAOL,EAAQ,MAAM;AAAA,IACrB,OAAOG,IAAe,SAAYH,EAAQ;AAAA,IAC1C,aAAaA,EAAQ,iBAAiBA,EAAQ,QAAQA,EAAQ,iBAAiB;AAAA,IAC/E,cAAAG;AAAA,IACA,eAAeF,IAAQ;AAAA,IACvB,QAAAG;AAAA,IACA,OAAOJ,EAAQ;AAAA,IACf,WAAWA,EAAQ;AAAA,EAAA;AACrB,CACD,GAGUM,IAA2B,CAACC,MAA+B;AACtE,UAAQA,GAAO;AAAA,IACb,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT;AACS,aAAA;AAAA,EACX;AACF,GAEaC,IAAiB,CAACC,MAA8B;AAC3D,QAAMC,IAAO,IAAI,KAAKD,IAAY,GAAI,GAChCE,IAAQD,EAAK,mBAAmB,SAAS,EAAE,OAAO,QAAA,CAAS,EAAE,eAC7DE,IAAOF,EAAK;AAEX,SAAA,GAAGC,CAAK,IAAIC,CAAI;AACzB;"}
1
+ {"version":3,"file":"math-fit-report-helpers.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report-helpers.ts"],"sourcesContent":["import { type TColorNames } from '../../ui/types';\nimport { EQuestionState, type IMathFitSection } from '../math-fit-overview/math-fit-overview-types';\nimport { type ITransformedSection } from './math-fit-report-types';\n\nexport const transformSectionsToReportData = (\n sections: IMathFitSection[],\n): ITransformedSection[] => {\n return sections.map((section, index) => {\n const summary = section.summary;\n const isIncomplete = !summary;\n\n const topics = summary\n ? Object.entries(summary).map(([, miniGoal]) => ({\n name: miniGoal.description,\n miniGoal,\n }))\n : [];\n\n return {\n title: section.sheet.title,\n score: isIncomplete ? undefined : section.score,\n scoreChange: section.previous_score ? section.score - section.previous_score : undefined,\n isIncomplete,\n sectionNumber: index + 1,\n topics,\n sheet: section.sheet,\n sessionId: section.id,\n };\n });\n};\n\nexport const getQuestionStatusBgColor = (state: EQuestionState): TColorNames => {\n switch (state) {\n case EQuestionState.CORRECT:\n return 'GREEN_5';\n case EQuestionState.INCORRECT:\n return 'RED';\n case EQuestionState.SKIPPED:\n return 'BLACK_T_08';\n default:\n return 'BLACK_T_08';\n }\n};\n\nexport const formatTestDate = (timestamp: number): string => {\n const date = new Date(timestamp * 1000);\n const month = date.toLocaleDateString('en-US', { month: 'short' }).toUpperCase();\n const year = date.getFullYear();\n\n return `${month} ${year}`;\n};\n"],"names":["transformSectionsToReportData","sections","section","index","summary","isIncomplete","topics","miniGoal","getQuestionStatusBgColor","state","EQuestionState","formatTestDate","timestamp","date","month","year"],"mappings":";AAIa,MAAAA,IAAgC,CAC3CC,MAEOA,EAAS,IAAI,CAACC,GAASC,MAAU;AACtC,QAAMC,IAAUF,EAAQ,SAClBG,IAAe,CAACD,GAEhBE,IAASF,IACX,OAAO,QAAQA,CAAO,EAAE,IAAI,CAAC,CAAG,EAAAG,CAAQ,OAAO;AAAA,IAC7C,MAAMA,EAAS;AAAA,IACf,UAAAA;AAAA,EAAA,EACA,IACF,CAAA;AAEG,SAAA;AAAA,IACL,OAAOL,EAAQ,MAAM;AAAA,IACrB,OAAOG,IAAe,SAAYH,EAAQ;AAAA,IAC1C,aAAaA,EAAQ,iBAAiBA,EAAQ,QAAQA,EAAQ,iBAAiB;AAAA,IAC/E,cAAAG;AAAA,IACA,eAAeF,IAAQ;AAAA,IACvB,QAAAG;AAAA,IACA,OAAOJ,EAAQ;AAAA,IACf,WAAWA,EAAQ;AAAA,EAAA;AACrB,CACD,GAGUM,IAA2B,CAACC,MAAuC;AAC9E,UAAQA,GAAO;AAAA,IACb,KAAKC,EAAe;AACX,aAAA;AAAA,IACT,KAAKA,EAAe;AACX,aAAA;AAAA,IACT,KAAKA,EAAe;AACX,aAAA;AAAA,IACT;AACS,aAAA;AAAA,EACX;AACF,GAEaC,IAAiB,CAACC,MAA8B;AAC3D,QAAMC,IAAO,IAAI,KAAKD,IAAY,GAAI,GAChCE,IAAQD,EAAK,mBAAmB,SAAS,EAAE,OAAO,QAAA,CAAS,EAAE,eAC7DE,IAAOF,EAAK;AAEX,SAAA,GAAGC,CAAK,IAAIC,CAAI;AACzB;"}