@cuemath/leap 3.3.30-beta.1 → 3.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/auth/pla-signup/pla-analytics-events.js +3 -9
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +7 -13
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +30 -32
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +16 -17
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +1 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +4 -8
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +4 -5
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +145 -170
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/class-preference.js +49 -61
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/navigation-bar/index.js +25 -25
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +53 -55
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +43 -44
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +0 -5
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +51 -96
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +63 -70
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +39 -40
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/helper.js +53 -69
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +130 -150
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +112 -103
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/utils/utils.js +1 -1
- package/dist/features/utils/utils.js.map +1 -1
- package/dist/index.d.ts +5 -45
- package/dist/index.js +106 -116
- package/dist/index.js.map +1 -1
- package/dist/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/package.json +3 -2
- package/dist/features/parent-dashboard/api/cancel-subscription.js +0 -9
- package/dist/features/parent-dashboard/api/cancel-subscription.js.map +0 -1
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +0 -20
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +0 -96
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +0 -21
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +0 -85
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +0 -23
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +0 -55
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +0 -59
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +0 -93
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +0 -1
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +0 -66
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +0 -12
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +0 -76
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-constants.js +0 -6
- package/dist/features/student-username/add/add-student-username-constants.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-helpers.js +0 -6
- package/dist/features/student-username/add/add-student-username-helpers.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-styled.js +0 -10
- package/dist/features/student-username/add/add-student-username-styled.js.map +0 -1
- package/dist/features/student-username/add/add-student-username.js +0 -78
- package/dist/features/student-username/add/add-student-username.js.map +0 -1
- package/dist/features/student-username/add/api/update-username.js +0 -9
- package/dist/features/student-username/add/api/update-username.js.map +0 -1
- package/dist/features/student-username/add/api/username-availability.js +0 -10
- package/dist/features/student-username/add/api/username-availability.js.map +0 -1
- package/dist/features/student-username/add/hooks/use-check-username-availability.js +0 -41
- package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +0 -1
- package/dist/features/trial-session/api/teacher-availability.js +0 -9
- package/dist/features/trial-session/api/teacher-availability.js.map +0 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +0 -28
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +0 -1
- package/dist/features/trial-session/hooks/use-slide-config-update.js +0 -49
- package/dist/features/trial-session/hooks/use-slide-config-update.js.map +0 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
- /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent-dashboard-view.js","sources":["../../../src/features/parent-dashboard/parent-dashboard-view.tsx"],"sourcesContent":["import type { ESummaryType, IParentDashboardProps, ISpacingConfig } from './parent-dashboard-types';\n\nimport React, { memo, useMemo, useCallback } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport OnboardingGuide from '../auth/pla-signup/onboarding-guide/onboarding-guide';\nimport SignupHeader from '../auth/pla-signup/signup-header/signup-header';\nimport TeacherProfile from '../trial-session/comps/teacher-intro/teacher-profile/teacher-profile';\nimport Button from '../ui/buttons/button/button';\nimport TextButton from '../ui/buttons/text-button/text-button';\nimport Error from '../ui/error/error';\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 { EDeviceType } from '../ui/theme/constants';\nimport { invalidateParentHome } from './api/parent-home';\nimport BillingInformation from './comps/billing-information/billing-information';\nimport CompactHeader from './comps/compact-header/compact-header';\nimport CuemathAppFeatures from './comps/cuemath-app-features/cuemath-app-features';\nimport MathPractice from './comps/math-practice/math-practice';\nimport NextSteps from './comps/next-steps/next-steps';\nimport ParentDashboardFaqs from './comps/parent-dashboard-faqs/parent-dashboard-faqs';\nimport SessionStatus from './comps/session-status/session-status';\nimport SessionSummary from './comps/session-summary/session-summary';\nimport UpcomingSessions from './comps/upcoming-sessions/upcoming-sessions';\nimport useParentHomeData from './hooks/use-parent-home-data';\nimport useStudentProfileSummaryData from './hooks/use-student-profile-summary-data';\nimport { usePLAModalHandlers } from './modals/hooks/use-pla-model-handlers';\nimport { DESKTOP_SPACING, MOBILE_SPACING } from './parent-dashboard-constants';\nimport * as Styled from './parent-dashboard-styled';\n\nconst ParentDashboardView: React.FC<IParentDashboardProps> = memo(\n ({\n studentName,\n studentId,\n onRescheduleDemo,\n onViewSummary,\n onGetStartedAgain,\n onChangeTutor,\n onSwitchUser,\n HeaderAvatar,\n }) => {\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const parentHomeData = useParentHomeData(studentId);\n const {\n isStudentNoShow,\n isTutorNoShow,\n teacherDetails,\n billingDetails,\n teacherName,\n completedSessions,\n nextSessionStart,\n nextSessionEnd,\n upcomingSessions,\n isTrialDone,\n isOnlyTrialDone,\n isRegularClassDone,\n showLoading = false,\n demoId,\n isProcessingFailed,\n userAttemptId,\n isSubscriptionCancelled,\n canChangeTutor,\n sessionDetails,\n cardOnFileNotAvailable,\n isCardDeclined,\n } = parentHomeData;\n const { summaryInfo, fetchSummaryData } = useStudentProfileSummaryData(studentId);\n\n const spacing = useMemo<ISpacingConfig>(\n () => (isMobile ? MOBILE_SPACING : DESKTOP_SPACING),\n [isMobile],\n );\n\n const buttonWidth = useMemo(() => (isMobile ? '100%' : 200), [isMobile]);\n\n const handleTryAgain = useCallback(() => {\n invalidateParentHome(studentId);\n fetchSummaryData();\n }, [fetchSummaryData, studentId]);\n\n const { onCancelSubscription, onViewPaymentMethod } = usePLAModalHandlers({\n demoId,\n studentId,\n studentName,\n billingDetails,\n completedSessions,\n withTutor: !!teacherName,\n onRescheduleDemo,\n onChangeTutor,\n });\n\n const handleRescheduleDemo = useCallback(() => {\n onRescheduleDemo(demoId);\n }, [demoId, onRescheduleDemo]);\n\n const handleChangeTutor = useCallback(() => {\n onChangeTutor(demoId);\n }, [demoId, onChangeTutor]);\n\n const handleViewSummary = useCallback(\n (key: ESummaryType) => {\n onViewSummary?.(key, { ...summaryInfo, userAttemptId: userAttemptId ?? null });\n },\n [onViewSummary, summaryInfo, userAttemptId],\n );\n\n const sessionStatusProps = useMemo(\n () => ({\n completedSessions,\n nextSessionStartTime: nextSessionStart,\n teacherName,\n isTutorNoShow,\n isStudentNoShow,\n nextSessionEndTime: nextSessionEnd,\n studentName,\n onRescheduleClick: handleRescheduleDemo,\n isTrialDone,\n isOnlyTrialDone,\n }),\n [\n completedSessions,\n nextSessionStart,\n teacherName,\n isTutorNoShow,\n isStudentNoShow,\n nextSessionEnd,\n studentName,\n handleRescheduleDemo,\n isTrialDone,\n isOnlyTrialDone,\n ],\n );\n\n const sessionSummaryProps = useMemo(\n () => ({\n isTrialDone,\n studentName,\n onViewSummary: handleViewSummary,\n }),\n [isTrialDone, studentName, handleViewSummary],\n );\n\n const CancelledSubscriptionView = useMemo(\n () => (\n <FlexView>\n <SignupHeader />\n <Separator height={spacing.separator.extraLarge} />\n <OnboardingGuide orientation=\"horizontal\" />\n {onGetStartedAgain && (\n <FlexView>\n <Separator height={spacing.medium} />\n <Button\n label=\"Get Started\"\n renderAs=\"yellow-dark\"\n shape=\"square\"\n size=\"small\"\n width={buttonWidth}\n onClick={onGetStartedAgain}\n />\n </FlexView>\n )}\n </FlexView>\n ),\n [spacing, buttonWidth, onGetStartedAgain],\n );\n\n const SessionStatusSection = useMemo(\n () => <SessionStatus {...sessionStatusProps} />,\n [sessionStatusProps],\n );\n\n const TeacherProfileSection = useMemo(() => {\n if (!teacherDetails || isTrialDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.large} />\n <TeacherProfile teacherProfile={teacherDetails} />\n </FlexView>\n );\n }, [teacherDetails, isTrialDone, spacing.separator.large]);\n\n const SessionSummarySection = useMemo(() => {\n if (isRegularClassDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <SessionSummary {...sessionSummaryProps} />\n </FlexView>\n );\n }, [isRegularClassDone, spacing.separator.extraLarge, sessionSummaryProps]);\n\n const TutorChangeSection = useMemo(() => {\n if (!canChangeTutor) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.small} />\n <FlexView $flexDirection=\"row\" $flexColumnGapX={0.25}>\n <Text $renderAs=\"ub1\" $renderOnMobileAs=\"ub2\" $color=\"WHITE\">\n Not the right fit for your child?\n </Text>\n <TextButton\n color=\"WHITE_1\"\n sizeOnMobile=\"small\"\n label=\"Try another tutor\"\n onClick={handleChangeTutor}\n />\n </FlexView>\n </FlexView>\n );\n }, [canChangeTutor, spacing.separator.small, handleChangeTutor]);\n\n const TeacherDetailsSection = useMemo(() => {\n if (!teacherDetails) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n Know your tutor\n </Text>\n <Separator height={spacing.separator.medium} />\n <TeacherProfile teacherProfile={teacherDetails} />\n {TutorChangeSection}\n </FlexView>\n );\n }, [teacherDetails, spacing.separator, TutorChangeSection]);\n\n const OnlyTrialDoneSection = useMemo(() => {\n if (!isOnlyTrialDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <NextSteps />\n <UpcomingSessions sessions={upcomingSessions} />\n {TeacherDetailsSection}\n </FlexView>\n );\n }, [isOnlyTrialDone, spacing.separator.extraLarge, upcomingSessions, TeacherDetailsSection]);\n\n const AppFeaturesSection = useMemo(() => {\n if (!isTrialDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <CuemathAppFeatures />\n </FlexView>\n );\n }, [isTrialDone, spacing.separator.extraLarge]);\n\n const MathPracticeSection = useMemo(() => {\n if (isRegularClassDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <Styled.MathPracticeWrapper>\n <MathPractice onSwitchUser={onSwitchUser} />\n </Styled.MathPracticeWrapper>\n </FlexView>\n );\n }, [isRegularClassDone, spacing.separator.extraLarge, onSwitchUser]);\n\n const BillingInformationSection = useMemo(() => {\n if (!billingDetails) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <BillingInformation\n billingDetails={billingDetails}\n onViewPaymentMethod={onViewPaymentMethod}\n onCancelSubscription={onCancelSubscription}\n />\n </FlexView>\n );\n }, [billingDetails, spacing.separator.extraLarge, onViewPaymentMethod, onCancelSubscription]);\n\n const MainContent = useMemo(\n () => (\n <FlexView>\n {SessionStatusSection}\n {TeacherProfileSection}\n {SessionSummarySection}\n {OnlyTrialDoneSection}\n {AppFeaturesSection}\n {MathPracticeSection}\n {BillingInformationSection}\n </FlexView>\n ),\n [\n SessionStatusSection,\n TeacherProfileSection,\n SessionSummarySection,\n OnlyTrialDoneSection,\n AppFeaturesSection,\n MathPracticeSection,\n BillingInformationSection,\n ],\n );\n\n const FaqsSection = useMemo(\n () => (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <ParentDashboardFaqs />\n <Separator height={spacing.separator.extraLarge} />\n </FlexView>\n ),\n [spacing.separator.extraLarge],\n );\n\n const isLoading = useMemo(() => {\n return isCardDeclined || cardOnFileNotAvailable || !sessionDetails || showLoading;\n }, [cardOnFileNotAvailable, isCardDeclined, sessionDetails, showLoading]);\n\n if (isLoading) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error theme=\"dark\" onTryAgain={handleTryAgain} />\n </FlexView>\n );\n }\n\n return (\n <Styled.Container>\n <CompactHeader HeaderAvatar={HeaderAvatar} />\n <Styled.ContentWrapper\n $flex={1}\n $width=\"100%\"\n $height=\"100%\"\n $background=\"BLACK_1\"\n $gap={spacing.medium}\n $gutter={spacing.small}\n >\n {isSubscriptionCancelled ? CancelledSubscriptionView : MainContent}\n {FaqsSection}\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n },\n);\n\nexport default ParentDashboardView;\n"],"names":["ParentDashboardView","memo","studentName","studentId","onRescheduleDemo","onViewSummary","onGetStartedAgain","onChangeTutor","onSwitchUser","HeaderAvatar","device","useTheme","isMobile","EDeviceType","parentHomeData","useParentHomeData","isStudentNoShow","isTutorNoShow","teacherDetails","billingDetails","teacherName","completedSessions","nextSessionStart","nextSessionEnd","upcomingSessions","isTrialDone","isOnlyTrialDone","isRegularClassDone","showLoading","demoId","isProcessingFailed","userAttemptId","isSubscriptionCancelled","canChangeTutor","sessionDetails","cardOnFileNotAvailable","isCardDeclined","summaryInfo","fetchSummaryData","useStudentProfileSummaryData","spacing","useMemo","MOBILE_SPACING","DESKTOP_SPACING","buttonWidth","handleTryAgain","useCallback","invalidateParentHome","onCancelSubscription","onViewPaymentMethod","usePLAModalHandlers","handleRescheduleDemo","handleChangeTutor","handleViewSummary","key","sessionStatusProps","sessionSummaryProps","CancelledSubscriptionView","FlexView","jsx","SignupHeader","Separator","OnboardingGuide","Button","SessionStatusSection","SessionStatus","TeacherProfileSection","TeacherProfile","SessionSummarySection","SessionSummary","TutorChangeSection","jsxs","Text","TextButton","TeacherDetailsSection","OnlyTrialDoneSection","NextSteps","UpcomingSessions","AppFeaturesSection","CuemathAppFeatures","MathPracticeSection","Styled.MathPracticeWrapper","MathPractice","BillingInformationSection","BillingInformation","MainContent","FaqsSection","ParentDashboardFaqs","AppLoader","Error","Styled.Container","CompactHeader","Styled.ContentWrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAMA,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,MACI;AACE,UAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,MAAUG,GAAY,QAEjCC,KAAiBC,GAAkBZ,CAAS,GAC5C;AAAA,MACJ,iBAAAa;AAAA,MACA,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,aAAAC,IAAc;AAAA,MACd,QAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,yBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,gBAAAC;AAAA,IACE,IAAAtB,IACE,EAAE,aAAAuB,GAAa,kBAAAC,EAAiB,IAAIC,GAA6BpC,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;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
1
|
+
{"version":3,"file":"parent-dashboard-view.js","sources":["../../../src/features/parent-dashboard/parent-dashboard-view.tsx"],"sourcesContent":["import type { ESummaryType, IParentDashboardProps, ISpacingConfig } from './parent-dashboard-types';\n\nimport React, { memo, useMemo, useCallback } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport OnboardingGuide from '../auth/pla-signup/onboarding-guide/onboarding-guide';\nimport SignupHeader from '../auth/pla-signup/signup-header/signup-header';\nimport TeacherProfile from '../trial-session/comps/teacher-intro/teacher-profile/teacher-profile';\nimport Button from '../ui/buttons/button/button';\nimport TextButton from '../ui/buttons/text-button/text-button';\nimport Error from '../ui/error/error';\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 { EDeviceType } from '../ui/theme/constants';\nimport { invalidateParentHome } from './api/parent-home';\nimport CompactHeader from './comps/compact-header/compact-header';\nimport CuemathAppFeatures from './comps/cuemath-app-features/cuemath-app-features';\nimport MathPractice from './comps/math-practice/math-practice';\nimport NextSteps from './comps/next-steps/next-steps';\nimport ParentDashboardFaqs from './comps/parent-dashboard-faqs/parent-dashboard-faqs';\nimport SessionStatus from './comps/session-status/session-status';\nimport SessionSummary from './comps/session-summary/session-summary';\nimport UpcomingSessions from './comps/upcoming-sessions/upcoming-sessions';\nimport useParentHomeData from './hooks/use-parent-home-data';\nimport useStudentProfileSummaryData from './hooks/use-student-profile-summary-data';\nimport { DESKTOP_SPACING, MOBILE_SPACING } from './parent-dashboard-constants';\nimport * as Styled from './parent-dashboard-styled';\n\nconst ParentDashboardView: React.FC<IParentDashboardProps> = memo(\n ({\n studentName,\n studentId,\n onRescheduleDemo,\n onViewSummary,\n onGetStartedAgain,\n onChangeTutor,\n onSwitchUser,\n HeaderAvatar,\n }) => {\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const parentHomeData = useParentHomeData(studentId);\n const {\n isStudentNoShow,\n isTutorNoShow,\n teacherDetails,\n teacherName,\n completedSessions,\n nextSessionStart,\n nextSessionEnd,\n upcomingSessions,\n isTrialDone,\n isOnlyTrialDone,\n isRegularClassDone,\n showLoading = false,\n demoId,\n isProcessingFailed,\n userAttemptId,\n isSubscriptionCancelled,\n canChangeTutor,\n sessionDetails,\n cardOnFileNotAvailable,\n isCardDeclined,\n } = parentHomeData;\n const { summaryInfo, fetchSummaryData } = useStudentProfileSummaryData(studentId);\n\n const spacing = useMemo<ISpacingConfig>(\n () => (isMobile ? MOBILE_SPACING : DESKTOP_SPACING),\n [isMobile],\n );\n\n const buttonWidth = useMemo(() => (isMobile ? '100%' : 200), [isMobile]);\n\n const handleTryAgain = useCallback(() => {\n invalidateParentHome(studentId);\n fetchSummaryData();\n }, [fetchSummaryData, studentId]);\n\n const handleRescheduleDemo = useCallback(() => {\n onRescheduleDemo(demoId);\n }, [demoId, onRescheduleDemo]);\n\n const handleChangeTutor = useCallback(() => {\n onChangeTutor(demoId);\n }, [demoId, onChangeTutor]);\n\n const handleViewSummary = useCallback(\n (key: ESummaryType) => {\n onViewSummary?.(key, { ...summaryInfo, userAttemptId: userAttemptId ?? null });\n },\n [onViewSummary, summaryInfo, userAttemptId],\n );\n\n const sessionStatusProps = useMemo(\n () => ({\n completedSessions,\n nextSessionStartTime: nextSessionStart,\n teacherName,\n isTutorNoShow,\n isStudentNoShow,\n nextSessionEndTime: nextSessionEnd,\n studentName,\n onRescheduleClick: handleRescheduleDemo,\n isTrialDone,\n isOnlyTrialDone,\n }),\n [\n completedSessions,\n nextSessionStart,\n teacherName,\n isTutorNoShow,\n isStudentNoShow,\n nextSessionEnd,\n studentName,\n handleRescheduleDemo,\n isTrialDone,\n isOnlyTrialDone,\n ],\n );\n\n const sessionSummaryProps = useMemo(\n () => ({\n isTrialDone,\n studentName,\n onViewSummary: handleViewSummary,\n }),\n [isTrialDone, studentName, handleViewSummary],\n );\n\n const CancelledSubscriptionView = useMemo(\n () => (\n <FlexView>\n <SignupHeader />\n <Separator height={spacing.separator.extraLarge} />\n <OnboardingGuide orientation=\"horizontal\" />\n {onGetStartedAgain && (\n <FlexView>\n <Separator height={spacing.medium} />\n <Button\n label=\"Get Started\"\n renderAs=\"yellow-dark\"\n shape=\"square\"\n size=\"small\"\n width={buttonWidth}\n onClick={onGetStartedAgain}\n />\n </FlexView>\n )}\n </FlexView>\n ),\n [spacing, buttonWidth, onGetStartedAgain],\n );\n\n const SessionStatusSection = useMemo(\n () => <SessionStatus {...sessionStatusProps} />,\n [sessionStatusProps],\n );\n\n const TeacherProfileSection = useMemo(() => {\n if (!teacherDetails || isTrialDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.large} />\n <TeacherProfile teacherProfile={teacherDetails} />\n </FlexView>\n );\n }, [teacherDetails, isTrialDone, spacing.separator.large]);\n\n const SessionSummarySection = useMemo(() => {\n if (isRegularClassDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <SessionSummary {...sessionSummaryProps} />\n </FlexView>\n );\n }, [isRegularClassDone, spacing.separator.extraLarge, sessionSummaryProps]);\n\n const TutorChangeSection = useMemo(() => {\n if (!canChangeTutor) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.small} />\n <FlexView $flexDirection=\"row\" $flexColumnGapX={0.25}>\n <Text $renderAs=\"ub1\" $renderOnMobileAs=\"ub2\" $color=\"WHITE\">\n Not the right fit for your child?\n </Text>\n <TextButton\n color=\"WHITE_1\"\n sizeOnMobile=\"small\"\n label=\"Try another tutor\"\n onClick={handleChangeTutor}\n />\n </FlexView>\n </FlexView>\n );\n }, [canChangeTutor, spacing.separator.small, handleChangeTutor]);\n\n const TeacherDetailsSection = useMemo(() => {\n if (!teacherDetails) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n Know your tutor\n </Text>\n <Separator height={spacing.separator.medium} />\n <TeacherProfile teacherProfile={teacherDetails} />\n {TutorChangeSection}\n </FlexView>\n );\n }, [teacherDetails, spacing.separator, TutorChangeSection]);\n\n const OnlyTrialDoneSection = useMemo(() => {\n if (!isOnlyTrialDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <NextSteps />\n <UpcomingSessions sessions={upcomingSessions} />\n {TeacherDetailsSection}\n </FlexView>\n );\n }, [isOnlyTrialDone, spacing.separator.extraLarge, upcomingSessions, TeacherDetailsSection]);\n\n const AppFeaturesSection = useMemo(() => {\n if (!isTrialDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <CuemathAppFeatures />\n </FlexView>\n );\n }, [isTrialDone, spacing.separator.extraLarge]);\n\n const MathPracticeSection = useMemo(() => {\n if (isRegularClassDone) return null;\n\n return (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <Styled.MathPracticeWrapper>\n <MathPractice onSwitchUser={onSwitchUser} />\n </Styled.MathPracticeWrapper>\n </FlexView>\n );\n }, [isRegularClassDone, spacing.separator.extraLarge, onSwitchUser]);\n\n const MainContent = useMemo(\n () => (\n <FlexView>\n {SessionStatusSection}\n {TeacherProfileSection}\n {SessionSummarySection}\n {OnlyTrialDoneSection}\n {AppFeaturesSection}\n {MathPracticeSection}\n </FlexView>\n ),\n [\n SessionStatusSection,\n TeacherProfileSection,\n SessionSummarySection,\n OnlyTrialDoneSection,\n AppFeaturesSection,\n MathPracticeSection,\n ],\n );\n\n const FaqsSection = useMemo(\n () => (\n <FlexView>\n <Separator height={spacing.separator.extraLarge} />\n <ParentDashboardFaqs />\n </FlexView>\n ),\n [spacing.separator.extraLarge],\n );\n\n const isLoading = useMemo(() => {\n return isCardDeclined || cardOnFileNotAvailable || !sessionDetails || showLoading;\n }, [cardOnFileNotAvailable, isCardDeclined, sessionDetails, showLoading]);\n\n if (isLoading) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error theme=\"dark\" onTryAgain={handleTryAgain} />\n </FlexView>\n );\n }\n\n return (\n <Styled.Container>\n <CompactHeader HeaderAvatar={HeaderAvatar} />\n <Styled.ContentWrapper\n $flex={1}\n $width=\"100%\"\n $height=\"100%\"\n $background=\"BLACK_1\"\n $gap={spacing.medium}\n $gutter={spacing.small}\n >\n {isSubscriptionCancelled ? CancelledSubscriptionView : MainContent}\n {FaqsSection}\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n },\n);\n\nexport default ParentDashboardView;\n"],"names":["ParentDashboardView","memo","studentName","studentId","onRescheduleDemo","onViewSummary","onGetStartedAgain","onChangeTutor","onSwitchUser","HeaderAvatar","device","useTheme","isMobile","EDeviceType","parentHomeData","useParentHomeData","isStudentNoShow","isTutorNoShow","teacherDetails","teacherName","completedSessions","nextSessionStart","nextSessionEnd","upcomingSessions","isTrialDone","isOnlyTrialDone","isRegularClassDone","showLoading","demoId","isProcessingFailed","userAttemptId","isSubscriptionCancelled","canChangeTutor","sessionDetails","cardOnFileNotAvailable","isCardDeclined","summaryInfo","fetchSummaryData","useStudentProfileSummaryData","spacing","useMemo","MOBILE_SPACING","DESKTOP_SPACING","buttonWidth","handleTryAgain","useCallback","invalidateParentHome","handleRescheduleDemo","handleChangeTutor","handleViewSummary","key","sessionStatusProps","sessionSummaryProps","CancelledSubscriptionView","FlexView","jsx","SignupHeader","Separator","OnboardingGuide","Button","SessionStatusSection","SessionStatus","TeacherProfileSection","TeacherProfile","SessionSummarySection","SessionSummary","TutorChangeSection","jsxs","Text","TextButton","TeacherDetailsSection","OnlyTrialDoneSection","NextSteps","UpcomingSessions","AppFeaturesSection","CuemathAppFeatures","MathPracticeSection","Styled.MathPracticeWrapper","MathPractice","MainContent","FaqsSection","ParentDashboardFaqs","AppLoader","Error","Styled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UACP,SAAQ;AAAA,UACR,aAAY;AAAA,UACZ,MAAM/C,EAAQ;AAAA,UACd,SAASA,EAAQ;AAAA,UAEhB,UAAA;AAAA,YAAAR,KAA0BsB,KAA4B0B;AAAA,YACtDC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -1,61 +1,49 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useCallback as O, useEffect as w } from "react";
|
|
3
3
|
import { DAYS as f } from "../../../../constants/date-time.js";
|
|
4
|
-
import { getTimeUnits as
|
|
5
|
-
import
|
|
4
|
+
import { getTimeUnits as j, getOffsetBetweenTimezone as v, convertEpochToDateTime as g, convertToMilliseconds as H } from "../../../../helpers/date-time.js";
|
|
5
|
+
import $ from "../../../ui/inputs/select-input/select-input.js";
|
|
6
6
|
import u from "../../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useTrialSessionContext as
|
|
10
|
-
import { TEACHER_TIMEZONE as
|
|
11
|
-
import
|
|
12
|
-
import { timeSlots as
|
|
13
|
-
import { Container as
|
|
14
|
-
|
|
15
|
-
const h = [
|
|
7
|
+
import P from "../../../ui/separator/separator.js";
|
|
8
|
+
import W from "../../../ui/text/text.js";
|
|
9
|
+
import { useTrialSessionContext as z } from "../../context/use-trial-session-context.js";
|
|
10
|
+
import { TEACHER_TIMEZONE as y } from "../../trial-session-constants.js";
|
|
11
|
+
import B from "../slide-header/index.js";
|
|
12
|
+
import { timeSlots as Y } from "./class-preference-constants.js";
|
|
13
|
+
import { Container as F, PreferenceWrapper as K, FixedLineSeparator as M } from "./class-preference-styled.js";
|
|
14
|
+
const C = [
|
|
16
15
|
{ id: 1, selectedDay: "", selectedTime: "" },
|
|
17
16
|
{ id: 2, selectedDay: "", selectedTime: "" }
|
|
18
|
-
],
|
|
19
|
-
const { isTeacher:
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
), D = (e, t, s) => {
|
|
23
|
-
T({
|
|
24
|
-
preferences: (m ?? h).map(
|
|
17
|
+
], se = A(({ miniScreenDevice: D }) => {
|
|
18
|
+
const { isTeacher: n, formData: x, updateSlideConfig: p } = z(), { preferences: o, studentTimezone: c } = x || {}, b = f.map((e) => ({ id: e, label: e })), h = n ? y : c, T = (e, t, s) => {
|
|
19
|
+
p({
|
|
20
|
+
preferences: (o ?? C).map(
|
|
25
21
|
(r) => r.id === e ? { ...r, [t]: s } : r
|
|
26
22
|
)
|
|
27
23
|
});
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
24
|
+
}, _ = (e, t) => {
|
|
25
|
+
T(e, "selectedDay", t);
|
|
26
|
+
}, S = (e, t) => {
|
|
27
|
+
T(e, "selectedTime", t);
|
|
28
|
+
}, E = O(
|
|
33
29
|
(e, t) => {
|
|
34
|
-
if (e && t &&
|
|
35
|
-
const { hours: s, minutes: r } =
|
|
36
|
-
return
|
|
30
|
+
if (e && t && c) {
|
|
31
|
+
const { hours: s, minutes: r } = j(t), m = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), l = v(y, c), i = n ? m + l : m, { day: L = "" } = g(i, c), I = f.indexOf(L), X = (f.indexOf(e) - I + 7) % 7, k = i + H({ days: X, hours: s, minutes: r });
|
|
32
|
+
return g(k, h);
|
|
37
33
|
}
|
|
38
34
|
return {};
|
|
39
35
|
},
|
|
40
|
-
[
|
|
36
|
+
[n, c, h]
|
|
41
37
|
);
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
selectedDay: l.day,
|
|
48
|
-
selectedTime: l.time
|
|
49
|
-
} : e
|
|
50
|
-
) : h
|
|
51
|
-
});
|
|
52
|
-
}, [l]), /* @__PURE__ */ d(R, { children: [
|
|
53
|
-
/* @__PURE__ */ i(M, { height: 60 }),
|
|
54
|
-
/* @__PURE__ */ i(G, {}),
|
|
38
|
+
return w(() => {
|
|
39
|
+
n && !o && p({ preferences: C });
|
|
40
|
+
}, [n, o, p]), /* @__PURE__ */ d(F, { children: [
|
|
41
|
+
/* @__PURE__ */ a(P, { height: 60 }),
|
|
42
|
+
/* @__PURE__ */ a(B, {}),
|
|
55
43
|
/* @__PURE__ */ d(
|
|
56
|
-
|
|
44
|
+
K,
|
|
57
45
|
{
|
|
58
|
-
$gapX:
|
|
46
|
+
$gapX: D ? 2.2 : 3.75,
|
|
59
47
|
$gutterX: 4.6875,
|
|
60
48
|
$background: "YELLOW_4",
|
|
61
49
|
$borderColor: "BLACK_1",
|
|
@@ -63,51 +51,51 @@ const h = [
|
|
|
63
51
|
$justifyContent: "space-between",
|
|
64
52
|
$alignItems: "center",
|
|
65
53
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
const { id: t, selectedDay: s, selectedTime: r } = e, { day:
|
|
54
|
+
/* @__PURE__ */ a(M, {}),
|
|
55
|
+
o == null ? void 0 : o.map((e) => {
|
|
56
|
+
const { id: t, selectedDay: s, selectedTime: r } = e, { day: m, time: l } = E(s, r);
|
|
69
57
|
return /* @__PURE__ */ d(u, { $widthX: 15, $background: "YELLOW_1", $borderColor: "BLACK_1", children: [
|
|
70
58
|
/* @__PURE__ */ d(u, { $gapX: 1.65, $gutterX: 2, $flexGapX: 0.25, children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
59
|
+
/* @__PURE__ */ a(
|
|
60
|
+
$,
|
|
73
61
|
{
|
|
74
62
|
renderAs: "primary",
|
|
75
63
|
label: `Day ${t}`,
|
|
76
64
|
value: s,
|
|
77
|
-
options:
|
|
65
|
+
options: b,
|
|
78
66
|
theme: "dark",
|
|
79
67
|
shape: "borderLess",
|
|
80
68
|
isTransparent: !0,
|
|
81
|
-
onChange: (
|
|
69
|
+
onChange: (i) => _(t, i)
|
|
82
70
|
}
|
|
83
71
|
),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
72
|
+
/* @__PURE__ */ a(
|
|
73
|
+
$,
|
|
86
74
|
{
|
|
87
75
|
renderAs: "primary",
|
|
88
76
|
label: "Time",
|
|
89
77
|
value: r,
|
|
90
|
-
options:
|
|
78
|
+
options: Y,
|
|
91
79
|
shape: "borderLess",
|
|
92
80
|
isTransparent: !0,
|
|
93
81
|
theme: "dark",
|
|
94
|
-
onChange: (
|
|
82
|
+
onChange: (i) => S(t, i)
|
|
95
83
|
}
|
|
96
84
|
)
|
|
97
85
|
] }),
|
|
98
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ a(
|
|
99
87
|
u,
|
|
100
88
|
{
|
|
101
89
|
$heightX: 3.125,
|
|
102
90
|
$gutterX: 2,
|
|
103
91
|
$justifyContent: "center",
|
|
104
92
|
$background: "WHITE_T_60",
|
|
105
|
-
children:
|
|
106
|
-
|
|
93
|
+
children: n ? /* @__PURE__ */ d(W, { $renderAs: "ac4-black", $align: "center", children: [
|
|
94
|
+
m ? m.slice(0, 3) : "__",
|
|
107
95
|
", ",
|
|
108
|
-
|
|
96
|
+
l || "__",
|
|
109
97
|
" ",
|
|
110
|
-
|
|
98
|
+
n ? "(IST)" : ""
|
|
111
99
|
] }) : null
|
|
112
100
|
}
|
|
113
101
|
)
|
|
@@ -119,6 +107,6 @@ const h = [
|
|
|
119
107
|
] });
|
|
120
108
|
});
|
|
121
109
|
export {
|
|
122
|
-
|
|
110
|
+
se as default
|
|
123
111
|
};
|
|
124
112
|
//# sourceMappingURL=class-preference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\nimport { extractDayAndTimeFromEpoch } from './helpers';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, trialHomeData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone = 'Asia/Calcutta' } = formData || {};\n const { demo_info: demoInfo } = trialHomeData || {};\n const { scheduled_start_time: scheduledStartTime } = demoInfo || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const preSelectedDateTimeFromEpoch = useMemo(\n () => (isTeacher ? extractDayAndTimeFromEpoch(scheduledStartTime, studentTimezone) : undefined),\n [isTeacher, scheduledStartTime, studentTimezone],\n );\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({\n preferences: preSelectedDateTimeFromEpoch\n ? defaultPreferences.map((preference: TPreference) =>\n preference.id === 1\n ? {\n ...preference,\n selectedDay: preSelectedDateTimeFromEpoch.day,\n selectedTime: preSelectedDateTimeFromEpoch.time,\n }\n : preference,\n )\n : defaultPreferences,\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [preSelectedDateTimeFromEpoch]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","trialHomeData","updateSlideConfig","useTrialSessionContext","preferences","studentTimezone","demoInfo","scheduledStartTime","daySlots","DAYS","day","timezone","teacherTimezone","preSelectedDateTimeFromEpoch","useMemo","extractDayAndTimeFromEpoch","handlePreferenceChange","id","field","value","preference","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.PreferenceWrapper","Styled.FixedLineSeparator","selectedDay","selectedTime","time","FlexView","SelectInput","timeSlots","Text"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,IAAqB;AAAA,EACzB,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zB;AAAA,UAAA;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone } = formData || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({ preferences: defaultPreferences });\n }\n }, [isTeacher, preferences, updateSlideConfig]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","updateSlideConfig","useTrialSessionContext","preferences","studentTimezone","daySlots","DAYS","day","timezone","teacherTimezone","handlePreferenceChange","id","field","value","preference","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.PreferenceWrapper","Styled.FixedLineSeparator","selectedDay","selectedTime","time","FlexView","SelectInput","timeSlots","Text"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAqB;AAAA,EACzB,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAAA,EAC3C,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAC7C,GAEMC,KAAwCC,EAAK,CAAC,EAAE,kBAAAC,QAAuB;AAC3E,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,MAAsBC,EAAuB,GACpE,EAAE,aAAAC,GAAa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AAAA,oBACT,OAAM;AAAA,oBACN,eAAa;AAAA,oBACb,OAAM;AAAA,oBACN,UAAU,CAAAlC,MAASG,EAAiBL,GAAIE,CAAK;AAAA,kBAAA;AAAA,gBAC/C;AAAA,cAAA,GACF;AAAA,cACA,gBAAAwB;AAAA,gBAACQ;AAAA,gBAAA;AAAA,kBACC,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,iBAAgB;AAAA,kBAChB,aAAY;AAAA,kBAEX,cACE,gBAAAV,EAAAa,GAAA,EAAK,WAAU,aAAY,QAAO,UAChC,UAAA;AAAA,oBAAAzC,IAAMA,EAAI,MAAM,GAAG,CAAC,IAAI;AAAA,oBAAK;AAAA,oBAAGqC,KAAc;AAAA,oBAAK;AAAA,oBAAE7C,IAAY,UAAU;AAAA,kBAAA,EAAA,CAC9E,IACE;AAAA,gBAAA;AAAA,cACN;AAAA,YAlCa,EAAA,GAAA,QAAQY,CAAE,EAmCzB;AAAA,UAAA;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as l } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import y from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
4
|
+
import A from "../../../ui/buttons/button/button.js";
|
|
5
5
|
import d from "../../../ui/buttons/icon-button/icon-button.js";
|
|
6
6
|
import c from "../../../ui/layout/flex-view.js";
|
|
7
7
|
import m from "../../../ui/text/text.js";
|
|
8
|
-
import { useTrialSessionContext as
|
|
9
|
-
import { useTrialSessionNavigation as
|
|
10
|
-
import { Container as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
const { slideConfig: p, buttonState: f, openEndClassModal:
|
|
14
|
-
left: { isDisabled: g, isLoading:
|
|
15
|
-
right: { isDisabled: x, isLoading:
|
|
16
|
-
} = f || {}, { prevPage:
|
|
8
|
+
import { useTrialSessionContext as v } from "../../context/use-trial-session-context.js";
|
|
9
|
+
import { useTrialSessionNavigation as w } from "../../hooks/use-trial-session-navigation.js";
|
|
10
|
+
import { Container as D, ForwardArrow as j } from "./navigation-bar-styled.js";
|
|
11
|
+
import P from "../../../../assets/line-icons/icons/back2.js";
|
|
12
|
+
const q = () => {
|
|
13
|
+
const { slideConfig: p, buttonState: f, openEndClassModal: b, studentAbsentInClass: a } = v(), {
|
|
14
|
+
left: { isDisabled: g, isLoading: u },
|
|
15
|
+
right: { isDisabled: x, isLoading: h }
|
|
16
|
+
} = f || {}, { prevPage: L, nextPage: $ } = p || {}, { buttonLabel: i, pageId: t } = L || {}, { buttonLabel: r, pageId: n } = $ || {}, { handleNavigation: o } = w(), C = t && !n, I = l(() => {
|
|
17
17
|
o("next", n);
|
|
18
|
-
}, [o, n]),
|
|
18
|
+
}, [o, n]), B = l(() => {
|
|
19
19
|
o("prev", t);
|
|
20
20
|
}, [o, t]);
|
|
21
21
|
return /* @__PURE__ */ s(
|
|
22
|
-
|
|
22
|
+
D,
|
|
23
23
|
{
|
|
24
24
|
$flexDirection: "row-reverse",
|
|
25
25
|
$justifyContent: "space-between",
|
|
26
26
|
$alignItems: "center",
|
|
27
27
|
children: [
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
C && /* @__PURE__ */ e(
|
|
29
|
+
A,
|
|
30
30
|
{
|
|
31
31
|
renderAs: "tertiary",
|
|
32
32
|
size: "small",
|
|
33
|
-
label:
|
|
33
|
+
label: "End the class",
|
|
34
34
|
shape: "square",
|
|
35
|
-
onClick:
|
|
35
|
+
onClick: b
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
38
|
n && r && /* @__PURE__ */ s(c, { $flexDirection: "row", $alignItems: "center", $justifyContent: "center", $flexGap: 12, children: [
|
|
39
39
|
/* @__PURE__ */ e(m, { $renderAs: "ab2", $color: "BLACK_T_60", children: r }),
|
|
40
40
|
/* @__PURE__ */ e(
|
|
41
|
-
|
|
41
|
+
y,
|
|
42
42
|
{
|
|
43
43
|
widthX: 8,
|
|
44
44
|
zIndex: 2,
|
|
@@ -49,13 +49,13 @@ const W = () => {
|
|
|
49
49
|
children: /* @__PURE__ */ e(
|
|
50
50
|
d,
|
|
51
51
|
{
|
|
52
|
-
Icon:
|
|
52
|
+
Icon: j,
|
|
53
53
|
renderAs: "primary",
|
|
54
54
|
analyticsLabel: r,
|
|
55
55
|
size: "small",
|
|
56
|
-
onClick:
|
|
56
|
+
onClick: I,
|
|
57
57
|
disabled: x || a,
|
|
58
|
-
busy:
|
|
58
|
+
busy: h
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
}
|
|
@@ -65,13 +65,13 @@ const W = () => {
|
|
|
65
65
|
/* @__PURE__ */ e(
|
|
66
66
|
d,
|
|
67
67
|
{
|
|
68
|
-
Icon:
|
|
68
|
+
Icon: P,
|
|
69
69
|
renderAs: "secondary",
|
|
70
70
|
analyticsLabel: i,
|
|
71
71
|
size: "small",
|
|
72
|
-
onClick:
|
|
72
|
+
onClick: B,
|
|
73
73
|
disabled: g,
|
|
74
|
-
busy:
|
|
74
|
+
busy: u
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
77
|
/* @__PURE__ */ e(m, { $renderAs: "ab2", $color: "BLACK_T_60", children: i })
|
|
@@ -81,6 +81,6 @@ const W = () => {
|
|
|
81
81
|
);
|
|
82
82
|
};
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
q as default
|
|
85
85
|
};
|
|
86
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/navigation-bar/index.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { useTrialSessionNavigation } from '../../hooks/use-trial-session-navigation';\nimport * as Styled from './navigation-bar-styled';\n\nconst NavigationBar: React.FC = () => {\n const { slideConfig, buttonState, openEndClassModal, studentAbsentInClass
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/navigation-bar/index.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { useTrialSessionNavigation } from '../../hooks/use-trial-session-navigation';\nimport * as Styled from './navigation-bar-styled';\n\nconst NavigationBar: React.FC = () => {\n const { slideConfig, buttonState, openEndClassModal, studentAbsentInClass } =\n useTrialSessionContext();\n const {\n left: { isDisabled: isLeftBtnDisabled, isLoading: isLeftBtnLoading },\n right: { isDisabled: isRightBtnDisabled, isLoading: isRightBtnLoading },\n } = buttonState || {};\n const { prevPage, nextPage } = slideConfig || {};\n const { buttonLabel: prevButtonLabel, pageId: prevPageId } = prevPage || {};\n const { buttonLabel: nextButtonLabel, pageId: nextPageId } = nextPage || {};\n const { handleNavigation } = useTrialSessionNavigation();\n const isLastPage = prevPageId && !nextPageId;\n\n const handleNext = useCallback(() => {\n handleNavigation('next', nextPageId);\n }, [handleNavigation, nextPageId]);\n\n const handlePrev = useCallback(() => {\n handleNavigation('prev', prevPageId);\n }, [handleNavigation, prevPageId]);\n\n return (\n <Styled.Container\n $flexDirection=\"row-reverse\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n {isLastPage && (\n <Button\n renderAs=\"tertiary\"\n size=\"small\"\n label=\"End the class\"\n shape=\"square\"\n onClick={openEndClassModal}\n />\n )}\n {nextPageId && nextButtonLabel && (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={12}>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n {nextButtonLabel}\n </Text>\n <ArrowTooltip\n widthX={8}\n zIndex={2}\n position=\"top-left\"\n renderAs=\"primary\"\n tooltipItem=\"Waiting for student to join...\"\n hidden={!studentAbsentInClass}\n children={\n <IconButton\n Icon={Styled.ForwardArrow}\n renderAs=\"primary\"\n analyticsLabel={nextButtonLabel}\n size=\"small\"\n onClick={handleNext}\n disabled={isRightBtnDisabled || studentAbsentInClass}\n busy={isRightBtnLoading}\n />\n }\n />\n </FlexView>\n )}\n {prevPageId && prevButtonLabel && (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={12}>\n <IconButton\n Icon={Styled.BackwardArrow}\n renderAs=\"secondary\"\n analyticsLabel={prevButtonLabel}\n size=\"small\"\n onClick={handlePrev}\n disabled={isLeftBtnDisabled}\n busy={isLeftBtnLoading}\n />\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n {prevButtonLabel}\n </Text>\n </FlexView>\n )}\n </Styled.Container>\n );\n};\n\nexport default NavigationBar;\n"],"names":["NavigationBar","slideConfig","buttonState","openEndClassModal","studentAbsentInClass","useTrialSessionContext","isLeftBtnDisabled","isLeftBtnLoading","isRightBtnDisabled","isRightBtnLoading","prevPage","nextPage","prevButtonLabel","prevPageId","nextButtonLabel","nextPageId","handleNavigation","useTrialSessionNavigation","isLastPage","handleNext","useCallback","handlePrev","jsxs","Styled.Container","jsx","Button","FlexView","Text","ArrowTooltip","IconButton","Styled.ForwardArrow","Styled.BackwardArrow"],"mappings":";;;;;;;;;;;AAWA,MAAMA,IAA0B,MAAM;AACpC,QAAM,EAAE,aAAAC,GAAa,aAAAC,GAAa,mBAAAC,GAAmB,sBAAAC,EAAA,IACnDC,KACI;AAAA,IACJ,MAAM,EAAE,YAAYC,GAAmB,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