@cuemath/leap 2.8.60-beta-0.1 → 2.8.60-gs1

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 (44) hide show
  1. package/dist/assets/line-icons/icons/bin2.js +7 -8
  2. package/dist/assets/line-icons/icons/bin2.js.map +1 -1
  3. package/dist/assets/line-icons/icons/skip-colored.js +43 -0
  4. package/dist/assets/line-icons/icons/skip-colored.js.map +1 -0
  5. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +1 -1
  6. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
  7. package/dist/features/chapters-v2/chapter-details/chapter-details.js +24 -24
  8. package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
  9. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +76 -72
  10. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  11. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +62 -75
  12. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
  13. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +127 -110
  14. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  15. package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js +12 -4
  16. package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js.map +1 -1
  17. package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +128 -105
  18. package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
  19. package/dist/features/milestone/create/milestone-create.js +49 -43
  20. package/dist/features/milestone/create/milestone-create.js.map +1 -1
  21. package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js +1 -1
  22. package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js.map +1 -1
  23. package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js +42 -40
  24. package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -1
  25. package/dist/features/milestone/edit/goal-edit-container.js +64 -62
  26. package/dist/features/milestone/edit/goal-edit-container.js.map +1 -1
  27. package/dist/features/milestone/edit/milestone-edit-container.js +54 -52
  28. package/dist/features/milestone/edit/milestone-edit-container.js.map +1 -1
  29. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +61 -52
  30. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  31. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +28 -28
  32. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
  33. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +120 -111
  34. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
  35. package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +16 -18
  36. package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
  37. package/dist/features/ui/lottie-animation/lottie-animation.js +39 -24
  38. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  39. package/dist/features/ui/theme/button.js +5 -5
  40. package/dist/features/ui/theme/button.js.map +1 -1
  41. package/dist/index.d.ts +6 -2
  42. package/dist/index.js +369 -367
  43. package/dist/index.js.map +1 -1
  44. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- const e = (o) => /* @__PURE__ */ l(
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const l = (e) => /* @__PURE__ */ o(
3
3
  "svg",
4
4
  {
5
5
  xmlns: "http://www.w3.org/2000/svg",
@@ -7,20 +7,19 @@ const e = (o) => /* @__PURE__ */ l(
7
7
  height: "24",
8
8
  viewBox: "0 0 24 24",
9
9
  fill: "none",
10
- ...o,
11
- children: /* @__PURE__ */ l(
10
+ ...e,
11
+ children: /* @__PURE__ */ o(
12
12
  "path",
13
13
  {
14
14
  fillRule: "evenodd",
15
15
  clipRule: "evenodd",
16
16
  d: "M11.1 6.97363C11.1 6.47657 11.5029 6.07363 12 6.07363C12.4971 6.07363 12.9 6.47657 12.9 6.97363H14.1C14.1 5.81383 13.1598 4.87363 12 4.87363C10.8402 4.87363 9.9 5.81383 9.9 6.97363H11.1ZM17 7.92636V9.12636L7 9.12636V7.92636L17 7.92636ZM9.1 17.4V9.99999H7.9V18V18.6H8.5H15.5H16.1V18V9.99999H14.9V17.4H9.1ZM10.4 16V11H11.6V16H10.4ZM12.4 16V11H13.6V16H12.4Z",
17
- fill: "currentColor",
18
- fillOpacity: "0.87"
17
+ fill: "currentColor"
19
18
  }
20
19
  )
21
20
  }
22
- ), n = e;
21
+ ), H = l;
23
22
  export {
24
- n as default
23
+ H as default
25
24
  };
26
25
  //# sourceMappingURL=bin2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bin2.js","sources":["../../../../src/assets/line-icons/icons/bin2.tsx"],"sourcesContent":["const Bin2Icon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.1 6.97363C11.1 6.47657 11.5029 6.07363 12 6.07363C12.4971 6.07363 12.9 6.47657 12.9 6.97363H14.1C14.1 5.81383 13.1598 4.87363 12 4.87363C10.8402 4.87363 9.9 5.81383 9.9 6.97363H11.1ZM17 7.92636V9.12636L7 9.12636V7.92636L17 7.92636ZM9.1 17.4V9.99999H7.9V18V18.6H8.5H15.5H16.1V18V9.99999H14.9V17.4H9.1ZM10.4 16V11H11.6V16H10.4ZM12.4 16V11H13.6V16H12.4Z\"\n fill=\"currentColor\"\n fillOpacity=\"0.87\"\n />\n </svg>\n);\n\nexport default Bin2Icon;\n"],"names":["Bin2Icon","props","jsx","Bin2Icon$1"],"mappings":";AAAA,MAAMA,IAAoD,CACxDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
1
+ {"version":3,"file":"bin2.js","sources":["../../../../src/assets/line-icons/icons/bin2.tsx"],"sourcesContent":["const Bin2Icon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.1 6.97363C11.1 6.47657 11.5029 6.07363 12 6.07363C12.4971 6.07363 12.9 6.47657 12.9 6.97363H14.1C14.1 5.81383 13.1598 4.87363 12 4.87363C10.8402 4.87363 9.9 5.81383 9.9 6.97363H11.1ZM17 7.92636V9.12636L7 9.12636V7.92636L17 7.92636ZM9.1 17.4V9.99999H7.9V18V18.6H8.5H15.5H16.1V18V9.99999H14.9V17.4H9.1ZM10.4 16V11H11.6V16H10.4ZM12.4 16V11H13.6V16H12.4Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default Bin2Icon;\n"],"names":["Bin2Icon","props","jsx","Bin2Icon$1"],"mappings":";AAAA,MAAMA,IAAoD,CACxDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,MAAA;AAAA,IACP;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
@@ -0,0 +1,43 @@
1
+ import { jsxs as e, jsx as l } from "react/jsx-runtime";
2
+ const L = (o) => /* @__PURE__ */ e(
3
+ "svg",
4
+ {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: "24",
7
+ height: "24",
8
+ viewBox: "0 0 24 24",
9
+ fill: "none",
10
+ ...o,
11
+ children: [
12
+ /* @__PURE__ */ l(
13
+ "path",
14
+ {
15
+ fillRule: "evenodd",
16
+ clipRule: "evenodd",
17
+ d: "M6.3999 5.93884L7.44424 5.53564L11.8999 10.4459V5.93884L12.9442 5.53564L18.4442 11.5968V12.4032L12.9442 18.4644L11.8999 18.0612V13.5541L7.44424 18.4644L6.3999 18.0612V5.93884ZM11.6897 12L7.5999 16.5071V7.49293L11.6897 12ZM13.0999 7.49293V16.5071L17.1897 12L13.0999 7.49293Z",
18
+ fill: "currentColor"
19
+ }
20
+ ),
21
+ /* @__PURE__ */ l(
22
+ "path",
23
+ {
24
+ className: "skip-colored-path",
25
+ d: "M17.1897 12L13.0999 16.5071V7.49293L17.1897 12Z",
26
+ fill: "#00E573"
27
+ }
28
+ ),
29
+ /* @__PURE__ */ l(
30
+ "path",
31
+ {
32
+ className: "skip-colored-path",
33
+ d: "M11.6897 12L7.5999 16.5071V7.49293L11.6897 12Z",
34
+ fill: "#00E573"
35
+ }
36
+ )
37
+ ]
38
+ }
39
+ ), s = L;
40
+ export {
41
+ s as default
42
+ };
43
+ //# sourceMappingURL=skip-colored.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip-colored.js","sources":["../../../../src/assets/line-icons/icons/skip-colored.tsx"],"sourcesContent":["const SkipColoredIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6.3999 5.93884L7.44424 5.53564L11.8999 10.4459V5.93884L12.9442 5.53564L18.4442 11.5968V12.4032L12.9442 18.4644L11.8999 18.0612V13.5541L7.44424 18.4644L6.3999 18.0612V5.93884ZM11.6897 12L7.5999 16.5071V7.49293L11.6897 12ZM13.0999 7.49293V16.5071L17.1897 12L13.0999 7.49293Z\"\n fill=\"currentColor\"\n />\n <path\n className=\"skip-colored-path\"\n d=\"M17.1897 12L13.0999 16.5071V7.49293L17.1897 12Z\"\n fill=\"#00E573\"\n />\n <path\n className=\"skip-colored-path\"\n d=\"M11.6897 12L7.5999 16.5071V7.49293L11.6897 12Z\"\n fill=\"#00E573\"\n />\n </svg>\n);\n\nexport default SkipColoredIcon;\n"],"names":["SkipColoredIcon","props","jsxs","jsx","SkipColoredIcon$1"],"mappings":";AAAA,MAAMA,IAA2D,CAC/DC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,IAAA;AAAA,EAAA;AACF,GAGFC,IAAeJ;"}
@@ -11,7 +11,7 @@ const R = C(
11
11
  image_url: h,
12
12
  progress_stat: m,
13
13
  image_hue: g
14
- } = o, { completed: c, total: d } = m, [$, u] = x(!1), t = I(null), s = c > 0 ? Math.floor((c / d || 1) * 100) : 0, f = w(() => {
14
+ } = o, { completed: c = 0, total: d = 0 } = m || {}, [$, u] = x(!1), t = I(null), s = c > 0 ? Math.floor((c / d || 1) * 100) : 0, f = w(() => {
15
15
  a(o, r);
16
16
  }, [o, r, a]);
17
17
  return T(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItemProps } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState, memo } from 'react';\n\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(\n ({ milestoneId, chapter, onChapterClick, itemIndex }) => {\n const {\n name,\n image_url: imageUrl,\n progress_stat: chapterProgressStat,\n image_hue: imageHue,\n } = chapter;\n const { completed, total } = chapterProgressStat;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n\n const completionPercentage = completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const handleOnChapterClick = useCallback(() => {\n onChapterClick(chapter, milestoneId);\n }, [chapter, milestoneId, onChapterClick]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <Styled.ChapterItemWrapper\n id={`milestone-chapter-${milestoneId}-${itemIndex}`}\n $alignItems=\"center\"\n $gapX={1}\n $gutterX={1}\n $flexGap={8}\n $background=\"WHITE_1\"\n onClick={handleOnChapterClick}\n className=\"goal-widget-chapter-item\"\n $bgColor={`${imageHue}_1`}\n >\n <Styled.ChapterImageWrapper\n $width=\"fit-content\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <Styled.ChapterProgressWrapper>\n <Styled.ChapterProgressSVG width=\"96px\" height=\"96px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"47\" cx=\"48\" cy=\"48\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progress={completionPercentage * 2.98}\n r=\"47\"\n cx=\"48\"\n cy=\"48\"\n />\n </Styled.ChapterProgressSVG>\n </Styled.ChapterProgressWrapper>\n\n <Styled.ChapterImage src={imageUrl} alt=\"Chapter Image\" />\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </Styled.ChapterImageWrapper>\n\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n zIndex={5}\n >\n <Styled.ChapterName\n ref={titleTextRef}\n $renderAs=\"ab2\"\n $color=\"BLACK_T_87\"\n $align=\"center\"\n >\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n </FlexView>\n </Styled.ChapterItemWrapper>\n );\n },\n);\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","chapter","onChapterClick","itemIndex","name","imageUrl","chapterProgressStat","imageHue","completed","total","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","completionPercentage","handleOnChapterClick","useCallback","useLayoutEffect","jsxs","Styled.ChapterItemWrapper","Styled.ChapterImageWrapper","jsx","Styled.ChapterProgressWrapper","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.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AA;AAAA,kBAAC,gBAAAF,EAAAG,GAAA,EAAgC,WAAW,GAAG,GAAE,MAAK,IAAG,MAAK,IAAG,KAAK,CAAA;AAAA,kBACtE,gBAAAH;AAAA,oBAACG;AAAAA,oBAAA;AAAA,sBACC,iBAAe;AAAA,sBACf,WAAWV,IAAuB;AAAA,sBAClC,GAAE;AAAA,sBACF,IAAG;AAAA,sBACH,IAAG;AAAA,oBAAA;AAAA,kBACL;AAAA,gBAAA,EAAA,CACF,EACF,CAAA;AAAA,kCAECW,GAAA,EAAoB,KAAKrB,GAAU,KAAI,iBAAgB;AAAA,gBAEvDU,MAAyB,OACvB,gBAAAO,EAAAK,GAAA,EACC,UAAC,gBAAAL,EAAAM,GAAA,EAAW,OAAO,IAAI,QAAQ,GAAA,CAAI,EACrC,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEC,gBAAAN,EAAAO,GAAA,EAAS,iBAAgB,UAAS,aAAY,UAC7C,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,aAAa1B;AAAA,cACb,QAAQ,CAACM;AAAA,cACT,QAAQ;AAAA,cACR,QAAQ;AAAA,cAER,UAAA,gBAAAY;AAAA,gBAACS;AAAAA,gBAAA;AAAA,kBACC,KAAKlB;AAAA,kBACL,WAAU;AAAA,kBACV,QAAO;AAAA,kBACP,QAAO;AAAA,kBAEN,UAAAT;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItemProps } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState, memo } from 'react';\n\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(\n ({ milestoneId, chapter, onChapterClick, itemIndex }) => {\n const {\n name,\n image_url: imageUrl,\n progress_stat: chapterProgressStat,\n image_hue: imageHue,\n } = chapter;\n const { completed = 0, total = 0 } = chapterProgressStat || {};\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n\n const completionPercentage = completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const handleOnChapterClick = useCallback(() => {\n onChapterClick(chapter, milestoneId);\n }, [chapter, milestoneId, onChapterClick]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <Styled.ChapterItemWrapper\n id={`milestone-chapter-${milestoneId}-${itemIndex}`}\n $alignItems=\"center\"\n $gapX={1}\n $gutterX={1}\n $flexGap={8}\n $background=\"WHITE_1\"\n onClick={handleOnChapterClick}\n className=\"goal-widget-chapter-item\"\n $bgColor={`${imageHue}_1`}\n >\n <Styled.ChapterImageWrapper\n $width=\"fit-content\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <Styled.ChapterProgressWrapper>\n <Styled.ChapterProgressSVG width=\"96px\" height=\"96px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"47\" cx=\"48\" cy=\"48\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progress={completionPercentage * 2.98}\n r=\"47\"\n cx=\"48\"\n cy=\"48\"\n />\n </Styled.ChapterProgressSVG>\n </Styled.ChapterProgressWrapper>\n\n <Styled.ChapterImage src={imageUrl} alt=\"Chapter Image\" />\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </Styled.ChapterImageWrapper>\n\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n zIndex={5}\n >\n <Styled.ChapterName\n ref={titleTextRef}\n $renderAs=\"ab2\"\n $color=\"BLACK_T_87\"\n $align=\"center\"\n >\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n </FlexView>\n </Styled.ChapterItemWrapper>\n );\n },\n);\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","chapter","onChapterClick","itemIndex","name","imageUrl","chapterProgressStat","imageHue","completed","total","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","completionPercentage","handleOnChapterClick","useCallback","useLayoutEffect","jsxs","Styled.ChapterItemWrapper","Styled.ChapterImageWrapper","jsx","Styled.ChapterProgressWrapper","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.ChapterImage","Styled.StyledCheckIconWrapper","Check2Icon","FlexView","ArrowTooltip","Styled.ChapterName"],"mappings":";;;;;;AAUA,MAAMA,IAAqCC;AAAA,EACzC,CAAC,EAAE,aAAAC,GAAa,SAAAC,GAAS,gBAAAC,GAAgB,WAAAC,QAAgB;AACjD,UAAA;AAAA,MACJ,MAAAC;AAAA,MACA,WAAWC;AAAA,MACX,eAAeC;AAAA,MACf,WAAWC;AAAA,IACT,IAAAN,GACE,EAAE,WAAAO,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIH,KAAuB,IACtD,CAACI,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAuBP,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEpFO,IAAuBC,EAAY,MAAM;AAC7C,MAAAf,EAAeD,GAASD,CAAW;AAAA,IAClC,GAAA,CAAC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,GAAA,EAAS,iBAAgB,UAAS,aAAY,UAC7C,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,aAAa1B;AAAA,cACb,QAAQ,CAACM;AAAA,cACT,QAAQ;AAAA,cACR,QAAQ;AAAA,cAER,UAAA,gBAAAY;AAAA,gBAACS;AAAAA,gBAAA;AAAA,kBACC,KAAKlB;AAAA,kBACL,WAAU;AAAA,kBACV,QAAO;AAAA,kBACP,QAAO;AAAA,kBAEN,UAAAT;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1,6 +1,6 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { memo as x, useCallback as y, useEffect as p } from "react";
3
- import { ILLUSTRATIONS as A } from "../../../assets/illustrations/illustrations.js";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { memo as B, useCallback as x, useEffect as l } from "react";
3
+ import { ILLUSTRATIONS as y } from "../../../assets/illustrations/illustrations.js";
4
4
  import I from "../../../assets/line-icons/icons/back2.js";
5
5
  import w from "../../ui/buttons/button/button.js";
6
6
  import L from "../../ui/buttons/icon-button/icon-button.js";
@@ -9,13 +9,13 @@ import S from "../../ui/loader/app-loader/app-loader.js";
9
9
  import _ from "../../ui/text/text.js";
10
10
  import { useGetChapterDetails as b } from "../api/chapter.js";
11
11
  import D from "./block-sections/block-sections.js";
12
- import v from "./chapter-banner/chapter-banner.js";
13
- import { ContentWrapper as T, BackButtonContainer as j, BackButtonWrapper as E, LoaderWrapper as P } from "./chapter-details-styled.js";
14
- const R = x((l) => {
12
+ import E from "./chapter-banner/chapter-banner.js";
13
+ import { ContentWrapper as T, BackButtonContainer as v, BackButtonWrapper as R, LoaderWrapper as j } from "./chapter-details-styled.js";
14
+ const P = B((c) => {
15
15
  const {
16
16
  userChapterId: i,
17
17
  studentId: n,
18
- userType: c,
18
+ userType: a,
19
19
  onBlockSkipUnskip: h,
20
20
  onNodeAttempt: d,
21
21
  onNodeAttemptLocationChange: g,
@@ -24,20 +24,20 @@ const R = x((l) => {
24
24
  onNodeReview: C,
25
25
  onNodeView: k,
26
26
  onExit: $
27
- } = l, {
28
- get: a,
27
+ } = c, {
28
+ get: s,
29
29
  data: e,
30
30
  isProcessing: r,
31
- isProcessingFailed: B,
32
- isStale: s
33
- } = b(), o = y(() => {
34
- a(i, void 0, { studentId: n });
35
- }, [a, i, n]);
36
- return p(() => {
31
+ isProcessingFailed: A,
32
+ isStale: m
33
+ } = b(), o = x(() => {
34
+ s(i, void 0, { studentId: n });
35
+ }, [s, i, n]);
36
+ return l(() => {
37
37
  o();
38
- }, [o]), p(() => {
39
- !r && s && o();
40
- }, [o, r, s]), B ? /* @__PURE__ */ m(N, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
38
+ }, [o]), l(() => {
39
+ !r && m && o();
40
+ }, [o, r, m]), A ? /* @__PURE__ */ p(N, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
41
41
  /* @__PURE__ */ t(_, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
42
42
  /* @__PURE__ */ t(
43
43
  w,
@@ -50,7 +50,7 @@ const R = x((l) => {
50
50
  onClick: o
51
51
  }
52
52
  )
53
- ] }) : !e && r ? /* @__PURE__ */ t(S, { height: "80vh" }) : /* @__PURE__ */ m(
53
+ ] }) : !e && r ? /* @__PURE__ */ t(S, { height: "80vh" }) : /* @__PURE__ */ p(
54
54
  T,
55
55
  {
56
56
  $widthX: 50,
@@ -58,7 +58,7 @@ const R = x((l) => {
58
58
  $justifyContent: "center",
59
59
  $alignItems: "center",
60
60
  children: [
61
- /* @__PURE__ */ t(j, { $height: "100%", children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(
61
+ a === "TEACHER" && /* @__PURE__ */ t(v, { $height: "100%", children: /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
62
62
  L,
63
63
  {
64
64
  Icon: I,
@@ -68,9 +68,9 @@ const R = x((l) => {
68
68
  onClick: $
69
69
  }
70
70
  ) }) }),
71
- r && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t("img", { src: A.LOADER_1, alt: "loader" }) }),
71
+ r && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t("img", { src: y.LOADER_1, alt: "loader" }) }),
72
72
  e && /* @__PURE__ */ t(
73
- v,
73
+ E,
74
74
  {
75
75
  title: e.name,
76
76
  imageHue: e.image_hue,
@@ -82,7 +82,7 @@ const R = x((l) => {
82
82
  D,
83
83
  {
84
84
  imageHue: e.image_hue,
85
- userType: c,
85
+ userType: a,
86
86
  blocks: e.blocks,
87
87
  onBlockSkipUnskip: h,
88
88
  onNodeAttempt: d,
@@ -96,7 +96,7 @@ const R = x((l) => {
96
96
  ]
97
97
  }
98
98
  );
99
- }), Q = R;
99
+ }), Q = P;
100
100
  export {
101
101
  Q as default
102
102
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAX,GAEE;AAAA,IACJ,KAAKY;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBX,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACU,GAAmBX,GAAeC,CAAS,CAAC;AAYhD,SAVAkB,EAAU,MAAM;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,EAAgB;AAAA,UAAA;AAAA,QACjC;AAAA,QAGDA,KACC,gBAAAU;AAAA,UAACY;AAAA,UAAA;AAAA,YACC,UAAUtB,EAAe;AAAA,YACzB,UAAAV;AAAA,YACA,QAAQU,EAAe;AAAA,YACvB,mBAAAT;AAAA,YACA,eAAAC;AAAA,YACA,6BAAAC;AAAA,YACA,kBAAAC;AAAA,YACA,iBAAAC;AAAA,YACA,cAAAC;AAAA,YACA,YAAAC;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAED0B,IAAetC;"}
1
+ {"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAX,GAEE;AAAA,IACJ,KAAKY;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBX,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACU,GAAmBX,GAAeC,CAAS,CAAC;AAYhD,SAVAkB,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC,GAExBE,EAAU,MAAM;AACV,IAAA,CAACN,KAAgBE,KACCE;EAErB,GAAA,CAACA,GAAqBJ,GAAcE,CAAO,CAAC,GAE3CD,IAEA,gBAAAM,EAACC,KAAS,WAAW,KAAK,SAAQ,SAAQ,iBAAgB,UAAS,aAAY,UAC7E,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAK,WAAU,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A,YACA,YAAAC;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAED0B,IAAetC;"}
@@ -1,45 +1,46 @@
1
- import { jsx as e, jsxs as d, Fragment as G } from "react/jsx-runtime";
2
- import { memo as K, useCallback as T } from "react";
3
- import P from "../../../../../assets/line-icons/icons/eye2.js";
4
- import X from "../../../../../assets/line-icons/icons/redo.js";
5
- import j from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
6
- import M from "../../../../ui/context-menu/context-menu.js";
7
- import z from "../../../../ui/text/text.js";
8
- import { BLOCK_TYPE as F } from "../../../constants/block-constants.js";
9
- import { NODE_CARD_STATES as l } from "../../../constants/node-constants.js";
10
- import { getNodeTypeBasedBgImage as Y } from "../../../utils/index.js";
11
- import { getNodeCardBasedIcon as Z } from "../../../utils/node-card-utils.js";
12
- import q from "../border-path-animation.js";
13
- import { NodeCardContainer as J, NodeCardInfoWrapper as Q, IconWrapper as U, StyledImportantIcon as V, NodeCardContentWrapper as ee, NodeCardTitle as te } from "../node-card-styled.js";
14
- import oe from "../node-card-tags.js";
15
- import re from "../node-menu-options/node-menu-options.js";
16
- const Ie = K((k) => {
1
+ import { jsx as e, jsxs as d, Fragment as M } from "react/jsx-runtime";
2
+ import { memo as P, useCallback as T } from "react";
3
+ import X from "../../../../../assets/line-icons/icons/eye2.js";
4
+ import j from "../../../../../assets/line-icons/icons/redo.js";
5
+ import z from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
6
+ import F from "../../../../ui/context-menu/context-menu.js";
7
+ import Y from "../../../../ui/text/text.js";
8
+ import { BLOCK_TYPE as Z } from "../../../constants/block-constants.js";
9
+ import { NODE_CARD_STATES as h } from "../../../constants/node-constants.js";
10
+ import { getNodeTypeBasedBgImage as q } from "../../../utils/index.js";
11
+ import { getNodeCardBasedIcon as J } from "../../../utils/node-card-utils.js";
12
+ import Q from "../border-path-animation.js";
13
+ import { NodeCardContainer as U, NodeCardInfoWrapper as V, IconWrapper as ee, StyledImportantIcon as te, NodeCardContentWrapper as oe, NodeCardTitle as re } from "../node-card-styled.js";
14
+ import ne from "../node-card-tags.js";
15
+ import ae from "../node-menu-options/node-menu-options.js";
16
+ const ke = P((A) => {
17
17
  const {
18
18
  nodeData: t,
19
- imageHue: w,
20
- blockType: A,
19
+ imageHue: S,
20
+ blockType: w,
21
21
  onNodeAttempt: r,
22
22
  onNodeReattempt: n,
23
23
  onNodeReview: a,
24
24
  onNodeView: i
25
- } = k, {
26
- accuracy: S,
27
- attempt_location: E,
25
+ } = A, {
26
+ accuracy: E,
27
+ attempt_location: N,
28
28
  node_type: s,
29
- card_header: N,
30
- title: y,
29
+ card_header: y,
30
+ title: x,
31
31
  state: c,
32
- is_optional: p,
33
- sheet_statement: h,
34
- permissions: x
32
+ is_optional: f,
33
+ sheet_statement: u,
34
+ permissions: B,
35
+ marked_as_completed: C
35
36
  } = t, {
36
- can_review: u,
37
- can_reattempt: f,
38
- can_start: C,
39
- can_resume: $
40
- } = x, g = A === F.GOAL, o = c === l.LOCKED, B = c === l.NOT_STARTED, L = c === l.IN_PROGRESS, R = E === "INCLASS", W = !h || !g, I = !p && (L || B), m = f || u, v = Y(s), _ = Z(s), b = T(
41
- (O) => {
42
- switch (O) {
37
+ can_review: $,
38
+ can_reattempt: g,
39
+ can_start: m,
40
+ can_resume: l
41
+ } = B, I = w === Z.GOAL, o = c === h.LOCKED, L = c === h.NOT_STARTED, R = c === h.IN_PROGRESS, W = N === "INCLASS", v = !u || !I, D = m || l, _ = !f && (R || L), p = !D && (g || $), H = q(s), k = J(s), O = T(
42
+ (b) => {
43
+ switch (b) {
43
44
  case "node-card-review":
44
45
  a == null || a(t);
45
46
  return;
@@ -47,68 +48,71 @@ const Ie = K((k) => {
47
48
  n == null || n(t);
48
49
  return;
49
50
  default:
50
- throw new Error(`No callback function for ${O}`);
51
+ throw new Error(`No callback function for ${b}`);
51
52
  }
52
53
  },
53
54
  [t, n, a]
54
- ), D = T(() => {
55
- if (!(m || o)) {
56
- if (C || $) {
57
- r == null || r(t);
58
- return;
59
- }
60
- i == null || i(t);
61
- }
62
- }, [$, C, t, r, i, m, o]), H = [
55
+ ), G = T(() => {
56
+ p || o || (m || l ? r == null || r(t) : C && (i == null || i(t)));
57
+ }, [
58
+ l,
59
+ m,
60
+ t,
61
+ r,
62
+ i,
63
+ p,
64
+ o,
65
+ C
66
+ ]), K = [
63
67
  {
64
68
  id: "node-card-review",
65
69
  label: "Review",
66
- icon: P,
67
- disabled: !u,
68
- onClick: b
70
+ icon: X,
71
+ disabled: !$,
72
+ onClick: O
69
73
  },
70
74
  {
71
75
  id: "node-card-reattempt",
72
76
  label: "Reattempt",
73
- icon: X,
74
- disabled: !f,
75
- onClick: b
77
+ icon: j,
78
+ disabled: !g,
79
+ onClick: O
76
80
  }
77
81
  ];
78
82
  return /* @__PURE__ */ e(
79
- M,
83
+ F,
80
84
  {
81
85
  targetElement: /* @__PURE__ */ e(
82
- J,
86
+ U,
83
87
  {
84
- $showOutline: !I,
85
- $background: `${w}_2`,
88
+ $showOutline: !_,
89
+ $background: `${S}_2`,
86
90
  $disabled: o,
87
- onClick: D,
91
+ onClick: G,
88
92
  children: /* @__PURE__ */ d(
89
- j,
93
+ z,
90
94
  {
91
95
  renderAs: "primary",
92
- tooltipItem: h,
96
+ tooltipItem: u,
93
97
  position: "bottom",
94
98
  zIndex: 5,
95
- hidden: W,
99
+ hidden: v,
96
100
  parentWidth: "100%",
97
101
  widthX: 11.25,
98
102
  children: [
99
103
  /* @__PURE__ */ d(
100
- Q,
104
+ V,
101
105
  {
102
106
  $flexDirection: "row",
103
107
  $alignItems: "center",
104
108
  $heightX: 3.5,
105
- $bgImage: v,
109
+ $bgImage: H,
106
110
  $gutterX: 0.78125,
107
111
  $flexGap: 8.5,
108
112
  $opacity: o ? 0.5 : 1,
109
113
  children: [
110
114
  /* @__PURE__ */ d(
111
- U,
115
+ ee,
112
116
  {
113
117
  $width: 31,
114
118
  $height: 31,
@@ -117,28 +121,28 @@ const Ie = K((k) => {
117
121
  $alignItems: "center",
118
122
  $justifyContent: "center",
119
123
  children: [
120
- _ && /* @__PURE__ */ e(_, { width: 20, height: 20 }),
121
- !p && /* @__PURE__ */ e(V, {})
124
+ k && /* @__PURE__ */ e(k, { width: 20, height: 20 }),
125
+ !f && /* @__PURE__ */ e(te, {})
122
126
  ]
123
127
  }
124
128
  ),
125
- /* @__PURE__ */ d(z, { $renderAs: "ac4-black", $color: "BLACK", children: [
126
- N,
129
+ /* @__PURE__ */ d(Y, { $renderAs: "ac4-black", $color: "BLACK", children: [
130
+ y,
127
131
  " ",
128
- R && ". CW"
132
+ W && ". CW"
129
133
  ] }),
130
- I && /* @__PURE__ */ e(q, {})
134
+ _ && /* @__PURE__ */ e(Q, {})
131
135
  ]
132
136
  }
133
137
  ),
134
- /* @__PURE__ */ e(oe, { nodeType: s, state: c, accuracy: S }),
135
- !g && /* @__PURE__ */ e(ee, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
136
- te,
138
+ /* @__PURE__ */ e(ne, { nodeType: s, state: c, accuracy: E }),
139
+ !I && /* @__PURE__ */ e(oe, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
140
+ re,
137
141
  {
138
142
  $renderAs: "ab3",
139
143
  $color: "BLACK_1",
140
144
  $opacity: o ? 0.5 : 1,
141
- children: y
145
+ children: x
142
146
  }
143
147
  ) })
144
148
  ]
@@ -150,11 +154,11 @@ const Ie = K((k) => {
150
154
  menuWidth: "100%",
151
155
  menuZIndex: 6,
152
156
  menuOffset: 2,
153
- menuElement: /* @__PURE__ */ e(G, { children: m ? /* @__PURE__ */ e(re, { options: H }) : void 0 })
157
+ menuElement: /* @__PURE__ */ e(M, { children: p ? /* @__PURE__ */ e(ae, { options: K }) : void 0 })
154
158
  }
155
159
  );
156
160
  });
157
161
  export {
158
- Ie as default
162
+ ke as default
159
163
  };
160
164
  //# sourceMappingURL=student-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_reattempt: canReattempt,\n can_start: canStart,\n can_resume: canResume,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const tooltipHidden = !sheetStatement || !isGoalBlock;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = canReattempt || canReview;\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n\n return;\n }\n\n onNodeView?.(nodeData);\n }, [canResume, canStart, nodeData, onNodeAttempt, onNodeView, renderOptions, sheetLocked]);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReattempt,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={tooltipHidden}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","canReview","canReattempt","canStart","canResume","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","tooltipHidden","showCardAnimation","renderOptions","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;AAmBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAA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AAA,EAA2B;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBAC9C;AAAA,sBAEC,gBAAAJ,EAAAK,GAAA,EAAK,WAAU,aAAY,QAAO,SAChC,UAAA;AAAA,wBAAAvC;AAAA,wBAAW;AAAA,wBAAEgB,KAAgB;AAAA,sBAAA,GAChC;AAAA,sBAECE,uBAAsBsB,GAAoB,EAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC7C;AAAA,gBAEC,gBAAAT,EAAAU,IAAA,EAAa,UAAA1C,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACa,KACC,gBAAAqB,EAAAW,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAX;AAAA,kBAACY;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAU/B,IAAc,MAAM;AAAA,oBAE7B,UAAAX;AAAA,kBAAA;AAAA,gBAAA,GAEL;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,WAAS;AAAA,MACT,WAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,oCAAgB,UAAgBkB,IAAA,gBAAAY,EAACa,MAAgB,SAAShB,EAAa,CAAA,IAAK,OAAU,CAAA;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;"}
1
+ {"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_reattempt: canReattempt,\n can_start: canStart,\n can_resume: canResume,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const tooltipHidden = !sheetStatement || !isGoalBlock;\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReattempt || canReview);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReattempt,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={tooltipHidden}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canReattempt","canStart","canResume","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","tooltipHidden","canStartOrResume","showCardAnimation","renderOptions","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;AAmBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAP,GACE;AAAA,IACJ,UAAAQ;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,O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