@newskit-render/my-account 7.151.2 → 7.151.3-2b6f607b2.9
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/cjs/Components/Elements/CancellationConfirm/CancellationConfirm.d.ts +16 -0
- package/dist/cjs/Components/Elements/CancellationConfirm/CancellationConfirm.js +64 -0
- package/dist/cjs/Components/Elements/CancellationConfirm/CancellationConfirm.js.map +1 -0
- package/dist/cjs/Components/Elements/CancellationConfirm/index.d.ts +2 -0
- package/dist/cjs/Components/Elements/CancellationConfirm/index.js +6 -0
- package/dist/cjs/Components/Elements/CancellationConfirm/index.js.map +1 -0
- package/dist/cjs/Components/Elements/CancellationPolicy/CancellationPolicy.js +6 -2
- package/dist/cjs/Components/Elements/CancellationPolicy/CancellationPolicy.js.map +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/cjs/Components/Elements/OfferGroup/OfferBody.js +4 -4
- package/dist/cjs/Components/Elements/OfferGroup/OfferBody.js.map +1 -1
- package/dist/cjs/Components/Elements/SunArticleCard/SunArticleCard.d.ts +12 -8
- package/dist/cjs/Components/Elements/SunArticleCard/SunArticleCard.js +48 -12
- package/dist/cjs/Components/Elements/SunArticleCard/SunArticleCard.js.map +1 -1
- package/dist/cjs/Components/Elements/SunArticleGrid/SunArticleGrid.d.ts +2 -2
- package/dist/cjs/Components/Elements/SunArticleGrid/SunArticleGrid.js +2 -3
- package/dist/cjs/Components/Elements/SunArticleGrid/SunArticleGrid.js.map +1 -1
- package/dist/cjs/Components/Elements/SunOfferCard/SunOfferCard.d.ts +12 -7
- package/dist/cjs/Components/Elements/SunOfferCard/SunOfferCard.js +48 -11
- package/dist/cjs/Components/Elements/SunOfferCard/SunOfferCard.js.map +1 -1
- package/dist/cjs/Components/Elements/SunOfferGrid/SunOfferGrid.d.ts +2 -2
- package/dist/cjs/Components/Elements/SunOfferGrid/SunOfferGrid.js +2 -3
- package/dist/cjs/Components/Elements/SunOfferGrid/SunOfferGrid.js.map +1 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.d.ts +4 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js +28 -3
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/cjs/Components/Sections/CancelSubscription/CancelSubscription.d.ts +1 -1
- package/dist/cjs/Components/Sections/CancelSubscription/CancelSubscription.js +11 -17
- package/dist/cjs/Components/Sections/CancelSubscription/CancelSubscription.js.map +1 -1
- package/dist/cjs/Components/Sections/CancelSubscription/types.d.ts +2 -0
- package/dist/cjs/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js +54 -13
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/types.d.ts +29 -4
- package/dist/cjs/Components/Sections/CancellationReasons/CancellationReasons.d.ts +2 -1
- package/dist/cjs/Components/Sections/CancellationReasons/CancellationReasons.js +15 -3
- package/dist/cjs/Components/Sections/CancellationReasons/CancellationReasons.js.map +1 -1
- package/dist/cjs/Components/Sections/CancellationReview/CancellationReview.d.ts +4 -0
- package/dist/cjs/Components/Sections/CancellationReview/CancellationReview.js +148 -0
- package/dist/cjs/Components/Sections/CancellationReview/CancellationReview.js.map +1 -0
- package/dist/cjs/Components/Sections/CancellationReview/index.d.ts +2 -0
- package/dist/cjs/Components/Sections/CancellationReview/index.js +19 -0
- package/dist/cjs/Components/Sections/CancellationReview/index.js.map +1 -0
- package/dist/cjs/Components/Sections/CancellationReview/types.d.ts +23 -0
- package/dist/cjs/Components/Sections/CancellationReview/types.js +3 -0
- package/dist/cjs/Components/Sections/CancellationReview/types.js.map +1 -0
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.d.ts +1 -1
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js +6 -7
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js.map +1 -1
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/index.d.ts +2 -0
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/index.js.map +1 -1
- package/dist/cjs/Components/Sections/ContactSupport/ContactSupport.d.ts +2 -0
- package/dist/cjs/Components/Sections/ContactSupport/ContactSupport.js +43 -0
- package/dist/cjs/Components/Sections/ContactSupport/ContactSupport.js.map +1 -0
- package/dist/cjs/Components/Sections/ContactSupport/index.d.ts +2 -0
- package/dist/cjs/Components/Sections/ContactSupport/index.js +19 -0
- package/dist/cjs/Components/Sections/ContactSupport/index.js.map +1 -0
- package/dist/cjs/Components/Sections/ContactSupport/types.d.ts +21 -0
- package/dist/cjs/Components/Sections/ContactSupport/types.js +3 -0
- package/dist/cjs/Components/Sections/ContactSupport/types.js.map +1 -0
- package/dist/cjs/Components/Sections/ContentContainer/ContentContainer.js +4 -7
- package/dist/cjs/Components/Sections/ContentContainer/ContentContainer.js.map +1 -1
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.d.ts +30 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js +189 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.d.ts +21 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js +95 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.d.ts +9 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js +38 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js +2 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js +2 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js.map +1 -0
- package/dist/cjs/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/UserHub/SubscriptionDetailsSection.d.ts +1 -1
- package/dist/cjs/Components/Sections/UserHub/SubscriptionDetailsSection.js +7 -24
- package/dist/cjs/Components/Sections/UserHub/SubscriptionDetailsSection.js.map +1 -1
- package/dist/cjs/Components/Templates/CancellationStepperRender.d.ts +8 -6
- package/dist/cjs/Components/Templates/CancellationStepperRender.js +59 -21
- package/dist/cjs/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/cjs/Components/Templates/LayoutTemplate.js +29 -1
- package/dist/cjs/Components/Templates/LayoutTemplate.js.map +1 -1
- package/dist/cjs/Components/Templates/NewslettersRender.js +1 -0
- package/dist/cjs/Components/Templates/NewslettersRender.js.map +1 -1
- package/dist/cjs/Components/Templates/SubscriptionAndBillingRender.js +16 -2
- package/dist/cjs/Components/Templates/SubscriptionAndBillingRender.js.map +1 -1
- package/dist/cjs/Components/Templates/SunCancellationFlowRender.js +186 -23
- package/dist/cjs/Components/Templates/SunCancellationFlowRender.js.map +1 -1
- package/dist/cjs/Components/index.d.ts +1 -0
- package/dist/cjs/api/queryHandler.js +29 -14
- package/dist/cjs/api/queryHandler.js.map +1 -1
- package/dist/cjs/context/types.d.ts +11 -3
- package/dist/cjs/context/types.js.map +1 -1
- package/dist/cjs/getProviderProps.js +4 -0
- package/dist/cjs/getProviderProps.js.map +1 -1
- package/dist/cjs/helpers/apiHandlerUtils.js +1 -0
- package/dist/cjs/helpers/apiHandlerUtils.js.map +1 -1
- package/dist/cjs/helpers/cancellationOffersUtils.d.ts +55 -0
- package/dist/cjs/helpers/cancellationOffersUtils.js +149 -0
- package/dist/cjs/helpers/cancellationOffersUtils.js.map +1 -0
- package/dist/cjs/helpers/cancellationUtils.d.ts +20 -0
- package/dist/cjs/helpers/cancellationUtils.js +110 -1
- package/dist/cjs/helpers/cancellationUtils.js.map +1 -1
- package/dist/cjs/helpers/dataUtils.js +28 -2
- package/dist/cjs/helpers/dataUtils.js.map +1 -1
- package/dist/cjs/helpers/dmccVariant.d.ts +2 -0
- package/dist/cjs/helpers/dmccVariant.js +81 -0
- package/dist/cjs/helpers/dmccVariant.js.map +1 -0
- package/dist/cjs/helpers/featureFlagUtils.js +2 -2
- package/dist/cjs/helpers/featureFlagUtils.js.map +1 -1
- package/dist/cjs/helpers/index.d.ts +3 -0
- package/dist/cjs/helpers/index.js +3 -2
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/helpers/stringUtils.d.ts +1 -0
- package/dist/cjs/helpers/stringUtils.js +9 -0
- package/dist/cjs/helpers/stringUtils.js.map +1 -0
- package/dist/cjs/helpers/subscriptionsUtils.d.ts +6 -3
- package/dist/cjs/helpers/subscriptionsUtils.js +10 -4
- package/dist/cjs/helpers/subscriptionsUtils.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/pages/CancellationStepper/CancellationStepper.js +5 -5
- package/dist/cjs/pages/CancellationStepper/CancellationStepper.js.map +1 -1
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js +210 -12
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/cjs/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js +3 -0
- package/dist/cjs/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js.map +1 -1
- package/dist/cjs/pages/SunCancellationFlow/SunCancellationFlowContext.d.ts +37 -0
- package/dist/cjs/pages/SunCancellationFlow/SunCancellationFlowContext.js +57 -13
- package/dist/cjs/pages/SunCancellationFlow/SunCancellationFlowContext.js.map +1 -1
- package/dist/cjs/pages/UserHub/UserHubContext.js +1 -0
- package/dist/cjs/pages/UserHub/UserHubContext.js.map +1 -1
- package/dist/cjs/pages/types.d.ts +4 -0
- package/dist/cjs/queries/getContractPhases.js +1 -1
- package/dist/cjs/queries/getContractPhases.js.map +1 -1
- package/dist/cjs/queries/getIncentivePreview.d.ts +2 -0
- package/dist/cjs/queries/getIncentivePreview.js +11 -0
- package/dist/cjs/queries/getIncentivePreview.js.map +1 -0
- package/dist/cjs/queries/getUserSubscription.js +1 -1
- package/dist/cjs/queries/getUserSubscription.js.map +1 -1
- package/dist/cjs/queries/index.d.ts +2 -0
- package/dist/cjs/queries/index.js +2 -0
- package/dist/cjs/queries/index.js.map +1 -1
- package/dist/cjs/queries/mutateApplyIncentive.d.ts +2 -0
- package/dist/cjs/queries/mutateApplyIncentive.js +11 -0
- package/dist/cjs/queries/mutateApplyIncentive.js.map +1 -0
- package/dist/esm/Components/Elements/CancellationConfirm/CancellationConfirm.d.ts +16 -0
- package/dist/esm/Components/Elements/CancellationConfirm/CancellationConfirm.js +57 -0
- package/dist/esm/Components/Elements/CancellationConfirm/CancellationConfirm.js.map +1 -0
- package/dist/esm/Components/Elements/CancellationConfirm/index.d.ts +2 -0
- package/dist/esm/Components/Elements/CancellationConfirm/index.js +2 -0
- package/dist/esm/Components/Elements/CancellationConfirm/index.js.map +1 -0
- package/dist/esm/Components/Elements/CancellationPolicy/CancellationPolicy.js +6 -2
- package/dist/esm/Components/Elements/CancellationPolicy/CancellationPolicy.js.map +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/esm/Components/Elements/OfferGroup/OfferBody.js +4 -4
- package/dist/esm/Components/Elements/OfferGroup/OfferBody.js.map +1 -1
- package/dist/esm/Components/Elements/SunArticleCard/SunArticleCard.d.ts +12 -8
- package/dist/esm/Components/Elements/SunArticleCard/SunArticleCard.js +49 -13
- package/dist/esm/Components/Elements/SunArticleCard/SunArticleCard.js.map +1 -1
- package/dist/esm/Components/Elements/SunArticleGrid/SunArticleGrid.d.ts +2 -2
- package/dist/esm/Components/Elements/SunArticleGrid/SunArticleGrid.js +2 -3
- package/dist/esm/Components/Elements/SunArticleGrid/SunArticleGrid.js.map +1 -1
- package/dist/esm/Components/Elements/SunOfferCard/SunOfferCard.d.ts +12 -7
- package/dist/esm/Components/Elements/SunOfferCard/SunOfferCard.js +49 -12
- package/dist/esm/Components/Elements/SunOfferCard/SunOfferCard.js.map +1 -1
- package/dist/esm/Components/Elements/SunOfferGrid/SunOfferGrid.d.ts +2 -2
- package/dist/esm/Components/Elements/SunOfferGrid/SunOfferGrid.js +2 -3
- package/dist/esm/Components/Elements/SunOfferGrid/SunOfferGrid.js.map +1 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.d.ts +4 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js +28 -3
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/esm/Components/Sections/CancelSubscription/CancelSubscription.d.ts +1 -1
- package/dist/esm/Components/Sections/CancelSubscription/CancelSubscription.js +11 -17
- package/dist/esm/Components/Sections/CancelSubscription/CancelSubscription.js.map +1 -1
- package/dist/esm/Components/Sections/CancelSubscription/types.d.ts +2 -0
- package/dist/esm/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js +54 -13
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/types.d.ts +29 -4
- package/dist/esm/Components/Sections/CancellationReasons/CancellationReasons.d.ts +2 -1
- package/dist/esm/Components/Sections/CancellationReasons/CancellationReasons.js +13 -2
- package/dist/esm/Components/Sections/CancellationReasons/CancellationReasons.js.map +1 -1
- package/dist/esm/Components/Sections/CancellationReview/CancellationReview.d.ts +4 -0
- package/dist/esm/Components/Sections/CancellationReview/CancellationReview.js +120 -0
- package/dist/esm/Components/Sections/CancellationReview/CancellationReview.js.map +1 -0
- package/dist/esm/Components/Sections/CancellationReview/index.d.ts +2 -0
- package/dist/esm/Components/Sections/CancellationReview/index.js +3 -0
- package/dist/esm/Components/Sections/CancellationReview/index.js.map +1 -0
- package/dist/esm/Components/Sections/CancellationReview/types.d.ts +23 -0
- package/dist/esm/Components/Sections/CancellationReview/types.js +2 -0
- package/dist/esm/Components/Sections/CancellationReview/types.js.map +1 -0
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.d.ts +1 -1
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js +6 -7
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js.map +1 -1
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/index.d.ts +2 -0
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/index.js.map +1 -1
- package/dist/esm/Components/Sections/ContactSupport/ContactSupport.d.ts +2 -0
- package/dist/esm/Components/Sections/ContactSupport/ContactSupport.js +36 -0
- package/dist/esm/Components/Sections/ContactSupport/ContactSupport.js.map +1 -0
- package/dist/esm/Components/Sections/ContactSupport/index.d.ts +2 -0
- package/dist/esm/Components/Sections/ContactSupport/index.js +3 -0
- package/dist/esm/Components/Sections/ContactSupport/index.js.map +1 -0
- package/dist/esm/Components/Sections/ContactSupport/types.d.ts +21 -0
- package/dist/esm/Components/Sections/ContactSupport/types.js +2 -0
- package/dist/esm/Components/Sections/ContactSupport/types.js.map +1 -0
- package/dist/esm/Components/Sections/ContentContainer/ContentContainer.js +5 -8
- package/dist/esm/Components/Sections/ContentContainer/ContentContainer.js.map +1 -1
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.d.ts +30 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js +159 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.d.ts +21 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js +88 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.d.ts +9 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js +31 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js +2 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js +2 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js.map +1 -0
- package/dist/esm/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/esm/Components/Sections/UserHub/SubscriptionDetailsSection.d.ts +1 -1
- package/dist/esm/Components/Sections/UserHub/SubscriptionDetailsSection.js +9 -26
- package/dist/esm/Components/Sections/UserHub/SubscriptionDetailsSection.js.map +1 -1
- package/dist/esm/Components/Templates/CancellationStepperRender.d.ts +8 -6
- package/dist/esm/Components/Templates/CancellationStepperRender.js +60 -22
- package/dist/esm/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/esm/Components/Templates/LayoutTemplate.js +6 -1
- package/dist/esm/Components/Templates/LayoutTemplate.js.map +1 -1
- package/dist/esm/Components/Templates/NewslettersRender.js +1 -0
- package/dist/esm/Components/Templates/NewslettersRender.js.map +1 -1
- package/dist/esm/Components/Templates/SubscriptionAndBillingRender.js +16 -2
- package/dist/esm/Components/Templates/SubscriptionAndBillingRender.js.map +1 -1
- package/dist/esm/Components/Templates/SunCancellationFlowRender.js +187 -24
- package/dist/esm/Components/Templates/SunCancellationFlowRender.js.map +1 -1
- package/dist/esm/Components/index.d.ts +1 -0
- package/dist/esm/api/queryHandler.js +29 -14
- package/dist/esm/api/queryHandler.js.map +1 -1
- package/dist/esm/context/types.d.ts +11 -3
- package/dist/esm/context/types.js.map +1 -1
- package/dist/esm/getProviderProps.js +4 -0
- package/dist/esm/getProviderProps.js.map +1 -1
- package/dist/esm/helpers/apiHandlerUtils.js +2 -1
- package/dist/esm/helpers/apiHandlerUtils.js.map +1 -1
- package/dist/esm/helpers/cancellationOffersUtils.d.ts +55 -0
- package/dist/esm/helpers/cancellationOffersUtils.js +144 -0
- package/dist/esm/helpers/cancellationOffersUtils.js.map +1 -0
- package/dist/esm/helpers/cancellationUtils.d.ts +20 -0
- package/dist/esm/helpers/cancellationUtils.js +106 -0
- package/dist/esm/helpers/cancellationUtils.js.map +1 -1
- package/dist/esm/helpers/dataUtils.js +5 -2
- package/dist/esm/helpers/dataUtils.js.map +1 -1
- package/dist/esm/helpers/dmccVariant.d.ts +2 -0
- package/dist/esm/helpers/dmccVariant.js +76 -0
- package/dist/esm/helpers/dmccVariant.js.map +1 -0
- package/dist/esm/helpers/featureFlagUtils.js +2 -2
- package/dist/esm/helpers/featureFlagUtils.js.map +1 -1
- package/dist/esm/helpers/index.d.ts +3 -0
- package/dist/esm/helpers/index.js +3 -2
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/helpers/stringUtils.d.ts +1 -0
- package/dist/esm/helpers/stringUtils.js +5 -0
- package/dist/esm/helpers/stringUtils.js.map +1 -0
- package/dist/esm/helpers/subscriptionsUtils.d.ts +6 -3
- package/dist/esm/helpers/subscriptionsUtils.js +10 -4
- package/dist/esm/helpers/subscriptionsUtils.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/pages/CancellationStepper/CancellationStepper.js +5 -5
- package/dist/esm/pages/CancellationStepper/CancellationStepper.js.map +1 -1
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js +211 -13
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/esm/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js +3 -0
- package/dist/esm/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js.map +1 -1
- package/dist/esm/pages/SunCancellationFlow/SunCancellationFlowContext.d.ts +37 -0
- package/dist/esm/pages/SunCancellationFlow/SunCancellationFlowContext.js +57 -13
- package/dist/esm/pages/SunCancellationFlow/SunCancellationFlowContext.js.map +1 -1
- package/dist/esm/pages/UserHub/UserHubContext.js +1 -0
- package/dist/esm/pages/UserHub/UserHubContext.js.map +1 -1
- package/dist/esm/pages/types.d.ts +4 -0
- package/dist/esm/queries/getContractPhases.js +1 -1
- package/dist/esm/queries/getContractPhases.js.map +1 -1
- package/dist/esm/queries/getIncentivePreview.d.ts +2 -0
- package/dist/esm/queries/getIncentivePreview.js +8 -0
- package/dist/esm/queries/getIncentivePreview.js.map +1 -0
- package/dist/esm/queries/getUserSubscription.js +1 -1
- package/dist/esm/queries/getUserSubscription.js.map +1 -1
- package/dist/esm/queries/index.d.ts +2 -0
- package/dist/esm/queries/index.js +2 -0
- package/dist/esm/queries/index.js.map +1 -1
- package/dist/esm/queries/mutateApplyIncentive.d.ts +2 -0
- package/dist/esm/queries/mutateApplyIncentive.js +8 -0
- package/dist/esm/queries/mutateApplyIncentive.js.map +1 -0
- package/package.json +4 -4
|
@@ -9,6 +9,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
12
21
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
22
|
import { BackButton, ContentContainer, } from '@newskit-render/shared-components';
|
|
14
23
|
import { useAccountContext } from '../../context';
|
|
@@ -16,41 +25,54 @@ import { ContextName, } from '../../context/types';
|
|
|
16
25
|
import { useRouter, useSearchParams } from 'next/navigation';
|
|
17
26
|
import { CancellationReasons } from '../Sections/CancellationReasons';
|
|
18
27
|
import { CancellationDetails } from '../Sections/CancellationDetails';
|
|
19
|
-
import { replaceBaseURL, trackEvent } from '../../helpers';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
28
|
+
import { replaceBaseURL, trackEvent, } from '../../helpers';
|
|
29
|
+
import { ContactSupport } from '../Sections/ContactSupport';
|
|
30
|
+
import { CancellationReview } from '../Sections/CancellationReview';
|
|
22
31
|
import { EventTrigger, useInstrumentation } from 'newskit';
|
|
23
|
-
import { GridSection } from '../Sections/SectionContainer';
|
|
24
32
|
import { ConfirmCancellationRender } from '../Sections/ConfirmCancellation';
|
|
25
33
|
import { ConfirmSubscriptionOffer } from '../Sections/ConfirmSubscriptionOffer';
|
|
34
|
+
import { ACTIVE_SUBSCRIPTION } from '../../constants';
|
|
35
|
+
import { CancellationOffers } from '../Sections/CancellationOffers';
|
|
36
|
+
import { OfferPreview } from '../Sections/OfferPreview/OfferPreview';
|
|
37
|
+
import { CancelSubscriptionDowngrade } from '../Sections/CancelSubscriptionDowngrade';
|
|
26
38
|
export var componentMap = {
|
|
27
39
|
reason: CancellationReasons,
|
|
28
|
-
downgrade: CancelSubscriptionDowngrade,
|
|
29
40
|
preCancellation: CancellationDetails,
|
|
30
41
|
confirmCancel: ConfirmCancellationRender,
|
|
31
42
|
offers: CancellationOffers,
|
|
32
|
-
discountPreview: GridSection,
|
|
33
43
|
offerConfirmation: ConfirmSubscriptionOffer,
|
|
44
|
+
contactSupport: ContactSupport,
|
|
45
|
+
reviewCancellation: CancellationReview,
|
|
46
|
+
offerPreview: OfferPreview,
|
|
47
|
+
downgrade: CancelSubscriptionDowngrade,
|
|
34
48
|
};
|
|
35
49
|
var CancellationStepperRender = function () {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37
51
|
var contextName = ContextName.CancellationStepper;
|
|
38
|
-
var
|
|
52
|
+
var _j = useAccountContext(contextName), header = _j.header, components = _j.components, componentSequence = _j.componentSequence, showBackButton = _j.showBackButton, userData = _j.userData, baseUrl = _j.baseUrl, handleError = _j.handleError, featureFlags = _j.featureFlags;
|
|
39
53
|
var backButtonHref = (_a = header === null || header === void 0 ? void 0 : header.backButton) === null || _a === void 0 ? void 0 : _a.href;
|
|
40
54
|
var hederBackButtonProps = header === null || header === void 0 ? void 0 : header.backButton;
|
|
41
55
|
var router = useRouter();
|
|
42
56
|
var searchParams = useSearchParams();
|
|
43
|
-
var
|
|
44
|
-
|
|
57
|
+
var subscription = (_b = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _b === void 0 ? void 0 : _b[0];
|
|
58
|
+
var type = subscription === null || subscription === void 0 ? void 0 : subscription.type;
|
|
59
|
+
var isActiveSubscription = (subscription === null || subscription === void 0 ? void 0 : subscription.status) === ACTIVE_SUBSCRIPTION;
|
|
60
|
+
if (!subscription ||
|
|
61
|
+
!isActiveSubscription ||
|
|
62
|
+
!type ||
|
|
63
|
+
!componentSequence[type]) {
|
|
45
64
|
return null;
|
|
46
|
-
|
|
65
|
+
}
|
|
66
|
+
var _k = useState(null), selections = _k[0], setSelections = _k[1];
|
|
47
67
|
var pagesInOrder = componentSequence[type];
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
68
|
+
var _l = useState(null), overrideComponent = _l[0], setOverrideComponent = _l[1];
|
|
69
|
+
var _m = useState([]), filteredPages = _m[0], setFilteredPages = _m[1];
|
|
70
|
+
var _o = useState(((_d = (_c = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.serviceCancellationDate) || null), serviceCancellationDate = _o[0], setServiceCancellationDate = _o[1];
|
|
71
|
+
var _p = useState(), selectedOffer = _p[0], setSelectedOffer = _p[1];
|
|
72
|
+
var _q = useState(null), incentiveData = _q[0], setIncentiveData = _q[1];
|
|
52
73
|
var stepFromUrl = searchParams.get('step');
|
|
53
|
-
var
|
|
74
|
+
var returnUrl = searchParams.get('returnUrl');
|
|
75
|
+
var currentStepComponent = stepFromUrl || pagesInOrder[0];
|
|
54
76
|
var activePages = filteredPages.length > 0 ? filteredPages : pagesInOrder;
|
|
55
77
|
var stepIndex = activePages.findIndex(function (page) { return page === currentStepComponent; });
|
|
56
78
|
var SectionComponent = componentMap[currentStepComponent];
|
|
@@ -72,18 +94,35 @@ var CancellationStepperRender = function () {
|
|
|
72
94
|
}, []);
|
|
73
95
|
var handleBackBtn = function (event) {
|
|
74
96
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
97
|
+
var previousStep = activePages[stepIndex - 1];
|
|
75
98
|
if (overrideComponent) {
|
|
76
99
|
setOverrideComponent(null);
|
|
77
100
|
setFilteredPages([]);
|
|
78
|
-
|
|
101
|
+
if (previousStep) {
|
|
102
|
+
updateUrlWithStep(previousStep);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
router.back();
|
|
106
|
+
}
|
|
79
107
|
return;
|
|
80
108
|
}
|
|
81
109
|
if (stepIndex <= 0) {
|
|
110
|
+
if (returnUrl) {
|
|
111
|
+
router.push(returnUrl);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
82
114
|
router.push(replaceBaseURL(baseUrl || '', backButtonHref));
|
|
83
115
|
return;
|
|
84
116
|
}
|
|
85
117
|
updateUrlWithStep(activePages[stepIndex - 1]);
|
|
86
118
|
};
|
|
119
|
+
var addStep = function (step) {
|
|
120
|
+
if (!activePages.includes(step)) {
|
|
121
|
+
var newPages = __spreadArray([], activePages, true);
|
|
122
|
+
newPages.splice(stepIndex + 1, 0, step);
|
|
123
|
+
setFilteredPages(newPages);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
87
126
|
var stepController = function (event, override) {
|
|
88
127
|
var _a;
|
|
89
128
|
if (override === void 0) { override = null; }
|
|
@@ -95,7 +134,7 @@ var CancellationStepperRender = function () {
|
|
|
95
134
|
return;
|
|
96
135
|
}
|
|
97
136
|
setOverrideComponent(override);
|
|
98
|
-
|
|
137
|
+
addStep(override);
|
|
99
138
|
updateUrlWithStep(override);
|
|
100
139
|
};
|
|
101
140
|
var handleCardClick = function (_event, selectionData) {
|
|
@@ -124,7 +163,6 @@ var CancellationStepperRender = function () {
|
|
|
124
163
|
trigger: EventTrigger.Load,
|
|
125
164
|
context: __assign(__assign({}, context), { cancellation_type: ((_a = selections === null || selections === void 0 ? void 0 : selections.eventContext) === null || _a === void 0 ? void 0 : _a.article_parent_name) || '' }),
|
|
126
165
|
});
|
|
127
|
-
// track page view event via Optimizely
|
|
128
166
|
trackEvent({
|
|
129
167
|
eventName: "cancellation_".concat(stepFromUrl.toLocaleLowerCase()),
|
|
130
168
|
cpn: userData === null || userData === void 0 ? void 0 : userData.cpn,
|
|
@@ -135,10 +173,10 @@ var CancellationStepperRender = function () {
|
|
|
135
173
|
if (!currentStepComponent || !SectionComponent) {
|
|
136
174
|
return null;
|
|
137
175
|
}
|
|
138
|
-
var shouldShowBackButton = (
|
|
176
|
+
var shouldShowBackButton = (_e = componentProps === null || componentProps === void 0 ? void 0 : componentProps.showBackButton) !== null && _e !== void 0 ? _e : showBackButton;
|
|
139
177
|
return (React.createElement(ContentContainer, __assign({ "data-testid": "section-container" }, componentProps === null || componentProps === void 0 ? void 0 : componentProps.contentContainerOverrides),
|
|
140
|
-
shouldShowBackButton && hederBackButtonProps && (React.createElement(BackButton, { backButton: __assign(__assign({}, hederBackButtonProps), { href: '' }), backButtonOverrides: header.backButtonOverrides, eventContext: __assign(__assign({}, hederBackButtonProps === null || hederBackButtonProps === void 0 ? void 0 : hederBackButtonProps.eventContext), { page_name: (
|
|
141
|
-
React.createElement(SectionComponent, __assign({}, componentProps, { baseUrl: baseUrl, onNextStep: stepController, handleCardClick: handleCardClick, user: userData, selectedReason: selections, handleError: handleError, serviceCancellationDate: serviceCancellationDate, setServiceCancellationDate: setServiceCancellationDate, subType: ((
|
|
178
|
+
shouldShowBackButton && hederBackButtonProps && (React.createElement(BackButton, { backButton: __assign(__assign({}, hederBackButtonProps), { href: '' }), backButtonOverrides: header.backButtonOverrides, eventContext: __assign(__assign({}, hederBackButtonProps === null || hederBackButtonProps === void 0 ? void 0 : hederBackButtonProps.eventContext), { page_name: (_f = componentProps === null || componentProps === void 0 ? void 0 : componentProps.tealiumContext) === null || _f === void 0 ? void 0 : _f.context.page_name }), onClick: handleBackBtn })),
|
|
179
|
+
React.createElement(SectionComponent, __assign({}, componentProps, { baseUrl: baseUrl, onNextStep: stepController, handleCardClick: handleCardClick, user: userData, selectedReason: selections, handleError: handleError, serviceCancellationDate: serviceCancellationDate, setServiceCancellationDate: setServiceCancellationDate, subType: ((_h = (_g = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.type) || '', selectedOffer: selectedOffer, setSelectedOffer: setSelectedOffer, incentiveData: incentiveData, setIncentiveData: setIncentiveData, featureFlags: featureFlags }))));
|
|
142
180
|
};
|
|
143
181
|
export default CancellationStepperRender;
|
|
144
182
|
//# sourceMappingURL=CancellationStepperRender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancellationStepperRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/CancellationStepperRender.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CancellationStepperRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/CancellationStepperRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EACL,UAAU,EACV,gBAAgB,GAGjB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EACL,WAAW,GAEZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAEL,cAAc,EACd,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAA;AAErF,MAAM,CAAC,IAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,mBAAmB;IAC3B,eAAe,EAAE,m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est = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { useEffect } from 'react';
|
|
24
24
|
import { ThemeProvider, ToastProvider, MediaQueryProvider } from 'newskit';
|
|
25
25
|
import { sharedTheme } from '@newskit-render/shared-components';
|
|
26
26
|
import { AccountContextProvider } from '../../context';
|
|
27
|
+
import { enableDmccVariantOnSpaNavigation } from '../../helpers';
|
|
27
28
|
import Head from '../Elements/Head';
|
|
28
29
|
import LayoutContentContainer from '../Sections/LayoutContentContainer';
|
|
29
30
|
var withMediaQueryProvider = function (Component) {
|
|
@@ -35,6 +36,10 @@ var withMediaQueryProvider = function (Component) {
|
|
|
35
36
|
};
|
|
36
37
|
export var BaseLayoutTemplate = function (_a) {
|
|
37
38
|
var customTheme = _a.customTheme, context = _a.context, toastProviderProps = _a.toastProviderProps, contextName = _a.contextName, rest = __rest(_a, ["customTheme", "context", "toastProviderProps", "contextName"]);
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
var cleanup = enableDmccVariantOnSpaNavigation();
|
|
41
|
+
return cleanup;
|
|
42
|
+
}, []);
|
|
38
43
|
return (React.createElement(AccountContextProvider, { context: context, contextName: contextName },
|
|
39
44
|
React.createElement(Head, { contextName: contextName }),
|
|
40
45
|
React.createElement(ThemeProvider, { theme: customTheme || sharedTheme },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutTemplate.js","sourceRoot":"","sources":["../../../../src/Components/Templates/LayoutTemplate.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"LayoutTemplate.js","sourceRoot":"","sources":["../../../../src/Components/Templates/LayoutTemplate.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA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AAM,kBAAkB,EAAI,CACtD,CACO,CAC1B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,cAAc,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAA"}
|
|
@@ -57,6 +57,7 @@ export var NewslettersRender = function () {
|
|
|
57
57
|
}
|
|
58
58
|
return { filteredNewsletters: orderedNewsletters, featuredNewsletters: [] };
|
|
59
59
|
}, [newsletters, featuredNewsletterIds]), filteredNewsletters = _b.filteredNewsletters, featuredNewsletters = _b.featuredNewsletters;
|
|
60
|
+
console.log('newsletters', newsletters);
|
|
60
61
|
return (React.createElement(StyledRelativeWrapper, null,
|
|
61
62
|
React.createElement(Header, __assign({}, header)),
|
|
62
63
|
featuredNewsletters && featuredNewsletters.length !== 0 && (React.createElement(NewslettersList, { gridLayoutOverrides: gridLayoutOverrides, "data-testid": "newsletters-grid-featured" }, featuredNewsletters.map(function (newsletter) { return (React.createElement(NewsletterCard, { newsletter: newsletter, key: newsletter.bulletinId, cardOverrides: cardOverrides, cardContentOverrides: cardContentOverrides, headlineOverrides: headlineOverrides, frequencyOverrides: frequencyOverrides, textOverrides: textOverrides, newsletterImages: newsletterImages, switchButtonProps: switchButtonProps, handleError: handleError, handleShowSuccess: handleShowSuccess, handleLoading: handleLoading, genericErrorMessage: genericErrorMessage, errorMessages: errorMessages, tealiumContext: tealiumContext })); }))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewslettersRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/NewslettersRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,WA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,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC9B,CACH,EAlBwC,CAkBxC,CAAC,CACc,CACnB;QACA,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,IAAI,CAC1D,oBAAC,eAAe,IACd,mBAAmB,EAAE,mBAAmB,iBAC5B,kBAAkB,IAE7B,mBAAmB,CAAC,GAAG,CAAC,UAAC,UAAU,IAAK,OAAA,CACvC,oBAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,UAAU,CAAC,UAAU,EAC1B,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC9B,CACH,EAlBwC,CAkBxC,CAAC,CACc,CACnB,CACqB,CACzB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -40,14 +40,28 @@ var SubscriptionAndBillingRender = function (_a) {
|
|
|
40
40
|
tags: {},
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
}, []);
|
|
44
|
-
useEffect(function () {
|
|
45
43
|
if (window.location.hash === '#reminder-notices') {
|
|
46
44
|
var el = document.getElementById('reminder-notices');
|
|
47
45
|
if (el) {
|
|
48
46
|
el.scrollIntoView({ behavior: 'smooth' });
|
|
49
47
|
}
|
|
50
48
|
}
|
|
49
|
+
// Capture dmcc_email_variant query param and store as cookies (1 hour)
|
|
50
|
+
try {
|
|
51
|
+
var dmccParamToCapture = 'dmcc_email_variant';
|
|
52
|
+
var search = window.location.search;
|
|
53
|
+
if (search) {
|
|
54
|
+
var urlParams = new URLSearchParams(search);
|
|
55
|
+
var expires = new Date(Date.now() + 60 * 60 * 1000).toUTCString();
|
|
56
|
+
var val = urlParams.get(dmccParamToCapture);
|
|
57
|
+
if (val) {
|
|
58
|
+
document.cookie = "".concat(encodeURIComponent(dmccParamToCapture), "=").concat(encodeURIComponent(val), "; path=/; expires=").concat(expires, "; SameSite=Lax");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (_b) {
|
|
63
|
+
// swallow errors to avoid breaking page load
|
|
64
|
+
}
|
|
51
65
|
}, []);
|
|
52
66
|
// For backwards compatibility if multiple subscriptions are enabled by the context (i.e. componentType is cardComposable) then render all of them, otherwise just the first one
|
|
53
67
|
var subscriptions = ((_b = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _b === void 0 ? void 0 : _b.length) > 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionAndBillingRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/SubscriptionAndBillingRender.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AACpC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,uB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gBACrC,IAAI,EAAE,EAAE;aACT,CAAC,CAAA;QACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"SubscriptionAndBillingRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/SubscriptionAndBillingRender.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AACpC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,MAAM,EACN,mBAAmB,GACpB,MAAM,mCAAmC,CAAA;AAE1C,IAAM,kBAAkB,GAAG,UACzB,WAAmB,EACnB,IAAa,EACb,uBAAuC;IAEvC,IAAI,IAAI,IAAI,uBAAuB,EAAE,CAAC;QACpC,OAAO,WAAW;aACf,OAAO,CACN,4BAA4B,EAC5B,WAAW,CAAC,uBAAuB,CAAC,CACrC;aACA,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,WAAW,CAAC,OAAO,CACxB,+EAA+E,EAC/E,EAAE,CACH,CAAA;AACH,CAAC,CAAA;AAED,IAAM,4BAA4B,GAA+B,UAAC,EAEjE;;QADC,WAAW,iBAAA;IAEL,IAAA,KAWF,iBAAiB,CAAC,WAAW,CAAyC,EAVhE,aAAa,YAAA,EACrB,QAAQ,cAAA,EACR,cAAc,oBAAA,EACd,iBAAiB,uBAAA,EACjB,oBAAoB,0BAAA,EACpB,mBAAmB,yBAAA,EACnB,gBAAgB,sBAAA,EAChB,cAAc,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gBAC5C,CAAC,cAAc,CAAC,MAAM;gBACtB,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,cAAc,CAAC,aAAa,CAAC,IAAI,MAAK,IAAI,CAAA;YAE1D,IAAI,sBAAsB,IAAI,gBAAgB,EAAE,CAAC;gBAC/C,OAAO,CACL,oBAAC,kBAAkB,aAAC,GAAG,EAAE,YAAY,CAAC,EAAE,IAAM,gBAAgB,EAAI,CACnE,CAAA;YACH,CAAC;YAED,IAAI,sBAAsB,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAChD,OAAO,CACL;oBACE,oBAAC,eAAe,IACd,GAAG,EAAE,YAAY,CAAC,EAAE,EACpB,EAAE,EAAE,YAAY,CAAC,EAAE,EACnB,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,IAAI,GAC7B,CACD,CACJ,CAAA;YACH,CAAC;YAED,OAAO,CACL;gBACE,oBAAC,eAAe,IACd,GAAG,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,EACrB,EAAE,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,EACpB,WAAW,EAAE,WAAW,GACxB,CACD,CACJ,CAAA;QACH,CAAC,CAAC,CACD,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,4BAA4B,CAAA"}
|
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
import React, { useState, useMemo, useEffect } from 'react';
|
|
13
49
|
import { BackButton, Header } from '@newskit-render/shared-components';
|
|
14
50
|
import { useAccountContext } from '../../context';
|
|
@@ -16,27 +52,43 @@ import { randomizeCancellationReasons } from '../../helpers/randomizeReasons';
|
|
|
16
52
|
import { ContextName } from '../../context/types';
|
|
17
53
|
import { useRouter } from 'next/router';
|
|
18
54
|
import { Stack, TextBlock, Button, GridLayout } from 'newskit';
|
|
19
|
-
import { replaceBaseURL } from '../../helpers';
|
|
55
|
+
import { replaceBaseURL, fetchSunClubOffers, fetchSunClubArticles, } from '../../helpers';
|
|
20
56
|
import { CancellationReasonSelector, } from '../Elements/CancellationReasonSelector';
|
|
21
57
|
import { CancellationPolicy } from '../Elements/CancellationPolicy';
|
|
22
58
|
import { SunOfferGrid } from '../Elements/SunOfferGrid';
|
|
23
59
|
import { SunArticleGrid } from '../Elements/SunArticleGrid';
|
|
60
|
+
import { CancellationConfirm } from '../Elements/CancellationConfirm';
|
|
61
|
+
import { cancelSubscription } from '../../helpers/cancellationUtils';
|
|
24
62
|
var SunCancellationFlowRender = function () {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
26
64
|
var contextName = ContextName.SunCancellationFlow;
|
|
27
|
-
var
|
|
65
|
+
var _t = useAccountContext(contextName), header = _t.header, components = _t.components, componentSequence = _t.componentSequence, showBackButton = _t.showBackButton, userData = _t.userData, baseUrl = _t.baseUrl, handleError = _t.handleError, env = _t.env;
|
|
28
66
|
var router = useRouter();
|
|
29
67
|
var backButtonHref = (_a = header === null || header === void 0 ? void 0 : header.backButton) === null || _a === void 0 ? void 0 : _a.href;
|
|
30
68
|
var headerBackButtonProps = header === null || header === void 0 ? void 0 : header.backButton;
|
|
31
|
-
var
|
|
69
|
+
var _u = useState(false), isCancellingSubscription = _u[0], setIsCancellingSubscription = _u[1];
|
|
70
|
+
var _v = useState(null), serviceCancellationDate = _v[0], setServiceCancellationDate = _v[1];
|
|
71
|
+
// Get subscription ID from query params and find the correct subscription
|
|
72
|
+
var subscriptionIdFromQuery = router.query.id;
|
|
73
|
+
var subscription = subscriptionIdFromQuery
|
|
74
|
+
? (_b = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _b === void 0 ? void 0 : _b.find(function (sub) { return sub.id === subscriptionIdFromQuery; })
|
|
75
|
+
: (_c = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _c === void 0 ? void 0 : _c[0];
|
|
76
|
+
var type = (subscription === null || subscription === void 0 ? void 0 : subscription.type) || 'Digital';
|
|
32
77
|
if (!type || !componentSequence[type])
|
|
33
78
|
return null;
|
|
34
79
|
var pagesInOrder = componentSequence[type];
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
80
|
+
var _w = useState(0), currentStepIndex = _w[0], setCurrentStepIndex = _w[1];
|
|
81
|
+
var _x = useState(''), selectedReasonId = _x[0], setSelectedReasonId = _x[1];
|
|
82
|
+
var _y = useState(''), selectedReasonLabel = _y[0], setSelectedReasonLabel = _y[1];
|
|
83
|
+
var _z = useState([]), offers = _z[0], setOffers = _z[1];
|
|
84
|
+
var _0 = useState([]), articles = _0[0], setArticles = _0[1];
|
|
85
|
+
var _1 = useState(false), isLoadingOffers = _1[0], setIsLoadingOffers = _1[1];
|
|
86
|
+
var _2 = useState(false), isLoadingArticles = _2[0], setIsLoadingArticles = _2[1];
|
|
87
|
+
var _3 = useState(null), offersError = _3[0], setOffersError = _3[1];
|
|
88
|
+
var _4 = useState(null), articlesError = _4[0], setArticlesError = _4[1];
|
|
89
|
+
var nextBillCycleDate = (_d = subscription === null || subscription === void 0 ? void 0 : subscription.billingDetails) === null || _d === void 0 ? void 0 : _d.nextBillCycleDate;
|
|
90
|
+
var daysUntilBilling = nextBillCycleDate
|
|
91
|
+
? Math.ceil((new Date(nextBillCycleDate).getTime() - new Date().getTime()) /
|
|
40
92
|
(1000 * 60 * 60 * 24))
|
|
41
93
|
: undefined;
|
|
42
94
|
var currentStepKey = pagesInOrder[currentStepIndex];
|
|
@@ -46,13 +98,48 @@ var SunCancellationFlowRender = function () {
|
|
|
46
98
|
var selectReasonComponent = (_a = componentProps === null || componentProps === void 0 ? void 0 : componentProps.childComponents) === null || _a === void 0 ? void 0 : _a.find(function (child) { return child.type === 'reasonSelector'; });
|
|
47
99
|
return (selectReasonComponent === null || selectReasonComponent === void 0 ? void 0 : selectReasonComponent.reasons) || [];
|
|
48
100
|
}, [componentProps]);
|
|
49
|
-
var
|
|
101
|
+
var _5 = useState(originalReasons), randomizedReasons = _5[0], setRandomizedReasons = _5[1];
|
|
50
102
|
// Randomize only on client side after hydration otherwise SSR will mismatch and cause errors
|
|
51
103
|
useEffect(function () {
|
|
52
104
|
if (originalReasons.length > 0) {
|
|
53
105
|
setRandomizedReasons(randomizeCancellationReasons(originalReasons));
|
|
54
106
|
}
|
|
55
107
|
}, [originalReasons]);
|
|
108
|
+
useEffect(function () {
|
|
109
|
+
var isViewOffersStep = currentStepKey === 'viewOffers';
|
|
110
|
+
if (isViewOffersStep && env) {
|
|
111
|
+
var sunclubUrl = env.SUNCLUB_URL || '';
|
|
112
|
+
var tronApiUrl = env.TRON_API_URL || '';
|
|
113
|
+
var apiGatewayUrl = env.API_GATEWAY_URL || '';
|
|
114
|
+
setIsLoadingOffers(true);
|
|
115
|
+
setOffersError(null);
|
|
116
|
+
fetchSunClubOffers(sunclubUrl, apiGatewayUrl)
|
|
117
|
+
.then(function (mappedOffers) {
|
|
118
|
+
setOffers(mappedOffers);
|
|
119
|
+
})
|
|
120
|
+
.catch(function (err) {
|
|
121
|
+
setOffersError('Failed to load offers');
|
|
122
|
+
console.error('Error fetching offers:', err);
|
|
123
|
+
})
|
|
124
|
+
.finally(function () {
|
|
125
|
+
setIsLoadingOffers(false);
|
|
126
|
+
});
|
|
127
|
+
// Already mapped in the helper
|
|
128
|
+
setIsLoadingArticles(true);
|
|
129
|
+
setArticlesError(null);
|
|
130
|
+
fetchSunClubArticles(tronApiUrl)
|
|
131
|
+
.then(function (mappedArticles) {
|
|
132
|
+
setArticles(mappedArticles);
|
|
133
|
+
})
|
|
134
|
+
.catch(function (err) {
|
|
135
|
+
setArticlesError('Failed to load articles');
|
|
136
|
+
console.error('Error fetching articles:', err);
|
|
137
|
+
})
|
|
138
|
+
.finally(function () {
|
|
139
|
+
setIsLoadingArticles(false);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, [currentStepKey]);
|
|
56
143
|
var handleBackBtn = function (event) {
|
|
57
144
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
58
145
|
if (currentStepIndex <= 0) {
|
|
@@ -67,33 +154,109 @@ var SunCancellationFlowRender = function () {
|
|
|
67
154
|
setCurrentStepIndex(nextIndex);
|
|
68
155
|
}
|
|
69
156
|
};
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
157
|
+
var showCancellationError = function () {
|
|
158
|
+
handleError === null || handleError === void 0 ? void 0 : handleError('cancellation', {}, 'Unable to cancel subscription. Please try again.', undefined, 4000);
|
|
159
|
+
};
|
|
160
|
+
var handleConfirmCancellation = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
161
|
+
var reason, response, parsedResponse, _a;
|
|
162
|
+
var _b, _c;
|
|
163
|
+
return __generator(this, function (_d) {
|
|
164
|
+
switch (_d.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
/* istanbul ignore if -- @preserve defensive guard, button is disabled during loading */
|
|
167
|
+
if (isCancellingSubscription)
|
|
168
|
+
return [2 /*return*/];
|
|
169
|
+
reason = selectedReasonLabel || 'User cancelled subscription';
|
|
170
|
+
if (!(subscription === null || subscription === void 0 ? void 0 : subscription.id)) {
|
|
171
|
+
showCancellationError();
|
|
172
|
+
return [2 /*return*/];
|
|
173
|
+
}
|
|
174
|
+
setIsCancellingSubscription(true);
|
|
175
|
+
_d.label = 1;
|
|
176
|
+
case 1:
|
|
177
|
+
_d.trys.push([1, 6, 7, 8]);
|
|
178
|
+
return [4 /*yield*/, cancelSubscription(subscription.id, reason)];
|
|
179
|
+
case 2:
|
|
180
|
+
response = _d.sent();
|
|
181
|
+
if (!!(response === null || response === void 0 ? void 0 : response.ok)) return [3 /*break*/, 3];
|
|
182
|
+
showCancellationError();
|
|
183
|
+
return [3 /*break*/, 5];
|
|
184
|
+
case 3: return [4 /*yield*/, response.json()];
|
|
185
|
+
case 4:
|
|
186
|
+
parsedResponse = _d.sent();
|
|
187
|
+
setServiceCancellationDate((_c = (_b = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.data) === null || _b === void 0 ? void 0 : _b.cancelSubscriptionV2) === null || _c === void 0 ? void 0 : _c.serviceCancellationDate);
|
|
188
|
+
handleNextStep();
|
|
189
|
+
_d.label = 5;
|
|
190
|
+
case 5: return [3 /*break*/, 8];
|
|
191
|
+
case 6:
|
|
192
|
+
_a = _d.sent();
|
|
193
|
+
showCancellationError();
|
|
194
|
+
return [3 /*break*/, 8];
|
|
195
|
+
case 7:
|
|
196
|
+
setIsCancellingSubscription(false);
|
|
197
|
+
return [7 /*endfinally*/];
|
|
198
|
+
case 8: return [2 /*return*/];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}); };
|
|
202
|
+
var shouldShowBackButton = (_e = componentProps === null || componentProps === void 0 ? void 0 : componentProps.showBackButton) !== null && _e !== void 0 ? _e : showBackButton;
|
|
203
|
+
return (React.createElement(React.Fragment, null,
|
|
204
|
+
shouldShowBackButton && headerBackButtonProps && (React.createElement(BackButton, { backButton: __assign(__assign({}, headerBackButtonProps), { href: '' }), backButtonOverrides: header.backButtonOverrides, eventContext: __assign(__assign({}, headerBackButtonProps === null || headerBackButtonProps === void 0 ? void 0 : headerBackButtonProps.eventContext), { page_name: (_g = (_f = componentProps === null || componentProps === void 0 ? void 0 : componentProps.tealiumContext) === null || _f === void 0 ? void 0 : _f.context) === null || _g === void 0 ? void 0 : _g.page_name }), onClick: handleBackBtn })),
|
|
73
205
|
React.createElement(Stack, { flow: "vertical-stretch", stackDistribution: "flex-start", spaceStack: "space060" },
|
|
74
206
|
(componentProps === null || componentProps === void 0 ? void 0 : componentProps.header) && React.createElement(Header, __assign({}, componentProps.header)),
|
|
75
|
-
(componentProps === null || componentProps === void 0 ? void 0 : componentProps.stepText) && (React.createElement(TextBlock, __assign({}, componentProps === null || componentProps === void 0 ? void 0 : componentProps.stepTextOverrides), componentProps.stepText)),
|
|
76
|
-
|
|
207
|
+
(componentProps === null || componentProps === void 0 ? void 0 : componentProps.stepText) && (React.createElement(TextBlock, __assign({}, componentProps === null || componentProps === void 0 ? void 0 : componentProps.stepTextOverrides), componentProps.stepText)),
|
|
208
|
+
(componentProps === null || componentProps === void 0 ? void 0 : componentProps.daysRemainingText) &&
|
|
209
|
+
daysUntilBilling !== undefined && (React.createElement(TextBlock, __assign({}, componentProps === null || componentProps === void 0 ? void 0 : componentProps.daysRemainingTextOverrides), componentProps.daysRemainingText.replace('##DAYS_REMAINING##', String(daysUntilBilling)))), (_h = componentProps === null || componentProps === void 0 ? void 0 : componentProps.childComponents) === null || _h === void 0 ? void 0 :
|
|
210
|
+
_h.map(function (child, index) {
|
|
77
211
|
if (child.type === 'reasonSelector' && child.reasons) {
|
|
78
|
-
return (React.createElement(CancellationReasonSelector, { key: index, reasons: randomizedReasons, selectedReasonId: selectedReasonId, onSelect:
|
|
212
|
+
return (React.createElement(CancellationReasonSelector, { key: index, reasons: randomizedReasons, selectedReasonId: selectedReasonId, onSelect: function (id) {
|
|
213
|
+
var _a, _b;
|
|
214
|
+
setSelectedReasonId(id);
|
|
215
|
+
var reasonLabel = (_b = (_a = child.reasons) === null || _a === void 0 ? void 0 : _a.find(function (r) { return r.id === id; })) === null || _b === void 0 ? void 0 : _b.label;
|
|
216
|
+
if (reasonLabel) {
|
|
217
|
+
setSelectedReasonLabel(reasonLabel);
|
|
218
|
+
}
|
|
219
|
+
} }));
|
|
79
220
|
}
|
|
80
221
|
if (child.type === 'policy') {
|
|
81
222
|
return (React.createElement(CancellationPolicy, { key: index, title: child.policyTitle, message: child.policyMessage, daysUntilBilling: daysUntilBilling }));
|
|
82
223
|
}
|
|
83
|
-
if (child.type === 'offers'
|
|
84
|
-
|
|
224
|
+
if (child.type === 'offers') {
|
|
225
|
+
var offersToRender = offers.length > 0 ? offers : child.offers || [];
|
|
226
|
+
if (isLoadingOffers) {
|
|
227
|
+
return (React.createElement(Stack, { key: index, flow: "vertical-center", stackDistribution: "center", paddingBlock: "space060" },
|
|
228
|
+
React.createElement(TextBlock, { typographyPreset: "utilityBody020", stylePreset: "inkSubtle" }, "Loading offers...")));
|
|
229
|
+
}
|
|
230
|
+
if (offersError) {
|
|
231
|
+
return (React.createElement(Stack, { key: index, flow: "vertical-center", stackDistribution: "center", paddingBlock: "space060" },
|
|
232
|
+
React.createElement(TextBlock, { typographyPreset: "utilityBody020", stylePreset: "inkNegative" }, offersError)));
|
|
233
|
+
}
|
|
234
|
+
return (React.createElement(SunOfferGrid, { key: index, offers: offersToRender, onOfferClick: child.onOfferClick, placeholderText: child.placeholderText, overrides: child.overrides }));
|
|
235
|
+
}
|
|
236
|
+
if (child.type === 'articles') {
|
|
237
|
+
var articlesToRender = articles.length > 0 ? articles : child.articles || [];
|
|
238
|
+
if (isLoadingArticles) {
|
|
239
|
+
return (React.createElement(Stack, { key: index, flow: "vertical-center", stackDistribution: "center", paddingBlock: "space060" },
|
|
240
|
+
React.createElement(TextBlock, { typographyPreset: "utilityBody020", stylePreset: "inkSubtle" }, "Loading articles...")));
|
|
241
|
+
}
|
|
242
|
+
if (articlesError) {
|
|
243
|
+
return (React.createElement(Stack, { key: index, flow: "vertical-center", stackDistribution: "center", paddingBlock: "space060" },
|
|
244
|
+
React.createElement(TextBlock, { typographyPreset: "utilityBody020", stylePreset: "inkNegative" }, articlesError)));
|
|
245
|
+
}
|
|
246
|
+
return (React.createElement(SunArticleGrid, { key: index, articles: articlesToRender, onArticleClick: child.onArticleClick, placeholderText: child.placeholderText, overrides: child.overrides }));
|
|
85
247
|
}
|
|
86
|
-
if (child.type === '
|
|
87
|
-
|
|
248
|
+
if (child.type === 'confirm') {
|
|
249
|
+
var endDate = serviceCancellationDate || nextBillCycleDate;
|
|
250
|
+
return (React.createElement(CancellationConfirm, { key: index, endDate: endDate || undefined, confirmButtonText: child.confirmButtonText, infoMessage: child.infoMessage, onConfirm: handleConfirmCancellation, isLoading: isCancellingSubscription, confirmButtonEventContext: child.confirmButtonEventContext }));
|
|
88
251
|
}
|
|
89
252
|
return null;
|
|
90
253
|
}),
|
|
91
|
-
React.createElement(GridLayout, { columns:
|
|
92
|
-
React.createElement(Button, { size: ((
|
|
93
|
-
React.createElement(Button, { size: ((
|
|
254
|
+
!((_j = componentProps === null || componentProps === void 0 ? void 0 : componentProps.childComponents) === null || _j === void 0 ? void 0 : _j.some(function (child) { return child.type === 'confirm'; })) && (React.createElement(GridLayout, { columns: { xs: '1fr', sm: '1fr 1fr' }, columnGap: "space040", rowGap: "space040", overrides: { marginBlockStart: 'space040', width: '100%' } },
|
|
255
|
+
React.createElement(Button, { size: ((_k = componentProps === null || componentProps === void 0 ? void 0 : componentProps.secondaryButton) === null || _k === void 0 ? void 0 : _k.size) || 'medium', href: ((_l = componentProps === null || componentProps === void 0 ? void 0 : componentProps.secondaryButton) === null || _l === void 0 ? void 0 : _l.href) || '', eventContext: (_m = componentProps === null || componentProps === void 0 ? void 0 : componentProps.secondaryButton) === null || _m === void 0 ? void 0 : _m.eventContext, eventOriginator: "secondary-button", overrides: { width: '100%' } }, (_o = componentProps === null || componentProps === void 0 ? void 0 : componentProps.secondaryButton) === null || _o === void 0 ? void 0 : _o.text),
|
|
256
|
+
React.createElement(Button, { size: ((_p = componentProps === null || componentProps === void 0 ? void 0 : componentProps.primaryButton) === null || _p === void 0 ? void 0 : _p.size) || 'medium', onClick: handleNextStep, eventContext: (_q = componentProps === null || componentProps === void 0 ? void 0 : componentProps.primaryButton) === null || _q === void 0 ? void 0 : _q.eventContext, eventOriginator: "primary-button", disabled: ((_r = componentProps === null || componentProps === void 0 ? void 0 : componentProps.childComponents) === null || _r === void 0 ? void 0 : _r.some(function (child) { return child.type === 'reasonSelector'; })) && !selectedReasonId, overrides: {
|
|
94
257
|
width: '100%',
|
|
95
258
|
stylePreset: 'buttonOutlinedPrimary',
|
|
96
|
-
} }, (
|
|
259
|
+
} }, (_s = componentProps === null || componentProps === void 0 ? void 0 : componentProps.primaryButton) === null || _s === void 0 ? void 0 : _s.text))))));
|
|
97
260
|
};
|
|
98
261
|
export default SunCancellationFlowRender;
|
|
99
262
|
//# sourceMappingURL=SunCancellationFlowRender.js.map
|