@solvimon/solvimon-web 0.1.0-alpha.26 → 0.1.0-alpha.28
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 +138 -27
- package/dist/ApiStatus-CSFKl_ra.mjs +9 -0
- package/dist/{Avatar.vue.es-BqQHvLGA.mjs → Avatar.vue.es-Beg7umjO.mjs} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BFza7Nf9.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DBGe1PvD.mjs} +17 -19
- package/dist/{Button.vue.es-C32_baQN.mjs → Button.vue.es-rh6mITmN.mjs} +1 -1
- package/dist/{ChargeOnDemandModal-CIiI74ls.mjs → ChargeOnDemandModal-CPjPa_uq.mjs} +233 -253
- package/dist/Checkbox.vue.es-DsyiJ-VY.mjs +50 -0
- package/dist/Checkout.entry.ce-BZ1rYQvt.mjs +5279 -0
- package/dist/{Chip.vue.es-CKCOY5T6.mjs → Chip.vue.es-Cn2R_0mE.mjs} +34 -20
- package/dist/Comparators.vue.es-DQBI3f7m.mjs +103 -0
- package/dist/{ContextMenu.vue.es-Da-lAmTl.mjs → ContextMenu.vue.es-DRxsa7bZ.mjs} +4 -4
- package/dist/{CustomerBillingInformation.vue.es-BxBQt4Q0.mjs → CustomerBillingInformation.vue.es-DQfL5RMR.mjs} +2 -2
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BcTZgshS.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Ct-eYaEN.mjs} +31 -36
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BzTSwo4i.mjs +2921 -0
- package/dist/{DividerText.vue.es-DKl3FnDJ.mjs → DividerText.vue.es-M0XqSz55.mjs} +1 -1
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-Bk4zwyWa.mjs +362 -0
- package/dist/{ErrorNotification.vue.es-rRKgmkzV.mjs → ErrorNotification.vue.es-CKlt4hr2.mjs} +1 -1
- package/dist/{IconButton.vue.es-UlqwNPAX.mjs → IconButton.vue.es-oe4MVBK1.mjs} +2 -2
- package/dist/{IconTitle.vue.es-CK9k69tV.mjs → IconTitle.vue.es-BO6KBS4v.mjs} +3 -3
- package/dist/Input.vue.es-DAlPmtE_.mjs +249 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DUfJl07Y.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CCTl5GWa.mjs} +14 -13
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-DMGqj_Uk.mjs +56 -0
- package/dist/{InvoiceSummary.vue.es-DQ4KvTaw.mjs → InvoiceSummary.vue.es-DbNoGfYN.mjs} +9 -9
- package/dist/{Modal.vue.es-B9xMiyn3.mjs → Modal.vue.es-CTNACAst.mjs} +5 -5
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-BVzL2PGe.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-DLfAfB_m.mjs} +73 -75
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-nLTPnH4j.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CKm-XYuF.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-DYa99P1M.mjs → PaymentHistoryBlock-BmA8jbMb.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D0KnSy0y.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BDMse2lO.mjs} +24 -24
- package/dist/{PaymentIntegrationForm-UWoyZgsR.mjs → PaymentIntegrationForm-D1Xw-xIt.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CCxw0PCv.mjs +182 -0
- package/dist/{PaymentIntegrationFormAdyen-D4qfNtZ_.mjs → PaymentIntegrationFormAdyen-CfT5aD4L.mjs} +395 -297
- package/dist/PaymentIntegrationFormStripe-DKXJ-mjd.mjs +743 -0
- package/dist/{PaymentMethod.vue.es-CKu5nApX.mjs → PaymentMethod.vue.es-Cauxx4Xr.mjs} +3 -3
- package/dist/{PaymentMethodForm-B05sHWcW.mjs → PaymentMethodForm-CypZOYUZ.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-D1yIYsb_.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-De8FgdYD.mjs} +65 -75
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Dw28tfpD.mjs +168 -0
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DGpXRtp4.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-OtjVO7lR.mjs} +13 -8
- package/dist/PlanCustomizationEditor-Xtww2r9K.mjs +711 -0
- package/dist/PortalNotAvailable-B_59GUwN.mjs +25 -0
- package/dist/{PricingGroupRangeInput.vue.es-CJpvUP3-.mjs → PricingGroupRangeInput.vue.es-C9LJW3b8.mjs} +5 -5
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DJ81eUJX.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DdWxoB8q.mjs} +30 -30
- package/dist/{RadioGroupExtended.vue.es-BalV7gwp.mjs → RadioGroupExtended.vue.es-UtKsdmiv.mjs} +2 -2
- package/dist/{Section.vue.es-D7eiXUbk.mjs → Section.vue.es-iS8hVGWA.mjs} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DudMRVka.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Djc1SkEU.mjs} +13 -12
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs +32 -0
- package/dist/{StepInput.vue.es-C3Zm6Wc9.mjs → StepInput.vue.es-Dpan1RQd.mjs} +5 -4
- package/dist/{SubscriptionDetails.entry.ce-WEimiOex.mjs → SubscriptionDetails.entry.ce-DufQX3uI.mjs} +451 -468
- package/dist/{SubscriptionSchedules-DrrEAPlx.mjs → SubscriptionSchedules-DAahcNoI.mjs} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DHp_KtbF.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DNr1CqVj.mjs} +750 -763
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-Wmjqy7RZ.mjs +203 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DFU0IULg.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BeRLuEyR.mjs} +124 -90
- package/dist/{TooltipParagraph.vue.es-BXbOJmjr.mjs → TooltipParagraph.vue.es-BjCn2BF6.mjs} +1 -1
- package/dist/{TrialChip.vue.es-C_yRujip.mjs → TrialChip.vue.es-B-XBSHWE.mjs} +2 -2
- package/dist/addressFormats.data-dzBx49dw.mjs +278 -0
- package/dist/amount-CondixVt.mjs +36 -0
- package/dist/{cn.es-CGa6b2Lt.mjs → cn.es-2bVdkiFV.mjs} +87 -83
- package/dist/{comparators.es-D8WGL-c4.mjs → comparators.es-C8rHpb70.mjs} +17 -13
- package/dist/components/BillingInformation/BillingInformation.mjs +7 -8
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +394 -350
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +16 -17
- package/dist/components/Invoice/Invoice.mjs +206 -209
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +64 -63
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +40 -41
- package/dist/components/InvoicesList/InvoicesList.mjs +14 -14
- package/dist/components/PaymentHistory/PaymentHistory.mjs +70 -65
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +31 -31
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +47 -45
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +50 -36
- package/dist/components/WalletBalances/WalletBalances.mjs +9 -10
- package/dist/core/index.mjs +61 -95
- package/dist/customElements-Di3zwlEU.mjs +6447 -0
- package/dist/customer-CqddTiOr.mjs +31 -0
- package/dist/{de-DE-jkW2dJrX.mjs → de-DE-BNMj3boy.mjs} +16 -10
- package/dist/{de-DE-CLfzTbbX.mjs → de-DE-BW8dMvhW.mjs} +87 -19
- package/dist/formControl-CsITfsBk.mjs +749 -0
- package/dist/index.mjs +2 -2
- package/dist/invoiceState-BJVHaKs7.mjs +14 -0
- package/dist/{invoices-DJTwftJv.mjs → invoices-Cf1qDAv4.mjs} +40 -35
- package/dist/{it-IT-Cym1UvvK.mjs → it-IT-Byg06KWc.mjs} +87 -19
- package/dist/{it-IT-CaaFToGB.mjs → it-IT-DRvuxM1F.mjs} +9 -3
- package/dist/{nl-NL-D0MQKaql.mjs → nl-NL-DLUwWbMG.mjs} +12 -6
- package/dist/{nl-NL-D0c4x5C0.mjs → nl-NL-x3zQqzZ7.mjs} +93 -25
- package/dist/paymentMethods-BUuOmDq9.mjs +77 -0
- package/dist/paymentOutcome-D17VD4MV.mjs +67 -0
- package/dist/payments-Ci8bF4C6.mjs +45 -0
- package/dist/pricingItemConfigs.es-D3pX_9AJ.mjs +78 -0
- package/dist/pricingPlanScheduleOverrides-COr9F8DO.mjs +233 -0
- package/dist/pricingPlanSchedules-BK_o9p6h.mjs +38 -0
- package/dist/sanitization.es-C6dbuxUJ.mjs +4 -0
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +98 -91
- package/dist/screens/PayInvoice/PayInvoice.mjs +181 -210
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +98 -86
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +363 -334
- package/dist/sessionReference-B8Dbmx5t.mjs +38 -0
- package/dist/sorting.es-qtEN8J8T.mjs +77 -0
- package/dist/subscription-BhxoqwcT.mjs +83 -0
- package/dist/subscriptions-CwogJODR.mjs +54 -0
- package/dist/types/components/InvoiceTable/InvoiceTable.types.d.ts +2 -0
- package/dist/types/components/checkout/CheckoutTitle.types.d.ts +10 -0
- package/dist/types/components/checkout/PromotionCodeSection.types.d.ts +2 -0
- package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +20 -0
- package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +15 -0
- package/dist/types/components/customer/CustomerPaymentMethodsBlock/CustomerPaymentMethodsBlock.types.d.ts +0 -2
- package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethod.types.d.ts +9 -5
- package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethodApplePay.types.d.ts +3 -1
- package/dist/types/components/payments/ExpressPaymentMethods/ExpressPaymentMethods.types.d.ts +5 -1
- package/dist/types/components/payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts +0 -1
- package/dist/types/components/payments/PaymentCompletedCard/PaymentCompletedCard.types.d.ts +0 -2
- package/dist/types/components/payments/PaymentErrorCard/PaymentErrorCard.types.d.ts +9 -2
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +36 -4
- package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +7 -0
- package/dist/types/components/payments/PaymentMethodSelector/PaymentMethodSelector.types.d.ts +0 -4
- package/dist/types/components/providers/AuthProvider/AuthProvider.lib.d.ts +9 -4
- package/dist/types/components/providers/AuthProvider/composables/useAuth.d.ts +1 -3
- package/dist/types/components/providers/ConfigProvider/ConfigProvider.lib.d.ts +2 -4
- package/dist/types/components/providers/CssOverridesProvider/CssOverridesProvider.lib.d.ts +11 -0
- package/dist/types/components/providers/EntryProvider/EntryProvider.lib.d.ts +7 -0
- package/dist/types/components/providers/EntryProvider/EntryProvider.types.d.ts +2 -0
- package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +3 -1
- package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +5 -1
- package/dist/types/components/providers/ExperimentalFeatureProvider/ExperimentalFeatureProvider.lib.d.ts +2 -2
- package/dist/types/components/providers/HostElementProvider/HostElementProvider.lib.d.ts +6 -1
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.vue.d.ts +5 -1
- package/dist/types/components/providers/PortalProvider/PortalProvider.lib.d.ts +10 -7
- package/dist/types/components/providers/PortalProvider/PortalProvider.types.d.ts +1 -1
- package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +3 -1
- package/dist/types/components/providers/PortalProvider/composables/usePortal.d.ts +2 -2
- package/dist/types/components/providers/Provider/Provider.types.d.ts +1 -1
- package/dist/types/components/providers/Provider/Provider.vue.d.ts +11 -4
- package/dist/types/components/providers/RequiredPropertiesGuard/RequiredPropertiesGuard.vue.d.ts +17 -0
- package/dist/types/components/providers/TranslationProvider/TranslationProvider.lib.d.ts +7 -2
- package/dist/types/components/providers/TranslationProvider/TranslationProvider.types.d.ts +1 -1
- package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +1 -2
- package/dist/types/components/subscriptions/EnabledPricingsList/EnabledPricingsListItem.types.d.ts +2 -0
- package/dist/types/components/subscriptions/OrderSummary.types.d.ts +1 -10
- package/dist/types/components/subscriptions/SubscriptionCancellationModal/SubscriptionCancellationModal.types.d.ts +5 -1
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +8 -16
- package/dist/types/components/subscriptions/SubscriptionSummary.types.d.ts +1 -14
- package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsList.types.d.ts +4 -1
- package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsListItem.types.d.ts +1 -2
- package/dist/types/components/wallets/AutoTopUpConfig/AutoTopUpConfig.types.d.ts +0 -3
- package/dist/types/components/wallets/TopUpModal/TopUpModalForm.types.d.ts +3 -1
- package/dist/types/components/wallets/TopUpModal/TopUpModalSuccess.types.d.ts +1 -7
- package/dist/types/public/components/BillingInformation/BillingInformation.entry.ce.d.ts +1 -1
- package/dist/types/public/components/BillingInformation/BillingInformation.types.d.ts +0 -3
- package/dist/types/public/components/BillingInformationForm/BillingInformationForm.entry.ce.d.ts +1 -1
- package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.entry.ce.d.ts +1 -1
- package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.types.d.ts +0 -1
- package/dist/types/public/components/Invoice/Invoice.entry.ce.d.ts +1 -1
- package/dist/types/public/components/Invoice/Invoice.types.d.ts +0 -1
- package/dist/types/public/components/InvoiceDetails/InvoiceDetails.entry.ce.d.ts +1 -1
- package/dist/types/public/components/InvoiceDetails/InvoiceDetails.entry.types.d.ts +3 -2
- package/dist/types/public/components/InvoiceDetails/InvoiceDetails.types.d.ts +0 -2
- package/dist/types/public/components/InvoiceHeader/InvoiceHeader.entry.ce.d.ts +1 -1
- package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +0 -1
- package/dist/types/public/components/InvoicesList/InvoicesList.entry.ce.d.ts +1 -1
- package/dist/types/public/components/InvoicesList/InvoicesList.types.d.ts +2 -0
- package/dist/types/public/components/PaymentHistory/PaymentHistory.entry.ce.d.ts +1 -1
- package/dist/types/public/components/PaymentHistory/PaymentHistory.entry.types.d.ts +3 -2
- package/dist/types/public/components/PaymentHistory/PaymentHistory.types.d.ts +0 -2
- package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.entry.ce.d.ts +1 -1
- package/dist/types/public/components/SubscriptionSchedules/SubscriptionSchedules.entry.ce.d.ts +1 -1
- package/dist/types/public/components/SubscriptionSchedules/SubscriptionSchedules.entry.types.d.ts +3 -2
- package/dist/types/public/components/SubscriptionSchedules/SubscriptionSchedules.types.d.ts +0 -2
- package/dist/types/public/components/SubscriptionsList/SubscriptionsList.entry.ce.d.ts +1 -1
- package/dist/types/public/components/SubscriptionsList/SubscriptionsList.types.d.ts +3 -0
- package/dist/types/public/components/WalletBalances/WalletBalances.entry.ce.d.ts +1 -1
- package/dist/types/public/components/WalletBalances/WalletBalances.entry.types.d.ts +1 -3
- package/dist/types/public/core/action-request.types.d.ts +5 -0
- package/dist/types/public/core/registry.ce.d.ts +3 -3
- package/dist/types/public/core/registry.d.ts +0 -3
- package/dist/types/public/screens/Checkout/Checkout.entry.ce.d.ts +1 -1
- package/dist/types/public/screens/Checkout/Checkout.entry.types.d.ts +0 -7
- package/dist/types/public/screens/Checkout/Checkout.types.d.ts +2 -2
- package/dist/types/public/screens/CustomerOverview/CustomerOverview.entry.ce.d.ts +1 -1
- package/dist/types/public/screens/PayInvoice/PayInvoice.entry.ce.d.ts +1 -1
- package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +2 -0
- package/dist/types/public/screens/PaymentMethodsManagement/PaymentMethodsManagement.entry.ce.d.ts +1 -1
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.entry.ce.d.ts +1 -1
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +1 -2
- package/dist/types/public/screens/SubscriptionManagement/SubscriptionManagement.entry.ce.d.ts +1 -1
- package/dist/types/services/paymentMethods.types.d.ts +2 -10
- package/dist/types/services/requests.types.d.ts +16 -6
- package/dist/types/types/errors.d.ts +3 -2
- package/dist/types/vendor/@adyen/adyen-web/index.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Payment.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/utils.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-ui/components/providers/BrandProvider/BrandProvider.types.d.ts +16 -0
- package/dist/types/vendor/@solvimon/solvimon-ui/components/providers/IntlProvider/IntlProvider.types.d.ts +66 -0
- package/dist/types/vendor/@solvimon/solvimon-ui/index.d.ts +2 -0
- package/dist/useActionDispatchProvider-DC_fUykI.mjs +9 -0
- package/dist/{useCustomer-XZKWsolE.mjs → useCustomer-C3kTh7wn.mjs} +2 -2
- package/dist/useCustomerFormLabels-CK7K50nB.mjs +1369 -0
- package/dist/useIncrementalLoading-C_sHmW7d.mjs +60 -0
- package/dist/useInvoiceData-BIh8-h8b.mjs +21 -0
- package/dist/useInvoicesList-Y6p0Pqpy.mjs +674 -0
- package/dist/{useLoadInitialData-CR0kbYw8.mjs → useLoadInitialData-4k_Cyqef.mjs} +1 -1
- package/dist/usePaymentFormHold-FfNc578l.mjs +189 -0
- package/dist/{usePaymentMethodAvailability-ZH-m3B-A.mjs → usePaymentMethodAvailability-CnYTvG15.mjs} +17 -18
- package/dist/usePaymentMethodOptions-1QBcmgUf.mjs +40 -0
- package/dist/{usePaymentMethods-B-OKRyKd.mjs → usePaymentMethods-gvr-rmwE.mjs} +2 -2
- package/dist/{usePayments-CV85OV8V.mjs → usePayments-CykCZPG2.mjs} +7 -7
- package/dist/usePortal-CxzKGhbK.mjs +7 -0
- package/dist/useService-B0OQJmif.mjs +56 -0
- package/dist/{useTimePeriod.es-B22-fno3.mjs → useTimePeriod.es-JkXdHNWr.mjs} +1 -1
- package/dist/useViewport-psZejz_H.mjs +19 -0
- package/package.json +35 -59
- package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DcrLNA_x.mjs +0 -223
- package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js +0 -1
- package/dist/Alert.vue.es-RyK53a2P.js +0 -1
- package/dist/Amount.vue.es-DExaYBqm.js +0 -1
- package/dist/Avatar.vue.es-Bm6MCMAL.js +0 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-0JHnqIpC.js +0 -1
- package/dist/Button.vue.es-qGvnOKnK.js +0 -1
- package/dist/ChargeOnDemandModal-DIQaGnRs.js +0 -1
- package/dist/Checkout.entry.ce-8EcavNgT.js +0 -2
- package/dist/Checkout.entry.ce-BA5ljKj8.mjs +0 -3924
- package/dist/Chip.vue.es-D60gTbfe.js +0 -1
- package/dist/Comparators.vue.es-CwhX3rbx.mjs +0 -93
- package/dist/Comparators.vue.es-DmkxV0gb.js +0 -1
- package/dist/ContentWithAsideLayout-RSdKXqAf.js +0 -1
- package/dist/ContextMenu.vue.es-C7KI8Gz6.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-bFUx81Ig.js +0 -1
- package/dist/CustomerPaymentMethods.lib-BKgQTCtc.js +0 -1
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C0lJ_ESU.js +0 -1
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DkbQ2MiR.mjs +0 -2701
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-hBo2Y2mJ.js +0 -1
- package/dist/Divider.vue.es-UwnWvUTl.js +0 -1
- package/dist/DividerText.vue.es-BF3gnr4e.js +0 -1
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3QYra1x.mjs +0 -335
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js +0 -1
- package/dist/ErrorNotification.vue.es-BX9dHEc-.js +0 -1
- package/dist/Expand.vue.es-BtM0EZEr.js +0 -1
- package/dist/FormMessage.vue.es-dqATjC2N.js +0 -1
- package/dist/IconButton.vue.es-Bwdfu-jm.js +0 -1
- package/dist/IconTitle.vue.es-Cei98MBw.js +0 -1
- package/dist/Input.vue.es-B47l_feL.js +0 -1
- package/dist/Input.vue.es-D9IjIWc-.mjs +0 -235
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DKlPrxQS.js +0 -1
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-D9Rtgapa.mjs +0 -41
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-DlJ6lELc.js +0 -1
- package/dist/InvoiceSummary.vue.es-DBnR9Hs7.js +0 -1
- package/dist/Modal.vue.es-8LN4gBh0.js +0 -1
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-B1yGKkWN.js +0 -1
- package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DSGf6uFP.js +0 -1
- package/dist/PaymentHistoryBlock-Ds93gNvh.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CBZhXQfC.js +0 -1
- package/dist/PaymentIntegrationForm-B_Db4DG1.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C0J37ZVe.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-J15IDbMc.mjs +0 -154
- package/dist/PaymentIntegrationFormAdyen-HeA9XIj-.js +0 -98
- package/dist/PaymentIntegrationFormStripe-BIiMCWlV.mjs +0 -587
- package/dist/PaymentIntegrationFormStripe-DUCJTIAq.js +0 -102
- package/dist/PaymentMethod.vue.es-CJcSZ9lN.js +0 -1
- package/dist/PaymentMethodForm-1d0YIGOu.js +0 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-BDm8l_6N.js +0 -1
- package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-BE4S26JX.js +0 -1
- package/dist/PlanCustomizationEditor-CEMP_Dhz.js +0 -1
- package/dist/PlanCustomizationEditor-CpZeilm5.mjs +0 -694
- package/dist/PricingGroupRangeInput.vue.es-DZSJ5Mz0.js +0 -185
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-jrkraJMu.js +0 -1
- package/dist/RadioGroupExtended.vue.es-Dt6LH9Yh.js +0 -1
- package/dist/Section.vue.es-zVXBHAL6.js +0 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BdjYFrVC.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D60YtA9z.mjs +0 -51
- package/dist/StepInput.vue.es-mAnuCuDQ.js +0 -1
- package/dist/SubscriptionDetails.entry.ce-D4CsSoR9.js +0 -1
- package/dist/SubscriptionSchedules-Cm5Dt-1H.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-t2Awijf5.js +0 -1
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-3VYfm6Hm.mjs +0 -91
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Bu-_clEa.js +0 -1
- package/dist/TooltipParagraph.vue.es-Cph6zT31.js +0 -1
- package/dist/TrialChip.vue.es-C_wgHGuN.js +0 -1
- package/dist/accel.svg.es-DFJXdioD.js +0 -1
- package/dist/ach.svg.es-BYP873jU.js +0 -1
- package/dist/adyen-BJfC7N6f.js +0 -1
- package/dist/adyen-CvsH5fok.mjs +0 -117
- package/dist/adyen-Druit6gz.js +0 -1
- package/dist/adyenSdk-BP2XXzeJ.js +0 -1
- package/dist/amazon-pay.svg.es-CQWgtowB.js +0 -1
- package/dist/amex.svg.es-DKhW4Txt.js +0 -1
- package/dist/api.es-duCDtZD9.js +0 -1
- package/dist/apple-pay.svg.es-Dyojd0F-.js +0 -1
- package/dist/bacs.svg.es-GJpZs1sD.js +0 -1
- package/dist/bancontact.svg.es-BQh7nAup.js +0 -1
- package/dist/carnet.svg.es-DY04-F2L.js +0 -1
- package/dist/cartes-bancaires.svg.es-BleHMlkN.js +0 -1
- package/dist/cashapp.svg.es-MwXGYom6.js +0 -1
- package/dist/cn.es-D9YMDvG2.js +0 -1
- package/dist/comparators.es-OGt19O9U.js +0 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +0 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +0 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +0 -1
- package/dist/components/Invoice/Invoice.cjs +0 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +0 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +0 -1
- package/dist/components/InvoicesList/InvoicesList.cjs +0 -1
- package/dist/components/PaymentHistory/PaymentHistory.cjs +0 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +0 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +0 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +0 -1
- package/dist/components/WalletBalances/WalletBalances.cjs +0 -1
- package/dist/configuration-akTS7Wiw.js +0 -1
- package/dist/core/index.cjs +0 -1
- package/dist/countryData.es-C4jHBzfo.js +0 -1
- package/dist/customElements-C963-LtW.js +0 -1215
- package/dist/customElements-D5DAoHRI.mjs +0 -6633
- package/dist/customer-DKa1B2vp.mjs +0 -31
- package/dist/customer-TE1FnGT0.js +0 -1
- package/dist/customer.es-BButyYo0.js +0 -1
- package/dist/dana.svg.es-BDtZLpwd.js +0 -1
- package/dist/dankort.svg.es-CksaipXF.js +0 -1
- package/dist/de-DE-B4TUdnUf.js +0 -1
- package/dist/de-DE-DaBBl-Ak.js +0 -1
- package/dist/diners.svg.es-D6Mu1pqP.js +0 -1
- package/dist/discover.svg.es-DgqWCMUM.js +0 -1
- package/dist/eftpos.svg.es-Dk2DOT8W.js +0 -1
- package/dist/elo.svg.es-C-BzjuRP.js +0 -1
- package/dist/en-US-BNevqm0M.js +0 -1
- package/dist/en-US-D6SGRAch.mjs +0 -325
- package/dist/en-US-J85TQRI8.js +0 -1
- package/dist/en-US-SDhjlY_v.mjs +0 -301
- package/dist/eps.svg.es-B_85bP-W.js +0 -1
- package/dist/error-BHVZJGwD.mjs +0 -13
- package/dist/error-CmduqgVq.js +0 -1
- package/dist/floating-ui.vue.es-Bly3DGWm.js +0 -1
- package/dist/formControl-ODrpUvcA.js +0 -1
- package/dist/formControl-dX7l8o3c.mjs +0 -845
- package/dist/formatting.es-C72Nsrmh.js +0 -1
- package/dist/gcash.svg.es-BKAdhWzv.js +0 -1
- package/dist/getComposedString.es-haS4bAj7.js +0 -1
- package/dist/getCountryNameByCode.es-Xxc0nZsH.js +0 -1
- package/dist/girocard.svg.es-HSOEvDif.js +0 -1
- package/dist/go-pay.svg.es-DQjtunZ_.js +0 -1
- package/dist/google-pay.svg.es-hzc_EgiJ.js +0 -1
- package/dist/hipercard.svg.es-CbCsRY2q.js +0 -1
- package/dist/icon-sprite.svg.es-Ds6lDf5p.js +0 -1
- package/dist/ideal.svg.es-Booz1IML.js +0 -1
- package/dist/index-BPZPnOQQ.js +0 -7
- package/dist/index.cjs +0 -1
- package/dist/index.es-BclokHQX.js +0 -1
- package/dist/invoices-ClqTWYF9.js +0 -1
- package/dist/it-IT-BkPbTueL.js +0 -1
- package/dist/it-IT-CSYvGmpT.js +0 -1
- package/dist/jcb.svg.es-B3WPB8c2.js +0 -1
- package/dist/kakao-pay.svg.es-Cs-lCW74.js +0 -1
- package/dist/klarna.svg.es-Cs6XaHD7.js +0 -1
- package/dist/maestro.svg.es-BvK4oPg4.js +0 -1
- package/dist/mastercard.svg.es-lp4AXyyV.js +0 -1
- package/dist/momo.svg.es-C5aLYf_R.js +0 -1
- package/dist/nl-NL-CpE4IgwO.js +0 -1
- package/dist/nl-NL-jIfAVGv0.js +0 -1
- package/dist/nyce.svg.es-ArAivAZW.js +0 -1
- package/dist/object.es-CdriXMPs.js +0 -1
- package/dist/open-banking.svg.es-Q3rRkCvP.js +0 -1
- package/dist/paymentFailure-Bh60UhxA.mjs +0 -47
- package/dist/paymentFailure-Cki8c5BX.js +0 -1
- package/dist/paymentMethods-AL2U_byg.js +0 -1
- package/dist/paymentMethods-CWzJhcWK.mjs +0 -77
- package/dist/payments-BmiHMlQt.js +0 -1
- package/dist/payments-aXyfylwk.mjs +0 -45
- package/dist/paypal.svg.es-Cjp5sNI3.js +0 -1
- package/dist/pricing-BVAld27Y.js +0 -1
- package/dist/pricing-DLOeiAIB.mjs +0 -16
- package/dist/pricing.es-C07bgEZx.js +0 -1
- package/dist/pricingItemConfigs.es-D4aYkYcf.js +0 -1
- package/dist/pricingItemConfigs.es-ORxsk_YS.mjs +0 -77
- package/dist/pricingPlanSchedule-BM8vsKkV.js +0 -1
- package/dist/pricingPlanSchedules-BD4GIP_F.mjs +0 -32
- package/dist/pricingPlanSchedules-BfsMSvN0.js +0 -1
- package/dist/pulse.svg.es-Dit33E8S.js +0 -1
- package/dist/screens/Checkout/Checkout.cjs +0 -1
- package/dist/screens/CustomerOverview/CustomerOverview.cjs +0 -1
- package/dist/screens/PayInvoice/PayInvoice.cjs +0 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +0 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +0 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +0 -1
- package/dist/sepa.svg.es-0t4DKeA1.js +0 -1
- package/dist/sessionReference-3h-6FdrC.mjs +0 -43
- package/dist/sessionReference-m_6Rp4X1.js +0 -1
- package/dist/slots.es-T9ZJRGtG.js +0 -1
- package/dist/sorting.es-DCihKqD2.mjs +0 -77
- package/dist/sorting.es-DQsjKr8A.js +0 -1
- package/dist/star.svg.es-D2JncY7b.js +0 -1
- package/dist/subscription-D1yHKUNc.mjs +0 -69
- package/dist/subscription-ZA62t4E9.js +0 -1
- package/dist/subscriptions-Cm83ckfl.js +0 -1
- package/dist/subscriptions-cnR5fnf7.mjs +0 -55
- package/dist/trustly.svg.es-GJByiFAs.js +0 -1
- package/dist/twint.svg.es-BJ2f48og.js +0 -1
- package/dist/typeGuards.es-DS3vZaJn.js +0 -1
- package/dist/types/components/payments/AddPaymentMethodModal/AddPaymentMethodModal.types.d.ts +0 -14
- package/dist/types/components/payments/SubscriptionPaymentCompletedCard/SubscriptionPaymentCompletedCard.types.d.ts +0 -3
- package/dist/types/components/subscriptions/PlanCustomizationForm/AddonSingleEditor.types.d.ts +0 -5
- package/dist/types/services/portals.types.d.ts +0 -70
- package/dist/types/types/subscription.d.ts +0 -4
- package/dist/unionpay.svg.es-DjFZ5EMQ.js +0 -1
- package/dist/url-TNRgVI8A.mjs +0 -21
- package/dist/url-vloPOiXd.js +0 -1
- package/dist/useActionDispatchProvider-CHkVQMaE.js +0 -1
- package/dist/useActionDispatchProvider-DDYqIh3r.mjs +0 -11
- package/dist/useCustomer-DGYtowRy.js +0 -1
- package/dist/useCustomerFormLabels-CcnkJLcB.mjs +0 -968
- package/dist/useCustomerFormLabels-DAZziqYt.js +0 -1
- package/dist/useExperimentalFeature-COOU6IZd.js +0 -1
- package/dist/useExperimentalFeature-ierhOt9Q.mjs +0 -6
- package/dist/useIncrementalLoading-CaWOE8Xl.js +0 -1
- package/dist/useIncrementalLoading-Cgxw2GD7.mjs +0 -48
- package/dist/useInvoiceData-BEK-7msA.mjs +0 -38
- package/dist/useInvoiceData-CQRn8l9C.js +0 -1
- package/dist/useInvoicesList-BQkKyyXa.js +0 -1
- package/dist/useInvoicesList-C4I118KM.mjs +0 -500
- package/dist/useLoadInitialData-CrKnBZs_.js +0 -1
- package/dist/usePaymentMethodAvailability-Ci6LeYKt.js +0 -1
- package/dist/usePaymentMethodOptions-Ciifjo6c.mjs +0 -39
- package/dist/usePaymentMethodOptions-Cqe92ZBn.js +0 -1
- package/dist/usePaymentMethods-BKwrl82-.js +0 -1
- package/dist/usePayments-Bauj16B-.js +0 -1
- package/dist/usePortal-DSLImEfr.js +0 -1
- package/dist/usePortal-H8Tv2TnZ.mjs +0 -11
- package/dist/useService-Bh47bllz.mjs +0 -50
- package/dist/useService-H7BjLg8P.js +0 -1
- package/dist/useSubscription-BiYNJT2e.js +0 -1
- package/dist/useSubscription-DqnxWNKg.mjs +0 -210
- package/dist/useTimePeriod.es-D2aiyfd-.js +0 -1
- package/dist/useViewport-BgdA2PPt.mjs +0 -29
- package/dist/useViewport-hPRVDWCm.js +0 -1
- package/dist/useWatchDebounced-B8iX7ykx.js +0 -1
- package/dist/useWatchDebounced-BHlBPcXB.mjs +0 -20
- package/dist/visa.svg.es-NY3BHhda.js +0 -1
- package/dist/vpay.svg.es-VViQi42w.js +0 -1
- package/dist/wallets.es-CNIMW5ay.js +0 -1
- package/dist/zip.svg.es-C9S_F31W.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),Ze=require("./api.es-duCDtZD9.js"),M=require("./customElements-C963-LtW.js"),et=require("./sessionReference-m_6Rp4X1.js"),tt=require("./useService-H7BjLg8P.js"),Be=require("./ErrorNotification.vue.es-BX9dHEc-.js"),J=require("./pricingItemConfigs.es-D4aYkYcf.js"),se=require("./wallets.es-CNIMW5ay.js"),z=require("./Button.vue.es-qGvnOKnK.js"),j=require("./TooltipParagraph.vue.es-Cph6zT31.js"),Z=require("./Section.vue.es-zVXBHAL6.js"),Pe=require("./Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js"),Ue=require("./RadioGroupExtended.vue.es-Dt6LH9Yh.js"),O=require("./formControl-ODrpUvcA.js"),le=require("./formatting.es-C72Nsrmh.js"),ot=require("./Divider.vue.es-UwnWvUTl.js"),Ae=require("./Expand.vue.es-BtM0EZEr.js"),Ne=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js"),nt=require("./cn.es-D9YMDvG2.js"),ke=require("./invoices-ClqTWYF9.js"),at=require("./useWatchDebounced-B8iX7ykx.js"),it=require("./Input.vue.es-B47l_feL.js"),re=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js"),ut=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js"),st=require("./customer.es-BButyYo0.js"),lt=require("./usePaymentMethodOptions-Cqe92ZBn.js"),Ee=require("./Modal.vue.es-8LN4gBh0.js"),rt=3e4,ne=60,ae=12,ct=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ne,n=24*o,a=t,{$t:i,formatDate:u}=M.useIntl(),s=e.ref(Date.now());let l;e.onMounted(()=>{l=setInterval(()=>{s.value=Date.now()},rt)}),e.onBeforeUnmount(()=>{clearInterval(l)});const c=(f,v)=>{const m=(v.getFullYear()-f.getFullYear())*ae+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?m-1:m},h=e.computed(()=>{const f=Math.max(0,(s.value-a.date.getTime())/1e3);if(f<ne)return i({defaultMessage:"{count, plural, one {# second} other {# seconds}} ago",id:"dateTimeAgo.seconds",description:"Relative time in whole seconds"},{count:Math.trunc(f)});if(f<o)return i({defaultMessage:"{count, plural, one {# minute} other {# minutes}} ago",id:"dateTimeAgo.minutes",description:"Relative time in whole minutes"},{count:Math.trunc(f/ne)});if(f<n)return i({defaultMessage:"{count, plural, one {# hour} other {# hours}} ago",id:"dateTimeAgo.hours",description:"Relative time in whole hours"},{count:Math.trunc(f/o)});const v=c(a.date,new Date(s.value));if(v<1){const m=Math.trunc(f/n);return m===1?i({defaultMessage:"yesterday",id:"dateTimeAgo.yesterday",description:'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'}):i({defaultMessage:"{count, plural, one {# day} other {# days}} ago",id:"dateTimeAgo.days",description:"Relative time in whole days"},{count:m})}return v<ae?i({defaultMessage:"{count, plural, one {# month} other {# months}} ago",id:"dateTimeAgo.months",description:"Relative time in whole months"},{count:v}):i({defaultMessage:"{count, plural, one {# year} other {# years}} ago",id:"dateTimeAgo.years",description:"Relative time in whole years"},{count:Math.trunc(v/ae)})}),_=e.computed(()=>a.actionVerb?`${a.actionVerb} ${h.value}`:h.value),C=e.computed(()=>u({date:a.date,format:"dateTime",offsetType:"local"}));return(f,v)=>(e.openBlock(),e.createBlock(j._sfc_main,null,{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(_.value),1)]),_:1}))}}),dt=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=g=>se.formatWalletBalanceValue(o,n,g),i=e.computed(()=>{var g,d;return((d=(g=t.walletBalance.wallet)==null?void 0:g.wallet_type)==null?void 0:d.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),u=g=>{var d;return(((d=g.pricing_item)==null?void 0:d.configs)??[]).filter(T=>!!T.on_demand)},s=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(g=>u(g).some(d=>J.isFixedPricing(d)||J.isFlexiblePricing(d)))),l=e.computed(()=>s.value.find(g=>u(g).some(d=>J.isFlexiblePricing(d)))),c=e.computed(()=>!!t.showManualTopUp&&s.value.length>0),h=e.computed(()=>!!t.showAutoTopUp&&!!l.value),_=e.computed(()=>{var g,d;return(d=(g=t.walletBalance.wallet)==null?void 0:g.auto_top_up_configs)==null?void 0:d.find(T=>T.status==="ACTIVE")}),C=e.computed(()=>{var g,d;return(d=(g=t.walletBalance.wallet_balance.open_balance)==null?void 0:g.credits)==null?void 0:d.credit_type}),f=(g,d)=>a({credits:{quantity:g,credit_type_id:d,credit_type:C.value}}),v=g=>g.amount?a({amount:g.amount}):g.credits?f(g.credits.quantity,g.credits.credit_type_id):"",m=e.computed(()=>{var g,d;const T=(g=_.value)==null?void 0:g.pricing_item_id;if(!T)return;const x=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===T).flatMap(A=>u(A)).flatMap(A=>A.wallet_grants??[]),U=(d=t.walletBalance.wallet)==null?void 0:d.wallet_type_id;return x.find(A=>A.wallet_type_id===U)??x[0]}),w=e.computed(()=>{var g,d;const T=(g=_.value)==null?void 0:g.topup_amount,x=(d=m.value)==null?void 0:d.credits_grant;if(!T||!x)return"";if(x.credits)return f(x.credits.quantity,x.credits.credit_type_id);if(x.conversion){const U=Number(T.quantity)*Number(x.conversion.rate);return f(String(U),x.conversion.credit_type_id)}return""}),P=e.computed(()=>_.value?o({defaultMessage:"Auto top-up enabled",id:"wallet_balance.auto_top_up_enabled_label",description:"Label shown when a wallet tops itself up automatically"}):o({defaultMessage:"No auto top-up enabled",id:"wallet_balance.auto_top_up_disabled_label",description:"Label shown when a wallet has no automatic top-up configured"})),q=e.computed(()=>{const g=_.value;if(!g)return o({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.",id:"wallet_balance.auto_top_up_setup_explanation",description:"Tooltip explaining what automatic top-ups do, shown when none is configured yet"});const d=g.topup_amount?a({amount:g.topup_amount}):"",T=v(g.threshold);return!d||!T?o({defaultMessage:"Your balance is topped up automatically once it runs low.",id:"wallet_balance.auto_top_up_generic_explanation",description:"Tooltip shown for an active automatic top-up whose amount or threshold is unknown"}):w.value?o({defaultMessage:"Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",id:"wallet_balance.auto_top_up_credits_explanation",description:"Tooltip explaining an automatic top-up that grants credits for a paid amount"},{topUpCredits:w.value,topUpAmount:d,threshold:T}):o({defaultMessage:"Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",id:"wallet_balance.auto_top_up_explanation",description:"Tooltip explaining how the automatic top-up of a wallet balance works"},{topUpAmount:d,threshold:T})});return{walletName:i,formatBalance:a,manualTopUpItems:s,flexibleManualTopUpItem:l,showManualTopUp:c,showAutoTopUp:h,activeTopUpConfig:_,autoTopUpLabel:P,autoTopUpExplanation:q}},pt={class:"flex flex-col gap-3 py-3"},mt={class:"flex flex-col gap-1 px-4"},ft={class:"flex w-full justify-between gap-3"},vt={class:"flex w-full items-center gap-4"},ht={key:0},gt={key:1,class:"flex w-full justify-between gap-3 px-4"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"flex min-w-0 items-center gap-1"},bt={class:"shrink-0"},wt=e.defineComponent({__name:"WalletBalancesItem",props:{walletBalance:{},showAutoTopUp:{type:Boolean},showManualTopUp:{type:Boolean}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){const o=t,{$t:n}=M.useIntl(),{walletName:a,formatBalance:i,manualTopUpItems:u,flexibleManualTopUpItem:s,showManualTopUp:l,showAutoTopUp:c,activeTopUpConfig:h,autoTopUpLabel:_,autoTopUpExplanation:C}=dt(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("div",ft,[e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>{var m,w;return[(m=t.walletBalance.wallet_balance)!=null&&m.balance_at?(e.openBlock(),e.createBlock(ct,{key:0,date:new Date((w=t.walletBalance.wallet_balance)==null?void 0:w.balance_at),"action-verb":e.unref(n)({defaultMessage:"updated",id:"wallet_balance.updated_action_verb",description:"Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"})},null,8,["date","action-verb"])):e.createCommentVNode("",!0)]}),_:1})]),e.createElementVNode("div",vt,[e.createVNode(M._sfc_main,{variant:"body-lg",weight:"semibold","no-spacing":"",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(o.walletBalance.wallet_balance.open_balance)),1)]),_:1}),e.unref(l)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=m=>f.$emit("top-up",e.unref(u)[0]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Top up",id:"v1V8kA",description:"Button to top up a wallet balance"})),1)]),_:1})):e.createCommentVNode("",!0)])]),f.$slots.graph?(e.openBlock(),e.createElementBlock("div",ht,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("div",_t,[e.createVNode(j._sfc_main,{class:"min-w-0"},{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",yt,[e.createVNode(M._sfc_main,{variant:"body-sm",color:"secondary","no-spacing":"",class:"truncate"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_)),1)]),_:1}),e.createVNode(z._sfc_main$1,{icon:"info",size:"2xs",class:"shrink-0 cursor-help text-gray-400"})])]),_:1})]),e.createElementVNode("div",bt,[e.unref(h)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=m=>f.$emit("cancel-auto-top-up",e.unref(h)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Disable",id:"wallet_balance.auto_top_up_disable_button",description:"Button to turn off a wallet's automatic top-up"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:1,size:"xs",intent:"secondary",onClick:v[2]||(v[2]=m=>f.$emit("auto-top-up",e.unref(s)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Enable",id:"wallet_balance.auto_top_up_enable_button",description:"Button to set up a wallet's automatic top-up"})),1)]),_:1}))])])):e.createCommentVNode("",!0)]))}}),Tt={class:"flex flex-col gap-2"},Ct=e.defineComponent({__name:"WalletBalances",props:{customerWalletBalances:{},title:{default:void 0},showAutoTopUp:{type:Boolean,default:!1},showManualTopUp:{type:Boolean,default:!1}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(Z._sfc_main,{"no-spacing":"","no-border":"",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.customerWalletBalances,a=>(e.openBlock(),e.createBlock(Z._sfc_main,{key:a.wallet_id,"no-spacing":""},{default:e.withCtx(()=>[e.createVNode(wt,{"wallet-balance":a,"show-auto-top-up":t.showAutoTopUp,"show-manual-top-up":t.showManualTopUp,onTopUp:n[0]||(n[0]=i=>o.$emit("top-up",i)),onAutoTopUp:n[1]||(n[1]=i=>o.$emit("auto-top-up",i)),onCancelAutoTopUp:n[2]||(n[2]=i=>o.$emit("cancel-auto-top-up",i))},null,8,["wallet-balance","show-auto-top-up","show-manual-top-up"])]),_:2},1024))),128))])]),_:2},[o.$slots["heading-right"]?{name:"right",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"heading-right")]),key:"0"}:void 0]),1032,["title"]))}});function Mt(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Ze.withExpand({expandParams:et.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function St({customerId:t}){const{getCustomerWalletBalances:o}=Mt(),{data:n,execute:a,apiStatus:i,error:u,isPending:s}=tt.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:u,fetch:a,isPending:s}}const _e=(t=[],o)=>{if(o!=null&&o.pricing_item_id)return t.find(n=>(n.charge_on_demand_pricing_items??[]).some(({pricing_item_id:a})=>a===o.pricing_item_id))},xt=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,Bt=t=>[...new Set(((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>ce(o)&&o.pricing_plan_schedule_id?[o.pricing_plan_schedule_id]:[]))],Pt=(t,o)=>{const n=new Set(Bt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:u})=>n.has(u));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:u})=>u),enabledPricingIds:i.flatMap(u=>{var s;return(((s=u.pricing_plan_schedule)==null?void 0:s.enabled_pricings)??[]).flatMap(({pricing_id:l})=>l?[l]:[])})}]})},Ut=(t,o)=>{if(!t||o.length===0)return t;const n=new Set(o);return{...t,charge_on_demand_pricing_items:(t.charge_on_demand_pricing_items??[]).filter(a=>ce(a)&&!!a.pricing_plan_schedule_id&&n.has(a.pricing_plan_schedule_id))}},Ve=t=>((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>{var a,i;if(!ce(o))return[];const n=o.pricing_item_id??((a=o.pricing_item)==null?void 0:a.id);return n?(((i=o.pricing_item)==null?void 0:i.configs)??[]).map(u=>{const s=Et(u,t),l=At(u,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:u,...s&&{flexiblePricing:s},...l&&{fixedPricing:l}}}):[]});function At(t,o){var u,s,l;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(l=(s=(u=t.details)==null?void 0:u.bands)==null?void 0:s[0])==null?void 0:l.fixed_amount;if(!n)return;const a=$e(o),i=a?kt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const $e=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Oe=(t,o)=>{var a;const n=(a=o==null?void 0:o.wallet)==null?void 0:a.wallet_type_id;return(t.wallet_grants??[]).filter(({wallet_type_id:i})=>!n||i===n)},Nt=(t,o)=>{var n,a;return(a=(n=Oe(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},kt=(t,o)=>{var n,a;return(a=(n=Oe(t,o).find(({credits_grant:i})=>i==null?void 0:i.credits))==null?void 0:n.credits_grant)==null?void 0:a.credits},de=(t,o)=>({credits:{...o,quantity:t}}),De=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function Et(t,o){var c,h,_,C,f,v,m;if(!t.on_demand||!J.isFlexiblePricing(t))return;const n=(h=(c=t.details)==null?void 0:c.bands)==null?void 0:h[0],a=((_=n==null?void 0:n.minimum_amount)==null?void 0:_.currency)??((C=n==null?void 0:n.maximum_amount)==null?void 0:C.currency)??((v=(f=o==null?void 0:o.wallet_balance.balance)==null?void 0:f.amount)==null?void 0:v.currency);if(!a)return;const i=$e(o),u=i?Nt(t,o):void 0,s=(m=i==null?void 0:i.credit_type)==null?void 0:m.unit_name,l=w=>{if(!w)return;const P=i&&u?De(w.quantity,u.rate):void 0;return P!==void 0&&i?de(P,i):{amount:w}};return{config:{...(n==null?void 0:n.minimum_amount)&&{minimum_amount:n.minimum_amount},...(n==null?void 0:n.maximum_amount)&&{maximum_amount:n.maximum_amount}},currency:a,...u&&{creditsConfiguration:{conversionRate:u.rate,...(s==null?void 0:s.singular)&&{unitNameSingle:s.singular},...(s==null?void 0:s.plural)&&{unitNamePlural:s.plural}}},bounds:{...l(n==null?void 0:n.minimum_amount)&&{minimum:l(n==null?void 0:n.minimum_amount)},...l(n==null?void 0:n.maximum_amount)&&{maximum:l(n==null?void 0:n.maximum_amount)}}}}const Vt=t=>{var o,n,a,i,u;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((u=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&u.credits)},$t=t=>{var o;for(const{fixedPricing:n,flexiblePricing:a}of t){const i=(n==null?void 0:n.value.credits)??((o=(a==null?void 0:a.bounds.minimum)??(a==null?void 0:a.bounds.maximum))==null?void 0:o.credits);if(i!=null&&i.credit_type_id)return i.credit_type_id}},Ot=(t=[])=>{for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return a}},Ie=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:u}of t){const s=(i==null?void 0:i.value.credits)??((o=(u==null?void 0:u.bounds.minimum)??(u==null?void 0:u.bounds.maximum))==null?void 0:o.credits);if((a=(n=s==null?void 0:s.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return s.credit_type.unit_name.plural}},Dt=(t=[])=>{var o;for(const{flexiblePricing:n}of t){const a=(o=n==null?void 0:n.creditsConfiguration)==null?void 0:o.conversionRate;if(a)return a}},It=(t=[])=>{for(const{flexiblePricing:o}of t){const{minimum_amount:n,maximum_amount:a}=(o==null?void 0:o.config)??{};if(n||a)return{...n&&{minimum:n},...a&&{maximum:a}}}return{}},qt=(t=[])=>{if(t.some(Vt)){const o=$t(t);return o?{creditTypeId:o}:void 0}for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return{currency:a}}},Rt=(t,o)=>{var s;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(s=n.minimum??n.maximum)==null?void 0:s.credits,u=a?De(o.quantity,a.conversionRate):void 0;return i&&u!==void 0?de(u,i):{amount:o}},qe=(t=[])=>{const o=qt(t);if(o)return{denomination:o,chargeCurrency:Ot(t)??"",creditUnitName:Ie(t),conversionRate:Dt(t),topUpBounds:It(t)}},Ft=400;function Re({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=ke.createInvoicesService(),a=M.useLogger(),i=e.ref(),u=e.ref(!1),s=e.ref(!1),l=e.computed(()=>u.value||s.value),c=e.ref(!1),h=M.createLatestGuard(),_=async()=>{const C=t.value,f=h();if(s.value=!1,!C||!o.value){o.value&&!C&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the on-demand charge invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,u.value=!1,c.value=!1;return}u.value=!0,c.value=!1;try{const v=await n({pricingPlanScheduleId:C,pricingItems:o.value});f()&&(i.value=v)}catch(v){f()&&(i.value=void 0,c.value=!0),a.error("INVOICE_PREVIEW_FAILED","Failed to load the invoice preview",{preview:"ON_DEMAND_CHARGE"},v)}finally{f()&&(u.value=!1)}};return at.useWatchDebounced(o,()=>void _(),{debounce:()=>i.value||u.value||c.value?Ft:0,deep:!0}),e.watch(o,C=>{s.value=!!C,C||(h(),i.value=void 0,c.value=!1,u.value=!1)},{deep:!0,flush:"sync"}),_(),{invoicePreview:i,isPreviewPending:l,hasPreviewFailed:c,loadPreview:_}}const Lt={key:0},Fe=e.defineComponent({__name:"TopUpInvoicePreview",props:{pricingPlanScheduleId:{type:String},pricingItems:{type:Array}},setup(t){const o=t,{$t:n}=M.useIntl(),a=e.computed(()=>o.pricingPlanScheduleId),i=e.computed(()=>o.pricingItems),{invoicePreview:u}=Re({pricingPlanScheduleId:a,pricingItems:i});return(s,l)=>(e.openBlock(),e.createBlock(Pe._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(u)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(nt._sfc_main),{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"You will pay",description:"Label above the preview of what topping up will be invoiced for",id:"topup_modal.invoice_preview.label"})),1)]),_:1}),e.createVNode(e.unref(Z._sfc_main),{"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ne._sfc_main$1),{invoice:e.unref(u),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),Le=(t,o)=>t.currency??o??t.creditTypeId??"",ye=(t,o)=>({quantity:t??null,currency:o}),ie=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var u,s,l,c,h;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:ye(((s=(u=t==null?void 0:t.threshold)==null?void 0:u.amount)==null?void 0:s.quantity)??((c=(l=t==null?void 0:t.threshold)==null?void 0:l.credits)==null?void 0:c.quantity),Le(o,a)),topUpAmount:ye(((h=t==null?void 0:t.topup_amount)==null?void 0:h.quantity)??i,n)}},Yt=(t,o)=>{var a;const n=(a=t.threshold)==null?void 0:a.quantity;return n?o.creditTypeId?{credits:{quantity:n,credit_type_id:o.creditTypeId}}:{amount:{quantity:n,currency:o.currency??""}}:{}},be=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},Ye=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...be(t,n)&&{topup_amount:be(t,n)}}),we=(t,o)=>Ye(ie(t,o),o),Te=(t,o)=>JSON.stringify(t)===JSON.stringify(o),Ce=t=>{const o=Number(t==null?void 0:t.quantity);return t!=null&&t.quantity&&Number.isFinite(o)?o:void 0},Wt=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t>=n},Ht=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t<=n},ee=t=>{const o=Number(t);return t!=null&&t!==""&&Number.isFinite(o)?o:void 0},pe=(t,o,n)=>{const a=ee(t),i=ee(n);if(!(a===void 0||i===void 0||i<=0))return o==="CREDITS"?a/i:a*i},Me=(t,o,n,a)=>o===n?ee(t):pe(t,o,a),zt=(t,o,n)=>o==="CREDITS"?pe(t,"AMOUNT",n):ee(t),me=t=>t.toFixed(2),Se=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),We=(t,o,n,a)=>{const i=zt(t==null?void 0:t.quantity,o,n);if(i!==void 0)return o==="CREDITS"?a(i):me(i)},jt=["data-testid"],ue=e.defineComponent({__name:"ConvertedAmountInput",props:e.mergeModels({unit:{type:String},modelBase:{type:String},entryBase:{type:String},conversionRate:{type:String},showConversionHint:{type:Boolean},currency:{type:String},creditUnitName:{type:String},bounds:{type:Object},label:{type:String},name:{type:String},required:{type:Boolean},disabled:{type:Boolean},error:{type:[String,Object,Array]}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:a,formatNumber:i}=M.useIntl(),u=e.computed(()=>o.entryBase??o.modelBase),s=e.computed(()=>u.value!==o.modelBase&&ee(o.conversionRate)!==void 0),l=e.ref("");e.watch(()=>[n.value,u.value,o.modelBase,o.conversionRate],([d])=>{if(!s.value){l.value=d??"";return}if(d===c(l.value))return;const T=Me(d,o.modelBase,u.value,o.conversionRate);l.value=T===void 0?"":Se(T,u.value)},{immediate:!0});function c(d){const T=Me(d,u.value,o.modelBase,o.conversionRate);return T===void 0?"":Se(T,o.modelBase)}const h=e.computed({get:()=>l.value,set:d=>{l.value=O.asText(d),n.value=s.value?c(l.value):l.value}}),_=e.computed(()=>pe(l.value,u.value,o.conversionRate)),C=e.computed(()=>o.creditUnitName?o.creditUnitName:u.value==="CREDITS"?o.unit:a({defaultMessage:"credits",description:"Generic name for a wallet credit, where its credit type does not name one",id:"converted_amount_input.credits"})),f=(d,T)=>le.formatAmount({quantity:me(d),currency:T}),v=d=>`${i(d)} ${C.value}`,m=e.computed(()=>{const d=o.error;return Array.isArray(d)?d.length>0:!!(e.isRef(d)?d.value:d)}),w=e.computed(()=>{const d=_.value;if(!(m.value||!o.showConversionHint||d===void 0))return u.value==="CREDITS"?o.currency?a({defaultMessage:"Will cost {amount} excluding taxes",description:"Helper text under a credits field, naming what those credits cost in money",id:"converted_amount_input.cost"},{amount:f(d,o.currency)}):void 0:a({defaultMessage:"Buys about {credits}",description:"Helper text under a money field, naming the credits that amount converts into",id:"converted_amount_input.buys"},{credits:v(d)})}),P=d=>We(d,u.value,o.conversionRate,i),q=e.computed(()=>{var d,T,x,U;return u.value==="CREDITS"?C.value:((T=(d=o.bounds)==null?void 0:d.minimum)==null?void 0:T.currency)??((U=(x=o.bounds)==null?void 0:x.maximum)==null?void 0:U.currency)??o.unit}),g=e.computed(()=>{var U,A;const d=P((U=o.bounds)==null?void 0:U.minimum),T=P((A=o.bounds)==null?void 0:A.maximum),x=q.value;if(d&&T)return a({defaultMessage:"Between {minimum} and {maximum} {unit}",description:"Range of what a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.range"},{minimum:d,maximum:T,unit:x});if(d)return a({defaultMessage:"At least {minimum} {unit}",description:"Smallest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.minimum"},{minimum:d,unit:x});if(T)return a({defaultMessage:"Up to {maximum} {unit}",description:"Largest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.maximum"},{maximum:T,unit:x})});return(d,T)=>(e.openBlock(),e.createBlock(e.unref(it._sfc_main),{modelValue:h.value,"onUpdate:modelValue":T[0]||(T[0]=x=>h.value=x),class:"sv-converted-amount-input",type:"number","as-text-type":"",name:t.name,label:t.label,required:t.required,disabled:t.disabled,error:t.error},e.createSlots({suffix:e.withCtx(()=>[e.createElementVNode("span",{"data-testid":`${t.name}-unit`},e.toDisplayString(t.unit),9,jt)]),_:2},[g.value?{name:"label-suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-bounds`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,w.value?{name:"helper",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-conversion`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1},8,["data-testid"])]),key:"1"}:void 0]),1032,["modelValue","name","label","required","disabled","error"]))}}),Qt=e.defineComponent({__name:"Section",props:{emphasized:{type:Boolean,default:!1},contentClasses:{type:String},contentBackground:{type:String},title:{type:String},noSpacing:{type:Boolean},hasError:{type:Boolean},noBorder:{type:Boolean}},setup(t){const o=t,n=["sv-section__accent relative","before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5","before:rounded-full before:bg-primary-600"].join(" "),a=e.computed(()=>[o.emphasized?n:void 0,o.contentClasses].filter(Boolean).join(" ")),i=e.computed(()=>{const{emphasized:u,...s}=o;return s});return(u,s)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(i.value,{class:"sv-section","content-classes":a.value}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:2},[u.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},He=e.defineComponent({__name:"AutoTopUpConfig",props:{config:{type:Object},denomination:{type:Object},creditUnitName:{type:String},chargeCurrency:{type:String},conversionRate:{type:String},topUpBounds:{type:Object},showThresholdConversion:{type:Boolean,default:!0},contained:{type:Boolean},alwaysEnabled:{type:Boolean},disabled:{type:Boolean}},emits:["save"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:u,formatNumber:s}=M.useIntl(),l=e.computed(()=>{var y,S;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(S=(y=a.topUpBounds)==null?void 0:y.minimum)==null?void 0:S.quantity}}),c=e.ref(ie(a.config,l.value)),h=e.computed(()=>Le(a.denomination,a.creditUnitName)),_=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),C=e.computed(()=>_.value==="CREDITS"?h.value:a.chargeCurrency),f=e.computed({get:()=>{var y;return((y=c.value.threshold)==null?void 0:y.quantity)??""},set:y=>{c.value.threshold={quantity:y||null,currency:h.value}}}),v=e.computed({get:()=>{var y;return((y=c.value.topUpAmount)==null?void 0:y.quantity)??""},set:y=>{c.value.topUpAmount={quantity:y||null,currency:a.chargeCurrency}}});e.watch(()=>[a.config,l.value],([y,S])=>{Te(we(y,S),P())||(c.value=ie(y,S))});const m=e.computed({get:()=>a.alwaysEnabled||c.value.enabled,set:y=>{c.value.enabled=y}}),w=e.computed(()=>Ye({...c.value,enabled:m.value},l.value)),P=()=>w.value,q=e.reactive({threshold:e.computed(()=>Ce(c.value.threshold)??null),topUpAmount:e.computed(()=>Ce(c.value.topUpAmount)??null)}),g=y=>{if(!y)return"";const S=We(y,_.value,a.conversionRate,s);return S===void 0?le.formatAmount(y):`${S} ${C.value}`},d=O.requiredIf(()=>m.value),T=O.useValidation({threshold:{required:O.common.withMessage(()=>u({defaultMessage:"Enter the balance to top up at.",description:"Error shown under the auto top-up threshold when it is left empty",id:"auto_topup_config.threshold.required"}),d),notNegative:O.common.withMessage(()=>u({defaultMessage:"The balance to top up at cannot be negative.",description:"Error shown under the auto top-up threshold when it is below zero",id:"auto_topup_config.threshold.not_negative"}),y=>y===null||y>=0)},topUpAmount:{required:O.common.withMessage(()=>u({defaultMessage:"Enter the amount to top up with.",description:"Error shown under the auto top-up amount when it is left empty",id:"auto_topup_config.amount.required"}),d),positive:O.common.withMessage(()=>u({defaultMessage:"Top up with more than zero.",description:"Error shown under the auto top-up amount when it is zero or negative",id:"auto_topup_config.amount.positive"}),y=>y===null||y>0),atLeastMinimum:O.common.withMessage(()=>{var y;return u({defaultMessage:"Top up with at least {minimum}.",description:"Error shown under the auto top-up amount when it is below what the pricing allows",id:"auto_topup_config.amount.at_least_minimum"},{minimum:g((y=a.topUpBounds)==null?void 0:y.minimum)})},y=>{var S;return Wt(y,(S=a.topUpBounds)==null?void 0:S.minimum)}),withinMaximum:O.common.withMessage(()=>{var y;return u({defaultMessage:"Top up with at most {maximum}.",description:"Error shown under the auto top-up amount when it is above what the pricing allows",id:"auto_topup_config.amount.within_maximum"},{maximum:g((y=a.topUpBounds)==null?void 0:y.maximum)})},y=>{var S;return Ht(y,(S=a.topUpBounds)==null?void 0:S.maximum)})}},q),x=e.computed(()=>!Te(P(),we(a.config,l.value)));function U(){return T.value.$touch(),T.value.$invalid?void 0:P()}function A(){const y=U();y&&i("save",y)}return o({submit:A,validate:U,rule:w,hasChanges:x,isInvalid:e.computed(()=>T.value.$invalid)}),(y,S)=>(e.openBlock(),e.createBlock(Qt,{class:"sv-auto-topup-config","content-background":t.contained?"gray":"none","no-spacing":!t.contained,"no-border":!t.contained},{default:e.withCtx(()=>[t.alwaysEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(O._sfc_main),{key:0,modelValue:m.value,"onUpdate:modelValue":S[0]||(S[0]=I=>m.value=I),"no-spacing":"","label-position":"before",class:"!flex",disabled:t.disabled},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",Gt,[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Auto top-up",description:"Title of the automatic wallet top-up settings",id:"auto_topup_config.title"})),1)]),_:1}),e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Automatically top up your balance when it runs low.",description:"Subtitle of the automatic wallet top-up settings",id:"auto_topup_config.subtitle"})),1)]),_:1})])]),_:1},8,["modelValue","disabled"])),e.createVNode(e.unref(Ae._sfc_main),{"is-open":m.value},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid grid-cols-1 gap-3",{"mt-4":!t.alwaysEnabled}])},[e.createVNode(ue,{modelValue:f.value,"onUpdate:modelValue":S[1]||(S[1]=I=>f.value=I),name:"auto-top-up-threshold",unit:h.value,"model-base":_.value,"entry-base":_.value,currency:t.chargeCurrency,"conversion-rate":t.conversionRate,"show-conversion-hint":t.showThresholdConversion,required:"",disabled:t.disabled,error:e.unref(T).threshold.$errors,label:e.unref(u)({defaultMessage:"When your balance falls below",description:"Label of the balance at which an automatic top-up is charged",id:"auto_topup_config.threshold.label"})},null,8,["modelValue","unit","model-base","entry-base","currency","conversion-rate","show-conversion-hint","disabled","error","label"]),e.createVNode(ue,{modelValue:v.value,"onUpdate:modelValue":S[2]||(S[2]=I=>v.value=I),name:"auto-top-up-amount",unit:C.value,"model-base":"AMOUNT","entry-base":_.value,currency:t.chargeCurrency,"credit-unit-name":t.creditUnitName,"conversion-rate":t.conversionRate,bounds:t.topUpBounds,"show-conversion-hint":"",required:"",disabled:t.disabled,error:e.unref(T).topUpAmount.$errors,label:e.unref(u)({defaultMessage:"Top-up with",description:"Label of the amount every automatic top-up adds",id:"auto_topup_config.amount.label"})},null,8,["modelValue","unit","entry-base","currency","credit-unit-name","conversion-rate","bounds","disabled","error","label"])],2)):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["content-background","no-spacing","no-border"]))}}),xe=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function ze({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,u)=>xe(u.created_at)-xe(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,u,s],l)=>{var C;const c=l==null?void 0:l[0],h=i==null?void 0:i.find(({id:f})=>!(c!=null&&c.some(v=>v.id===f)));if(h&&(c!=null&&c.length)){o.value=h.id;return}const _=f=>!!f&&!!(i!=null&&i.some(v=>v.id===f));_(s)||(o.value=_(u)?u:(C=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:C.id)},{immediate:!0}),{sortedPaymentMethods:a}}function te(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>se.formatWalletBalanceValue(t,o,i);return{formatValue:n,formatOpenBalance:i=>n(i==null?void 0:i.wallet_balance.open_balance)}}const Kt={class:"sv-top-up-form"},Xt={class:"grid grid-cols-1 gap-4"},Jt={class:"grid grid-cols-1 gap-1"},Zt={class:"sv-top-up-form__option-details"},eo={key:0},to=e.defineComponent({__name:"TopUpModalForm",props:{topUpPricingItems:{type:null},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},autoTopUpConfig:{type:Object}},emits:["add-payment-method","success","save-auto-top-up","failure"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:u}=M.useIntl(),{formatValue:s}=te(),l=e.ref({pricing_plan_schedule_id:"",pricing_items:[],start_at:"",finalize_immediately:!1,payment_method_id:void 0,preview:!0}),c=e.computed(()=>{const r=(a.topUpPricingItems??[]).filter(p=>p.flexiblePricing||p.fixedPricing);return[...r.filter(({flexiblePricing:p})=>p),...r.filter(({flexiblePricing:p})=>!p)]}),h=r=>c.value.find(p=>p.pricingItemId===r),_=e.computed(()=>{var r,p;return(p=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:p.pricingPlanScheduleId});e.watch(_,r=>{l.value.pricing_plan_schedule_id=r??""},{immediate:!0});const C=r=>{const{config:p,currency:b}=r.flexiblePricing??{},N=p==null?void 0:p.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=l.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const p=h(typeof r=="string"?r:void 0);if(!p){l.value.pricing_items=[];return}const b=C(p);l.value.pricing_items=[{pricing_item_id:p.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(c,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=l.value.pricing_items[0])==null?void 0:V.pricing_item_id)}))return;const b=r.find(({flexiblePricing:N})=>N)??r[0];f.value=b==null?void 0:b.pricingItemId},{immediate:!0});const v=e.computed({get:()=>{var r;return(r=l.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const p=(b=l.value.pricing_items[0])==null?void 0:b.pricing_item_id;p&&(l.value.pricing_items=[{pricing_item_id:p,...r&&{flexible_amount:r}}])}}),m=r=>{var b;const p=(b=h(String(r)))==null?void 0:b.fixedPricing;return p!=null&&p.value.credits?le.formatAmount(p.amount):void 0},w=e.computed(()=>{var r;return(r=h(String(f.value)))==null?void 0:r.flexiblePricing}),P=e.computed({get:()=>{var r;return((r=v.value)==null?void 0:r.quantity)??""},set:r=>{var b;const p=(b=w.value)==null?void 0:b.currency;v.value=r&&p?{quantity:r,currency:p}:void 0}}),q=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",g=e.computed(()=>Ie(a.topUpPricingItems)),d=r=>r.creditsConfiguration?g.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,T=r=>{var b;const p=(b=h(String(r)))==null?void 0:b.flexiblePricing;return p?[p]:[]},x=r=>{var p;return!!((p=h(String(r)))!=null&&p.flexiblePricing)},U=e.computed(()=>c.value.map(r=>{var p;return{value:r.pricingItemId,label:r.fixedPricing?s(r.fixedPricing.value):u({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((p=r.flexiblePricing)==null?void 0:p.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:u({defaultMessage:"Between {minimum} and {maximum}",description:"Bounds of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.bounds"},{minimum:s(r.flexiblePricing.bounds.minimum),maximum:s(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=l.value.pricing_items.filter(p=>{var b;return!((b=h(p.pricing_item_id))!=null&&b.flexiblePricing)||!!p.flexible_amount});return r.length>0?r:void 0}),y=e.computed(()=>!a.autoTopUpConfig&&c.value.some(({flexiblePricing:p})=>p)?qe(a.topUpPricingItems):void 0),S=e.ref(),{chargeOnDemandPricingItems:I}=ke.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!l.value.pricing_plan_schedule_id&&!!A.value&&!!l.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>l.value.payment_method_id??null)}),W=O.useValidation({paymentMethodId:{required:O.common.withMessage(()=>u({defaultMessage:"Select a payment method to pay for this top-up.",description:"Error shown under the payment methods in the top-up modal when none is selected on submit",id:"topup_modal.payment_method_required"}),O.required)}},G),Y=e.computed(()=>{const[r]=l.value.pricing_items,p=h(r==null?void 0:r.pricing_item_id);return p?Rt(p,r==null?void 0:r.flexible_amount):void 0});async function K(){var p,b,N;W.value.$touch();const r=(p=S.value)==null?void 0:p.validate();if(!(W.value.$invalid||(b=S.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await I({pricing_plan_schedule_id:l.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:l.value.payment_method_id,preview:!1});r&&((N=S.value)!=null&&N.hasChanges)&&l.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:l.value.payment_method_id}),i("success",V)}catch(V){Q.error("TOP_UP_FAILED","Failed to charge the wallet top-up",{},V),i("failure",V)}finally{R.value=!1}}}o({submit:K,isCharging:R,canSubmit:L,chargedValue:Y});const H=e.computed({get:()=>l.value.payment_method_id??void 0,set:r=>{l.value.payment_method_id=r}}),{sortedPaymentMethods:X}=ze({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,p)=>(e.openBlock(),e.createElementBlock("form",Kt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Jt,[U.value.length>0?(e.openBlock(),e.createBlock(e.unref(Ue._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":p[3]||(p[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:U.value,"show-radio":!1,label:e.unref(u)({defaultMessage:"Top up amount",description:"Label above the list of ways to top up the wallet in the top-up modal",id:"topup_modal.pricing_items.label"})},{label:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("span",null,e.toDisplayString(b.label),1),m(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",weight:"normal","no-spacing":"",class:"sv-top-up-form__option-cost"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!x(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),T(N).length>0?(e.openBlock(),e.createBlock(e.unref(Ae._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T(N),V=>{var k;return e.openBlock(),e.createElementBlock("div",{key:V.currency,class:"sv-top-up-form__amount grid grid-cols-1 gap-3",onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"])),onKeydown:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[b.description?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(ue,{modelValue:P.value,"onUpdate:modelValue":p[0]||(p[0]=D=>P.value=D),name:"top-up-amount","model-base":"AMOUNT",unit:d(V),"entry-base":q(V),currency:V.currency,"conversion-rate":(k=V.creditsConfiguration)==null?void 0:k.conversionRate,required:"",disabled:R.value},null,8,["modelValue","unit","entry-base","currency","conversion-rate","disabled"])],32)}),128))]),_:2},1032,["is-open"])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","disabled","options","label"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(Fe,{"pricing-plan-schedule-id":_.value,"pricing-items":A.value},null,8,["pricing-plan-schedule-id","pricing-items"])]),y.value?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(He,e.mergeProps({ref_key:"autoTopUpFormRef",ref:S,class:"sv-top-up-form__auto-top-up"},y.value,{contained:"","show-threshold-conversion":!1,disabled:R.value}),null,16,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(e.unref(ot._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(re._sfc_main,{modelValue:H.value,"onUpdate:modelValue":p[4]||(p[4]=b=>H.value=b),class:"sv-top-up-form__payment-methods","payment-methods":e.unref(X),required:"",error:e.unref(W).paymentMethodId.$errors,"payment-method-options":t.paymentMethodOptions,disabled:R.value,label:e.unref(u)({defaultMessage:"Payment method",description:"Label above the payment method that pays for the top-up, in the top-up modal",id:"topup_modal.payment_method_selector.label"}),onAddPaymentMethod:p[5]||(p[5]=b=>i("add-payment-method"))},null,8,["modelValue","payment-methods","error","payment-method-options","disabled","label"])])])])]))}}),oo={class:"sv-top-up-success grid grid-cols-1 gap-4"},no=e.defineComponent({__name:"TopUpModalSuccess",props:{addedValue:{type:Object},invoice:{type:Object}},setup(t){const{$t:o}=M.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock("div",oo,[t.invoice?(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),{key:0,"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold",class:"mb-2 block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Receipt",description:"Heading above the invoice a completed top-up produced",id:"topup_modal.success.receipt.heading"})),1)]),_:1}),e.createVNode(e.unref(Ne._sfc_main$1),{invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})):e.createCommentVNode("",!0)]))}});function ao({step:t,currentBalance:o,topUpValue:n}){const{$t:a,formatNumber:i}=M.useIntl(),u=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add payment method",description:"Title of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.title"}):t.value==="SUCCESS"?a({defaultMessage:"Top-up complete",description:"Title of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_title"}):a({defaultMessage:"Top up balance",description:"Title of the wallet top-up modal",id:"topup_modal.title"})),s=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add a new payment method for topping up your balance.",description:"Subtitle of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.subtitle"}):t.value==="SUCCESS"?a({defaultMessage:"Your payment went through.",description:"Subtitle of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_subtitle"}):a({defaultMessage:"Your current balance is {balance}.",description:"Subtitle of the top-up modal showing the current wallet balance",id:"topup_modal.subtitle"},{balance:o.value})),l=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Back",description:"Label of the button that leaves the add payment method step in the top-up modal",id:"topup_modal.back_button.label"}):a({defaultMessage:"Cancel",description:"Label of the button that closes the top-up modal",id:"topup_modal.cancel_button.label"})),c=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Save payment method",description:"Label of the confirm button in the top-up modal while adding a payment method",id:"topup_modal.save_payment_method.label"}):t.value==="SUCCESS"?a({defaultMessage:"Done",description:"Label of the button that dismisses the top-up modal once the top-up has been charged",id:"topup_modal.done_button.label"}):n.value?a({defaultMessage:"Top up balance with {value}",description:"Label of the confirm button in the top-up modal once an amount is entered",id:"topup_modal.confirm_button.label"},{value:se.formatWalletBalanceValue(a,i,n.value)}):a({defaultMessage:"Top up balance",description:"Label of the confirm button in the top-up modal while no amount is entered",id:"topup_modal.confirm_button.empty.label"}));return{title:u,subTitle:s,cancelButtonText:l,confirmButtonText:c}}function fe({isOpen:t,customer:o,subscriptionId:n,onError:a}){const{paymentMethodOptions:i,get:u,isPending:s}=lt.usePaymentMethodOptions(),l=async()=>{const h=o.value;if(!(!t.value||!h))try{await u({customerId:h.id,...n!=null&&n.value?{subscriptionId:n.value}:{},country:st.getCustomerCountry(h)})}catch(_){a==null||a(_)}};e.watch(()=>[t.value,o.value,n==null?void 0:n.value],()=>void l(),{immediate:!0});const c=e.computed(()=>s.value?void 0:i.value);return{paymentMethodOptions:i,settledOptions:c,isPending:s,load:l}}function io(t){const o=e.ref(0),n=i=>{o.value=(i==null?void 0:i.offsetHeight)??0},a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i=>{var s;const u=(s=i[0])==null?void 0:s.target;n(u instanceof HTMLElement?u:void 0)});return e.watch(t,(i,u)=>{u&&(a==null||a.unobserve(u)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const uo=["inert"],so=300,lo="1rem",ro=e.defineComponent({__name:"SlidingPanes",props:{panes:{type:Array},current:{type:String}},setup(t){const o=t,n=e.ref(!1);let a;e.watch(()=>o.current,()=>{n.value=!0,clearTimeout(a),a=setTimeout(()=>{n.value=!1},so)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),u={},s=_=>u[_]??(u[_]=C=>{i.value[_]=C instanceof HTMLElement?C:void 0}),l=e.computed(()=>i.value[o.current]),c=io(l),h=e.computed(()=>{const _=o.panes.indexOf(o.current);return _>0?`translateX(calc(${-_} * (100% + ${lo})))`:"translateX(0px)"});return(_,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",n.value?"transition-[height] duration-300 ease-in-out motion-reduce:transition-none":""]),style:e.normalizeStyle(e.unref(c)?{height:`${e.unref(c)}px`}:void 0)},[e.createElementVNode("div",{class:"sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",style:e.normalizeStyle({transform:h.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.panes,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"sv-sliding-panes__pane w-full shrink-0",inert:f!==t.current||void 0},[e.createElementVNode("div",{ref_for:!0,ref:s(f)},[e.renderSlot(_.$slots,f)],512)],8,uo))),128))],4)],6))}}),ve=e.defineComponent({inheritAttrs:!1,__name:"OnDemandPaymentModalShell",props:{showModal:{type:Boolean},title:{type:String},subTitle:{type:String},cancelButtonText:{type:String},confirmButtonText:{type:String},isPending:{type:Boolean},panes:{type:Array},step:{type:String},addPaymentMethodPane:{type:String},customer:{type:Object},paymentMethodOptions:{type:Array},isPaymentMethodOptionsPending:{type:Boolean},isAddingPaymentMethod:{type:Boolean}},emits:["confirm","cancel","payment-success","payment-failed"],setup(t,{expose:o}){const n=t,a=e.ref(),i=e.computed(()=>n.panes.filter(u=>u!==n.addPaymentMethodPane));return o({submit:()=>{var u;return(u=a.value)==null?void 0:u.submit()},isSaving:e.computed(()=>{var u;return!!((u=a.value)!=null&&u.isSaving)})}),(u,s)=>(e.openBlock(),e.createBlock(e.unref(Ee.Modal),{"no-click-away":"","show-modal":t.showModal,size:"lg",title:t.title,"sub-title":t.subTitle,"cancel-button-text":t.cancelButtonText,"confirm-button-text":t.confirmButtonText,"is-loading":t.isPending,onConfirm:s[2]||(s[2]=l=>u.$emit("confirm")),onClose:s[3]||(s[3]=l=>u.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({class:"grid grid-cols-1 gap-4 pb-4"},u.$attrs),[e.createVNode(ro,{panes:t.panes,current:t.step},e.createSlots({[t.addPaymentMethodPane]:e.withCtx(()=>[e.createVNode(re._sfc_main$1,{ref_key:"paneRef",ref:a,customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isPaymentMethodOptionsPending,"is-active":t.isAddingPaymentMethod,onSuccess:s[0]||(s[0]=l=>u.$emit("payment-success")),onFailure:s[1]||(s[1]=l=>u.$emit("payment-failed",l))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,l=>({name:l,fn:e.withCtx(()=>[e.renderSlot(u.$slots,l)])}))]),1032,["panes","current"])],16)]),_:2},[u.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),je=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},Qe=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,Ge=(t,o=[])=>{if(t!=null&&t.pricing_item_id&&t.pricing_plan_schedule_id)return{pricingItemId:t.pricing_item_id,pricingPlanScheduleId:t.pricing_plan_schedule_id};const n=o.find(({flexiblePricing:a,pricingPlanScheduleId:i})=>a&&i);return n!=null&&n.pricingPlanScheduleId?{pricingItemId:n.pricingItemId,pricingPlanScheduleId:n.pricingPlanScheduleId}:void 0},Ke=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var u,s;const i=!!(((u=t==null?void 0:t.threshold)==null?void 0:u.amount)??((s=t==null?void 0:t.threshold)==null?void 0:s.credits));if(!(!t||!i||!(o!=null&&o.wallet_id)||!n||!a))return{wallet_id:o.wallet_id,status:t.status,threshold:t.threshold,pricing_plan_schedule_id:n.pricingPlanScheduleId,pricing_item_id:n.pricingItemId,payment_method_id:a,...t.topup_amount&&{topup_amount:t.topup_amount}}};function he({step:t,name:o,returnTo:n}){const a=e.ref();return{paneRef:a,isActive:e.computed(()=>t.value===o),isSaving:e.computed(()=>{var i;return!!((i=a.value)!=null&&i.isSaving)}),open:()=>{t.value=o},leave:()=>{t.value=n},submit:()=>{var i;return(i=a.value)==null?void 0:i.submit()}}}function Xe(){const t=M.createRequestService(),o=M.useConfig(),n="/portal/auto-top-up-configs";function a(l){return t({url:`${o.apiUrls.config}${n}`,query:{...l},isCollection:!0})}function i(l){return t({url:`${o.apiUrls.config}${n}/${l}`})}function u(l){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:l})}function s(l){return t({url:`${o.apiUrls.config}${n}/${l}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:u,deactivateAutoTopUpConfig:s}}function Je(){const{createAutoTopUpConfig:t}=Xe(),o=M.useLogger(),n=e.ref(!1);return{save:async i=>{if(!i||n.value)return{saved:!1};n.value=!0;try{return await t(i),{saved:!0}}catch(u){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},u),{saved:!1,error:u}}finally{n.value=!1}},isSaving:n}}const co={key:0,class:"mb-4"},po={class:"sr-only"},mo={class:"flex flex-col gap-2"},fo=e.defineComponent({__name:"TopUpModal",props:{showModal:{type:Boolean},selectedBalanceItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object},subscriptions:{type:Array}},emits:["confirm","close","auto-top-up-saved","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:u}=te(),s=e.computed(()=>Qe(je(n.selectedBalanceItem))),l=e.computed(()=>u(n.selectedBalanceItem)),c=e.computed(()=>Pt(n.selectedBalanceItem,n.subscriptions??[])),h=e.ref();e.watch(c,B=>{var E;B.some(({id:oe})=>oe===h.value)||(h.value=(E=B[0])==null?void 0:E.id)},{immediate:!0});const _=e.computed(()=>c.value.length>1),C=e.computed(()=>c.value.map(({id:B,name:$})=>({value:B,label:$}))),f=e.computed(()=>Object.fromEntries(c.value.flatMap(({id:B,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:oe})=>oe===B);return E?[[B,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const B=c.value.find(({id:E})=>E===h.value);return B?Ut(n.selectedBalanceItem,B.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),m=e.computed(()=>Ve(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:q}=fe({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),g=e.ref("TOP_UP"),d=e.computed(()=>(n.paymentMethods??[]).length>0),T=e.computed(()=>!q.value&&(w.value??[]).length===0),x=e.computed(()=>g.value==="TOP_UP"&&!d.value&&T.value),U=e.ref(),A=e.ref(),y=()=>{L(),a("payment-success")},{paneRef:S,isActive:I,isSaving:Q,open:R,leave:L,submit:G}=he({step:g,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Je(),Y=e.ref(),K=e.computed(()=>{var B;return(B=Y.value)==null?void 0:B.chargedValue}),H=e.computed(()=>{var B;return Q.value||!!((B=Y.value)!=null&&B.isCharging)}),{title:X,subTitle:r,cancelButtonText:p,confirmButtonText:b}=ao({step:g,currentBalance:l,topUpValue:K}),N=()=>{var B;if(I.value){G();return}(B=Y.value)==null||B.submit()},V=async({rule:B,paymentMethodId:$})=>{const{saved:E}=await W(Ke({rule:B,walletBalanceItem:n.selectedBalanceItem,chargeTarget:Ge(void 0,m.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=B=>{var $;U.value=B,A.value=($=Y.value)==null?void 0:$.chargedValue,g.value="SUCCESS"},D=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(I.value){L();return}if(g.value==="SUCCESS"){D();return}a("close")}},ge=e.ref(0);return e.watch(()=>n.showModal,B=>{B&&(g.value="TOP_UP",U.value=void 0,A.value=void 0,ge.value+=1)}),(B,$)=>(e.openBlock(),e.createBlock(ve,{ref_key:"addPaymentMethodRef",ref:S,"show-modal":t.showModal,title:e.unref(X),"sub-title":e.unref(r),"cancel-button-text":e.unref(p),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(xt),step:g.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(w),"is-payment-method-options-pending":e.unref(q),"is-adding-payment-method":e.unref(I),onConfirm:N,onCancel:F,onPaymentSuccess:y,onPaymentFailed:$[1]||($[1]=E=>B.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[_.value?(e.openBlock(),e.createElementBlock("div",co,[e.createVNode(e.unref(Ue._sfc_main),{modelValue:h.value,"onUpdate:modelValue":$[0]||($[0]=E=>h.value=E),class:"sv-topup-modal__subscription",name:"top-up-subscription",direction:"column",required:"",options:C.value,"show-radio":!1,label:e.unref(i)({defaultMessage:"Subscription to top up",description:"Label above the list of subscriptions a top-up can be charged against, in the top-up modal",id:"topup_modal.subscriptions.label"})},{prefix:e.withCtx(({optionValue:E})=>[f.value[String(E)]?(e.openBlock(),e.createBlock(ut._sfc_main,{key:0,class:"sv-topup-modal__subscription-option grow","no-spacing":"",subscription:f.value[String(E)].subscription,"enabled-pricing-ids":f.value[String(E)].enabledPricingIds},null,8,["subscription","enabled-pricing-ids"])):e.createCommentVNode("",!0)]),label:e.withCtx(({option:E})=>[e.createElementVNode("span",po,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:ge.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":m.value,"payment-methods":t.paymentMethods,"auto-top-up-config":s.value,"payment-method-options":e.unref(P),onAddPaymentMethod:e.unref(R),onSuccess:k,onSaveAutoTopUp:V},null,8,["top-up-pricing-items","payment-methods","auto-top-up-config","payment-method-options","onAddPaymentMethod"]))]),SUCCESS:e.withCtx(()=>[U.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:U.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[g.value==="SUCCESS"||x.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",mo,[g.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(z._sfc_main),{size:"lg",disabled:"","data-testid":"confirm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1}),e.createVNode(e.unref(z._sfc_main),{size:"lg",intent:"subtle","data-testid":"cancel",onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]),_:1})],64))])]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),vo=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],ho={class:"grid grid-cols-1 gap-4"},go=e.defineComponent({__name:"AutoTopUpModal",props:{showModal:{type:Boolean},walletBalanceItem:{type:Object},topUpItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object}},emits:["saved","close","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:u}=te(),s=e.ref("AUTO_TOP_UP"),l=e.computed(()=>u(n.walletBalanceItem)),c=e.computed(()=>Ve(n.walletBalanceItem)),h=e.computed(()=>qe(c.value)),_=e.computed(()=>je(n.walletBalanceItem)),C=e.computed(()=>Qe(_.value)),f=e.computed(()=>Ge(n.topUpItem,c.value)),v=e.ref(),m=e.computed(()=>{var D,F;const k=(F=(D=v.value)==null?void 0:D.rule)==null?void 0:F.topup_amount;return k!=null&&k.quantity&&f.value?[{pricing_item_id:f.value.pricingItemId,flexible_amount:k}]:void 0}),w=e.computed(()=>{var k;return(k=f.value)==null?void 0:k.pricingPlanScheduleId}),P=e.ref(),{sortedPaymentMethods:q}=ze({paymentMethods:e.computed(()=>n.paymentMethods),selectedPaymentMethodId:P,preferredPaymentMethodId:e.computed(()=>{var k;return(k=_.value)==null?void 0:k.payment_method_id})}),{paymentMethodOptions:g,settledOptions:d,isPending:T}=fe({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:x,isActive:U,isSaving:A,open:y,leave:S,submit:I}=he({step:s,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Je(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=O.useValidation({paymentMethodId:{required:O.common.withMessage(()=>i({defaultMessage:"Select a payment method to pay for automatic top-ups.",description:"Error shown in the auto top-up modal when no payment method is selected",id:"auto_topup_modal.payment_method.required"}),O.required)}},G),Y=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Title of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.title"}):i({defaultMessage:"Automatic top-up",description:"Title of the automatic wallet top-up modal",id:"auto_topup_modal.title"})),K=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"This method pays for every automatic top-up.",description:"Subtitle of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.subtitle"}):i({defaultMessage:"Your current balance is {balance}. Enable auto top so you can stay productive",description:"Subtitle of the automatic wallet top-up modal, naming the balance",id:"auto_topup_modal.subtitle"},{balance:l.value})),H=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Back",description:"Button returning from adding a payment method to the auto top-up rule",id:"auto_topup_modal.add_payment_method.cancel"}):i({defaultMessage:"Cancel",description:"Button dismissing the auto top-up modal",id:"auto_topup_modal.cancel"})),X=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Button storing the payment method being added in the auto top-up modal",id:"auto_topup_modal.add_payment_method.confirm"}):i({defaultMessage:"Save",description:"Button saving the automatic top-up rule",id:"auto_topup_modal.confirm"}));async function r(){var F;if(W.value.$touch(),L.value)return;const{saved:k,error:D}=await Q(Ke({rule:(F=v.value)==null?void 0:F.validate(),walletBalanceItem:n.walletBalanceItem,chargeTarget:f.value,paymentMethodId:P.value}));if(k){a("saved"),a("close");return}D&&a("payment-failed",D)}const p=()=>{if(U.value){I();return}r()},b=()=>{S(),a("payment-success")},N=()=>{if(!L.value){if(U.value){S();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(s.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,D)=>(e.openBlock(),e.createBlock(ve,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:Y.value,"sub-title":K.value,"cancel-button-text":H.value,"confirm-button-text":X.value,"is-pending":L.value,panes:e.unref(vo),step:s.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(g),"is-payment-method-options-pending":e.unref(T),"is-adding-payment-method":e.unref(U),onConfirm:p,onCancel:N,onPaymentSuccess:b,onPaymentFailed:D[1]||(D[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",ho,[h.value?(e.openBlock(),e.createBlock(He,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},h.value,{config:C.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Fe,{"pricing-plan-schedule-id":w.value,"pricing-items":m.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(re._sfc_main,{modelValue:P.value,"onUpdate:modelValue":D[0]||(D[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(q),"payment-method-options":e.unref(d),disabled:L.value,error:e.unref(W).paymentMethodId.$errors,label:e.unref(i)({defaultMessage:"Pay automatic top-ups with",description:"Label above the payment method an automatic top-up is charged to",id:"auto_topup_modal.payment_method.label"}),onAddPaymentMethod:e.unref(y)},null,8,["modelValue","payment-methods","payment-method-options","disabled","error","label","onAddPaymentMethod"])])]),_:1},8,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),_o={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},yo=e.defineComponent({__name:"AutoTopUpCancellationModal",props:{showModal:{type:Boolean},config:{type:Object}},emits:["confirmed","close"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),u=M.useLogger(),{formatValue:s}=te(),{deactivateAutoTopUpConfig:l}=Xe(),c=e.ref(!1),h=e.ref(!1);e.watch(()=>n.showModal,v=>{v&&(h.value=!1)});const _=e.computed(()=>{var w,P;const v=(w=n.config)==null?void 0:w.threshold,m=(P=n.config)==null?void 0:P.topup_amount;return!(v!=null&&v.amount)&&!(v!=null&&v.credits)?i({defaultMessage:"Your balance will no longer be topped up automatically. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.explanation"}):m?i({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.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",id:"auto_topup_cancellation_modal.explanation_with_amount"},{amount:s({amount:m}),threshold:s(v)}):i({defaultMessage:"Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",id:"auto_topup_cancellation_modal.explanation_with_threshold"},{threshold:s(v)})}),C=async()=>{var m;const v=(m=n.config)==null?void 0:m.id;if(!(!v||c.value)){c.value=!0,h.value=!1;try{await l(v),a("confirmed"),a("close")}catch(w){u.error("AUTO_TOP_UP_CANCELLATION_FAILED","Failed to turn off a wallet's automatic top-up",{},w),h.value=!0}finally{c.value=!1}}},f=()=>{c.value||a("close")};return(v,m)=>(e.openBlock(),e.createBlock(e.unref(Ee.Modal),{size:"sm","show-modal":t.showModal,"is-loading":c.value,"no-click-away":c.value,"no-backdrop-close":c.value,title:e.unref(i)({defaultMessage:"Turn off automatic top-up",description:"Title of the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.title"}),"confirm-button-text":e.unref(i)({defaultMessage:"Yes, turn it off",description:"Button confirming that a wallet automatic top-up is turned off",id:"auto_topup_cancellation_modal.confirm"}),"cancel-button-text":e.unref(i)({defaultMessage:"Cancel",description:"Button dismissing the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.cancel"}),onConfirm:C,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",_o,[e.createVNode(e.unref(M._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-auto-topup-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.value),1)]),_:1}),h.value?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:0,class:"sv-auto-topup-cancellation-modal__error sv-error",title:e.unref(i)({defaultMessage:"Could not turn off the automatic top-up. Please try again later.",description:"Error shown when turning a wallet automatic top-up off failed",id:"auto_topup_cancellation_modal.failed"})},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","is-loading","no-click-away","no-backdrop-close","title","confirm-button-text","cancel-button-text"]))}}),bo=e.defineComponent({inheritAttrs:!1,__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array},showTopUpButton:{type:Boolean},customer:{type:Object},paymentMethods:{type:Array},subscriptions:{type:Array}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),u=e.ref(),s=e.computed(()=>_e(n.walletBalances,u.value)),l=e.computed(()=>!!s.value),c=e.ref(),h=e.computed(()=>!!c.value),_=e.computed(()=>_e(n.walletBalances,c.value)),C=e.ref(),f=e.computed(()=>!!C.value);return(v,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Pe._sfc_main,e.mergeProps({key:0,variant:"section"},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-loading min-h-48","data-testid":"customer-wallet-balances-skeleton"}),null,16)):t.hasError?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),e.mergeProps({key:1},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-error",title:e.unref(i)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})}),null,16,["title"])):t.walletBalances.length>0?(e.openBlock(),e.createBlock(e.unref(Ct),e.mergeProps({key:2},v.$attrs,{class:"sv-wallet-balances sv-root sv-component","customer-wallet-balances":t.walletBalances,"show-auto-top-up":"","show-manual-top-up":"",title:e.unref(i)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(t.walletBalances.length)}),onTopUp:m[0]||(m[0]=w=>u.value=w),onAutoTopUp:m[1]||(m[1]=w=>c.value=w),onCancelAutoTopUp:m[2]||(m[2]=w=>C.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(fo,{key:3,"show-modal":l.value,"selected-balance-item":s.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:m[3]||(m[3]=w=>u.value=void 0),onConfirm:m[4]||(m[4]=w=>a("top-up-charged")),onPaymentSuccess:m[5]||(m[5]=w=>a("payment-method-stored")),onPaymentFailed:m[6]||(m[6]=w=>a("payment-failed",w))},null,8,["show-modal","selected-balance-item","payment-methods","customer","subscriptions"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(go,{key:4,"show-modal":h.value,"wallet-balance-item":_.value,"top-up-item":c.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:m[7]||(m[7]=w=>c.value=void 0),onSaved:m[8]||(m[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:m[9]||(m[9]=w=>a("payment-method-stored")),onPaymentFailed:m[10]||(m[10]=w=>a("payment-failed",w))},null,8,["show-modal","wallet-balance-item","top-up-item","payment-methods","customer"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(yo,{key:5,"show-modal":f.value,config:C.value,onClose:m[11]||(m[11]=w=>C.value=void 0),onConfirmed:m[12]||(m[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=bo;exports._sfc_main$1=ve;exports.useAddPaymentMethodStep=he;exports.useChargeOnDemandInvoicePreview=Re;exports.useCustomerPaymentMethodOptions=fe;exports.useCustomerWalletBalances=St;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),c=e.defineComponent({__name:"Divider",props:{spacing:{default:"md"}},setup(n){return(a,m)=>(e.openBlock(),e.createElementBlock("hr",{class:e.normalizeClass({"my-1":n.spacing==="xxs","my-2":n.spacing==="xs","my-4":n.spacing==="sm","my-6":n.spacing==="md","my-8":n.spacing==="lg","my-10":n.spacing==="xl"})},null,2))}});exports._sfc_main=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),r=require("./customElements-C963-LtW.js"),a="relative translate-y-1/2 top-1/2 border-t border-gray-100",c=t=>{const i=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="left"?s+=" w-2":s+=" grow",s}),n=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="right"?s+=" w-2":s+=" grow",s});return{leftDividerClasses:i,rightDividerClasses:n}},o=e.defineComponent({__name:"DividerText",props:{spacing:{default:"none"},textPosition:{default:"left"},hasOuterDivider:{type:Boolean,default:!1},text:{}},setup(t){const i=t,{leftDividerClasses:n,rightDividerClasses:s}=c(i);return(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex gap-2",{"my-2":t.spacing==="xs","my-4":t.spacing==="sm","my-6":t.spacing==="md","my-8":t.spacing==="lg","my-10":t.spacing==="xl"}])},[t.textPosition==="left"&&t.hasOuterDivider||["center","right"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n))},null,2)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default",{},()=>[e.createVNode(e.unref(r._sfc_main),{tag:"span","no-spacing":"",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text),1)]),_:1})]),t.textPosition==="right"&&t.hasOuterDivider||["center","left"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s))},null,2)):e.createCommentVNode("",!0)],2))}});exports._sfc_main=o;
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, openBlock as t, createElementBlock as u, normalizeClass as k, createVNode as l, withCtx as a, renderSlot as w, createBlock as r, createTextVNode as m, toDisplayString as f, unref as d, Fragment as _, renderList as C, resolveDynamicComponent as M, ref as E, computed as $, createElementVNode as I, createCommentVNode as b } from "vue";
|
|
2
|
-
import { _ as x, a as N } from "./customElements-D5DAoHRI.mjs";
|
|
3
|
-
import { _ as V, T as A, a as j } from "./TooltipParagraph.vue.es-BXbOJmjr.mjs";
|
|
4
|
-
import { i as D } from "./useService-Bh47bllz.mjs";
|
|
5
|
-
import { g as F } from "./getComposedString.es-C__uhJpd.mjs";
|
|
6
|
-
import { _ as p } from "./Amount.vue.es-DPqHB8Xd.mjs";
|
|
7
|
-
import { _ as S } from "./Divider.vue.es-DnP_HqLz.mjs";
|
|
8
|
-
import { _ as q } from "./Expand.vue.es-BleuAfDz.mjs";
|
|
9
|
-
import { a as W } from "./Button.vue.es-C32_baQN.mjs";
|
|
10
|
-
import { _ as L } from "./Section.vue.es-D7eiXUbk.mjs";
|
|
11
|
-
const y = /* @__PURE__ */ h({
|
|
12
|
-
__name: "invoicePreviewRow",
|
|
13
|
-
props: {
|
|
14
|
-
weight: { default: "normal" },
|
|
15
|
-
variant: { default: "body-xs" },
|
|
16
|
-
noSpacing: { type: Boolean, default: !1 }
|
|
17
|
-
},
|
|
18
|
-
setup(e) {
|
|
19
|
-
return (i, c) => (t(), u("div", {
|
|
20
|
-
class: k(["flex flex-row gap-2", { "py-1.5": !e.noSpacing }])
|
|
21
|
-
}, [
|
|
22
|
-
l(x, {
|
|
23
|
-
tag: "span",
|
|
24
|
-
variant: e.variant,
|
|
25
|
-
class: "grow",
|
|
26
|
-
weight: e.weight
|
|
27
|
-
}, {
|
|
28
|
-
default: a(() => [
|
|
29
|
-
w(i.$slots, "label")
|
|
30
|
-
]),
|
|
31
|
-
_: 3
|
|
32
|
-
}, 8, ["variant", "weight"]),
|
|
33
|
-
l(x, {
|
|
34
|
-
tag: "span",
|
|
35
|
-
variant: e.variant,
|
|
36
|
-
weight: e.weight
|
|
37
|
-
}, {
|
|
38
|
-
default: a(() => [
|
|
39
|
-
w(i.$slots, "value")
|
|
40
|
-
]),
|
|
41
|
-
_: 3
|
|
42
|
-
}, 8, ["variant", "weight"])
|
|
43
|
-
], 2));
|
|
44
|
-
}
|
|
45
|
-
}), O = /* @__PURE__ */ h({
|
|
46
|
-
__name: "Skeleton",
|
|
47
|
-
props: {
|
|
48
|
-
widthClass: { default: "w-10" },
|
|
49
|
-
heightClass: { default: "h-3" },
|
|
50
|
-
shade: { default: "default" }
|
|
51
|
-
},
|
|
52
|
-
setup(e) {
|
|
53
|
-
return (i, c) => (t(), u("div", {
|
|
54
|
-
class: k(["rounded", [
|
|
55
|
-
e.widthClass,
|
|
56
|
-
e.heightClass,
|
|
57
|
-
{
|
|
58
|
-
"bg-gray-50/50": e.shade === "default",
|
|
59
|
-
"bg-gray-100/50": e.shade === "dark",
|
|
60
|
-
"bg-gray-200/50": e.shade === "darker",
|
|
61
|
-
"bg-gray-400/50": e.shade === "darkest"
|
|
62
|
-
}
|
|
63
|
-
]])
|
|
64
|
-
}, null, 2));
|
|
65
|
-
}
|
|
66
|
-
}), P = /* @__PURE__ */ h({
|
|
67
|
-
__name: "InvoicePreviewNoTaxesSkeleton",
|
|
68
|
-
props: {
|
|
69
|
-
widthClass: { default: "w-12" },
|
|
70
|
-
heightClass: { default: "h-5" }
|
|
71
|
-
},
|
|
72
|
-
setup(e) {
|
|
73
|
-
const { $t: i } = N();
|
|
74
|
-
return (c, s) => (t(), r(V, { "is-dark-mode": "" }, {
|
|
75
|
-
tooltip: a(() => [
|
|
76
|
-
l(A, null, {
|
|
77
|
-
default: a(() => [
|
|
78
|
-
l(j, null, {
|
|
79
|
-
default: a(() => [
|
|
80
|
-
m(f(d(i)({
|
|
81
|
-
defaultMessage: "Will be determined by billing information",
|
|
82
|
-
description: "Tooltip content for the invoice preview when taxes are not determined by billing information",
|
|
83
|
-
id: "invoice_preview.taxes_not_determined_by_billing_information_tooltip"
|
|
84
|
-
})), 1)
|
|
85
|
-
]),
|
|
86
|
-
_: 1
|
|
87
|
-
})
|
|
88
|
-
]),
|
|
89
|
-
_: 1
|
|
90
|
-
})
|
|
91
|
-
]),
|
|
92
|
-
default: a(() => [
|
|
93
|
-
l(O, {
|
|
94
|
-
"width-class": e.widthClass,
|
|
95
|
-
"height-class": e.heightClass,
|
|
96
|
-
shade: "darker"
|
|
97
|
-
}, null, 8, ["width-class", "height-class"])
|
|
98
|
-
]),
|
|
99
|
-
_: 1
|
|
100
|
-
}));
|
|
101
|
-
}
|
|
102
|
-
}), R = /* @__PURE__ */ h({
|
|
103
|
-
__name: "InvoicePreviewGroups",
|
|
104
|
-
props: {
|
|
105
|
-
invoice: {},
|
|
106
|
-
wrapperComponent: {}
|
|
107
|
-
},
|
|
108
|
-
setup(e) {
|
|
109
|
-
const i = (s) => s.groups.reduce(
|
|
110
|
-
(o, n) => n.type in o ? {
|
|
111
|
-
...o,
|
|
112
|
-
[n.type]: [...o[n.type], n]
|
|
113
|
-
} : { ...o, [n.type]: [n] },
|
|
114
|
-
{}
|
|
115
|
-
), c = (s) => {
|
|
116
|
-
var o, n, v;
|
|
117
|
-
return (o = s.pricing) != null && o.name && !D((n = s.pricing) == null ? void 0 : n.name) ? s.pricing.name : F(((v = s.products) == null ? void 0 : v.map((g) => g.name)) ?? []);
|
|
118
|
-
};
|
|
119
|
-
return (s, o) => (t(!0), u(_, null, C(e.invoice.periods, (n, v) => (t(), u(_, { key: v }, [
|
|
120
|
-
(t(!0), u(_, null, C(Object.entries(i(n)), ([g, B]) => (t(), u(_, { key: g }, [
|
|
121
|
-
(t(!0), u(_, null, C(B, (T, z) => (t(), r(M(e.wrapperComponent ?? "div"), { key: z }, {
|
|
122
|
-
default: a(() => [
|
|
123
|
-
l(y, {
|
|
124
|
-
"no-spacing": e.wrapperComponent !== void 0
|
|
125
|
-
}, {
|
|
126
|
-
label: a(() => [
|
|
127
|
-
m(f(c(T)), 1)
|
|
128
|
-
]),
|
|
129
|
-
value: a(() => [
|
|
130
|
-
l(p, {
|
|
131
|
-
value: T.amount_excluding_tax
|
|
132
|
-
}, null, 8, ["value"])
|
|
133
|
-
]),
|
|
134
|
-
_: 2
|
|
135
|
-
}, 1032, ["no-spacing"])
|
|
136
|
-
]),
|
|
137
|
-
_: 2
|
|
138
|
-
}, 1024))), 128))
|
|
139
|
-
], 64))), 128))
|
|
140
|
-
], 64))), 128));
|
|
141
|
-
}
|
|
142
|
-
}), H = { class: "flex flex-col" }, le = /* @__PURE__ */ h({
|
|
143
|
-
__name: "InvoicePreview",
|
|
144
|
-
props: {
|
|
145
|
-
invoice: {},
|
|
146
|
-
trialInvoice: {},
|
|
147
|
-
isCustomerFacing: { type: Boolean, default: !1 },
|
|
148
|
-
variant: { default: "default" },
|
|
149
|
-
isPaid: { type: Boolean, default: !1 },
|
|
150
|
-
collapsible: { default: void 0 },
|
|
151
|
-
isPreviewWithoutTaxes: { type: Boolean }
|
|
152
|
-
},
|
|
153
|
-
setup(e) {
|
|
154
|
-
const i = e, { $t: c } = N(), s = E(i.collapsible !== void 0 ? i.collapsible !== "expanded" : !1), o = $(() => i.collapsible !== void 0), n = $(() => !!i.trialInvoice), v = $(
|
|
155
|
-
() => i.trialInvoice ? i.trialInvoice.tax_summary.total_amount : i.invoice.tax_summary.total_amount
|
|
156
|
-
), g = () => {
|
|
157
|
-
o.value && (s.value = !s.value);
|
|
158
|
-
};
|
|
159
|
-
return (B, T) => (t(), u("div", H, [
|
|
160
|
-
l(q, {
|
|
161
|
-
"is-open": !s.value,
|
|
162
|
-
lazy: ""
|
|
163
|
-
}, {
|
|
164
|
-
default: a(() => [
|
|
165
|
-
I("div", null, [
|
|
166
|
-
n.value ? (t(), r(x, {
|
|
167
|
-
key: 0,
|
|
168
|
-
variant: "caps-heading"
|
|
169
|
-
}, {
|
|
170
|
-
default: a(() => [
|
|
171
|
-
m(f(d(c)({
|
|
172
|
-
id: "invoice_preview.after_trial_heading",
|
|
173
|
-
defaultMessage: "After trial",
|
|
174
|
-
description: "After trial heading for the invoice preview"
|
|
175
|
-
})), 1)
|
|
176
|
-
]),
|
|
177
|
-
_: 1
|
|
178
|
-
})) : b("", !0),
|
|
179
|
-
e.variant !== "without-products" ? (t(), u(_, { key: 1 }, [
|
|
180
|
-
l(R, { invoice: e.invoice }, null, 8, ["invoice"]),
|
|
181
|
-
l(S, { spacing: "xxs" })
|
|
182
|
-
], 64)) : b("", !0),
|
|
183
|
-
l(y, null, {
|
|
184
|
-
label: a(() => [
|
|
185
|
-
m(f(d(c)({
|
|
186
|
-
id: "invoice_preview.total_excluding_taxes_heading",
|
|
187
|
-
defaultMessage: "Total excluding taxes",
|
|
188
|
-
description: "Total excluding taxes heading for the invoice preview"
|
|
189
|
-
})), 1)
|
|
190
|
-
]),
|
|
191
|
-
value: a(() => [
|
|
192
|
-
l(p, {
|
|
193
|
-
value: e.invoice.tax_summary.base_amount
|
|
194
|
-
}, null, 8, ["value"])
|
|
195
|
-
]),
|
|
196
|
-
_: 1
|
|
197
|
-
}),
|
|
198
|
-
l(y, null, {
|
|
199
|
-
label: a(() => [
|
|
200
|
-
m(f(d(c)({
|
|
201
|
-
id: "invoice_preview.taxes_heading",
|
|
202
|
-
defaultMessage: "Taxes",
|
|
203
|
-
description: "Taxes heading for the invoice preview"
|
|
204
|
-
})), 1)
|
|
205
|
-
]),
|
|
206
|
-
value: a(() => [
|
|
207
|
-
e.isPreviewWithoutTaxes ? (t(), r(P, {
|
|
208
|
-
key: 0,
|
|
209
|
-
"width-class": "w-10",
|
|
210
|
-
"height-class": "h-4"
|
|
211
|
-
})) : (t(), r(p, {
|
|
212
|
-
key: 1,
|
|
213
|
-
value: e.invoice.tax_summary.tax_amount
|
|
214
|
-
}, null, 8, ["value"]))
|
|
215
|
-
]),
|
|
216
|
-
_: 1
|
|
217
|
-
}),
|
|
218
|
-
n.value ? (t(), r(y, { key: 2 }, {
|
|
219
|
-
label: a(() => [
|
|
220
|
-
m(f(d(c)({
|
|
221
|
-
id: "invoice_preview.total_including_taxes_heading",
|
|
222
|
-
defaultMessage: "Total including taxes",
|
|
223
|
-
description: "Total including taxes heading for the invoice preview"
|
|
224
|
-
})), 1)
|
|
225
|
-
]),
|
|
226
|
-
value: a(() => [
|
|
227
|
-
e.isPreviewWithoutTaxes ? (t(), r(P, {
|
|
228
|
-
key: 0,
|
|
229
|
-
"width-class": "w-10",
|
|
230
|
-
"height-class": "h-4"
|
|
231
|
-
})) : (t(), r(p, {
|
|
232
|
-
key: 1,
|
|
233
|
-
value: e.invoice.tax_summary.total_amount
|
|
234
|
-
}, null, 8, ["value"]))
|
|
235
|
-
]),
|
|
236
|
-
_: 1
|
|
237
|
-
})) : b("", !0),
|
|
238
|
-
l(S, { spacing: "xxs" })
|
|
239
|
-
])
|
|
240
|
-
]),
|
|
241
|
-
_: 1
|
|
242
|
-
}, 8, ["is-open"]),
|
|
243
|
-
(t(), r(M(o.value ? "button" : "div"), {
|
|
244
|
-
class: k({ "text-left hover:cursor-pointer": o.value }),
|
|
245
|
-
onClick: g
|
|
246
|
-
}, {
|
|
247
|
-
default: a(() => [
|
|
248
|
-
l(y, {
|
|
249
|
-
weight: "semibold",
|
|
250
|
-
variant: "body-sm"
|
|
251
|
-
}, {
|
|
252
|
-
label: a(() => [
|
|
253
|
-
m(f(e.isPaid ? d(c)({
|
|
254
|
-
id: "invoice_preview.total_paid_heading",
|
|
255
|
-
defaultMessage: "Total paid",
|
|
256
|
-
description: "Total paid heading for the invoice preview"
|
|
257
|
-
}) : d(c)({
|
|
258
|
-
id: "invoice_preview.total_due_today_heading",
|
|
259
|
-
defaultMessage: "Total due today",
|
|
260
|
-
description: "Total due today heading for the invoice preview"
|
|
261
|
-
})) + " ", 1),
|
|
262
|
-
o.value ? (t(), r(W, {
|
|
263
|
-
key: 0,
|
|
264
|
-
size: "xs",
|
|
265
|
-
icon: "keyboard_arrow_down",
|
|
266
|
-
class: k(["text-gray-400 transition ease-in-out", { "rotate-0": s.value, "rotate-180": !s.value }])
|
|
267
|
-
}, null, 8, ["class"])) : b("", !0)
|
|
268
|
-
]),
|
|
269
|
-
value: a(() => [
|
|
270
|
-
e.isPreviewWithoutTaxes && (!n.value || n.value && v.value.quantity !== "0.00") ? (t(), r(P, { key: 0 })) : (t(), r(p, {
|
|
271
|
-
key: 1,
|
|
272
|
-
value: v.value
|
|
273
|
-
}, null, 8, ["value"]))
|
|
274
|
-
]),
|
|
275
|
-
_: 1
|
|
276
|
-
})
|
|
277
|
-
]),
|
|
278
|
-
_: 1
|
|
279
|
-
}, 8, ["class"]))
|
|
280
|
-
]));
|
|
281
|
-
}
|
|
282
|
-
}), J = { class: "sv-empty-state__body flex flex-col items-center justify-center py-2" }, K = { class: "sv-empty-state__action mt-3 empty:hidden" }, ne = /* @__PURE__ */ h({
|
|
283
|
-
__name: "EmptyStatePlaceholder",
|
|
284
|
-
props: {
|
|
285
|
-
icon: { type: null }
|
|
286
|
-
},
|
|
287
|
-
setup(e) {
|
|
288
|
-
return (i, c) => (t(), r(d(L), { class: "sv-empty-state" }, {
|
|
289
|
-
default: a(() => [
|
|
290
|
-
I("div", J, [
|
|
291
|
-
l(d(W), {
|
|
292
|
-
icon: e.icon,
|
|
293
|
-
size: "md",
|
|
294
|
-
class: "sv-empty-state__icon text-gray-500"
|
|
295
|
-
}, null, 8, ["icon"]),
|
|
296
|
-
l(d(x), {
|
|
297
|
-
center: "",
|
|
298
|
-
tag: "span",
|
|
299
|
-
variant: "body-xs",
|
|
300
|
-
weight: "semibold",
|
|
301
|
-
color: "subtle",
|
|
302
|
-
class: "sv-empty-state__title mt-1"
|
|
303
|
-
}, {
|
|
304
|
-
default: a(() => [
|
|
305
|
-
w(i.$slots, "title")
|
|
306
|
-
]),
|
|
307
|
-
_: 3
|
|
308
|
-
}),
|
|
309
|
-
l(d(x), {
|
|
310
|
-
center: "",
|
|
311
|
-
tag: "span",
|
|
312
|
-
variant: "body-xs",
|
|
313
|
-
color: "subtle",
|
|
314
|
-
class: "sv-empty-state__message mt-1"
|
|
315
|
-
}, {
|
|
316
|
-
default: a(() => [
|
|
317
|
-
w(i.$slots, "message")
|
|
318
|
-
]),
|
|
319
|
-
_: 3
|
|
320
|
-
}),
|
|
321
|
-
I("div", K, [
|
|
322
|
-
w(i.$slots, "action")
|
|
323
|
-
])
|
|
324
|
-
])
|
|
325
|
-
]),
|
|
326
|
-
_: 3
|
|
327
|
-
}));
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
export {
|
|
331
|
-
ne as _,
|
|
332
|
-
le as a,
|
|
333
|
-
O as b,
|
|
334
|
-
R as c
|
|
335
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),r=require("./customElements-C963-LtW.js"),v=require("./TooltipParagraph.vue.es-Cph6zT31.js"),y=require("./useService-H7BjLg8P.js"),k=require("./getComposedString.es-haS4bAj7.js"),d=require("./Amount.vue.es-DExaYBqm.js"),h=require("./Divider.vue.es-UwnWvUTl.js"),C=require("./Expand.vue.es-BtM0EZEr.js"),p=require("./Button.vue.es-qGvnOKnK.js"),B=require("./Section.vue.es-zVXBHAL6.js"),u=e.defineComponent({__name:"invoicePreviewRow",props:{weight:{default:"normal"},variant:{default:"body-xs"},noSpacing:{type:Boolean,default:!1}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row gap-2",{"py-1.5":!t.noSpacing}])},[e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,class:"grow",weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"label")]),_:3},8,["variant","weight"]),e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"value")]),_:3},8,["variant","weight"])],2))}}),g=e.defineComponent({__name:"Skeleton",props:{widthClass:{default:"w-10"},heightClass:{default:"h-3"},shade:{default:"default"}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded",[t.widthClass,t.heightClass,{"bg-gray-50/50":t.shade==="default","bg-gray-100/50":t.shade==="dark","bg-gray-200/50":t.shade==="darker","bg-gray-400/50":t.shade==="darkest"}]])},null,2))}}),_=e.defineComponent({__name:"InvoicePreviewNoTaxesSkeleton",props:{widthClass:{default:"w-12"},heightClass:{default:"h-5"}},setup(t){const{$t:a}=r.useIntl();return(l,i)=>(e.openBlock(),e.createBlock(v._sfc_main,{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(v.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(v._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(g,{"width-class":t.widthClass,"height-class":t.heightClass,shade:"darker"},null,8,["width-class","height-class"])]),_:1}))}}),x=e.defineComponent({__name:"InvoicePreviewGroups",props:{invoice:{},wrapperComponent:{}},setup(t){const a=i=>i.groups.reduce((o,n)=>n.type in o?{...o,[n.type]:[...o[n.type],n]}:{...o,[n.type]:[n]},{}),l=i=>{var o,n,s;return(o=i.pricing)!=null&&o.name&&!y.isEmpty((n=i.pricing)==null?void 0:n.name)?i.pricing.name:k.getComposedString(((s=i.products)==null?void 0:s.map(c=>c.name))??[])};return(i,o)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.periods,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.entries(a(n)),([c,f])=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(m,w)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.wrapperComponent??"div"),{key:w},{default:e.withCtx(()=>[e.createVNode(u,{"no-spacing":t.wrapperComponent!==void 0},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(m)),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:m.amount_excluding_tax},null,8,["value"])]),_:2},1032,["no-spacing"])]),_:2},1024))),128))],64))),128))],64))),128))}}),b={class:"flex flex-col"},N=e.defineComponent({__name:"InvoicePreview",props:{invoice:{},trialInvoice:{},isCustomerFacing:{type:Boolean,default:!1},variant:{default:"default"},isPaid:{type:Boolean,default:!1},collapsible:{default:void 0},isPreviewWithoutTaxes:{type:Boolean}},setup(t){const a=t,{$t:l}=r.useIntl(),i=e.ref(a.collapsible!==void 0?a.collapsible!=="expanded":!1),o=e.computed(()=>a.collapsible!==void 0),n=e.computed(()=>!!a.trialInvoice),s=e.computed(()=>a.trialInvoice?a.trialInvoice.tax_summary.total_amount:a.invoice.tax_summary.total_amount),c=()=>{o.value&&(i.value=!i.value)};return(f,m)=>(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(C._sfc_main,{"is-open":!i.value,lazy:""},{default:e.withCtx(()=>[e.createElementVNode("div",null,[n.value?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.after_trial_heading",defaultMessage:"After trial",description:"After trial heading for the invoice preview"})),1)]),_:1})):e.createCommentVNode("",!0),t.variant!=="without-products"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(x,{invoice:t.invoice},null,8,["invoice"]),e.createVNode(h._sfc_main,{spacing:"xxs"})],64)):e.createCommentVNode("",!0),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_excluding_taxes_heading",defaultMessage:"Total excluding taxes",description:"Total excluding taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:t.invoice.tax_summary.base_amount},null,8,["value"])]),_:1}),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.taxes_heading",defaultMessage:"Taxes",description:"Taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.tax_amount},null,8,["value"]))]),_:1}),n.value?(e.openBlock(),e.createBlock(u,{key:2},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_including_taxes_heading",defaultMessage:"Total including taxes",description:"Total including taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.total_amount},null,8,["value"]))]),_:1})):e.createCommentVNode("",!0),e.createVNode(h._sfc_main,{spacing:"xxs"})])]),_:1},8,["is-open"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value?"button":"div"),{class:e.normalizeClass({"text-left hover:cursor-pointer":o.value}),onClick:c},{default:e.withCtx(()=>[e.createVNode(u,{weight:"semibold",variant:"body-sm"},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.isPaid?e.unref(l)({id:"invoice_preview.total_paid_heading",defaultMessage:"Total paid",description:"Total paid heading for the invoice preview"}):e.unref(l)({id:"invoice_preview.total_due_today_heading",defaultMessage:"Total due today",description:"Total due today heading for the invoice preview"}))+" ",1),o.value?(e.openBlock(),e.createBlock(p._sfc_main$1,{key:0,size:"xs",icon:"keyboard_arrow_down",class:e.normalizeClass(["text-gray-400 transition ease-in-out",{"rotate-0":i.value,"rotate-180":!i.value}])},null,8,["class"])):e.createCommentVNode("",!0)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes&&(!n.value||n.value&&s.value.quantity!=="0.00")?(e.openBlock(),e.createBlock(_,{key:0})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:s.value},null,8,["value"]))]),_:1})]),_:1},8,["class"]))]))}}),V={class:"sv-empty-state__body flex flex-col items-center justify-center py-2"},T={class:"sv-empty-state__action mt-3 empty:hidden"},S=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup(t){return(a,l)=>(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{class:"sv-empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(p._sfc_main$1),{icon:t.icon,size:"md",class:"sv-empty-state__icon text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",weight:"semibold",color:"subtle",class:"sv-empty-state__title mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"title")]),_:3}),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",color:"subtle",class:"sv-empty-state__message mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"message")]),_:3}),e.createElementVNode("div",T,[e.renderSlot(a.$slots,"action")])])]),_:3}))}});exports._sfc_main=S;exports._sfc_main$1=N;exports._sfc_main$2=g;exports._sfc_main$3=x;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),i=require("./Alert.vue.es-RyK53a2P.js"),c=require("./customElements-C963-LtW.js"),a={class:"grid gap-1"},l={class:"font-medium"},d={key:0},m=e.defineComponent({__name:"ErrorNotification",props:{title:{},description:{}},setup(t){const{formatMessage:o}=c.useIntl(),s=t,n=e.computed(()=>s.title??o({defaultMessage:"Something went wrong",id:"error_notification.default_error_message",description:"The default message to display"}));return(r,u)=>(e.openBlock(),e.createBlock(i._sfc_main,e.mergeProps({type:"danger"},r.$attrs),{default:e.withCtx(()=>[e.createElementVNode("div",a,[e.createElementVNode("span",l,e.toDisplayString(n.value),1),t.description?(e.openBlock(),e.createElementBlock("span",d,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])]),_:1},16))}});exports._sfc_main=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),s={class:"expand__inner"},u=e.defineComponent({__name:"Expand",props:{isOpen:{type:Boolean},lazy:{type:Boolean,default:!1},unmountOnClose:{type:Boolean}},setup(t){const l=t,a=e.ref(l.isOpen||!l.lazy);let n=null;return e.watch(()=>l.isOpen,o=>{o&&!a.value&&n===null?n=requestAnimationFrame(()=>{n=null,a.value=!0}):!o&&l.unmountOnClose&&(n!==null&&(cancelAnimationFrame(n),n=null),a.value=!1)}),e.onBeforeUnmount(()=>{n!==null&&(cancelAnimationFrame(n),n=null)}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["expand",{"expand--open":t.isOpen}])},[e.createElementVNode("div",s,[a.value?e.renderSlot(o.$slots,"default",{},void 0,void 0,0):e.createCommentVNode("",!0)])],2))}});exports._sfc_main=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),i=e.defineComponent({__name:"FormMessage",props:{message:{},variant:{default:"error"},capitalizeFirstLetter:{type:Boolean,default:!0}},setup(a){const r=a,s=e.computed(()=>{let t="text-xs";return r.variant==="default"&&(t+=" text-secondary"),r.variant==="error"&&(t+=" text-feedback-danger"),r.variant==="warning"&&(t+=" text-feedback-warning"),r.capitalizeFirstLetter&&(t+=" first-letter:capitalize"),t});return(t,o)=>typeof a.message=="object"&&!("value"in a.message)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.message,({$uid:n,$message:l})=>(e.openBlock(),e.createElementBlock("p",{key:n,class:e.normalizeClass(s.value)},e.toDisplayString(l),3))),128)):a.message||t.$slots.default?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(s.value)},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.message),1)])],2)):e.createCommentVNode("",!0)}});exports._sfc_main=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),a=require("./object.es-CdriXMPs.js"),o=require("./TooltipParagraph.vue.es-Cph6zT31.js"),i=require("./Button.vue.es-qGvnOKnK.js"),r={inheritAttrs:!1},s=e.defineComponent({...r,__name:"IconButton",props:{tooltip:{},icon:{},type:{},intent:{},size:{},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{},iconSuffix:{},tag:{},preventDoubleClick:{type:Boolean}},setup(t){const c=t,l=e.useAttrs(),n=e.computed(()=>a.omit({...c,...l},"icon","tooltip"));return(u,p)=>t.tooltip?(e.openBlock(),e.createBlock(o._sfc_main,{key:0},{tooltip:e.withCtx(()=>[e.createVNode(o.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tooltip),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(i._sfc_main,e.mergeProps(n.value,{"icon-prefix":t.icon,square:""}),null,16,["icon-prefix"])]),_:1})):(e.openBlock(),e.createBlock(i._sfc_main,e.mergeProps({key:1},n.value,{square:"","icon-prefix":t.icon}),null,16,["icon-prefix"]))}});exports._sfc_main=s;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),n=require("./slots.es-T9ZJRGtG.js"),i=require("./Button.vue.es-qGvnOKnK.js"),r=require("./Avatar.vue.es-Bm6MCMAL.js"),c=require("./customElements-C963-LtW.js"),o={class:"min-w-0 grow"},u=e.defineComponent({__name:"IconTitle",props:{title:{},subTitle:{},icon:{},variant:{default:"default"},suffix:{},size:{default:"md"},avatar:{type:Boolean,default:!1},uppercase:{type:Boolean,default:!0},resourceId:{},iconClass:{},titleClass:{}},setup(t){const l=t,a=e.computed(()=>{switch(l.variant){case"transparent":return"";case"warning":return"bg-gradient-to-br backdrop-blur-sm from-orange-600/20 to-yellow-200/20";case"neutral":return"bg-neutral-100";default:case"default":return"bg-gradient-to-br backdrop-blur-sm from-peach-100/20 to-mint-100/20"}});return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex min-w-0 items-center",{"gap-4":["md","lg"].includes(t.size),"gap-3":t.size==="sm","gap-2":t.size==="xs"&&t.variant!=="transparent","gap-1":t.size==="xs"&&t.variant==="transparent"}])},[t.icon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([[t.iconClass,{[a.value]:!0,"h-9 w-9":["md","lg"].includes(t.size),"h-8 w-8":t.size==="sm","h-6 w-6":t.size==="xs"}],"flex shrink-0 items-center justify-center rounded-md"])},[t.icon?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:0,size:["sm","xs"].includes(t.size)?"xs":"md",icon:t.icon},null,8,["size","icon"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),t.avatar&&t.title?(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{key:1,initials:t.title.slice(0,1),"color-hash":t.title,size:["sm","xs"].includes(t.size)?"lg":"xl"},null,8,["initials","color-hash","size"])):e.createCommentVNode("",!0),e.createElementVNode("div",o,[t.title||s.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([[t.titleClass,{"text-3xl":t.size==="lg","text-2xl":t.size==="md","text-base":t.size==="sm","text-xs text-subtle":t.size==="xs","text-default":t.size!=="xs",uppercase:t.size==="xs"&&t.uppercase,"font-general-sans":["md","lg"].includes(t.size)}],"flex flex-wrap items-center break-words font-semibold"])},[e.renderSlot(s.$slots,"prefix"),e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),e.renderSlot(s.$slots,"suffix",{},()=>[e.createTextVNode(e.toDisplayString(t.suffix),1)])],2)):e.createCommentVNode("",!0),t.subTitle||s.$slots.subTitle&&!e.unref(n.isVnodeEmpty)(s.$slots.subTitle({}))?(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{key:1,variant:"body-sm",color:"secondary"},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subTitle),1)])]),_:3})):e.createCommentVNode("",!0)])],2))}});exports._sfc_main=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),d=require("./cn.es-D9YMDvG2.js"),M=require("./FormMessage.vue.es-dqATjC2N.js"),g=require("./useService-H7BjLg8P.js"),w=require("./customElements-C963-LtW.js"),T={xs:"h-[22px]",sm:"h-7",md:"h-10",lg:"h-12",xl:"h-16"};function R({size:l,disabled:s,labelScreenReaderOnly:u,hasError:f,ring:i,hasShadow:v,hasFocusStyles:m,type:p,prefixHasBorder:a,wrapperClass:y,inputClass:b,prefixClass:h,suffixClass:C,isMultiline:k}){const n=e.computed(()=>(s==null?void 0:s.value)??!1),c=e.computed(()=>(p==null?void 0:p.value)==="checkbox"),x=e.computed(()=>(m==null?void 0:m.value)!==!1),t=e.computed(()=>((f==null?void 0:f.value)??!1)&&!n.value),o=e.computed(()=>l.value==="xs"||l.value==="sm"),r=e.computed(()=>({"block text-sm font-medium text-default":!0,"sr-only":u==null?void 0:u.value})),B=e.computed(()=>({"rounded border border-gray-300 overflow-hidden":!0,"cursor-not-allowed bg-gray-50 border-transparent":n.value,"bg-white":!n.value,"focus-within:border-primary-500 focus-within:outline-1 focus-within:outline focus-within:outline-primary-500":x.value,"focus-within:ring-primary-500":i==null?void 0:i.value,"shadow-sm focus-within:shadow-sm":v==null?void 0:v.value,"border-red-500 focus-within:border-red-500 focus-within:outline-red-500 focus-within:ring-red-500":t.value})),$=e.computed(()=>({"text-default placeholder:text-placeholder disabled:text-disabled disabled:placeholder:text-disabled block w-full border-0 focus:border-transparent focus:outline-0 focus:ring-0 bg-transparent":!0,"text-xs":o.value,"text-sm":!o.value,"p-2":c.value,"px-1":!c.value&&l.value==="xs","px-2":!c.value&&l.value==="sm","px-4":!c.value&&!o.value,[T[l.value]]:!c.value&&!(k!=null&&k.value),"cursor-default":n.value})),S=e.computed(()=>({"z-10 flex shrink-0 items-center":!0,"px-3":a==null?void 0:a.value,"pl-3":!(a!=null&&a.value),"border-r":a==null?void 0:a.value,"border-none":!(a!=null&&a.value),"border-red-500":(a==null?void 0:a.value)&&t.value,"border-gray-300":(a==null?void 0:a.value)&&!t.value})),V=e.computed(()=>({"align-end z-10 flex shrink-0 items-center gap-2 border-l px-2":!0,"border-red-500":t.value,"border-gray-300":!t.value,"px-1":o.value,"px-2":l.value==="md","px-3":l.value==="lg"})),E=e.computed(()=>d.cn(B.value,y==null?void 0:y.value)),q=e.computed(()=>d.cn($.value,b==null?void 0:b.value)),N=e.computed(()=>d.cn(S.value,h==null?void 0:h.value)),I=e.computed(()=>d.cn(V.value,C==null?void 0:C.value));return{wrapperClasses:E,inputClasses:q,prefixClasses:N,suffixClasses:I,labelClasses:r}}const z=["data-testid"],D={class:"relative"},F={class:"relative grow"},P=["id","disabled","type","value","name","form","placeholder","autocomplete"],U=["id","value","disabled","type","name","form","placeholder","autocomplete"],W={key:1,class:"mt-2 text-sm text-secondary"},K=e.defineComponent({__name:"Input",props:e.mergeModels({label:{default:""},labelScreenReaderOnly:{type:Boolean},disabled:{type:Boolean,default:!1},type:{default:"text"},asTextType:{type:Boolean,default:!1},size:{default:"md"},prefixClass:{},suffixClass:{},wrapperClass:{default:""},inputClass:{},rootClass:{default:""},required:{type:Boolean,default:!1},id:{},checked:{type:Boolean},value:{},hasShadow:{type:Boolean,default:!1},hasFocusStyles:{type:Boolean,default:!0},form:{},ring:{type:Boolean,default:!0},error:{},invalid:{type:Boolean},name:{},prefixHasBorder:{type:Boolean,default:!0},placeholder:{},autocomplete:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["blur"],["update:modelValue"]),setup(l){const s=l,u=e.useModel(l,"modelValue"),f=s.type==="number"&&s.asTextType,i=s.name??d.uniqueId("name"),v=t=>{f&&(u.value=t.target.value)},m=s.id??d.uniqueId(`${i}-`),p=t=>{s.type==="number"&&t.target.blur()},a=e.computed(()=>!g.isEmpty(s.error)||!!s.invalid),{wrapperClasses:y,inputClasses:b,labelClasses:h,prefixClasses:C,suffixClasses:k}=R({...e.toRefs(s),hasError:a}),n=e.ref(),c=t=>{var o;const r=t.target;r!=null&&r.closest("button, a, input, select, textarea")||(o=n.value)==null||o.focus()},x=e.computed(()=>s.size==="xs"?"body-xs":"body-sm");return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.rootClass),"data-testid":e.unref(d.getRootTestId)(e.unref(i))},[l.label?(e.openBlock(),e.createBlock(d._sfc_main,{key:0,class:e.normalizeClass(e.unref(h)),for:e.unref(m),required:l.required},e.createSlots({suffix:e.withCtx(()=>[e.unref(g.isEmpty)(l.error)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M._sfc_main,{key:0,message:l.error},null,8,["message"])),e.renderSlot(t.$slots,"label-suffix")]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label)+" ",1)]),_:2},[t.$slots.tooltip?{name:"tooltip",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip")]),key:"0"}:void 0]),1032,["class","for","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["flex",e.unref(y)])},[t.$slots.prefix?(e.openBlock(),e.createBlock(w._sfc_main,{key:0,tag:"div",variant:x.value,class:e.normalizeClass(e.unref(C))},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"prefix")]),_:3},8,["variant","class"])):e.createCommentVNode("",!0),e.createElementVNode("div",F,[e.unref(f)?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0},t.$attrs,{id:e.unref(m),ref_key:"inputElRef",ref:n,disabled:l.disabled,type:l.type,class:e.unref(b),value:u.value,name:e.unref(i),form:l.form,placeholder:l.placeholder,autocomplete:l.autocomplete??"off",onKeyup:v,onChange:v,onBlur:o[0]||(o[0]=r=>t.$emit("blur")),onWheel:p}),null,16,P)):e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1},t.$attrs,{id:e.unref(m),ref_key:"inputElRef",ref:n,"onUpdate:modelValue":o[1]||(o[1]=r=>u.value=r),value:l.type==="checkbox"?l.value:u.value,disabled:l.disabled,type:l.type,name:e.unref(i),form:l.form,class:e.unref(b),placeholder:l.placeholder,autocomplete:l.autocomplete??"off",onBlur:o[2]||(o[2]=r=>t.$emit("blur")),onWheel:p}),null,16,U)),[[e.vModelDynamic,u.value]]),e.renderSlot(t.$slots,"input")]),t.$slots.suffix?(e.openBlock(),e.createBlock(w._sfc_main,{key:1,tag:"div",variant:x.value,class:e.normalizeClass(e.unref(k)),onClick:c},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"suffix")]),_:3},8,["variant","class"])):e.createCommentVNode("",!0)],2),e.renderSlot(t.$slots,"adornment-end")]),t.$slots.helper?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"helper")])):e.createCommentVNode("",!0)],10,z))}});exports._sfc_main=K;
|