@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.
- package/dist/assets/line-icons/icons/bin2.js +7 -8
- package/dist/assets/line-icons/icons/bin2.js.map +1 -1
- package/dist/assets/line-icons/icons/skip-colored.js +43 -0
- package/dist/assets/line-icons/icons/skip-colored.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +24 -24
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +76 -72
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +62 -75
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +127 -110
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js +12 -4
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +128 -105
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +49 -43
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js.map +1 -1
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js +42 -40
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-container.js +64 -62
- package/dist/features/milestone/edit/goal-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/milestone-edit-container.js +54 -52
- package/dist/features/milestone/edit/milestone-edit-container.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +61 -52
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +28 -28
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +120 -111
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +16 -18
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +39 -24
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/theme/button.js +5 -5
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +369 -367
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1,74 +1,80 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { useFormDataPrefiller as
|
6
|
-
import { Container as
|
7
|
-
const
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
2
|
+
import { memo as y, useMemo as z, useCallback as A, useEffect as I } from "react";
|
3
|
+
import J from "./milestone-create-components-map.js";
|
4
|
+
import K from "./milestone-create-context.js";
|
5
|
+
import { useFormDataPrefiller as L, useMilestoneFormTree as N, useFormTreeTraversal as Q } from "./milestone-create-hooks.js";
|
6
|
+
import { Container as U, BodyContainer as W } from "./milestone-create-styled.js";
|
7
|
+
const G = y(
|
8
8
|
({
|
9
|
-
studentName:
|
10
|
-
studentId:
|
11
|
-
height:
|
12
|
-
minHeight:
|
13
|
-
formData:
|
9
|
+
studentName: h,
|
10
|
+
studentId: x,
|
11
|
+
height: S,
|
12
|
+
minHeight: l,
|
13
|
+
formData: c,
|
14
14
|
config: a,
|
15
|
-
onChapterExitWarning:
|
15
|
+
onChapterExitWarning: C,
|
16
16
|
onFormDataChange: e,
|
17
17
|
onPreSubmit: $,
|
18
|
-
onExit:
|
18
|
+
onExit: b,
|
19
19
|
board: F,
|
20
20
|
schoolData: P,
|
21
21
|
grade: T,
|
22
22
|
flow: t,
|
23
|
-
milestoneId:
|
23
|
+
milestoneId: k,
|
24
24
|
currentCountryCode: B,
|
25
|
-
isGoalCreation:
|
26
|
-
courseStream:
|
27
|
-
classRatio:
|
28
|
-
enrollmentType:
|
25
|
+
isGoalCreation: d,
|
26
|
+
courseStream: E,
|
27
|
+
classRatio: V,
|
28
|
+
enrollmentType: u,
|
29
|
+
canDeleteGoal: j,
|
30
|
+
onDeleteGoal: r
|
29
31
|
}) => {
|
30
|
-
const { formDataState:
|
32
|
+
const { formDataState: s, setFormData: w } = L(c, {
|
31
33
|
schoolData: P,
|
32
34
|
board: F,
|
33
35
|
grade: T,
|
34
36
|
config: a,
|
35
37
|
flow: t,
|
36
38
|
currentCountryCode: B
|
37
|
-
}),
|
39
|
+
}), H = N({
|
38
40
|
flow: t,
|
39
|
-
formDataState:
|
40
|
-
isGoalCreation:
|
41
|
-
}), o = e ?
|
41
|
+
formDataState: s,
|
42
|
+
isGoalCreation: d
|
43
|
+
}), o = e ? s : c, m = e ? "edit" : "view", p = m === "view", { currentStep: n, updateFormData: O, handleBack: v } = Q({
|
42
44
|
flow: t,
|
43
|
-
updatedFormTree:
|
45
|
+
updatedFormTree: H,
|
44
46
|
formData: o,
|
45
|
-
formDataState:
|
46
|
-
setFormData:
|
47
|
-
handleExit:
|
48
|
-
}), { name:
|
49
|
-
|
47
|
+
formDataState: s,
|
48
|
+
setFormData: w,
|
49
|
+
handleExit: b
|
50
|
+
}), { name: f } = n || {}, M = f ? J[f] : void 0, R = z(() => ({ handleBack: v, mode: m, flow: t }), [v, m, t]), q = A(() => {
|
51
|
+
r == null || r();
|
52
|
+
}, [r]);
|
53
|
+
return I(() => {
|
50
54
|
e && e(o);
|
51
|
-
}, [o, e]), /* @__PURE__ */
|
52
|
-
|
55
|
+
}, [o, e]), /* @__PURE__ */ i(K.Provider, { value: R, children: /* @__PURE__ */ i(U, { $height: S, $minHeight: l, $viewMode: p, children: /* @__PURE__ */ i(W, { $viewMode: p, children: M && n && u ? /* @__PURE__ */ i(
|
56
|
+
M,
|
53
57
|
{
|
54
|
-
studentName:
|
55
|
-
currentStep:
|
56
|
-
isGoalCreation:
|
58
|
+
studentName: h,
|
59
|
+
currentStep: n,
|
60
|
+
isGoalCreation: d,
|
57
61
|
config: a,
|
58
62
|
formData: o,
|
59
|
-
onFormDataChange:
|
60
|
-
onChapterExitWarning:
|
61
|
-
studentId:
|
63
|
+
onFormDataChange: O,
|
64
|
+
onChapterExitWarning: C,
|
65
|
+
studentId: x,
|
62
66
|
onPreSubmit: $,
|
63
|
-
milestoneId:
|
64
|
-
courseStream:
|
65
|
-
classRatio:
|
66
|
-
enrollmentType:
|
67
|
+
milestoneId: k,
|
68
|
+
courseStream: E,
|
69
|
+
classRatio: V || 0,
|
70
|
+
enrollmentType: u,
|
71
|
+
canDeleteGoal: j,
|
72
|
+
onDeleteGoal: q
|
67
73
|
}
|
68
74
|
) : void 0 }) }) });
|
69
75
|
}
|
70
76
|
);
|
71
77
|
export {
|
72
|
-
|
78
|
+
G as default
|
73
79
|
};
|
74
80
|
//# sourceMappingURL=milestone-create.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-create.js","sources":["../../../../src/features/milestone/create/milestone-create.tsx"],"sourcesContent":["import type { MileStoneJourneyMode } from './milestone-create-context';\nimport type { IMileStoneCreateProps, IMilestoneFormData } from './milestone-create-types';\n\nimport React, { memo, useEffect, useMemo } from 'react';\n\nimport ComponentsMap from './milestone-create-components-map';\nimport MilestoneCreateContext from './milestone-create-context';\nimport {\n useFormDataPrefiller,\n useFormTreeTraversal,\n useMilestoneFormTree,\n} from './milestone-create-hooks';\nimport { BodyContainer, Container } from './milestone-create-styled';\n\nconst MilestoneCreate: React.FC<IMileStoneCreateProps> = memo(\n ({\n studentName,\n studentId,\n height,\n minHeight,\n formData: formDataProp,\n config,\n onChapterExitWarning,\n onFormDataChange,\n onPreSubmit: handlePreSubmit,\n onExit: handleExit,\n board,\n schoolData,\n grade,\n flow,\n milestoneId,\n currentCountryCode,\n isGoalCreation,\n courseStream,\n classRatio,\n enrollmentType,\n }) => {\n const { formDataState, setFormData } = useFormDataPrefiller(formDataProp, {\n schoolData,\n board,\n grade,\n config,\n flow,\n currentCountryCode,\n });\n\n const updatedFormTree = useMilestoneFormTree({\n flow,\n formDataState,\n isGoalCreation,\n });\n\n const formData = (onFormDataChange ? formDataState : formDataProp) as IMilestoneFormData; //TODO: make better\n\n const mode: MileStoneJourneyMode = onFormDataChange ? 'edit' : 'view';\n const isViewMode = mode === 'view';\n\n const { currentStep, updateFormData, handleBack } = useFormTreeTraversal({\n flow,\n updatedFormTree,\n formData,\n formDataState,\n setFormData,\n handleExit,\n });\n\n const { name } = currentStep || {};\n const StepComponent = name ? ComponentsMap[name] : undefined;\n\n const contextValue = useMemo(() => ({ handleBack, mode, flow }), [handleBack, mode, flow]);\n\n useEffect(() => {\n if (onFormDataChange) {\n onFormDataChange(formData);\n }\n }, [formData, onFormDataChange]);\n\n return (\n <MilestoneCreateContext.Provider value={contextValue}>\n <Container $height={height} $minHeight={minHeight} $viewMode={isViewMode}>\n <BodyContainer $viewMode={isViewMode}>\n {StepComponent && currentStep && enrollmentType ? (\n <StepComponent\n studentName={studentName}\n currentStep={currentStep}\n isGoalCreation={isGoalCreation}\n config={config}\n formData={formData}\n onFormDataChange={updateFormData}\n onChapterExitWarning={onChapterExitWarning}\n studentId={studentId}\n onPreSubmit={handlePreSubmit}\n milestoneId={milestoneId}\n courseStream={courseStream}\n classRatio={classRatio || 0}\n enrollmentType={enrollmentType}\n />\n ) : undefined}\n </BodyContainer>\n </Container>\n </MilestoneCreateContext.Provider>\n );\n },\n);\n\nexport default MilestoneCreate;\n"],"names":["MilestoneCreate","memo","studentName","studentId","height","minHeight","formDataProp","config","onChapterExitWarning","onFormDataChange","handlePreSubmit","handleExit","board","schoolData","grade","flow","milestoneId","currentCountryCode","isGoalCreation","courseStream","classRatio","enrollmentType","formDataState","setFormData","useFormDataPrefiller","updatedFormTree","useMilestoneFormTree","formData","mode","isViewMode","currentStep","updateFormData","handleBack","useFormTreeTraversal","name","StepComponent","ComponentsMap","contextValue","useMemo","useEffect","jsx","MilestoneCreateContext","Container","BodyContainer"],"mappings":";;;;;;AAcA,MAAMA,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAUC;AAAA,IACV,QAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,aAAaC;AAAA,IACb,QAAQC;AAAA,IACR,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,eAAAC,GAAe,aAAAC,MAAgBC,
|
1
|
+
{"version":3,"file":"milestone-create.js","sources":["../../../../src/features/milestone/create/milestone-create.tsx"],"sourcesContent":["import type { MileStoneJourneyMode } from './milestone-create-context';\nimport type { IMileStoneCreateProps, IMilestoneFormData } from './milestone-create-types';\n\nimport React, { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport ComponentsMap from './milestone-create-components-map';\nimport MilestoneCreateContext from './milestone-create-context';\nimport {\n useFormDataPrefiller,\n useFormTreeTraversal,\n useMilestoneFormTree,\n} from './milestone-create-hooks';\nimport { BodyContainer, Container } from './milestone-create-styled';\n\nconst MilestoneCreate: React.FC<IMileStoneCreateProps> = memo(\n ({\n studentName,\n studentId,\n height,\n minHeight,\n formData: formDataProp,\n config,\n onChapterExitWarning,\n onFormDataChange,\n onPreSubmit: handlePreSubmit,\n onExit: handleExit,\n board,\n schoolData,\n grade,\n flow,\n milestoneId,\n currentCountryCode,\n isGoalCreation,\n courseStream,\n classRatio,\n enrollmentType,\n canDeleteGoal,\n onDeleteGoal,\n }) => {\n const { formDataState, setFormData } = useFormDataPrefiller(formDataProp, {\n schoolData,\n board,\n grade,\n config,\n flow,\n currentCountryCode,\n });\n\n const updatedFormTree = useMilestoneFormTree({\n flow,\n formDataState,\n isGoalCreation,\n });\n\n const formData = (onFormDataChange ? formDataState : formDataProp) as IMilestoneFormData; //TODO: make better\n\n const mode: MileStoneJourneyMode = onFormDataChange ? 'edit' : 'view';\n const isViewMode = mode === 'view';\n\n const { currentStep, updateFormData, handleBack } = useFormTreeTraversal({\n flow,\n updatedFormTree,\n formData,\n formDataState,\n setFormData,\n handleExit,\n });\n\n const { name } = currentStep || {};\n const StepComponent = name ? ComponentsMap[name] : undefined;\n\n const contextValue = useMemo(() => ({ handleBack, mode, flow }), [handleBack, mode, flow]);\n\n const handleOnDeleteGoal = useCallback(() => {\n onDeleteGoal?.();\n }, [onDeleteGoal]);\n\n useEffect(() => {\n if (onFormDataChange) {\n onFormDataChange(formData);\n }\n }, [formData, onFormDataChange]);\n\n return (\n <MilestoneCreateContext.Provider value={contextValue}>\n <Container $height={height} $minHeight={minHeight} $viewMode={isViewMode}>\n <BodyContainer $viewMode={isViewMode}>\n {StepComponent && currentStep && enrollmentType ? (\n <StepComponent\n studentName={studentName}\n currentStep={currentStep}\n isGoalCreation={isGoalCreation}\n config={config}\n formData={formData}\n onFormDataChange={updateFormData}\n onChapterExitWarning={onChapterExitWarning}\n studentId={studentId}\n onPreSubmit={handlePreSubmit}\n milestoneId={milestoneId}\n courseStream={courseStream}\n classRatio={classRatio || 0}\n enrollmentType={enrollmentType}\n canDeleteGoal={canDeleteGoal}\n onDeleteGoal={handleOnDeleteGoal}\n />\n ) : undefined}\n </BodyContainer>\n </Container>\n </MilestoneCreateContext.Provider>\n );\n },\n);\n\nexport default MilestoneCreate;\n"],"names":["MilestoneCreate","memo","studentName","studentId","height","minHeight","formDataProp","config","onChapterExitWarning","onFormDataChange","handlePreSubmit","handleExit","board","schoolData","grade","flow","milestoneId","currentCountryCode","isGoalCreation","courseStream","classRatio","enrollmentType","canDeleteGoal","onDeleteGoal","formDataState","setFormData","useFormDataPrefiller","updatedFormTree","useMilestoneFormTree","formData","mode","isViewMode","currentStep","updateFormData","handleBack","useFormTreeTraversal","name","StepComponent","ComponentsMap","contextValue","useMemo","handleOnDeleteGoal","useCallback","useEffect","jsx","MilestoneCreateContext","Container","BodyContainer"],"mappings":";;;;;;AAcA,MAAMA,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAUC;AAAA,IACV,QAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,aAAaC;AAAA,IACb,QAAQC;AAAA,IACR,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,eAAAC,GAAe,aAAAC,MAAgBC,EAAqBpB,GAAc;AAAA,MACxE,YAAAO;AAAA,MACA,OAAAD;AAAA,MACA,OAAAE;AAAA,MACA,QAAAP;AAAA,MACA,MAAAQ;AAAA,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A,QACb,aAAAM;AAAA,QACA,cAAAG;AAAA,QACA,YAAYC,KAAc;AAAA,QAC1B,gBAAAC;AAAA,QACA,eAAAC;AAAA,QACA,cAAcmB;AAAA,MAAA;AAAA,IAChB,IACE,OACN,CAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createGetAPI as i } from "@cuemath/rest-api";
|
2
|
-
import {
|
2
|
+
import { BASE_URL_V3_1 as o } from "../../../../../../constants/api.js";
|
3
3
|
import { stringify as r } from "../../../../../../helpers/query-string.js";
|
4
4
|
const { useGet: n, invalidate: l } = i({
|
5
5
|
getURL: (e, t) => `${o}/user-milestone/${e}/?${r(t)}`
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-milestone.js","sources":["../../../../../../../src/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.ts"],"sourcesContent":["import type { IMilestoneData } from '../../../../milestone-list-container/milestone-list/milestone-list-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport {
|
1
|
+
{"version":3,"file":"get-milestone.js","sources":["../../../../../../../src/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.ts"],"sourcesContent":["import type { IMilestoneData } from '../../../../milestone-list-container/milestone-list/milestone-list-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_1 } from '../../../../../../constants/api';\nimport { stringify } from '../../../../../../helpers/query-string';\n\ntype TQuery = {\n with_sheets: boolean;\n with_recommended_chapters?: boolean;\n};\n\nconst { useGet: useMilestoneGet, invalidate: invalidateMilestoneGetData } = createGetAPI<\n IMilestoneData,\n TQuery\n>({\n getURL: (milestoneId, query) =>\n `${BASE_URL_V3_1}/user-milestone/${milestoneId}/?${stringify(query)}`,\n});\n\nexport { useMilestoneGet, invalidateMilestoneGetData };\n"],"names":["useMilestoneGet","invalidateMilestoneGetData","createGetAPI","milestoneId","query","BASE_URL_V3_1","stringify"],"mappings":";;;AAYA,MAAM,EAAE,QAAQA,GAAiB,YAAYC,EAAA,IAA+BC,EAG1E;AAAA,EACA,QAAQ,CAACC,GAAaC,MACpB,GAAGC,CAAa,mBAAmBF,CAAW,KAAKG,EAAUF,CAAK,CAAC;AACvE,CAAC;"}
|
@@ -1,87 +1,89 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { h as
|
3
|
-
import { memo as
|
4
|
-
import { useGetMileStoneConfig as
|
5
|
-
import
|
6
|
-
import { useMilestoneGet as
|
7
|
-
import
|
8
|
-
import { transformGoalData as
|
9
|
-
const
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
2
|
+
import { h as A } from "../../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as R, useEffect as c, useMemo as S } from "react";
|
4
|
+
import { useGetMileStoneConfig as W } from "../../create/api/milestone-config.js";
|
5
|
+
import j from "../../create/milestone-create.js";
|
6
|
+
import { useMilestoneGet as z } from "../comps/edit-milestone-modal/api/get-milestone.js";
|
7
|
+
import H from "../comps/milestone-edit-loader/milestone-edit-loader.js";
|
8
|
+
import { transformGoalData as L } from "../goal-edit-helpers.js";
|
9
|
+
const N = R(
|
10
10
|
({
|
11
|
-
studentName:
|
12
|
-
studentId:
|
11
|
+
studentName: d,
|
12
|
+
studentId: l,
|
13
13
|
height: E,
|
14
|
-
onFormDataChange:
|
15
|
-
onPreSubmit:
|
16
|
-
onExit:
|
17
|
-
onChapterExitWarning:
|
14
|
+
onFormDataChange: C,
|
15
|
+
onPreSubmit: h,
|
16
|
+
onExit: p,
|
17
|
+
onChapterExitWarning: P,
|
18
18
|
userType: e,
|
19
|
-
board:
|
19
|
+
board: u,
|
20
20
|
schoolData: D,
|
21
21
|
grade: x,
|
22
22
|
milestoneId: t,
|
23
23
|
currentCountryCode: a,
|
24
24
|
courseStream: r,
|
25
25
|
classRatio: F,
|
26
|
-
enrollmentType:
|
26
|
+
enrollmentType: s,
|
27
|
+
onDeleteGoal: G
|
27
28
|
}) => {
|
28
29
|
const {
|
29
30
|
get: f,
|
30
31
|
data: i,
|
31
|
-
isProcessing:
|
32
|
-
isProcessingFailed:
|
33
|
-
} =
|
32
|
+
isProcessing: _,
|
33
|
+
isProcessingFailed: M
|
34
|
+
} = W();
|
34
35
|
c(() => {
|
35
36
|
f("", void 0);
|
36
37
|
}, [f]);
|
37
38
|
const {
|
38
39
|
get: m,
|
39
40
|
data: o,
|
40
|
-
isProcessing:
|
41
|
-
isProcessingFailed:
|
42
|
-
} =
|
43
|
-
() => o && i &&
|
41
|
+
isProcessing: w,
|
42
|
+
isProcessingFailed: b
|
43
|
+
} = z(t), g = S(
|
44
|
+
() => o && i && L({
|
44
45
|
currentMilestoneData: o,
|
45
46
|
config: i,
|
46
47
|
courseStream: r,
|
47
|
-
enrollmentType:
|
48
|
+
enrollmentType: s,
|
48
49
|
currentCountryCode: a
|
49
50
|
}),
|
50
|
-
[i, a,
|
51
|
-
);
|
51
|
+
[i, a, s, o, r]
|
52
|
+
), { can_delete: v } = (o == null ? void 0 : o.permissions) || {};
|
52
53
|
return c(() => {
|
53
54
|
e === "TEACHER" && m(t, {
|
54
|
-
with_plan: !0,
|
55
55
|
with_sheets: !0,
|
56
56
|
with_recommended_chapters: !0
|
57
57
|
});
|
58
|
-
}, [m, t, e]),
|
59
|
-
|
58
|
+
}, [m, t, e]), _ || w ? /* @__PURE__ */ n(H, {}) : b || M ? /* @__PURE__ */ n("p", { children: "Error" }) : i && g ? /* @__PURE__ */ n(
|
59
|
+
j,
|
60
60
|
{
|
61
61
|
flow: "DRAFT_EDIT",
|
62
|
-
board:
|
62
|
+
board: u,
|
63
63
|
schoolData: D,
|
64
|
-
studentId:
|
65
|
-
studentName:
|
64
|
+
studentId: l,
|
65
|
+
studentName: A.titleCase(d),
|
66
66
|
height: E,
|
67
67
|
formData: g,
|
68
68
|
config: i,
|
69
|
-
onFormDataChange:
|
70
|
-
onPreSubmit:
|
71
|
-
onExit:
|
72
|
-
onChapterExitWarning:
|
69
|
+
onFormDataChange: C,
|
70
|
+
onPreSubmit: h,
|
71
|
+
onExit: p,
|
72
|
+
onChapterExitWarning: P,
|
73
73
|
userType: e,
|
74
74
|
grade: x,
|
75
75
|
milestoneId: t,
|
76
76
|
isGoalCreation: !0,
|
77
77
|
courseStream: (o == null ? void 0 : o.course_stream) || r,
|
78
78
|
classRatio: F,
|
79
|
-
enrollmentType:
|
79
|
+
enrollmentType: s,
|
80
|
+
canDeleteGoal: v,
|
81
|
+
onDeleteGoal: G
|
80
82
|
}
|
81
83
|
) : null;
|
82
84
|
}
|
83
|
-
),
|
85
|
+
), U = N;
|
84
86
|
export {
|
85
|
-
|
87
|
+
U as default
|
86
88
|
};
|
87
89
|
//# sourceMappingURL=goal-draft-edit-container.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"goal-draft-edit-container.js","sources":["../../../../../src/features/milestone/edit/goal-drafts/goal-draft-edit-container.tsx"],"sourcesContent":["import type { IMileStoneEditContainerProps } from '../milestone-edit-types';\n\nimport { titleCase } from 'humanize-plus';\nimport { memo, useEffect, useMemo } from 'react';\n\nimport { useGetMileStoneConfig } from '../../create/api/milestone-config';\nimport MilestoneCreate from '../../create/milestone-create';\nimport { useMilestoneGet } from '../comps/edit-milestone-modal/api/get-milestone';\nimport MilestoneEditLoader from '../comps/milestone-edit-loader/milestone-edit-loader';\nimport { transformGoalData } from '../goal-edit-helpers';\n\nconst GoalDraftEditContainer: React.FC<IMileStoneEditContainerProps> = memo(\n ({\n studentName,\n studentId,\n height,\n onFormDataChange: handleFormDataChange,\n onPreSubmit: handlePreSubmit,\n onExit: handleExit,\n onChapterExitWarning: handleChapterExitWarning,\n userType,\n board,\n schoolData,\n grade,\n milestoneId,\n currentCountryCode,\n courseStream,\n classRatio,\n enrollmentType,\n }) => {\n const {\n get: getConfig,\n data: configData,\n isProcessing: isConfigProcessing,\n isProcessingFailed: isConfigProcessingFailed,\n } = useGetMileStoneConfig();\n\n useEffect(() => {\n getConfig('', undefined);\n }, [getConfig]);\n\n const {\n get: getMilestone,\n data: currentMilestoneData,\n isProcessing: isMilestoneProcessing,\n isProcessingFailed: isMilestoneProcessingFailed,\n } = useMilestoneGet(milestoneId);\n\n const convertedData = useMemo(\n () =>\n currentMilestoneData &&\n configData &&\n transformGoalData({\n currentMilestoneData,\n config: configData,\n courseStream,\n enrollmentType,\n currentCountryCode,\n }),\n [configData, currentCountryCode, enrollmentType, currentMilestoneData, courseStream],\n );\n\n useEffect(() => {\n if (userType === 'TEACHER')\n getMilestone(milestoneId, {\n
|
1
|
+
{"version":3,"file":"goal-draft-edit-container.js","sources":["../../../../../src/features/milestone/edit/goal-drafts/goal-draft-edit-container.tsx"],"sourcesContent":["import type { IMileStoneEditContainerProps } from '../milestone-edit-types';\n\nimport { titleCase } from 'humanize-plus';\nimport { memo, useEffect, useMemo } from 'react';\n\nimport { useGetMileStoneConfig } from '../../create/api/milestone-config';\nimport MilestoneCreate from '../../create/milestone-create';\nimport { useMilestoneGet } from '../comps/edit-milestone-modal/api/get-milestone';\nimport MilestoneEditLoader from '../comps/milestone-edit-loader/milestone-edit-loader';\nimport { transformGoalData } from '../goal-edit-helpers';\n\nconst GoalDraftEditContainer: React.FC<IMileStoneEditContainerProps> = memo(\n ({\n studentName,\n studentId,\n height,\n onFormDataChange: handleFormDataChange,\n onPreSubmit: handlePreSubmit,\n onExit: handleExit,\n onChapterExitWarning: handleChapterExitWarning,\n userType,\n board,\n schoolData,\n grade,\n milestoneId,\n currentCountryCode,\n courseStream,\n classRatio,\n enrollmentType,\n onDeleteGoal,\n }) => {\n const {\n get: getConfig,\n data: configData,\n isProcessing: isConfigProcessing,\n isProcessingFailed: isConfigProcessingFailed,\n } = useGetMileStoneConfig();\n\n useEffect(() => {\n getConfig('', undefined);\n }, [getConfig]);\n\n const {\n get: getMilestone,\n data: currentMilestoneData,\n isProcessing: isMilestoneProcessing,\n isProcessingFailed: isMilestoneProcessingFailed,\n } = useMilestoneGet(milestoneId);\n\n const convertedData = useMemo(\n () =>\n currentMilestoneData &&\n configData &&\n transformGoalData({\n currentMilestoneData,\n config: configData,\n courseStream,\n enrollmentType,\n currentCountryCode,\n }),\n [configData, currentCountryCode, enrollmentType, currentMilestoneData, courseStream],\n );\n const { can_delete: canDeleteGoal } = currentMilestoneData?.permissions || {};\n\n useEffect(() => {\n if (userType === 'TEACHER')\n getMilestone(milestoneId, {\n with_sheets: true,\n with_recommended_chapters: true,\n });\n }, [getMilestone, milestoneId, userType]);\n\n if (isConfigProcessing || isMilestoneProcessing) return <MilestoneEditLoader />;\n\n if (isMilestoneProcessingFailed || isConfigProcessingFailed) {\n return <p>Error</p>;\n }\n\n return configData && convertedData ? (\n <MilestoneCreate\n flow=\"DRAFT_EDIT\"\n board={board}\n schoolData={schoolData}\n studentId={studentId}\n studentName={titleCase(studentName)}\n height={height}\n formData={convertedData}\n config={configData}\n onFormDataChange={handleFormDataChange}\n onPreSubmit={handlePreSubmit}\n onExit={handleExit}\n onChapterExitWarning={handleChapterExitWarning}\n userType={userType}\n grade={grade}\n milestoneId={milestoneId}\n isGoalCreation={true}\n courseStream={currentMilestoneData?.course_stream || courseStream}\n classRatio={classRatio}\n enrollmentType={enrollmentType}\n canDeleteGoal={canDeleteGoal}\n onDeleteGoal={onDeleteGoal}\n />\n ) : null;\n },\n);\n\nexport default GoalDraftEditContainer;\n"],"names":["GoalDraftEditContainer","memo","studentName","studentId","height","handleFormDataChange","handlePreSubmit","handleExit","handleChapterExitWarning","userType","board","schoolData","grade","milestoneId","currentCountryCode","courseStream","classRatio","enrollmentType","onDeleteGoal","getConfig","configData","isConfigProcessing","isConfigProcessingFailed","useGetMileStoneConfig","useEffect","getMilestone","currentMilestoneData","isMilestoneProcessing","isMilestoneProcessingFailed","useMilestoneGet","convertedData","useMemo","transformGoalData","canDeleteGoal","jsx","MilestoneEditLoader","MilestoneCreate","titleCase","GoalDraftEditContainer$1"],"mappings":";;;;;;;;AAWA,MAAMA,IAAiEC;AAAA,EACrE,CAAC;AAAA,IAC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K,QAAA,CAAA,IAGVd,KAAcU,IACnB,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAA1B;AAAA,QACA,YAAAC;AAAA,QACA,WAAAR;AAAA,QACA,aAAakC,YAAUnC,CAAW;AAAA,QAClC,QAAAE;AAAA,QACA,UAAU0B;AAAA,QACV,QAAQV;AAAA,QACR,kBAAkBf;AAAA,QAClB,aAAaC;AAAA,QACb,QAAQC;AAAA,QACR,sBAAsBC;AAAA,QACtB,UAAAC;AAAA,QACA,OAAAG;AAAA,QACA,aAAAC;AAAA,QACA,gBAAgB;AAAA,QAChB,eAAca,KAAA,gBAAAA,EAAsB,kBAAiBX;AAAA,QACrD,YAAAC;AAAA,QACA,gBAAAC;AAAA,QACA,eAAAgB;AAAA,QACA,cAAAf;AAAA,MAAA;AAAA,IAEA,IAAA;AAAA,EACN;AACF,GAEAoB,IAAetC;"}
|
@@ -1,88 +1,90 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import { useGetMileStoneConfig as
|
4
|
-
import
|
5
|
-
import { useMilestoneGet as
|
6
|
-
import
|
7
|
-
import { transformGoalData as
|
8
|
-
const
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
2
|
+
import { memo as W, useEffect as m } from "react";
|
3
|
+
import { useGetMileStoneConfig as j } from "../create/api/milestone-config.js";
|
4
|
+
import A from "../create/milestone-create.js";
|
5
|
+
import { useMilestoneGet as H } from "./comps/edit-milestone-modal/api/get-milestone.js";
|
6
|
+
import L from "./comps/milestone-edit-loader/milestone-edit-loader.js";
|
7
|
+
import { transformGoalData as R } from "./goal-edit-helpers.js";
|
8
|
+
const $ = W(
|
9
9
|
({
|
10
10
|
studentName: l,
|
11
11
|
studentId: d,
|
12
12
|
height: C,
|
13
|
-
minHeight:
|
14
|
-
board:
|
15
|
-
grade:
|
16
|
-
onFormDataChange:
|
17
|
-
onPreSubmit:
|
18
|
-
onExit:
|
19
|
-
onChapterExitWarning:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
minHeight: E,
|
14
|
+
board: p,
|
15
|
+
grade: P,
|
16
|
+
onFormDataChange: h,
|
17
|
+
onPreSubmit: u,
|
18
|
+
onExit: G,
|
19
|
+
onChapterExitWarning: x,
|
20
|
+
onDeleteGoal: D,
|
21
|
+
userType: e,
|
22
|
+
milestoneId: i,
|
23
|
+
formData: r,
|
24
|
+
currentCountryCode: F,
|
25
|
+
courseStream: s,
|
26
|
+
classRatio: M,
|
27
|
+
enrollmentType: a
|
27
28
|
}) => {
|
28
29
|
const {
|
29
|
-
get:
|
30
|
-
data:
|
31
|
-
isProcessing:
|
30
|
+
get: g,
|
31
|
+
data: t,
|
32
|
+
isProcessing: _,
|
32
33
|
isProcessingFailed: w
|
33
|
-
} =
|
34
|
+
} = j();
|
34
35
|
m(() => {
|
35
|
-
|
36
|
-
}, [
|
36
|
+
g("", void 0);
|
37
|
+
}, [g]);
|
37
38
|
const {
|
38
|
-
get:
|
39
|
-
data:
|
40
|
-
isProcessing:
|
41
|
-
isProcessingFailed:
|
42
|
-
} =
|
39
|
+
get: c,
|
40
|
+
data: o,
|
41
|
+
isProcessing: b,
|
42
|
+
isProcessingFailed: v
|
43
|
+
} = H(i);
|
43
44
|
if (m(() => {
|
44
|
-
|
45
|
-
with_plan: !0,
|
45
|
+
e === "TEACHER" && c(i, {
|
46
46
|
with_sheets: !0,
|
47
47
|
with_recommended_chapters: !0
|
48
48
|
});
|
49
|
-
}, [
|
50
|
-
if (
|
51
|
-
return /* @__PURE__ */
|
52
|
-
const
|
53
|
-
currentMilestoneData:
|
54
|
-
config:
|
55
|
-
courseStream:
|
56
|
-
enrollmentType:
|
57
|
-
currentCountryCode:
|
49
|
+
}, [c, i, e]), _ || b) return /* @__PURE__ */ n(L, {});
|
50
|
+
if (v || w)
|
51
|
+
return /* @__PURE__ */ n("p", { children: "Error" });
|
52
|
+
const { can_delete: S } = (o == null ? void 0 : o.permissions) || {}, f = o && t && R({
|
53
|
+
currentMilestoneData: o,
|
54
|
+
config: t,
|
55
|
+
courseStream: s,
|
56
|
+
enrollmentType: a,
|
57
|
+
currentCountryCode: F
|
58
58
|
});
|
59
|
-
return
|
60
|
-
|
59
|
+
return t && (f || r) ? /* @__PURE__ */ n(
|
60
|
+
A,
|
61
61
|
{
|
62
62
|
flow: "EDIT",
|
63
|
-
board:
|
64
|
-
grade:
|
63
|
+
board: p,
|
64
|
+
grade: P,
|
65
65
|
studentId: d,
|
66
66
|
studentName: l,
|
67
67
|
height: C,
|
68
|
-
minHeight:
|
69
|
-
formData:
|
70
|
-
config:
|
71
|
-
onFormDataChange:
|
72
|
-
onPreSubmit:
|
73
|
-
onExit:
|
74
|
-
onChapterExitWarning:
|
75
|
-
userType:
|
68
|
+
minHeight: E,
|
69
|
+
formData: r || f,
|
70
|
+
config: t,
|
71
|
+
onFormDataChange: h,
|
72
|
+
onPreSubmit: u,
|
73
|
+
onExit: G,
|
74
|
+
onChapterExitWarning: x,
|
75
|
+
userType: e,
|
76
76
|
isGoalCreation: !0,
|
77
|
-
milestoneId:
|
78
|
-
courseStream:
|
79
|
-
classRatio:
|
80
|
-
enrollmentType:
|
77
|
+
milestoneId: i,
|
78
|
+
courseStream: s,
|
79
|
+
classRatio: M,
|
80
|
+
enrollmentType: a,
|
81
|
+
canDeleteGoal: S,
|
82
|
+
onDeleteGoal: D
|
81
83
|
}
|
82
84
|
) : null;
|
83
85
|
}
|
84
|
-
),
|
86
|
+
), O = $;
|
85
87
|
export {
|
86
|
-
|
88
|
+
O as default
|
87
89
|
};
|
88
90
|
//# sourceMappingURL=goal-edit-container.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"goal-edit-container.js","sources":["../../../../src/features/milestone/edit/goal-edit-container.tsx"],"sourcesContent":["import type { IMileStoneEditContainerProps } from './milestone-edit-types';\n\nimport { memo, useEffect } from 'react';\n\nimport { useGetMileStoneConfig } from '../create/api/milestone-config';\nimport MilestoneCreate from '../create/milestone-create';\nimport { useMilestoneGet } from './comps/edit-milestone-modal/api/get-milestone';\nimport MilestoneEditLoader from './comps/milestone-edit-loader/milestone-edit-loader';\nimport { transformGoalData } from './goal-edit-helpers';\n\nconst GoalEditContainer: React.FC<IMileStoneEditContainerProps> = memo(\n ({\n studentName,\n studentId,\n height,\n minHeight,\n board,\n grade,\n onFormDataChange: handleFormDataChange,\n onPreSubmit: handlePreSubmit,\n onExit: handleExit,\n onChapterExitWarning: handleChapterExitWarning,\n userType,\n milestoneId,\n formData,\n currentCountryCode,\n courseStream,\n classRatio,\n enrollmentType,\n }) => {\n const {\n get: getConfig,\n data: configData,\n isProcessing: isConfigProcessing,\n isProcessingFailed: isConfigProcessingFailed,\n } = useGetMileStoneConfig();\n\n useEffect(() => {\n getConfig('', undefined);\n }, [getConfig]);\n\n const {\n get: getMilestone,\n data: currentMilestoneData,\n isProcessing: isMilestoneProcessing,\n isProcessingFailed: isMilestoneProcessingFailed,\n } = useMilestoneGet(milestoneId);\n\n useEffect(() => {\n if (userType === 'TEACHER')\n getMilestone(milestoneId, {\n
|
1
|
+
{"version":3,"file":"goal-edit-container.js","sources":["../../../../src/features/milestone/edit/goal-edit-container.tsx"],"sourcesContent":["import type { IMileStoneEditContainerProps } from './milestone-edit-types';\n\nimport { memo, useEffect } from 'react';\n\nimport { useGetMileStoneConfig } from '../create/api/milestone-config';\nimport MilestoneCreate from '../create/milestone-create';\nimport { useMilestoneGet } from './comps/edit-milestone-modal/api/get-milestone';\nimport MilestoneEditLoader from './comps/milestone-edit-loader/milestone-edit-loader';\nimport { transformGoalData } from './goal-edit-helpers';\n\nconst GoalEditContainer: React.FC<IMileStoneEditContainerProps> = memo(\n ({\n studentName,\n studentId,\n height,\n minHeight,\n board,\n grade,\n onFormDataChange: handleFormDataChange,\n onPreSubmit: handlePreSubmit,\n onExit: handleExit,\n onChapterExitWarning: handleChapterExitWarning,\n onDeleteGoal,\n userType,\n milestoneId,\n formData,\n currentCountryCode,\n courseStream,\n classRatio,\n enrollmentType,\n }) => {\n const {\n get: getConfig,\n data: configData,\n isProcessing: isConfigProcessing,\n isProcessingFailed: isConfigProcessingFailed,\n } = useGetMileStoneConfig();\n\n useEffect(() => {\n getConfig('', undefined);\n }, [getConfig]);\n\n const {\n get: getMilestone,\n data: currentMilestoneData,\n isProcessing: isMilestoneProcessing,\n isProcessingFailed: isMilestoneProcessingFailed,\n } = useMilestoneGet(milestoneId);\n\n useEffect(() => {\n if (userType === 'TEACHER')\n getMilestone(milestoneId, {\n with_sheets: true,\n with_recommended_chapters: true,\n });\n }, [getMilestone, milestoneId, userType]);\n\n if (isConfigProcessing || isMilestoneProcessing) return <MilestoneEditLoader />;\n\n if (isMilestoneProcessingFailed || isConfigProcessingFailed) {\n return <p>Error</p>;\n }\n\n const { can_delete: canDeleteGoal } = currentMilestoneData?.permissions || {};\n\n const convertedData =\n currentMilestoneData &&\n configData &&\n transformGoalData({\n currentMilestoneData,\n config: configData,\n courseStream,\n enrollmentType,\n currentCountryCode,\n });\n\n return configData && (convertedData || formData) ? (\n <MilestoneCreate\n flow=\"EDIT\"\n board={board}\n grade={grade}\n studentId={studentId}\n studentName={studentName}\n height={height}\n minHeight={minHeight}\n formData={formData || convertedData}\n config={configData}\n onFormDataChange={handleFormDataChange}\n onPreSubmit={handlePreSubmit}\n onExit={handleExit}\n onChapterExitWarning={handleChapterExitWarning}\n userType={userType}\n isGoalCreation={true}\n milestoneId={milestoneId}\n courseStream={courseStream}\n classRatio={classRatio}\n enrollmentType={enrollmentType}\n canDeleteGoal={canDeleteGoal}\n onDeleteGoal={onDeleteGoal}\n />\n ) : null;\n },\n);\n\nexport default GoalEditContainer;\n"],"names":["GoalEditContainer","memo","studentName","studentId","height","minHeight","board","grade","handleFormDataChange","handlePreSubmit","handleExit","handleChapterExitWarning","onDeleteGoal","userType","milestoneId","formData","currentCountryCode","courseStream","classRatio","enrollmentType","getConfig","configData","isConfigProcessing","isConfigProcessingFailed","useGetMileStoneConfig","useEffect","getMilestone","currentMilestoneData","isMilestoneProcessing","isMilestoneProcessingFailed","useMilestoneGet","jsx","MilestoneEditLoader","canDeleteGoal","convertedData","transformGoalData","MilestoneCreate","GoalEditContainer$1"],"mappings":";;;;;;;AAUA,MAAMA,IAA4DC;AAAA,EAChE,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,kBAAkBC;AAAA,IAClB,aAAaC;AAAA,IACb,QAAQC;AAAA,IACR,sBAAsBC;AAAA,IACtB,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,MACI;AACE,UAAA;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MACN,cAAcC;AAAA,MACd,oBAAoBC;AAAA,QAClBC,EAAsB;AAE1B,IAAAC,EAAU,MAAM;AACd,MAAAL,EAAU,IAAI,MAAS;AAAA,IAAA,GACtB,CAACA,CAAS,CAAC;AAER,UAAA;AAAA,MACJ,KAAKM;AAAA,MACL,MAAMC;AAAA,MACN,cAAcC;AAAA,MACd,oBAAoBC;AAAA,IAAA,IAClBC,EAAgBhB,CAAW;AAU/B,QARAW,EAAU,MAAM;AACd,MAAIZ,MAAa,aACfa,EAAaZ,GAAa;AAAA,QACxB,aAAa;AAAA,QACb,2BAA2B;AAAA,MAAA,CAC5B;AAAA,IACF,GAAA,CAACY,GAAcZ,GAAaD,CAAQ,CAAC,GAEpCS,KAAsBM,EAA8B,QAAA,gBAAAG,EAACC,GAAoB,CAAA,CAAA;AAE7E,QAAIH,KAA+BN;AAC1B,aAAA,gBAAAQ,EAAC,OAAE,UAAK,QAAA,CAAA;AAGjB,UAAM,EAAE,YAAYE,EAAA,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