@cuemath/leap 3.1.5-beta-0.1 → 3.1.6-j1
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/illustrations/illustrations.js +1 -2
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/check.js +3 -3
- package/dist/assets/line-icons/icons/check.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +2 -4
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector-styled.js +9 -0
- package/dist/features/auth/account-selector/account-selector-styled.js.map +1 -0
- package/dist/features/auth/account-selector/account-selector.js +57 -33
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js +21 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js.map +1 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +8 -9
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +1 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -3
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/forgot-password/otp-form/otp-form.js +29 -29
- package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js +14 -18
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js.map +1 -1
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +23 -24
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +4 -2
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js +85 -75
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +13 -0
- package/dist/features/auth/login/login-styled.js.map +1 -0
- package/dist/features/auth/login/social-account-not-found/social-account-not-found.js +27 -21
- package/dist/features/auth/login/social-account-not-found/social-account-not-found.js.map +1 -1
- package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js +9 -0
- package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js.map +1 -0
- package/dist/features/auth/login/social-login-methods/social-login-methods.js +43 -34
- package/dist/features/auth/login/social-login-methods/social-login-methods.js.map +1 -1
- package/dist/features/auth/login/username-password-form/username-password-form.js +22 -21
- package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
- package/dist/features/auth/user-list/user-item/user-item.js +33 -32
- package/dist/features/auth/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/user-list/user-list.js +60 -51
- package/dist/features/auth/user-list/user-list.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +74 -74
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-context.js +5 -8
- package/dist/features/cue-canvas/cue-canvas-context.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-core.js +74 -84
- package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-helpers.js +25 -31
- package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +12 -14
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js +59 -66
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/cue-cavas-styled.js +42 -45
- package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +54 -61
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js +14 -18
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/grid-menu.js +13 -13
- package/dist/features/cue-canvas/toolbar/grid-menu.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/tool.js +20 -22
- package/dist/features/cue-canvas/toolbar/tool.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +112 -144
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/styles.js +4 -5
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/hooks/use-viewport.js +21 -0
- package/dist/features/hooks/use-viewport.js.map +1 -0
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +262 -199
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +15 -15
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +36 -38
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +22 -24
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +22 -23
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +47 -49
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +87 -94
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +12 -13
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +21 -23
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +162 -165
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js +47 -48
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +121 -100
- 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/milestone-widget-styled.js +14 -15
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +51 -52
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/trial-session/comps/pricing/pricing.js +35 -36
- package/dist/features/trial-session/comps/pricing/pricing.js.map +1 -1
- package/dist/features/ui/buttons/button/button-styled.js +29 -29
- package/dist/features/ui/buttons/button/button-styled.js.map +1 -1
- package/dist/features/ui/stepper/stepper.js +7 -7
- package/dist/features/utils/media.js +16 -0
- package/dist/features/utils/media.js.map +1 -0
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js +19 -22
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js.map +1 -1
- package/dist/index.d.ts +35 -92
- package/dist/index.js +321 -323
- package/dist/index.js.map +1 -1
- package/dist/static/cuemath-app-qr-code.7205ee79.svg +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/puzzle-icon.js +0 -51
- package/dist/assets/line-icons/icons/puzzle-icon.js.map +0 -1
- package/dist/assets/line-icons/icons/share.js +0 -48
- package/dist/assets/line-icons/icons/share.js.map +0 -1
- package/dist/assets/line-icons/icons/tile.js +0 -54
- package/dist/assets/line-icons/icons/tile.js.map +0 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +0 -12
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +0 -1
- package/dist/features/cue-canvas/bottombar/homework-controls.js +0 -73
- package/dist/features/cue-canvas/bottombar/homework-controls.js.map +0 -1
- package/dist/features/cue-canvas/hooks/use-config-updater.js +0 -12
- package/dist/features/cue-canvas/hooks/use-config-updater.js.map +0 -1
- package/dist/features/cue-canvas/hooks/use-upload-helper.js +0 -23
- package/dist/features/cue-canvas/hooks/use-upload-helper.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/helper.js +0 -20
- package/dist/features/cue-canvas/sidebar/homework/helper.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js +0 -33
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js +0 -68
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js +0 -25
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework.js +0 -39
- package/dist/features/cue-canvas/sidebar/homework/homework.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js +0 -13
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js +0 -60
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js +0 -44
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js +0 -107
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js +0 -42
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js +0 -84
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js +0 -36
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js +0 -133
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js +0 -96
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js +0 -29
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js +0 -120
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js +0 -32
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/sidebar.js +0 -29
- package/dist/features/cue-canvas/sidebar/sidebar.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/tiles/tile.js +0 -16
- package/dist/features/cue-canvas/sidebar/tiles/tile.js.map +0 -1
- package/dist/features/homework/hw-card-list/hw-card-list-utils.js +0 -8
- package/dist/features/homework/hw-card-list/hw-card-list-utils.js.map +0 -1
- package/dist/features/hooks/use-debounce.js +0 -16
- package/dist/features/hooks/use-debounce.js.map +0 -1
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js +0 -18
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js.map +0 -1
- package/dist/features/trial-session/comps/pricing/india-pricing/index.js +0 -96
- package/dist/features/trial-session/comps/pricing/india-pricing/index.js.map +0 -1
- package/dist/features/trial-session/comps/pricing/india-pricing/india-pricing-styled.js +0 -59
- package/dist/features/trial-session/comps/pricing/india-pricing/india-pricing-styled.js.map +0 -1
- package/dist/static/ellipse-clip.dfb25608.svg +0 -1
package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AA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AAA,cACA,aAAAC;AAAA,cACA,cAAAQ;AAAA,cACA,mBAAAP;AAAA,cACA,aAAAC;AAAA,cACA,sBAAAC;AAAA,YAAA;AAAA,UACF;AAAA,UACCyB,MAAQrD,EAAW,SAAS,KAAM,gBAAAgD,EAAAS,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,CAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACH,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
1
|
+
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport { StyledDownIcon } from './milestone-widget/milestone-widget-styled';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const [expandInactiveMilestones, setExpandInactiveMilestones] = useState(false);\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onExpandPastMilestones,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const toggleExpand = () => {\n if (!expandInactiveMilestones && onExpandPastMilestones) {\n onExpandPastMilestones();\n }\n setExpandInactiveMilestones(!expandInactiveMilestones);\n };\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestoneType === 'INACTIVE' && Boolean(milestones.length) && (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $marginBottomX={1}\n >\n <Text $renderAs=\"ac4\">PAST LEARNING PLANS & OUTCOMES ({milestones.length})</Text>\n <StyledDownIcon onClick={toggleExpand} $expanded={expandInactiveMilestones} />\n </FlexView>\n )}\n\n {(isDraftMilestone || isMilestoneActive || expandInactiveMilestones) &&\n milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","expandInactiveMilestones","setExpandInactiveMilestones","useState","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onExpandPastMilestones","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","toggleExpand","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","TextButton","StyledDownIcon","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACvE,UAAM,CAACC,GAA0BC,CAA2B,IAAIC,GAAS,EAAK,GACxE;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,wBAAAC;AAAA,IACE,IAAAnC,GAEEoC,IAAoBrC,MAAkB,UACtCsC,IAAmBtC,MAAkB,SACrCuC,IAAuBC,GAAWC,EAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,MAAA/B,KAAA,QAAAA,EAAe2B;AAAA,IAAoB,GAClC,CAAC3B,GAAc2B,CAAoB,CAAC,GAEjCK,IAAe,MA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2B,MAAQ3D,EAAW,SAAS,KAAM,gBAAAqD,EAAAU,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,EAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACL,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
@@ -13,8 +13,7 @@ const f = x`
|
|
13
13
|
`, v = r(i)`
|
14
14
|
position: relative;
|
15
15
|
animation: ${f} 0.3s ease-in-out;
|
16
|
-
|
17
|
-
r(g)(({ theme: o, $expanded: t }) => {
|
16
|
+
`, k = r(g)(({ theme: o, $expanded: t }) => {
|
18
17
|
const {
|
19
18
|
layout: { gutter: e },
|
20
19
|
colors: { BLACK_1: n }
|
@@ -28,8 +27,7 @@ r(g)(({ theme: o, $expanded: t }) => {
|
|
28
27
|
transform: rotate(${t === !0 ? 180 : 0}deg);
|
29
28
|
transition: transform 0.3s ease;
|
30
29
|
`;
|
31
|
-
})
|
32
|
-
const k = r.div(({ $expanded: o, theme: t }) => {
|
30
|
+
}), C = r.div(({ $expanded: o, theme: t }) => {
|
33
31
|
const { colors: e } = t;
|
34
32
|
return `
|
35
33
|
display:grid;
|
@@ -39,7 +37,7 @@ const k = r.div(({ $expanded: o, theme: t }) => {
|
|
39
37
|
border: 1px solid ${e.GREY_2};
|
40
38
|
border-top:none;
|
41
39
|
`;
|
42
|
-
}),
|
40
|
+
}), I = r.div`
|
43
41
|
min-height: 0px;
|
44
42
|
width: 100%;
|
45
43
|
`;
|
@@ -83,7 +81,7 @@ r.div(({ theme: o, $rotate: t }) => {
|
|
83
81
|
}
|
84
82
|
`;
|
85
83
|
});
|
86
|
-
const
|
84
|
+
const _ = r(i)`
|
87
85
|
border-bottom: 0px;
|
88
86
|
position: relative;
|
89
87
|
padding: 32px 32px 24px;
|
@@ -92,7 +90,7 @@ const I = r(i)`
|
|
92
90
|
r(s)`
|
93
91
|
white-space: pre-wrap;
|
94
92
|
`;
|
95
|
-
const
|
93
|
+
const A = r(s)`
|
96
94
|
display: -webkit-box;
|
97
95
|
-webkit-box-orient: vertical;
|
98
96
|
-webkit-line-clamp: 2;
|
@@ -111,7 +109,7 @@ r(i)(({
|
|
111
109
|
top: ${t.layout.gutter * 1.75 / 2}px;
|
112
110
|
${o === "right" ? "right: 0px;" : "left: 0px;"}
|
113
111
|
`);
|
114
|
-
const
|
112
|
+
const D = r.div(({ theme: o }) => {
|
115
113
|
const { layout: t } = o;
|
116
114
|
return `
|
117
115
|
position: absolute;
|
@@ -129,7 +127,7 @@ const A = r.div(({ theme: o }) => {
|
|
129
127
|
position: absolute;
|
130
128
|
inset: 50%;
|
131
129
|
transform: translate(-50%, -50%) rotate(-90deg);
|
132
|
-
`),
|
130
|
+
`), S = r.circle(
|
133
131
|
({ theme: o, $progressCircle: t, $progress: e, $progressBackground: n }) => {
|
134
132
|
const { colors: p, layout: l } = o, { GREY_2: c } = p, { gutter: a } = l, d = a * 12.5, u = t ? d - e : e;
|
135
133
|
return `
|
@@ -148,12 +146,13 @@ r(s)(({ theme: o, $backgroundColor: t }) => `
|
|
148
146
|
`);
|
149
147
|
export {
|
150
148
|
G as ChapterProgressSVG,
|
151
|
-
|
152
|
-
|
153
|
-
|
149
|
+
S as ChapterProgressSVGCircle,
|
150
|
+
I as Content,
|
151
|
+
C as ContentWrapper,
|
154
152
|
v as MainContainer,
|
155
|
-
|
156
|
-
|
157
|
-
|
153
|
+
A as MilestoneTitle,
|
154
|
+
D as StyledCheckIconWrapper,
|
155
|
+
k as StyledDownIcon,
|
156
|
+
_ as Wrapper
|
158
157
|
};
|
159
158
|
//# sourceMappingURL=milestone-widget-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-widget-styled.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\n\nimport styled, { keyframes } from 'styled-components';\n\nimport ChevronDownIcon from '../../../../../assets/line-icons/icons/chevron-down';\nimport InfoIcon from '../../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\ninterface IContentWrapperProps {\n $expanded: boolean;\n}\n\ninterface IStyledDownIconProps {\n $expanded: boolean;\n}\n\nconst fadeIn = keyframes`\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst MainContainer = styled(FlexView)`\n position: relative;\n animation: ${fadeIn} 0.3s ease-in-out;\n`;\n\nconst StyledDownIcon = styled(ChevronDownIcon)<IStyledDownIconProps>(({ theme, $expanded }) => {\n const {\n layout: { gutter },\n colors: { BLACK_1 },\n } = theme;\n\n return `\n cursor: pointer;\n width: ${gutter * 1.5}px;\n height: ${gutter * 1.5}px;\n outline: 1px solid ${BLACK_1};\n border-radius: 50%;\n transform: rotate(${$expanded === true ? 180 : 0}deg);\n transition: transform 0.3s ease;\n `;\n});\n\nconst ContentWrapper = styled.div<IContentWrapperProps>(({ $expanded, theme }) => {\n const { colors } = theme;\n\n return `\n display:grid;\n grid-template-rows:${$expanded ? 1 : 0}fr;\n overflow:hidden;\n transition:grid-template-rows 200ms;\n border: 1px solid ${colors.GREY_2};\n border-top:none;\n `;\n});\n\nconst Content = styled.div`\n min-height: 0px;\n width: 100%;\n`;\n\nconst HelpWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding: ${gutter * 2}px;\n `;\n});\n\nconst StyledInfoIcon = styled(InfoIcon)(\n () => `\n position: relative;\n cursor: pointer;\n `,\n);\n\nconst LessonsInfoWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding:${gutter}px;\n display: grid;\n gap:0px;\n grid-template-rows: 1fr ${gutter * 1.75}px 1fr ${gutter * 1.75}px 1fr;\n grid-template-columns: ${gutter * 4}px ${gutter * 5}px ${gutter * 6.375}px ${gutter * 10.25}px;\n width:${gutter * 28}px;\n align-items:center;\n `;\n});\n\nconst UpArrowWrapper = styled.div<{ $rotate: boolean }>(({ theme, $rotate }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n grid-column: span 4;\n padding-left: ${gutter * 1.5}px;\n & img {\n transform: rotate(${$rotate ? 180 : 0}deg);\n }\n `;\n});\n\nconst Wrapper = styled(FlexView)`\n border-bottom: 0px;\n position: relative;\n padding: 32px 32px 24px;\n cursor: pointer;\n`;\n\nconst SpacedText = styled(Text)`\n white-space: pre-wrap;\n`;\n\nconst MilestoneTitle = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\n\nconst MilestoneWidgetStatusWrapper = styled(FlexView)`\n position: relative;\n z-index: 1;\n`;\n\ninterface IMilestoneWidgetStatusTag {\n $placement: string;\n}\n\nconst MilestoneWidgetStatusTag = styled(FlexView)<IMilestoneWidgetStatusTag>(({\n $placement,\n theme,\n}) => {\n return `\n position: absolute;\n top: ${(theme.layout.gutter * 1.75) / 2}px;\n ${$placement === 'right' ? 'right: 0px;' : 'left: 0px;'}\n `;\n});\n\nconst StyledCheckIconWrapper = styled.div(({ theme }) => {\n const { layout } = theme;\n\n return `\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 2;\n\n width: ${layout.gutter * 1.25}px;\n height: ${layout.gutter * 1.25}px;\n border-radius: 50%;\n background: ${theme.colors.WHITE_1};\n outline: 1px solid ${theme.colors.BLACK_1};\n `;\n});\n\nconst ChapterProgressSVG = styled.svg(() => {\n return `\n position: absolute;\n inset: 50%;\n transform: translate(-50%, -50%) rotate(-90deg);\n `;\n});\n\ninterface IChapterProgressSVGCircleProps {\n $progressCircle?: boolean;\n $progress: number;\n $progressBackground?: TColorNames;\n}\n\nconst ChapterProgressSVGCircle = styled.circle<IChapterProgressSVGCircleProps>(\n ({ theme, $progressCircle, $progress, $progressBackground }) => {\n const { colors, layout } = theme;\n const { GREY_2 } = colors;\n const { gutter } = layout;\n\n const strokeDashArray = gutter * 12.5;\n const strokeDashOffset = $progressCircle ? strokeDashArray - $progress : $progress;\n\n return `\n stroke-dasharray: ${strokeDashArray};\n stroke-dashoffset: ${strokeDashOffset};\n stroke: ${$progressCircle ? colors[$progressBackground || 'BLACK'] : GREY_2};\n\n stroke-width: ${gutter * 0.125}px;\n fill: none;\n `;\n },\n);\n\ninterface IWidgetStateTag {\n $backgroundColor: TColorNames;\n}\n\nconst WidgetStateTag = styled(Text)<IWidgetStateTag>(({ theme, $backgroundColor }) => {\n return `\n padding: 4px;\n background: ${theme.colors[$backgroundColor]};\n `;\n});\n\nexport {\n Content,\n ContentWrapper,\n HelpWrapper,\n LessonsInfoWrapper,\n MainContainer,\n SpacedText,\n StyledDownIcon,\n StyledInfoIcon,\n UpArrowWrapper,\n Wrapper,\n MilestoneTitle,\n MilestoneWidgetStatusWrapper,\n MilestoneWidgetStatusTag,\n StyledCheckIconWrapper,\n ChapterProgressSVG,\n ChapterProgressSVGCircle,\n WidgetStateTag,\n};\n"],"names":["fadeIn","keyframes","MainContainer","styled","FlexView","ChevronDownIcon","theme","$expanded","gutter","BLACK_1","ContentWrapper","colors","Content","InfoIcon","$rotate","Wrapper","Text","MilestoneTitle","$placement","StyledCheckIconWrapper","layout","ChapterProgressSVG","ChapterProgressSVGCircle","$progressCircle","$progress","$progressBackground","GREY_2","strokeDashArray","strokeDashOffset","$backgroundColor"],"mappings":";;;;;AAiBA,MAAMA,IAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASTC,IAAgBC,EAAOC,CAAQ;AAAA;AAAA,eAEtBJ,CAAM;AAAA
|
1
|
+
{"version":3,"file":"milestone-widget-styled.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\n\nimport styled, { keyframes } from 'styled-components';\n\nimport ChevronDownIcon from '../../../../../assets/line-icons/icons/chevron-down';\nimport InfoIcon from '../../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\ninterface IContentWrapperProps {\n $expanded: boolean;\n}\n\ninterface IStyledDownIconProps {\n $expanded: boolean;\n}\n\nconst fadeIn = keyframes`\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst MainContainer = styled(FlexView)`\n position: relative;\n animation: ${fadeIn} 0.3s ease-in-out;\n`;\n\nconst StyledDownIcon = styled(ChevronDownIcon)<IStyledDownIconProps>(({ theme, $expanded }) => {\n const {\n layout: { gutter },\n colors: { BLACK_1 },\n } = theme;\n\n return `\n cursor: pointer;\n width: ${gutter * 1.5}px;\n height: ${gutter * 1.5}px;\n outline: 1px solid ${BLACK_1};\n border-radius: 50%;\n transform: rotate(${$expanded === true ? 180 : 0}deg);\n transition: transform 0.3s ease;\n `;\n});\n\nconst ContentWrapper = styled.div<IContentWrapperProps>(({ $expanded, theme }) => {\n const { colors } = theme;\n\n return `\n display:grid;\n grid-template-rows:${$expanded ? 1 : 0}fr;\n overflow:hidden;\n transition:grid-template-rows 200ms;\n border: 1px solid ${colors.GREY_2};\n border-top:none;\n `;\n});\n\nconst Content = styled.div`\n min-height: 0px;\n width: 100%;\n`;\n\nconst HelpWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding: ${gutter * 2}px;\n `;\n});\n\nconst StyledInfoIcon = styled(InfoIcon)(\n () => `\n position: relative;\n cursor: pointer;\n `,\n);\n\nconst LessonsInfoWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding:${gutter}px;\n display: grid;\n gap:0px;\n grid-template-rows: 1fr ${gutter * 1.75}px 1fr ${gutter * 1.75}px 1fr;\n grid-template-columns: ${gutter * 4}px ${gutter * 5}px ${gutter * 6.375}px ${gutter * 10.25}px;\n width:${gutter * 28}px;\n align-items:center;\n `;\n});\n\nconst UpArrowWrapper = styled.div<{ $rotate: boolean }>(({ theme, $rotate }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n grid-column: span 4;\n padding-left: ${gutter * 1.5}px;\n & img {\n transform: rotate(${$rotate ? 180 : 0}deg);\n }\n `;\n});\n\nconst Wrapper = styled(FlexView)`\n border-bottom: 0px;\n position: relative;\n padding: 32px 32px 24px;\n cursor: pointer;\n`;\n\nconst SpacedText = styled(Text)`\n white-space: pre-wrap;\n`;\n\nconst MilestoneTitle = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\n\nconst MilestoneWidgetStatusWrapper = styled(FlexView)`\n position: relative;\n z-index: 1;\n`;\n\ninterface IMilestoneWidgetStatusTag {\n $placement: string;\n}\n\nconst MilestoneWidgetStatusTag = styled(FlexView)<IMilestoneWidgetStatusTag>(({\n $placement,\n theme,\n}) => {\n return `\n position: absolute;\n top: ${(theme.layout.gutter * 1.75) / 2}px;\n ${$placement === 'right' ? 'right: 0px;' : 'left: 0px;'}\n `;\n});\n\nconst StyledCheckIconWrapper = styled.div(({ theme }) => {\n const { layout } = theme;\n\n return `\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 2;\n\n width: ${layout.gutter * 1.25}px;\n height: ${layout.gutter * 1.25}px;\n border-radius: 50%;\n background: ${theme.colors.WHITE_1};\n outline: 1px solid ${theme.colors.BLACK_1};\n `;\n});\n\nconst ChapterProgressSVG = styled.svg(() => {\n return `\n position: absolute;\n inset: 50%;\n transform: translate(-50%, -50%) rotate(-90deg);\n `;\n});\n\ninterface IChapterProgressSVGCircleProps {\n $progressCircle?: boolean;\n $progress: number;\n $progressBackground?: TColorNames;\n}\n\nconst ChapterProgressSVGCircle = styled.circle<IChapterProgressSVGCircleProps>(\n ({ theme, $progressCircle, $progress, $progressBackground }) => {\n const { colors, layout } = theme;\n const { GREY_2 } = colors;\n const { gutter } = layout;\n\n const strokeDashArray = gutter * 12.5;\n const strokeDashOffset = $progressCircle ? strokeDashArray - $progress : $progress;\n\n return `\n stroke-dasharray: ${strokeDashArray};\n stroke-dashoffset: ${strokeDashOffset};\n stroke: ${$progressCircle ? colors[$progressBackground || 'BLACK'] : GREY_2};\n\n stroke-width: ${gutter * 0.125}px;\n fill: none;\n `;\n },\n);\n\ninterface IWidgetStateTag {\n $backgroundColor: TColorNames;\n}\n\nconst WidgetStateTag = styled(Text)<IWidgetStateTag>(({ theme, $backgroundColor }) => {\n return `\n padding: 4px;\n background: ${theme.colors[$backgroundColor]};\n `;\n});\n\nexport {\n Content,\n ContentWrapper,\n HelpWrapper,\n LessonsInfoWrapper,\n MainContainer,\n SpacedText,\n StyledDownIcon,\n StyledInfoIcon,\n UpArrowWrapper,\n Wrapper,\n MilestoneTitle,\n MilestoneWidgetStatusWrapper,\n MilestoneWidgetStatusTag,\n StyledCheckIconWrapper,\n ChapterProgressSVG,\n ChapterProgressSVGCircle,\n WidgetStateTag,\n};\n"],"names":["fadeIn","keyframes","MainContainer","styled","FlexView","StyledDownIcon","ChevronDownIcon","theme","$expanded","gutter","BLACK_1","ContentWrapper","colors","Content","InfoIcon","$rotate","Wrapper","Text","MilestoneTitle","$placement","StyledCheckIconWrapper","layout","ChapterProgressSVG","ChapterProgressSVGCircle","$progressCircle","$progress","$progressBackground","GREY_2","strokeDashArray","strokeDashOffset","$backgroundColor"],"mappings":";;;;;AAiBA,MAAMA,IAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASTC,IAAgBC,EAAOC,CAAQ;AAAA;AAAA,eAEtBJ,CAAM;AAAA,GAGfK,IAAiBF,EAAOG,CAAe,EAAwB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACvF,QAAA;AAAA,IACJ,QAAQ,EAAE,QAAAC,EAAO;AAAA,IACjB,QAAQ,EAAE,SAAAC,EAAQ;AAAA,EAChB,IAAAH;AAEG,SAAA;AAAA;AAAA,aAEIE,IAAS,GAAG;AAAA,cACXA,IAAS,GAAG;AAAA,yBACDC,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OAAOuB,CAAgB,CAAC;AAAA,GAE/C;"}
|
@@ -1,28 +1,27 @@
|
|
1
|
-
import { jsx as a, jsxs as
|
1
|
+
import { jsx as a, jsxs as C, Fragment as ae } from "react/jsx-runtime";
|
2
2
|
import { h as le } from "../../../node_modules/humanize-plus/dist/humanize.js";
|
3
3
|
import { memo as Se, useMemo as me, useState as u, useCallback as Te, useEffect as p } from "react";
|
4
4
|
import { ILLUSTRATIONS as ce } from "../../../assets/illustrations/illustrations.js";
|
5
5
|
import { EVENTS as e } from "../../communication/pub-sub/constants.js";
|
6
|
-
import { useInClassActionListener as
|
6
|
+
import { useInClassActionListener as _e } from "../../communication/pub-sub/hooks.js";
|
7
7
|
import { invalidateHomeworks as f } from "../../homework/hw-card-list/api/get-homeworks.js";
|
8
|
-
import
|
8
|
+
import de from "../../ui/separator/separator.js";
|
9
9
|
import { invalidateMilestoneResources as Ae } from "./api/get-milestone-resources.js";
|
10
10
|
import { useGetAllMilestonesdata as Ne, invalidateMilestonesData as De } from "./api/get-milestones.js";
|
11
|
-
import {
|
12
|
-
import
|
13
|
-
import Ie from "./
|
14
|
-
import Le from "./milestone-list/milestone-
|
15
|
-
import Ce from "./
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
({ studentName: m, studentId: l, studentClassroomId: h, ...v }) => {
|
11
|
+
import { invalidateTestHelpData as Me } from "./api/get-tests-list.js";
|
12
|
+
import Re from "./filter-milestones.js";
|
13
|
+
import Ie from "./milestone-list/milestone-list.js";
|
14
|
+
import Le from "./milestone-list/milestone-loader/milestone-loader.js";
|
15
|
+
import { ContentWrapper as Oe, LoaderWrapper as Ce } from "./styled.js";
|
16
|
+
const ue = (_) => {
|
17
|
+
De(_);
|
18
|
+
}, pe = Se(
|
19
|
+
({ studentName: _, studentId: l, studentClassroomId: h, ...v }) => {
|
21
20
|
const {
|
22
21
|
milestoneType: s,
|
23
22
|
isStudentPresent: N,
|
24
23
|
isClassOngoing: P,
|
25
|
-
userType:
|
24
|
+
userType: d,
|
26
25
|
canCreatePlan: U,
|
27
26
|
teacherName: G,
|
28
27
|
parentName: g,
|
@@ -40,9 +39,9 @@ const pe = (m) => {
|
|
40
39
|
onDelete: j,
|
41
40
|
onAssignResources: X,
|
42
41
|
onNodeAttempt: $,
|
43
|
-
onNodeView:
|
44
|
-
onNodeReview:
|
45
|
-
onNodeReattempt:
|
42
|
+
onNodeView: q,
|
43
|
+
onNodeReview: z,
|
44
|
+
onNodeReattempt: B,
|
46
45
|
onNodeReset: J,
|
47
46
|
onNodeUnassign: Q,
|
48
47
|
onTestPreview: Y,
|
@@ -52,31 +51,31 @@ const pe = (m) => {
|
|
52
51
|
onNodeAssignAsHomework: oe
|
53
52
|
} = v, n = me(
|
54
53
|
() => ({
|
55
|
-
milestone_state_group: s === "ACTIVE" ?
|
54
|
+
milestone_state_group: s === "ACTIVE" ? d === "TEACHER" ? "LIVE" : "STUDENT_LIVE" : s,
|
56
55
|
course_stream: A,
|
57
56
|
student_id: l
|
58
57
|
}),
|
59
|
-
[s, A, l,
|
58
|
+
[s, A, l, d]
|
60
59
|
), {
|
61
60
|
data: o,
|
62
|
-
getAll:
|
61
|
+
getAll: m,
|
63
62
|
isStale: D,
|
64
63
|
isProcessing: S
|
65
64
|
} = Ne(n), [M, R] = u(), [I, L] = u(!1), se = Te(
|
66
|
-
(
|
67
|
-
const { searchText: E, selectedBoard: i, selectedGrade: r } =
|
65
|
+
(T) => {
|
66
|
+
const { searchText: E, selectedBoard: i, selectedGrade: r } = T || {};
|
68
67
|
(E || i || r) && L(!0);
|
69
|
-
const
|
68
|
+
const c = o == null ? void 0 : o.filter((t) => {
|
70
69
|
const { milestone_name: Ee, board: ie, grade: re } = t || {};
|
71
70
|
return (E ? Ee.toLowerCase().includes(E.toLowerCase()) : !0) && (i ? ie === i : !0) && (r ? re === r : !0);
|
72
71
|
});
|
73
|
-
R(
|
72
|
+
R(c);
|
74
73
|
},
|
75
74
|
[o]
|
76
75
|
), ne = () => {
|
77
76
|
L(!1), R(void 0);
|
78
77
|
};
|
79
|
-
if (
|
78
|
+
if (_e(
|
80
79
|
{
|
81
80
|
studentClassroomId: h,
|
82
81
|
actions: [
|
@@ -102,37 +101,37 @@ const pe = (m) => {
|
|
102
101
|
[e.MILESTONE_TEST_ASSIGNED],
|
103
102
|
[e.SHEET_MARKED_AS_REVIEWED]
|
104
103
|
],
|
105
|
-
callback: (
|
106
|
-
var r,
|
107
|
-
const E = (r =
|
104
|
+
callback: (T) => {
|
105
|
+
var r, c;
|
106
|
+
const E = (r = T.find(
|
108
107
|
(t) => t.eventName === e.MILESTONE_RESOURCE_ASSIGNED || t.eventName === e.MILESTONE_RESOURCE_UNASSIGNED || t.eventName === e.MILESTONE_RESOURCE_RESET || t.eventName === e.SHEET_MARKED_AS_REVIEWED
|
109
|
-
)) == null ? void 0 : r.eventPayload, i = (
|
108
|
+
)) == null ? void 0 : r.eventPayload, i = (c = T.find(
|
110
109
|
(t) => t.eventName === e.MILESTONE_TEST_ASSIGNED || t.eventName === e.MILESTONE_RESOURCE_RESET
|
111
|
-
)) == null ? void 0 :
|
110
|
+
)) == null ? void 0 : c.eventPayload;
|
112
111
|
if (E) {
|
113
112
|
const { milestoneId: t } = E || {};
|
114
113
|
f(l), Ae(t);
|
115
114
|
}
|
116
115
|
if (i) {
|
117
116
|
const { milestoneId: t } = i;
|
118
|
-
f(l),
|
117
|
+
f(l), Me(t);
|
119
118
|
}
|
120
|
-
|
119
|
+
ue(n);
|
121
120
|
}
|
122
121
|
},
|
123
122
|
(s === "ACTIVE" || s === "INACTIVE") && N
|
124
123
|
), p(() => {
|
125
|
-
|
126
|
-
}, [
|
127
|
-
!S && D &&
|
128
|
-
}, [
|
129
|
-
return /* @__PURE__ */ a(
|
130
|
-
const
|
131
|
-
return /* @__PURE__ */
|
132
|
-
S && /* @__PURE__ */ a(
|
133
|
-
|
124
|
+
m(n);
|
125
|
+
}, [m, n]), p(() => {
|
126
|
+
!S && D && m(n);
|
127
|
+
}, [m, n, D, S]), S && !o)
|
128
|
+
return /* @__PURE__ */ a(Le, { numMilestones: 2 });
|
129
|
+
const O = s === "ACTIVE" && o && o.length > 6;
|
130
|
+
return /* @__PURE__ */ C(Oe, { $disablePointerEvents: S, children: [
|
131
|
+
S && /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ a("img", { src: ce.LOADER_1, alt: "loading" }) }),
|
132
|
+
O && /* @__PURE__ */ C(ae, { children: [
|
134
133
|
/* @__PURE__ */ a(
|
135
|
-
|
134
|
+
Re,
|
136
135
|
{
|
137
136
|
filteredMilestones: M,
|
138
137
|
milestones: o,
|
@@ -140,12 +139,12 @@ const pe = (m) => {
|
|
140
139
|
handleClearFilter: ne
|
141
140
|
}
|
142
141
|
),
|
143
|
-
/* @__PURE__ */ a(
|
142
|
+
/* @__PURE__ */ a(de, { heightX: 1.5 })
|
144
143
|
] }),
|
145
144
|
/* @__PURE__ */ a(
|
146
|
-
|
145
|
+
Ie,
|
147
146
|
{
|
148
|
-
showFilters: !!
|
147
|
+
showFilters: !!O,
|
149
148
|
canCreatePlan: U,
|
150
149
|
isClassOngoing: P,
|
151
150
|
isFiltersAdded: I,
|
@@ -166,9 +165,9 @@ const pe = (m) => {
|
|
166
165
|
onTestReview: Z,
|
167
166
|
onTestStart: ee,
|
168
167
|
onNodeAttempt: $,
|
169
|
-
onNodeView:
|
170
|
-
onNodeReview:
|
171
|
-
onNodeReattempt:
|
168
|
+
onNodeView: q,
|
169
|
+
onNodeReview: z,
|
170
|
+
onNodeReattempt: B,
|
172
171
|
onNodeReset: J,
|
173
172
|
onNodeUnassign: Q,
|
174
173
|
onNodeAssignAsHomework: oe,
|
@@ -176,17 +175,17 @@ const pe = (m) => {
|
|
176
175
|
activeTabId: w,
|
177
176
|
onWidgetTabSelection: te,
|
178
177
|
studentId: l,
|
179
|
-
studentName: le.titleCase(
|
178
|
+
studentName: le.titleCase(_),
|
180
179
|
teacherName: G,
|
181
180
|
parentName: g,
|
182
|
-
userType:
|
181
|
+
userType: d,
|
183
182
|
courseStream: A
|
184
183
|
}
|
185
184
|
)
|
186
185
|
] });
|
187
186
|
}
|
188
|
-
),
|
187
|
+
), Xe = pe;
|
189
188
|
export {
|
190
|
-
|
189
|
+
Xe as default
|
191
190
|
};
|
192
191
|
//# sourceMappingURL=milestone-list-container.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-list-container.js","sources":["../../../../src/features/milestone/milestone-list-container/milestone-list-container.tsx"],"sourcesContent":["import type {\n IMilestoneContainerProps,\n IMilestoneListQueryParams,\n} from './milestone-list-container-types';\nimport type { IMilestoneData } from './milestone-list/milestone-list-types';\n\nimport { titleCase } from 'humanize-plus';\nimport React, { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { EVENTS } from '../../communication/pub-sub/constants';\nimport { useInClassActionListener } from '../../communication/pub-sub/hooks';\nimport { invalidateHomeworks } from '../../homework/hw-card-list/api/get-homeworks';\nimport Separator from '../../ui/separator/separator';\nimport { invalidateMilestoneResources } from './api/get-milestone-resources';\nimport { useGetAllMilestonesdata, invalidateMilestonesData } from './api/get-milestones';\nimport { invalidatePastMilestoneCount } from './api/get-past-milestone-count';\nimport { invalidateTestHelpData } from './api/get-tests-list';\nimport FilterMilestones from './filter-milestones';\nimport MilestoneList from './milestone-list/milestone-list';\nimport MilestoneLoader from './milestone-list/milestone-loader/milestone-loader';\nimport * as Styled from './styled';\n\nconst invalidateAllMilestones = (queryParams: IMilestoneListQueryParams) => {\n invalidateMilestonesData(queryParams);\n invalidatePastMilestoneCount(queryParams.student_id);\n};\n\nconst MilestoneListContainer: React.FC<IMilestoneContainerProps> = memo(\n ({ studentName, studentId, studentClassroomId, ...restMilestoneListContainerProps }) => {\n const {\n milestoneType,\n isStudentPresent,\n isClassOngoing,\n userType,\n canCreatePlan,\n teacherName,\n parentName,\n courseStream,\n activeMilestoneId,\n activeTabId,\n onExpandPastMilestones,\n onAddOutcome,\n onChapterClick,\n onEdit,\n onCreateMilestoneTest,\n onDraftPublish,\n onAddChapter,\n onCreatePlan,\n onDelete,\n onAssignResources,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n onNodeAssignAsHomework,\n } = restMilestoneListContainerProps;\n\n const queryParams: IMilestoneListQueryParams = useMemo(\n () =>\n ({\n milestone_state_group:\n milestoneType === 'ACTIVE'\n ? userType === 'TEACHER'\n ? 'LIVE'\n : 'STUDENT_LIVE'\n : milestoneType,\n course_stream: courseStream,\n student_id: studentId,\n }) as const,\n [milestoneType, courseStream, studentId, userType],\n );\n\n const {\n data: milestoneData,\n getAll: getMilestoneData,\n isStale: isMilestoneDataStale,\n isProcessing: isMilestoneProcessing,\n } = useGetAllMilestonesdata(queryParams);\n\n const [filteredMilestones, setFilteredMilestones] = useState<IMilestoneData[] | undefined>();\n const [isFiltersAdded, setIsFiltersAdded] = useState<boolean>(false);\n\n const handleFilterMilestones = useCallback(\n (data: { searchText?: string; selectedBoard?: string; selectedGrade?: string }) => {\n const { searchText, selectedBoard, selectedGrade } = data || {};\n\n if (searchText || selectedBoard || selectedGrade) {\n setIsFiltersAdded(true);\n }\n\n const filteredData = milestoneData?.filter(item => {\n const { milestone_name: milestoneName, board, grade } = item || {};\n const matchesSearchText = searchText\n ? milestoneName.toLowerCase().includes(searchText.toLowerCase())\n : true;\n const matchesCurriculum = selectedBoard ? board === selectedBoard : true;\n const matchesGrade = selectedGrade ? grade === selectedGrade : true;\n\n return matchesSearchText && matchesCurriculum && matchesGrade;\n });\n\n setFilteredMilestones(filteredData);\n },\n [milestoneData],\n );\n\n const handleClearFilter = () => {\n setIsFiltersAdded(false);\n setFilteredMilestones(undefined);\n };\n\n useInClassActionListener(\n {\n studentClassroomId,\n actions: [\n [EVENTS.CHAPTER_UPDATED],\n [EVENTS.LESSONS_MARKED_AS_FAMILIAR],\n [EVENTS.LESSONS_MARKED_AS_IRRELEVANT],\n [EVENTS.LESSONS_PROGRESS_RESET],\n [EVENTS.UNLOCK_SHEETS],\n [EVENTS.EXTRA_PRACTICE_ASSIGNED],\n [EVENTS.MILESTONE_DATE_UPDATED],\n [EVENTS.MILESTONE_DELETED],\n [EVENTS.MILESTONE_NAME_UPDATED],\n [EVENTS.MILESTONE_EDITED],\n [EVENTS.MILESTONE_RESOURCE_ASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_UNASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_RESET],\n [EVENTS.SHEET_UNASSIGNED],\n [EVENTS.GOAL_CREATED],\n [EVENTS.GOAL_EDITED],\n [EVENTS.GOAL_DELETED],\n [EVENTS.GOAL_OUTCOME_ADDED],\n [EVENTS.PAST_MILESTONE_OUTCOME_ADDED],\n [EVENTS.MILESTONE_TEST_ASSIGNED],\n [EVENTS.SHEET_MARKED_AS_REVIEWED],\n ],\n callback: messages => {\n const milestoneResourceEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_RESOURCE_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_UNASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_RESET ||\n message.eventName === EVENTS.SHEET_MARKED_AS_REVIEWED,\n )?.eventPayload;\n const milestoneTestEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_TEST_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_RESET,\n )?.eventPayload;\n\n if (milestoneResourceEventPayload) {\n const { milestoneId: resourceMilestoneId } =\n (milestoneResourceEventPayload as { milestoneId: string }) || {};\n\n invalidateHomeworks(studentId);\n invalidateMilestoneResources(resourceMilestoneId);\n }\n\n if (milestoneTestEventPayload) {\n const { milestoneId } = milestoneTestEventPayload as { milestoneId: string };\n\n invalidateHomeworks(studentId);\n invalidateTestHelpData(milestoneId);\n }\n\n invalidateAllMilestones(queryParams);\n },\n },\n (milestoneType === 'ACTIVE' || milestoneType === 'INACTIVE') && isStudentPresent,\n );\n\n useEffect(() => {\n getMilestoneData(queryParams);\n }, [getMilestoneData, queryParams]);\n\n useEffect(() => {\n if (!isMilestoneProcessing && isMilestoneDataStale) {\n getMilestoneData(queryParams);\n }\n }, [getMilestoneData, queryParams, isMilestoneDataStale, isMilestoneProcessing]);\n\n if (isMilestoneProcessing && !milestoneData) {\n return <MilestoneLoader numMilestones={2} />;\n }\n\n const showFilters = milestoneType === 'ACTIVE' && milestoneData && milestoneData.length > 6;\n\n return (\n <Styled.ContentWrapper $disablePointerEvents={isMilestoneProcessing}>\n {isMilestoneProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loading\" />\n </Styled.LoaderWrapper>\n )}\n {showFilters && (\n <>\n <FilterMilestones\n filteredMilestones={filteredMilestones}\n milestones={milestoneData}\n handleFilterMilestones={handleFilterMilestones}\n handleClearFilter={handleClearFilter}\n />\n <Separator heightX={1.5} />\n </>\n )}\n\n <MilestoneList\n showFilters={!!showFilters}\n canCreatePlan={canCreatePlan}\n isClassOngoing={isClassOngoing}\n isFiltersAdded={isFiltersAdded}\n isStudentPresent={isStudentPresent}\n milestoneType={milestoneType}\n milestones={isFiltersAdded ? filteredMilestones : milestoneData}\n onAddChapter={onAddChapter}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n onCreatePlan={onCreatePlan}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n onExpandPastMilestones={onExpandPastMilestones}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAssignResources={onAssignResources}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n studentId={studentId}\n studentName={titleCase(studentName)}\n teacherName={teacherName}\n parentName={parentName}\n userType={userType}\n courseStream={courseStream}\n />\n </Styled.ContentWrapper>\n );\n },\n);\n\nexport default MilestoneListContainer;\n"],"names":["invalidateAllMilestones","queryParams","invalidateMilestonesData","invalidatePastMilestoneCount","MilestoneListContainer","memo","studentName","studentId","studentClassroomId","restMilestoneListContainerProps","milestoneType","isStudentPresent","isClassOngoing","userType","canCreatePlan","teacherName","parentName","courseStream","activeMilestoneId","activeTabId","onExpandPastMilestones","onAddOutcome","onChapterClick","onEdit","onCreateMilestoneTest","onDraftPublish","onAddChapter","onCreatePlan","onDelete","onAssignResources","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","onNodeAssignAsHomework","useMemo","milestoneData","getMilestoneData","isMilestoneDataStale","isMilestoneProcessing","useGetAllMilestonesdata","filteredMilestones","setFilteredMilestones","useState","isFiltersAdded","setIsFiltersAdded","handleFilterMilestones","useCallback","data","searchText","selectedBoard","selectedGrade","filteredData","item","milestoneName","board","grade","handleClearFilter","useInClassActionListener","EVENTS","messages","milestoneResourceEventPayload","_a","message","milestoneTestEventPayload","_b","resourceMilestoneId","invalidateHomeworks","invalidateMilestoneResources","milestoneId","invalidateTestHelpData","useEffect","jsx","MilestoneLoader","showFilters","jsxs","Styled.ContentWrapper","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","FilterMilestones","Separator","MilestoneList","titleCase","MilestoneListContainer$1"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAMA,KAA0B,CAACC,MAA2C;AAC1E,EAAAC,GAAyBD,CAAW,GACpCE,GAA6BF,EAAY,UAAU;AACrD,GAEMG,KAA6DC;AAAA,EACjE,CAAC,EAAE,aAAAC,GAAa,WAAAC,GAAW,oBAAAC,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U,EAClD,CAAA;AAAA,MAEDJ,KAEG,gBAAAC,EAAAI,IAAA,EAAA,UAAA;AAAA,QAAA,gBAAAP;AAAA,UAACQ;AAAA,UAAA;AAAA,YACC,oBAAAvC;AAAA,YACA,YAAYL;AAAA,YACZ,wBAAAU;AAAA,YACA,mBAAAW;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAe,EAACS,IAAU,EAAA,SAAS,IAAK,CAAA;AAAA,MAAA,GAC3B;AAAA,MAGF,gBAAAT;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,aAAa,CAAC,CAACR;AAAA,UACf,eAAAlE;AAAA,UACA,gBAAAF;AAAA,UACA,gBAAAsC;AAAA,UACA,kBAAAvC;AAAA,UACA,eAAAD;AAAA,UACA,YAAYwC,IAAiBH,IAAqBL;AAAA,UAClD,cAAAhB;AAAA,UACA,cAAAL;AAAA,UACA,gBAAAC;AAAA,UACA,cAAAK;AAAA,UACA,UAAAC;AAAA,UACA,gBAAAH;AAAA,UACA,QAAAF;AAAA,UACA,wBAAAH;AAAA,UACA,uBAAAI;AAAA,UACA,mBAAAK;AAAA,UACA,eAAAO;AAAA,UACA,cAAAC;AAAA,UACA,aAAAC;AAAA,UACA,eAAAR;AAAA,UACA,YAAAC;AAAA,UACA,cAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,aAAAC;AAAA,UACA,gBAAAC;AAAA,UACA,wBAAAK;AAAA,UACA,mBAAAtB;AAAA,UACA,aAAAC;AAAA,UACA,sBAAAoB;AAAA,UACA,WAAAhC;AAAA,UACA,aAAakF,aAAUnF,CAAW;AAAA,UAClC,aAAAS;AAAA,UACA,YAAAC;AAAA,UACA,UAAAH;AAAA,UACA,cAAAI;AAAA,QAAA;AAAA,MACF;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAyE,KAAetF;"}
|
1
|
+
{"version":3,"file":"milestone-list-container.js","sources":["../../../../src/features/milestone/milestone-list-container/milestone-list-container.tsx"],"sourcesContent":["import type {\n IMilestoneContainerProps,\n IMilestoneListQueryParams,\n} from './milestone-list-container-types';\nimport type { IMilestoneData } from './milestone-list/milestone-list-types';\n\nimport { titleCase } from 'humanize-plus';\nimport React, { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { EVENTS } from '../../communication/pub-sub/constants';\nimport { useInClassActionListener } from '../../communication/pub-sub/hooks';\nimport { invalidateHomeworks } from '../../homework/hw-card-list/api/get-homeworks';\nimport Separator from '../../ui/separator/separator';\nimport { invalidateMilestoneResources } from './api/get-milestone-resources';\nimport { useGetAllMilestonesdata, invalidateMilestonesData } from './api/get-milestones';\nimport { invalidateTestHelpData } from './api/get-tests-list';\nimport FilterMilestones from './filter-milestones';\nimport MilestoneList from './milestone-list/milestone-list';\nimport MilestoneLoader from './milestone-list/milestone-loader/milestone-loader';\nimport * as Styled from './styled';\n\nconst invalidateAllMilestones = (queryParams: IMilestoneListQueryParams) => {\n invalidateMilestonesData(queryParams);\n};\n\nconst MilestoneListContainer: React.FC<IMilestoneContainerProps> = memo(\n ({ studentName, studentId, studentClassroomId, ...restMilestoneListContainerProps }) => {\n const {\n milestoneType,\n isStudentPresent,\n isClassOngoing,\n userType,\n canCreatePlan,\n teacherName,\n parentName,\n courseStream,\n activeMilestoneId,\n activeTabId,\n onExpandPastMilestones,\n onAddOutcome,\n onChapterClick,\n onEdit,\n onCreateMilestoneTest,\n onDraftPublish,\n onAddChapter,\n onCreatePlan,\n onDelete,\n onAssignResources,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n onNodeAssignAsHomework,\n } = restMilestoneListContainerProps;\n\n const queryParams: IMilestoneListQueryParams = useMemo(\n () =>\n ({\n milestone_state_group:\n milestoneType === 'ACTIVE'\n ? userType === 'TEACHER'\n ? 'LIVE'\n : 'STUDENT_LIVE'\n : milestoneType,\n course_stream: courseStream,\n student_id: studentId,\n }) as const,\n [milestoneType, courseStream, studentId, userType],\n );\n\n const {\n data: milestoneData,\n getAll: getMilestoneData,\n isStale: isMilestoneDataStale,\n isProcessing: isMilestoneProcessing,\n } = useGetAllMilestonesdata(queryParams);\n\n const [filteredMilestones, setFilteredMilestones] = useState<IMilestoneData[] | undefined>();\n const [isFiltersAdded, setIsFiltersAdded] = useState<boolean>(false);\n\n const handleFilterMilestones = useCallback(\n (data: { searchText?: string; selectedBoard?: string; selectedGrade?: string }) => {\n const { searchText, selectedBoard, selectedGrade } = data || {};\n\n if (searchText || selectedBoard || selectedGrade) {\n setIsFiltersAdded(true);\n }\n\n const filteredData = milestoneData?.filter(item => {\n const { milestone_name: milestoneName, board, grade } = item || {};\n const matchesSearchText = searchText\n ? milestoneName.toLowerCase().includes(searchText.toLowerCase())\n : true;\n const matchesCurriculum = selectedBoard ? board === selectedBoard : true;\n const matchesGrade = selectedGrade ? grade === selectedGrade : true;\n\n return matchesSearchText && matchesCurriculum && matchesGrade;\n });\n\n setFilteredMilestones(filteredData);\n },\n [milestoneData],\n );\n\n const handleClearFilter = () => {\n setIsFiltersAdded(false);\n setFilteredMilestones(undefined);\n };\n\n useInClassActionListener(\n {\n studentClassroomId,\n actions: [\n [EVENTS.CHAPTER_UPDATED],\n [EVENTS.LESSONS_MARKED_AS_FAMILIAR],\n [EVENTS.LESSONS_MARKED_AS_IRRELEVANT],\n [EVENTS.LESSONS_PROGRESS_RESET],\n [EVENTS.UNLOCK_SHEETS],\n [EVENTS.EXTRA_PRACTICE_ASSIGNED],\n [EVENTS.MILESTONE_DATE_UPDATED],\n [EVENTS.MILESTONE_DELETED],\n [EVENTS.MILESTONE_NAME_UPDATED],\n [EVENTS.MILESTONE_EDITED],\n [EVENTS.MILESTONE_RESOURCE_ASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_UNASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_RESET],\n [EVENTS.SHEET_UNASSIGNED],\n [EVENTS.GOAL_CREATED],\n [EVENTS.GOAL_EDITED],\n [EVENTS.GOAL_DELETED],\n [EVENTS.GOAL_OUTCOME_ADDED],\n [EVENTS.PAST_MILESTONE_OUTCOME_ADDED],\n [EVENTS.MILESTONE_TEST_ASSIGNED],\n [EVENTS.SHEET_MARKED_AS_REVIEWED],\n ],\n callback: messages => {\n const milestoneResourceEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_RESOURCE_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_UNASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_RESET ||\n message.eventName === EVENTS.SHEET_MARKED_AS_REVIEWED,\n )?.eventPayload;\n const milestoneTestEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_TEST_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_RESET,\n )?.eventPayload;\n\n if (milestoneResourceEventPayload) {\n const { milestoneId: resourceMilestoneId } =\n (milestoneResourceEventPayload as { milestoneId: string }) || {};\n\n invalidateHomeworks(studentId);\n invalidateMilestoneResources(resourceMilestoneId);\n }\n\n if (milestoneTestEventPayload) {\n const { milestoneId } = milestoneTestEventPayload as { milestoneId: string };\n\n invalidateHomeworks(studentId);\n invalidateTestHelpData(milestoneId);\n }\n\n invalidateAllMilestones(queryParams);\n },\n },\n (milestoneType === 'ACTIVE' || milestoneType === 'INACTIVE') && isStudentPresent,\n );\n\n useEffect(() => {\n getMilestoneData(queryParams);\n }, [getMilestoneData, queryParams]);\n\n useEffect(() => {\n if (!isMilestoneProcessing && isMilestoneDataStale) {\n getMilestoneData(queryParams);\n }\n }, [getMilestoneData, queryParams, isMilestoneDataStale, isMilestoneProcessing]);\n\n if (isMilestoneProcessing && !milestoneData) {\n return <MilestoneLoader numMilestones={2} />;\n }\n\n const showFilters = milestoneType === 'ACTIVE' && milestoneData && milestoneData.length > 6;\n\n return (\n <Styled.ContentWrapper $disablePointerEvents={isMilestoneProcessing}>\n {isMilestoneProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loading\" />\n </Styled.LoaderWrapper>\n )}\n {showFilters && (\n <>\n <FilterMilestones\n filteredMilestones={filteredMilestones}\n milestones={milestoneData}\n handleFilterMilestones={handleFilterMilestones}\n handleClearFilter={handleClearFilter}\n />\n <Separator heightX={1.5} />\n </>\n )}\n\n <MilestoneList\n showFilters={!!showFilters}\n canCreatePlan={canCreatePlan}\n isClassOngoing={isClassOngoing}\n isFiltersAdded={isFiltersAdded}\n isStudentPresent={isStudentPresent}\n milestoneType={milestoneType}\n milestones={isFiltersAdded ? filteredMilestones : milestoneData}\n onAddChapter={onAddChapter}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n onCreatePlan={onCreatePlan}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n onExpandPastMilestones={onExpandPastMilestones}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAssignResources={onAssignResources}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n studentId={studentId}\n studentName={titleCase(studentName)}\n teacherName={teacherName}\n parentName={parentName}\n userType={userType}\n courseStream={courseStream}\n />\n </Styled.ContentWrapper>\n );\n },\n);\n\nexport default MilestoneListContainer;\n"],"names":["invalidateAllMilestones","queryParams","invalidateMilestonesData","MilestoneListContainer","memo","studentName","studentId","studentClassroomId","restMilestoneListContainerProps","milestoneType","isStudentPresent","isClassOngoing","userType","canCreatePlan","teacherName","parentName","courseStream","activeMilestoneId","activeTabId","onExpandPastMilestones","onAddOutcome","onChapterClick","onEdit","onCreateMilestoneTest","onDraftPublish","onAddChapter","onCreatePlan","onDelete","onAssignResources","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","onNodeAssignAsHomework","useMemo","milestoneData","getMilestoneData","isMilestoneDataStale","isMilestoneProcessing","useGetAllMilestonesdata","filteredMilestones","setFilteredMilestones","useState","isFiltersAdded","setIsFiltersAdded","handleFilterMilestones","useCallback","data","searchText","selectedBoard","selectedGrade","filteredData","item","milestoneName","board","grade","handleClearFilter","useInClassActionListener","EVENTS","messages","milestoneResourceEventPayload","_a","message","milestoneTestEventPayload","_b","resourceMilestoneId","invalidateHomeworks","invalidateMilestoneResources","milestoneId","invalidateTestHelpData","useEffect","jsx","MilestoneLoader","showFilters","jsxs","Styled.ContentWrapper","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","FilterMilestones","Separator","MilestoneList","titleCase","MilestoneListContainer$1"],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAMA,KAA0B,CAACC,MAA2C;AAC1E,EAAAC,GAAyBD,CAAW;AACtC,GAEME,KAA6DC;AAAA,EACjE,CAAC,EAAE,aAAAC,GAAa,WAAAC,GAAW,oBAAAC,GAAoB,GAAGC,QAAsC;AAChF,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAC;AAAA,MACA,eAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,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BAAAvC;AAAA,UACA,eAAAD;AAAA,UACA,YAAYwC,IAAiBH,IAAqBL;AAAA,UAClD,cAAAhB;AAAA,UACA,cAAAL;AAAA,UACA,gBAAAC;AAAA,UACA,cAAAK;AAAA,UACA,UAAAC;AAAA,UACA,gBAAAH;AAAA,UACA,QAAAF;AAAA,UACA,wBAAAH;AAAA,UACA,uBAAAI;AAAA,UACA,mBAAAK;AAAA,UACA,eAAAO;AAAA,UACA,cAAAC;AAAA,UACA,aAAAC;AAAA,UACA,eAAAR;AAAA,UACA,YAAAC;AAAA,UACA,cAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,aAAAC;AAAA,UACA,gBAAAC;AAAA,UACA,wBAAAK;AAAA,UACA,mBAAAtB;AAAA,UACA,aAAAC;AAAA,UACA,sBAAAoB;AAAA,UACA,WAAAhC;AAAA,UACA,aAAakF,aAAUnF,CAAW;AAAA,UAClC,aAAAS;AAAA,UACA,YAAAC;AAAA,UACA,UAAAH;AAAA,UACA,cAAAI;AAAA,QAAA;AAAA,MACF;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAyE,KAAetF;"}
|
@@ -1,38 +1,37 @@
|
|
1
1
|
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
2
|
+
import { memo as P, useCallback as x, useEffect as m } from "react";
|
3
3
|
import { ILLUSTRATIONS as T } from "../../../../assets/illustrations/illustrations.js";
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import v from "../../../ui/error/error.js";
|
5
|
+
import y from "../../../ui/image/image.js";
|
6
6
|
import C from "../../../ui/layout/flex-view.js";
|
7
|
-
import
|
7
|
+
import I from "../../../ui/loader/app-loader/app-loader.js";
|
8
8
|
import d from "../../../ui/separator/separator.js";
|
9
|
-
import
|
10
|
-
import { useGetTrialPricing as
|
11
|
-
import { useTrialSessionContext as
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import D from "./pricing-
|
15
|
-
|
16
|
-
const
|
17
|
-
const { isTeacher: f, studentId: i, updateButtonState: s } = w(), {
|
9
|
+
import L from "../../../ui/text/text.js";
|
10
|
+
import { useGetTrialPricing as S } from "../../api/trial-pricing.js";
|
11
|
+
import { useTrialSessionContext as $ } from "../../context/use-trial-session-context.js";
|
12
|
+
import w from "../slide-header/index.js";
|
13
|
+
import A from "./pricing-cards.js";
|
14
|
+
import { Container as b, PricingWrapper as D, PolicyWrapper as E, RefundImageWrapper as W } from "./pricing-styled.js";
|
15
|
+
const z = P(() => {
|
16
|
+
const { isTeacher: f, studentId: i, updateButtonState: s } = $(), {
|
18
17
|
data: g,
|
19
18
|
get: p,
|
20
|
-
isProcessed:
|
21
|
-
isProcessing:
|
19
|
+
isProcessed: e,
|
20
|
+
isProcessing: t,
|
22
21
|
isProcessingFailed: h
|
23
|
-
} =
|
22
|
+
} = S("trial-v3-pricing", {
|
24
23
|
student_id: i
|
25
|
-
}), { plans:
|
26
|
-
i && !
|
27
|
-
}, [p,
|
28
|
-
return
|
24
|
+
}), { plans: o, intent_level: c } = g || {}, n = x(() => {
|
25
|
+
i && !e && p("trial-v3-pricing", { student_id: i });
|
26
|
+
}, [p, e, i]);
|
27
|
+
return m(() => {
|
29
28
|
n();
|
30
|
-
}, [n]),
|
31
|
-
s("right", { isDisabled:
|
32
|
-
}, [
|
29
|
+
}, [n]), m(() => {
|
30
|
+
s("right", { isDisabled: t, isLoading: !1 });
|
31
|
+
}, [t, f, s]), t ? /* @__PURE__ */ r(I, { height: "100vh" }) : h ? /* @__PURE__ */ r(v, { height: "100vh", onTryAgain: n }) : e ? /* @__PURE__ */ a(b, { children: [
|
33
32
|
/* @__PURE__ */ r(d, { height: 60 }),
|
34
|
-
/* @__PURE__ */ r(
|
35
|
-
/* @__PURE__ */ a(
|
33
|
+
/* @__PURE__ */ r(w, { marginBottom: 38 }),
|
34
|
+
/* @__PURE__ */ a(D, { children: [
|
36
35
|
/* @__PURE__ */ r(
|
37
36
|
C,
|
38
37
|
{
|
@@ -41,22 +40,22 @@ const M = x(() => {
|
|
41
40
|
$justifyContent: "space-between",
|
42
41
|
$flexGap: 20,
|
43
42
|
$flexWrap: !0,
|
44
|
-
children:
|
45
|
-
|
43
|
+
children: c && o && Array.isArray(o) && o.map((u, l) => /* @__PURE__ */ r(
|
44
|
+
A,
|
46
45
|
{
|
47
|
-
colorIndex:
|
46
|
+
colorIndex: l,
|
48
47
|
intentType: c,
|
49
|
-
pricingConfig:
|
48
|
+
pricingConfig: u
|
50
49
|
},
|
51
|
-
|
52
|
-
))
|
50
|
+
l
|
51
|
+
))
|
53
52
|
}
|
54
53
|
),
|
55
54
|
/* @__PURE__ */ r(d, { height: 50 }),
|
56
|
-
/* @__PURE__ */ a(
|
57
|
-
/* @__PURE__ */ r(
|
58
|
-
/* @__PURE__ */ r(
|
59
|
-
|
55
|
+
/* @__PURE__ */ a(E, { children: [
|
56
|
+
/* @__PURE__ */ r(L, { $renderAs: "ab1-bold", $color: "GREEN_6", children: "We have a no-questions-asked refund policy" }),
|
57
|
+
/* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
58
|
+
y,
|
60
59
|
{
|
61
60
|
src: T.REFUND_POLICY,
|
62
61
|
width: 168,
|
@@ -69,6 +68,6 @@ const M = x(() => {
|
|
69
68
|
] }) : null;
|
70
69
|
});
|
71
70
|
export {
|
72
|
-
|
71
|
+
z as default
|
73
72
|
};
|
74
73
|
//# sourceMappingURL=pricing.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricing.js","sources":["../../../../../src/features/trial-session/comps/pricing/pricing.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetTrialPricing } from '../../api/trial-pricing';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport
|
1
|
+
{"version":3,"file":"pricing.js","sources":["../../../../../src/features/trial-session/comps/pricing/pricing.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetTrialPricing } from '../../api/trial-pricing';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport PricingCards from './pricing-cards';\nimport * as Styled from './pricing-styled';\n\nconst SessionPricing = memo(() => {\n const { isTeacher, studentId, updateButtonState } = useTrialSessionContext();\n\n const {\n data: pricingData,\n get: getTrialPricing,\n isProcessed,\n isProcessing,\n isProcessingFailed,\n } = useGetTrialPricing('trial-v3-pricing', {\n student_id: studentId,\n });\n\n const { plans: pricingPlans, intent_level: intentLevel } = pricingData || {};\n const fetchData = useCallback(() => {\n if (studentId && !isProcessed) {\n getTrialPricing('trial-v3-pricing', { student_id: studentId });\n }\n }, [getTrialPricing, isProcessed, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, isTeacher, updateButtonState]);\n\n if (isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error height=\"100vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessed) {\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={38} />\n <Styled.PricingWrapper>\n <FlexView\n $width=\"100%\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $flexGap={20}\n $flexWrap\n >\n {intentLevel &&\n pricingPlans &&\n Array.isArray(pricingPlans) &&\n pricingPlans.map((pricing, index) => {\n return (\n <PricingCards\n key={index}\n colorIndex={index}\n intentType={intentLevel}\n pricingConfig={pricing}\n />\n );\n })}\n </FlexView>\n <Separator height={50} />\n <Styled.PolicyWrapper>\n <Text $renderAs=\"ab1-bold\" $color=\"GREEN_6\">\n We have a no-questions-asked refund policy\n </Text>\n <Styled.RefundImageWrapper>\n <Image\n src={ILLUSTRATIONS.REFUND_POLICY}\n width={168}\n height={100}\n withLoader={false}\n />\n </Styled.RefundImageWrapper>\n </Styled.PolicyWrapper>\n </Styled.PricingWrapper>\n </Styled.Container>\n );\n }\n\n return null;\n});\n\nexport default SessionPricing;\n"],"names":["SessionPricing","memo","isTeacher","studentId","updateButtonState","useTrialSessionContext","pricingData","getTrialPricing","isProcessed","isProcessing","isProcessingFailed","useGetTrialPricing","pricingPlans","intentLevel","fetchData","useCallback","useEffect","jsx","AppLoader","Error","jsxs","Styled.Container","Separator","SlideHeader","Styled.PricingWrapper","FlexView","pricing","index","PricingCards","Styled.PolicyWrapper","Text","Styled.RefundImageWrapper","Image","ILLUSTRATIONS"],"mappings":";;;;;;;;;;;;;;AAeM,MAAAA,IAAiBC,EAAK,MAAM;AAChC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,MAAsBC,EAAuB,GAErE;AAAA,IACJ,MAAMC;AAAA,IACN,KAAKC;AAAA,IACL,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,EAAmB,oBAAoB;AAAA,IACzC,YAAYR;AAAA,EAAA,CACb,GAEK,EAAE,OAAOS,GAAc,cAAcC,EAAY,IAAIP,KAAe,IACpEQ,IAAYC,EAAY,MAAM;AAC9B,IAAAZ,KAAa,CAACK,KAChBD,EAAgB,oBAAoB,EAAE,YAAYJ,EAAW,CAAA;AAAA,EAE9D,GAAA,CAACI,GAAiBC,GAAaL,CAAS,CAAC;AAU5C,SARAa,EAAU,MAAM;A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