@cuemath/leap 3.3.29-beta.0 → 3.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- 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/chapters-v2/chapter-details/block-sections/block-sections.js +43 -34
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +140 -101
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +20 -16
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +6 -6
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js +86 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js +140 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +400 -0
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
- 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/comps/pla-first-session-introduction/pla-first-session-introduction.js +22 -28
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +46 -48
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.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 -45
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +173 -197
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/student-details/class-details/class-details-utils.js +6 -6
- 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 +24 -24
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-constants.js +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps.js +5 -5
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +29 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +132 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +11 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +19 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-status/session-status-styled.js +2 -2
- package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status.js +127 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/session-summary-constants.js +2 -2
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +53 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/summary-card/summary-card-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +56 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions.js +14 -14
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -0
- package/dist/features/trial-session/comps/school-goals/school-goals.js +50 -51
- 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 +38 -39
- 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/teacher-intro/teacher-profile/teacher-profile.js +44 -43
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-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 +83 -77
- package/dist/index.js +309 -310
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +10 -0
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInMilliseconds.js +9 -0
- package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInSeconds.js +11 -0
- package/dist/node_modules/date-fns/differenceInSeconds.js.map +1 -0
- 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/comps/next-steps/next-steps-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +0 -34
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +0 -137
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +0 -20
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +0 -19
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status.js +0 -124
- package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +0 -53
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +0 -63
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.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/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/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
- /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-types.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chevron-right.js","sources":["../../../../src/assets/line-icons/icons/chevron-right.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronRight: React.FC<IconProps> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.666 12.6C13.3155 12.6 10.5993 15.3161 10.5993 18.6666H9.39935C9.39935 15.6827 11.1979 13.1188 13.77 12C11.1979 10.8811 9.39935 8.31722 9.39935 5.33329H10.5993C10.5993 8.68382 13.3155 11.4 16.666 11.4V12.6Z\"\n fill=\"currentColor\"\n fillOpacity=\"1\"\n />\n </svg>\n);\n\nexport default ChevronRight;\n"],"names":["ChevronRight","props","jsx","
|
|
1
|
+
{"version":3,"file":"chevron-right.js","sources":["../../../../src/assets/line-icons/icons/chevron-right.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronRight: React.FC<IconProps> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.666 12.6C13.3155 12.6 10.5993 15.3161 10.5993 18.6666H9.39935C9.39935 15.6827 11.1979 13.1188 13.77 12C11.1979 10.8811 9.39935 8.31722 9.39935 5.33329H10.5993C10.5993 8.68382 13.3155 11.4 16.666 11.4V12.6Z\"\n fill=\"currentColor\"\n fillOpacity=\"1\"\n />\n </svg>\n);\n\nexport default ChevronRight;\n"],"names":["ChevronRight","props","jsx","ChevronRight$1"],"mappings":";AAIA,MAAMA,IAAoC,CACxCC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PLUGINS as _ } from "../../../node_modules/@cuemath/analytics-v2/dist/constants.js";
|
|
2
|
-
var
|
|
2
|
+
var s = /* @__PURE__ */ ((e) => (e.START_SIGNUP_CTA_CLICKED = "start_signup_cta_clicked", e.ECNA_STEP_VIEWED = "ecna_step_viewed", e.ECNA_RESPONSE_RECORDED_DEBUG = "ecna_response_recorded_debug", e.PARENT_SIGNUP_CTA_CLICKED = "parent_signup_cta_clicked", e.PARENT_SIGNUP_SUCCESSFUL = "parent_signup_successful", e.PARENT_SIGNUP_FAILED = "parent_signup_failed", e.STUDENT_SIGNUP_SUCCESSFUL = "signup_successful", e.STUDENT_SIGNUP_FAILED = "signup_failed", e.SIGNUP_OTP_ENTERED = "signup_otp_entered", e.SIGNUP_OTP_VERIFIED = "signup_otp_verified", e.SIGNUP_OTP_FAILED = "signup_otp_failed", e.SLOTS_SHOWN = "slots_shown", e.SLOT_DATE_SELECTED = "slot_date_selected", e.SLOT_TIME_SELECTED = "slot_time_selected", e.TUTOR_CHANGE_REASON_SELECTED = "tutor_change_reason_selected", e))(s || {});
|
|
3
3
|
const n = {
|
|
4
4
|
start_signup_cta_clicked: [_.MIXPANEL],
|
|
5
5
|
ecna_step_viewed: [_.MIXPANEL],
|
|
@@ -15,16 +15,10 @@ const n = {
|
|
|
15
15
|
slots_shown: [_.MIXPANEL],
|
|
16
16
|
slot_date_selected: [_.MIXPANEL],
|
|
17
17
|
slot_time_selected: [_.MIXPANEL],
|
|
18
|
-
tutor_change_reason_selected: [_.MIXPANEL]
|
|
19
|
-
subscription_intent_failed: [_.MIXPANEL],
|
|
20
|
-
subscription_intent_created: [_.MIXPANEL],
|
|
21
|
-
stripe_payment_element_ready: [_.MIXPANEL],
|
|
22
|
-
stripe_payment_failed: [_.MIXPANEL],
|
|
23
|
-
stripe_payment_success: [_.MIXPANEL],
|
|
24
|
-
payment_plan_selected: [_.MIXPANEL]
|
|
18
|
+
tutor_change_reason_selected: [_.MIXPANEL]
|
|
25
19
|
};
|
|
26
20
|
export {
|
|
27
|
-
|
|
21
|
+
s as PLA_ANALYTICS_EVENTS,
|
|
28
22
|
n as PLA_ANALYTICS_WHITELIST_EVENTS
|
|
29
23
|
};
|
|
30
24
|
//# sourceMappingURL=pla-analytics-events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pla-analytics-events.js","sources":["../../../../src/features/auth/pla-signup/pla-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PLA_ANALYTICS_EVENTS {\n START_SIGNUP_CTA_CLICKED = 'start_signup_cta_clicked',\n ECNA_STEP_VIEWED = 'ecna_step_viewed',\n ECNA_RESPONSE_RECORDED_DEBUG = 'ecna_response_recorded_debug',\n PARENT_SIGNUP_CTA_CLICKED = 'parent_signup_cta_clicked',\n PARENT_SIGNUP_SUCCESSFUL = 'parent_signup_successful',\n PARENT_SIGNUP_FAILED = 'parent_signup_failed',\n STUDENT_SIGNUP_SUCCESSFUL = 'signup_successful',\n STUDENT_SIGNUP_FAILED = 'signup_failed',\n SIGNUP_OTP_ENTERED = 'signup_otp_entered',\n SIGNUP_OTP_VERIFIED = 'signup_otp_verified',\n SIGNUP_OTP_FAILED = 'signup_otp_failed',\n SLOTS_SHOWN = 'slots_shown',\n SLOT_DATE_SELECTED = 'slot_date_selected',\n SLOT_TIME_SELECTED = 'slot_time_selected',\n TUTOR_CHANGE_REASON_SELECTED = 'tutor_change_reason_selected',\n
|
|
1
|
+
{"version":3,"file":"pla-analytics-events.js","sources":["../../../../src/features/auth/pla-signup/pla-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PLA_ANALYTICS_EVENTS {\n START_SIGNUP_CTA_CLICKED = 'start_signup_cta_clicked',\n ECNA_STEP_VIEWED = 'ecna_step_viewed',\n ECNA_RESPONSE_RECORDED_DEBUG = 'ecna_response_recorded_debug',\n PARENT_SIGNUP_CTA_CLICKED = 'parent_signup_cta_clicked',\n PARENT_SIGNUP_SUCCESSFUL = 'parent_signup_successful',\n PARENT_SIGNUP_FAILED = 'parent_signup_failed',\n STUDENT_SIGNUP_SUCCESSFUL = 'signup_successful',\n STUDENT_SIGNUP_FAILED = 'signup_failed',\n SIGNUP_OTP_ENTERED = 'signup_otp_entered',\n SIGNUP_OTP_VERIFIED = 'signup_otp_verified',\n SIGNUP_OTP_FAILED = 'signup_otp_failed',\n SLOTS_SHOWN = 'slots_shown',\n SLOT_DATE_SELECTED = 'slot_date_selected',\n SLOT_TIME_SELECTED = 'slot_time_selected',\n TUTOR_CHANGE_REASON_SELECTED = 'tutor_change_reason_selected',\n}\n\nexport const PLA_ANALYTICS_WHITELIST_EVENTS = {\n [PLA_ANALYTICS_EVENTS.START_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_RESPONSE_RECORDED_DEBUG]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_ENTERED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_VERIFIED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOTS_SHOWN]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_DATE_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_TIME_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.TUTOR_CHANGE_REASON_SELECTED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PLA_ANALYTICS_EVENTS","PLA_ANALYTICS_WHITELIST_EVENTS","PLUGINS"],"mappings":";AAEY,IAAAA,sBAAAA,OACVA,EAAA,2BAA2B,4BAC3BA,EAAA,mBAAmB,oBACnBA,EAAA,+BAA+B,gCAC/BA,EAAA,4BAA4B,6BAC5BA,EAAA,2BAA2B,4BAC3BA,EAAA,uBAAuB,wBACvBA,EAAA,4BAA4B,qBAC5BA,EAAA,wBAAwB,iBACxBA,EAAA,qBAAqB,sBACrBA,EAAA,sBAAsB,uBACtBA,EAAA,oBAAoB,qBACpBA,EAAA,cAAc,eACdA,EAAA,qBAAqB,sBACrBA,EAAA,qBAAqB,sBACrBA,EAAA,+BAA+B,gCAfrBA,IAAAA,KAAA,CAAA,CAAA;AAkBL,MAAMC,IAAiC;AAAA,EAC3C,0BAAgD,CAACC,EAAQ,QAAQ;AAAA,EACjE,kBAAwC,CAACA,EAAQ,QAAQ;AAAA,EACzD,8BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,2BAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,0BAAgD,CAACA,EAAQ,QAAQ;AAAA,EACjE,sBAA4C,CAACA,EAAQ,QAAQ;AAAA,EAC7D,mBAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,eAA6C,CAACA,EAAQ,QAAQ;AAAA,EAC9D,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,qBAA2C,CAACA,EAAQ,QAAQ;AAAA,EAC5D,mBAAyC,CAACA,EAAQ,QAAQ;AAAA,EAC1D,aAAmC,CAACA,EAAQ,QAAQ;AAAA,EACpD,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,8BAAoD,CAACA,EAAQ,QAAQ;AACxE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circular-step-wrapper.js","sources":["../../../../../src/features/auth/signup/circular-step-wrapper/circular-step-wrapper.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport type { ICircularStepRef, ICircularStepWrapperProps } from './circular-step-wrapper-types';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n memo,\n type Ref,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport Next2Icon from '../../../../assets/line-icons/icons/next2';\nimport AnimatedArc from '../../../ui/animated-arc/animated-arc';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './circular-step-wrapper-styled';\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n rendererSettings: {\n preserveAspectRatio: 'xMidYMin slice',\n },\n};\n\nconst CircularStepWrapper = forwardRef<ICircularStepRef, ICircularStepWrapperProps>(\n (\n {\n children,\n onGoBack,\n onNext,\n label,\n showNext,\n showPrevious,\n animation,\n introFrames,\n outroFrames,\n isNextLoading,\n progressAngle,\n footerElement,\n isNextDisabled,\n animationSrcMobile,\n },\n ref: Ref<ICircularStepRef>,\n ) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerHeight, setContainerHeight] = useState<number | undefined>();\n const [showContent, setShowContent] = useState(false);\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const onLottieRender = useCallback(() => {\n if (animation && animationRef.current) {\n animationRef.current.playSegments(introFrames, true);\n setShowContent(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animation]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [animation]);\n\n useImperativeHandle(ref, () => ({\n playOutroAndFadeOut: async () => {\n return new Promise<void>(resolve => {\n const handleComplete = () => {\n resolve();\n animationRef.current?.removeEventListener('complete', handleComplete);\n };\n\n animationRef.current?.playSegments(outroFrames, true);\n timeoutRef.current = setTimeout(() => setShowContent(false), 400);\n animationRef.current?.addEventListener('complete', handleComplete);\n });\n },\n }));\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setContainerHeight(containerRef.current.offsetHeight);\n }\n }, []);\n\n return (\n <Styled.Container\n $flex={1}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n ref={containerRef}\n >\n {containerHeight && (\n <LottieAnimation\n width={1280}\n height={containerHeight}\n src={isMobile ? animationSrcMobile ?? animation : animation}\n ref={animationRef}\n onRender={onLottieRender}\n settings={animationSettings}\n />\n )}\n <Styled.CircularStepContainer\n $width={isMobile ? 290 : 400}\n $height={isMobile ? 290 : 400}\n $background=\"REAL_BLACK\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {progressAngle && (\n <AnimatedArc\n radius={isMobile ? 145 : 200}\n strokeWidth={2}\n color=\"WHITE\"\n targetAngle={progressAngle}\n mode=\"fade\"\n duration={1}\n />\n )}\n <Styled.ContentWrapper $isVisible={showContent} $width=\"100%\">\n {label && (\n <FlexView $gutterX={isMobile ? 1.5 : 3.5}>\n <Text $renderAs=\"ab2\" $color=\"WHITE\" $align=\"center\">\n {label}\n </Text>\n <Separator heightX={1} />\n </FlexView>\n )}\n <Styled.InputContainer>{children}</Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.CircularStepContainer>\n {footerElement && (\n <Styled.FooterWrapper $alignItems=\"center\" $justifyContent=\"center\">\n {footerElement}\n </Styled.FooterWrapper>\n )}\n {showPrevious && (\n <Styled.PrevButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"black-dark\"\n analyticsLabel=\"Prev\"\n onClick={onGoBack}\n disabled={isNextLoading}\n size=\"small\"\n />\n </Styled.PrevButtonWrapper>\n )}\n {showNext && (\n <Styled.NextButtonWrapper>\n <IconButton\n size=\"small\"\n Icon={Next2Icon}\n renderAs=\"secondary-dark\"\n analyticsLabel=\"Next\"\n onClick={onNext}\n busy={isNextLoading}\n disabled={isNextLoading || isNextDisabled}\n />\n </Styled.NextButtonWrapper>\n )}\n </Styled.Container>\n );\n },\n);\n\nexport default memo(CircularStepWrapper);\n"],"names":["animationSettings","CircularStepWrapper","forwardRef","children","onGoBack","onNext","label","showNext","showPrevious","animation","introFrames","outroFrames","isNextLoading","progressAngle","footerElement","isNextDisabled","animationSrcMobile","ref","animationRef","useRef","containerRef","containerHeight","setContainerHeight","useState","showContent","setShowContent","timeoutRef","device","useTheme","isMobile","EDeviceType","onLottieRender","useCallback","useEffect","useImperativeHandle","resolve","handleComplete","_a","_b","useLayoutEffect","jsxs","Styled.Container","jsx","LottieAnimation","Styled.CircularStepContainer","AnimatedArc","Styled.ContentWrapper","FlexView","Text","Separator","Styled.InputContainer","Styled.FooterWrapper","Styled.PrevButtonWrapper","IconButton","Back2Icon","Styled.NextButtonWrapper","Next2Icon","
|
|
1
|
+
{"version":3,"file":"circular-step-wrapper.js","sources":["../../../../../src/features/auth/signup/circular-step-wrapper/circular-step-wrapper.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport type { ICircularStepRef, ICircularStepWrapperProps } from './circular-step-wrapper-types';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n memo,\n type Ref,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport Next2Icon from '../../../../assets/line-icons/icons/next2';\nimport AnimatedArc from '../../../ui/animated-arc/animated-arc';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './circular-step-wrapper-styled';\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n rendererSettings: {\n preserveAspectRatio: 'xMidYMin slice',\n },\n};\n\nconst CircularStepWrapper = forwardRef<ICircularStepRef, ICircularStepWrapperProps>(\n (\n {\n children,\n onGoBack,\n onNext,\n label,\n showNext,\n showPrevious,\n animation,\n introFrames,\n outroFrames,\n isNextLoading,\n progressAngle,\n footerElement,\n isNextDisabled,\n animationSrcMobile,\n },\n ref: Ref<ICircularStepRef>,\n ) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerHeight, setContainerHeight] = useState<number | undefined>();\n const [showContent, setShowContent] = useState(false);\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const onLottieRender = useCallback(() => {\n if (animation && animationRef.current) {\n animationRef.current.playSegments(introFrames, true);\n setShowContent(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animation]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [animation]);\n\n useImperativeHandle(ref, () => ({\n playOutroAndFadeOut: async () => {\n return new Promise<void>(resolve => {\n const handleComplete = () => {\n resolve();\n animationRef.current?.removeEventListener('complete', handleComplete);\n };\n\n animationRef.current?.playSegments(outroFrames, true);\n timeoutRef.current = setTimeout(() => setShowContent(false), 400);\n animationRef.current?.addEventListener('complete', handleComplete);\n });\n },\n }));\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setContainerHeight(containerRef.current.offsetHeight);\n }\n }, []);\n\n return (\n <Styled.Container\n $flex={1}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n ref={containerRef}\n >\n {containerHeight && (\n <LottieAnimation\n width={1280}\n height={containerHeight}\n src={isMobile ? animationSrcMobile ?? animation : animation}\n ref={animationRef}\n onRender={onLottieRender}\n settings={animationSettings}\n />\n )}\n <Styled.CircularStepContainer\n $width={isMobile ? 290 : 400}\n $height={isMobile ? 290 : 400}\n $background=\"REAL_BLACK\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {progressAngle && (\n <AnimatedArc\n radius={isMobile ? 145 : 200}\n strokeWidth={2}\n color=\"WHITE\"\n targetAngle={progressAngle}\n mode=\"fade\"\n duration={1}\n />\n )}\n <Styled.ContentWrapper $isVisible={showContent} $width=\"100%\">\n {label && (\n <FlexView $gutterX={isMobile ? 1.5 : 3.5}>\n <Text $renderAs=\"ab2\" $color=\"WHITE\" $align=\"center\">\n {label}\n </Text>\n <Separator heightX={1} />\n </FlexView>\n )}\n <Styled.InputContainer>{children}</Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.CircularStepContainer>\n {footerElement && (\n <Styled.FooterWrapper $alignItems=\"center\" $justifyContent=\"center\">\n {footerElement}\n </Styled.FooterWrapper>\n )}\n {showPrevious && (\n <Styled.PrevButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"black-dark\"\n analyticsLabel=\"Prev\"\n onClick={onGoBack}\n disabled={isNextLoading}\n size=\"small\"\n />\n </Styled.PrevButtonWrapper>\n )}\n {showNext && (\n <Styled.NextButtonWrapper>\n <IconButton\n size=\"small\"\n Icon={Next2Icon}\n renderAs=\"secondary-dark\"\n analyticsLabel=\"Next\"\n onClick={onNext}\n busy={isNextLoading}\n disabled={isNextLoading || isNextDisabled}\n />\n </Styled.NextButtonWrapper>\n )}\n </Styled.Container>\n );\n },\n);\n\nexport default memo(CircularStepWrapper);\n"],"names":["animationSettings","CircularStepWrapper","forwardRef","children","onGoBack","onNext","label","showNext","showPrevious","animation","introFrames","outroFrames","isNextLoading","progressAngle","footerElement","isNextDisabled","animationSrcMobile","ref","animationRef","useRef","containerRef","containerHeight","setContainerHeight","useState","showContent","setShowContent","timeoutRef","device","useTheme","isMobile","EDeviceType","onLottieRender","useCallback","useEffect","useImperativeHandle","resolve","handleComplete","_a","_b","useLayoutEffect","jsxs","Styled.Container","jsx","LottieAnimation","Styled.CircularStepContainer","AnimatedArc","Styled.ContentWrapper","FlexView","Text","Separator","Styled.InputContainer","Styled.FooterWrapper","Styled.PrevButtonWrapper","IconButton","Back2Icon","Styled.NextButtonWrapper","Next2Icon","circularStepWrapper","memo"],"mappings":";;;;;;;;;;;;;AA2BA,MAAMA,KAAoB;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,IAChB,qBAAqB;AAAA,EACvB;AACF,GAEMC,KAAsBC;AAAA,EAC1B,CACE;AAAA,IACE,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,KAEFC,M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AAA,cACV,MAAK;AAAA,YAAA;AAAA,UAAA,GAET;AAAA,UAEDL,KACC,gBAAAmC,EAACa,IAAA,EACC,UAAA,gBAAAb;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAMG;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASnD;AAAA,cACT,MAAMO;AAAA,cACN,UAAUA,KAAiBG;AAAA,YAAA;AAAA,UAAA,GAE/B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF,GAEe0C,KAAAC,EAAKzD,EAAmB;"}
|
|
@@ -13,12 +13,12 @@ const q = ({
|
|
|
13
13
|
error: u,
|
|
14
14
|
helperText: b,
|
|
15
15
|
onEnter: n,
|
|
16
|
-
isLoading:
|
|
16
|
+
isLoading: D,
|
|
17
17
|
isValid: h,
|
|
18
18
|
type: t = "text",
|
|
19
|
-
placeholder:
|
|
20
|
-
actionElement:
|
|
21
|
-
maxLength:
|
|
19
|
+
placeholder: F,
|
|
20
|
+
actionElement: R,
|
|
21
|
+
maxLength: $,
|
|
22
22
|
width: E,
|
|
23
23
|
textTransform: P,
|
|
24
24
|
textAlign: v = "center",
|
|
@@ -56,8 +56,8 @@ const q = ({
|
|
|
56
56
|
X,
|
|
57
57
|
{
|
|
58
58
|
helperText: u || b,
|
|
59
|
-
isLoading:
|
|
60
|
-
actionElement:
|
|
59
|
+
isLoading: D,
|
|
60
|
+
actionElement: R,
|
|
61
61
|
children: /* @__PURE__ */ K(
|
|
62
62
|
B,
|
|
63
63
|
{
|
|
@@ -75,13 +75,13 @@ const q = ({
|
|
|
75
75
|
value: r,
|
|
76
76
|
onChange: G,
|
|
77
77
|
autoFocus: !0,
|
|
78
|
-
placeholder:
|
|
78
|
+
placeholder: F,
|
|
79
79
|
color: z,
|
|
80
80
|
autoCapitalize: "none",
|
|
81
81
|
textTransform: P,
|
|
82
82
|
type: y,
|
|
83
83
|
onKeyDown: k,
|
|
84
|
-
maxLength:
|
|
84
|
+
maxLength: $,
|
|
85
85
|
align: v,
|
|
86
86
|
fontSize: j
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(isMobile ? 24 : 32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n if (isMobile) {\n setFontSize(24);\n\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize, isMobile]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isMobile","EDeviceType","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","
|
|
1
|
+
{"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(isMobile ? 24 : 32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n if (isMobile) {\n setFontSize(24);\n\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize, isMobile]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isMobile","EDeviceType","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","customInputField","memo"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAA+C,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAAM;AACJ,QAAMC,IAAQC,KACRC,IAAWF,EAAM,UAAUG,EAAY,QACvC,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAC1D,CAACC,GAAUC,CAAW,IAAIF,EAASJ,IAAW,KAAK,EAAE,GACrDO,IAAWC,EAAyB,IAAI,GACxCC,IAAYD,EAAiC,IAAI,GAEjDE,IAAgBC;AAAA,IACpB,CAACC,MAA2C;AACtC,MAAAA,EAAM,QAAQ,YACN3B,KAAA,QAAAA;AAAA,IAEd;AAAA,IACA,CAACA,CAAO;AAAA,EAAA,GAGJ4B,IAAYC,EAAQ,MACpB1B,MAAS,aAAmBc,IAAoB,SAAS,aAEzDd,MAAS,UAAgB,WAEtBA,GACN,CAACA,GAAMc,CAAiB,CAAC,GAEtBa,IAAaD,EAAQ,MACrB/B,IAAce,EAAM,OAAO,MAE3BX,IAAgBW,EAAM,OAAO,UAE1BA,EAAM,OAAO,OACnB,CAACf,GAAOI,GAASW,EAAM,MAAM,CAAC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AAUyC;AAAA,gBACV,WAAS;AAAA,gBACT,aAAAjC;AAAA,gBACA,OAAO0B;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAAtB;AAAA,gBACA,MAAMoB;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAnB;AAAA,gBACA,OAAOG;AAAA,gBACP,UAAAW;AAAA,cAAA;AAAA,YACF;AAAA,YACCjB,MAAS,cACR,gBAAAmC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAW3B;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAA2B,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,KAAAC,EAAKpD,CAAgB;"}
|
|
@@ -1,53 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { BLOCK_TYPE as
|
|
4
|
-
import
|
|
5
|
-
import { ChapterDetailsWrapper as
|
|
6
|
-
const { SAT_MOCK_TEST:
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as O, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { memo as y, useMemo as D } from "react";
|
|
3
|
+
import { BLOCK_TYPE as G, SECTION_CODE as I } from "../../constants/block-constants.js";
|
|
4
|
+
import u from "./block-section-view.js";
|
|
5
|
+
import { ChapterDetailsWrapper as L } from "./block-sections-styled.js";
|
|
6
|
+
const { SAT_MOCK_TEST: _, GOAL: w } = G, { GOALS: N, READINESS: x } = I, F = y((h) => {
|
|
7
|
+
const {
|
|
8
|
+
blocks: t,
|
|
9
|
+
imageHue: i,
|
|
10
|
+
userType: r,
|
|
11
|
+
coreBlocksRef: S,
|
|
12
|
+
challengeBlockRef: C,
|
|
13
|
+
downloadBlockRef: E,
|
|
14
|
+
downloadCoreBlockRef: g,
|
|
15
|
+
...d
|
|
16
|
+
} = h;
|
|
17
|
+
let a = 0, k = !1, f = !1;
|
|
18
|
+
const { goalBlocks: p, nonGoalBlocks: B } = D(
|
|
10
19
|
() => t.reduce(
|
|
11
|
-
(o, e) => (e.section_code ===
|
|
20
|
+
(o, e) => (e.section_code === N || e.section_code === x || e.block_type === _ ? o.goalBlocks.push(e) : o.nonGoalBlocks.push(e), o),
|
|
12
21
|
{ goalBlocks: [], nonGoalBlocks: [] }
|
|
13
22
|
),
|
|
14
23
|
[t]
|
|
15
24
|
);
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
25
|
+
return /* @__PURE__ */ O(
|
|
26
|
+
L,
|
|
18
27
|
{
|
|
19
28
|
$width: "100%",
|
|
20
|
-
$background:
|
|
29
|
+
$background: B.length ? "WHITE_3" : "WHITE_1",
|
|
21
30
|
children: [
|
|
22
|
-
/* @__PURE__ */ c("div", { ref:
|
|
23
|
-
const { block_type: l, block_id: s, permissions:
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
return (l ===
|
|
27
|
-
|
|
31
|
+
/* @__PURE__ */ c("div", { ref: S, children: p.map((o, e) => {
|
|
32
|
+
const { block_type: l, block_id: s, permissions: n, sheets: A } = o;
|
|
33
|
+
let m = 0;
|
|
34
|
+
const R = e === p.length - 1, T = A.find((b) => b.node_type === "PDF");
|
|
35
|
+
return (l === w || l === _) && (n.can_un_skip || (a += 1), m = a), /* @__PURE__ */ c(
|
|
36
|
+
u,
|
|
28
37
|
{
|
|
29
38
|
blockData: o,
|
|
30
|
-
userType:
|
|
31
|
-
isLastBlock:
|
|
32
|
-
lessonIdx:
|
|
33
|
-
imageHue:
|
|
39
|
+
userType: r,
|
|
40
|
+
isLastBlock: R,
|
|
41
|
+
lessonIdx: m,
|
|
42
|
+
imageHue: i,
|
|
34
43
|
isGoalBlock: !0,
|
|
35
|
-
...
|
|
36
|
-
blockSectionRef: void 0
|
|
44
|
+
...d,
|
|
45
|
+
blockSectionRef: T ? g : void 0
|
|
37
46
|
},
|
|
38
47
|
s
|
|
39
48
|
);
|
|
40
49
|
}) }),
|
|
41
|
-
|
|
42
|
-
const { block_id: e, block_type: l } = o, s = l === "CHALLENGE_ARENA" && !k;
|
|
43
|
-
return s && (k = !0), /* @__PURE__ */ c(
|
|
44
|
-
|
|
50
|
+
B.map((o) => {
|
|
51
|
+
const { block_id: e, block_type: l } = o, s = l === "CHALLENGE_ARENA" && !k, n = l === "DOWNLOADS" && !f;
|
|
52
|
+
return s && (k = !0), n && (f = !0), /* @__PURE__ */ c(
|
|
53
|
+
u,
|
|
45
54
|
{
|
|
46
55
|
blockData: o,
|
|
47
|
-
userType:
|
|
48
|
-
imageHue:
|
|
49
|
-
...
|
|
50
|
-
blockSectionRef: s ?
|
|
56
|
+
userType: r,
|
|
57
|
+
imageHue: i,
|
|
58
|
+
...d,
|
|
59
|
+
blockSectionRef: s ? C : n ? E : void 0
|
|
51
60
|
},
|
|
52
61
|
e
|
|
53
62
|
);
|
|
@@ -57,6 +66,6 @@ const { SAT_MOCK_TEST: u, GOAL: y } = C, { GOALS: G, READINESS: I } = g, v = b((
|
|
|
57
66
|
);
|
|
58
67
|
});
|
|
59
68
|
export {
|
|
60
|
-
|
|
69
|
+
F as default
|
|
61
70
|
};
|
|
62
71
|
//# sourceMappingURL=block-sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { BLOCK_TYPE, SECTION_CODE } from '../../constants/block-constants';\nimport BlockSectionView from './block-section-view';\nimport * as Styled from './block-sections-styled';\n\nconst { SAT_MOCK_TEST, GOAL } = BLOCK_TYPE;\nconst { GOALS, READINESS } = SECTION_CODE;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {
|
|
1
|
+
{"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { BLOCK_TYPE, SECTION_CODE } from '../../constants/block-constants';\nimport BlockSectionView from './block-section-view';\nimport * as Styled from './block-sections-styled';\n\nconst { SAT_MOCK_TEST, GOAL } = BLOCK_TYPE;\nconst { GOALS, READINESS } = SECTION_CODE;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {\n blocks,\n imageHue,\n userType,\n coreBlocksRef,\n challengeBlockRef,\n downloadBlockRef,\n downloadCoreBlockRef,\n ...blockSectionCallBacks\n } = props;\n\n let lessonCount = 0;\n let addChallengeArenaRef = false;\n let addDownloadBlockRef = false;\n\n const { goalBlocks, nonGoalBlocks } = useMemo(\n () =>\n blocks.reduce(\n (acc, block) => {\n if (\n block.section_code === GOALS ||\n block.section_code === READINESS ||\n block.block_type === SAT_MOCK_TEST\n ) {\n acc.goalBlocks.push(block);\n } else {\n acc.nonGoalBlocks.push(block);\n }\n\n return acc;\n },\n { goalBlocks: [] as typeof blocks, nonGoalBlocks: [] as typeof blocks },\n ),\n [blocks],\n );\n\n return (\n <Styled.ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `WHITE_1` : 'WHITE_3'}\n >\n <div ref={coreBlocksRef}>\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, permissions, sheets } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n const hasPDFNode = sheets.find(sheet => sheet.node_type === 'PDF');\n\n if (blockType === GOAL || blockType === SAT_MOCK_TEST) {\n if (!permissions.can_un_skip) {\n lessonCount += 1;\n }\n\n lessonIdx = lessonCount;\n }\n\n return (\n <BlockSectionView\n blockData={blockData}\n userType={userType}\n isLastBlock={isLastBlock}\n key={blockId}\n lessonIdx={lessonIdx}\n imageHue={imageHue}\n isGoalBlock\n {...blockSectionCallBacks}\n blockSectionRef={hasPDFNode ? downloadCoreBlockRef : undefined}\n />\n );\n })}\n </div>\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId, block_type: blockType } = blockData;\n\n // Apply blockSectionRef only to the first CHALLENGE_ARENA block\n const isChallengeArenaBlock = blockType === 'CHALLENGE_ARENA' && !addChallengeArenaRef;\n\n const isDownloadBlock = blockType === 'DOWNLOADS' && !addDownloadBlockRef;\n\n if (isChallengeArenaBlock) {\n addChallengeArenaRef = true;\n }\n\n if (isDownloadBlock) {\n addDownloadBlockRef = true;\n }\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n {...blockSectionCallBacks}\n blockSectionRef={\n isChallengeArenaBlock\n ? challengeBlockRef\n : isDownloadBlock\n ? downloadBlockRef\n : undefined\n }\n />\n );\n })}\n </Styled.ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["SAT_MOCK_TEST","GOAL","BLOCK_TYPE","GOALS","READINESS","SECTION_CODE","BlockSections","memo","props","blocks","imageHue","userType","coreBlocksRef","challengeBlockRef","downloadBlockRef","downloadCoreBlockRef","blockSectionCallBacks","lessonCount","addChallengeArenaRef","addDownloadBlockRef","goalBlocks","nonGoalBlocks","useMemo","acc","block","jsxs","Styled.ChapterDetailsWrapper","jsx","blockData","idx","blockType","blockId","permissions","sheets","lessonIdx","isLastBlock","hasPDFNode","sheet","BlockSectionView","isChallengeArenaBlock","isDownloadBlock"],"mappings":";;;;;AASA,MAAM,EAAE,eAAAA,GAAe,MAAAC,EAAS,IAAAC,GAC1B,EAAE,OAAAC,GAAO,WAAAC,EAAc,IAAAC,GAEvBC,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA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UAAUG,GAAS,YAAYD,MAAcF,GAG/CW,IAAwBT,MAAc,qBAAqB,CAACZ,GAE5DsB,IAAkBV,MAAc,eAAe,CAACX;AAEtD,iBAAIoB,MACqBrB,IAAA,KAGrBsB,MACoBrB,IAAA,KAItB,gBAAAQ;AAAA,YAACW;AAAA,YAAA;AAAA,cAEC,WAAAV;AAAA,cACA,UAAAjB;AAAA,cACA,UAAAD;AAAA,cACC,GAAGM;AAAA,cACJ,iBACEuB,IACI1B,IACA2B,IACE1B,IACA;AAAA,YAAA;AAAA,YAVHiB;AAAA,UAAA;AAAA,QAYP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -1,148 +1,187 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { ILLUSTRATIONS as
|
|
4
|
-
import
|
|
5
|
-
import { useChallengeArenaJourney as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
|
|
1
|
+
import { jsxs as p, jsx as o, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { memo as G, useCallback as M, useEffect as f, useMemo as h } from "react";
|
|
3
|
+
import { ILLUSTRATIONS as V } from "../../../assets/illustrations/illustrations.js";
|
|
4
|
+
import q from "../../../assets/line-icons/icons/back2.js";
|
|
5
|
+
import { useChallengeArenaJourney as K } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
|
|
6
|
+
import { useDownloadBlockJourney as Q } from "../../journey/hooks/use-chapter-page-journey/use-download-block-journey.js";
|
|
7
|
+
import { useDownloadNodeJourney as Y } from "../../journey/hooks/use-chapter-page-journey/use-download-node-journey.js";
|
|
8
|
+
import { useJourney as Z } from "../../journey/use-journey/use-journey.js";
|
|
9
|
+
import ee from "../../ui/buttons/button/button.js";
|
|
10
|
+
import oe from "../../ui/buttons/icon-button/icon-button.js";
|
|
11
|
+
import te from "../../ui/layout/flex-view.js";
|
|
12
|
+
import re from "../../ui/loader/app-loader/app-loader.js";
|
|
13
|
+
import ne from "../../ui/text/text.js";
|
|
14
|
+
import { useGetChapterDetails as ae } from "../api/chapter.js";
|
|
15
|
+
import { getHasDownloadBlock as ie, getHasNonDownloadBlockWithPdfNode as se } from "../utils/index.js";
|
|
16
|
+
import le from "./block-sections/block-sections.js";
|
|
17
|
+
import ce from "./chapter-banner/chapter-banner.js";
|
|
18
|
+
import { ContentWrapper as de, BackButtonContainer as me, BackButtonWrapper as pe, LoaderWrapper as fe } from "./chapter-details-styled.js";
|
|
19
|
+
const he = G((S) => {
|
|
17
20
|
const {
|
|
18
|
-
userChapterId:
|
|
19
|
-
studentId:
|
|
20
|
-
userType:
|
|
21
|
-
onBlockSkipUnskip:
|
|
22
|
-
onNodeAttempt:
|
|
23
|
-
onNodeAssignAsHomework:
|
|
24
|
-
onNodeMarkAsDone:
|
|
25
|
-
onNodeReattempt:
|
|
26
|
-
onNodeReview:
|
|
27
|
-
onNodeView:
|
|
28
|
-
onExit:
|
|
29
|
-
onNodeUnassign:
|
|
30
|
-
onNodeUnlock:
|
|
31
|
-
onNodeSkipUnSkip:
|
|
32
|
-
startChapterPageJourney:
|
|
33
|
-
onBlockReset:
|
|
34
|
-
chapterPageRef:
|
|
35
|
-
bannerRef:
|
|
36
|
-
coreBlocksRef:
|
|
37
|
-
canStartJourney:
|
|
38
|
-
canStartChallengeArenaJourney:
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
userChapterId: s,
|
|
22
|
+
studentId: l,
|
|
23
|
+
userType: t,
|
|
24
|
+
onBlockSkipUnskip: J,
|
|
25
|
+
onNodeAttempt: A,
|
|
26
|
+
onNodeAssignAsHomework: b,
|
|
27
|
+
onNodeMarkAsDone: $,
|
|
28
|
+
onNodeReattempt: x,
|
|
29
|
+
onNodeReview: I,
|
|
30
|
+
onNodeView: v,
|
|
31
|
+
onExit: P,
|
|
32
|
+
onNodeUnassign: _,
|
|
33
|
+
onNodeUnlock: E,
|
|
34
|
+
onNodeSkipUnSkip: H,
|
|
35
|
+
startChapterPageJourney: m,
|
|
36
|
+
onBlockReset: L,
|
|
37
|
+
chapterPageRef: T,
|
|
38
|
+
bannerRef: U,
|
|
39
|
+
coreBlocksRef: W,
|
|
40
|
+
canStartJourney: r,
|
|
41
|
+
canStartChallengeArenaJourney: u,
|
|
42
|
+
canStartDownloadNodeJourney: c,
|
|
43
|
+
canStartDownloadBlockJourney: n
|
|
44
|
+
} = S, { isJourneyActive: g } = Z(), {
|
|
45
|
+
get: k,
|
|
41
46
|
data: e,
|
|
42
|
-
isProcessing:
|
|
43
|
-
isProcessingFailed:
|
|
44
|
-
isStale:
|
|
45
|
-
} =
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
const { blockSectionRef:
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
isProcessing: a,
|
|
48
|
+
isProcessingFailed: j,
|
|
49
|
+
isStale: y
|
|
50
|
+
} = ae(), i = M(() => {
|
|
51
|
+
k(s, void 0, { studentId: l });
|
|
52
|
+
}, [k, s, l]);
|
|
53
|
+
f(() => {
|
|
54
|
+
i();
|
|
55
|
+
}, [i]);
|
|
56
|
+
const { blockSectionRef: F, startJourney: B } = K(), {
|
|
57
|
+
blockSectionRef: w,
|
|
58
|
+
downloadCoreBlockRef: O,
|
|
59
|
+
startJourney: C
|
|
60
|
+
} = Y(), { blockSectionRef: N, startJourney: R } = Q(), D = h(
|
|
61
|
+
() => e && ie(e.blocks),
|
|
62
|
+
[e]
|
|
63
|
+
), d = h(
|
|
64
|
+
() => e && se(e.blocks),
|
|
65
|
+
[e]
|
|
66
|
+
), X = h(
|
|
67
|
+
() => c && d ? w : n ? N : void 0,
|
|
68
|
+
[
|
|
69
|
+
c,
|
|
70
|
+
n,
|
|
71
|
+
d,
|
|
72
|
+
w,
|
|
73
|
+
N
|
|
74
|
+
]
|
|
75
|
+
);
|
|
76
|
+
return f(() => {
|
|
77
|
+
e && !g && (r && m && m({
|
|
78
|
+
chapterDetails: e,
|
|
79
|
+
userChapterId: s,
|
|
80
|
+
studentId: l,
|
|
81
|
+
userType: t
|
|
82
|
+
}), !r && u && B({
|
|
83
|
+
chapterDetails: e,
|
|
84
|
+
userType: t
|
|
85
|
+
}), !r && c && d && C({
|
|
54
86
|
chapterDetails: e,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}), e && !l && h && !m && f({
|
|
87
|
+
userType: t,
|
|
88
|
+
canStartDownloadBlockJourney: n
|
|
89
|
+
}), !r && n && D && R({
|
|
59
90
|
chapterDetails: e,
|
|
60
|
-
userType:
|
|
61
|
-
});
|
|
91
|
+
userType: t
|
|
92
|
+
}));
|
|
62
93
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
94
|
+
u,
|
|
95
|
+
r,
|
|
65
96
|
e,
|
|
97
|
+
g,
|
|
98
|
+
B,
|
|
66
99
|
m,
|
|
67
|
-
|
|
100
|
+
R,
|
|
101
|
+
C,
|
|
102
|
+
l,
|
|
68
103
|
s,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
t,
|
|
105
|
+
d,
|
|
106
|
+
D,
|
|
107
|
+
c,
|
|
108
|
+
n
|
|
109
|
+
]), f(() => {
|
|
110
|
+
!a && y && i();
|
|
111
|
+
}, [i, a, y]), j ? /* @__PURE__ */ p(te, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
|
112
|
+
/* @__PURE__ */ o(ne, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
|
113
|
+
/* @__PURE__ */ o(
|
|
114
|
+
ee,
|
|
78
115
|
{
|
|
79
116
|
widthX: 14,
|
|
80
117
|
size: "small",
|
|
81
118
|
shape: "square",
|
|
82
119
|
renderAs: "primary",
|
|
83
120
|
label: "Try again",
|
|
84
|
-
onClick:
|
|
121
|
+
onClick: i
|
|
85
122
|
}
|
|
86
123
|
)
|
|
87
|
-
] }) : !e &&
|
|
88
|
-
|
|
124
|
+
] }) : !e && a ? /* @__PURE__ */ o(re, { height: "100vh" }) : /* @__PURE__ */ p(
|
|
125
|
+
de,
|
|
89
126
|
{
|
|
90
|
-
ref:
|
|
127
|
+
ref: T,
|
|
91
128
|
$widthX: 50,
|
|
92
|
-
$disablePointerEvents:
|
|
129
|
+
$disablePointerEvents: a,
|
|
93
130
|
$justifyContent: "center",
|
|
94
131
|
$alignItems: "center",
|
|
95
132
|
$height: "max-content",
|
|
96
133
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
134
|
+
t === "TEACHER" && /* @__PURE__ */ o(me, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
|
|
135
|
+
oe,
|
|
99
136
|
{
|
|
100
|
-
Icon:
|
|
137
|
+
Icon: q,
|
|
101
138
|
renderAs: "secondary-gray",
|
|
102
139
|
analyticsLabel: "chapter_page_exit",
|
|
103
140
|
size: "xsmall",
|
|
104
|
-
onClick:
|
|
141
|
+
onClick: P
|
|
105
142
|
}
|
|
106
143
|
) }) }),
|
|
107
|
-
|
|
108
|
-
e && /* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
144
|
+
a && /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o("img", { src: V.LOADER_1, alt: "loader" }) }),
|
|
145
|
+
e && /* @__PURE__ */ p(z, { children: [
|
|
146
|
+
/* @__PURE__ */ o(
|
|
147
|
+
ce,
|
|
111
148
|
{
|
|
112
149
|
title: e.name,
|
|
113
150
|
imageHue: e.image_hue,
|
|
114
151
|
imageUrl: e.image_url,
|
|
115
152
|
progressStats: e == null ? void 0 : e.progress_stat,
|
|
116
|
-
bannerRef:
|
|
153
|
+
bannerRef: U
|
|
117
154
|
}
|
|
118
155
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
156
|
+
/* @__PURE__ */ o(
|
|
157
|
+
le,
|
|
121
158
|
{
|
|
122
159
|
imageHue: e.image_hue,
|
|
123
|
-
userType:
|
|
160
|
+
userType: t,
|
|
124
161
|
blocks: e.blocks,
|
|
125
|
-
onBlockSkipUnskip:
|
|
126
|
-
onNodeAttempt:
|
|
127
|
-
onNodeAssignAsHomework:
|
|
128
|
-
onNodeMarkAsDone:
|
|
129
|
-
onNodeReattempt:
|
|
130
|
-
onNodeReview:
|
|
131
|
-
onNodeView:
|
|
132
|
-
coreBlocksRef:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
onBlockSkipUnskip: J,
|
|
163
|
+
onNodeAttempt: A,
|
|
164
|
+
onNodeAssignAsHomework: b,
|
|
165
|
+
onNodeMarkAsDone: $,
|
|
166
|
+
onNodeReattempt: x,
|
|
167
|
+
onNodeReview: I,
|
|
168
|
+
onNodeView: v,
|
|
169
|
+
coreBlocksRef: W,
|
|
170
|
+
challengeBlockRef: F,
|
|
171
|
+
downloadCoreBlockRef: O,
|
|
172
|
+
downloadBlockRef: X,
|
|
173
|
+
onNodeUnassign: _,
|
|
174
|
+
onNodeUnlock: E,
|
|
175
|
+
onNodeSkipUnSkip: H,
|
|
176
|
+
onBlockReset: L
|
|
138
177
|
}
|
|
139
178
|
)
|
|
140
179
|
] })
|
|
141
180
|
]
|
|
142
181
|
}
|
|
143
182
|
);
|
|
144
|
-
}),
|
|
183
|
+
}), Pe = he;
|
|
145
184
|
export {
|
|
146
|
-
|
|
185
|
+
Pe as default
|
|
147
186
|
};
|
|
148
187
|
//# sourceMappingURL=chapter-details.js.map
|