@solvimon/solvimon-web 0.1.0-alpha.24 → 0.1.0-alpha.26
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/README.md +14 -11
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DW10rozs.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DcrLNA_x.mjs} +6 -6
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jWthTJk-.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js} +1 -1
- package/dist/{Avatar.vue.es-nr8srGuK.js → Avatar.vue.es-Bm6MCMAL.js} +1 -1
- package/dist/{Avatar.vue.es-DzjFvLuK.mjs → Avatar.vue.es-BqQHvLGA.mjs} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-C1prOJay.js → BillingInformation.vue_vue_type_script_setup_true_lang-0JHnqIpC.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BptcwJMr.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BFza7Nf9.mjs} +8 -8
- package/dist/{Button.vue.es-PbJFK8z7.mjs → Button.vue.es-C32_baQN.mjs} +1 -1
- package/dist/{Button.vue.es-TCF-bvDF.js → Button.vue.es-qGvnOKnK.js} +1 -1
- package/dist/ChargeOnDemandModal-CIiI74ls.mjs +983 -0
- package/dist/ChargeOnDemandModal-DIQaGnRs.js +1 -0
- package/dist/Checkout.entry.ce-8EcavNgT.js +2 -0
- package/dist/{Checkout.entry.ce-DHFx5Vnb.mjs → Checkout.entry.ce-BA5ljKj8.mjs} +1562 -1538
- package/dist/{Chip.vue.es-DpcOM3Ai.mjs → Chip.vue.es-CKCOY5T6.mjs} +2 -2
- package/dist/{Chip.vue.es-CAoisngJ.js → Chip.vue.es-D60gTbfe.js} +1 -1
- package/dist/{ContextMenu.vue.es-kzZ3JJHG.js → ContextMenu.vue.es-C7KI8Gz6.js} +1 -1
- package/dist/{ContextMenu.vue.es-tAuFp-6i.mjs → ContextMenu.vue.es-Da-lAmTl.mjs} +10 -10
- package/dist/{CustomerBillingInformation.vue.es-BQSl9q6W.mjs → CustomerBillingInformation.vue.es-BxBQt4Q0.mjs} +2 -2
- package/dist/{CustomerBillingInformation.vue.es-Nac6HgLo.js → CustomerBillingInformation.vue.es-bFUx81Ig.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-R47ln7Wb.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BcTZgshS.mjs} +6 -6
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BOLf-U0A.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C0lJ_ESU.js} +1 -1
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CaNXS48v.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DkbQ2MiR.mjs} +908 -891
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-hBo2Y2mJ.js +1 -0
- package/dist/{DividerText.vue.es-LJ2kZakb.js → DividerText.vue.es-BF3gnr4e.js} +1 -1
- package/dist/{DividerText.vue.es-CSE7a-T0.mjs → DividerText.vue.es-DKl3FnDJ.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DeotDsFP.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3QYra1x.mjs} +4 -4
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-GNPyrcAQ.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js} +1 -1
- package/dist/{ErrorNotification.vue.es-BF6swP7o.js → ErrorNotification.vue.es-BX9dHEc-.js} +1 -1
- package/dist/{ErrorNotification.vue.es-CVUuIt8Z.mjs → ErrorNotification.vue.es-rRKgmkzV.mjs} +1 -1
- package/dist/{IconButton.vue.es-CB1lIPao.js → IconButton.vue.es-Bwdfu-jm.js} +1 -1
- package/dist/{IconButton.vue.es-DGflbWFk.mjs → IconButton.vue.es-UlqwNPAX.mjs} +2 -2
- package/dist/{IconTitle.vue.es-BsdjyGlQ.mjs → IconTitle.vue.es-CK9k69tV.mjs} +3 -3
- package/dist/{IconTitle.vue.es-CMO8EyQl.js → IconTitle.vue.es-Cei98MBw.js} +1 -1
- package/dist/{Input.vue.es-CREdT4nB.js → Input.vue.es-B47l_feL.js} +1 -1
- package/dist/{Input.vue.es-BFbiFXsU.mjs → Input.vue.es-D9IjIWc-.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BZ4D_-7E.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DKlPrxQS.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Btv0rRk4.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DUfJl07Y.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-CrZq0d1M.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-D9Rtgapa.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-j-cNIRD_.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DlJ6lELc.js} +1 -1
- package/dist/InvoiceSummary.vue.es-DBnR9Hs7.js +1 -0
- package/dist/{InvoiceSummary.vue.es-JtOIQ6SJ.mjs → InvoiceSummary.vue.es-DQ4KvTaw.mjs} +576 -565
- package/dist/{Modal.vue.es-BbdtdxsO.js → Modal.vue.es-8LN4gBh0.js} +1 -1
- package/dist/{Modal.vue.es-jT61xK_A.mjs → Modal.vue.es-B9xMiyn3.mjs} +5 -5
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-BBoZVnsK.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-B1yGKkWN.js} +1 -1
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-Dan29qmH.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BVzL2PGe.mjs} +4 -4
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D34fD3Io.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DSGf6uFP.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BJZHkTqA.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-nLTPnH4j.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-quvnCSFV.mjs → PaymentHistoryBlock-DYa99P1M.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-Dw2wOiAI.js → PaymentHistoryBlock-Ds93gNvh.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C0XIdBbx.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CBZhXQfC.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-5ckQd9eQ.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D0KnSy0y.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-D1oJREmH.js → PaymentIntegrationForm-B_Db4DG1.js} +1 -1
- package/dist/{PaymentIntegrationForm-CQjUZi22.mjs → PaymentIntegrationForm-UWoyZgsR.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C0J37ZVe.js +1 -0
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-J15IDbMc.mjs +154 -0
- package/dist/{PaymentIntegrationFormAdyen-CyZk9ofV.mjs → PaymentIntegrationFormAdyen-D4qfNtZ_.mjs} +217 -197
- package/dist/PaymentIntegrationFormAdyen-HeA9XIj-.js +98 -0
- package/dist/{PaymentIntegrationFormStripe-D-GaLHwc.mjs → PaymentIntegrationFormStripe-BIiMCWlV.mjs} +247 -220
- package/dist/PaymentIntegrationFormStripe-DUCJTIAq.js +102 -0
- package/dist/PaymentMethod.vue.es-CJcSZ9lN.js +1 -0
- package/dist/{PaymentMethod.vue.es-C0j580g7.mjs → PaymentMethod.vue.es-CKu5nApX.mjs} +168 -148
- package/dist/{PaymentMethodForm-CDV5LR8i.js → PaymentMethodForm-1d0YIGOu.js} +1 -1
- package/dist/{PaymentMethodForm-Bf2Ps6eV.mjs → PaymentMethodForm-B05sHWcW.mjs} +1 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-BDm8l_6N.js +1 -0
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-BqPu7CYA.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-D1yIYsb_.mjs} +45 -41
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-BIX0k7-q.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BE4S26JX.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-9MUPbgWM.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DGpXRtp4.mjs} +6 -6
- package/dist/PlanCustomizationEditor-CEMP_Dhz.js +1 -0
- package/dist/PlanCustomizationEditor-CpZeilm5.mjs +694 -0
- package/dist/{PricingGroupRangeInput.vue.es-CP7-dmxS.mjs → PricingGroupRangeInput.vue.es-CJpvUP3-.mjs} +4 -4
- package/dist/{PricingGroupRangeInput.vue.es-BchXhunH.js → PricingGroupRangeInput.vue.es-DZSJ5Mz0.js} +1 -1
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DJ81eUJX.mjs +141 -0
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-jrkraJMu.js +1 -0
- package/dist/{RadioGroupExtended.vue.es-_QMReyZ8.mjs → RadioGroupExtended.vue.es-BalV7gwp.mjs} +2 -2
- package/dist/{RadioGroupExtended.vue.es-Cf5R1P9a.js → RadioGroupExtended.vue.es-Dt6LH9Yh.js} +1 -1
- package/dist/{Section.vue.es-KRsHeFoT.mjs → Section.vue.es-D7eiXUbk.mjs} +1 -1
- package/dist/{Section.vue.es-CBZx5x53.js → Section.vue.es-zVXBHAL6.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-UdGQMJGY.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BdjYFrVC.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVELHoUj.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DudMRVka.mjs} +6 -6
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs → Skeleton.vue_vue_type_script_setup_true_lang-D60YtA9z.mjs} +5 -5
- package/dist/StepInput.vue.es-C3Zm6Wc9.mjs +199 -0
- package/dist/StepInput.vue.es-mAnuCuDQ.js +1 -0
- package/dist/SubscriptionDetails.entry.ce-D4CsSoR9.js +1 -0
- package/dist/SubscriptionDetails.entry.ce-WEimiOex.mjs +1057 -0
- package/dist/{SubscriptionSchedules-1ikoGncQ.js → SubscriptionSchedules-Cm5Dt-1H.js} +1 -1
- package/dist/{SubscriptionSchedules-B6b6xf-E.mjs → SubscriptionSchedules-DrrEAPlx.mjs} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Dv2bP9vv.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DHp_KtbF.mjs} +2284 -2341
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-t2Awijf5.js +1 -0
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DvYZvTV9.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-3VYfm6Hm.mjs} +3 -3
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DZKl0Zxp.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DTjZcOhj.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bu-_clEa.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DmeIKMYI.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DFU0IULg.mjs} +8 -8
- package/dist/{TooltipParagraph.vue.es-nGFfHF1A.mjs → TooltipParagraph.vue.es-BXbOJmjr.mjs} +3 -3
- package/dist/TooltipParagraph.vue.es-Cph6zT31.js +1 -0
- package/dist/{TrialChip.vue.es-DhC5Bpmy.js → TrialChip.vue.es-C_wgHGuN.js} +1 -1
- package/dist/{TrialChip.vue.es-eKgO6an3.mjs → TrialChip.vue.es-C_yRujip.mjs} +2 -2
- package/dist/{cn.es-BD7Afj5Q.mjs → cn.es-CGa6b2Lt.mjs} +2 -2
- package/dist/{cn.es-BLE3T5Rx.js → cn.es-D9YMDvG2.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +246 -230
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +201 -212
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +4 -4
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
- package/dist/{customElements-CSzbVZIH.js → customElements-C963-LtW.js} +36 -32
- package/dist/{customElements-DT1YyL4O.mjs → customElements-D5DAoHRI.mjs} +231 -196
- package/dist/{customer-Cq4fF__H.mjs → customer-DKa1B2vp.mjs} +4 -4
- package/dist/{customer-CJonIvSm.js → customer-TE1FnGT0.js} +1 -1
- package/dist/{de-DE-BSlbAnPE.js → de-DE-B4TUdnUf.js} +1 -1
- package/dist/{de-DE-CyvjSD9b.mjs → de-DE-CLfzTbbX.mjs} +39 -6
- package/dist/de-DE-DaBBl-Ak.js +1 -0
- package/dist/{de-DE-DXsG-vXA.mjs → de-DE-jkW2dJrX.mjs} +28 -14
- package/dist/en-US-BNevqm0M.js +1 -0
- package/dist/{en-US-xQrWj8qI.mjs → en-US-D6SGRAch.mjs} +39 -6
- package/dist/en-US-J85TQRI8.js +1 -0
- package/dist/{en-US-C939IZ5i.mjs → en-US-SDhjlY_v.mjs} +20 -5
- package/dist/formControl-ODrpUvcA.js +1 -0
- package/dist/{index-BPU8tIml.mjs → formControl-dX7l8o3c.mjs} +160 -143
- package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +4 -0
- package/dist/icon-sprite.svg.es-Ds6lDf5p.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{invoices-EamWI_jz.js → invoices-ClqTWYF9.js} +1 -1
- package/dist/{invoices-CVZOfEOY.mjs → invoices-DJTwftJv.mjs} +1 -1
- package/dist/it-IT-BkPbTueL.js +1 -0
- package/dist/{it-IT-DT3rfjOY.js → it-IT-CSYvGmpT.js} +1 -1
- package/dist/{it-IT-BxpwB3oJ.mjs → it-IT-CaaFToGB.mjs} +20 -6
- package/dist/{it-IT-C09oObBM.mjs → it-IT-Cym1UvvK.mjs} +39 -6
- package/dist/{nl-NL-DfkhOJKc.js → nl-NL-CpE4IgwO.js} +1 -1
- package/dist/{nl-NL-na2I4aiP.mjs → nl-NL-D0MQKaql.mjs} +34 -20
- package/dist/{nl-NL-BhNND_yi.mjs → nl-NL-D0c4x5C0.mjs} +39 -6
- package/dist/nl-NL-jIfAVGv0.js +1 -0
- package/dist/paymentMethods-AL2U_byg.js +1 -0
- package/dist/{paymentMethods-By1SebnO.mjs → paymentMethods-CWzJhcWK.mjs} +16 -14
- package/dist/{payments-Dnjg9Se4.js → payments-BmiHMlQt.js} +1 -1
- package/dist/{payments-BYZLQTJ-.mjs → payments-aXyfylwk.mjs} +6 -6
- package/dist/pricing.es-C07bgEZx.js +1 -0
- package/dist/pricing.es-QYWrKMUJ.mjs +30 -0
- package/dist/pricingPlanSchedules-BD4GIP_F.mjs +32 -0
- package/dist/pricingPlanSchedules-BfsMSvN0.js +1 -0
- package/dist/screens/Checkout/Checkout.cjs +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +10 -10
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +57 -55
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +9 -9
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +3 -769
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +243 -270
- package/dist/{subscription-CrVOr5MF.mjs → subscription-D1yHKUNc.mjs} +2 -2
- package/dist/{subscriptions-BKER9RUc.js → subscriptions-Cm83ckfl.js} +1 -1
- package/dist/{subscriptions-Gj3KgCZz.mjs → subscriptions-cnR5fnf7.mjs} +1 -1
- package/dist/types/components/{wallets/WalletModalShell.types.d.ts → payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts} +3 -3
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +5 -0
- package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +5 -9
- package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/ConfigProvider/ConfigProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/CssOverridesProvider/CssOverridesProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +7 -11
- package/dist/types/components/providers/ExperimentalFeatureProvider/ExperimentalFeatureProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/HostElementProvider/HostElementProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/Provider/Provider.vue.d.ts +7 -11
- package/dist/types/components/providers/TeleportProvider/TeleportProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/TranslationProvider/TranslationOverride.vue.d.ts +7 -11
- package/dist/types/components/providers/TranslationProvider/TranslationProvider.vue.d.ts +7 -11
- package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +21 -0
- package/dist/types/components/subscriptions/OnDemandItemsCard/OnDemandItemsCard.types.d.ts +7 -0
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +27 -0
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.entry.types.d.ts +1 -1
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +6 -5
- package/dist/types/services/paymentMethods.types.d.ts +4 -2
- package/dist/types/services/requests.types.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/AgentContext.d.ts +3 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +6 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/ChargeOnDemandPricingItems.d.ts +23 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/CustomFields.d.ts +16 -4
- package/dist/types/vendor/@solvimon/solvimon-types/types/Embeddable.d.ts +8 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +21 -6
- package/dist/types/vendor/@solvimon/solvimon-types/types/OAuth.d.ts +28 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +2 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +6 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingItemConfig.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanGroups.d.ts +31 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSchedule.d.ts +9 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanScheduleInfo.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +3 -3
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlans.d.ts +3 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Product.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ProductItem.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ResourceStatus.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/SeatAssignment.d.ts +22 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Wallet.d.ts +6 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Workflows.d.ts +128 -1
- package/dist/{useActionDispatchProvider-DDHrhy3i.js → useActionDispatchProvider-CHkVQMaE.js} +1 -1
- package/dist/{useActionDispatchProvider-MjTckd4f.mjs → useActionDispatchProvider-DDYqIh3r.mjs} +1 -1
- package/dist/{useCustomer-BW0DBEJh.js → useCustomer-DGYtowRy.js} +1 -1
- package/dist/{useCustomer-CxnF7r8Z.mjs → useCustomer-XZKWsolE.mjs} +1 -1
- package/dist/{useCustomerFormLabels-zPc8QrwJ.mjs → useCustomerFormLabels-CcnkJLcB.mjs} +6 -6
- package/dist/useCustomerFormLabels-DAZziqYt.js +1 -0
- package/dist/{useExperimentalFeature-9teNYGuP.js → useExperimentalFeature-COOU6IZd.js} +1 -1
- package/dist/{useExperimentalFeature-NsSDg-e3.mjs → useExperimentalFeature-ierhOt9Q.mjs} +1 -1
- package/dist/{useInvoiceData-GQwk6fl4.mjs → useInvoiceData-BEK-7msA.mjs} +3 -3
- package/dist/{useInvoiceData-DvV2AsgC.js → useInvoiceData-CQRn8l9C.js} +1 -1
- package/dist/{useInvoicesList-Xnth6s6U.js → useInvoicesList-BQkKyyXa.js} +1 -1
- package/dist/{useInvoicesList-CGmFSQSg.mjs → useInvoicesList-C4I118KM.mjs} +7 -7
- package/dist/{useLoadInitialData-BvvaWeAe.mjs → useLoadInitialData-CR0kbYw8.mjs} +1 -1
- package/dist/{useLoadInitialData-Cjkc70u-.js → useLoadInitialData-CrKnBZs_.js} +1 -1
- package/dist/{usePaymentMethodAvailability-DKyscbom.js → usePaymentMethodAvailability-Ci6LeYKt.js} +1 -1
- package/dist/{usePaymentMethodAvailability-BWaaj3N3.mjs → usePaymentMethodAvailability-ZH-m3B-A.mjs} +12 -12
- package/dist/{usePaymentMethodOptions-l-wVAmIW.mjs → usePaymentMethodOptions-Ciifjo6c.mjs} +15 -13
- package/dist/usePaymentMethodOptions-Cqe92ZBn.js +1 -0
- package/dist/{usePaymentMethods-DvQVnsSV.mjs → usePaymentMethods-B-OKRyKd.mjs} +1 -1
- package/dist/{usePaymentMethods-BDFVB-kK.js → usePaymentMethods-BKwrl82-.js} +1 -1
- package/dist/usePayments-Bauj16B-.js +1 -0
- package/dist/{usePayments-D_dyuf6S.mjs → usePayments-CV85OV8V.mjs} +46 -41
- package/dist/{usePortal-BU4ibdWq.js → usePortal-DSLImEfr.js} +1 -1
- package/dist/{usePortal-Br5lYuPT.mjs → usePortal-H8Tv2TnZ.mjs} +1 -1
- package/dist/{useSubscription-DRBUt9H5.js → useSubscription-BiYNJT2e.js} +1 -1
- package/dist/{useSubscription-CqRae2I9.mjs → useSubscription-DqnxWNKg.mjs} +1 -1
- package/dist/{useTimePeriod.es-BxIGnCAP.mjs → useTimePeriod.es-B22-fno3.mjs} +1 -1
- package/dist/{useTimePeriod.es-DDos3-EH.js → useTimePeriod.es-D2aiyfd-.js} +1 -1
- package/dist/useWatchDebounced-B8iX7ykx.js +1 -0
- package/dist/useWatchDebounced-BHlBPcXB.mjs +20 -0
- package/package.json +11 -8
- package/dist/Checkout.entry.ce-D8O4qJ24.js +0 -2
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D_jcV7VG.js +0 -1
- package/dist/InvoiceSummary.vue.es-BOnvORpf.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-De7h9-fH.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DnBLj1wZ.mjs +0 -141
- package/dist/PaymentIntegrationFormAdyen-BQXXwpUK.js +0 -98
- package/dist/PaymentIntegrationFormStripe-Bs4F7oK_.js +0 -102
- package/dist/PaymentMethod.vue.es-CXV_ThBY.js +0 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-BwsRDlQJ.js +0 -1
- package/dist/PlanCustomizationEditor-0kEXoOcM.js +0 -1
- package/dist/PlanCustomizationEditor-Dv69xPbX.mjs +0 -877
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DmVJ2JQE.mjs +0 -131
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-YsI__d0V.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cd56tuZb.js +0 -1
- package/dist/TooltipParagraph.vue.es-7IQdU3Tf.js +0 -1
- package/dist/de-DE-DXsDvO5y.js +0 -1
- package/dist/en-US-9xdcz3T5.js +0 -1
- package/dist/en-US-DHdI11k9.js +0 -1
- package/dist/icon-sprite.svg.es-Bt21fMEt.mjs +0 -4
- package/dist/icon-sprite.svg.es-Dauis9LS.js +0 -1
- package/dist/index-DwueOtPi.js +0 -1
- package/dist/it-IT-CcRIzP1A.js +0 -1
- package/dist/nl-NL-5PrgQl8q.js +0 -1
- package/dist/paymentMethods-Bwym8l9a.js +0 -1
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagement.types.d.ts +0 -47
- package/dist/useCustomerFormLabels-C773h3J0.js +0 -1
- package/dist/usePaymentMethodOptions-DuXKS36F.js +0 -1
- package/dist/usePayments-CIJocDhR.js +0 -1
- package/dist/useWatchDebounced-CAU1WI1P.js +0 -1
- package/dist/useWatchDebounced-DT5IicPp.mjs +0 -14
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { defineComponent as z, ref as
|
|
1
|
+
import { defineComponent as z, ref as $, onMounted as xt, onBeforeUnmount as Se, computed as s, openBlock as w, createBlock as C, withCtx as _, createElementVNode as N, toDisplayString as I, createVNode as A, createTextVNode as F, createElementBlock as W, unref as r, createCommentVNode as k, renderSlot as se, createSlots as re, Fragment as he, renderList as ge, watch as X, useModel as $t, isRef as Et, mergeModels as Ot, mergeProps as le, reactive as Ae, normalizeClass as ze, withModifiers as Ne, normalizeStyle as ke } from "vue";
|
|
2
2
|
import { w as Bt } from "./api.es-QaC926Xu.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { a as Q, _ as K, c as Qe, u as Ge, b as _e, g as It } from "./customElements-D5DAoHRI.mjs";
|
|
4
4
|
import { E as Dt } from "./sessionReference-3h-6FdrC.mjs";
|
|
5
5
|
import { u as Nt } from "./useService-Bh47bllz.mjs";
|
|
6
|
-
import { _ as Ke } from "./ErrorNotification.vue.es-
|
|
6
|
+
import { _ as Ke } from "./ErrorNotification.vue.es-rRKgmkzV.mjs";
|
|
7
7
|
import { i as kt, a as Me, h as Rt } from "./pricingItemConfigs.es-ORxsk_YS.mjs";
|
|
8
8
|
import { b as Ce } from "./wallets.es-eH2C2ygn.mjs";
|
|
9
|
-
import { _ as ue, a as
|
|
10
|
-
import { _ as Xe, T as Je, a as Ze } from "./TooltipParagraph.vue.es-
|
|
11
|
-
import { _ as
|
|
12
|
-
import { _ as et } from "./Skeleton.vue_vue_type_script_setup_true_lang-
|
|
13
|
-
import { _ as tt } from "./RadioGroupExtended.vue.es-
|
|
14
|
-
import { u as xe, c as ie, _ as
|
|
9
|
+
import { _ as ue, a as qt } from "./Button.vue.es-C32_baQN.mjs";
|
|
10
|
+
import { _ as Xe, T as Je, a as Ze } from "./TooltipParagraph.vue.es-BXbOJmjr.mjs";
|
|
11
|
+
import { _ as ve } from "./Section.vue.es-D7eiXUbk.mjs";
|
|
12
|
+
import { _ as et } from "./Skeleton.vue_vue_type_script_setup_true_lang-D60YtA9z.mjs";
|
|
13
|
+
import { _ as tt } from "./RadioGroupExtended.vue.es-BalV7gwp.mjs";
|
|
14
|
+
import { a as Vt, u as xe, c as ie, _ as Ft, d as Lt, r as ot } from "./formControl-dX7l8o3c.mjs";
|
|
15
15
|
import { f as $e } from "./formatting.es-RclXHhKo.mjs";
|
|
16
|
-
import { _ as
|
|
16
|
+
import { _ as Yt } from "./Divider.vue.es-DnP_HqLz.mjs";
|
|
17
17
|
import { _ as nt } from "./Expand.vue.es-BleuAfDz.mjs";
|
|
18
|
-
import { a as at } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { _ as
|
|
20
|
-
import { c as it } from "./invoices-
|
|
21
|
-
import { u as
|
|
22
|
-
import { _ as
|
|
23
|
-
import { _ as st, a as
|
|
24
|
-
import { _ as
|
|
25
|
-
import { g as
|
|
26
|
-
import { u as
|
|
27
|
-
import { M as lt } from "./Modal.vue.es-
|
|
28
|
-
const
|
|
18
|
+
import { a as at } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3QYra1x.mjs";
|
|
19
|
+
import { _ as Ht } from "./cn.es-CGa6b2Lt.mjs";
|
|
20
|
+
import { c as it } from "./invoices-DJTwftJv.mjs";
|
|
21
|
+
import { u as Wt } from "./useWatchDebounced-BHlBPcXB.mjs";
|
|
22
|
+
import { _ as jt } from "./Input.vue.es-D9IjIWc-.mjs";
|
|
23
|
+
import { _ as st, a as zt } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DcrLNA_x.mjs";
|
|
24
|
+
import { _ as Qt } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-3VYfm6Hm.mjs";
|
|
25
|
+
import { g as Gt } from "./customer.es-B5ppZf0j.mjs";
|
|
26
|
+
import { u as Kt } from "./usePaymentMethodOptions-Ciifjo6c.mjs";
|
|
27
|
+
import { M as lt } from "./Modal.vue.es-B9xMiyn3.mjs";
|
|
28
|
+
const Xt = 3e4, we = 60, Te = 12, Jt = /* @__PURE__ */ z({
|
|
29
29
|
__name: "DateTimeAgo",
|
|
30
30
|
props: {
|
|
31
31
|
date: {},
|
|
32
32
|
actionVerb: {}
|
|
33
33
|
},
|
|
34
34
|
setup(e) {
|
|
35
|
-
const t = 60 * we, o = 24 * t, n = e, { $t: a, formatDate: i } = Q(),
|
|
36
|
-
let
|
|
35
|
+
const t = 60 * we, o = 24 * t, n = e, { $t: a, formatDate: i } = Q(), l = $(Date.now());
|
|
36
|
+
let u;
|
|
37
37
|
xt(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
clearInterval(
|
|
38
|
+
u = setInterval(() => {
|
|
39
|
+
l.value = Date.now();
|
|
40
|
+
}, Xt);
|
|
41
|
+
}), Se(() => {
|
|
42
|
+
clearInterval(u);
|
|
43
43
|
});
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
44
|
+
const c = (f, h) => {
|
|
45
|
+
const v = (h.getFullYear() - f.getFullYear()) * Te + (h.getMonth() - f.getMonth());
|
|
46
|
+
return h.getDate() < f.getDate() ? v - 1 : v;
|
|
47
|
+
}, g = s(() => {
|
|
48
|
+
const f = Math.max(0, (l.value - n.date.getTime()) / 1e3);
|
|
49
|
+
if (f < we)
|
|
50
50
|
return a(
|
|
51
51
|
{
|
|
52
52
|
defaultMessage: "{count, plural, one {# second} other {# seconds}} ago",
|
|
53
53
|
id: "dateTimeAgo.seconds",
|
|
54
54
|
description: "Relative time in whole seconds"
|
|
55
55
|
},
|
|
56
|
-
{ count: Math.trunc(
|
|
56
|
+
{ count: Math.trunc(f) }
|
|
57
57
|
);
|
|
58
|
-
if (
|
|
58
|
+
if (f < t)
|
|
59
59
|
return a(
|
|
60
60
|
{
|
|
61
61
|
defaultMessage: "{count, plural, one {# minute} other {# minutes}} ago",
|
|
62
62
|
id: "dateTimeAgo.minutes",
|
|
63
63
|
description: "Relative time in whole minutes"
|
|
64
64
|
},
|
|
65
|
-
{ count: Math.trunc(
|
|
65
|
+
{ count: Math.trunc(f / we) }
|
|
66
66
|
);
|
|
67
|
-
if (
|
|
67
|
+
if (f < o)
|
|
68
68
|
return a(
|
|
69
69
|
{
|
|
70
70
|
defaultMessage: "{count, plural, one {# hour} other {# hours}} ago",
|
|
71
71
|
id: "dateTimeAgo.hours",
|
|
72
72
|
description: "Relative time in whole hours"
|
|
73
73
|
},
|
|
74
|
-
{ count: Math.trunc(
|
|
74
|
+
{ count: Math.trunc(f / t) }
|
|
75
75
|
);
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
return
|
|
76
|
+
const h = c(n.date, new Date(l.value));
|
|
77
|
+
if (h < 1) {
|
|
78
|
+
const v = Math.trunc(f / o);
|
|
79
|
+
return v === 1 ? a({
|
|
80
80
|
defaultMessage: "yesterday",
|
|
81
81
|
id: "dateTimeAgo.yesterday",
|
|
82
82
|
description: 'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'
|
|
@@ -86,36 +86,36 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
86
86
|
id: "dateTimeAgo.days",
|
|
87
87
|
description: "Relative time in whole days"
|
|
88
88
|
},
|
|
89
|
-
{ count:
|
|
89
|
+
{ count: v }
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return h < Te ? a(
|
|
93
93
|
{
|
|
94
94
|
defaultMessage: "{count, plural, one {# month} other {# months}} ago",
|
|
95
95
|
id: "dateTimeAgo.months",
|
|
96
96
|
description: "Relative time in whole months"
|
|
97
97
|
},
|
|
98
|
-
{ count:
|
|
98
|
+
{ count: h }
|
|
99
99
|
) : a(
|
|
100
100
|
{
|
|
101
101
|
defaultMessage: "{count, plural, one {# year} other {# years}} ago",
|
|
102
102
|
id: "dateTimeAgo.years",
|
|
103
103
|
description: "Relative time in whole years"
|
|
104
104
|
},
|
|
105
|
-
{ count: Math.trunc(
|
|
105
|
+
{ count: Math.trunc(h / Te) }
|
|
106
106
|
);
|
|
107
|
-
}),
|
|
108
|
-
() => n.actionVerb ? `${n.actionVerb} ${
|
|
109
|
-
),
|
|
107
|
+
}), b = s(
|
|
108
|
+
() => n.actionVerb ? `${n.actionVerb} ${g.value}` : g.value
|
|
109
|
+
), S = s(
|
|
110
110
|
() => i({ date: n.date, format: "dateTime", offsetType: "local" })
|
|
111
111
|
);
|
|
112
|
-
return (
|
|
113
|
-
tooltip:
|
|
112
|
+
return (f, h) => (w(), C(Xe, null, {
|
|
113
|
+
tooltip: _(() => [
|
|
114
114
|
A(Je, null, {
|
|
115
|
-
default:
|
|
115
|
+
default: _(() => [
|
|
116
116
|
A(Ze, null, {
|
|
117
|
-
default:
|
|
118
|
-
F(
|
|
117
|
+
default: _(() => [
|
|
118
|
+
F(I(S.value), 1)
|
|
119
119
|
]),
|
|
120
120
|
_: 1
|
|
121
121
|
})
|
|
@@ -123,79 +123,79 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
123
123
|
_: 1
|
|
124
124
|
})
|
|
125
125
|
]),
|
|
126
|
-
default:
|
|
127
|
-
|
|
126
|
+
default: _(() => [
|
|
127
|
+
N("span", null, I(b.value), 1)
|
|
128
128
|
]),
|
|
129
129
|
_: 1
|
|
130
130
|
}));
|
|
131
131
|
}
|
|
132
|
-
}),
|
|
133
|
-
const { $t: t, formatNumber: o } = Q(), n = (
|
|
132
|
+
}), Zt = (e) => {
|
|
133
|
+
const { $t: t, formatNumber: o } = Q(), n = (y) => Ce(t, o, y), a = s(
|
|
134
134
|
() => {
|
|
135
|
-
var
|
|
136
|
-
return ((
|
|
135
|
+
var y, p;
|
|
136
|
+
return ((p = (y = e.walletBalance.wallet) == null ? void 0 : y.wallet_type) == null ? void 0 : p.name) || t({
|
|
137
137
|
defaultMessage: "Balance",
|
|
138
138
|
id: "wallet_balance.balance_label",
|
|
139
139
|
description: "Label shown above a wallet's balance amount"
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
), i = (
|
|
143
|
-
var
|
|
144
|
-
return (((
|
|
145
|
-
},
|
|
142
|
+
), i = (y) => {
|
|
143
|
+
var p;
|
|
144
|
+
return (((p = y.pricing_item) == null ? void 0 : p.configs) ?? []).filter((P) => !!P.on_demand);
|
|
145
|
+
}, l = s(
|
|
146
146
|
() => (e.walletBalance.charge_on_demand_pricing_items ?? []).filter(
|
|
147
|
-
(
|
|
148
|
-
(
|
|
147
|
+
(y) => i(y).some(
|
|
148
|
+
(p) => kt(p) || Me(p)
|
|
149
149
|
)
|
|
150
150
|
)
|
|
151
|
-
),
|
|
152
|
-
() =>
|
|
153
|
-
(
|
|
151
|
+
), u = s(
|
|
152
|
+
() => l.value.find(
|
|
153
|
+
(y) => i(y).some((p) => Me(p))
|
|
154
154
|
)
|
|
155
|
-
),
|
|
156
|
-
() => !!e.showManualTopUp &&
|
|
157
|
-
),
|
|
155
|
+
), c = s(
|
|
156
|
+
() => !!e.showManualTopUp && l.value.length > 0
|
|
157
|
+
), g = s(() => !!e.showAutoTopUp && !!u.value), b = s(
|
|
158
158
|
() => {
|
|
159
|
-
var
|
|
160
|
-
return (
|
|
161
|
-
(
|
|
159
|
+
var y, p;
|
|
160
|
+
return (p = (y = e.walletBalance.wallet) == null ? void 0 : y.auto_top_up_configs) == null ? void 0 : p.find(
|
|
161
|
+
(P) => P.status === "ACTIVE"
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
|
-
),
|
|
164
|
+
), S = s(
|
|
165
165
|
() => {
|
|
166
|
-
var
|
|
167
|
-
return (
|
|
166
|
+
var y, p;
|
|
167
|
+
return (p = (y = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : y.credits) == null ? void 0 : p.credit_type;
|
|
168
168
|
}
|
|
169
|
-
),
|
|
169
|
+
), f = (y, p) => n({
|
|
170
170
|
credits: {
|
|
171
|
-
quantity:
|
|
172
|
-
credit_type_id:
|
|
173
|
-
credit_type:
|
|
171
|
+
quantity: y,
|
|
172
|
+
credit_type_id: p,
|
|
173
|
+
credit_type: S.value
|
|
174
174
|
}
|
|
175
|
-
}),
|
|
176
|
-
var
|
|
177
|
-
const
|
|
178
|
-
if (!
|
|
175
|
+
}), h = (y) => y.amount ? n({ amount: y.amount }) : y.credits ? f(y.credits.quantity, y.credits.credit_type_id) : "", v = s(() => {
|
|
176
|
+
var y, p;
|
|
177
|
+
const P = (y = b.value) == null ? void 0 : y.pricing_item_id;
|
|
178
|
+
if (!P)
|
|
179
179
|
return;
|
|
180
|
-
const
|
|
181
|
-
return
|
|
180
|
+
const E = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((R) => R.pricing_item_id === P).flatMap((R) => i(R)).flatMap((R) => R.wallet_grants ?? []), D = (p = e.walletBalance.wallet) == null ? void 0 : p.wallet_type_id;
|
|
181
|
+
return E.find((R) => R.wallet_type_id === D) ?? E[0];
|
|
182
182
|
}), U = s(() => {
|
|
183
|
-
var
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
183
|
+
var y, p;
|
|
184
|
+
const P = (y = b.value) == null ? void 0 : y.topup_amount, E = (p = v.value) == null ? void 0 : p.credits_grant;
|
|
185
|
+
if (!P || !E)
|
|
186
186
|
return "";
|
|
187
|
-
if (
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
if (E.credits)
|
|
188
|
+
return f(
|
|
189
|
+
E.credits.quantity,
|
|
190
|
+
E.credits.credit_type_id
|
|
191
191
|
);
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
return
|
|
192
|
+
if (E.conversion) {
|
|
193
|
+
const D = Number(P.quantity) * Number(E.conversion.rate);
|
|
194
|
+
return f(String(D), E.conversion.credit_type_id);
|
|
195
195
|
}
|
|
196
196
|
return "";
|
|
197
|
-
}),
|
|
198
|
-
() =>
|
|
197
|
+
}), B = s(
|
|
198
|
+
() => b.value ? t({
|
|
199
199
|
defaultMessage: "Auto top-up enabled",
|
|
200
200
|
id: "wallet_balance.auto_top_up_enabled_label",
|
|
201
201
|
description: "Label shown when a wallet tops itself up automatically"
|
|
@@ -204,16 +204,16 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
204
204
|
id: "wallet_balance.auto_top_up_disabled_label",
|
|
205
205
|
description: "Label shown when a wallet has no automatic top-up configured"
|
|
206
206
|
})
|
|
207
|
-
),
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
207
|
+
), J = s(() => {
|
|
208
|
+
const y = b.value;
|
|
209
|
+
if (!y)
|
|
210
210
|
return t({
|
|
211
211
|
defaultMessage: "Set up an automatic top-up and your balance is increased for you whenever it drops below an amount you choose, so you never run out.",
|
|
212
212
|
id: "wallet_balance.auto_top_up_setup_explanation",
|
|
213
213
|
description: "Tooltip explaining what automatic top-ups do, shown when none is configured yet"
|
|
214
214
|
});
|
|
215
|
-
const
|
|
216
|
-
return !
|
|
215
|
+
const p = y.topup_amount ? n({ amount: y.topup_amount }) : "", P = h(y.threshold);
|
|
216
|
+
return !p || !P ? t({
|
|
217
217
|
defaultMessage: "Your balance is topped up automatically once it runs low.",
|
|
218
218
|
id: "wallet_balance.auto_top_up_generic_explanation",
|
|
219
219
|
description: "Tooltip shown for an active automatic top-up whose amount or threshold is unknown"
|
|
@@ -223,31 +223,31 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
223
223
|
id: "wallet_balance.auto_top_up_credits_explanation",
|
|
224
224
|
description: "Tooltip explaining an automatic top-up that grants credits for a paid amount"
|
|
225
225
|
},
|
|
226
|
-
{ topUpCredits: U.value, topUpAmount:
|
|
226
|
+
{ topUpCredits: U.value, topUpAmount: p, threshold: P }
|
|
227
227
|
) : t(
|
|
228
228
|
{
|
|
229
229
|
defaultMessage: "Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",
|
|
230
230
|
id: "wallet_balance.auto_top_up_explanation",
|
|
231
231
|
description: "Tooltip explaining how the automatic top-up of a wallet balance works"
|
|
232
232
|
},
|
|
233
|
-
{ topUpAmount:
|
|
233
|
+
{ topUpAmount: p, threshold: P }
|
|
234
234
|
);
|
|
235
235
|
});
|
|
236
236
|
return {
|
|
237
237
|
walletName: a,
|
|
238
238
|
formatBalance: n,
|
|
239
|
-
manualTopUpItems:
|
|
240
|
-
flexibleManualTopUpItem:
|
|
241
|
-
showManualTopUp:
|
|
242
|
-
showAutoTopUp:
|
|
243
|
-
activeTopUpConfig:
|
|
244
|
-
autoTopUpLabel:
|
|
245
|
-
autoTopUpExplanation:
|
|
239
|
+
manualTopUpItems: l,
|
|
240
|
+
flexibleManualTopUpItem: u,
|
|
241
|
+
showManualTopUp: c,
|
|
242
|
+
showAutoTopUp: g,
|
|
243
|
+
activeTopUpConfig: b,
|
|
244
|
+
autoTopUpLabel: B,
|
|
245
|
+
autoTopUpExplanation: J
|
|
246
246
|
};
|
|
247
|
-
},
|
|
247
|
+
}, eo = { class: "flex flex-col gap-3 py-3" }, to = { class: "flex flex-col gap-1 px-4" }, oo = { class: "flex w-full justify-between gap-3" }, no = { class: "flex w-full items-center gap-4" }, ao = { key: 0 }, io = {
|
|
248
248
|
key: 1,
|
|
249
249
|
class: "flex w-full justify-between gap-3 px-4"
|
|
250
|
-
},
|
|
250
|
+
}, so = { class: "flex min-w-0 items-center gap-1" }, lo = { class: "flex min-w-0 items-center gap-1" }, uo = { class: "shrink-0" }, ro = /* @__PURE__ */ z({
|
|
251
251
|
__name: "WalletBalancesItem",
|
|
252
252
|
props: {
|
|
253
253
|
walletBalance: {},
|
|
@@ -260,35 +260,35 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
260
260
|
walletName: n,
|
|
261
261
|
formatBalance: a,
|
|
262
262
|
manualTopUpItems: i,
|
|
263
|
-
flexibleManualTopUpItem:
|
|
264
|
-
showManualTopUp:
|
|
265
|
-
showAutoTopUp:
|
|
266
|
-
activeTopUpConfig:
|
|
267
|
-
autoTopUpLabel:
|
|
268
|
-
autoTopUpExplanation:
|
|
269
|
-
} =
|
|
270
|
-
return (
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
A(
|
|
263
|
+
flexibleManualTopUpItem: l,
|
|
264
|
+
showManualTopUp: u,
|
|
265
|
+
showAutoTopUp: c,
|
|
266
|
+
activeTopUpConfig: g,
|
|
267
|
+
autoTopUpLabel: b,
|
|
268
|
+
autoTopUpExplanation: S
|
|
269
|
+
} = Zt(t);
|
|
270
|
+
return (f, h) => (w(), W("div", eo, [
|
|
271
|
+
N("div", to, [
|
|
272
|
+
N("div", oo, [
|
|
273
|
+
A(K, {
|
|
274
274
|
variant: "body-xs",
|
|
275
275
|
color: "subtle",
|
|
276
276
|
"no-spacing": ""
|
|
277
277
|
}, {
|
|
278
|
-
default:
|
|
279
|
-
F(
|
|
278
|
+
default: _(() => [
|
|
279
|
+
F(I(r(n)), 1)
|
|
280
280
|
]),
|
|
281
281
|
_: 1
|
|
282
282
|
}),
|
|
283
|
-
A(
|
|
283
|
+
A(K, {
|
|
284
284
|
variant: "body-xs",
|
|
285
285
|
color: "subtle",
|
|
286
286
|
"no-spacing": ""
|
|
287
287
|
}, {
|
|
288
|
-
default:
|
|
289
|
-
var
|
|
288
|
+
default: _(() => {
|
|
289
|
+
var v, U;
|
|
290
290
|
return [
|
|
291
|
-
(
|
|
291
|
+
(v = e.walletBalance.wallet_balance) != null && v.balance_at ? (w(), C(Jt, {
|
|
292
292
|
key: 0,
|
|
293
293
|
date: new Date((U = e.walletBalance.wallet_balance) == null ? void 0 : U.balance_at),
|
|
294
294
|
"action-verb": r(o)({
|
|
@@ -296,52 +296,52 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
296
296
|
id: "wallet_balance.updated_action_verb",
|
|
297
297
|
description: "Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"
|
|
298
298
|
})
|
|
299
|
-
}, null, 8, ["date", "action-verb"])) :
|
|
299
|
+
}, null, 8, ["date", "action-verb"])) : k("", !0)
|
|
300
300
|
];
|
|
301
301
|
}),
|
|
302
302
|
_: 1
|
|
303
303
|
})
|
|
304
304
|
]),
|
|
305
|
-
|
|
306
|
-
A(
|
|
305
|
+
N("div", no, [
|
|
306
|
+
A(K, {
|
|
307
307
|
variant: "body-lg",
|
|
308
308
|
weight: "semibold",
|
|
309
309
|
"no-spacing": "",
|
|
310
310
|
class: "grow"
|
|
311
311
|
}, {
|
|
312
|
-
default:
|
|
313
|
-
F(
|
|
312
|
+
default: _(() => [
|
|
313
|
+
F(I(r(a)(t.walletBalance.wallet_balance.open_balance)), 1)
|
|
314
314
|
]),
|
|
315
315
|
_: 1
|
|
316
316
|
}),
|
|
317
|
-
r(
|
|
317
|
+
r(u) ? (w(), C(r(ue), {
|
|
318
318
|
key: 0,
|
|
319
319
|
size: "xs",
|
|
320
|
-
onClick:
|
|
320
|
+
onClick: h[0] || (h[0] = (v) => f.$emit("top-up", r(i)[0]))
|
|
321
321
|
}, {
|
|
322
|
-
default:
|
|
323
|
-
F(
|
|
322
|
+
default: _(() => [
|
|
323
|
+
F(I(r(o)({
|
|
324
324
|
defaultMessage: "Top up",
|
|
325
325
|
id: "v1V8kA",
|
|
326
326
|
description: "Button to top up a wallet balance"
|
|
327
327
|
})), 1)
|
|
328
328
|
]),
|
|
329
329
|
_: 1
|
|
330
|
-
})) :
|
|
330
|
+
})) : k("", !0)
|
|
331
331
|
])
|
|
332
332
|
]),
|
|
333
|
-
|
|
334
|
-
se(
|
|
335
|
-
])) :
|
|
336
|
-
r(
|
|
337
|
-
|
|
333
|
+
f.$slots.graph ? (w(), W("div", ao, [
|
|
334
|
+
se(f.$slots, "graph")
|
|
335
|
+
])) : k("", !0),
|
|
336
|
+
r(c) ? (w(), W("div", io, [
|
|
337
|
+
N("div", so, [
|
|
338
338
|
A(Xe, { class: "min-w-0" }, {
|
|
339
|
-
tooltip:
|
|
339
|
+
tooltip: _(() => [
|
|
340
340
|
A(Je, null, {
|
|
341
|
-
default:
|
|
341
|
+
default: _(() => [
|
|
342
342
|
A(Ze, null, {
|
|
343
|
-
default:
|
|
344
|
-
F(
|
|
343
|
+
default: _(() => [
|
|
344
|
+
F(I(r(S)), 1)
|
|
345
345
|
]),
|
|
346
346
|
_: 1
|
|
347
347
|
})
|
|
@@ -349,20 +349,20 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
349
349
|
_: 1
|
|
350
350
|
})
|
|
351
351
|
]),
|
|
352
|
-
default:
|
|
353
|
-
|
|
354
|
-
A(
|
|
352
|
+
default: _(() => [
|
|
353
|
+
N("div", lo, [
|
|
354
|
+
A(K, {
|
|
355
355
|
variant: "body-sm",
|
|
356
356
|
color: "secondary",
|
|
357
357
|
"no-spacing": "",
|
|
358
358
|
class: "truncate"
|
|
359
359
|
}, {
|
|
360
|
-
default:
|
|
361
|
-
F(
|
|
360
|
+
default: _(() => [
|
|
361
|
+
F(I(r(b)), 1)
|
|
362
362
|
]),
|
|
363
363
|
_: 1
|
|
364
364
|
}),
|
|
365
|
-
A(
|
|
365
|
+
A(qt, {
|
|
366
366
|
icon: "info",
|
|
367
367
|
size: "2xs",
|
|
368
368
|
class: "shrink-0 cursor-help text-gray-400"
|
|
@@ -372,15 +372,15 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
372
372
|
_: 1
|
|
373
373
|
})
|
|
374
374
|
]),
|
|
375
|
-
|
|
376
|
-
r(
|
|
375
|
+
N("div", uo, [
|
|
376
|
+
r(g) ? (w(), C(r(ue), {
|
|
377
377
|
key: 0,
|
|
378
378
|
size: "xs",
|
|
379
379
|
intent: "secondary",
|
|
380
|
-
onClick:
|
|
380
|
+
onClick: h[1] || (h[1] = (v) => f.$emit("cancel-auto-top-up", r(g)))
|
|
381
381
|
}, {
|
|
382
|
-
default:
|
|
383
|
-
F(
|
|
382
|
+
default: _(() => [
|
|
383
|
+
F(I(r(o)({
|
|
384
384
|
defaultMessage: "Disable",
|
|
385
385
|
id: "wallet_balance.auto_top_up_disable_button",
|
|
386
386
|
description: "Button to turn off a wallet's automatic top-up"
|
|
@@ -391,10 +391,10 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
391
391
|
key: 1,
|
|
392
392
|
size: "xs",
|
|
393
393
|
intent: "secondary",
|
|
394
|
-
onClick:
|
|
394
|
+
onClick: h[2] || (h[2] = (v) => f.$emit("auto-top-up", r(l)))
|
|
395
395
|
}, {
|
|
396
|
-
default:
|
|
397
|
-
F(
|
|
396
|
+
default: _(() => [
|
|
397
|
+
F(I(r(o)({
|
|
398
398
|
defaultMessage: "Enable",
|
|
399
399
|
id: "wallet_balance.auto_top_up_enable_button",
|
|
400
400
|
description: "Button to set up a wallet's automatic top-up"
|
|
@@ -403,10 +403,10 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
403
403
|
_: 1
|
|
404
404
|
}))
|
|
405
405
|
])
|
|
406
|
-
])) :
|
|
406
|
+
])) : k("", !0)
|
|
407
407
|
]));
|
|
408
408
|
}
|
|
409
|
-
}),
|
|
409
|
+
}), co = { class: "flex flex-col gap-2" }, po = /* @__PURE__ */ z({
|
|
410
410
|
__name: "WalletBalances",
|
|
411
411
|
props: {
|
|
412
412
|
customerWalletBalances: {},
|
|
@@ -416,19 +416,19 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
416
416
|
},
|
|
417
417
|
emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
|
|
418
418
|
setup(e) {
|
|
419
|
-
return (t, o) => (w(), C(
|
|
419
|
+
return (t, o) => (w(), C(ve, {
|
|
420
420
|
"no-spacing": "",
|
|
421
421
|
"no-border": "",
|
|
422
422
|
title: e.title
|
|
423
423
|
}, re({
|
|
424
|
-
default:
|
|
425
|
-
|
|
426
|
-
(w(!0), W(
|
|
424
|
+
default: _(() => [
|
|
425
|
+
N("div", co, [
|
|
426
|
+
(w(!0), W(he, null, ge(e.customerWalletBalances, (n) => (w(), C(ve, {
|
|
427
427
|
key: n.wallet_id,
|
|
428
428
|
"no-spacing": ""
|
|
429
429
|
}, {
|
|
430
|
-
default:
|
|
431
|
-
A(
|
|
430
|
+
default: _(() => [
|
|
431
|
+
A(ro, {
|
|
432
432
|
"wallet-balance": n,
|
|
433
433
|
"show-auto-top-up": e.showAutoTopUp,
|
|
434
434
|
"show-manual-top-up": e.showManualTopUp,
|
|
@@ -445,7 +445,7 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
445
445
|
}, [
|
|
446
446
|
t.$slots["heading-right"] ? {
|
|
447
447
|
name: "right",
|
|
448
|
-
fn:
|
|
448
|
+
fn: _(() => [
|
|
449
449
|
se(t.$slots, "heading-right")
|
|
450
450
|
]),
|
|
451
451
|
key: "0"
|
|
@@ -453,7 +453,7 @@ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
|
|
|
453
453
|
]), 1032, ["title"]));
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
|
-
function
|
|
456
|
+
function mo() {
|
|
457
457
|
const e = Qe(), t = Ge();
|
|
458
458
|
function o(n) {
|
|
459
459
|
return e({
|
|
@@ -468,12 +468,12 @@ function po() {
|
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
470
|
function Nn({ customerId: e }) {
|
|
471
|
-
const { getCustomerWalletBalances: t } =
|
|
471
|
+
const { getCustomerWalletBalances: t } = mo(), { data: o, execute: n, apiStatus: a, error: i, isPending: l } = Nt({
|
|
472
472
|
service: () => t(e)
|
|
473
473
|
});
|
|
474
474
|
return { walletBalances: s(
|
|
475
475
|
() => o.value ?? null
|
|
476
|
-
), apiStatus: a, error: i, fetch: n, isPending:
|
|
476
|
+
), apiStatus: a, error: i, fetch: n, isPending: l };
|
|
477
477
|
}
|
|
478
478
|
const Re = (e = [], t) => {
|
|
479
479
|
if (t != null && t.pricing_item_id)
|
|
@@ -482,13 +482,13 @@ const Re = (e = [], t) => {
|
|
|
482
482
|
({ pricing_item_id: n }) => n === t.pricing_item_id
|
|
483
483
|
)
|
|
484
484
|
);
|
|
485
|
-
},
|
|
485
|
+
}, vo = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], Ee = (e) => typeof e == "object" && e !== null && "pricing_item" in e, fo = (e) => [
|
|
486
486
|
...new Set(
|
|
487
487
|
((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap(
|
|
488
488
|
(t) => Ee(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
|
|
489
489
|
)
|
|
490
490
|
)
|
|
491
|
-
],
|
|
491
|
+
], ho = (e, t) => {
|
|
492
492
|
const o = new Set(fo(e));
|
|
493
493
|
return t.flatMap((n) => {
|
|
494
494
|
const a = (n.pricing_plan_schedule_infos ?? []).filter(
|
|
@@ -501,9 +501,9 @@ const Re = (e = [], t) => {
|
|
|
501
501
|
scheduleIds: a.map(({ id: i }) => i),
|
|
502
502
|
enabledPricingIds: a.flatMap(
|
|
503
503
|
(i) => {
|
|
504
|
-
var
|
|
505
|
-
return (((
|
|
506
|
-
({ pricing_id:
|
|
504
|
+
var l;
|
|
505
|
+
return (((l = i.pricing_plan_schedule) == null ? void 0 : l.enabled_pricings) ?? []).flatMap(
|
|
506
|
+
({ pricing_id: u }) => u ? [u] : []
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
509
|
)
|
|
@@ -526,26 +526,26 @@ const Re = (e = [], t) => {
|
|
|
526
526
|
return [];
|
|
527
527
|
const o = t.pricing_item_id ?? ((n = t.pricing_item) == null ? void 0 : n.id);
|
|
528
528
|
return o ? (((a = t.pricing_item) == null ? void 0 : a.configs) ?? []).map((i) => {
|
|
529
|
-
const
|
|
529
|
+
const l = wo(i, e), u = _o(i, e);
|
|
530
530
|
return {
|
|
531
531
|
pricingItemId: o,
|
|
532
532
|
...t.pricing_plan_schedule_id && {
|
|
533
533
|
pricingPlanScheduleId: t.pricing_plan_schedule_id
|
|
534
534
|
},
|
|
535
535
|
config: i,
|
|
536
|
-
...
|
|
537
|
-
...
|
|
536
|
+
...l && { flexiblePricing: l },
|
|
537
|
+
...u && { fixedPricing: u }
|
|
538
538
|
};
|
|
539
539
|
}) : [];
|
|
540
540
|
});
|
|
541
|
-
function
|
|
542
|
-
var i,
|
|
541
|
+
function _o(e, t) {
|
|
542
|
+
var i, l, u;
|
|
543
543
|
if (!e.on_demand || !Rt(e, ["FIXED"]))
|
|
544
544
|
return;
|
|
545
|
-
const o = (
|
|
545
|
+
const o = (u = (l = (i = e.details) == null ? void 0 : i.bands) == null ? void 0 : l[0]) == null ? void 0 : u.fixed_amount;
|
|
546
546
|
if (!o)
|
|
547
547
|
return;
|
|
548
|
-
const n = rt(t), a = n ?
|
|
548
|
+
const n = rt(t), a = n ? bo(e, t) : void 0;
|
|
549
549
|
return {
|
|
550
550
|
amount: o,
|
|
551
551
|
value: a && n ? Oe(a.quantity, n) : { amount: o }
|
|
@@ -560,30 +560,30 @@ const rt = (e) => {
|
|
|
560
560
|
return (e.wallet_grants ?? []).filter(
|
|
561
561
|
({ wallet_type_id: a }) => !o || a === o
|
|
562
562
|
);
|
|
563
|
-
},
|
|
563
|
+
}, yo = (e, t) => {
|
|
564
564
|
var o, n;
|
|
565
565
|
return (n = (o = dt(e, t).find(
|
|
566
566
|
({ credits_grant: a }) => a == null ? void 0 : a.conversion
|
|
567
567
|
)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.conversion;
|
|
568
|
-
},
|
|
568
|
+
}, bo = (e, t) => {
|
|
569
569
|
var o, n;
|
|
570
570
|
return (n = (o = dt(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
|
|
571
571
|
}, Oe = (e, t) => ({ credits: { ...t, quantity: e } }), ct = (e, t) => {
|
|
572
572
|
const o = Number(e), n = Number(t);
|
|
573
573
|
return Number.isFinite(o) && Number.isFinite(n) ? String(o * n) : void 0;
|
|
574
574
|
};
|
|
575
|
-
function
|
|
576
|
-
var
|
|
575
|
+
function wo(e, t) {
|
|
576
|
+
var c, g, b, S, f, h, v;
|
|
577
577
|
if (!e.on_demand || !Me(e))
|
|
578
578
|
return;
|
|
579
|
-
const o = (
|
|
579
|
+
const o = (g = (c = e.details) == null ? void 0 : c.bands) == null ? void 0 : g[0], n = ((b = o == null ? void 0 : o.minimum_amount) == null ? void 0 : b.currency) ?? ((S = o == null ? void 0 : o.maximum_amount) == null ? void 0 : S.currency) ?? ((h = (f = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : f.amount) == null ? void 0 : h.currency);
|
|
580
580
|
if (!n)
|
|
581
581
|
return;
|
|
582
|
-
const a = rt(t), i = a ?
|
|
582
|
+
const a = rt(t), i = a ? yo(e, t) : void 0, l = (v = a == null ? void 0 : a.credit_type) == null ? void 0 : v.unit_name, u = (U) => {
|
|
583
583
|
if (!U)
|
|
584
584
|
return;
|
|
585
|
-
const
|
|
586
|
-
return
|
|
585
|
+
const B = a && i ? ct(U.quantity, i.rate) : void 0;
|
|
586
|
+
return B !== void 0 && a ? Oe(B, a) : { amount: U };
|
|
587
587
|
};
|
|
588
588
|
return {
|
|
589
589
|
config: {
|
|
@@ -594,27 +594,27 @@ function bo(e, t) {
|
|
|
594
594
|
...i && {
|
|
595
595
|
creditsConfiguration: {
|
|
596
596
|
conversionRate: i.rate,
|
|
597
|
-
...(
|
|
598
|
-
...(
|
|
597
|
+
...(l == null ? void 0 : l.singular) && { unitNameSingle: l.singular },
|
|
598
|
+
...(l == null ? void 0 : l.plural) && { unitNamePlural: l.plural }
|
|
599
599
|
}
|
|
600
600
|
},
|
|
601
601
|
bounds: {
|
|
602
|
-
...
|
|
603
|
-
...
|
|
602
|
+
...u(o == null ? void 0 : o.minimum_amount) && { minimum: u(o == null ? void 0 : o.minimum_amount) },
|
|
603
|
+
...u(o == null ? void 0 : o.maximum_amount) && { maximum: u(o == null ? void 0 : o.maximum_amount) }
|
|
604
604
|
}
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
|
-
const
|
|
607
|
+
const To = (e) => {
|
|
608
608
|
var t, o, n, a, i;
|
|
609
609
|
return !!((t = e.fixedPricing) != null && t.value.credits) || !!((o = e.flexiblePricing) != null && o.creditsConfiguration) || !!((i = ((n = e.flexiblePricing) == null ? void 0 : n.bounds.minimum) ?? ((a = e.flexiblePricing) == null ? void 0 : a.bounds.maximum)) != null && i.credits);
|
|
610
|
-
},
|
|
610
|
+
}, Mo = (e) => {
|
|
611
611
|
var t;
|
|
612
612
|
for (const { fixedPricing: o, flexiblePricing: n } of e) {
|
|
613
613
|
const a = (o == null ? void 0 : o.value.credits) ?? ((t = (n == null ? void 0 : n.bounds.minimum) ?? (n == null ? void 0 : n.bounds.maximum)) == null ? void 0 : t.credits);
|
|
614
614
|
if (a != null && a.credit_type_id)
|
|
615
615
|
return a.credit_type_id;
|
|
616
616
|
}
|
|
617
|
-
},
|
|
617
|
+
}, Uo = (e = []) => {
|
|
618
618
|
for (const { flexiblePricing: t, fixedPricing: o } of e) {
|
|
619
619
|
const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
|
|
620
620
|
if (n)
|
|
@@ -623,11 +623,11 @@ const wo = (e) => {
|
|
|
623
623
|
}, pt = (e = []) => {
|
|
624
624
|
var t, o, n;
|
|
625
625
|
for (const { fixedPricing: a, flexiblePricing: i } of e) {
|
|
626
|
-
const
|
|
627
|
-
if ((n = (o =
|
|
628
|
-
return
|
|
626
|
+
const l = (a == null ? void 0 : a.value.credits) ?? ((t = (i == null ? void 0 : i.bounds.minimum) ?? (i == null ? void 0 : i.bounds.maximum)) == null ? void 0 : t.credits);
|
|
627
|
+
if ((n = (o = l == null ? void 0 : l.credit_type) == null ? void 0 : o.unit_name) != null && n.plural)
|
|
628
|
+
return l.credit_type.unit_name.plural;
|
|
629
629
|
}
|
|
630
|
-
},
|
|
630
|
+
}, Po = (e = []) => {
|
|
631
631
|
var t;
|
|
632
632
|
for (const { flexiblePricing: o } of e) {
|
|
633
633
|
const n = (t = o == null ? void 0 : o.creditsConfiguration) == null ? void 0 : t.conversionRate;
|
|
@@ -641,9 +641,9 @@ const wo = (e) => {
|
|
|
641
641
|
return { ...o && { minimum: o }, ...n && { maximum: n } };
|
|
642
642
|
}
|
|
643
643
|
return {};
|
|
644
|
-
},
|
|
645
|
-
if (e.some(
|
|
646
|
-
const t =
|
|
644
|
+
}, Ao = (e = []) => {
|
|
645
|
+
if (e.some(To)) {
|
|
646
|
+
const t = Mo(e);
|
|
647
647
|
return t ? { creditTypeId: t } : void 0;
|
|
648
648
|
}
|
|
649
649
|
for (const { flexiblePricing: t, fixedPricing: o } of e) {
|
|
@@ -651,79 +651,85 @@ const wo = (e) => {
|
|
|
651
651
|
if (n)
|
|
652
652
|
return { currency: n };
|
|
653
653
|
}
|
|
654
|
-
},
|
|
655
|
-
var
|
|
654
|
+
}, Co = (e, t) => {
|
|
655
|
+
var l;
|
|
656
656
|
if (e.fixedPricing)
|
|
657
657
|
return e.fixedPricing.value;
|
|
658
658
|
if (!e.flexiblePricing || !t)
|
|
659
659
|
return;
|
|
660
|
-
const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (
|
|
660
|
+
const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (l = o.minimum ?? o.maximum) == null ? void 0 : l.credits, i = n ? ct(t.quantity, n.conversionRate) : void 0;
|
|
661
661
|
return a && i !== void 0 ? Oe(i, a) : { amount: t };
|
|
662
662
|
}, mt = (e = []) => {
|
|
663
|
-
const t =
|
|
663
|
+
const t = Ao(e);
|
|
664
664
|
if (t)
|
|
665
665
|
return {
|
|
666
666
|
denomination: t,
|
|
667
|
-
chargeCurrency:
|
|
667
|
+
chargeCurrency: Uo(e) ?? "",
|
|
668
668
|
creditUnitName: pt(e),
|
|
669
|
-
conversionRate:
|
|
669
|
+
conversionRate: Po(e),
|
|
670
670
|
topUpBounds: So(e)
|
|
671
671
|
};
|
|
672
|
-
},
|
|
673
|
-
function
|
|
672
|
+
}, xo = 400;
|
|
673
|
+
function $o({
|
|
674
674
|
pricingPlanScheduleId: e,
|
|
675
675
|
pricingItems: t
|
|
676
676
|
}) {
|
|
677
|
-
const { previewChargeOnDemandPricingItems: o } = it(), n = _e(), a =
|
|
678
|
-
const
|
|
679
|
-
if (!
|
|
680
|
-
t.value && !
|
|
677
|
+
const { previewChargeOnDemandPricingItems: o } = it(), n = _e(), a = $(), i = $(!1), l = $(!1), u = s(() => i.value || l.value), c = $(!1), g = It(), b = async () => {
|
|
678
|
+
const S = e.value, f = g();
|
|
679
|
+
if (l.value = !1, !S || !t.value) {
|
|
680
|
+
t.value && !S && n.warn(
|
|
681
681
|
"INVOICE_PREVIEW_SKIPPED",
|
|
682
|
-
"Skipped the
|
|
682
|
+
"Skipped the on-demand charge invoice preview: no schedule to charge it on",
|
|
683
683
|
{ missing: ["pricingPlanScheduleId"] }
|
|
684
|
-
), a.value = void 0, i.value = !1;
|
|
684
|
+
), a.value = void 0, i.value = !1, c.value = !1;
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
|
-
i.value = !0;
|
|
687
|
+
i.value = !0, c.value = !1;
|
|
688
688
|
try {
|
|
689
|
-
const
|
|
690
|
-
pricingPlanScheduleId:
|
|
689
|
+
const h = await o({
|
|
690
|
+
pricingPlanScheduleId: S,
|
|
691
691
|
pricingItems: t.value
|
|
692
692
|
});
|
|
693
|
-
|
|
694
|
-
} catch (
|
|
695
|
-
|
|
693
|
+
f() && (a.value = h);
|
|
694
|
+
} catch (h) {
|
|
695
|
+
f() && (a.value = void 0, c.value = !0), n.error(
|
|
696
696
|
"INVOICE_PREVIEW_FAILED",
|
|
697
|
-
"Failed to load
|
|
698
|
-
{},
|
|
699
|
-
|
|
697
|
+
"Failed to load the invoice preview",
|
|
698
|
+
{ preview: "ON_DEMAND_CHARGE" },
|
|
699
|
+
h
|
|
700
700
|
);
|
|
701
701
|
} finally {
|
|
702
|
-
|
|
702
|
+
f() && (i.value = !1);
|
|
703
703
|
}
|
|
704
704
|
};
|
|
705
|
-
return
|
|
706
|
-
debounce:
|
|
705
|
+
return Wt(t, () => void b(), {
|
|
706
|
+
debounce: () => a.value || i.value || c.value ? xo : 0,
|
|
707
707
|
deep: !0
|
|
708
|
-
}),
|
|
708
|
+
}), X(
|
|
709
|
+
t,
|
|
710
|
+
(S) => {
|
|
711
|
+
l.value = !!S, S || (g(), a.value = void 0, c.value = !1, i.value = !1);
|
|
712
|
+
},
|
|
713
|
+
{ deep: !0, flush: "sync" }
|
|
714
|
+
), b(), { invoicePreview: a, isPreviewPending: u, hasPreviewFailed: c, loadPreview: b };
|
|
709
715
|
}
|
|
710
|
-
const
|
|
716
|
+
const Eo = { key: 0 }, vt = /* @__PURE__ */ z({
|
|
711
717
|
__name: "TopUpInvoicePreview",
|
|
712
718
|
props: {
|
|
713
719
|
pricingPlanScheduleId: { type: String },
|
|
714
720
|
pricingItems: { type: Array }
|
|
715
721
|
},
|
|
716
722
|
setup(e) {
|
|
717
|
-
const t = e, { $t: o } = Q(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i } =
|
|
718
|
-
return (
|
|
723
|
+
const t = e, { $t: o } = Q(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i } = $o({ pricingPlanScheduleId: n, pricingItems: a });
|
|
724
|
+
return (l, u) => (w(), C(et, {
|
|
719
725
|
class: "sv-top-up-invoice-preview h-[152px]",
|
|
720
726
|
"data-testid": "top-up-invoice-preview-skeleton"
|
|
721
727
|
}, {
|
|
722
|
-
default:
|
|
723
|
-
r(i) ? (w(), W("div",
|
|
724
|
-
A(r(
|
|
725
|
-
default:
|
|
726
|
-
F(
|
|
728
|
+
default: _(() => [
|
|
729
|
+
r(i) ? (w(), W("div", Eo, [
|
|
730
|
+
A(r(Ht), { required: "" }, {
|
|
731
|
+
default: _(() => [
|
|
732
|
+
F(I(r(o)({
|
|
727
733
|
defaultMessage: "You will pay",
|
|
728
734
|
description: "Label above the preview of what topping up will be invoiced for",
|
|
729
735
|
id: "topup_modal.invoice_preview.label"
|
|
@@ -731,8 +737,8 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
731
737
|
]),
|
|
732
738
|
_: 1
|
|
733
739
|
}),
|
|
734
|
-
A(r(
|
|
735
|
-
default:
|
|
740
|
+
A(r(ve), { "content-background": "none" }, {
|
|
741
|
+
default: _(() => [
|
|
736
742
|
A(r(at), {
|
|
737
743
|
invoice: r(i),
|
|
738
744
|
"is-customer-facing": ""
|
|
@@ -740,61 +746,61 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
740
746
|
]),
|
|
741
747
|
_: 1
|
|
742
748
|
})
|
|
743
|
-
])) :
|
|
749
|
+
])) : k("", !0)
|
|
744
750
|
]),
|
|
745
751
|
_: 1
|
|
746
752
|
}));
|
|
747
753
|
}
|
|
748
|
-
}),
|
|
754
|
+
}), ft = (e, t) => e.currency ?? t ?? e.creditTypeId ?? "", qe = (e, t) => ({
|
|
749
755
|
quantity: e ?? null,
|
|
750
756
|
currency: t
|
|
751
757
|
}), Ue = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
|
|
752
|
-
var i,
|
|
758
|
+
var i, l, u, c, g;
|
|
753
759
|
return {
|
|
754
760
|
enabled: (e == null ? void 0 : e.status) === "ACTIVE",
|
|
755
|
-
threshold:
|
|
756
|
-
((
|
|
757
|
-
|
|
761
|
+
threshold: qe(
|
|
762
|
+
((l = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : l.quantity) ?? ((c = (u = e == null ? void 0 : e.threshold) == null ? void 0 : u.credits) == null ? void 0 : c.quantity),
|
|
763
|
+
ft(t, n)
|
|
758
764
|
),
|
|
759
|
-
topUpAmount:
|
|
765
|
+
topUpAmount: qe(((g = e == null ? void 0 : e.topup_amount) == null ? void 0 : g.quantity) ?? a, o)
|
|
760
766
|
};
|
|
761
|
-
},
|
|
767
|
+
}, Oo = (e, t) => {
|
|
762
768
|
var n;
|
|
763
769
|
const o = (n = e.threshold) == null ? void 0 : n.quantity;
|
|
764
770
|
return o ? t.creditTypeId ? { credits: { quantity: o, credit_type_id: t.creditTypeId } } : { amount: { quantity: o, currency: t.currency ?? "" } } : {};
|
|
765
|
-
},
|
|
771
|
+
}, Ve = (e, t) => {
|
|
766
772
|
var o;
|
|
767
773
|
return (o = e.topUpAmount) != null && o.quantity ? {
|
|
768
774
|
quantity: e.topUpAmount.quantity,
|
|
769
775
|
currency: e.topUpAmount.currency ?? t
|
|
770
776
|
} : void 0;
|
|
771
|
-
},
|
|
777
|
+
}, ht = (e, { denomination: t, chargeCurrency: o }) => ({
|
|
772
778
|
status: e.enabled ? "ACTIVE" : "INACTIVE",
|
|
773
|
-
threshold:
|
|
774
|
-
...
|
|
775
|
-
topup_amount:
|
|
779
|
+
threshold: Oo(e, t),
|
|
780
|
+
...Ve(e, o) && {
|
|
781
|
+
topup_amount: Ve(e, o)
|
|
776
782
|
}
|
|
777
|
-
}), Fe = (e, t) =>
|
|
783
|
+
}), Fe = (e, t) => ht(Ue(e, t), t), Le = (e, t) => JSON.stringify(e) === JSON.stringify(t), Ye = (e) => {
|
|
778
784
|
const t = Number(e == null ? void 0 : e.quantity);
|
|
779
785
|
return e != null && e.quantity && Number.isFinite(t) ? t : void 0;
|
|
780
|
-
},
|
|
786
|
+
}, Bo = (e, t) => {
|
|
781
787
|
const o = Number(t == null ? void 0 : t.quantity);
|
|
782
788
|
return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e >= o;
|
|
783
|
-
},
|
|
789
|
+
}, Io = (e, t) => {
|
|
784
790
|
const o = Number(t == null ? void 0 : t.quantity);
|
|
785
791
|
return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e <= o;
|
|
786
|
-
},
|
|
792
|
+
}, fe = (e) => {
|
|
787
793
|
const t = Number(e);
|
|
788
794
|
return e != null && e !== "" && Number.isFinite(t) ? t : void 0;
|
|
789
795
|
}, Be = (e, t, o) => {
|
|
790
|
-
const n =
|
|
796
|
+
const n = fe(e), a = fe(o);
|
|
791
797
|
if (!(n === void 0 || a === void 0 || a <= 0))
|
|
792
798
|
return t === "CREDITS" ? n / a : n * a;
|
|
793
|
-
}, He = (e, t, o, n) => t === o ?
|
|
794
|
-
const a =
|
|
799
|
+
}, He = (e, t, o, n) => t === o ? fe(e) : Be(e, t, n), Do = (e, t, o) => t === "CREDITS" ? Be(e, "AMOUNT", o) : fe(e), Ie = (e) => e.toFixed(2), We = (e, t) => t === "AMOUNT" ? Ie(e) : String(Number(e.toFixed(6))), gt = (e, t, o, n) => {
|
|
800
|
+
const a = Do(e == null ? void 0 : e.quantity, t, o);
|
|
795
801
|
if (a !== void 0)
|
|
796
802
|
return t === "CREDITS" ? n(a) : Ie(a);
|
|
797
|
-
},
|
|
803
|
+
}, No = ["data-testid"], Pe = /* @__PURE__ */ z({
|
|
798
804
|
__name: "ConvertedAmountInput",
|
|
799
805
|
props: /* @__PURE__ */ Ot({
|
|
800
806
|
unit: { type: String },
|
|
@@ -816,92 +822,89 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
816
822
|
}),
|
|
817
823
|
emits: ["update:modelValue"],
|
|
818
824
|
setup(e) {
|
|
819
|
-
const t = e, o = $t(e, "modelValue"), { $t: n, formatNumber: a } = Q(), i = s(() => t.entryBase ?? t.modelBase),
|
|
820
|
-
() => i.value !== t.modelBase &&
|
|
821
|
-
),
|
|
822
|
-
|
|
825
|
+
const t = e, o = $t(e, "modelValue"), { $t: n, formatNumber: a } = Q(), i = s(() => t.entryBase ?? t.modelBase), l = s(
|
|
826
|
+
() => i.value !== t.modelBase && fe(t.conversionRate) !== void 0
|
|
827
|
+
), u = $("");
|
|
828
|
+
X(
|
|
823
829
|
() => [o.value, i.value, t.modelBase, t.conversionRate],
|
|
824
|
-
([
|
|
825
|
-
if (!
|
|
826
|
-
|
|
830
|
+
([p]) => {
|
|
831
|
+
if (!l.value) {
|
|
832
|
+
u.value = p ?? "";
|
|
827
833
|
return;
|
|
828
834
|
}
|
|
829
|
-
if (
|
|
835
|
+
if (p === c(u.value))
|
|
830
836
|
return;
|
|
831
837
|
const P = He(
|
|
832
|
-
|
|
838
|
+
p,
|
|
833
839
|
t.modelBase,
|
|
834
840
|
i.value,
|
|
835
841
|
t.conversionRate
|
|
836
842
|
);
|
|
837
|
-
|
|
843
|
+
u.value = P === void 0 ? "" : We(P, i.value);
|
|
838
844
|
},
|
|
839
845
|
{ immediate: !0 }
|
|
840
846
|
);
|
|
841
|
-
function p
|
|
842
|
-
|
|
843
|
-
}
|
|
844
|
-
function y(f) {
|
|
845
|
-
const P = He(f, i.value, t.modelBase, t.conversionRate);
|
|
847
|
+
function c(p) {
|
|
848
|
+
const P = He(p, i.value, t.modelBase, t.conversionRate);
|
|
846
849
|
return P === void 0 ? "" : We(P, t.modelBase);
|
|
847
850
|
}
|
|
848
|
-
const
|
|
849
|
-
get: () =>
|
|
850
|
-
set: (
|
|
851
|
-
|
|
851
|
+
const g = s({
|
|
852
|
+
get: () => u.value,
|
|
853
|
+
set: (p) => {
|
|
854
|
+
u.value = Vt(p), o.value = l.value ? c(u.value) : u.value;
|
|
852
855
|
}
|
|
853
|
-
}),
|
|
854
|
-
() => Be(
|
|
855
|
-
),
|
|
856
|
+
}), b = s(
|
|
857
|
+
() => Be(u.value, i.value, t.conversionRate)
|
|
858
|
+
), S = s(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
|
|
856
859
|
defaultMessage: "credits",
|
|
857
860
|
description: "Generic name for a wallet credit, where its credit type does not name one",
|
|
858
861
|
id: "converted_amount_input.credits"
|
|
859
|
-
})),
|
|
860
|
-
const
|
|
861
|
-
return Array.isArray(
|
|
862
|
-
}),
|
|
863
|
-
const
|
|
864
|
-
if (!(
|
|
862
|
+
})), f = (p, P) => $e({ quantity: Ie(p), currency: P }), h = (p) => `${a(p)} ${S.value}`, v = s(() => {
|
|
863
|
+
const p = t.error;
|
|
864
|
+
return Array.isArray(p) ? p.length > 0 : !!(Et(p) ? p.value : p);
|
|
865
|
+
}), U = s(() => {
|
|
866
|
+
const p = b.value;
|
|
867
|
+
if (!(v.value || !t.showConversionHint || p === void 0))
|
|
865
868
|
return i.value === "CREDITS" ? t.currency ? n(
|
|
866
869
|
{
|
|
867
870
|
defaultMessage: "Will cost {amount} excluding taxes",
|
|
868
871
|
description: "Helper text under a credits field, naming what those credits cost in money",
|
|
869
872
|
id: "converted_amount_input.cost"
|
|
870
873
|
},
|
|
871
|
-
{ amount:
|
|
874
|
+
{ amount: f(p, t.currency) }
|
|
872
875
|
) : void 0 : n(
|
|
873
876
|
{
|
|
874
877
|
defaultMessage: "Buys about {credits}",
|
|
875
878
|
description: "Helper text under a money field, naming the credits that amount converts into",
|
|
876
879
|
id: "converted_amount_input.buys"
|
|
877
880
|
},
|
|
878
|
-
{ credits:
|
|
881
|
+
{ credits: h(p) }
|
|
879
882
|
);
|
|
880
|
-
}),
|
|
883
|
+
}), B = (p) => gt(p, i.value, t.conversionRate, a), J = s(
|
|
881
884
|
() => {
|
|
882
|
-
var
|
|
883
|
-
return i.value === "CREDITS" ?
|
|
885
|
+
var p, P, E, D;
|
|
886
|
+
return i.value === "CREDITS" ? S.value : ((P = (p = t.bounds) == null ? void 0 : p.minimum) == null ? void 0 : P.currency) ?? ((D = (E = t.bounds) == null ? void 0 : E.maximum) == null ? void 0 : D.currency) ?? t.unit;
|
|
884
887
|
}
|
|
885
|
-
),
|
|
886
|
-
var D,
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
888
|
+
), y = s(() => {
|
|
889
|
+
var D, R;
|
|
890
|
+
const p = B((D = t.bounds) == null ? void 0 : D.minimum), P = B((R = t.bounds) == null ? void 0 : R.maximum), E = J.value;
|
|
891
|
+
if (p && P)
|
|
889
892
|
return n(
|
|
890
893
|
{
|
|
891
894
|
defaultMessage: "Between {minimum} and {maximum} {unit}",
|
|
892
895
|
description: "Range of what a flexible top-up may be charged for, beside its label",
|
|
893
896
|
id: "converted_amount_input.bounds.range"
|
|
894
897
|
},
|
|
895
|
-
{ minimum:
|
|
898
|
+
{ minimum: p, maximum: P, unit: E }
|
|
896
899
|
);
|
|
897
|
-
if (
|
|
900
|
+
if (p)
|
|
898
901
|
return n(
|
|
899
902
|
{
|
|
900
903
|
defaultMessage: "At least {minimum} {unit}",
|
|
901
904
|
description: "Smallest amount a flexible top-up may be charged for, beside its label",
|
|
902
905
|
id: "converted_amount_input.bounds.minimum"
|
|
903
906
|
},
|
|
904
|
-
{ minimum:
|
|
907
|
+
{ minimum: p, unit: E }
|
|
905
908
|
);
|
|
906
909
|
if (P)
|
|
907
910
|
return n(
|
|
@@ -910,12 +913,12 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
910
913
|
description: "Largest amount a flexible top-up may be charged for, beside its label",
|
|
911
914
|
id: "converted_amount_input.bounds.maximum"
|
|
912
915
|
},
|
|
913
|
-
{ maximum: P, unit:
|
|
916
|
+
{ maximum: P, unit: E }
|
|
914
917
|
);
|
|
915
918
|
});
|
|
916
|
-
return (
|
|
917
|
-
modelValue:
|
|
918
|
-
"onUpdate:modelValue": P[0] || (P[0] = (
|
|
919
|
+
return (p, P) => (w(), C(r(jt), {
|
|
920
|
+
modelValue: g.value,
|
|
921
|
+
"onUpdate:modelValue": P[0] || (P[0] = (E) => g.value = E),
|
|
919
922
|
class: "sv-converted-amount-input",
|
|
920
923
|
type: "number",
|
|
921
924
|
"as-text-type": "",
|
|
@@ -925,43 +928,43 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
925
928
|
disabled: e.disabled,
|
|
926
929
|
error: e.error
|
|
927
930
|
}, re({
|
|
928
|
-
suffix:
|
|
929
|
-
|
|
931
|
+
suffix: _(() => [
|
|
932
|
+
N("span", {
|
|
930
933
|
"data-testid": `${e.name}-unit`
|
|
931
|
-
},
|
|
934
|
+
}, I(e.unit), 9, No)
|
|
932
935
|
]),
|
|
933
936
|
_: 2
|
|
934
937
|
}, [
|
|
935
|
-
|
|
938
|
+
y.value ? {
|
|
936
939
|
name: "label-suffix",
|
|
937
|
-
fn:
|
|
938
|
-
A(r(
|
|
940
|
+
fn: _(() => [
|
|
941
|
+
A(r(K), {
|
|
939
942
|
tag: "span",
|
|
940
943
|
variant: "body-xs",
|
|
941
944
|
color: "subtle",
|
|
942
945
|
"no-spacing": "",
|
|
943
946
|
"data-testid": `${e.name}-bounds`
|
|
944
947
|
}, {
|
|
945
|
-
default:
|
|
946
|
-
F(
|
|
948
|
+
default: _(() => [
|
|
949
|
+
F(I(y.value), 1)
|
|
947
950
|
]),
|
|
948
951
|
_: 1
|
|
949
952
|
}, 8, ["data-testid"])
|
|
950
953
|
]),
|
|
951
954
|
key: "0"
|
|
952
955
|
} : void 0,
|
|
953
|
-
|
|
956
|
+
U.value ? {
|
|
954
957
|
name: "helper",
|
|
955
|
-
fn:
|
|
956
|
-
A(r(
|
|
958
|
+
fn: _(() => [
|
|
959
|
+
A(r(K), {
|
|
957
960
|
tag: "span",
|
|
958
961
|
variant: "body-xs",
|
|
959
962
|
color: "subtle",
|
|
960
963
|
"no-spacing": "",
|
|
961
964
|
"data-testid": `${e.name}-conversion`
|
|
962
965
|
}, {
|
|
963
|
-
default:
|
|
964
|
-
F(
|
|
966
|
+
default: _(() => [
|
|
967
|
+
F(I(U.value), 1)
|
|
965
968
|
]),
|
|
966
969
|
_: 1
|
|
967
970
|
}, 8, ["data-testid"])
|
|
@@ -970,7 +973,7 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
970
973
|
} : void 0
|
|
971
974
|
]), 1032, ["modelValue", "name", "label", "required", "disabled", "error"]));
|
|
972
975
|
}
|
|
973
|
-
}),
|
|
976
|
+
}), ko = /* @__PURE__ */ z({
|
|
974
977
|
__name: "Section",
|
|
975
978
|
props: {
|
|
976
979
|
emphasized: { type: Boolean, default: !1 },
|
|
@@ -989,28 +992,28 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
989
992
|
].join(" "), n = s(
|
|
990
993
|
() => [t.emphasized ? o : void 0, t.contentClasses].filter(Boolean).join(" ")
|
|
991
994
|
), a = s(() => {
|
|
992
|
-
const { emphasized: i, ...
|
|
993
|
-
return
|
|
995
|
+
const { emphasized: i, ...l } = t;
|
|
996
|
+
return l;
|
|
994
997
|
});
|
|
995
|
-
return (i,
|
|
998
|
+
return (i, l) => (w(), C(r(ve), le(a.value, {
|
|
996
999
|
class: "sv-section",
|
|
997
1000
|
"content-classes": n.value
|
|
998
1001
|
}), re({
|
|
999
|
-
default:
|
|
1002
|
+
default: _(() => [
|
|
1000
1003
|
se(i.$slots, "default")
|
|
1001
1004
|
]),
|
|
1002
1005
|
_: 2
|
|
1003
1006
|
}, [
|
|
1004
1007
|
i.$slots.right ? {
|
|
1005
1008
|
name: "right",
|
|
1006
|
-
fn:
|
|
1009
|
+
fn: _(() => [
|
|
1007
1010
|
se(i.$slots, "right")
|
|
1008
1011
|
]),
|
|
1009
1012
|
key: "0"
|
|
1010
1013
|
} : void 0
|
|
1011
1014
|
]), 1040, ["content-classes"]));
|
|
1012
1015
|
}
|
|
1013
|
-
}),
|
|
1016
|
+
}), Ro = { class: "flex grow flex-col" }, _t = /* @__PURE__ */ z({
|
|
1014
1017
|
__name: "AutoTopUpConfig",
|
|
1015
1018
|
props: {
|
|
1016
1019
|
config: { type: Object },
|
|
@@ -1026,57 +1029,57 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1026
1029
|
},
|
|
1027
1030
|
emits: ["save"],
|
|
1028
1031
|
setup(e, { expose: t, emit: o }) {
|
|
1029
|
-
const n = e, a = o, { $t: i, formatNumber:
|
|
1030
|
-
var
|
|
1032
|
+
const n = e, a = o, { $t: i, formatNumber: l } = Q(), u = s(() => {
|
|
1033
|
+
var T, x;
|
|
1031
1034
|
return {
|
|
1032
1035
|
denomination: n.denomination,
|
|
1033
1036
|
chargeCurrency: n.chargeCurrency,
|
|
1034
1037
|
creditUnitName: n.creditUnitName,
|
|
1035
|
-
minimumTopUp: (
|
|
1038
|
+
minimumTopUp: (x = (T = n.topUpBounds) == null ? void 0 : T.minimum) == null ? void 0 : x.quantity
|
|
1036
1039
|
};
|
|
1037
|
-
}),
|
|
1040
|
+
}), c = $(Ue(n.config, u.value)), g = s(() => ft(n.denomination, n.creditUnitName)), b = s(
|
|
1038
1041
|
() => n.denomination.creditTypeId ? "CREDITS" : "AMOUNT"
|
|
1039
|
-
),
|
|
1040
|
-
() =>
|
|
1041
|
-
),
|
|
1042
|
+
), S = s(
|
|
1043
|
+
() => b.value === "CREDITS" ? g.value : n.chargeCurrency
|
|
1044
|
+
), f = s({
|
|
1042
1045
|
get: () => {
|
|
1043
|
-
var
|
|
1044
|
-
return ((
|
|
1046
|
+
var T;
|
|
1047
|
+
return ((T = c.value.threshold) == null ? void 0 : T.quantity) ?? "";
|
|
1045
1048
|
},
|
|
1046
|
-
set: (
|
|
1047
|
-
|
|
1049
|
+
set: (T) => {
|
|
1050
|
+
c.value.threshold = { quantity: T || null, currency: g.value };
|
|
1048
1051
|
}
|
|
1049
|
-
}),
|
|
1052
|
+
}), h = s({
|
|
1050
1053
|
get: () => {
|
|
1051
|
-
var
|
|
1052
|
-
return ((
|
|
1054
|
+
var T;
|
|
1055
|
+
return ((T = c.value.topUpAmount) == null ? void 0 : T.quantity) ?? "";
|
|
1053
1056
|
},
|
|
1054
|
-
set: (
|
|
1055
|
-
|
|
1057
|
+
set: (T) => {
|
|
1058
|
+
c.value.topUpAmount = { quantity: T || null, currency: n.chargeCurrency };
|
|
1056
1059
|
}
|
|
1057
1060
|
});
|
|
1058
|
-
|
|
1059
|
-
() => [n.config,
|
|
1060
|
-
([
|
|
1061
|
-
Le(Fe(
|
|
1061
|
+
X(
|
|
1062
|
+
() => [n.config, u.value],
|
|
1063
|
+
([T, x]) => {
|
|
1064
|
+
Le(Fe(T, x), B()) || (c.value = Ue(T, x));
|
|
1062
1065
|
}
|
|
1063
1066
|
);
|
|
1064
|
-
const
|
|
1065
|
-
get: () => n.alwaysEnabled ||
|
|
1066
|
-
set: (
|
|
1067
|
-
|
|
1067
|
+
const v = s({
|
|
1068
|
+
get: () => n.alwaysEnabled || c.value.enabled,
|
|
1069
|
+
set: (T) => {
|
|
1070
|
+
c.value.enabled = T;
|
|
1068
1071
|
}
|
|
1069
1072
|
}), U = s(
|
|
1070
|
-
() =>
|
|
1071
|
-
),
|
|
1072
|
-
threshold: s(() => Ye(
|
|
1073
|
-
topUpAmount: s(() => Ye(
|
|
1074
|
-
}),
|
|
1075
|
-
if (!
|
|
1073
|
+
() => ht({ ...c.value, enabled: v.value }, u.value)
|
|
1074
|
+
), B = () => U.value, J = Ae({
|
|
1075
|
+
threshold: s(() => Ye(c.value.threshold) ?? null),
|
|
1076
|
+
topUpAmount: s(() => Ye(c.value.topUpAmount) ?? null)
|
|
1077
|
+
}), y = (T) => {
|
|
1078
|
+
if (!T)
|
|
1076
1079
|
return "";
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1079
|
-
},
|
|
1080
|
+
const x = gt(T, b.value, n.conversionRate, l);
|
|
1081
|
+
return x === void 0 ? $e(T) : `${x} ${S.value}`;
|
|
1082
|
+
}, p = Lt(() => v.value), P = xe(
|
|
1080
1083
|
{
|
|
1081
1084
|
threshold: {
|
|
1082
1085
|
required: ie.withMessage(
|
|
@@ -1085,7 +1088,7 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1085
1088
|
description: "Error shown under the auto top-up threshold when it is left empty",
|
|
1086
1089
|
id: "auto_topup_config.threshold.required"
|
|
1087
1090
|
}),
|
|
1088
|
-
|
|
1091
|
+
p
|
|
1089
1092
|
),
|
|
1090
1093
|
notNegative: ie.withMessage(
|
|
1091
1094
|
() => i({
|
|
@@ -1093,7 +1096,7 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1093
1096
|
description: "Error shown under the auto top-up threshold when it is below zero",
|
|
1094
1097
|
id: "auto_topup_config.threshold.not_negative"
|
|
1095
1098
|
}),
|
|
1096
|
-
(
|
|
1099
|
+
(T) => T === null || T >= 0
|
|
1097
1100
|
)
|
|
1098
1101
|
},
|
|
1099
1102
|
topUpAmount: {
|
|
@@ -1103,7 +1106,7 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1103
1106
|
description: "Error shown under the auto top-up amount when it is left empty",
|
|
1104
1107
|
id: "auto_topup_config.amount.required"
|
|
1105
1108
|
}),
|
|
1106
|
-
|
|
1109
|
+
p
|
|
1107
1110
|
),
|
|
1108
1111
|
positive: ie.withMessage(
|
|
1109
1112
|
() => i({
|
|
@@ -1111,88 +1114,88 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1111
1114
|
description: "Error shown under the auto top-up amount when it is zero or negative",
|
|
1112
1115
|
id: "auto_topup_config.amount.positive"
|
|
1113
1116
|
}),
|
|
1114
|
-
(
|
|
1117
|
+
(T) => T === null || T > 0
|
|
1115
1118
|
),
|
|
1116
1119
|
atLeastMinimum: ie.withMessage(
|
|
1117
1120
|
() => {
|
|
1118
|
-
var
|
|
1121
|
+
var T;
|
|
1119
1122
|
return i(
|
|
1120
1123
|
{
|
|
1121
1124
|
defaultMessage: "Top up with at least {minimum}.",
|
|
1122
1125
|
description: "Error shown under the auto top-up amount when it is below what the pricing allows",
|
|
1123
1126
|
id: "auto_topup_config.amount.at_least_minimum"
|
|
1124
1127
|
},
|
|
1125
|
-
{ minimum:
|
|
1128
|
+
{ minimum: y((T = n.topUpBounds) == null ? void 0 : T.minimum) }
|
|
1126
1129
|
);
|
|
1127
1130
|
},
|
|
1128
|
-
(
|
|
1129
|
-
var
|
|
1130
|
-
return
|
|
1131
|
+
(T) => {
|
|
1132
|
+
var x;
|
|
1133
|
+
return Bo(T, (x = n.topUpBounds) == null ? void 0 : x.minimum);
|
|
1131
1134
|
}
|
|
1132
1135
|
),
|
|
1133
1136
|
withinMaximum: ie.withMessage(
|
|
1134
1137
|
() => {
|
|
1135
|
-
var
|
|
1138
|
+
var T;
|
|
1136
1139
|
return i(
|
|
1137
1140
|
{
|
|
1138
1141
|
defaultMessage: "Top up with at most {maximum}.",
|
|
1139
1142
|
description: "Error shown under the auto top-up amount when it is above what the pricing allows",
|
|
1140
1143
|
id: "auto_topup_config.amount.within_maximum"
|
|
1141
1144
|
},
|
|
1142
|
-
{ maximum:
|
|
1145
|
+
{ maximum: y((T = n.topUpBounds) == null ? void 0 : T.maximum) }
|
|
1143
1146
|
);
|
|
1144
1147
|
},
|
|
1145
|
-
(
|
|
1146
|
-
var
|
|
1147
|
-
return
|
|
1148
|
+
(T) => {
|
|
1149
|
+
var x;
|
|
1150
|
+
return Io(T, (x = n.topUpBounds) == null ? void 0 : x.maximum);
|
|
1148
1151
|
}
|
|
1149
1152
|
)
|
|
1150
1153
|
}
|
|
1151
1154
|
},
|
|
1152
|
-
|
|
1153
|
-
),
|
|
1155
|
+
J
|
|
1156
|
+
), E = s(
|
|
1154
1157
|
() => !Le(
|
|
1155
|
-
|
|
1156
|
-
Fe(n.config,
|
|
1158
|
+
B(),
|
|
1159
|
+
Fe(n.config, u.value)
|
|
1157
1160
|
)
|
|
1158
1161
|
);
|
|
1159
|
-
function O() {
|
|
1160
|
-
return f.value.$touch(), f.value.$invalid ? void 0 : I();
|
|
1161
|
-
}
|
|
1162
1162
|
function D() {
|
|
1163
|
-
|
|
1164
|
-
|
|
1163
|
+
return P.value.$touch(), P.value.$invalid ? void 0 : B();
|
|
1164
|
+
}
|
|
1165
|
+
function R() {
|
|
1166
|
+
const T = D();
|
|
1167
|
+
T && a("save", T);
|
|
1165
1168
|
}
|
|
1166
1169
|
return t({
|
|
1167
|
-
submit:
|
|
1168
|
-
validate:
|
|
1170
|
+
submit: R,
|
|
1171
|
+
validate: D,
|
|
1169
1172
|
rule: U,
|
|
1170
|
-
hasChanges:
|
|
1171
|
-
isInvalid: s(() =>
|
|
1172
|
-
}), (
|
|
1173
|
+
hasChanges: E,
|
|
1174
|
+
isInvalid: s(() => P.value.$invalid)
|
|
1175
|
+
}), (T, x) => (w(), C(ko, {
|
|
1173
1176
|
class: "sv-auto-topup-config",
|
|
1174
1177
|
"content-background": e.contained ? "gray" : "none",
|
|
1175
1178
|
"no-spacing": !e.contained,
|
|
1176
1179
|
"no-border": !e.contained
|
|
1177
1180
|
}, {
|
|
1178
|
-
default:
|
|
1179
|
-
e.alwaysEnabled ?
|
|
1181
|
+
default: _(() => [
|
|
1182
|
+
e.alwaysEnabled ? k("", !0) : (w(), C(r(Ft), {
|
|
1180
1183
|
key: 0,
|
|
1181
|
-
modelValue:
|
|
1182
|
-
"onUpdate:modelValue":
|
|
1184
|
+
modelValue: v.value,
|
|
1185
|
+
"onUpdate:modelValue": x[0] || (x[0] = (G) => v.value = G),
|
|
1183
1186
|
"no-spacing": "",
|
|
1184
1187
|
"label-position": "before",
|
|
1185
1188
|
class: "!flex",
|
|
1186
1189
|
disabled: e.disabled
|
|
1187
1190
|
}, {
|
|
1188
|
-
"inline-label":
|
|
1189
|
-
|
|
1190
|
-
A(r(
|
|
1191
|
+
"inline-label": _(() => [
|
|
1192
|
+
N("div", Ro, [
|
|
1193
|
+
A(r(K), {
|
|
1191
1194
|
tag: "span",
|
|
1192
1195
|
variant: "body-sm"
|
|
1193
1196
|
}, {
|
|
1194
|
-
default:
|
|
1195
|
-
F(
|
|
1197
|
+
default: _(() => [
|
|
1198
|
+
F(I(r(i)({
|
|
1196
1199
|
defaultMessage: "Auto top-up",
|
|
1197
1200
|
description: "Title of the automatic wallet top-up settings",
|
|
1198
1201
|
id: "auto_topup_config.title"
|
|
@@ -1200,13 +1203,13 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1200
1203
|
]),
|
|
1201
1204
|
_: 1
|
|
1202
1205
|
}),
|
|
1203
|
-
A(r(
|
|
1206
|
+
A(r(K), {
|
|
1204
1207
|
tag: "span",
|
|
1205
1208
|
variant: "body-xs",
|
|
1206
1209
|
color: "subtle"
|
|
1207
1210
|
}, {
|
|
1208
|
-
default:
|
|
1209
|
-
F(
|
|
1211
|
+
default: _(() => [
|
|
1212
|
+
F(I(r(i)({
|
|
1210
1213
|
defaultMessage: "Automatically top up your balance when it runs low.",
|
|
1211
1214
|
description: "Subtitle of the automatic wallet top-up settings",
|
|
1212
1215
|
id: "auto_topup_config.subtitle"
|
|
@@ -1218,38 +1221,38 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1218
1221
|
]),
|
|
1219
1222
|
_: 1
|
|
1220
1223
|
}, 8, ["modelValue", "disabled"])),
|
|
1221
|
-
A(r(nt), { "is-open":
|
|
1222
|
-
default:
|
|
1223
|
-
|
|
1224
|
+
A(r(nt), { "is-open": v.value }, {
|
|
1225
|
+
default: _(() => [
|
|
1226
|
+
v.value ? (w(), W("div", {
|
|
1224
1227
|
key: 0,
|
|
1225
1228
|
class: ze(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
|
|
1226
1229
|
}, [
|
|
1227
|
-
A(
|
|
1228
|
-
modelValue:
|
|
1229
|
-
"onUpdate:modelValue":
|
|
1230
|
+
A(Pe, {
|
|
1231
|
+
modelValue: f.value,
|
|
1232
|
+
"onUpdate:modelValue": x[1] || (x[1] = (G) => f.value = G),
|
|
1230
1233
|
name: "auto-top-up-threshold",
|
|
1231
|
-
unit:
|
|
1232
|
-
"model-base":
|
|
1233
|
-
"entry-base":
|
|
1234
|
+
unit: g.value,
|
|
1235
|
+
"model-base": b.value,
|
|
1236
|
+
"entry-base": b.value,
|
|
1234
1237
|
currency: e.chargeCurrency,
|
|
1235
1238
|
"conversion-rate": e.conversionRate,
|
|
1236
1239
|
"show-conversion-hint": e.showThresholdConversion,
|
|
1237
1240
|
required: "",
|
|
1238
1241
|
disabled: e.disabled,
|
|
1239
|
-
error: r(
|
|
1242
|
+
error: r(P).threshold.$errors,
|
|
1240
1243
|
label: r(i)({
|
|
1241
1244
|
defaultMessage: "When your balance falls below",
|
|
1242
1245
|
description: "Label of the balance at which an automatic top-up is charged",
|
|
1243
1246
|
id: "auto_topup_config.threshold.label"
|
|
1244
1247
|
})
|
|
1245
1248
|
}, null, 8, ["modelValue", "unit", "model-base", "entry-base", "currency", "conversion-rate", "show-conversion-hint", "disabled", "error", "label"]),
|
|
1246
|
-
A(
|
|
1247
|
-
modelValue:
|
|
1248
|
-
"onUpdate:modelValue":
|
|
1249
|
+
A(Pe, {
|
|
1250
|
+
modelValue: h.value,
|
|
1251
|
+
"onUpdate:modelValue": x[2] || (x[2] = (G) => h.value = G),
|
|
1249
1252
|
name: "auto-top-up-amount",
|
|
1250
|
-
unit:
|
|
1253
|
+
unit: S.value,
|
|
1251
1254
|
"model-base": "AMOUNT",
|
|
1252
|
-
"entry-base":
|
|
1255
|
+
"entry-base": b.value,
|
|
1253
1256
|
currency: e.chargeCurrency,
|
|
1254
1257
|
"credit-unit-name": e.creditUnitName,
|
|
1255
1258
|
"conversion-rate": e.conversionRate,
|
|
@@ -1257,14 +1260,14 @@ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
|
|
|
1257
1260
|
"show-conversion-hint": "",
|
|
1258
1261
|
required: "",
|
|
1259
1262
|
disabled: e.disabled,
|
|
1260
|
-
error: r(
|
|
1263
|
+
error: r(P).topUpAmount.$errors,
|
|
1261
1264
|
label: r(i)({
|
|
1262
1265
|
defaultMessage: "Top-up with",
|
|
1263
1266
|
description: "Label of the amount every automatic top-up adds",
|
|
1264
1267
|
id: "auto_topup_config.amount.label"
|
|
1265
1268
|
})
|
|
1266
1269
|
}, null, 8, ["modelValue", "unit", "entry-base", "currency", "credit-unit-name", "conversion-rate", "bounds", "disabled", "error", "label"])
|
|
1267
|
-
], 2)) :
|
|
1270
|
+
], 2)) : k("", !0)
|
|
1268
1271
|
]),
|
|
1269
1272
|
_: 1
|
|
1270
1273
|
}, 8, ["is-open"])
|
|
@@ -1286,23 +1289,23 @@ function yt({
|
|
|
1286
1289
|
(a, i) => je(i.created_at) - je(a.created_at)
|
|
1287
1290
|
)
|
|
1288
1291
|
);
|
|
1289
|
-
return
|
|
1292
|
+
return X(
|
|
1290
1293
|
() => [
|
|
1291
1294
|
e.value,
|
|
1292
1295
|
o == null ? void 0 : o.value,
|
|
1293
1296
|
t.value
|
|
1294
1297
|
],
|
|
1295
|
-
([a, i,
|
|
1296
|
-
var
|
|
1297
|
-
const
|
|
1298
|
-
({ id:
|
|
1298
|
+
([a, i, l], u) => {
|
|
1299
|
+
var S;
|
|
1300
|
+
const c = u == null ? void 0 : u[0], g = a == null ? void 0 : a.find(
|
|
1301
|
+
({ id: f }) => !(c != null && c.some((h) => h.id === f))
|
|
1299
1302
|
);
|
|
1300
|
-
if (
|
|
1301
|
-
t.value =
|
|
1303
|
+
if (g && (c != null && c.length)) {
|
|
1304
|
+
t.value = g.id;
|
|
1302
1305
|
return;
|
|
1303
1306
|
}
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1307
|
+
const b = (f) => !!f && !!(a != null && a.some((h) => h.id === f));
|
|
1308
|
+
b(l) || (t.value = b(i) ? i : (S = (a == null ? void 0 : a.find(({ is_default: f }) => f)) ?? n.value[0]) == null ? void 0 : S.id);
|
|
1306
1309
|
},
|
|
1307
1310
|
{ immediate: !0 }
|
|
1308
1311
|
), { sortedPaymentMethods: n };
|
|
@@ -1311,7 +1314,7 @@ function ye() {
|
|
|
1311
1314
|
const { $t: e, formatNumber: t } = Q(), o = (a) => Ce(e, t, a);
|
|
1312
1315
|
return { formatValue: o, formatOpenBalance: (a) => o(a == null ? void 0 : a.wallet_balance.open_balance) };
|
|
1313
1316
|
}
|
|
1314
|
-
const
|
|
1317
|
+
const qo = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }, Fo = { class: "grid grid-cols-1 gap-1" }, Lo = { class: "sv-top-up-form__option-details" }, Yo = { key: 0 }, Ho = /* @__PURE__ */ z({
|
|
1315
1318
|
__name: "TopUpModalForm",
|
|
1316
1319
|
props: {
|
|
1317
1320
|
topUpPricingItems: { type: null },
|
|
@@ -1321,121 +1324,121 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1321
1324
|
},
|
|
1322
1325
|
emits: ["add-payment-method", "success", "save-auto-top-up", "failure"],
|
|
1323
1326
|
setup(e, { expose: t, emit: o }) {
|
|
1324
|
-
const n = e, a = o, { $t: i } = Q(), { formatValue:
|
|
1327
|
+
const n = e, a = o, { $t: i } = Q(), { formatValue: l } = ye(), u = $({
|
|
1325
1328
|
pricing_plan_schedule_id: "",
|
|
1326
1329
|
pricing_items: [],
|
|
1327
1330
|
start_at: "",
|
|
1328
1331
|
finalize_immediately: !1,
|
|
1329
1332
|
payment_method_id: void 0,
|
|
1330
1333
|
preview: !0
|
|
1331
|
-
}),
|
|
1334
|
+
}), c = s(() => {
|
|
1332
1335
|
const d = (n.topUpPricingItems ?? []).filter(
|
|
1333
|
-
(
|
|
1336
|
+
(m) => m.flexiblePricing || m.fixedPricing
|
|
1334
1337
|
);
|
|
1335
1338
|
return [
|
|
1336
|
-
...d.filter(({ flexiblePricing:
|
|
1337
|
-
...d.filter(({ flexiblePricing:
|
|
1339
|
+
...d.filter(({ flexiblePricing: m }) => m),
|
|
1340
|
+
...d.filter(({ flexiblePricing: m }) => !m)
|
|
1338
1341
|
];
|
|
1339
|
-
}),
|
|
1342
|
+
}), g = (d) => c.value.find((m) => m.pricingItemId === d), b = s(
|
|
1340
1343
|
() => {
|
|
1341
|
-
var d,
|
|
1342
|
-
return (
|
|
1344
|
+
var d, m;
|
|
1345
|
+
return (m = (d = n.topUpPricingItems) == null ? void 0 : d.find((M) => M.pricingPlanScheduleId)) == null ? void 0 : m.pricingPlanScheduleId;
|
|
1343
1346
|
}
|
|
1344
1347
|
);
|
|
1345
|
-
|
|
1346
|
-
|
|
1348
|
+
X(
|
|
1349
|
+
b,
|
|
1347
1350
|
(d) => {
|
|
1348
|
-
|
|
1351
|
+
u.value.pricing_plan_schedule_id = d ?? "";
|
|
1349
1352
|
},
|
|
1350
1353
|
{ immediate: !0 }
|
|
1351
1354
|
);
|
|
1352
|
-
const
|
|
1353
|
-
const { config:
|
|
1354
|
-
return
|
|
1355
|
-
},
|
|
1355
|
+
const S = (d) => {
|
|
1356
|
+
const { config: m, currency: M } = d.flexiblePricing ?? {}, q = m == null ? void 0 : m.minimum_amount;
|
|
1357
|
+
return q && M ? { quantity: q.quantity, currency: M } : void 0;
|
|
1358
|
+
}, f = s({
|
|
1356
1359
|
get: () => {
|
|
1357
1360
|
var d;
|
|
1358
|
-
return (d =
|
|
1361
|
+
return (d = u.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id;
|
|
1359
1362
|
},
|
|
1360
1363
|
set: (d) => {
|
|
1361
|
-
const
|
|
1362
|
-
if (!
|
|
1363
|
-
|
|
1364
|
+
const m = g(typeof d == "string" ? d : void 0);
|
|
1365
|
+
if (!m) {
|
|
1366
|
+
u.value.pricing_items = [];
|
|
1364
1367
|
return;
|
|
1365
1368
|
}
|
|
1366
|
-
const M =
|
|
1367
|
-
|
|
1369
|
+
const M = S(m);
|
|
1370
|
+
u.value.pricing_items = [
|
|
1368
1371
|
{
|
|
1369
|
-
pricing_item_id:
|
|
1372
|
+
pricing_item_id: m.pricingItemId,
|
|
1370
1373
|
...M && { flexible_amount: M }
|
|
1371
1374
|
}
|
|
1372
1375
|
];
|
|
1373
1376
|
}
|
|
1374
1377
|
});
|
|
1375
|
-
|
|
1376
|
-
|
|
1378
|
+
X(
|
|
1379
|
+
c,
|
|
1377
1380
|
(d) => {
|
|
1378
1381
|
if (d.some(
|
|
1379
|
-
({ pricingItemId:
|
|
1382
|
+
({ pricingItemId: q }) => {
|
|
1380
1383
|
var Y;
|
|
1381
|
-
return
|
|
1384
|
+
return q === ((Y = u.value.pricing_items[0]) == null ? void 0 : Y.pricing_item_id);
|
|
1382
1385
|
}
|
|
1383
1386
|
))
|
|
1384
1387
|
return;
|
|
1385
|
-
const M = d.find(({ flexiblePricing:
|
|
1386
|
-
|
|
1388
|
+
const M = d.find(({ flexiblePricing: q }) => q) ?? d[0];
|
|
1389
|
+
f.value = M == null ? void 0 : M.pricingItemId;
|
|
1387
1390
|
},
|
|
1388
1391
|
{ immediate: !0 }
|
|
1389
1392
|
);
|
|
1390
|
-
const
|
|
1393
|
+
const h = s({
|
|
1391
1394
|
get: () => {
|
|
1392
1395
|
var d;
|
|
1393
|
-
return (d =
|
|
1396
|
+
return (d = u.value.pricing_items[0]) == null ? void 0 : d.flexible_amount;
|
|
1394
1397
|
},
|
|
1395
1398
|
set: (d) => {
|
|
1396
1399
|
var M;
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
-
{ pricing_item_id:
|
|
1400
|
+
const m = (M = u.value.pricing_items[0]) == null ? void 0 : M.pricing_item_id;
|
|
1401
|
+
m && (u.value.pricing_items = [
|
|
1402
|
+
{ pricing_item_id: m, ...d && { flexible_amount: d } }
|
|
1400
1403
|
]);
|
|
1401
1404
|
}
|
|
1402
|
-
}),
|
|
1405
|
+
}), v = (d) => {
|
|
1403
1406
|
var M;
|
|
1404
|
-
const
|
|
1405
|
-
return
|
|
1407
|
+
const m = (M = g(String(d))) == null ? void 0 : M.fixedPricing;
|
|
1408
|
+
return m != null && m.value.credits ? $e(m.amount) : void 0;
|
|
1406
1409
|
}, U = s(
|
|
1407
1410
|
() => {
|
|
1408
1411
|
var d;
|
|
1409
|
-
return (d =
|
|
1412
|
+
return (d = g(String(f.value))) == null ? void 0 : d.flexiblePricing;
|
|
1410
1413
|
}
|
|
1411
|
-
),
|
|
1414
|
+
), B = s({
|
|
1412
1415
|
get: () => {
|
|
1413
1416
|
var d;
|
|
1414
|
-
return ((d =
|
|
1417
|
+
return ((d = h.value) == null ? void 0 : d.quantity) ?? "";
|
|
1415
1418
|
},
|
|
1416
1419
|
set: (d) => {
|
|
1417
1420
|
var M;
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1421
|
+
const m = (M = U.value) == null ? void 0 : M.currency;
|
|
1422
|
+
h.value = d && m ? { quantity: d, currency: m } : void 0;
|
|
1420
1423
|
}
|
|
1421
|
-
}),
|
|
1424
|
+
}), J = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", y = s(() => pt(n.topUpPricingItems)), p = (d) => d.creditsConfiguration ? y.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, P = (d) => {
|
|
1422
1425
|
var M;
|
|
1423
|
-
const
|
|
1424
|
-
return
|
|
1425
|
-
},
|
|
1426
|
-
var
|
|
1427
|
-
return !!((
|
|
1428
|
-
},
|
|
1429
|
-
() =>
|
|
1430
|
-
var
|
|
1426
|
+
const m = (M = g(String(d))) == null ? void 0 : M.flexiblePricing;
|
|
1427
|
+
return m ? [m] : [];
|
|
1428
|
+
}, E = (d) => {
|
|
1429
|
+
var m;
|
|
1430
|
+
return !!((m = g(String(d))) != null && m.flexiblePricing);
|
|
1431
|
+
}, D = s(
|
|
1432
|
+
() => c.value.map((d) => {
|
|
1433
|
+
var m;
|
|
1431
1434
|
return {
|
|
1432
1435
|
value: d.pricingItemId,
|
|
1433
|
-
label: d.fixedPricing ?
|
|
1436
|
+
label: d.fixedPricing ? l(d.fixedPricing.value) : i({
|
|
1434
1437
|
defaultMessage: "Choose your own amount",
|
|
1435
1438
|
description: "Label of the choose-your-amount option in the top-up modal",
|
|
1436
1439
|
id: "topup_modal.flexible_option.label"
|
|
1437
1440
|
}),
|
|
1438
|
-
...((
|
|
1441
|
+
...((m = d.flexiblePricing) == null ? void 0 : m.bounds.minimum) && d.flexiblePricing.bounds.maximum && {
|
|
1439
1442
|
description: i(
|
|
1440
1443
|
{
|
|
1441
1444
|
defaultMessage: "Between {minimum} and {maximum}",
|
|
@@ -1443,25 +1446,25 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1443
1446
|
id: "topup_modal.flexible_option.bounds"
|
|
1444
1447
|
},
|
|
1445
1448
|
{
|
|
1446
|
-
minimum:
|
|
1447
|
-
maximum:
|
|
1449
|
+
minimum: l(d.flexiblePricing.bounds.minimum),
|
|
1450
|
+
maximum: l(d.flexiblePricing.bounds.maximum)
|
|
1448
1451
|
}
|
|
1449
1452
|
)
|
|
1450
1453
|
}
|
|
1451
1454
|
};
|
|
1452
1455
|
})
|
|
1453
|
-
),
|
|
1454
|
-
const d =
|
|
1455
|
-
(
|
|
1456
|
+
), R = s(() => {
|
|
1457
|
+
const d = u.value.pricing_items.filter(
|
|
1458
|
+
(m) => {
|
|
1456
1459
|
var M;
|
|
1457
|
-
return !((M =
|
|
1460
|
+
return !((M = g(m.pricing_item_id)) != null && M.flexiblePricing) || !!m.flexible_amount;
|
|
1458
1461
|
}
|
|
1459
1462
|
);
|
|
1460
1463
|
return d.length > 0 ? d : void 0;
|
|
1461
|
-
}),
|
|
1462
|
-
() => !!
|
|
1464
|
+
}), T = s(() => !n.autoTopUpConfig && c.value.some(({ flexiblePricing: m }) => m) ? mt(n.topUpPricingItems) : void 0), x = $(), { chargeOnDemandPricingItems: G } = it(), de = _e(), Z = $(!1), te = s(
|
|
1465
|
+
() => !!u.value.pricing_plan_schedule_id && !!R.value && !!u.value.payment_method_id
|
|
1463
1466
|
), ce = Ae({
|
|
1464
|
-
paymentMethodId: s(() =>
|
|
1467
|
+
paymentMethodId: s(() => u.value.payment_method_id ?? null)
|
|
1465
1468
|
}), ne = xe(
|
|
1466
1469
|
{
|
|
1467
1470
|
paymentMethodId: {
|
|
@@ -1477,56 +1480,56 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1477
1480
|
},
|
|
1478
1481
|
ce
|
|
1479
1482
|
), oe = s(() => {
|
|
1480
|
-
const [d] =
|
|
1481
|
-
return
|
|
1483
|
+
const [d] = u.value.pricing_items, m = g(d == null ? void 0 : d.pricing_item_id);
|
|
1484
|
+
return m ? Co(m, d == null ? void 0 : d.flexible_amount) : void 0;
|
|
1482
1485
|
});
|
|
1483
1486
|
async function pe() {
|
|
1484
|
-
var
|
|
1487
|
+
var m, M, q;
|
|
1485
1488
|
ne.value.$touch();
|
|
1486
|
-
const d = (
|
|
1487
|
-
if (!(ne.value.$invalid || (M =
|
|
1488
|
-
|
|
1489
|
+
const d = (m = x.value) == null ? void 0 : m.validate();
|
|
1490
|
+
if (!(ne.value.$invalid || (M = x.value) != null && M.isInvalid || !te.value || Z.value)) {
|
|
1491
|
+
Z.value = !0;
|
|
1489
1492
|
try {
|
|
1490
|
-
const Y = await
|
|
1491
|
-
pricing_plan_schedule_id:
|
|
1492
|
-
pricing_items:
|
|
1493
|
-
payment_method_id:
|
|
1493
|
+
const Y = await G({
|
|
1494
|
+
pricing_plan_schedule_id: u.value.pricing_plan_schedule_id,
|
|
1495
|
+
pricing_items: R.value ?? [],
|
|
1496
|
+
payment_method_id: u.value.payment_method_id,
|
|
1494
1497
|
preview: !1
|
|
1495
1498
|
});
|
|
1496
|
-
d && ((
|
|
1499
|
+
d && ((q = x.value) != null && q.hasChanges) && u.value.payment_method_id && a("save-auto-top-up", {
|
|
1497
1500
|
rule: d,
|
|
1498
|
-
paymentMethodId:
|
|
1501
|
+
paymentMethodId: u.value.payment_method_id
|
|
1499
1502
|
}), a("success", Y);
|
|
1500
1503
|
} catch (Y) {
|
|
1501
1504
|
de.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, Y), a("failure", Y);
|
|
1502
1505
|
} finally {
|
|
1503
|
-
|
|
1506
|
+
Z.value = !1;
|
|
1504
1507
|
}
|
|
1505
1508
|
}
|
|
1506
1509
|
}
|
|
1507
|
-
t({ submit: pe, isCharging:
|
|
1510
|
+
t({ submit: pe, isCharging: Z, canSubmit: te, chargedValue: oe });
|
|
1508
1511
|
const ae = s({
|
|
1509
|
-
get: () =>
|
|
1512
|
+
get: () => u.value.payment_method_id ?? void 0,
|
|
1510
1513
|
set: (d) => {
|
|
1511
|
-
|
|
1514
|
+
u.value.payment_method_id = d;
|
|
1512
1515
|
}
|
|
1513
1516
|
}), { sortedPaymentMethods: me } = yt({
|
|
1514
1517
|
paymentMethods: s(() => n.paymentMethods),
|
|
1515
1518
|
selectedPaymentMethodId: ae
|
|
1516
1519
|
});
|
|
1517
|
-
return (d,
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1520
|
+
return (d, m) => (w(), W("form", qo, [
|
|
1521
|
+
N("div", Vo, [
|
|
1522
|
+
N("div", Fo, [
|
|
1523
|
+
D.value.length > 0 ? (w(), C(r(tt), {
|
|
1521
1524
|
key: 0,
|
|
1522
|
-
modelValue:
|
|
1523
|
-
"onUpdate:modelValue":
|
|
1525
|
+
modelValue: f.value,
|
|
1526
|
+
"onUpdate:modelValue": m[3] || (m[3] = (M) => f.value = M),
|
|
1524
1527
|
class: "sv-top-up-form__options",
|
|
1525
1528
|
name: "top-up-pricing-item",
|
|
1526
1529
|
direction: "column",
|
|
1527
1530
|
required: "",
|
|
1528
|
-
disabled:
|
|
1529
|
-
options:
|
|
1531
|
+
disabled: Z.value,
|
|
1532
|
+
options: D.value,
|
|
1530
1533
|
"show-radio": !1,
|
|
1531
1534
|
label: r(i)({
|
|
1532
1535
|
defaultMessage: "Top up amount",
|
|
@@ -1534,9 +1537,9 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1534
1537
|
id: "topup_modal.pricing_items.label"
|
|
1535
1538
|
})
|
|
1536
1539
|
}, {
|
|
1537
|
-
label:
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
+
label: _(({ option: M, optionValue: q }) => [
|
|
1541
|
+
N("span", null, I(M.label), 1),
|
|
1542
|
+
v(q) ? (w(), C(r(K), {
|
|
1540
1543
|
key: 0,
|
|
1541
1544
|
tag: "span",
|
|
1542
1545
|
variant: "body-sm",
|
|
@@ -1545,120 +1548,120 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1545
1548
|
"no-spacing": "",
|
|
1546
1549
|
class: "sv-top-up-form__option-cost"
|
|
1547
1550
|
}, {
|
|
1548
|
-
default:
|
|
1549
|
-
F(
|
|
1551
|
+
default: _(() => [
|
|
1552
|
+
F(I(v(q)), 1)
|
|
1550
1553
|
]),
|
|
1551
1554
|
_: 2
|
|
1552
|
-
}, 1024)) :
|
|
1555
|
+
}, 1024)) : k("", !0)
|
|
1553
1556
|
]),
|
|
1554
|
-
description:
|
|
1555
|
-
|
|
1556
|
-
M.description && !
|
|
1557
|
+
description: _(({ option: M, optionValue: q }) => [
|
|
1558
|
+
N("div", Lo, [
|
|
1559
|
+
M.description && !E(q) ? (w(), C(r(K), {
|
|
1557
1560
|
key: 0,
|
|
1558
1561
|
tag: "span",
|
|
1559
1562
|
variant: "body-xs",
|
|
1560
1563
|
color: "subtle",
|
|
1561
1564
|
"no-spacing": ""
|
|
1562
1565
|
}, {
|
|
1563
|
-
default:
|
|
1564
|
-
F(
|
|
1566
|
+
default: _(() => [
|
|
1567
|
+
F(I(M.description), 1)
|
|
1565
1568
|
]),
|
|
1566
1569
|
_: 2
|
|
1567
|
-
}, 1024)) :
|
|
1568
|
-
|
|
1570
|
+
}, 1024)) : k("", !0),
|
|
1571
|
+
P(q).length > 0 ? (w(), C(r(nt), {
|
|
1569
1572
|
key: 1,
|
|
1570
|
-
"is-open": String(
|
|
1573
|
+
"is-open": String(q) === f.value,
|
|
1571
1574
|
lazy: ""
|
|
1572
1575
|
}, {
|
|
1573
|
-
default:
|
|
1574
|
-
(w(!0), W(
|
|
1575
|
-
var
|
|
1576
|
+
default: _(() => [
|
|
1577
|
+
(w(!0), W(he, null, ge(P(q), (Y) => {
|
|
1578
|
+
var V;
|
|
1576
1579
|
return w(), W("div", {
|
|
1577
1580
|
key: Y.currency,
|
|
1578
1581
|
class: "sv-top-up-form__amount grid grid-cols-1 gap-3",
|
|
1579
|
-
onClick:
|
|
1582
|
+
onClick: m[1] || (m[1] = Ne(() => {
|
|
1580
1583
|
}, ["stop"])),
|
|
1581
|
-
onKeydown:
|
|
1584
|
+
onKeydown: m[2] || (m[2] = Ne(() => {
|
|
1582
1585
|
}, ["stop"]))
|
|
1583
1586
|
}, [
|
|
1584
|
-
M.description ? (w(), C(r(
|
|
1587
|
+
M.description ? (w(), C(r(K), {
|
|
1585
1588
|
key: 0,
|
|
1586
1589
|
tag: "span",
|
|
1587
1590
|
variant: "body-xs",
|
|
1588
1591
|
color: "subtle",
|
|
1589
1592
|
"no-spacing": ""
|
|
1590
1593
|
}, {
|
|
1591
|
-
default:
|
|
1592
|
-
F(
|
|
1594
|
+
default: _(() => [
|
|
1595
|
+
F(I(M.description), 1)
|
|
1593
1596
|
]),
|
|
1594
1597
|
_: 2
|
|
1595
|
-
}, 1024)) :
|
|
1596
|
-
A(
|
|
1597
|
-
modelValue:
|
|
1598
|
-
"onUpdate:modelValue":
|
|
1598
|
+
}, 1024)) : k("", !0),
|
|
1599
|
+
A(Pe, {
|
|
1600
|
+
modelValue: B.value,
|
|
1601
|
+
"onUpdate:modelValue": m[0] || (m[0] = (j) => B.value = j),
|
|
1599
1602
|
name: "top-up-amount",
|
|
1600
1603
|
"model-base": "AMOUNT",
|
|
1601
|
-
unit:
|
|
1602
|
-
"entry-base":
|
|
1604
|
+
unit: p(Y),
|
|
1605
|
+
"entry-base": J(Y),
|
|
1603
1606
|
currency: Y.currency,
|
|
1604
|
-
"conversion-rate": (
|
|
1607
|
+
"conversion-rate": (V = Y.creditsConfiguration) == null ? void 0 : V.conversionRate,
|
|
1605
1608
|
required: "",
|
|
1606
|
-
disabled:
|
|
1609
|
+
disabled: Z.value
|
|
1607
1610
|
}, null, 8, ["modelValue", "unit", "entry-base", "currency", "conversion-rate", "disabled"])
|
|
1608
1611
|
], 32);
|
|
1609
1612
|
}), 128))
|
|
1610
1613
|
]),
|
|
1611
1614
|
_: 2
|
|
1612
|
-
}, 1032, ["is-open"])) :
|
|
1615
|
+
}, 1032, ["is-open"])) : k("", !0)
|
|
1613
1616
|
])
|
|
1614
1617
|
]),
|
|
1615
1618
|
_: 1
|
|
1616
|
-
}, 8, ["modelValue", "disabled", "options", "label"])) :
|
|
1619
|
+
}, 8, ["modelValue", "disabled", "options", "label"])) : k("", !0)
|
|
1617
1620
|
]),
|
|
1618
|
-
|
|
1619
|
-
A(
|
|
1620
|
-
"pricing-plan-schedule-id":
|
|
1621
|
-
"pricing-items":
|
|
1621
|
+
N("div", null, [
|
|
1622
|
+
A(vt, {
|
|
1623
|
+
"pricing-plan-schedule-id": b.value,
|
|
1624
|
+
"pricing-items": R.value
|
|
1622
1625
|
}, null, 8, ["pricing-plan-schedule-id", "pricing-items"])
|
|
1623
1626
|
]),
|
|
1624
|
-
|
|
1627
|
+
T.value ? (w(), W("div", Yo, [
|
|
1625
1628
|
A(_t, le({
|
|
1626
1629
|
ref_key: "autoTopUpFormRef",
|
|
1627
|
-
ref:
|
|
1630
|
+
ref: x,
|
|
1628
1631
|
class: "sv-top-up-form__auto-top-up"
|
|
1629
|
-
},
|
|
1632
|
+
}, T.value, {
|
|
1630
1633
|
contained: "",
|
|
1631
1634
|
"show-threshold-conversion": !1,
|
|
1632
|
-
disabled:
|
|
1635
|
+
disabled: Z.value
|
|
1633
1636
|
}), null, 16, ["disabled"])
|
|
1634
|
-
])) :
|
|
1635
|
-
|
|
1636
|
-
A(r(
|
|
1637
|
+
])) : k("", !0),
|
|
1638
|
+
N("div", null, [
|
|
1639
|
+
A(r(Yt), { spacing: "xs" })
|
|
1637
1640
|
]),
|
|
1638
|
-
|
|
1641
|
+
N("div", null, [
|
|
1639
1642
|
se(d.$slots, "payment-method", {}, () => [
|
|
1640
1643
|
A(st, {
|
|
1641
1644
|
modelValue: ae.value,
|
|
1642
|
-
"onUpdate:modelValue":
|
|
1645
|
+
"onUpdate:modelValue": m[4] || (m[4] = (M) => ae.value = M),
|
|
1643
1646
|
class: "sv-top-up-form__payment-methods",
|
|
1644
1647
|
"payment-methods": r(me),
|
|
1645
1648
|
required: "",
|
|
1646
1649
|
error: r(ne).paymentMethodId.$errors,
|
|
1647
1650
|
"payment-method-options": e.paymentMethodOptions,
|
|
1648
|
-
disabled:
|
|
1651
|
+
disabled: Z.value,
|
|
1649
1652
|
label: r(i)({
|
|
1650
1653
|
defaultMessage: "Payment method",
|
|
1651
1654
|
description: "Label above the payment method that pays for the top-up, in the top-up modal",
|
|
1652
1655
|
id: "topup_modal.payment_method_selector.label"
|
|
1653
1656
|
}),
|
|
1654
|
-
onAddPaymentMethod:
|
|
1657
|
+
onAddPaymentMethod: m[5] || (m[5] = (M) => a("add-payment-method"))
|
|
1655
1658
|
}, null, 8, ["modelValue", "payment-methods", "error", "payment-method-options", "disabled", "label"])
|
|
1656
1659
|
])
|
|
1657
1660
|
])
|
|
1658
1661
|
])
|
|
1659
1662
|
]));
|
|
1660
1663
|
}
|
|
1661
|
-
}),
|
|
1664
|
+
}), Wo = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, jo = /* @__PURE__ */ z({
|
|
1662
1665
|
__name: "TopUpModalSuccess",
|
|
1663
1666
|
props: {
|
|
1664
1667
|
addedValue: { type: Object },
|
|
@@ -1666,20 +1669,20 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1666
1669
|
},
|
|
1667
1670
|
setup(e) {
|
|
1668
1671
|
const { $t: t } = Q();
|
|
1669
|
-
return (o, n) => (w(), W("div",
|
|
1670
|
-
e.invoice ? (w(), C(r(
|
|
1672
|
+
return (o, n) => (w(), W("div", Wo, [
|
|
1673
|
+
e.invoice ? (w(), C(r(ve), {
|
|
1671
1674
|
key: 0,
|
|
1672
1675
|
"content-background": "none"
|
|
1673
1676
|
}, {
|
|
1674
|
-
default:
|
|
1675
|
-
A(r(
|
|
1677
|
+
default: _(() => [
|
|
1678
|
+
A(r(K), {
|
|
1676
1679
|
tag: "span",
|
|
1677
1680
|
variant: "body-sm",
|
|
1678
1681
|
weight: "semibold",
|
|
1679
1682
|
class: "mb-2 block"
|
|
1680
1683
|
}, {
|
|
1681
|
-
default:
|
|
1682
|
-
F(
|
|
1684
|
+
default: _(() => [
|
|
1685
|
+
F(I(r(t)({
|
|
1683
1686
|
defaultMessage: "Receipt",
|
|
1684
1687
|
description: "Heading above the invoice a completed top-up produced",
|
|
1685
1688
|
id: "topup_modal.success.receipt.heading"
|
|
@@ -1693,11 +1696,11 @@ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1693
1696
|
}, null, 8, ["invoice"])
|
|
1694
1697
|
]),
|
|
1695
1698
|
_: 1
|
|
1696
|
-
})) :
|
|
1699
|
+
})) : k("", !0)
|
|
1697
1700
|
]));
|
|
1698
1701
|
}
|
|
1699
1702
|
});
|
|
1700
|
-
function
|
|
1703
|
+
function zo({
|
|
1701
1704
|
step: e,
|
|
1702
1705
|
currentBalance: t,
|
|
1703
1706
|
topUpValue: o
|
|
@@ -1714,7 +1717,7 @@ function jo({
|
|
|
1714
1717
|
defaultMessage: "Top up balance",
|
|
1715
1718
|
description: "Title of the wallet top-up modal",
|
|
1716
1719
|
id: "topup_modal.title"
|
|
1717
|
-
})),
|
|
1720
|
+
})), l = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1718
1721
|
defaultMessage: "Add a new payment method for topping up your balance.",
|
|
1719
1722
|
description: "Subtitle of the top-up modal while the customer is adding a payment method",
|
|
1720
1723
|
id: "topup_modal.add_payment_method.subtitle"
|
|
@@ -1729,7 +1732,7 @@ function jo({
|
|
|
1729
1732
|
id: "topup_modal.subtitle"
|
|
1730
1733
|
},
|
|
1731
1734
|
{ balance: t.value }
|
|
1732
|
-
)),
|
|
1735
|
+
)), u = s(
|
|
1733
1736
|
() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1734
1737
|
defaultMessage: "Back",
|
|
1735
1738
|
description: "Label of the button that leaves the add payment method step in the top-up modal",
|
|
@@ -1739,7 +1742,7 @@ function jo({
|
|
|
1739
1742
|
description: "Label of the button that closes the top-up modal",
|
|
1740
1743
|
id: "topup_modal.cancel_button.label"
|
|
1741
1744
|
})
|
|
1742
|
-
),
|
|
1745
|
+
), c = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1743
1746
|
defaultMessage: "Save payment method",
|
|
1744
1747
|
description: "Label of the confirm button in the top-up modal while adding a payment method",
|
|
1745
1748
|
id: "topup_modal.save_payment_method.label"
|
|
@@ -1759,100 +1762,110 @@ function jo({
|
|
|
1759
1762
|
description: "Label of the confirm button in the top-up modal while no amount is entered",
|
|
1760
1763
|
id: "topup_modal.confirm_button.empty.label"
|
|
1761
1764
|
}));
|
|
1762
|
-
return { title: i, subTitle:
|
|
1765
|
+
return { title: i, subTitle: l, cancelButtonText: u, confirmButtonText: c };
|
|
1763
1766
|
}
|
|
1764
1767
|
function bt({
|
|
1765
1768
|
isOpen: e,
|
|
1766
|
-
customer: t
|
|
1769
|
+
customer: t,
|
|
1770
|
+
subscriptionId: o,
|
|
1771
|
+
onError: n
|
|
1767
1772
|
}) {
|
|
1768
|
-
const { paymentMethodOptions:
|
|
1769
|
-
|
|
1770
|
-
(
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1773
|
+
const { paymentMethodOptions: a, get: i, isPending: l } = Kt(), u = async () => {
|
|
1774
|
+
const g = t.value;
|
|
1775
|
+
if (!(!e.value || !g))
|
|
1776
|
+
try {
|
|
1777
|
+
await i({
|
|
1778
|
+
customerId: g.id,
|
|
1779
|
+
...o != null && o.value ? { subscriptionId: o.value } : {},
|
|
1780
|
+
country: Gt(g)
|
|
1781
|
+
});
|
|
1782
|
+
} catch (b) {
|
|
1783
|
+
n == null || n(b);
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
X(
|
|
1787
|
+
() => [e.value, t.value, o == null ? void 0 : o.value],
|
|
1788
|
+
() => void u(),
|
|
1777
1789
|
{ immediate: !0 }
|
|
1778
1790
|
);
|
|
1779
|
-
const
|
|
1780
|
-
() =>
|
|
1791
|
+
const c = s(
|
|
1792
|
+
() => l.value ? void 0 : a.value
|
|
1781
1793
|
);
|
|
1782
|
-
return { paymentMethodOptions:
|
|
1794
|
+
return { paymentMethodOptions: a, settledOptions: c, isPending: l, load: u };
|
|
1783
1795
|
}
|
|
1784
|
-
function
|
|
1785
|
-
const t =
|
|
1796
|
+
function Qo(e) {
|
|
1797
|
+
const t = $(0), o = (a) => {
|
|
1786
1798
|
t.value = (a == null ? void 0 : a.offsetHeight) ?? 0;
|
|
1787
1799
|
}, n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
|
|
1788
|
-
var
|
|
1789
|
-
const i = (
|
|
1800
|
+
var l;
|
|
1801
|
+
const i = (l = a[0]) == null ? void 0 : l.target;
|
|
1790
1802
|
o(i instanceof HTMLElement ? i : void 0);
|
|
1791
1803
|
});
|
|
1792
|
-
return
|
|
1804
|
+
return X(
|
|
1793
1805
|
e,
|
|
1794
1806
|
(a, i) => {
|
|
1795
1807
|
i && (n == null || n.unobserve(i)), o(a), a && (n == null || n.observe(a));
|
|
1796
1808
|
},
|
|
1797
1809
|
// `post` so the callback runs after the render that assigns the template ref, not before.
|
|
1798
1810
|
{ immediate: !0, flush: "post" }
|
|
1799
|
-
),
|
|
1811
|
+
), Se(() => {
|
|
1800
1812
|
n == null || n.disconnect();
|
|
1801
1813
|
}), t;
|
|
1802
1814
|
}
|
|
1803
|
-
const
|
|
1815
|
+
const Go = ["inert"], Ko = 300, Xo = "1rem", Jo = /* @__PURE__ */ z({
|
|
1804
1816
|
__name: "SlidingPanes",
|
|
1805
1817
|
props: {
|
|
1806
1818
|
panes: { type: Array },
|
|
1807
1819
|
current: { type: String }
|
|
1808
1820
|
},
|
|
1809
1821
|
setup(e) {
|
|
1810
|
-
const t = e, o =
|
|
1822
|
+
const t = e, o = $(!1);
|
|
1811
1823
|
let n;
|
|
1812
|
-
|
|
1824
|
+
X(
|
|
1813
1825
|
() => t.current,
|
|
1814
1826
|
() => {
|
|
1815
1827
|
o.value = !0, clearTimeout(n), n = setTimeout(() => {
|
|
1816
1828
|
o.value = !1;
|
|
1817
|
-
},
|
|
1829
|
+
}, Ko);
|
|
1818
1830
|
}
|
|
1819
|
-
),
|
|
1831
|
+
), Se(() => {
|
|
1820
1832
|
clearTimeout(n);
|
|
1821
1833
|
});
|
|
1822
|
-
const a =
|
|
1823
|
-
a.value[
|
|
1824
|
-
}),
|
|
1825
|
-
const
|
|
1826
|
-
return
|
|
1834
|
+
const a = $({}), i = {}, l = (b) => i[b] ?? (i[b] = (S) => {
|
|
1835
|
+
a.value[b] = S instanceof HTMLElement ? S : void 0;
|
|
1836
|
+
}), u = s(() => a.value[t.current]), c = Qo(u), g = s(() => {
|
|
1837
|
+
const b = t.panes.indexOf(t.current);
|
|
1838
|
+
return b > 0 ? `translateX(calc(${-b} * (100% + ${Xo})))` : "translateX(0px)";
|
|
1827
1839
|
});
|
|
1828
|
-
return (
|
|
1840
|
+
return (b, S) => (w(), W("div", {
|
|
1829
1841
|
class: ze([
|
|
1830
1842
|
"sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",
|
|
1831
1843
|
o.value ? "transition-[height] duration-300 ease-in-out motion-reduce:transition-none" : ""
|
|
1832
1844
|
]),
|
|
1833
|
-
style: ke(r(
|
|
1845
|
+
style: ke(r(c) ? { height: `${r(c)}px` } : void 0)
|
|
1834
1846
|
}, [
|
|
1835
|
-
|
|
1847
|
+
N("div", {
|
|
1836
1848
|
class: "sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",
|
|
1837
|
-
style: ke({ transform:
|
|
1849
|
+
style: ke({ transform: g.value })
|
|
1838
1850
|
}, [
|
|
1839
|
-
(w(!0), W(
|
|
1840
|
-
key:
|
|
1851
|
+
(w(!0), W(he, null, ge(e.panes, (f) => (w(), W("div", {
|
|
1852
|
+
key: f,
|
|
1841
1853
|
class: "sv-sliding-panes__pane w-full shrink-0",
|
|
1842
|
-
inert:
|
|
1854
|
+
inert: f !== e.current || void 0
|
|
1843
1855
|
}, [
|
|
1844
|
-
|
|
1856
|
+
N("div", {
|
|
1845
1857
|
ref_for: !0,
|
|
1846
|
-
ref:
|
|
1858
|
+
ref: l(f)
|
|
1847
1859
|
}, [
|
|
1848
|
-
se(
|
|
1860
|
+
se(b.$slots, f)
|
|
1849
1861
|
], 512)
|
|
1850
|
-
], 8,
|
|
1862
|
+
], 8, Go))), 128))
|
|
1851
1863
|
], 4)
|
|
1852
1864
|
], 6));
|
|
1853
1865
|
}
|
|
1854
|
-
}),
|
|
1855
|
-
|
|
1866
|
+
}), wt = /* @__PURE__ */ z({
|
|
1867
|
+
inheritAttrs: !1,
|
|
1868
|
+
__name: "OnDemandPaymentModalShell",
|
|
1856
1869
|
props: {
|
|
1857
1870
|
showModal: { type: Boolean },
|
|
1858
1871
|
title: { type: String },
|
|
@@ -1870,7 +1883,7 @@ const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
|
|
|
1870
1883
|
},
|
|
1871
1884
|
emits: ["confirm", "cancel", "payment-success", "payment-failed"],
|
|
1872
1885
|
setup(e, { expose: t }) {
|
|
1873
|
-
const o = e, n =
|
|
1886
|
+
const o = e, n = $(), a = s(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
|
|
1874
1887
|
return t({
|
|
1875
1888
|
submit: () => {
|
|
1876
1889
|
var i;
|
|
@@ -1880,7 +1893,7 @@ const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
|
|
|
1880
1893
|
var i;
|
|
1881
1894
|
return !!((i = n.value) != null && i.isSaving);
|
|
1882
1895
|
})
|
|
1883
|
-
}), (i,
|
|
1896
|
+
}), (i, l) => (w(), C(r(lt), {
|
|
1884
1897
|
"no-click-away": "",
|
|
1885
1898
|
"show-modal": e.showModal,
|
|
1886
1899
|
size: "lg",
|
|
@@ -1889,43 +1902,43 @@ const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
|
|
|
1889
1902
|
"cancel-button-text": e.cancelButtonText,
|
|
1890
1903
|
"confirm-button-text": e.confirmButtonText,
|
|
1891
1904
|
"is-loading": e.isPending,
|
|
1892
|
-
onConfirm:
|
|
1893
|
-
onClose:
|
|
1905
|
+
onConfirm: l[2] || (l[2] = (u) => i.$emit("confirm")),
|
|
1906
|
+
onClose: l[3] || (l[3] = (u) => i.$emit("cancel"))
|
|
1894
1907
|
}, re({
|
|
1895
|
-
body:
|
|
1896
|
-
|
|
1897
|
-
A(
|
|
1908
|
+
body: _(() => [
|
|
1909
|
+
N("div", le({ class: "grid grid-cols-1 gap-4 pb-4" }, i.$attrs), [
|
|
1910
|
+
A(Jo, {
|
|
1898
1911
|
panes: e.panes,
|
|
1899
1912
|
current: e.step
|
|
1900
1913
|
}, re({
|
|
1901
|
-
[e.addPaymentMethodPane]:
|
|
1902
|
-
A(
|
|
1914
|
+
[e.addPaymentMethodPane]: _(() => [
|
|
1915
|
+
A(zt, {
|
|
1903
1916
|
ref_key: "paneRef",
|
|
1904
1917
|
ref: n,
|
|
1905
1918
|
customer: e.customer,
|
|
1906
1919
|
"payment-method-options": e.paymentMethodOptions,
|
|
1907
1920
|
"is-loading": e.isPaymentMethodOptionsPending,
|
|
1908
1921
|
"is-active": e.isAddingPaymentMethod,
|
|
1909
|
-
onSuccess:
|
|
1910
|
-
onFailure:
|
|
1922
|
+
onSuccess: l[0] || (l[0] = (u) => i.$emit("payment-success")),
|
|
1923
|
+
onFailure: l[1] || (l[1] = (u) => i.$emit("payment-failed", u))
|
|
1911
1924
|
}, null, 8, ["customer", "payment-method-options", "is-loading", "is-active"])
|
|
1912
1925
|
]),
|
|
1913
1926
|
_: 2
|
|
1914
1927
|
}, [
|
|
1915
|
-
|
|
1916
|
-
name:
|
|
1917
|
-
fn:
|
|
1918
|
-
se(i.$slots,
|
|
1928
|
+
ge(a.value, (u) => ({
|
|
1929
|
+
name: u,
|
|
1930
|
+
fn: _(() => [
|
|
1931
|
+
se(i.$slots, u)
|
|
1919
1932
|
])
|
|
1920
1933
|
}))
|
|
1921
1934
|
]), 1032, ["panes", "current"])
|
|
1922
|
-
])
|
|
1935
|
+
], 16)
|
|
1923
1936
|
]),
|
|
1924
1937
|
_: 2
|
|
1925
1938
|
}, [
|
|
1926
1939
|
i.$slots.footer ? {
|
|
1927
1940
|
name: "footer",
|
|
1928
|
-
fn:
|
|
1941
|
+
fn: _(() => [
|
|
1929
1942
|
se(i.$slots, "footer")
|
|
1930
1943
|
]),
|
|
1931
1944
|
key: "0"
|
|
@@ -1954,14 +1967,14 @@ const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
|
|
|
1954
1967
|
pricingItemId: o.pricingItemId,
|
|
1955
1968
|
pricingPlanScheduleId: o.pricingPlanScheduleId
|
|
1956
1969
|
} : void 0;
|
|
1957
|
-
},
|
|
1970
|
+
}, Pt = ({
|
|
1958
1971
|
rule: e,
|
|
1959
1972
|
walletBalanceItem: t,
|
|
1960
1973
|
chargeTarget: o,
|
|
1961
1974
|
paymentMethodId: n
|
|
1962
1975
|
}) => {
|
|
1963
|
-
var i,
|
|
1964
|
-
const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((
|
|
1976
|
+
var i, l;
|
|
1977
|
+
const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((l = e == null ? void 0 : e.threshold) == null ? void 0 : l.credits));
|
|
1965
1978
|
if (!(!e || !a || !(t != null && t.wallet_id) || !o || !n))
|
|
1966
1979
|
return {
|
|
1967
1980
|
wallet_id: t.wallet_id,
|
|
@@ -1973,12 +1986,12 @@ const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
|
|
|
1973
1986
|
...e.topup_amount && { topup_amount: e.topup_amount }
|
|
1974
1987
|
};
|
|
1975
1988
|
};
|
|
1976
|
-
function
|
|
1989
|
+
function St({
|
|
1977
1990
|
step: e,
|
|
1978
1991
|
name: t,
|
|
1979
1992
|
returnTo: o
|
|
1980
1993
|
}) {
|
|
1981
|
-
const n =
|
|
1994
|
+
const n = $();
|
|
1982
1995
|
return {
|
|
1983
1996
|
paneRef: n,
|
|
1984
1997
|
isActive: s(() => e.value === t),
|
|
@@ -2000,28 +2013,28 @@ function Pt({
|
|
|
2000
2013
|
}
|
|
2001
2014
|
function At() {
|
|
2002
2015
|
const e = Qe(), t = Ge(), o = "/portal/auto-top-up-configs";
|
|
2003
|
-
function n(
|
|
2016
|
+
function n(u) {
|
|
2004
2017
|
return e({
|
|
2005
2018
|
url: `${t.apiUrls.config}${o}`,
|
|
2006
|
-
query: { ...
|
|
2019
|
+
query: { ...u },
|
|
2007
2020
|
isCollection: !0
|
|
2008
2021
|
});
|
|
2009
2022
|
}
|
|
2010
|
-
function a(
|
|
2023
|
+
function a(u) {
|
|
2011
2024
|
return e({
|
|
2012
|
-
url: `${t.apiUrls.config}${o}/${
|
|
2025
|
+
url: `${t.apiUrls.config}${o}/${u}`
|
|
2013
2026
|
});
|
|
2014
2027
|
}
|
|
2015
|
-
function i(
|
|
2028
|
+
function i(u) {
|
|
2016
2029
|
return e({
|
|
2017
2030
|
url: `${t.apiUrls.config}${o}`,
|
|
2018
2031
|
options: { method: "POST" },
|
|
2019
|
-
data:
|
|
2032
|
+
data: u
|
|
2020
2033
|
});
|
|
2021
2034
|
}
|
|
2022
|
-
function u
|
|
2035
|
+
function l(u) {
|
|
2023
2036
|
return e({
|
|
2024
|
-
url: `${t.apiUrls.config}${o}/${
|
|
2037
|
+
url: `${t.apiUrls.config}${o}/${u}/deactivate`,
|
|
2025
2038
|
options: { method: "POST" }
|
|
2026
2039
|
});
|
|
2027
2040
|
}
|
|
@@ -2029,11 +2042,11 @@ function At() {
|
|
|
2029
2042
|
getAutoTopUpConfigs: n,
|
|
2030
2043
|
getAutoTopUpConfig: a,
|
|
2031
2044
|
createAutoTopUpConfig: i,
|
|
2032
|
-
deactivateAutoTopUpConfig:
|
|
2045
|
+
deactivateAutoTopUpConfig: l
|
|
2033
2046
|
};
|
|
2034
2047
|
}
|
|
2035
2048
|
function Ct() {
|
|
2036
|
-
const { createAutoTopUpConfig: e } = At(), t = _e(), o =
|
|
2049
|
+
const { createAutoTopUpConfig: e } = At(), t = _e(), o = $(!1);
|
|
2037
2050
|
return { save: async (a) => {
|
|
2038
2051
|
if (!a || o.value)
|
|
2039
2052
|
return { saved: !1 };
|
|
@@ -2066,140 +2079,140 @@ const Zo = {
|
|
|
2066
2079
|
},
|
|
2067
2080
|
emits: ["confirm", "close", "auto-top-up-saved", "payment-success", "payment-failed"],
|
|
2068
2081
|
setup(e, { emit: t }) {
|
|
2069
|
-
const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(),
|
|
2082
|
+
const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(), l = s(
|
|
2070
2083
|
() => Mt(Tt(o.selectedBalanceItem))
|
|
2071
|
-
),
|
|
2072
|
-
() =>
|
|
2073
|
-
),
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
(
|
|
2084
|
+
), u = s(() => i(o.selectedBalanceItem)), c = s(
|
|
2085
|
+
() => ho(o.selectedBalanceItem, o.subscriptions ?? [])
|
|
2086
|
+
), g = $();
|
|
2087
|
+
X(
|
|
2088
|
+
c,
|
|
2089
|
+
(O) => {
|
|
2077
2090
|
var L;
|
|
2078
|
-
|
|
2079
|
-
({ id: be }) => be ===
|
|
2080
|
-
) || (
|
|
2091
|
+
O.some(
|
|
2092
|
+
({ id: be }) => be === g.value
|
|
2093
|
+
) || (g.value = (L = O[0]) == null ? void 0 : L.id);
|
|
2081
2094
|
},
|
|
2082
2095
|
{ immediate: !0 }
|
|
2083
2096
|
);
|
|
2084
|
-
const
|
|
2085
|
-
() =>
|
|
2086
|
-
),
|
|
2097
|
+
const b = s(() => c.value.length > 1), S = s(
|
|
2098
|
+
() => c.value.map(({ id: O, name: H }) => ({ value: O, label: H }))
|
|
2099
|
+
), f = s(
|
|
2087
2100
|
() => Object.fromEntries(
|
|
2088
|
-
|
|
2089
|
-
const L = (o.subscriptions ?? []).find(({ id: be }) => be ===
|
|
2090
|
-
return L ? [[
|
|
2101
|
+
c.value.flatMap(({ id: O, enabledPricingIds: H }) => {
|
|
2102
|
+
const L = (o.subscriptions ?? []).find(({ id: be }) => be === O);
|
|
2103
|
+
return L ? [[O, { subscription: L, enabledPricingIds: H }]] : [];
|
|
2091
2104
|
})
|
|
2092
2105
|
)
|
|
2093
|
-
),
|
|
2106
|
+
), h = s(() => {
|
|
2094
2107
|
var H;
|
|
2095
2108
|
if (!o.selectedBalanceItem || !((H = o.subscriptions) != null && H.length))
|
|
2096
2109
|
return o.selectedBalanceItem;
|
|
2097
|
-
const
|
|
2098
|
-
return
|
|
2099
|
-
}),
|
|
2110
|
+
const O = c.value.find(({ id: L }) => L === g.value);
|
|
2111
|
+
return O ? go(o.selectedBalanceItem, O.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
|
|
2112
|
+
}), v = s(() => ut(h.value)), {
|
|
2100
2113
|
paymentMethodOptions: U,
|
|
2101
|
-
settledOptions:
|
|
2102
|
-
isPending:
|
|
2114
|
+
settledOptions: B,
|
|
2115
|
+
isPending: J
|
|
2103
2116
|
} = bt({
|
|
2104
2117
|
isOpen: s(() => o.showModal),
|
|
2105
2118
|
customer: s(() => o.customer)
|
|
2106
|
-
}),
|
|
2107
|
-
() => !
|
|
2108
|
-
),
|
|
2109
|
-
() =>
|
|
2110
|
-
),
|
|
2119
|
+
}), y = $("TOP_UP"), p = s(() => (o.paymentMethods ?? []).length > 0), P = s(
|
|
2120
|
+
() => !J.value && (U.value ?? []).length === 0
|
|
2121
|
+
), E = s(
|
|
2122
|
+
() => y.value === "TOP_UP" && !p.value && P.value
|
|
2123
|
+
), D = $(), R = $(), T = () => {
|
|
2111
2124
|
te(), n("payment-success");
|
|
2112
2125
|
}, {
|
|
2113
|
-
paneRef:
|
|
2114
|
-
isActive:
|
|
2126
|
+
paneRef: x,
|
|
2127
|
+
isActive: G,
|
|
2115
2128
|
isSaving: de,
|
|
2116
|
-
open:
|
|
2129
|
+
open: Z,
|
|
2117
2130
|
leave: te,
|
|
2118
2131
|
submit: ce
|
|
2119
|
-
} =
|
|
2120
|
-
var
|
|
2121
|
-
return (
|
|
2132
|
+
} = St({ step: y, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: ne } = Ct(), oe = $(), pe = s(() => {
|
|
2133
|
+
var O;
|
|
2134
|
+
return (O = oe.value) == null ? void 0 : O.chargedValue;
|
|
2122
2135
|
}), ae = s(() => {
|
|
2123
|
-
var
|
|
2124
|
-
return de.value || !!((
|
|
2125
|
-
}), { title: me, subTitle: d, cancelButtonText:
|
|
2126
|
-
step:
|
|
2127
|
-
currentBalance:
|
|
2136
|
+
var O;
|
|
2137
|
+
return de.value || !!((O = oe.value) != null && O.isCharging);
|
|
2138
|
+
}), { title: me, subTitle: d, cancelButtonText: m, confirmButtonText: M } = zo({
|
|
2139
|
+
step: y,
|
|
2140
|
+
currentBalance: u,
|
|
2128
2141
|
topUpValue: pe
|
|
2129
|
-
}),
|
|
2130
|
-
var
|
|
2131
|
-
if (
|
|
2142
|
+
}), q = () => {
|
|
2143
|
+
var O;
|
|
2144
|
+
if (G.value) {
|
|
2132
2145
|
ce();
|
|
2133
2146
|
return;
|
|
2134
2147
|
}
|
|
2135
|
-
(
|
|
2148
|
+
(O = oe.value) == null || O.submit();
|
|
2136
2149
|
}, Y = async ({
|
|
2137
|
-
rule:
|
|
2150
|
+
rule: O,
|
|
2138
2151
|
paymentMethodId: H
|
|
2139
2152
|
}) => {
|
|
2140
2153
|
const { saved: L } = await ne(
|
|
2141
|
-
|
|
2142
|
-
rule:
|
|
2154
|
+
Pt({
|
|
2155
|
+
rule: O,
|
|
2143
2156
|
walletBalanceItem: o.selectedBalanceItem,
|
|
2144
|
-
chargeTarget: Ut(void 0,
|
|
2157
|
+
chargeTarget: Ut(void 0, v.value),
|
|
2145
2158
|
paymentMethodId: H
|
|
2146
2159
|
})
|
|
2147
2160
|
);
|
|
2148
2161
|
L && n("auto-top-up-saved");
|
|
2149
|
-
},
|
|
2162
|
+
}, V = (O) => {
|
|
2150
2163
|
var H;
|
|
2151
|
-
|
|
2164
|
+
D.value = O, R.value = (H = oe.value) == null ? void 0 : H.chargedValue, y.value = "SUCCESS";
|
|
2152
2165
|
}, j = () => {
|
|
2153
2166
|
n("confirm"), n("close");
|
|
2154
|
-
},
|
|
2167
|
+
}, ee = () => {
|
|
2155
2168
|
if (!ae.value) {
|
|
2156
|
-
if (
|
|
2169
|
+
if (G.value) {
|
|
2157
2170
|
te();
|
|
2158
2171
|
return;
|
|
2159
2172
|
}
|
|
2160
|
-
if (
|
|
2173
|
+
if (y.value === "SUCCESS") {
|
|
2161
2174
|
j();
|
|
2162
2175
|
return;
|
|
2163
2176
|
}
|
|
2164
2177
|
n("close");
|
|
2165
2178
|
}
|
|
2166
|
-
}, De =
|
|
2167
|
-
return
|
|
2179
|
+
}, De = $(0);
|
|
2180
|
+
return X(
|
|
2168
2181
|
() => o.showModal,
|
|
2169
|
-
(
|
|
2170
|
-
|
|
2182
|
+
(O) => {
|
|
2183
|
+
O && (y.value = "TOP_UP", D.value = void 0, R.value = void 0, De.value += 1);
|
|
2171
2184
|
}
|
|
2172
|
-
), (
|
|
2185
|
+
), (O, H) => (w(), C(wt, {
|
|
2173
2186
|
ref_key: "addPaymentMethodRef",
|
|
2174
|
-
ref:
|
|
2187
|
+
ref: x,
|
|
2175
2188
|
"show-modal": e.showModal,
|
|
2176
2189
|
title: r(me),
|
|
2177
2190
|
"sub-title": r(d),
|
|
2178
|
-
"cancel-button-text": r(
|
|
2191
|
+
"cancel-button-text": r(m),
|
|
2179
2192
|
"confirm-button-text": r(M),
|
|
2180
2193
|
"is-pending": ae.value,
|
|
2181
|
-
panes: r(
|
|
2182
|
-
step:
|
|
2194
|
+
panes: r(vo),
|
|
2195
|
+
step: y.value,
|
|
2183
2196
|
"add-payment-method-pane": "ADD_PAYMENT_METHOD",
|
|
2184
2197
|
customer: e.customer,
|
|
2185
2198
|
"payment-method-options": r(U),
|
|
2186
|
-
"is-payment-method-options-pending": r(
|
|
2187
|
-
"is-adding-payment-method": r(
|
|
2188
|
-
onConfirm:
|
|
2189
|
-
onCancel:
|
|
2190
|
-
onPaymentSuccess:
|
|
2191
|
-
onPaymentFailed: H[1] || (H[1] = (L) =>
|
|
2199
|
+
"is-payment-method-options-pending": r(J),
|
|
2200
|
+
"is-adding-payment-method": r(G),
|
|
2201
|
+
onConfirm: q,
|
|
2202
|
+
onCancel: ee,
|
|
2203
|
+
onPaymentSuccess: T,
|
|
2204
|
+
onPaymentFailed: H[1] || (H[1] = (L) => O.$emit("payment-failed", L))
|
|
2192
2205
|
}, re({
|
|
2193
|
-
TOP_UP:
|
|
2194
|
-
|
|
2206
|
+
TOP_UP: _(() => [
|
|
2207
|
+
b.value ? (w(), W("div", Zo, [
|
|
2195
2208
|
A(r(tt), {
|
|
2196
|
-
modelValue:
|
|
2197
|
-
"onUpdate:modelValue": H[0] || (H[0] = (L) =>
|
|
2209
|
+
modelValue: g.value,
|
|
2210
|
+
"onUpdate:modelValue": H[0] || (H[0] = (L) => g.value = L),
|
|
2198
2211
|
class: "sv-topup-modal__subscription",
|
|
2199
2212
|
name: "top-up-subscription",
|
|
2200
2213
|
direction: "column",
|
|
2201
2214
|
required: "",
|
|
2202
|
-
options:
|
|
2215
|
+
options: S.value,
|
|
2203
2216
|
"show-radio": !1,
|
|
2204
2217
|
label: r(a)({
|
|
2205
2218
|
defaultMessage: "Subscription to top up",
|
|
@@ -2207,65 +2220,65 @@ const Zo = {
|
|
|
2207
2220
|
id: "topup_modal.subscriptions.label"
|
|
2208
2221
|
})
|
|
2209
2222
|
}, {
|
|
2210
|
-
prefix:
|
|
2211
|
-
|
|
2223
|
+
prefix: _(({ optionValue: L }) => [
|
|
2224
|
+
f.value[String(L)] ? (w(), C(Qt, {
|
|
2212
2225
|
key: 0,
|
|
2213
2226
|
class: "sv-topup-modal__subscription-option grow",
|
|
2214
2227
|
"no-spacing": "",
|
|
2215
|
-
subscription:
|
|
2216
|
-
"enabled-pricing-ids":
|
|
2217
|
-
}, null, 8, ["subscription", "enabled-pricing-ids"])) :
|
|
2228
|
+
subscription: f.value[String(L)].subscription,
|
|
2229
|
+
"enabled-pricing-ids": f.value[String(L)].enabledPricingIds
|
|
2230
|
+
}, null, 8, ["subscription", "enabled-pricing-ids"])) : k("", !0)
|
|
2218
2231
|
]),
|
|
2219
|
-
label:
|
|
2220
|
-
|
|
2232
|
+
label: _(({ option: L }) => [
|
|
2233
|
+
N("span", en, I(L.label), 1)
|
|
2221
2234
|
]),
|
|
2222
2235
|
_: 1
|
|
2223
2236
|
}, 8, ["modelValue", "options", "label"])
|
|
2224
|
-
])) :
|
|
2225
|
-
(w(), C(
|
|
2237
|
+
])) : k("", !0),
|
|
2238
|
+
(w(), C(Ho, {
|
|
2226
2239
|
key: De.value,
|
|
2227
2240
|
ref_key: "topUpFormRef",
|
|
2228
2241
|
ref: oe,
|
|
2229
|
-
"top-up-pricing-items":
|
|
2242
|
+
"top-up-pricing-items": v.value,
|
|
2230
2243
|
"payment-methods": e.paymentMethods,
|
|
2231
|
-
"auto-top-up-config":
|
|
2232
|
-
"payment-method-options": r(
|
|
2233
|
-
onAddPaymentMethod: r(
|
|
2234
|
-
onSuccess:
|
|
2244
|
+
"auto-top-up-config": l.value,
|
|
2245
|
+
"payment-method-options": r(B),
|
|
2246
|
+
onAddPaymentMethod: r(Z),
|
|
2247
|
+
onSuccess: V,
|
|
2235
2248
|
onSaveAutoTopUp: Y
|
|
2236
2249
|
}, null, 8, ["top-up-pricing-items", "payment-methods", "auto-top-up-config", "payment-method-options", "onAddPaymentMethod"]))
|
|
2237
2250
|
]),
|
|
2238
|
-
SUCCESS:
|
|
2239
|
-
|
|
2251
|
+
SUCCESS: _(() => [
|
|
2252
|
+
D.value ? (w(), C(jo, {
|
|
2240
2253
|
key: 0,
|
|
2241
|
-
"added-value":
|
|
2242
|
-
invoice:
|
|
2243
|
-
}, null, 8, ["added-value", "invoice"])) :
|
|
2254
|
+
"added-value": R.value,
|
|
2255
|
+
invoice: D.value
|
|
2256
|
+
}, null, 8, ["added-value", "invoice"])) : k("", !0)
|
|
2244
2257
|
]),
|
|
2245
2258
|
_: 2
|
|
2246
2259
|
}, [
|
|
2247
|
-
|
|
2260
|
+
y.value === "SUCCESS" || E.value ? {
|
|
2248
2261
|
name: "footer",
|
|
2249
|
-
fn:
|
|
2250
|
-
|
|
2251
|
-
|
|
2262
|
+
fn: _(() => [
|
|
2263
|
+
N("div", tn, [
|
|
2264
|
+
y.value === "SUCCESS" ? (w(), C(r(ue), {
|
|
2252
2265
|
key: 0,
|
|
2253
2266
|
size: "lg",
|
|
2254
2267
|
"data-testid": "done",
|
|
2255
2268
|
onClick: j
|
|
2256
2269
|
}, {
|
|
2257
|
-
default:
|
|
2258
|
-
F(
|
|
2270
|
+
default: _(() => [
|
|
2271
|
+
F(I(r(M)), 1)
|
|
2259
2272
|
]),
|
|
2260
2273
|
_: 1
|
|
2261
|
-
})) : (w(), W(
|
|
2274
|
+
})) : (w(), W(he, { key: 1 }, [
|
|
2262
2275
|
A(r(ue), {
|
|
2263
2276
|
size: "lg",
|
|
2264
2277
|
disabled: "",
|
|
2265
2278
|
"data-testid": "confirm"
|
|
2266
2279
|
}, {
|
|
2267
|
-
default:
|
|
2268
|
-
F(
|
|
2280
|
+
default: _(() => [
|
|
2281
|
+
F(I(r(M)), 1)
|
|
2269
2282
|
]),
|
|
2270
2283
|
_: 1
|
|
2271
2284
|
}),
|
|
@@ -2273,10 +2286,10 @@ const Zo = {
|
|
|
2273
2286
|
size: "lg",
|
|
2274
2287
|
intent: "subtle",
|
|
2275
2288
|
"data-testid": "cancel",
|
|
2276
|
-
onClick:
|
|
2289
|
+
onClick: ee
|
|
2277
2290
|
}, {
|
|
2278
|
-
default:
|
|
2279
|
-
F(
|
|
2291
|
+
default: _(() => [
|
|
2292
|
+
F(I(r(m)), 1)
|
|
2280
2293
|
]),
|
|
2281
2294
|
_: 1
|
|
2282
2295
|
})
|
|
@@ -2298,38 +2311,38 @@ const Zo = {
|
|
|
2298
2311
|
},
|
|
2299
2312
|
emits: ["saved", "close", "payment-success", "payment-failed"],
|
|
2300
2313
|
setup(e, { emit: t }) {
|
|
2301
|
-
const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(),
|
|
2302
|
-
() => Ut(o.topUpItem,
|
|
2303
|
-
),
|
|
2304
|
-
var j,
|
|
2305
|
-
const
|
|
2306
|
-
return
|
|
2314
|
+
const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(), l = $("AUTO_TOP_UP"), u = s(() => i(o.walletBalanceItem)), c = s(() => ut(o.walletBalanceItem)), g = s(() => mt(c.value)), b = s(() => Tt(o.walletBalanceItem)), S = s(() => Mt(b.value)), f = s(
|
|
2315
|
+
() => Ut(o.topUpItem, c.value)
|
|
2316
|
+
), h = $(), v = s(() => {
|
|
2317
|
+
var j, ee;
|
|
2318
|
+
const V = (ee = (j = h.value) == null ? void 0 : j.rule) == null ? void 0 : ee.topup_amount;
|
|
2319
|
+
return V != null && V.quantity && f.value ? [{ pricing_item_id: f.value.pricingItemId, flexible_amount: V }] : void 0;
|
|
2307
2320
|
}), U = s(() => {
|
|
2308
|
-
var
|
|
2309
|
-
return (
|
|
2310
|
-
}),
|
|
2321
|
+
var V;
|
|
2322
|
+
return (V = f.value) == null ? void 0 : V.pricingPlanScheduleId;
|
|
2323
|
+
}), B = $(), { sortedPaymentMethods: J } = yt({
|
|
2311
2324
|
paymentMethods: s(() => o.paymentMethods),
|
|
2312
|
-
selectedPaymentMethodId:
|
|
2325
|
+
selectedPaymentMethodId: B,
|
|
2313
2326
|
preferredPaymentMethodId: s(() => {
|
|
2314
|
-
var
|
|
2315
|
-
return (
|
|
2327
|
+
var V;
|
|
2328
|
+
return (V = b.value) == null ? void 0 : V.payment_method_id;
|
|
2316
2329
|
})
|
|
2317
2330
|
}), {
|
|
2318
|
-
paymentMethodOptions:
|
|
2319
|
-
settledOptions:
|
|
2320
|
-
isPending:
|
|
2331
|
+
paymentMethodOptions: y,
|
|
2332
|
+
settledOptions: p,
|
|
2333
|
+
isPending: P
|
|
2321
2334
|
} = bt({
|
|
2322
2335
|
isOpen: s(() => o.showModal),
|
|
2323
2336
|
customer: s(() => o.customer)
|
|
2324
2337
|
}), {
|
|
2325
|
-
paneRef:
|
|
2326
|
-
isActive:
|
|
2327
|
-
isSaving:
|
|
2328
|
-
open:
|
|
2329
|
-
leave:
|
|
2330
|
-
submit:
|
|
2331
|
-
} =
|
|
2332
|
-
paymentMethodId: s(() =>
|
|
2338
|
+
paneRef: E,
|
|
2339
|
+
isActive: D,
|
|
2340
|
+
isSaving: R,
|
|
2341
|
+
open: T,
|
|
2342
|
+
leave: x,
|
|
2343
|
+
submit: G
|
|
2344
|
+
} = St({ step: l, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: de, isSaving: Z } = Ct(), te = s(() => R.value || Z.value), ce = Ae({
|
|
2345
|
+
paymentMethodId: s(() => B.value ?? null)
|
|
2333
2346
|
}), ne = xe(
|
|
2334
2347
|
{
|
|
2335
2348
|
paymentMethodId: {
|
|
@@ -2345,7 +2358,7 @@ const Zo = {
|
|
|
2345
2358
|
},
|
|
2346
2359
|
ce
|
|
2347
2360
|
), oe = s(
|
|
2348
|
-
() =>
|
|
2361
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2349
2362
|
defaultMessage: "Add payment method",
|
|
2350
2363
|
description: "Title of the auto top-up modal while the customer is adding a payment method",
|
|
2351
2364
|
id: "auto_topup_modal.add_payment_method.title"
|
|
@@ -2355,7 +2368,7 @@ const Zo = {
|
|
|
2355
2368
|
id: "auto_topup_modal.title"
|
|
2356
2369
|
})
|
|
2357
2370
|
), pe = s(
|
|
2358
|
-
() =>
|
|
2371
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2359
2372
|
defaultMessage: "This method pays for every automatic top-up.",
|
|
2360
2373
|
description: "Subtitle of the auto top-up modal while the customer is adding a payment method",
|
|
2361
2374
|
id: "auto_topup_modal.add_payment_method.subtitle"
|
|
@@ -2365,10 +2378,10 @@ const Zo = {
|
|
|
2365
2378
|
description: "Subtitle of the automatic wallet top-up modal, naming the balance",
|
|
2366
2379
|
id: "auto_topup_modal.subtitle"
|
|
2367
2380
|
},
|
|
2368
|
-
{ balance:
|
|
2381
|
+
{ balance: u.value }
|
|
2369
2382
|
)
|
|
2370
2383
|
), ae = s(
|
|
2371
|
-
() =>
|
|
2384
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2372
2385
|
defaultMessage: "Back",
|
|
2373
2386
|
description: "Button returning from adding a payment method to the auto top-up rule",
|
|
2374
2387
|
id: "auto_topup_modal.add_payment_method.cancel"
|
|
@@ -2378,7 +2391,7 @@ const Zo = {
|
|
|
2378
2391
|
id: "auto_topup_modal.cancel"
|
|
2379
2392
|
})
|
|
2380
2393
|
), me = s(
|
|
2381
|
-
() =>
|
|
2394
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2382
2395
|
defaultMessage: "Add payment method",
|
|
2383
2396
|
description: "Button storing the payment method being added in the auto top-up modal",
|
|
2384
2397
|
id: "auto_topup_modal.add_payment_method.confirm"
|
|
@@ -2389,48 +2402,48 @@ const Zo = {
|
|
|
2389
2402
|
})
|
|
2390
2403
|
);
|
|
2391
2404
|
async function d() {
|
|
2392
|
-
var
|
|
2405
|
+
var ee;
|
|
2393
2406
|
if (ne.value.$touch(), te.value)
|
|
2394
2407
|
return;
|
|
2395
|
-
const { saved:
|
|
2396
|
-
|
|
2397
|
-
rule: (
|
|
2408
|
+
const { saved: V, error: j } = await de(
|
|
2409
|
+
Pt({
|
|
2410
|
+
rule: (ee = h.value) == null ? void 0 : ee.validate(),
|
|
2398
2411
|
walletBalanceItem: o.walletBalanceItem,
|
|
2399
|
-
chargeTarget:
|
|
2400
|
-
paymentMethodId:
|
|
2412
|
+
chargeTarget: f.value,
|
|
2413
|
+
paymentMethodId: B.value
|
|
2401
2414
|
})
|
|
2402
2415
|
);
|
|
2403
|
-
if (
|
|
2416
|
+
if (V) {
|
|
2404
2417
|
n("saved"), n("close");
|
|
2405
2418
|
return;
|
|
2406
2419
|
}
|
|
2407
2420
|
j && n("payment-failed", j);
|
|
2408
2421
|
}
|
|
2409
|
-
const
|
|
2410
|
-
if (
|
|
2411
|
-
|
|
2422
|
+
const m = () => {
|
|
2423
|
+
if (D.value) {
|
|
2424
|
+
G();
|
|
2412
2425
|
return;
|
|
2413
2426
|
}
|
|
2414
2427
|
d();
|
|
2415
2428
|
}, M = () => {
|
|
2416
|
-
|
|
2417
|
-
},
|
|
2429
|
+
x(), n("payment-success");
|
|
2430
|
+
}, q = () => {
|
|
2418
2431
|
if (!te.value) {
|
|
2419
|
-
if (
|
|
2420
|
-
|
|
2432
|
+
if (D.value) {
|
|
2433
|
+
x();
|
|
2421
2434
|
return;
|
|
2422
2435
|
}
|
|
2423
2436
|
n("close");
|
|
2424
2437
|
}
|
|
2425
|
-
}, Y =
|
|
2426
|
-
return
|
|
2438
|
+
}, Y = $(0);
|
|
2439
|
+
return X(
|
|
2427
2440
|
() => o.showModal,
|
|
2428
|
-
(
|
|
2429
|
-
|
|
2441
|
+
(V) => {
|
|
2442
|
+
V && (l.value = "AUTO_TOP_UP", B.value = void 0, Y.value += 1);
|
|
2430
2443
|
}
|
|
2431
|
-
), (
|
|
2444
|
+
), (V, j) => (w(), C(wt, {
|
|
2432
2445
|
ref_key: "addPaymentMethodRef",
|
|
2433
|
-
ref:
|
|
2446
|
+
ref: E,
|
|
2434
2447
|
"show-modal": e.showModal,
|
|
2435
2448
|
title: oe.value,
|
|
2436
2449
|
"sub-title": pe.value,
|
|
@@ -2438,39 +2451,39 @@ const Zo = {
|
|
|
2438
2451
|
"confirm-button-text": me.value,
|
|
2439
2452
|
"is-pending": te.value,
|
|
2440
2453
|
panes: r(nn),
|
|
2441
|
-
step:
|
|
2454
|
+
step: l.value,
|
|
2442
2455
|
"add-payment-method-pane": "ADD_PAYMENT_METHOD",
|
|
2443
2456
|
customer: e.customer,
|
|
2444
|
-
"payment-method-options": r(
|
|
2445
|
-
"is-payment-method-options-pending": r(
|
|
2446
|
-
"is-adding-payment-method": r(
|
|
2447
|
-
onConfirm:
|
|
2448
|
-
onCancel:
|
|
2457
|
+
"payment-method-options": r(y),
|
|
2458
|
+
"is-payment-method-options-pending": r(P),
|
|
2459
|
+
"is-adding-payment-method": r(D),
|
|
2460
|
+
onConfirm: m,
|
|
2461
|
+
onCancel: q,
|
|
2449
2462
|
onPaymentSuccess: M,
|
|
2450
|
-
onPaymentFailed: j[1] || (j[1] = (
|
|
2463
|
+
onPaymentFailed: j[1] || (j[1] = (ee) => V.$emit("payment-failed", ee))
|
|
2451
2464
|
}, {
|
|
2452
|
-
AUTO_TOP_UP:
|
|
2453
|
-
|
|
2454
|
-
|
|
2465
|
+
AUTO_TOP_UP: _(() => [
|
|
2466
|
+
N("div", an, [
|
|
2467
|
+
g.value ? (w(), C(_t, le({
|
|
2455
2468
|
key: Y.value,
|
|
2456
2469
|
ref_key: "autoTopUpFormRef",
|
|
2457
|
-
ref:
|
|
2470
|
+
ref: h,
|
|
2458
2471
|
class: "sv-auto-topup-modal__rule"
|
|
2459
|
-
},
|
|
2460
|
-
config:
|
|
2472
|
+
}, g.value, {
|
|
2473
|
+
config: S.value,
|
|
2461
2474
|
"always-enabled": "",
|
|
2462
2475
|
disabled: te.value
|
|
2463
|
-
}), null, 16, ["config", "disabled"])) :
|
|
2464
|
-
A(
|
|
2476
|
+
}), null, 16, ["config", "disabled"])) : k("", !0),
|
|
2477
|
+
A(vt, {
|
|
2465
2478
|
"pricing-plan-schedule-id": U.value,
|
|
2466
|
-
"pricing-items":
|
|
2479
|
+
"pricing-items": v.value
|
|
2467
2480
|
}, null, 8, ["pricing-plan-schedule-id", "pricing-items"]),
|
|
2468
2481
|
A(st, {
|
|
2469
|
-
modelValue:
|
|
2470
|
-
"onUpdate:modelValue": j[0] || (j[0] = (
|
|
2482
|
+
modelValue: B.value,
|
|
2483
|
+
"onUpdate:modelValue": j[0] || (j[0] = (ee) => B.value = ee),
|
|
2471
2484
|
class: "sv-auto-topup-modal__payment-method",
|
|
2472
|
-
"payment-methods": r(
|
|
2473
|
-
"payment-method-options": r(
|
|
2485
|
+
"payment-methods": r(J),
|
|
2486
|
+
"payment-method-options": r(p),
|
|
2474
2487
|
disabled: te.value,
|
|
2475
2488
|
error: r(ne).paymentMethodId.$errors,
|
|
2476
2489
|
label: r(a)({
|
|
@@ -2478,7 +2491,7 @@ const Zo = {
|
|
|
2478
2491
|
description: "Label above the payment method an automatic top-up is charged to",
|
|
2479
2492
|
id: "auto_topup_modal.payment_method.label"
|
|
2480
2493
|
}),
|
|
2481
|
-
onAddPaymentMethod: r(
|
|
2494
|
+
onAddPaymentMethod: r(T)
|
|
2482
2495
|
}, null, 8, ["modelValue", "payment-methods", "payment-method-options", "disabled", "error", "label", "onAddPaymentMethod"])
|
|
2483
2496
|
])
|
|
2484
2497
|
]),
|
|
@@ -2493,62 +2506,62 @@ const Zo = {
|
|
|
2493
2506
|
},
|
|
2494
2507
|
emits: ["confirmed", "close"],
|
|
2495
2508
|
setup(e, { emit: t }) {
|
|
2496
|
-
const o = e, n = t, { $t: a } = Q(), i = _e(), { formatValue:
|
|
2497
|
-
|
|
2509
|
+
const o = e, n = t, { $t: a } = Q(), i = _e(), { formatValue: l } = ye(), { deactivateAutoTopUpConfig: u } = At(), c = $(!1), g = $(!1);
|
|
2510
|
+
X(
|
|
2498
2511
|
() => o.showModal,
|
|
2499
|
-
(
|
|
2500
|
-
|
|
2512
|
+
(h) => {
|
|
2513
|
+
h && (g.value = !1);
|
|
2501
2514
|
}
|
|
2502
2515
|
);
|
|
2503
|
-
const
|
|
2504
|
-
var U,
|
|
2505
|
-
const
|
|
2506
|
-
return !(
|
|
2516
|
+
const b = s(() => {
|
|
2517
|
+
var U, B;
|
|
2518
|
+
const h = (U = o.config) == null ? void 0 : U.threshold, v = (B = o.config) == null ? void 0 : B.topup_amount;
|
|
2519
|
+
return !(h != null && h.amount) && !(h != null && h.credits) ? a({
|
|
2507
2520
|
defaultMessage: "Your balance will no longer be topped up automatically. You can still top up whenever you want to.",
|
|
2508
2521
|
description: "Explanation in the modal that turns a wallet automatic top-up off",
|
|
2509
2522
|
id: "auto_topup_cancellation_modal.explanation"
|
|
2510
|
-
}) :
|
|
2523
|
+
}) : v ? a(
|
|
2511
2524
|
{
|
|
2512
2525
|
defaultMessage: "Your balance will no longer be topped up with {amount} when it falls below {threshold}. You can still top up whenever you want to.",
|
|
2513
2526
|
description: "Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",
|
|
2514
2527
|
id: "auto_topup_cancellation_modal.explanation_with_amount"
|
|
2515
2528
|
},
|
|
2516
|
-
{ amount:
|
|
2529
|
+
{ amount: l({ amount: v }), threshold: l(h) }
|
|
2517
2530
|
) : a(
|
|
2518
2531
|
{
|
|
2519
2532
|
defaultMessage: "Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",
|
|
2520
2533
|
description: "Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",
|
|
2521
2534
|
id: "auto_topup_cancellation_modal.explanation_with_threshold"
|
|
2522
2535
|
},
|
|
2523
|
-
{ threshold:
|
|
2536
|
+
{ threshold: l(h) }
|
|
2524
2537
|
);
|
|
2525
|
-
}),
|
|
2526
|
-
var
|
|
2527
|
-
const
|
|
2528
|
-
if (!(!
|
|
2529
|
-
|
|
2538
|
+
}), S = async () => {
|
|
2539
|
+
var v;
|
|
2540
|
+
const h = (v = o.config) == null ? void 0 : v.id;
|
|
2541
|
+
if (!(!h || c.value)) {
|
|
2542
|
+
c.value = !0, g.value = !1;
|
|
2530
2543
|
try {
|
|
2531
|
-
await
|
|
2544
|
+
await u(h), n("confirmed"), n("close");
|
|
2532
2545
|
} catch (U) {
|
|
2533
2546
|
i.error(
|
|
2534
2547
|
"AUTO_TOP_UP_CANCELLATION_FAILED",
|
|
2535
2548
|
"Failed to turn off a wallet's automatic top-up",
|
|
2536
2549
|
{},
|
|
2537
2550
|
U
|
|
2538
|
-
),
|
|
2551
|
+
), g.value = !0;
|
|
2539
2552
|
} finally {
|
|
2540
|
-
|
|
2553
|
+
c.value = !1;
|
|
2541
2554
|
}
|
|
2542
2555
|
}
|
|
2543
|
-
},
|
|
2544
|
-
|
|
2556
|
+
}, f = () => {
|
|
2557
|
+
c.value || n("close");
|
|
2545
2558
|
};
|
|
2546
|
-
return (
|
|
2559
|
+
return (h, v) => (w(), C(r(lt), {
|
|
2547
2560
|
size: "sm",
|
|
2548
2561
|
"show-modal": e.showModal,
|
|
2549
|
-
"is-loading":
|
|
2550
|
-
"no-click-away":
|
|
2551
|
-
"no-backdrop-close":
|
|
2562
|
+
"is-loading": c.value,
|
|
2563
|
+
"no-click-away": c.value,
|
|
2564
|
+
"no-backdrop-close": c.value,
|
|
2552
2565
|
title: r(a)({
|
|
2553
2566
|
defaultMessage: "Turn off automatic top-up",
|
|
2554
2567
|
description: "Title of the modal that turns a wallet automatic top-up off",
|
|
@@ -2564,23 +2577,23 @@ const Zo = {
|
|
|
2564
2577
|
description: "Button dismissing the modal that turns a wallet automatic top-up off",
|
|
2565
2578
|
id: "auto_topup_cancellation_modal.cancel"
|
|
2566
2579
|
}),
|
|
2567
|
-
onConfirm:
|
|
2568
|
-
onClose:
|
|
2580
|
+
onConfirm: S,
|
|
2581
|
+
onClose: f
|
|
2569
2582
|
}, {
|
|
2570
|
-
body:
|
|
2571
|
-
|
|
2572
|
-
A(r(
|
|
2583
|
+
body: _(() => [
|
|
2584
|
+
N("div", ln, [
|
|
2585
|
+
A(r(K), {
|
|
2573
2586
|
variant: "body-sm",
|
|
2574
2587
|
color: "subtle",
|
|
2575
2588
|
tag: "p",
|
|
2576
2589
|
class: "sv-auto-topup-cancellation-modal__explanation"
|
|
2577
2590
|
}, {
|
|
2578
|
-
default:
|
|
2579
|
-
F(
|
|
2591
|
+
default: _(() => [
|
|
2592
|
+
F(I(b.value), 1)
|
|
2580
2593
|
]),
|
|
2581
2594
|
_: 1
|
|
2582
2595
|
}),
|
|
2583
|
-
|
|
2596
|
+
g.value ? (w(), C(r(Ke), {
|
|
2584
2597
|
key: 0,
|
|
2585
2598
|
class: "sv-auto-topup-cancellation-modal__error sv-error",
|
|
2586
2599
|
title: r(a)({
|
|
@@ -2588,7 +2601,7 @@ const Zo = {
|
|
|
2588
2601
|
description: "Error shown when turning a wallet automatic top-up off failed",
|
|
2589
2602
|
id: "auto_topup_cancellation_modal.failed"
|
|
2590
2603
|
})
|
|
2591
|
-
}, null, 8, ["title"])) :
|
|
2604
|
+
}, null, 8, ["title"])) : k("", !0)
|
|
2592
2605
|
])
|
|
2593
2606
|
]),
|
|
2594
2607
|
_: 1
|
|
@@ -2608,26 +2621,26 @@ const Zo = {
|
|
|
2608
2621
|
},
|
|
2609
2622
|
emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "payment-failed"],
|
|
2610
2623
|
setup(e, { emit: t }) {
|
|
2611
|
-
const o = e, n = t, { $t: a } = Q(), i =
|
|
2624
|
+
const o = e, n = t, { $t: a } = Q(), i = $(), l = s(
|
|
2612
2625
|
() => Re(o.walletBalances, i.value)
|
|
2613
|
-
),
|
|
2614
|
-
() => Re(o.walletBalances,
|
|
2615
|
-
),
|
|
2616
|
-
return (
|
|
2626
|
+
), u = s(() => !!l.value), c = $(), g = s(() => !!c.value), b = s(
|
|
2627
|
+
() => Re(o.walletBalances, c.value)
|
|
2628
|
+
), S = $(), f = s(() => !!S.value);
|
|
2629
|
+
return (h, v) => (w(), W(he, null, [
|
|
2617
2630
|
e.isLoading ? (w(), C(et, le({
|
|
2618
2631
|
key: 0,
|
|
2619
2632
|
variant: "section"
|
|
2620
|
-
},
|
|
2633
|
+
}, h.$attrs, {
|
|
2621
2634
|
class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48",
|
|
2622
2635
|
"data-testid": "customer-wallet-balances-skeleton"
|
|
2623
|
-
}), null, 16)) : e.hasError ? (w(), C(r(Ke), le({ key: 1 },
|
|
2636
|
+
}), null, 16)) : e.hasError ? (w(), C(r(Ke), le({ key: 1 }, h.$attrs, {
|
|
2624
2637
|
class: "sv-wallet-balances sv-root sv-component sv-error",
|
|
2625
2638
|
title: r(a)({
|
|
2626
2639
|
defaultMessage: "Could not load wallet balances",
|
|
2627
2640
|
description: "Error shown when wallet balances fail to load",
|
|
2628
2641
|
id: "wallet_balance.load_failed"
|
|
2629
2642
|
})
|
|
2630
|
-
}), null, 16, ["title"])) : e.walletBalances.length > 0 ? (w(), C(r(
|
|
2643
|
+
}), null, 16, ["title"])) : e.walletBalances.length > 0 ? (w(), C(r(po), le({ key: 2 }, h.$attrs, {
|
|
2631
2644
|
class: "sv-wallet-balances sv-root sv-component",
|
|
2632
2645
|
"customer-wallet-balances": e.walletBalances,
|
|
2633
2646
|
"show-auto-top-up": "",
|
|
@@ -2640,45 +2653,49 @@ const Zo = {
|
|
|
2640
2653
|
},
|
|
2641
2654
|
{ count: String(e.walletBalances.length) }
|
|
2642
2655
|
),
|
|
2643
|
-
onTopUp:
|
|
2644
|
-
onAutoTopUp:
|
|
2645
|
-
onCancelAutoTopUp:
|
|
2646
|
-
}), null, 16, ["customer-wallet-balances", "title"])) :
|
|
2656
|
+
onTopUp: v[0] || (v[0] = (U) => i.value = U),
|
|
2657
|
+
onAutoTopUp: v[1] || (v[1] = (U) => c.value = U),
|
|
2658
|
+
onCancelAutoTopUp: v[2] || (v[2] = (U) => S.value = U)
|
|
2659
|
+
}), null, 16, ["customer-wallet-balances", "title"])) : k("", !0),
|
|
2647
2660
|
e.showTopUpButton ? (w(), C(on, {
|
|
2648
2661
|
key: 3,
|
|
2649
|
-
"show-modal":
|
|
2650
|
-
"selected-balance-item":
|
|
2662
|
+
"show-modal": u.value,
|
|
2663
|
+
"selected-balance-item": l.value,
|
|
2651
2664
|
"payment-methods": e.paymentMethods,
|
|
2652
2665
|
customer: e.customer,
|
|
2653
2666
|
subscriptions: e.subscriptions,
|
|
2654
|
-
onClose:
|
|
2655
|
-
onConfirm:
|
|
2656
|
-
onPaymentSuccess:
|
|
2657
|
-
onPaymentFailed:
|
|
2658
|
-
}, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) :
|
|
2667
|
+
onClose: v[3] || (v[3] = (U) => i.value = void 0),
|
|
2668
|
+
onConfirm: v[4] || (v[4] = (U) => n("top-up-charged")),
|
|
2669
|
+
onPaymentSuccess: v[5] || (v[5] = (U) => n("payment-method-stored")),
|
|
2670
|
+
onPaymentFailed: v[6] || (v[6] = (U) => n("payment-failed", U))
|
|
2671
|
+
}, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : k("", !0),
|
|
2659
2672
|
e.showTopUpButton ? (w(), C(sn, {
|
|
2660
2673
|
key: 4,
|
|
2661
|
-
"show-modal":
|
|
2662
|
-
"wallet-balance-item":
|
|
2663
|
-
"top-up-item":
|
|
2674
|
+
"show-modal": g.value,
|
|
2675
|
+
"wallet-balance-item": b.value,
|
|
2676
|
+
"top-up-item": c.value,
|
|
2664
2677
|
"payment-methods": e.paymentMethods,
|
|
2665
2678
|
customer: e.customer,
|
|
2666
|
-
onClose:
|
|
2667
|
-
onSaved:
|
|
2668
|
-
onPaymentSuccess:
|
|
2669
|
-
onPaymentFailed:
|
|
2670
|
-
}, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) :
|
|
2679
|
+
onClose: v[7] || (v[7] = (U) => c.value = void 0),
|
|
2680
|
+
onSaved: v[8] || (v[8] = (U) => n("auto-top-up-saved")),
|
|
2681
|
+
onPaymentSuccess: v[9] || (v[9] = (U) => n("payment-method-stored")),
|
|
2682
|
+
onPaymentFailed: v[10] || (v[10] = (U) => n("payment-failed", U))
|
|
2683
|
+
}, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) : k("", !0),
|
|
2671
2684
|
e.showTopUpButton ? (w(), C(un, {
|
|
2672
2685
|
key: 5,
|
|
2673
|
-
"show-modal":
|
|
2674
|
-
config:
|
|
2675
|
-
onClose:
|
|
2676
|
-
onConfirmed:
|
|
2677
|
-
}, null, 8, ["show-modal", "config"])) :
|
|
2686
|
+
"show-modal": f.value,
|
|
2687
|
+
config: S.value,
|
|
2688
|
+
onClose: v[11] || (v[11] = (U) => S.value = void 0),
|
|
2689
|
+
onConfirmed: v[12] || (v[12] = (U) => n("auto-top-up-cancelled"))
|
|
2690
|
+
}, null, 8, ["show-modal", "config"])) : k("", !0)
|
|
2678
2691
|
], 64));
|
|
2679
2692
|
}
|
|
2680
2693
|
});
|
|
2681
2694
|
export {
|
|
2682
2695
|
kn as _,
|
|
2696
|
+
St as a,
|
|
2697
|
+
bt as b,
|
|
2698
|
+
$o as c,
|
|
2699
|
+
wt as d,
|
|
2683
2700
|
Nn as u
|
|
2684
2701
|
};
|