@solvimon/solvimon-web 0.1.0-alpha.21 → 0.1.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B9WTpz0k.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Co3XAxaY.js} +1 -1
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DJCMa2Lz.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs} +6 -6
- package/dist/{Avatar.vue.es-CJw5z7Uu.js → Avatar.vue.es-D42J_izE.js} +1 -1
- package/dist/{Avatar.vue.es-ChcLSNaN.mjs → Avatar.vue.es-DNJ-jexx.mjs} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CTQ5RMtx.js → BillingInformation.vue_vue_type_script_setup_true_lang-BEVkWJXT.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DApMAncl.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-D1uVidXk.mjs} +4 -4
- package/dist/{Button.vue.es-VQCd3V3C.mjs → Button.vue.es-Dz-2L8dJ.mjs} +1 -1
- package/dist/{Button.vue.es-BWl37nzm.js → Button.vue.es-M_jXZda4.js} +1 -1
- package/dist/{Checkout.entry.ce-DRHqEFd7.mjs → Checkout.entry.ce-B5-0AM67.mjs} +1298 -1225
- package/dist/Checkout.entry.ce-C52gkrNZ.js +1 -0
- package/dist/{Chip.vue.es-CXG8o1Qf.mjs → Chip.vue.es-DMK9C78d.mjs} +2 -2
- package/dist/{Chip.vue.es-DUgjuRWm.js → Chip.vue.es-G8doKsZb.js} +1 -1
- package/dist/{ContextMenu.vue.es-BllxeDTt.js → ContextMenu.vue.es-B3Rz6Ojk.js} +1 -1
- package/dist/{ContextMenu.vue.es-C6TKlSXs.mjs → ContextMenu.vue.es-CzkkNoJG.mjs} +4 -4
- package/dist/{CustomerBillingInformation.vue.es-CMCZ-lIM.js → CustomerBillingInformation.vue.es-BmtU9Pk0.js} +1 -1
- package/dist/{CustomerBillingInformation.vue.es-CKQH_ds0.mjs → CustomerBillingInformation.vue.es-Db6bN2RZ.mjs} +2 -2
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BxwllXwU.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-fESZVyPe.mjs} +5 -5
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js +1 -0
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CtaoLbrM.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DdMHG1_Y.mjs} +485 -501
- package/dist/{DividerText.vue.es-BBdydUy_.js → DividerText.vue.es-D-QxT2OD.js} +1 -1
- package/dist/{DividerText.vue.es-Bomiy4if.mjs → DividerText.vue.es-IK2fns6f.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C9elbdbF.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs} +4 -4
- package/dist/{ErrorNotification.vue.es-C6ngWAVU.mjs → ErrorNotification.vue.es-BGckEwHf.mjs} +2 -2
- package/dist/{ErrorNotification.vue.es-0ZC_DozN.js → ErrorNotification.vue.es-Cd2UKPAz.js} +1 -1
- package/dist/{IconButton.vue.es-DGLIdHkR.js → IconButton.vue.es-BTAkuFsm.js} +1 -1
- package/dist/{IconButton.vue.es-DAR7e8NA.mjs → IconButton.vue.es-C4dQEQAc.mjs} +2 -2
- package/dist/{IconTitle.vue.es-Bbusc4wK.mjs → IconTitle.vue.es-BmX68uJx.mjs} +3 -3
- package/dist/{IconTitle.vue.es-D-q6w2E-.js → IconTitle.vue.es-CmR2xoeu.js} +1 -1
- package/dist/{Input.vue.es-AY1c0Rui.mjs → Input.vue.es-BGPELaZU.mjs} +2 -2
- package/dist/{Input.vue.es-BN95nPBw.js → Input.vue.es-CTOrmrcB.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-1WjSbPEP.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CMEOOuSU.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-qiBCPY8l.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-bheNAKzK.js} +1 -1
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-Xo9BR6AD.js +1 -0
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-D99nuBRE.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-avhwysNq.mjs} +3 -3
- package/dist/{InvoiceSummary.vue.es-Bs5c2Ovx.mjs → InvoiceSummary.vue.es-BWLiwlNs.mjs} +692 -705
- package/dist/InvoiceSummary.vue.es-hpG8Tq1D.js +1 -0
- package/dist/{Modal.vue.es-Chi6_MH_.js → Modal.vue.es-BD4vUaOQ.js} +1 -1
- package/dist/{Modal.vue.es-DSkC4eMv.mjs → Modal.vue.es-B_G8NQS2.mjs} +5 -5
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-vD88j_U7.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BnilyGBO.mjs} +3 -3
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-Draz_8Ts.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-CSv-Luvz.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DVif_ME8.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DuorCFo9.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-budeR7ep.mjs → PaymentHistoryBlock-ComJzB3H.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-DGJ_PiVq.js → PaymentHistoryBlock-DSHW_eW1.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dv-3suBX.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DUN0Hf2v.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C28ofG7N.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-hjtksV2D.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-Crrhar96.mjs → PaymentIntegrationForm-CH5B6BY5.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-DqqGcEP1.js → PaymentIntegrationForm-CwfCLnKt.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C4bk0m8g.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BqYk4_T9.mjs} +3 -3
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CcEEdHQJ.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DzSQC951.js} +1 -1
- package/dist/{PaymentIntegrationFormAdyen-DM-xMcm0.mjs → PaymentIntegrationFormAdyen-DfN7cPYZ.mjs} +5 -5
- package/dist/{PaymentIntegrationFormAdyen-DronjwO3.js → PaymentIntegrationFormAdyen-Q48aDXR7.js} +1 -1
- package/dist/{PaymentIntegrationFormStripe-ybM6wirp.js → PaymentIntegrationFormStripe-BSEqarl7.js} +1 -1
- package/dist/{PaymentIntegrationFormStripe-yBm4KnpV.mjs → PaymentIntegrationFormStripe-CBsXDuhy.mjs} +4 -4
- package/dist/{PaymentMethod.vue.es-Ctw9Es1g.js → PaymentMethod.vue.es-D18g-QB4.js} +1 -1
- package/dist/{PaymentMethod.vue.es-BdMcKq8_.mjs → PaymentMethod.vue.es-DkQdPXfk.mjs} +3 -3
- package/dist/{PaymentMethodForm-C1bIGX10.mjs → PaymentMethodForm-CpIZKfPH.mjs} +1 -1
- package/dist/{PaymentMethodForm-BQ5TVHlS.js → PaymentMethodForm-DK8ntFA0.js} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-5KKkuVt5.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-C1tGJsay.mjs} +5 -5
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-V88bCeDt.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-D7fDguwa.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CnmZ9dvP.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs} +6 -6
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-B_207kq5.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js} +1 -1
- package/dist/PlanCustomizationEditor-0zCXN-cv.mjs +877 -0
- package/dist/PlanCustomizationEditor-XpofGULc.js +1 -0
- package/dist/{PricingGroupRangeInput.vue.es-Bnb-ARie.mjs → PricingGroupRangeInput.vue.es-8_5nfZDI.mjs} +4 -4
- package/dist/{PricingGroupRangeInput.vue.es-D82XvoC_.js → PricingGroupRangeInput.vue.es-QnpfHxaY.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CxMkCmti.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CGJhKKNL.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-skQMgHEL.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-t6h1j6WD.mjs} +5 -5
- package/dist/{RadioGroupExtended.vue.es-WDbo_yj1.mjs → RadioGroupExtended.vue.es-C92xlCFQ.mjs} +3 -3
- package/dist/{RadioGroupExtended.vue.es-B1YtLNKG.js → RadioGroupExtended.vue.es-Cb1iD73r.js} +1 -1
- package/dist/{Section.vue.es-DuK52y67.js → Section.vue.es-Btff-cLY.js} +1 -1
- package/dist/{Section.vue.es-By1JltGi.mjs → Section.vue.es-DQ5H7mqW.mjs} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Ct3ZNq-j.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BfvX14E3.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CS3KIkPL.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DKsunuGT.mjs} +6 -6
- package/dist/{SubscriptionSchedules-DDCjVEbG.mjs → SubscriptionSchedules-Dc0rUnnf.mjs} +1 -1
- package/dist/{SubscriptionSchedules-DEjIERyF.js → SubscriptionSchedules-pzNsego6.js} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-JAedXFzq.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Brs9qDs5.mjs} +1655 -1620
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-nmVRb6hj.js +1 -0
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DVMS4gJQ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs} +3 -3
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DiXmEjUD.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-CFmCJK8M.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BckZJtOc.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DSoNs7Xx.mjs} +7 -7
- package/dist/{TooltipParagraph.vue.es-sTgWAgcd.js → TooltipParagraph.vue.es-BaqCDjl8.js} +1 -1
- package/dist/{TooltipParagraph.vue.es-DYu2ReL7.mjs → TooltipParagraph.vue.es-CIedcXGT.mjs} +1 -1
- package/dist/{TrialChip.vue.es-Cl-9_pdr.js → TrialChip.vue.es-BzNI94k0.js} +1 -1
- package/dist/{TrialChip.vue.es-DX53r0ku.mjs → TrialChip.vue.es-DkBuMNr_.mjs} +2 -2
- package/dist/{cn.es-DjnGlmqV.mjs → cn.es-BGqYNPM3.mjs} +2 -2
- package/dist/{cn.es-CNvIP217.js → cn.es-CvmLj7KH.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +6 -6
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +9 -9
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
- package/dist/{customElements-Com2NiGU.mjs → customElements-CSE7dwUr.mjs} +312 -282
- package/dist/{customElements-Bt8PbjIn.js → customElements-Vox1PB6G.js} +42 -18
- package/dist/{customer-CKgMJEgv.mjs → customer-5krPxZ8i.mjs} +1 -1
- package/dist/{customer-Q4JGfVfq.js → customer-Dsq-Moea.js} +1 -1
- package/dist/{de-DE-DqLD4IX2.js → de-DE-BSlbAnPE.js} +1 -1
- package/dist/{de-DE-Ds_yJLS3.js → de-DE-C3DzP1nj.js} +1 -1
- package/dist/{de-DE-DBO5f-Eu.mjs → de-DE-DXsG-vXA.mjs} +13 -8
- package/dist/{de-DE-CVCmzlNH.mjs → de-DE-DsFtpLsx.mjs} +2 -0
- package/dist/{en-US-CvFmmI_O.js → en-US-9xdcz3T5.js} +1 -1
- package/dist/{en-US-3UmnS23B.mjs → en-US-C939IZ5i.mjs} +13 -8
- package/dist/{en-US-DVR9O7b_.mjs → en-US-DvkvbV0p.mjs} +2 -0
- package/dist/{en-US-C51ILrVv.js → en-US-X_pSFsNm.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{invoices-CV9iAUHf.mjs → invoices-DRgfpkJ6.mjs} +8 -5
- package/dist/invoices-xOV2YaEV.js +1 -0
- package/dist/{it-IT-CxBRisRm.mjs → it-IT-BxpwB3oJ.mjs} +8 -3
- package/dist/it-IT-DT3rfjOY.js +1 -0
- package/dist/{it-IT-CDMnnFKZ.mjs → it-IT-TE7oqvXa.mjs} +2 -0
- package/dist/{it-IT-Dxw59eR_.js → it-IT-YBtHAao1.js} +1 -1
- package/dist/{nl-NL-Btbfd9p2.js → nl-NL-C8wnyKju.js} +1 -1
- package/dist/nl-NL-DfkhOJKc.js +1 -0
- package/dist/{nl-NL-o3UvtSNg.mjs → nl-NL-Di3-JArV.mjs} +2 -0
- package/dist/{nl-NL-BWGkVweu.mjs → nl-NL-na2I4aiP.mjs} +8 -3
- package/dist/{paymentMethods-ChWAwDSF.js → paymentMethods-CRDIw9lz.js} +1 -1
- package/dist/{paymentMethods-BuwoJ1y9.mjs → paymentMethods-PmkHYomw.mjs} +1 -1
- package/dist/{payments-C_cMXQzE.mjs → payments-Dvqh6CGW.mjs} +1 -1
- package/dist/{payments-DGckugN0.js → payments-jAgXhdp_.js} +1 -1
- package/dist/pricingItemConfigs.es-D4aYkYcf.js +1 -0
- package/dist/{pricingItemConfigs.es-DMf1e6y7.mjs → pricingItemConfigs.es-ORxsk_YS.mjs} +23 -22
- package/dist/pricingPlanSchedule-BM8vsKkV.js +1 -0
- package/dist/pricingPlanSchedule-BPrS2WRd.mjs +132 -0
- package/dist/screens/Checkout/Checkout.cjs +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +11 -11
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +13 -13
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +9 -9
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +20 -20
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +19 -19
- package/dist/{subscription-CvfAEJeP.mjs → subscription-CrVOr5MF.mjs} +1 -1
- package/dist/{subscription-9GORG-Gt.js → subscription-ZA62t4E9.js} +1 -1
- package/dist/{subscriptions-B5VqRayX.mjs → subscriptions-XDyI2Cqm.mjs} +1 -1
- package/dist/{subscriptions-X0Ciw8z3.js → subscriptions-fJcj88X9.js} +1 -1
- package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +1 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +1 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +6 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +6 -0
- package/dist/types/composables/useInvoicePreview.types.d.ts +1 -0
- package/dist/types/public/components/Invoice/Invoice.types.d.ts +1 -1
- package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +1 -1
- package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +1 -1
- package/dist/{useActionDispatchProvider-e2lQXTid.mjs → useActionDispatchProvider-B8-oycQk.mjs} +1 -1
- package/dist/{useActionDispatchProvider-B54GYEY7.js → useActionDispatchProvider-CNAuaHdm.js} +1 -1
- package/dist/{useCustomer-CC9zxV6c.mjs → useCustomer-CP8eWUZV.mjs} +1 -1
- package/dist/{useCustomer-BJwJ9BkJ.js → useCustomer-DSx-wN-6.js} +1 -1
- package/dist/useCustomerFormLabels-DW6jnDYH.mjs +968 -0
- package/dist/useCustomerFormLabels-TVTgy0MT.js +1 -0
- package/dist/{useExperimentalFeature-B0IFn3Uw.mjs → useExperimentalFeature-BvE_EOX-.mjs} +1 -1
- package/dist/{useExperimentalFeature-8Mzpj5wc.js → useExperimentalFeature-CC-DrIcL.js} +1 -1
- package/dist/{useInvoiceData-Bblwdl0f.js → useInvoiceData-CRRPdXc6.js} +1 -1
- package/dist/{useInvoiceData-6mHUZC9a.mjs → useInvoiceData-D8ds05CX.mjs} +2 -2
- package/dist/{useInvoicesList-_U1-tn9_.js → useInvoicesList-DIfQcvER.js} +1 -1
- package/dist/{useInvoicesList-B5H5JfvY.mjs → useInvoicesList-SJU5YWBQ.mjs} +7 -7
- package/dist/{useLoadInitialData-CezlvhBV.js → useLoadInitialData-DsabgMLZ.js} +1 -1
- package/dist/{useLoadInitialData-ux_wpNiR.mjs → useLoadInitialData-MUljS38K.mjs} +1 -1
- package/dist/{usePaymentMethodAvailability-DRwrBdto.js → usePaymentMethodAvailability-Bt7P9InI.js} +1 -1
- package/dist/{usePaymentMethodAvailability-CkR4TwoV.mjs → usePaymentMethodAvailability-D0NUanyF.mjs} +4 -4
- package/dist/{usePaymentMethodOptions-BfnLBZOo.mjs → usePaymentMethodOptions-B7JYkGsw.mjs} +1 -1
- package/dist/{usePaymentMethodOptions-B6GIM9q4.js → usePaymentMethodOptions-cT1o-BA1.js} +1 -1
- package/dist/{usePaymentMethods-C3QfLSrP.mjs → usePaymentMethods-CpzqXQUT.mjs} +1 -1
- package/dist/{usePaymentMethods-GFmQRp0X.js → usePaymentMethods-DNVw2eVg.js} +1 -1
- package/dist/{usePayments-SQF_V7oL.js → usePayments-D9Eo-uBk.js} +1 -1
- package/dist/{usePayments-BkwGyZT0.mjs → usePayments-Gx9kBvNB.mjs} +6 -6
- package/dist/{usePortal-DDG9b6FI.mjs → usePortal-3VCZwSUE.mjs} +1 -1
- package/dist/{usePortal-BdM7hDge.js → usePortal-DsebXdhx.js} +1 -1
- package/dist/{useSubscription-BJJYHYgr.mjs → useSubscription-DnL1wVh1.mjs} +1 -1
- package/dist/{useSubscription-Q4C2DPhw.js → useSubscription-K_gP9TeX.js} +1 -1
- package/dist/{useTimePeriod.es-pepm2TpV.js → useTimePeriod.es-CmltiTE-.js} +1 -1
- package/dist/{useTimePeriod.es-9tZvAhyb.mjs → useTimePeriod.es-DMtKzcoB.mjs} +1 -1
- package/dist/wallets.es-CNIMW5ay.js +1 -0
- package/dist/wallets.es-eH2C2ygn.mjs +102 -0
- package/package.json +1 -1
- package/dist/Checkout.entry.ce-BTVuGyNq.js +0 -1
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C_yKvYtG.js +0 -1
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-BXTInmf9.js +0 -1
- package/dist/InvoiceSummary.vue.es-B0MPR0oI.js +0 -1
- package/dist/PlanCustomizationEditor-CCOTD6Qu.mjs +0 -769
- package/dist/PlanCustomizationEditor-CiZnVCM6.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BlX0W6lw.js +0 -1
- package/dist/invoices-CvpL4rv5.js +0 -1
- package/dist/it-IT-CFEfSpPH.js +0 -1
- package/dist/nl-NL-jtVgF3jx.js +0 -1
- package/dist/pricingItemConfigs.es-DlybwIh1.js +0 -1
- package/dist/pricingPlanSchedule-COfmWv_o.js +0 -1
- package/dist/pricingPlanSchedule-J1nb9pCu.mjs +0 -129
- package/dist/useCustomerFormLabels-72Pxw8X5.js +0 -1
- package/dist/useCustomerFormLabels-V2YuYMLU.mjs +0 -930
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),S=require("./customElements-Bt8PbjIn.js"),nt=require("./useTimePeriod.es-pepm2TpV.js"),ee=require("./formatting.es-C72Nsrmh.js"),te=require("./Button.vue.es-BWl37nzm.js"),Et=require("./ErrorNotification.vue.es-0ZC_DozN.js"),Pt=require("./countryData.es-C4jHBzfo.js"),Dt=require("./subscriptions-X0Ciw8z3.js"),ue=require("./error-CmduqgVq.js"),ot=require("./TrialChip.vue.es-Cl-9_pdr.js"),xt=require("./useService-H7BjLg8P.js"),kt=require("./invoices-CvpL4rv5.js"),ae=require("./pricingPlanSchedule-COfmWv_o.js"),oe=require("./index-DwueOtPi.js"),be=require("./useCustomerFormLabels-72Pxw8X5.js"),wt=require("./useWatchDebounced-CAU1WI1P.js"),St=require("./usePaymentMethodOptions-B6GIM9q4.js"),ve=require("./subscription-9GORG-Gt.js"),it=require("./pricing-BVAld27Y.js"),de=require("./url-BNKStNY9.js"),ye=require("./adyen-Druit6gz.js"),Tt=require("./usePortal-BdM7hDge.js"),Lt=require("./getCountryNameByCode.es-Xxc0nZsH.js"),Qe=require("./Expand.vue.es-BtM0EZEr.js"),ie=require("./Input.vue.es-BN95nPBw.js"),ne=require("./Section.vue.es-DuK52y67.js"),Bt=require("./IconButton.vue.es-DGLIdHkR.js"),Ot=require("./customer-Q4JGfVfq.js"),pe=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js"),ke=require("./TooltipParagraph.vue.es-sTgWAgcd.js"),Vt=require("./PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js"),He=require("./Chip.vue.es-DUgjuRWm.js"),at=require("./SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Ct3ZNq-j.js"),zt=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js"),rt=require("./useViewport-hPRVDWCm.js"),le=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),jt=require("./DividerText.vue.es-BBdydUy_.js"),Ce=require("./adyenSdk-BP2XXzeJ.js"),Rt=require("./payments-DGckugN0.js"),$t=require("./ContentWithAsideLayout-C6yMIVJF.js"),Ut=require("./cn.es-CNvIP217.js"),Ft=require("./component-B7ZDyqBp.js"),Gt={AT:"Austria",BE:"Belgium",BG:"Bulgaria",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",FR:"France",GR:"Greece",HR:"Croatia",HU:"Hungary",IE:"Ireland",IT:"Italy",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SE:"Sweden",SI:"Slovenia",SK:"Slovakia"};function lt(t){return Object.keys(Gt).includes(t)}function Ze(t,n){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,i)}return o}function _e(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};n%2?Ze(Object(o),!0).forEach(function(i){Yt(t,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Ze(Object(o)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(o,i))})}return t}function Yt(t,n,o){return n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function Ne(t){return typeof t=="function"}function Se(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Ae(t){return Ne(t.$validator)?_e({},t):{$validator:t}}function st(t){return typeof t=="object"?t.$valid:t}function ct(t){return t.$validator||t}function Kt(t,n){if(!Se(t))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof t}`);if(!Se(n)&&!Ne(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Ae(n);return o.$params=_e(_e({},o.$params||{}),t),o}function qt(t,n){if(!Ne(t)&&typeof e.unref(t)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof t}`);if(!Se(n)&&!Ne(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Ae(n);return o.$message=t,o}function Qt(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const o=Ae(t);return _e(_e({},o),{},{$async:!0,$watchTargets:n})}function Ht(t){return{$validator(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return e.unref(n).reduce((l,s,_)=>{const p=Object.entries(s).reduce((N,g)=>{let[v,M]=g;const c=t[v]||{},C=Object.entries(c).reduce((m,A)=>{let[b,I]=A;const T=ct(I).call(this,M,s,_,...i),u=st(T);if(m.$data[b]=T,m.$data.$invalid=!u||!!m.$data.$invalid,m.$data.$error=m.$data.$invalid,!u){let P=I.$message||"";const z=I.$params||{};typeof P=="function"&&(P=P({$pending:!1,$invalid:!u,$params:z,$model:M,$response:T})),m.$errors.push({$property:v,$message:P,$params:z,$response:T,$model:M,$pending:!1,$validator:b})}return{$valid:m.$valid&&u,$data:m.$data,$errors:m.$errors}},{$valid:!0,$data:{},$errors:[]});return N.$data[v]=C.$data,N.$errors[v]=C.$errors,{$valid:N.$valid&&C.$valid,$data:N.$data,$errors:N.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:l.$valid&&p.$valid,$data:l.$data.concat(p.$data),$errors:l.$errors.concat(p.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:o}=n;return o?o.$errors.map(i=>Object.values(i).map(a=>a.map(l=>l.$message)).reduce((a,l)=>a.concat(l),[])):[]}}}const ut=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(t==null)return!1;if(t===!1)return!0;if(t instanceof Date)return!isNaN(t.getTime());if(typeof t=="object"){for(let n in t)return!0;return!1}return!!String(t).length},Zt=t=>(t=e.unref(t),Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:String(t).length);function se(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return i=>(i=e.unref(i),!ut(i)||n.every(a=>(a.lastIndex=0,a.test(i))))}var Xt=Object.freeze({__proto__:null,forEach:Ht,len:Zt,normalizeValidatorObject:Ae,regex:se,req:ut,unwrap:e.unref,unwrapNormalizedValidator:ct,unwrapValidatorResponse:st,withAsync:Qt,withMessage:qt,withParams:Kt});se(/^[a-zA-Z]*$/);se(/^[a-zA-Z0-9]*$/);se(/^\d*(\.\d+)?$/);const Wt=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;se(Wt);const Jt=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;se(Jt);se(/(^[0-9]*$)|(^-[0-9]+$)/);se(/^[-]?\d*(\.\d+)?$/);function Ee(t){return!!Pt.countryData.find(n=>n.key===t)}const dt={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},en=t=>!t||typeof t!="string"||t.trim()===""?!0:Object.values(dt).some(n=>n.regex.test(t)),tn=({$model:t})=>{if(!t||typeof t!="string"||t.trim()==="")return"";const n=e.inject(S.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,i=Object.values(dt).find(a=>t.toUpperCase().startsWith(a.prefix.toUpperCase()));return i?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:i.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},Te=Xt.withMessage(tn,en),nn="preview",on="NL",pt=t=>{var n,o;if("organization"in t)return(n=t.organization)==null?void 0:n.registered_address;if("individual"in t)return(o=t.individual)==null?void 0:o.residential_address},an=t=>{const n=pt(t);return{...(n==null?void 0:n.line1)&&{line1:n.line1},...(n==null?void 0:n.line2)&&{line2:n.line2},...(n==null?void 0:n.city)&&{city:n.city},...(n==null?void 0:n.state)&&{state:n.state},country:(n==null?void 0:n.country)||on,...(n==null?void 0:n.postal_code)&&{postal_code:n.postal_code}}},rn=t=>{var i,a;const n=an(t),o=t.type??"INDIVIDUAL";if(o==="ORGANIZATION"){const l="organization"in t?t.organization:void 0,s=(a=(i=l==null?void 0:l.tax_ids)==null?void 0:i[0])==null?void 0:a.id;return{type:o,organization:{legal_name:(l==null?void 0:l.legal_name)||nn,registered_address:n,...s&&{tax_id:Te.$validator(s,{},{})?s:void 0}}}}return{type:o,individual:{residential_address:n}}},ln={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},sn=t=>{if(t)return ln[t]},mt=({country:t,pricingCurrencySettings:n,fallbackCurrency:o})=>{const i=sn(t),a=(n==null?void 0:n.pricing_currencies)??[];return i&&a.includes(i)?i:(n==null?void 0:n.default_pricing_currency)??o??i},cn=()=>{const{getInvoicePreview:t}=kt.createInvoicesService(),n=S.useLogger(),o=e.ref(),i=e.ref(),a=e.ref(),l=e.ref({}),s=e.ref(ue.ApiStatus.Initial),_=e.ref({}),p=e.ref(),N=v=>`${v.type}:${v.value}`;return{loadInvoicePreview:async({subscription:v,subscriptionStartAt:M,customer:c={},seatsValues:C,enabledPricingIds:m,promotionCode:A})=>{var r,d,h,D,x,j;const b=rn(c);s.value=ue.ApiStatus.Loading;const I=ae.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,type:"DEFAULT"}),O=(r=I==null?void 0:I.pricing_plan_version)==null?void 0:r.pricing_currency_settings,T=(((d=O==null?void 0:O.pricing_currencies)==null?void 0:d.length)??0)>1,u=((D=(h=I==null?void 0:I.pricing_plan_version)==null?void 0:h.billing_period_settings)==null?void 0:D.billing_periods)??[],P=u.length>1,z=u.length>0?u.map(({period:L})=>L):v.billing_period?[v.billing_period]:[],Y=mt({country:(x=pt(c))==null?void 0:x.country,pricingCurrencySettings:O,fallbackCurrency:v.billing_currency});if(!z.length){n.warn("INVOICE_PREVIEW_SKIPPED","No billing period to preview an invoice for",{subscriptionId:v.id}),s.value=ue.ApiStatus.Done;return}const f=v.billing_period?N(v.billing_period):N(z[0]),y=z.map(async L=>{var B;const K=N(L),F=ae.getScheduleCustomizations({enabledPricings:m==null?void 0:m.map(R=>({pricing_id:R})),seatsValues:C,pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,pricingCurrency:T?Y:void 0,billingPeriod:P?L:void 0})??[];if(A){const R=(B=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:$})=>$.type==="DEFAULT"))==null?void 0:B.id;if(R){const $=F.find(({pricing_plan_schedule_id:Q})=>Q===R);$?$.promotion_codes=[A]:F.push({pricing_plan_schedule_id:R,promotion_codes:[A]})}}const G={pricingPlanSubscriptionId:v.id,startAt:M,customizations:F,customer:b},q=_.value[K];if(q&&xt.isEqual(G,q))return{periodKey:K,response:void 0};_.value={..._.value,[K]:G};const H=await t(G);return{periodKey:K,response:H}});try{const L={...l.value},K=await Promise.all(y),F=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:q})=>q.type==="TRIAL"),G=(j=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:q})=>q.type==="DEFAULT"))==null?void 0:j.id;K.forEach(({periodKey:q,response:H})=>{var $;if(!H)return;p.value=($=H.invoice_infos.at(-1))==null?void 0:$.pricing_plan_schedule_id,F&&(i.value=H.first_invoice,F.start_at&&F.end_at&&(o.value=ot.convertDateRangeToTimePeriod(new Date(F.start_at),new Date(F.end_at))));const B=H.invoice_infos.find(({pricing_plan_schedule_id:Q})=>Q===G),R=B==null?void 0:B.invoices[0];R&&(L[q]=R)}),l.value=L,a.value=L[f]}catch(L){throw s.value=ue.ApiStatus.Failed,n.error("INVOICE_PREVIEW_FAILED","Failed to load invoice preview",{},L),L}finally{s.value=ue.ApiStatus.Done}},invoicePreview:a,invoicePreviewByBillingPeriod:l,trialInvoicePreview:i,trialPeriod:o,lastPreviewScheduleId:p,isPending:e.computed(()=>s.value===ue.ApiStatus.Loading)}},Xe=["email","country"],gt="GENERIC_TAX_ID",We={US:["addressLine1","postalCode"],CA:["state"]},un=t=>!t||!We[t]?Xe:[...We[t],...Xe],Je=t=>{const n={...t.addressLine1&&{line1:t.addressLine1},...t.addressLine2&&{line2:t.addressLine2},...t.city&&{city:t.city},...t.state&&{state:t.state},...t.postalCode&&{postal_code:t.postalCode},country:t.country??""};return t.type==="ORGANIZATION"?{type:"ORGANIZATION",organization:{legal_name:t.companyLegalName??"",registered_address:n,...t.companyVatNumber&&{tax_ids:[{id:t.companyVatNumber,type:gt}]}}}:{type:"INDIVIDUAL",individual:{residential_address:n}}};function dn(){return{getGeoLocation(){return fetch("https://api.country.is/").then(t=>t.json())}}}function pn({initialState:t,onRequiredFieldChange:n}){const o=e.ref(Ie(t)),i=e.ref(Ie(t)),a=g=>{const v=Ie({...e.toRaw(o.value),...g});o.value=v,i.value=structuredClone(v)},l=e.computed(()=>un(o.value.country)),s=g=>l.value.includes(g),_=oe.useValidation({email:{required:oe.required,email:oe.email},country:{required:oe.required},state:{required:oe.requiredIf(()=>s("state"))},addressLine1:{required:oe.requiredIf(()=>s("addressLine1"))},postalCode:{required:oe.requiredIf(()=>s("postalCode"))},companyLegalName:oe.requiredIf(o.value.type==="ORGANIZATION"),companyVatNumber:{taxId:Te}},o),p=g=>{g||dn().getGeoLocation().then(({country:v})=>{o.value.country=v})},N=(g,v)=>{const M=be.objectDiff({from:v,to:g}),c=Object.keys(M).find(mn);if(c){if(["type","companyVatNumber"].includes(c)){n(g);return}if(c==="seatsValues"){n(g);return}if(c==="enabledPricingIds"){n(g);return}if(c!=="email"&&s(c)){n(g);return}}};return e.onMounted(async()=>{await p(t==null?void 0:t.country)}),wt.useWatchDebounced(()=>JSON.parse(JSON.stringify(o.value)),N,{debounce:200}),{form:o,validation:_,getIsFieldRequired:s,updateInitialState:a,initialState:i}}const Ie=(t={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,enabledPricingIds:void 0,...t});function mn(t){return t in Ie()}function gn(t,n=void 0){const o=n??[],i=ve.getPricingGroupsFromExtendedPricingPlanSubscription(t);for(const a of i)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(a.selection_constraint)){const l=a.pricings.map(s=>s.id);if(n!=null&&n.some(s=>l.includes(s)))continue;o.push(a.pricings[0].id)}return o}function fn(t){return ve.getPricingGroupsFromExtendedPricingPlanSubscription(t).some(o=>o.selection_constraint==="EXACTLY_ONE"||o.selection_constraint==="AT_LEAST_ONE")}function yn(t){const n=it.getAllPricingsFromScheduleInfos(t.pricing_plan_schedule_infos),o=ve.getPricingGroupsFromExtendedPricingPlanSubscription(t);return n.some(i=>i.product_type==="ADDON")||o.some(i=>i.object_type==="ADDON")}const ft="1",et=t=>(t??[]).flatMap(n=>n.configs??[]),vn=t=>[...t.configs??[],...et(t.billing_period_configs),...(t.pricing_currency_configs??[]).flatMap(n=>[...n.configs??[],...et(n.billing_period_configs)])];function _n(t){const n=it.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(vn);return new Map(n.flatMap(o=>{var i;return(i=o.default_seats_value)!=null&&i.number?[[o.id,o.default_seats_value.number]]:[]}))}function hn(t){var i;const n=(i=t==null?void 0:t.pricing_plan_schedule)==null?void 0:i.seats_values;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?_n(t):new Map;return n.map(({pricing_item_config_id:a,number:l})=>({pricing_item_config_id:a,number:l||o.get(a)||ft}))}const we="solvimon_checkout_redirect_state";function Mn({initialCountry:t,initialEmail:n,subscriptionId:o,enabledPricingIds:i}){const a=S.useLogger(),l=(()=>{if(t){if(Ee(t))return t;a.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${t}"`)}})(),s=(()=>{if(n){if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return n;a.error("INVALID_EMAIL",`invalid email provided: "${n}"`)}})(),_=e.ref(!1),p=e.ref(),{getSubscription:N}=Dt.createSubscriptionsService(),g=cn(),v=e.computed(()=>p.value&&u.form.value.country&&Y.value),{paymentMethodOptions:M,get:c,isPending:C,error:m}=St.usePaymentMethodOptions(),A=async(y,r)=>{try{await c({subscriptionId:p.value.id,country:y,amount:r})}catch{a.error("PAYMENT_METHOD_OPTIONS_LOAD_FAILED","Failed to load the payment methods the checkout can offer",{},m.value)}},b=e.computed(()=>m.value!==null),I=()=>{const{country:y}=u.form.value;!p.value||!y||!Y.value||A(y,Y.value)},O=()=>{const y=u.form.value;return g.loadInvoicePreview({subscription:p.value,customer:Je(y),seatsValues:y.seatsValues,enabledPricingIds:y.enabledPricingIds??i,promotionCode:y.promotionCode})},T=async y=>{const r=y.promotionCode??u.form.value.promotionCode,d=y.enabledPricingIds??u.form.value.enabledPricingIds,h={...u.form.value,...y};return await g.loadInvoicePreview({subscription:p.value,customer:Je(h),seatsValues:h.seatsValues,enabledPricingIds:d,promotionCode:r}),{trialInvoicePreview:g.trialInvoicePreview.value,invoicePreview:g.invoicePreview.value}},u=pn({initialState:{country:l,email:s},onRequiredFieldChange:()=>{p.value&&O().catch(()=>{})}}),P=async()=>{var D,x,j,L;const y=await N({id:o,expanded:!0}),r=ae.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:y.pricing_plan_schedule_infos,type:"DEFAULT"}),d=(L=(j=(x=(D=r==null?void 0:r.pricing_plan_version)==null?void 0:D.billing_period_settings)==null?void 0:x.billing_periods)==null?void 0:j[0])==null?void 0:L.period;p.value={...y,billing_period:d??y.billing_period};const h=hn(r);u.updateInitialState({...u.form.value,enabledPricingIds:gn(y,i),...h?{seatsValues:h}:{}})},z=e.computed(()=>{var G,q,H,B,R,$,Q,Z,X;const y=u.form.value.firstName||u.form.value.infix||u.form.value.lastName?{...u.form.value.firstName?{first_name:u.form.value.firstName}:{},...u.form.value.infix?{infix:u.form.value.infix}:{},...u.form.value.lastName?{last_name:u.form.value.lastName}:{}}:{},r={...u.form.value.addressLine1&&{line1:u.form.value.addressLine1},...u.form.value.addressLine2&&{line2:u.form.value.addressLine2},...u.form.value.city&&{city:u.form.value.city},...u.form.value.postalCode&&{postal_code:u.form.value.postalCode},...u.form.value.state&&{state:u.form.value.state},country:u.form.value.country??""},d=ae.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((G=p.value)==null?void 0:G.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),h=(q=d==null?void 0:d.pricing_plan_version)==null?void 0:q.pricing_currency_settings,D=(((H=h==null?void 0:h.pricing_currencies)==null?void 0:H.length)??0)>1,j=(((R=(B=d==null?void 0:d.pricing_plan_version)==null?void 0:B.billing_period_settings)==null?void 0:R.billing_periods)??[]).length>1,L=ae.getScheduleCustomizations({enabledPricings:($=u.form.value.enabledPricingIds)==null?void 0:$.map(W=>({pricing_id:W})),seatsValues:u.form.value.seatsValues,pricingPlanScheduleInfos:((Q=p.value)==null?void 0:Q.pricing_plan_schedule_infos)??[],pricingCurrency:D?(Z=p.value)==null?void 0:Z.billing_currency:void 0,billingPeriod:j?(X=p.value)==null?void 0:X.billing_period:void 0}),K=u.form.value.promotionCode,F=K&&p.value?(()=>{var he,ge,Me;const W=L?[...L]:[],re=((he=W[0])==null?void 0:he.pricing_plan_schedule_id)??((Me=ae.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((ge=p.value)==null?void 0:ge.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))==null?void 0:Me.id);if(!re)return L;const me=W.find(({pricing_plan_schedule_id:J})=>J===re);if(me)me.promotion_codes=[K];else{const J=L==null?void 0:L[0];W.push({pricing_plan_schedule_id:re,...(J==null?void 0:J.enabled_pricings)&&{enabled_pricings:J.enabled_pricings},...(J==null?void 0:J.seats_values)&&{seats_values:J.seats_values},promotion_codes:[K]})}return W})():L;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:o,...F&&{pricing_plan_schedule_customizations:F},customer_details:{email:u.form.value.email??"",type:u.form.value.type,...u.form.value.type==="INDIVIDUAL"?{individual:{residential_address:r,...y?{name:y}:{}}}:{organization:{registered_address:r,legal_name:u.form.value.companyLegalName??"",...u.form.value.companyVatNumber&&Te.$validator(u.form.value.companyVatNumber,{},{})?{tax_ids:[{id:u.form.value.companyVatNumber,type:gt}]}:{}}}}}}}),Y=e.computed(()=>{var y,r;return((y=g.trialInvoicePreview.value)==null?void 0:y.invoice_amount_including_tax)??((r=g.invoicePreview.value)==null?void 0:r.invoice_amount_including_tax)});e.watch([()=>u.form.value.country,Y],([y,r])=>{!p.value||!y||!r||A(y,r)});function f(){sessionStorage.setItem(we,JSON.stringify(u.form.value))}return e.onMounted(async()=>{const y=de.getQueryParam("redirect_status"),r=!!de.getQueryParam(ye.PAYMENT_ACCEPTOR_ID_QUERY_STRING),d=!!de.getQueryParam("payment_intent_client_secret")||!!de.getQueryParam("setup_intent_client_secret");y==="succeeded"&&r&&d&&(_.value=!0);const D=sessionStorage.getItem(we);let x=null;if(D)try{x=JSON.parse(D)}catch{}x&&u.updateInitialState(x);try{await P()}catch(j){throw a.error("SUBSCRIPTION_LOAD_FAILED","Failed to load the subscription the checkout prices",{},j),j}try{await O()}catch{}x&&(u.updateInitialState(x),sessionStorage.removeItem(we))}),e.watch(v,y=>{y&&I()},{once:!0}),{validatedEmail:s,validatedCountry:l,invoicePreview:g.invoicePreview,invoicePreviewByBillingPeriod:g.invoicePreviewByBillingPeriod,trialInvoicePreview:g.trialInvoicePreview,trialPeriod:g.trialPeriod,loadInvoicePreview:O,updateInvoicePreviewOnBillingInformationChange:T,lastPreviewScheduleId:g.lastPreviewScheduleId,paymentMethodOptions:M,hasPaymentMethodOptionsError:b,retryPaymentMethodOptions:I,isPaymentMethodsPending:C,isInvoicePreviewPending:g.isPending,subscription:p,checkoutForm:u,authorizationContext:z,isPaid:_,amount:Y,saveFormStateForRedirect:f}}function bn({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:n,formatErrorMessage:o,onInvalidPromotionCode:i,onApplyError:a}){const l=S.useLogger(),s=e.ref(!1),_=e.ref(null),p=(M,c)=>{_.value=o?o({action:M,error:c}):M==="apply"?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},N=M=>In(M)&&M.field==="promotion_codes",g=async M=>{const c=M==null?void 0:M.trim();if(c){_.value=null,t.form.value.promotionCode=c,s.value=!0;try{await n({promotionCode:c})}catch(C){l.capture(C,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),p("apply",C),a==null||a(),N(C)&&(i==null||i()),await v({suppressError:!0,preserveErrorMessage:!0})}finally{s.value=!1}}},v=async({suppressError:M=!1,preserveErrorMessage:c=!1}={})=>{c||(_.value=null),delete t.form.value.promotionCode,s.value=!0;try{await n({})}catch(C){l.capture(C,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),M||p("remove",C)}finally{s.value=!1}};return{applyPromotionCode:g,removePromotionCode:v,isPromotionCodePending:s,promotionCodeErrorMessage:_}}function In(t){return typeof t=="object"&&t!==null&&"field"in t}function Nn({subscription:t,promotionCode:n,appliedPromotionCode:o,applyPromotionCode:i}){e.watch(t,a=>{a&&n&&(o.value=n,i(n))},{once:!0})}const Cn={class:"flex items-center gap-2"},An=e.defineComponent({__name:"TaxIDCheckNotice",props:{taxIdValidationResult:{type:Object}},setup(t){const n=t,{formatMessage:o}=S.useIntl(),i=e.computed(()=>n.taxIdValidationResult.valid==="VALID"),a=e.computed(()=>i.value?o({defaultMessage:"VAT number is valid.",id:"tax_check.valid_vat_number",description:"The message shown when the VAT number is valid"}):o({defaultMessage:"VAT number is invalid.",id:"tax_check.invalid_vat_number",description:"The message shown when the VAT number is invalid"}));return(l,s)=>(e.openBlock(),e.createBlock(e.unref(Bt._sfc_main),{type:i.value?"success":"danger",icon:!1},{default:e.withCtx(()=>[e.createElementVNode("div",Cn,[e.createVNode(e.unref(S._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1})])]),_:1},8,["type"]))}});function En(t){const{checkTaxID:n}=Ot.createCustomerService(),o=e.ref(void 0),i=e.computed(()=>{var v;return((v=t.value.companyVatNumber)==null?void 0:v.trim())??""}),a=e.computed(()=>t.value.companyLegalName??""),l=e.computed(()=>t.value.country),s=e.ref(!1),_=e.computed(()=>lt(l.value??"")),p=e.computed(()=>!!(i.value&&a.value&&l.value)),N=e.computed(()=>_.value&&i.value);async function g(){var v;if(!(!p.value||!_.value||!l.value)){s.value=!0;try{const M=await n({type:"ORGANIZATION",organization:{legal_name:a.value,tax_ids:[{id:i.value,type:"GENERIC_TAX_ID"}],registered_address:{country:l.value}}});(v=M==null?void 0:M.data)!=null&&v.length?o.value=M.data[0]:o.value=void 0}finally{s.value=!1}}}return{runTaxIDCheck:g,taxIdValidationData:o,isTaxIDCheckPending:s,isTaxIDCheckEnabled:p,showViesCheckNotice:N,isSelectedCountryEU:_}}const Pn={class:"grid grid-cols-1 gap-1"},Dn={class:"grid grid-cols-1 gap-2"},xn={key:0},kn={class:"mt-2 flex flex-col gap-3"},wn={class:"grid grid-cols-3 gap-2"},Sn={key:0},Tn={class:"mt-4 grid grid-cols-1 gap-3"},Ln="checkout-form",Bn=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(t){const n=t,o=e.ref(!1),i=e.useModel(t,"modelValue"),a=e.computed({get:()=>i.value.type==="ORGANIZATION",set:A=>{i.value.type=A?"ORGANIZATION":"INDIVIDUAL"}}),l=e.computed(()=>i.value.type==="ORGANIZATION"),s=e.computed({get:()=>i.value.country,set:A=>{i.value.country=A&&Ee(A)?A:void 0}}),_=e.computed(()=>i.value.country!=="US"),{isTaxIDCheckEnabled:p,isTaxIDCheckPending:N,taxIdValidationData:g,runTaxIDCheck:v}=En(i),{$t:M}=S.useIntl(),c=be.useCustomerFormLabels(),C=A=>n.getIsFieldRequired(A)?"":" "+M({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),m=e.computed(()=>i.value.country?Lt.getCountryNameByCode(i.value.country):void 0);return(A,b)=>(e.openBlock(),e.createElementBlock("form",{id:Ln,onSubmit:b[12]||(b[12]=e.withModifiers(I=>A.$emit("submit",i.value),["prevent"]))},[e.createElementVNode("div",Pn,[e.createVNode(e.unref(ne._sfc_main),{title:e.unref(c).contactInformationTitle},{default:e.withCtx(()=>[e.createElementVNode("div",Dn,[t.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(S._sfc_main),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.email),1)]),_:1}),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",tag:"span",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.email,"onUpdate:modelValue":b[0]||(b[0]=I=>i.value.email=I),required:"",type:"email",name:"email",disabled:!!t.readOnlyEmail,label:e.unref(c).emailLabel,placeholder:e.unref(c).emailPlaceholder+C("email"),error:t.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(be._sfc_main),{"single-model-value":s.value,"onUpdate:singleModelValue":b[3]||(b[3]=I=>s.value=I),required:"",name:"country",label:e.unref(c).countryLabel+C("country"),error:t.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[!o.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{key:0,size:"xs",intent:"subtle","icon-prefix":"add",class:"py-0.5",onClick:b[1]||(b[1]=I=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})):e.createCommentVNode("",!0),o.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{key:1,size:"sm",intent:"subtle","icon-prefix":"close",class:"py-0.5",onClick:b[2]||(b[2]=I=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(Qe._sfc_main),{"is-open":o.value||!!t.isBillingInformationMandatory},{default:e.withCtx(()=>[o.value||t.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",xn,[e.createElementVNode("div",kn,[e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.addressLine1,"onUpdate:modelValue":b[4]||(b[4]=I=>i.value.addressLine1=I),name:"address_line_1",label:e.unref(M)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(M)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+C("addressLine1"),required:"",error:t.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.addressLine2,"onUpdate:modelValue":b[5]||(b[5]=I=>i.value.addressLine2=I),name:"address_line_2",placeholder:e.unref(M)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+C("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",wn,[e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.postalCode,"onUpdate:modelValue":b[6]||(b[6]=I=>i.value.postalCode=I),name:"postal_code",placeholder:e.unref(c).postalCodePlaceholder+C("postalCode"),error:t.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.city,"onUpdate:modelValue":b[7]||(b[7]=I=>i.value.city=I),name:"city",placeholder:e.unref(c).cityPlaceholder+C("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.state,"onUpdate:modelValue":b[8]||(b[8]=I=>i.value.state=I),name:"state",placeholder:e.unref(c).statePlaceholder+C("state"),error:t.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["title"]),t.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{key:0},{default:e.withCtx(()=>[e.createVNode(be._sfc_main$1,{modelValue:a.value,"onUpdate:modelValue":b[9]||(b[9]=I=>a.value=I),"no-spacing":"",class:"!flex"},null,8,["modelValue"]),e.createVNode(e.unref(Qe._sfc_main),{"is-open":l.value},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Sn,[e.createElementVNode("div",Tn,[e.createVNode(e.unref(ie._sfc_main),{modelValue:i.value.companyLegalName,"onUpdate:modelValue":b[10]||(b[10]=I=>i.value.companyLegalName=I),required:"",name:"legal_name",label:e.unref(c).legalNameLabel,placeholder:e.unref(c).legalNamePlaceholder},null,8,["modelValue","label","placeholder"]),_.value?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:0,modelValue:i.value.companyVatNumber,"onUpdate:modelValue":b[11]||(b[11]=I=>i.value.companyVatNumber=I),name:"vat_number","input-class":"focus:outline-none focus:ring-0",label:e.unref(c).vatNumberLabel,placeholder:e.unref(c).vatNumberPlaceholder,error:t.validation.value.companyVatNumber.$errors,"suffix-class":"px-2 border-l-0"},e.createSlots({_:2},[e.unref(lt)(i.value.country??"")?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(te._sfc_main),{type:"button",size:"sm",intent:"secondary",disabled:!e.unref(p)||e.unref(N)||t.validation.value.companyVatNumber.$invalid,onClick:e.unref(v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Check",id:"checkout.vat_number.check_button.label",description:"The label for the check button in the checkout form"})),1)]),_:1},8,["disabled","onClick"])]),key:"0"}:void 0]),1032,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"opacity-75":e.unref(N)})},[e.createVNode(An,{"tax-id-validation-result":e.unref(g)},null,8,["tax-id-validation-result"])],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1}))])],32))}}),On={key:0,class:"flex items-center"},Vn=["innerHTML"],zn=["innerHTML"],jn=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(t){const{$t:n}=S.useIntl();return(o,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(S._sfc_main),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.trialStartDate?t.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),t.trialPeriod?(e.openBlock(),e.createBlock(e.unref(ot._sfc_main),{key:0,"trial-period":t.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[t.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(ee.formatAmount)(t.amount),startDate:t.subscriptionStartDate,period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:a=>`<strong>${a}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(ee.formatAmount)(t.amount),period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:a=>`<strong>${a}</strong>`})},null,8,zn)):(e.openBlock(),e.createElementBlock("span",On,[e.createVNode(e.unref(ke._sfc_main),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(ke.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ke._sfc_main$1),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({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(e.unref(pe._sfc_main$2),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"mr-1.5 inline-block"})]),_:1}),e.createElementVNode("span",{innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description_without_price",description:"The description of the trial period, while the price is still being determined"},{startDate:t.subscriptionStartDate,period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description_without_price",description:"The description of the subscription, while the price is still being determined"},{period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,Vn)]))]),_:1})]))}}),Rn=t=>{var n;return((n=t.periods)==null?void 0:n.some(o=>o.groups.some(i=>{var a;return(a=i.lines)==null?void 0:a.some(l=>l.product_items.some(s=>s.model_type==="USAGE_BASED"))})))??!1},$n={class:"flex min-h-96 w-full items-center justify-center"},Un={class:"max-w-sm"},Fn=e.defineComponent({__name:"CheckoutNotAvailable",setup(t){const{$t:n}=S.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",$n,[e.createElementVNode("div",Un,[e.createVNode(e.unref(S._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),Gn=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",emits:["continue-to-merchant"],setup(t){const{$t:n}=S.useIntl();return(o,i)=>(e.openBlock(),e.createBlock(Vt._sfc_main,{status:"success",title:e.unref(n)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(S._sfc_main),{variant:"body-xs",color:"subtle",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1})]),_:1},8,["title"]))}}),Yn={class:"flex items-start"},Kn={class:"flex grow flex-col"},qn={class:"flex items-center gap-1"},Qn={class:"ml-4 flex items-center self-center"},yt=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createElementVNode("div",qn,[e.createVNode(e.unref(S._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.name),1)]),_:1}),e.renderSlot(n.$slots,"badge")]),e.createVNode(e.unref(S._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})]),e.createElementVNode("div",Qn,[e.renderSlot(n.$slots,"default")])]))}}),Hn={class:"sv-order-summary__body grid grid-cols-1 gap-1"},Zn={class:"px-3 py-2"},Xn={class:"sv-order-summary__billing-period flex flex-col gap-3"},Wn={class:"px-3 py-2"},Jn={key:3,class:"sv-order-summary__items"},tt=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(t,{emit:n}){const o=t,i=n,{$t:a}=S.useIntl(),{map:l,formatTimePeriod:s}=nt.useTimePeriod(),{isMobileViewport:_}=rt.useViewport(),p=e.computed(()=>_.value?"sm":"xs"),N=r=>`${r.type}:${r.value}`,g=["DAY","WEEK","MONTH","YEAR"],v=r=>g.includes(r),M=r=>{if(!r)return;const[d,h]=r.split(":"),D=Number(h);if(!(!D||!v(d)))return{type:d,value:D}},c=e.computed({get:()=>{const r=o.subscription.billing_period;return r?`${r.type}:${r.value}`:void 0},set:r=>{if(!r)return;const[d,h]=r.split(":"),D=Number(h);D&&v(d)&&i("billing-period-change",{type:d,value:D})}}),C=r=>{var D,x,j,L;const d=(L=(j=(x=(D=o.invoicePreviewByBillingPeriod)==null?void 0:D[N(r)])==null?void 0:x.periods)==null?void 0:j[0])==null?void 0:L.amount_including_tax;if(!d)return;const h=r.type==="MONTH"&&r.value===3?a({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):a({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:s(r,{prefix:!1,hideValueForExactPeriods:!0})});return a({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:ee.formatAmount(d),period:h})},m=r=>{var d,h,D,x;return(x=(D=(h=(d=o.invoicePreviewByBillingPeriod)==null?void 0:d[N(r)])==null?void 0:h.periods)==null?void 0:D[0])==null?void 0:x.amount_including_tax},A=r=>Number(r.quantity),b=(r,d)=>{if(!d)return;const D={DAY:365,WEEK:52,MONTH:12,YEAR:1}[r.type]/Math.max(r.value??1,1),x=A(d)*D;if(Number.isFinite(x))return{quantity:x.toFixed(2),currency:d.currency}},I=(r,d)=>{if(!r||!d)return;const h=A(r)-A(d);if(!(!Number.isFinite(h)||h<=0))return{quantity:h.toFixed(2),currency:r.currency}},O=r=>{if(!r)return;const d=a({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:ee.formatAmount(r)}),h=a({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"});return`${d}${h}`},T=e.computed(()=>{var G,q,H;const r=ae.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),d=((q=(G=r==null?void 0:r.pricing_plan_version)==null?void 0:G.billing_period_settings)==null?void 0:q.billing_periods)??[],h=new Map,D=B=>{B&&h.set(N(B),B)},x=B=>{var R;(R=B==null?void 0:B.items)==null||R.forEach($=>{var Q,Z;(Q=$.billing_period_configs)==null||Q.forEach(X=>D(X.billing_period)),(Z=$.pricing_currency_configs)==null||Z.forEach(X=>{var W;(W=X.billing_period_configs)==null||W.forEach(re=>D(re.billing_period))})})};if((((H=r==null?void 0:r.pricing_plan_version)==null?void 0:H.pricing_categories)??[]).forEach(B=>{var R,$;(R=B.pricings)==null||R.forEach(Q=>x(Q)),($=B.pricing_groups)==null||$.forEach(Q=>{var Z;return(Z=Q.pricings)==null?void 0:Z.forEach(X=>x(X))})}),!h.size)return[];const L=d.map(B=>h.get(N(B.period))).filter(B=>!!B),K=new Set(L.map(N)),F=[...h.values()].filter(B=>!K.has(N(B)));return[...L,...F]}),u=e.computed(()=>{const r=T.value[T.value.length-1],d=r?b(r,m(r)):void 0;return T.value.map(D=>{const x=D.type==="MONTH"&&D.value===3?a({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):a({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:l.value[D.type].full}),j=m(D),L=b(D,j),K=r&&D.type===r.type&&D.value===r.value?void 0:I(L,d),F=O(K);return{label:x,subLabel:C(D),labelSuffixComponent:F?{component:He._sfc_main,props:{color:"primary",content:F,size:p.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:c.value===`${D.type}:${D.value}`,value:`${D.type}:${D.value}`}})}),P=e.computed(()=>{const r=u.value,d=r[0],h=r[r.length-1];return{smallestPeriod:d==null?void 0:d.value,biggestPeriod:h==null?void 0:h.value}}),z=e.computed(()=>u.value.find(r=>r.value===P.value.biggestPeriod)),Y=e.computed(()=>u.value.find(r=>r.value===c.value)),f=e.computed(()=>{var G,q,H,B,R,$,Q,Z;const r=u.value,d=r[r.length-1],h=c.value;if(!d||!h||h===d.value)return"";const D=M(d.value);if(!D)return"";const x=(B=(H=(q=(G=o.invoicePreviewByBillingPeriod)==null?void 0:G[d.value])==null?void 0:q.periods)==null?void 0:H[0])==null?void 0:B.amount_including_tax,j=M(h),L=(Z=(Q=($=(R=o.invoicePreviewByBillingPeriod)==null?void 0:R[h])==null?void 0:$.periods)==null?void 0:Q[0])==null?void 0:Z.amount_including_tax;if(!j||!L)return"";const K=b(j,L),F=b(D,x);return O(I(K,F))??""}),y=r=>{const{smallestPeriod:d,biggestPeriod:h}=P.value;c.value=r?h:d};return(r,d)=>(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{class:"sv-order-summary","no-border":"","no-spacing":"","content-background":"none",title:t.noTitle?void 0:e.unref(a)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",Hn,[e.createVNode(e.unref(ne._sfc_main),{"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[t.subscription?(e.openBlock(),e.createBlock(zt._sfc_main,{key:0,avatar:t.avatar,invoice:t.invoice,subscription:t.subscription,"enabled-pricing-ids":t.enabledPricingIds,loading:t.isPreviewAndPaymentMethodsPending,"trial-period":t.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),u.value.length===2?(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{key:0,"no-spacing":"","content-classes":c.value===P.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var h;return[e.createElementVNode("div",Zn,[e.createElementVNode("div",Xn,[z.value?(e.openBlock(),e.createBlock(yt,{key:0,name:z.value.label,description:((h=Y.value)==null?void 0:h.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main),{"model-value":c.value===P.value.biggestPeriod,"onUpdate:modelValue":y},null,8,["model-value"])]),_:2},[f.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(He._sfc_main),{intent:"brand",content:f.value,size:p.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):u.value.length>2?(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{key:1,"single-model-value":c.value,"onUpdate:singleModelValue":d[0]||(d[0]=h=>c.value=h),class:"sv-order-summary__billing-period",options:u.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),t.isUsageBased?(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{key:2,"no-spacing":"",class:"sv-order-summary__usage"},{default:e.withCtx(()=>[e.createElementVNode("div",Wn,[e.createVNode(e.unref(S._sfc_main),{"no-spacing":"",variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),t.invoice&&t.variant!=="products-inline"?(e.openBlock(),e.createElementBlock("div",Jn,[e.createVNode(e.unref(pe._sfc_main$3),{invoice:t.invoice,"wrapper-component":e.unref(ne._sfc_main)},null,8,["invoice","wrapper-component"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(ne._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(pe._sfc_main$1),{key:0,class:"sv-order-summary__invoice-preview",variant:t.variant==="products-inline"?"default":"without-products",invoice:t.invoice,"trial-invoice":t.trialInvoice,"is-paid":t.isPaid,collapsible:t.collapsible,"is-preview-without-taxes":!t.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(S._sfc_main),{key:1,variant:"body-sm",color:"subtle",class:"sv-order-summary__empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}});async function vt(t,n){const{AdyenCheckout:o}=await Ce.loadAdyenSdk();return o(ye.getAdyenExpressCheckoutConfiguration({locale:t.locale,amount:t.amount,countryCode:t.countryCode,paymentMethodOptionResponse:t.paymentMethodOptionsResponse,logger:n}))}function _t({props:t,create:n,onMissingButton:o,onMountFailed:i,afterMount:a}){const l=e.ref(),s=S.useLogger(),_=async()=>{const p=await vt(t,s),N=await n(p);if(!l.value){o();return}try{await N.isAvailable(),N.mount(l.value),a==null||a()}catch(g){i(g)}};return e.onMounted(()=>{_()}),{buttonRef:l}}const eo={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},to={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},Le=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(t,{emit:n}){const o=t,i=n,a=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),l=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function s(){i("click")}return(_,p)=>(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{size:"lg","aria-label":a.value,class:e.normalizeClass([l.value,"!block h-11 w-full bg-center bg-no-repeat"]),onClick:s},{default:e.withCtx(()=>[o.type==="applepay"?(e.openBlock(),e.createElementBlock("svg",eo,[...p[0]||(p[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):o.type==="paypal"?(e.openBlock(),e.createElementBlock("img",to)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),no={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},oo="ADYEN",io=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=e.ref(),l=S.useLogger(),{authorizePayment:s}=Rt.createPaymentsService(),_=o.paymentMethodOptionsResponse.payment_acceptor.id,p=async()=>{const{ApplePay:m}=await Ce.loadAdyenSdk(),A=await vt(o,l),b=new m(A,{isExpress:!0,recurringPaymentRequest:{paymentDescription:o.billingInformation.description,billingAgreement:o.billingInformation.agreement,managementURL:"https://www.google.com",...o.billingInformation.trial&&{trialBilling:{label:o.billingInformation.trial.label,amount:o.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.trial.startDate,recurringPaymentEndDate:o.billingInformation.trial.endDate}},...o.billingInformation.regular&&{regularBilling:{label:o.billingInformation.regular.label,amount:o.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.regular.startDate,...N(o.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(I,O,T)=>{var Y,f,y,r,d,h,D;const{invoicePreview:u,trialInvoicePreview:P}=await o.onBillingInformationChange({...((Y=T.paymentMethod.billingContact)==null?void 0:Y.postalCode)&&{postal_code:T.paymentMethod.billingContact.postalCode},...((f=T.paymentMethod.billingContact)==null?void 0:f.locality)&&{city:T.paymentMethod.billingContact.locality},...M((y=T.paymentMethod.billingContact)==null?void 0:y.countryCode)&&{country:M((r=T.paymentMethod.billingContact)==null?void 0:r.countryCode)}}),z=P?P.invoice_amount_including_tax.quantity.toString():u.invoice_amount_including_tax.quantity.toString();i("update-billing-information",{postal_code:(d=T.paymentMethod.billingContact)==null?void 0:d.postalCode,city:(h=T.paymentMethod.billingContact)==null?void 0:h.locality,country:(D=T.paymentMethod.billingContact)==null?void 0:D.countryCode}),I({newTotal:{label:o.billingInformation.regular.label,amount:z,type:"final"}})},onError:I=>{l.error("APPLE_PAY_ERROR","Apple Pay error",{error:I})},onAuthorized:async(I,O)=>{try{l.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:I});const T=I.authorizedEvent;l.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:T,hasPaymentMethod:!!T.payment.token.paymentMethod,hasBrowserInfo:!!T.payment.token.paymentData,billingAddress:I.billingAddress});const u=T.payment.billingContact,P=I.billingAddress;u?i("update-billing-information",g(u)):P&&i("update-billing-information",v(P));const z={payment_method:ye.transformObjectToAdyenObject(T.payment.token.paymentMethod),browser_info:ye.transformObjectToAdyenObject(T.payment.token.paymentData)};l.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:z});const Y=ye.createReturnUrl({paymentAcceptorId:_,redirectUrl:window.location.href});l.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:_,amount:o.amount});const f=await s({payment_acceptor_id:_,payment_gateway_variant:oo,adyen:{...z,store_payment_method:!0},amount:o.amount,return_url:Y});if(l.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:f.status,paymentResult:f}),f.status==="FAILURE"){l.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:f}),O.reject();return}if(f.status==="ACTION_REQUIRED"){l.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:f.action}),O.reject();return}l.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),O.resolve()}catch(T){l.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:T}),O.reject()}}});if(!a.value){l.error("APPLE_PAY_ERROR","Apple Pay button ref not found");return}try{await b.isAvailable(),b.mount(a.value),i("ready")}catch(I){l.error("APPLE_PAY_ERROR","Apple Pay not available on this device",{},I)}},N=m=>{if(!m.value)return;let A=m.value??1,b=m.type.toLowerCase();if(m.type==="WEEK"&&(b="day",A=m.value*7),b==="day"||b==="month"||b==="year"||b==="hour"||b==="minute")return{recurringPaymentIntervalUnit:b,recurringPaymentIntervalCount:A}},g=m=>({postal_code:m.postalCode,city:m.locality,country:m.countryCode}),v=m=>({postal_code:m.postalCode,city:m.city,country:m.country}),M=m=>m&&c(m)?m:void 0,c=m=>Ee(m),C=()=>{var A;const m=(A=a.value)==null?void 0:A.querySelector("apple-pay-button");if(m){const b=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});m.dispatchEvent(b)}};return e.onMounted(()=>{p()}),(m,A)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Le,{key:0,type:"applepay",onClick:C})):e.createCommentVNode("",!0),e.createElementVNode("div",no,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:a},null,512)])],64))}}),ao={class:"relative overflow-hidden"},ro=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=S.useLogger(),{buttonRef:l}=_t({props:o,onMissingButton:()=>a.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted"),onMountFailed:s=>a.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:s}),create:async s=>{const{PayPal:_}=await Ce.loadAdyenSdk();return new _(s,{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{i("ready")}})}});return(s,_)=>(e.openBlock(),e.createElementBlock("div",ao,[t.isVisible?(e.openBlock(),e.createBlock(Le,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:l,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),lo={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},so=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=S.useLogger(),{buttonRef:l}=_t({props:o,onMissingButton:()=>a.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted"),onMountFailed:_=>a.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:_}),create:async _=>{const{GooglePay:p}=await Ce.loadAdyenSdk();return new p(_,{isExpress:!0})},afterMount:()=>i("ready")}),s=()=>{var p;const _=(p=l.value)==null?void 0:p.querySelector("#gpay-button-online-api-id");if(_){const N=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});_.dispatchEvent(N)}};return(_,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Le,{key:0,type:"googlepay",onClick:s})):e.createCommentVNode("",!0),e.createElementVNode("div",lo,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:l},null,512)])],64))}}),co={key:0,class:"mt-4n"},uo={class:"mb-2"},po={class:"grid grid-cols-6 gap-1 md:gap-2"},mo={class:"mt-4 h-4"},go=2,fo=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(t){const n=["applepay"],o=t,{$t:i}=S.useIntl(),a=e.ref(!1),l=e.ref(!1),s=e.ref(!1),_=e.computed(()=>{var c;if(n.includes("applepay"))return(c=o.paymentMethodsOptionsResponse)==null?void 0:c.find(C=>{var m;return(m=C.options)==null?void 0:m.some(A=>A.name.toLowerCase()==="apple pay"&&A.payment_gateway_variant==="ADYEN")})}),p=e.computed(()=>{var c;if(n.includes("paypal"))return(c=o.paymentMethodsOptionsResponse)==null?void 0:c.find(C=>{var m;return(m=C.options)==null?void 0:m.some(A=>A.name.toLowerCase()==="paypal"&&A.payment_gateway_variant==="ADYEN")})}),N=e.computed(()=>{var c;if(n.includes("googlepay"))return(c=o.paymentMethodsOptionsResponse)==null?void 0:c.find(C=>{var m;return(m=C.options)==null?void 0:m.some(A=>A.name.toLowerCase()==="google pay"&&A.payment_gateway_variant==="ADYEN")})}),g=e.computed(()=>!!(_.value||N.value||p.value)),v=e.computed(()=>{var A;if(((A=o.paymentMethodsOptionsResponse)==null?void 0:A.length)===0)return!1;const c=!_.value||a.value,C=!N.value||l.value,m=!p.value||s.value;return c&&C&&m}),M=e.computed(()=>v.value?(_.value?1:0)+(N.value?1:0)+(p.value?1:0):go);return(c,C)=>g.value?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",uo,[v.value?(e.openBlock(),e.createBlock(e.unref(S._sfc_main),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(le._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",po,[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(le._sfc_main,{class:"col-span-3 h-11"}),e.createVNode(le._sfc_main,{class:"col-span-3 h-11"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!_.value,"!col-span-6":M.value===1,"md:!col-span-3":M.value===2,"!col-span-6 md:!col-span-2":M.value===3}])},[_.value?(e.openBlock(),e.createBlock(io,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":_.value,"on-billing-information-change":t.onBillingInformationChange,onReady:C[0]||(C[0]=m=>a.value=!0),onUpdateBillingInformation:C[1]||(C[1]=m=>c.$emit("update-billing-information",m))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!N.value,"col-span-6 md:col-span-6":M.value===1,"md:!col-span-3":M.value===2}])},[N.value?(e.openBlock(),e.createBlock(so,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":N.value,onReady:C[2]||(C[2]=m=>l.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!p.value,"col-span-6 md:col-span-6":M.value===1,"md:!col-span-3":M.value===2}])},[p.value?(e.openBlock(),e.createBlock(ro,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":p.value,onReady:C[3]||(C[3]=m=>s.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",mo,[v.value?(e.openBlock(),e.createBlock(e.unref(jt._sfc_main),{key:1,text:e.unref(i)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(le._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),yo=["aria-expanded","aria-label"],vo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},_o={class:"flex flex-row items-center gap-2"},ho=["onKeydown"],Mo=["aria-label"],bo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Io={class:"flex flex-row items-center gap-2"},No={class:"sr-only","aria-live":"polite"},Co=e.defineComponent({inheritAttrs:!1,__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(t,{emit:n}){const{$t:o}=S.useIntl(),i=t,a=n,l=e.ref(!1),s=e.ref(""),_=e.ref(""),p=e.ref(null),N=e.ref(null),g=Ut.uniqueId("promotion-code-"),v=`${g}-label`,M=`${g}-panel`,c=e.computed(()=>i.promotionCode!==null&&i.promotionCode!==""),C=e.computed(()=>s.value.trim().length>0),m=e.computed(()=>i.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),A=e.computed(()=>l.value?o({defaultMessage:"Collapse promotion code input",id:"checkout.promotion_code.collapse_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is open"}):o({defaultMessage:"Expand promotion code input",id:"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is closed"})),b=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),I=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),O=()=>{s.value=""},T=()=>{var y;const f=(y=N.value)==null?void 0:y.querySelector("input");f instanceof HTMLInputElement&&f.focus()},u=()=>{l.value&&(l.value=!1)},P=()=>{c.value||(l.value=!l.value)},z=()=>{if(!C.value)return;const f=s.value.trim();a("update:appliedCode",f),a("apply",f),_.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),l.value=!1},Y=()=>{a("update:appliedCode",null),a("remove"),_.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),O(),e.nextTick(()=>{var f;(f=p.value)==null||f.focus()})};return e.watch(l,f=>{if(!f){O(),e.nextTick(()=>{var y;(y=p.value)==null||y.focus()});return}e.nextTick(()=>{T()})}),e.watch(()=>i.promotionCode,f=>{f||O()}),(f,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.value?(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),e.mergeProps({key:1},f.$attrs,{"no-border":"","no-spacing":"","content-background":"none",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full rounded border border-primary-900 bg-white","aria-label":I.value,onClick:Y},[e.createElementVNode("div",bo,[e.createElementVNode("div",Io,[e.createVNode(e.unref(te._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})]),e.createVNode(e.unref(te._sfc_main$1),{icon:"close"})])],8,Mo)]),_:1},16)):(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),e.mergeProps({key:0},f.$attrs,{"no-spacing":"",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:p,type:"button",class:"w-full","aria-expanded":l.value,"aria-controls":M,"aria-label":A.value,onClick:P},[e.createElementVNode("div",vo,[e.createElementVNode("div",_o,[e.createVNode(e.unref(te._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(S._sfc_main),{id:v,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(te._sfc_main$1),{icon:l.value?"remove":"add"},null,8,["icon"])])],8,yo),e.withDirectives(e.createElementVNode("div",{id:M,ref_key:"panelRef",ref:N,role:"region","aria-labelledby":v,class:"flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",onKeydown:e.withKeys(e.withModifiers(u,["prevent"]),["esc"])},[e.createVNode(e.unref(ie._sfc_main),{modelValue:s.value,"onUpdate:modelValue":y[0]||(y[0]=r=>s.value=r),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(z,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(te._sfc_main),{type:"button",disabled:!C.value,"aria-label":b.value,"aria-disabled":!C.value,onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,ho),[[e.vShow,l.value]])]),_:1},16)),e.createElementVNode("span",No,e.toDisplayString(_.value),1)],64))}}),Ao={class:"sv-checkout__header"},Eo={class:"sv-checkout__payment-methods"},Po={key:0,class:"sv-checkout__payment-methods-body"},Do={key:3,class:"sv-checkout__payment-form"},xo={class:"sv-checkout__order-summary"},ko={class:"flex flex-col gap-2"},wo=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var je,Re,$e,Ue,Fe,Ge,Ye,Ke,qe;const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PaymentIntegrationForm-DqqGcEP1.js"))),i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PlanCustomizationEditor-CiZnVCM6.js"))),a=t,l=n,s=e.computed(()=>a.configuration),_=e.ref(),p=e.ref(),N=S.useLogger(),{$t:g,locale:v}=S.useIntl(),{formatTimePeriod:M}=nt.useTimePeriod(),c=Tt.usePortal(),{isMobileViewport:C}=rt.useViewport();if(N.info("COMPONENT_INITIALIZED","Checkout component initialized"),((je=c.value)==null?void 0:je.type)!=="INIT_PRICING_PLAN_SUBSCRIPTION")throw N.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");c.value.status==="REVOKED"&&(_.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${c.value.id}" is revoked`},N.error("RESOURCE_REVOKED",`Portal url with resource id "${c.value.id}" is revoked`));const m=($e=(Re=c.value)==null?void 0:Re.init_pricing_plan_subscription)==null?void 0:$e.pricing_plan_subscription_id,A=(Fe=(Ue=c.value)==null?void 0:Ue.init_pricing_plan_subscription)==null?void 0:Fe.success_url,{validatedEmail:b,validatedCountry:I,paymentMethodOptions:O,hasPaymentMethodOptionsError:T,retryPaymentMethodOptions:u,subscription:P,isPaymentMethodsPending:z,isInvoicePreviewPending:Y,checkoutForm:f,invoicePreview:y,invoicePreviewByBillingPeriod:r,trialInvoicePreview:d,trialPeriod:h,authorizationContext:D,isPaid:x,amount:j,loadInvoicePreview:L,updateInvoicePreviewOnBillingInformationChange:K,saveFormStateForRedirect:F}=Mn({initialCountry:(Ge=a.configuration)==null?void 0:Ge.countryCode,initialEmail:(Ye=a.configuration)==null?void 0:Ye.email,subscriptionId:m,enabledPricingIds:(Ke=a.configuration)==null?void 0:Ke.enabledPricingIds}),G=e.ref(!1),q=async()=>{var E;await f.validation.value.$validate(),!f.validation.value.$invalid&&(G.value=!0,F(),(E=p.value)==null||E.submit())},H=()=>{G.value=!1},B=async()=>(await f.validation.value.$validate(),!f.validation.value.$invalid),R=e.computed(()=>!!d.value),$=e.computed(()=>y.value?Rn(y.value):!1),Q=e.computed(()=>f.form.value.country&&["US","CA"].includes(f.form.value.country)||!1),Z=e.computed({get:()=>f.form.value.enabledPricingIds??[],set:E=>{f.form.value.enabledPricingIds=E}}),X=e.computed(()=>P.value?ae.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:P.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),W=e.computed(()=>{var k,w;if(!P.value)return;const E=(w=(k=X.value)==null?void 0:k.pricing_plan_version)==null?void 0:w.pricing_currency_settings;return mt({country:f.form.value.country,pricingCurrencySettings:E,fallbackCurrency:P.value.billing_currency})}),re=e.computed(()=>{if(!X.value||!P.value)return new Set;const E=ae.getPricingItemConfigMetaById({pricingPlanScheduleInfo:X.value}),k=W.value,w=P.value.billing_period,U=new Set;return E.forEach((V,At)=>{k&&V.currency!==k||w&&V.billingPeriod&&(V.billingPeriod.type!==w.type||V.billingPeriod.value!==w.value)||U.add(At)}),U}),me=e.computed({get:()=>{const E=f.form.value.seatsValues??[],k=re.value;return k.size?E.filter(({pricing_item_config_id:w})=>k.has(w)):E},set:E=>{const k=f.form.value.seatsValues??[],w=re.value;if(!w.size){f.form.value.seatsValues=E;return}const U=k.filter(({pricing_item_config_id:V})=>!w.has(V));f.form.value.seatsValues=U.concat(E)}}),he=e.computed(()=>{var E,k,w,U,V;return d.value?g({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:d.value.tax_summary.total_amount.quantity==="0.00"?g({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):ee.formatAmount(d.value.tax_summary.total_amount),trial_period:M(h.value,{short:!0}),subscription_amount:ee.formatAmount(((E=y.value)==null?void 0:E.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:M(((k=y.value)==null?void 0:k.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(ce.value)}):g({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(w=y.value)!=null&&w.tax_summary.total_amount?ee.formatAmount((U=y.value)==null?void 0:U.tax_summary.total_amount):"",billing_period:M(((V=y.value)==null?void 0:V.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(ce.value)})}),ge=e.computed(()=>{var k;if(!y.value)return;const E=ve.getSubscriptionName({subscription:P.value,fallback:g({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})});return{description:E,managementURL:"https://www.solvimon.com/account/billing",agreement:he.value,...d.value&&h.value&&{trial:{label:g({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:d.value.tax_summary.total_amount,startDate:Pe.value?new Date(Pe.value):void 0,endDate:Be.value?new Date(Be.value):void 0}},regular:{label:E,amount:y.value.tax_summary.total_amount,startDate:ce.value?new Date(ce.value):void 0,interval:((k=P.value)==null?void 0:k.billing_period)??{type:"MONTH",value:1}}}}),Me=E=>Ee(E),J=E=>{const{country:k,...w}=E;f.updateInitialState({...w,...k&&Me(k)?{country:k}:{}})},ht=e.computed(()=>!(b&&I)),Pe=e.computed(()=>{var w,U,V;const E=(U=(w=d.value)==null?void 0:w.periods)==null?void 0:U[0],k=(V=De.value)==null?void 0:V.trialStartDate;return E!=null&&E.start_at?new Date(E.start_at):k}),De=e.computed(()=>ve.getFallbackTrialAndSubscriptionStartAndEndDates(P.value)),Be=e.computed(()=>{var w,U,V;const E=(U=(w=d.value)==null?void 0:w.periods)==null?void 0:U[0],k=(V=De.value)==null?void 0:V.trialEndDate;return E!=null&&E.end_at?new Date(E.end_at):k}),ce=e.computed(()=>{var w,U,V;const E=(U=(w=y.value)==null?void 0:w.periods)==null?void 0:U[0],k=(V=De.value)==null?void 0:V.subscriptionStartDate;return E!=null&&E.start_at?new Date(E.start_at):k}),Mt=e.computed(()=>!!(f.form.value.seatsValues&&f.form.value.seatsValues.length>0||P.value&&fn(P.value)||P.value&&yn(P.value))),fe=e.ref(null),{applyPromotionCode:Oe,removePromotionCode:bt,isPromotionCodePending:It,promotionCodeErrorMessage:xe}=bn({checkoutForm:f,updateInvoicePreviewOnBillingInformationChange:K,formatErrorMessage:({action:E})=>g(E==="apply"?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{fe.value=null},onApplyError:()=>{fe.value=null}});Nn({subscription:P,promotionCode:(qe=a.configuration)==null?void 0:qe.couponCode,appliedPromotionCode:fe,applyPromotionCode:Oe});const Ve=()=>{A&&de.safeUrlRedirect(A)},Nt=e.computed(()=>{var E;return!((E=a.configuration)!=null&&E.onPaymentSuccess)&&!!A}),Ct=()=>{var E;if(x.value=!0,xe.value=null,(E=a.configuration)!=null&&E.onPaymentSuccess){a.configuration.onPaymentSuccess();return}if(A){Ve();return}},ze=E=>{P.value&&(P.value={...P.value,billing_period:E},L())};return e.onMounted(()=>{l("ready")}),(E,k)=>_.value?(e.openBlock(),e.createBlock(Fn,{key:0,class:"sv-checkout sv-root sv-screen sv-checkout--error"})):(e.openBlock(),e.createBlock(e.unref($t.ContentWithAsideLayout),{key:1,class:e.normalizeClass(["sv-checkout sv-root sv-screen",{"sv-checkout--paid":e.unref(x)}])},{header:e.withCtx(()=>[e.createElementVNode("div",Ao,[e.createVNode(le._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var w,U,V;return[e.unref(y)&&e.unref(P)&&ce.value?(e.openBlock(),e.createBlock(jn,{key:0,class:"sv-checkout__title","trial-start-date":Pe.value,"trial-period":e.unref(h),"subscription-start-date":ce.value,"subscription-name":((w=e.unref(P))==null?void 0:w.name)??"",amount:(U=e.unref(y))==null?void 0:U.invoice_amount_including_tax,"billing-period":(V=e.unref(P))==null?void 0:V.billing_period,"country-code":e.unref(f).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})])]),content:e.withCtx(()=>{var w,U;return[e.unref(x)?(e.openBlock(),e.createBlock(Gn,{key:0,class:"sv-checkout__completed-payment",onContinueToMerchant:Ve})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(P)&&e.unref(C)?(e.openBlock(),e.createBlock(tt,{key:0,class:"sv-checkout__mobile-order-summary",subscription:e.unref(P),invoice:e.unref(y),"invoice-preview-by-billing-period":e.unref(r),"trial-invoice":e.unref(d),"enabled-pricing-ids":Z.value,"trial-period":e.unref(h),avatar:(w=s.value)==null?void 0:w.avatar,"is-paid":e.unref(x),"is-usage-based":$.value,"is-preview-and-payment-methods-pending":e.unref(z)||e.unref(Y),"country-code":e.unref(f).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:ze},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),Mt.value&&e.unref(P)?(e.openBlock(),e.createBlock(e.unref(i),{key:1,"seats-values":me.value,"onUpdate:seatsValues":k[0]||(k[0]=V=>me.value=V),"enabled-pricing-ids":Z.value,"onUpdate:enabledPricingIds":k[1]||(k[1]=V=>Z.value=V),class:"sv-checkout__plan-customization",subscription:e.unref(P),"initial-seats-values":(U=e.unref(f).initialState)==null?void 0:U.value.seatsValues,"billing-period":e.unref(P).billing_period,currency:W.value},null,8,["seats-values","enabled-pricing-ids","subscription","initial-seats-values","billing-period","currency"])):e.createCommentVNode("",!0),e.unref(f).form.value.country&&e.unref(j)&&ge.value?(e.openBlock(),e.createBlock(fo,{key:2,class:"sv-checkout__express-payment-methods",amount:e.unref(j),"country-code":e.unref(f).form.value.country,locale:e.unref(v),"payment-methods-options-response":e.unref(O)??[],"billing-information":ge.value,"on-billing-information-change":e.unref(K),onUpdateBillingInformation:J},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.createVNode(Bn,{modelValue:e.unref(f).form.value,"onUpdate:modelValue":k[2]||(k[2]=V=>e.unref(f).form.value=V),class:"sv-checkout__customer-form",validation:e.unref(f).validation,"read-only-email":e.unref(b),"show-customer-info-on-top":ht.value||e.unref(x),"is-billing-information-mandatory":Q.value,"get-is-field-required":e.unref(f).getIsFieldRequired,"read-only":e.unref(x)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"]),e.createElementVNode("div",Eo,[e.createVNode(le._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(z)||e.unref(z)&&e.unref(O).length>0?(e.openBlock(),e.createElementBlock("div",Po,[e.createVNode(e.unref(S._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-checkout__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(f).form.value.country?e.unref(T)?(e.openBlock(),e.createBlock(pe._sfc_main,{key:1,class:"sv-checkout__payment-methods-error",icon:"error"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Could not load payment methods",id:"checkout.payment_method_block.load_failed_title",description:"The title shown when the payment methods failed to load"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Check your connection and try again.",id:"checkout.payment_method_block.load_failed_message",description:"The message shown when the payment methods failed to load"})),1)]),action:e.withCtx(()=>[e.createVNode(e.unref(te._sfc_main),{type:"button",intent:"secondary",size:"sm",class:"sv-action sv-action--secondary sv-checkout__payment-methods-retry",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Try again",id:"checkout.payment_method_block.load_failed_retry_button.label",description:"The label of the button that loads the payment methods again"})),1)]),_:1},8,["onClick"])]),_:1})):e.unref(O).length===0?(e.openBlock(),e.createBlock(pe._sfc_main,{key:2,class:"sv-checkout__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),_:1})):e.unref(j)&&e.unref(f).form.value.country?(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":G.value})},[e.createVNode(e.unref(o),{ref_key:"paymentIntegrationFormRef",ref:p,"country-code":e.unref(f).form.value.country,context:e.unref(D),amount:e.unref(j),email:e.unref(f).form.value.email,variant:"AUTHORIZE","payment-method-options":e.unref(O)??[],"validate-on-submit":B,"redirects-on-success":Nt.value,"force-store-payment-method":"",onPaymentSuccess:Ct,onPaymentFailed:H,onReady:k[3]||(k[3]=V=>l("ready"))},null,8,["country-code","context","amount","email","payment-method-options","redirects-on-success"])],2)])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(pe._sfc_main,{key:0,class:"sv-checkout__payment-methods-empty",icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]),_:1})])],64))]}),aside:e.withCtx(()=>[e.createElementVNode("div",xo,[e.createVNode(le._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var w;return[e.unref(P)&&e.unref(y)?(e.openBlock(),e.createBlock(tt,{key:0,subscription:e.unref(P),invoice:e.unref(y),"invoice-preview-by-billing-period":e.unref(r),"trial-invoice":e.unref(d),"enabled-pricing-ids":Z.value,"trial-period":e.unref(h),"country-code":e.unref(f).form.value.country,avatar:(w=s.value)==null?void 0:w.avatar,"is-paid":e.unref(x),"is-usage-based":$.value,"is-preview-and-payment-methods-pending":e.unref(z)||e.unref(Y),onBillingPeriodChange:ze},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1})]),e.unref(x)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Co,{class:"sv-checkout__promotion-code","promotion-code":fe.value,"onUpdate:appliedCode":k[4]||(k[4]=w=>fe.value=w),onRemove:e.unref(bt),onApply:e.unref(Oe)},null,8,["promotion-code","onRemove","onApply"]),e.unref(xe)?(e.openBlock(),e.createBlock(e.unref(Et._sfc_main),{key:0,class:"sv-checkout__promotion-error mt-2",title:e.unref(xe)},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",ko,[e.createVNode(le._sfc_main,{class:"sv-checkout__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.unref(y)?(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{key:0,type:"button",size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",disabled:e.unref(It)||e.unref(O).length===0||G.value,loading:G.value,onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(R.value?e.unref(g)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(g)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled","loading"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(at._sfc_main$1,{"payment-method-options":e.unref(O)},null,8,["payment-method-options"])])],64))]),_:1},8,["class"]))}}),So=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var s;const o=Ft.getComponentName("checkout"),i=t,a=n,l=((s=i.configuration)==null?void 0:s.couponCode)??de.getQueryParam("coupon_code")??void 0;return(_,p)=>(e.openBlock(),e.createBlock(e.unref(S._sfc_main$1),{entry:_.$props,"component-name":e.unref(o),"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],onError:p[1]||(p[1]=N=>_.$emit("error",N))},{default:e.withCtx(()=>{var N,g,v,M,c;return[e.createVNode(wo,{configuration:{avatar:(g=(N=t.branding)==null?void 0:N.emblem)==null?void 0:g.public_url,email:(v=t.configuration)==null?void 0:v.email,countryCode:(M=t.configuration)==null?void 0:M.countryCode,enabledPricingIds:(c=t.configuration)==null?void 0:c.enabledPricingIds,couponCode:e.unref(l)},onReady:p[0]||(p[0]=C=>a("ready"))},e.createSlots({_:2},[_.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(_.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["configuration"])]}),_:3},8,["entry","component-name"]))}}),{define:To}=S.createSolvimonElement(So,"checkout");exports.FALLBACK_SEATS_NUMBER=ft;exports._sfc_main=yt;exports.defineSolvimonCheckout=To;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),Je=require("./api.es-duCDtZD9.js"),M=require("./customElements-Bt8PbjIn.js"),Ze=require("./component-B7ZDyqBp.js"),et=require("./useService-H7BjLg8P.js"),Me=require("./ErrorNotification.vue.es-0ZC_DozN.js"),J=require("./pricingItemConfigs.es-DlybwIh1.js"),te=require("./formatting.es-C72Nsrmh.js"),z=require("./Button.vue.es-BWl37nzm.js"),j=require("./TooltipParagraph.vue.es-sTgWAgcd.js"),Z=require("./Section.vue.es-DuK52y67.js"),Se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),xe=require("./RadioGroupExtended.vue.es-B1YtLNKG.js"),I=require("./index-DwueOtPi.js"),tt=require("./Divider.vue.es-UwnWvUTl.js"),Be=require("./Expand.vue.es-BtM0EZEr.js"),Ue=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js"),ot=require("./cn.es-CNvIP217.js"),Pe=require("./invoices-CvpL4rv5.js"),nt=require("./useWatchDebounced-CAU1WI1P.js"),at=require("./Input.vue.es-BN95nPBw.js"),le=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B9WTpz0k.js"),it=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js"),st=require("./customer.es-BButyYo0.js"),ut=require("./usePaymentMethodOptions-B6GIM9q4.js"),Ae=require("./Modal.vue.es-Chi6_MH_.js"),re=(t,o,n)=>{var a,i,s,l,u,c;if(n!=null&&n.amount)return te.formatAmount(n.amount);if(n!=null&&n.credits){const h=Number(n.credits.quantity),S=(h===1?(i=(a=n.credits.credit_type)==null?void 0:a.unit_name)==null?void 0:i.singular:((l=(s=n.credits.credit_type)==null?void 0:s.unit_name)==null?void 0:l.plural)??((c=(u=n.credits.credit_type)==null?void 0:u.unit_name)==null?void 0:c.singular))??t({defaultMessage:"credits",description:"Wallet balances credits default message",id:"wB/wXs"});return`${o(h)} ${S}`}return t({defaultMessage:"N/A",description:"Fallback wallet balance label when no balance is available",id:"PW+sL4"})},lt=3e4,ae=60,ie=12,rt=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ae,n=24*o,a=t,{$t:i,formatDate:s}=M.useIntl(),l=e.ref(Date.now());let u;e.onMounted(()=>{u=setInterval(()=>{l.value=Date.now()},lt)}),e.onBeforeUnmount(()=>{clearInterval(u)});const c=(f,v)=>{const p=(v.getFullYear()-f.getFullYear())*ie+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?p-1:p},h=e.computed(()=>{const f=Math.max(0,(l.value-a.date.getTime())/1e3);if(f<ae)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/ae)});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(l.value));if(v<1){const p=Math.trunc(f/n);return p===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:p})}return v<ie?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/ie)})}),_=e.computed(()=>a.actionVerb?`${a.actionVerb} ${h.value}`:h.value),S=e.computed(()=>s({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(S.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(_.value),1)]),_:1}))}}),ct=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=g=>re(o,n,g),i=e.computed(()=>{var g,T;return((T=(g=t.walletBalance.wallet)==null?void 0:g.wallet_type)==null?void 0:T.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),s=g=>{var T;return(((T=g.pricing_item)==null?void 0:T.configs)??[]).filter(m=>!!m.on_demand)},l=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(g=>s(g).some(T=>J.isFixedPricing(T)||J.isFlexiblePricing(T)))),u=e.computed(()=>l.value.find(g=>s(g).some(T=>J.isFlexiblePricing(T)))),c=e.computed(()=>!!t.showManualTopUp&&l.value.length>0),h=e.computed(()=>!!t.showAutoTopUp&&!!u.value),_=e.computed(()=>{var g,T;return(T=(g=t.walletBalance.wallet)==null?void 0:g.auto_top_up_configs)==null?void 0:T.find(m=>m.status==="ACTIVE")}),S=e.computed(()=>{var g,T;return(T=(g=t.walletBalance.wallet_balance.open_balance)==null?void 0:g.credits)==null?void 0:T.credit_type}),f=(g,T)=>a({credits:{quantity:g,credit_type_id:T,credit_type:S.value}}),v=g=>g.amount?a({amount:g.amount}):g.credits?f(g.credits.quantity,g.credits.credit_type_id):"",p=e.computed(()=>{var g,T;const m=(g=_.value)==null?void 0:g.pricing_item_id;if(!m)return;const C=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===m).flatMap(A=>s(A)).flatMap(A=>A.wallet_grants??[]),B=(T=t.walletBalance.wallet)==null?void 0:T.wallet_type_id;return C.find(A=>A.wallet_type_id===B)??C[0]}),w=e.computed(()=>{var g,T;const m=(g=_.value)==null?void 0:g.topup_amount,C=(T=p.value)==null?void 0:T.credits_grant;if(!m||!C)return"";if(C.credits)return f(C.credits.quantity,C.credits.credit_type_id);if(C.conversion){const B=Number(m.quantity)*Number(C.conversion.rate);return f(String(B),C.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"})),D=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 T=g.topup_amount?a({amount:g.topup_amount}):"",m=v(g.threshold);return!T||!m?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:T,threshold:m}):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:T,threshold:m})});return{walletName:i,formatBalance:a,manualTopUpItems:l,flexibleManualTopUpItem:u,showManualTopUp:c,showAutoTopUp:h,activeTopUpConfig:_,autoTopUpLabel:P,autoTopUpExplanation:D}},dt={class:"flex flex-col gap-3 py-3"},pt={class:"flex flex-col gap-1 px-4"},mt={class:"flex w-full justify-between gap-3"},ft={class:"flex w-full items-center gap-4"},vt={key:0},ht={key:1,class:"flex w-full justify-between gap-3 px-4"},gt={class:"flex min-w-0 items-center gap-1"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"shrink-0"},bt=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:s,flexibleManualTopUpItem:l,showManualTopUp:u,showAutoTopUp:c,activeTopUpConfig:h,autoTopUpLabel:_,autoTopUpExplanation:S}=ct(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[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 p,w;return[(p=t.walletBalance.wallet_balance)!=null&&p.balance_at?(e.openBlock(),e.createBlock(rt,{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",ft,[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(u)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=p=>f.$emit("top-up",e.unref(s)[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",vt,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",gt,[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(S)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",_t,[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",yt,[e.unref(h)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=p=>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]=p=>f.$emit("auto-top-up",e.unref(l)))},{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)]))}}),wt={class:"flex flex-col gap-2"},Tt=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",wt,[(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(bt,{"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 Ct(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Je.withExpand({expandParams:Ze.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function Mt({customerId:t}){const{getCustomerWalletBalances:o}=Ct(),{data:n,execute:a,apiStatus:i,error:s,isPending:l}=et.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:s,fetch:a,isPending:l}}const ve=(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))},St=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,xt=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]:[]))],Bt=(t,o)=>{const n=new Set(xt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:s})=>n.has(s));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:s})=>s),enabledPricingIds:i.flatMap(s=>{var l;return(((l=s.pricing_plan_schedule)==null?void 0:l.enabled_pricings)??[]).flatMap(({pricing_id:u})=>u?[u]:[])})}]})},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))}},Ne=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(s=>{const l=kt(s,t),u=Pt(s,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:s,...l&&{flexiblePricing:l},...u&&{fixedPricing:u}}}):[]});function Pt(t,o){var s,l,u;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(u=(l=(s=t.details)==null?void 0:s.bands)==null?void 0:l[0])==null?void 0:u.fixed_amount;if(!n)return;const a=ke(o),i=a?Nt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const ke=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Ee=(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)},At=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},Nt=(t,o)=>{var n,a;return(a=(n=Ee(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}}),Ve=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function kt(t,o){var c,h,_,S,f,v,p;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)??((S=n==null?void 0:n.maximum_amount)==null?void 0:S.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=ke(o),s=i?At(t,o):void 0,l=(p=i==null?void 0:i.credit_type)==null?void 0:p.unit_name,u=w=>{if(!w)return;const P=i&&s?Ve(w.quantity,s.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,...s&&{creditsConfiguration:{conversionRate:s.rate,...(l==null?void 0:l.singular)&&{unitNameSingle:l.singular},...(l==null?void 0:l.plural)&&{unitNamePlural:l.plural}}},bounds:{...u(n==null?void 0:n.minimum_amount)&&{minimum:u(n==null?void 0:n.minimum_amount)},...u(n==null?void 0:n.maximum_amount)&&{maximum:u(n==null?void 0:n.maximum_amount)}}}}const Et=t=>{var o,n,a,i,s;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((s=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&s.credits)},Vt=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}},$t=(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}},$e=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:s}of t){const l=(i==null?void 0:i.value.credits)??((o=(s==null?void 0:s.bounds.minimum)??(s==null?void 0:s.bounds.maximum))==null?void 0:o.credits);if((a=(n=l==null?void 0:l.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return l.credit_type.unit_name.plural}},Ot=(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{}},Dt=(t=[])=>{if(t.some(Et)){const o=Vt(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}}},qt=(t,o)=>{var l;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(l=n.minimum??n.maximum)==null?void 0:l.credits,s=a?Ve(o.quantity,a.conversionRate):void 0;return i&&s!==void 0?de(s,i):{amount:o}},Oe=(t=[])=>{const o=Dt(t);if(o)return{denomination:o,chargeCurrency:$t(t)??"",creditUnitName:$e(t),conversionRate:Ot(t),topUpBounds:It(t)}},Rt=400;function Ft({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=Pe.createInvoicesService(),a=M.useLogger(),i=e.ref(),s=e.ref(!1),l=M.createLatestGuard(),u=async()=>{const c=t.value,h=l();if(!c||!o.value){o.value&&!c&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the top-up invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,s.value=!1;return}s.value=!0;try{const _=await n({pricingPlanScheduleId:c,pricingItems:o.value});h()&&(i.value=_)}catch(_){h()&&(i.value=void 0),a.error("INVOICE_PREVIEW_FAILED","Failed to load top-up invoice preview",{},_)}finally{h()&&(s.value=!1)}};return nt.useWatchDebounced(o,()=>void u(),{debounce:Rt,deep:!0}),u(),{invoicePreview:i,isPreviewPending:s,loadPreview:u}}const Lt={key:0},Ie=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:s}=Ft({pricingPlanScheduleId:a,pricingItems:i});return(l,u)=>(e.openBlock(),e.createBlock(Se._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(ot._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(Ue._sfc_main$1),{invoice:e.unref(s),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),De=(t,o)=>t.currency??o??t.creditTypeId??"",he=(t,o)=>({quantity:t??null,currency:o}),se=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var s,l,u,c,h;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:he(((l=(s=t==null?void 0:t.threshold)==null?void 0:s.amount)==null?void 0:l.quantity)??((c=(u=t==null?void 0:t.threshold)==null?void 0:u.credits)==null?void 0:c.quantity),De(o,a)),topUpAmount:he(((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??""}}:{}},ge=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},qe=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...ge(t,n)&&{topup_amount:ge(t,n)}}),_e=(t,o)=>qe(se(t,o),o),ye=(t,o)=>JSON.stringify(t)===JSON.stringify(o),be=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},we=(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),Te=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),Re=(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(),s=e.computed(()=>o.entryBase??o.modelBase),l=e.computed(()=>s.value!==o.modelBase&&ee(o.conversionRate)!==void 0),u=e.ref("");e.watch(()=>[n.value,s.value,o.modelBase,o.conversionRate],([m])=>{if(!l.value){u.value=m??"";return}if(m===h(u.value))return;const C=we(m,o.modelBase,s.value,o.conversionRate);u.value=C===void 0?"":Te(C,s.value)},{immediate:!0});function c(m){return typeof m=="string"?m:typeof m=="number"?String(m):""}function h(m){const C=we(m,s.value,o.modelBase,o.conversionRate);return C===void 0?"":Te(C,o.modelBase)}const _=e.computed({get:()=>u.value,set:m=>{u.value=c(m),n.value=l.value?h(u.value):u.value}}),S=e.computed(()=>pe(u.value,s.value,o.conversionRate)),f=e.computed(()=>o.creditUnitName?o.creditUnitName:s.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"})),v=(m,C)=>te.formatAmount({quantity:me(m),currency:C}),p=m=>`${i(m)} ${f.value}`,w=e.computed(()=>{const m=o.error;return Array.isArray(m)?m.length>0:!!(e.isRef(m)?m.value:m)}),P=e.computed(()=>{const m=S.value;if(!(w.value||!o.showConversionHint||m===void 0))return s.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:v(m,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:p(m)})}),D=m=>Re(m,s.value,o.conversionRate,i),g=e.computed(()=>{var m,C,B,A;return s.value==="CREDITS"?f.value:((C=(m=o.bounds)==null?void 0:m.minimum)==null?void 0:C.currency)??((A=(B=o.bounds)==null?void 0:B.maximum)==null?void 0:A.currency)??o.unit}),T=e.computed(()=>{var A,y;const m=D((A=o.bounds)==null?void 0:A.minimum),C=D((y=o.bounds)==null?void 0:y.maximum),B=g.value;if(m&&C)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:m,maximum:C,unit:B});if(m)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:m,unit:B});if(C)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:C,unit:B})});return(m,C)=>(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{modelValue:_.value,"onUpdate:modelValue":C[0]||(C[0]=B=>_.value=B),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},[T.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(T.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,P.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(P.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:s,...l}=o;return l});return(s,l)=>(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(s.$slots,"default")]),_:2},[s.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},Fe=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:s,formatNumber:l}=M.useIntl(),u=e.computed(()=>{var y,x;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(x=(y=a.topUpBounds)==null?void 0:y.minimum)==null?void 0:x.quantity}}),c=e.ref(se(a.config,u.value)),h=e.computed(()=>De(a.denomination,a.creditUnitName)),_=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),S=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,u.value],([y,x])=>{ye(_e(y,x),P())||(c.value=se(y,x))});const p=e.computed({get:()=>a.alwaysEnabled||c.value.enabled,set:y=>{c.value.enabled=y}}),w=e.computed(()=>qe({...c.value,enabled:p.value},u.value)),P=()=>w.value,D=e.reactive({threshold:e.computed(()=>be(c.value.threshold)??null),topUpAmount:e.computed(()=>be(c.value.topUpAmount)??null)}),g=y=>{if(!y)return"";const x=Re(y,_.value,a.conversionRate,l);return x===void 0?te.formatAmount(y):`${x} ${S.value}`},T=I.requiredIf(()=>p.value),m=I.useValidation({threshold:{required:I.common.withMessage(()=>s({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"}),T),notNegative:I.common.withMessage(()=>s({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:I.common.withMessage(()=>s({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"}),T),positive:I.common.withMessage(()=>s({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:I.common.withMessage(()=>{var y;return s({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 x;return Wt(y,(x=a.topUpBounds)==null?void 0:x.minimum)}),withinMaximum:I.common.withMessage(()=>{var y;return s({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 x;return Ht(y,(x=a.topUpBounds)==null?void 0:x.maximum)})}},D),C=e.computed(()=>!ye(P(),_e(a.config,u.value)));function B(){return m.value.$touch(),m.value.$invalid?void 0:P()}function A(){const y=B();y&&i("save",y)}return o({submit:A,validate:B,rule:w,hasChanges:C,isInvalid:e.computed(()=>m.value.$invalid)}),(y,x)=>(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(I._sfc_main),{key:0,modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=q=>p.value=q),"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(s)({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(s)({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(Be._sfc_main),{"is-open":p.value},{default:e.withCtx(()=>[p.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":x[1]||(x[1]=q=>f.value=q),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(m).threshold.$errors,label:e.unref(s)({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":x[2]||(x[2]=q=>v.value=q),name:"auto-top-up-amount",unit:S.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(m).topUpAmount.$errors,label:e.unref(s)({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"]))}}),Ce=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function Le({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,s)=>Ce(s.created_at)-Ce(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,s,l],u)=>{var S;const c=u==null?void 0:u[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));_(l)||(o.value=_(s)?s:(S=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:S.id)},{immediate:!0}),{sortedPaymentMethods:a}}function oe(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>re(t,o,i);return{formatValue:n,formatOpenBalance:i=>n(i==null?void 0:i.wallet_balance.open_balance)}}const Xt={class:"sv-top-up-form"},Kt={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:s}=M.useIntl(),{formatValue:l}=oe(),u=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(d=>d.flexiblePricing||d.fixedPricing);return[...r.filter(({flexiblePricing:d})=>d),...r.filter(({flexiblePricing:d})=>!d)]}),h=r=>c.value.find(d=>d.pricingItemId===r),_=e.computed(()=>{var r,d;return(d=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:d.pricingPlanScheduleId});e.watch(_,r=>{u.value.pricing_plan_schedule_id=r??""},{immediate:!0});const S=r=>{const{config:d,currency:b}=r.flexiblePricing??{},N=d==null?void 0:d.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const d=h(typeof r=="string"?r:void 0);if(!d){u.value.pricing_items=[];return}const b=S(d);u.value.pricing_items=[{pricing_item_id:d.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(c,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=u.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=u.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const d=(b=u.value.pricing_items[0])==null?void 0:b.pricing_item_id;d&&(u.value.pricing_items=[{pricing_item_id:d,...r&&{flexible_amount:r}}])}}),p=r=>{var b;const d=(b=h(String(r)))==null?void 0:b.fixedPricing;return d!=null&&d.value.credits?te.formatAmount(d.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 d=(b=w.value)==null?void 0:b.currency;v.value=r&&d?{quantity:r,currency:d}:void 0}}),D=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",g=e.computed(()=>$e(a.topUpPricingItems)),T=r=>r.creditsConfiguration?g.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,m=r=>{var b;const d=(b=h(String(r)))==null?void 0:b.flexiblePricing;return d?[d]:[]},C=r=>{var d;return!!((d=h(String(r)))!=null&&d.flexiblePricing)},B=e.computed(()=>c.value.map(r=>{var d;return{value:r.pricingItemId,label:r.fixedPricing?l(r.fixedPricing.value):s({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((d=r.flexiblePricing)==null?void 0:d.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:s({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:l(r.flexiblePricing.bounds.minimum),maximum:l(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=u.value.pricing_items.filter(d=>{var b;return!((b=h(d.pricing_item_id))!=null&&b.flexiblePricing)||!!d.flexible_amount});return r.length>0?r:void 0}),y=e.computed(()=>!a.autoTopUpConfig&&c.value.some(({flexiblePricing:d})=>d)?Oe(a.topUpPricingItems):void 0),x=e.ref(),{chargeOnDemandPricingItems:q}=Pe.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!u.value.pricing_plan_schedule_id&&!!A.value&&!!u.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>u.value.payment_method_id??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>s({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"}),I.required)}},G),Y=e.computed(()=>{const[r]=u.value.pricing_items,d=h(r==null?void 0:r.pricing_item_id);return d?qt(d,r==null?void 0:r.flexible_amount):void 0});async function X(){var d,b,N;W.value.$touch();const r=(d=x.value)==null?void 0:d.validate();if(!(W.value.$invalid||(b=x.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await q({pricing_plan_schedule_id:u.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:u.value.payment_method_id,preview:!1});r&&((N=x.value)!=null&&N.hasChanges)&&u.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:u.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:X,isCharging:R,canSubmit:L,chargedValue:Y});const H=e.computed({get:()=>u.value.payment_method_id??void 0,set:r=>{u.value.payment_method_id=r}}),{sortedPaymentMethods:K}=Le({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,d)=>(e.openBlock(),e.createElementBlock("form",Xt,[e.createElementVNode("div",Kt,[e.createElementVNode("div",Jt,[B.value.length>0?(e.openBlock(),e.createBlock(e.unref(xe._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":d[3]||(d[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:B.value,"show-radio":!1,label:e.unref(s)({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),p(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(p(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!C(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),m(N).length>0?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(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:d[1]||(d[1]=e.withModifiers(()=>{},["stop"])),onKeydown:d[2]||(d[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":d[0]||(d[0]=O=>P.value=O),name:"top-up-amount","model-base":"AMOUNT",unit:T(V),"entry-base":D(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(Ie,{"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(Fe,e.mergeProps({ref_key:"autoTopUpFormRef",ref:x,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(tt._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(le._sfc_main,{modelValue:H.value,"onUpdate:modelValue":d[4]||(d[4]=b=>H.value=b),class:"sv-top-up-form__payment-methods","payment-methods":e.unref(K),required:"",error:e.unref(W).paymentMethodId.$errors,"payment-method-options":t.paymentMethodOptions,disabled:R.value,label:e.unref(s)({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:d[5]||(d[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(Ue._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(),s=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"})),l=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})),u=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:re(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:s,subTitle:l,cancelButtonText:u,confirmButtonText:c}}function Ye({isOpen:t,customer:o}){const{paymentMethodOptions:n,get:a,isPending:i}=ut.usePaymentMethodOptions();e.watch(()=>[t.value,o.value],([l,u])=>{!l||!u||a({customerId:u.id,country:st.getCustomerCountry(u)})},{immediate:!0});const s=e.computed(()=>i.value?void 0:n.value);return{paymentMethodOptions:n,settledOptions:s,isPending:i}}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 l;const s=(l=i[0])==null?void 0:l.target;n(s instanceof HTMLElement?s:void 0)});return e.watch(t,(i,s)=>{s&&(a==null||a.unobserve(s)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const so=["inert"],uo=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},uo)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),s={},l=_=>s[_]??(s[_]=S=>{i.value[_]=S instanceof HTMLElement?S:void 0}),u=e.computed(()=>i.value[o.current]),c=io(u),h=e.computed(()=>{const _=o.panes.indexOf(o.current);return _>0?`translateX(calc(${-_} * (100% + ${lo})))`:"translateX(0px)"});return(_,S)=>(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:l(f)},[e.renderSlot(_.$slots,f)],512)],8,so))),128))],4)],6))}}),co={class:"grid grid-cols-1 gap-4 pb-4"},We=e.defineComponent({__name:"WalletModalShell",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(s=>s!==n.addPaymentMethodPane));return o({submit:()=>{var s;return(s=a.value)==null?void 0:s.submit()},isSaving:e.computed(()=>{var s;return!!((s=a.value)!=null&&s.isSaving)})}),(s,l)=>(e.openBlock(),e.createBlock(e.unref(Ae.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:l[2]||(l[2]=u=>s.$emit("confirm")),onClose:l[3]||(l[3]=u=>s.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",co,[e.createVNode(ro,{panes:t.panes,current:t.step},e.createSlots({[t.addPaymentMethodPane]:e.withCtx(()=>[e.createVNode(le._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:l[0]||(l[0]=u=>s.$emit("payment-success")),onFailure:l[1]||(l[1]=u=>s.$emit("payment-failed",u))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,u=>({name:u,fn:e.withCtx(()=>[e.renderSlot(s.$slots,u)])}))]),1032,["panes","current"])])]),_:2},[s.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),He=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},ze=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,je=(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},Qe=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var s,l;const i=!!(((s=t==null?void 0:t.threshold)==null?void 0:s.amount)??((l=t==null?void 0:t.threshold)==null?void 0:l.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 Ge({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(u){return t({url:`${o.apiUrls.config}${n}`,query:{...u},isCollection:!0})}function i(u){return t({url:`${o.apiUrls.config}${n}/${u}`})}function s(u){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:u})}function l(u){return t({url:`${o.apiUrls.config}${n}/${u}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:s,deactivateAutoTopUpConfig:l}}function Ke(){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(s){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},s),{saved:!1,error:s}}finally{n.value=!1}},isSaving:n}}const po={key:0,class:"mb-4"},mo={class:"sr-only"},fo={class:"flex flex-col gap-2"},vo=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:s}=oe(),l=e.computed(()=>ze(He(n.selectedBalanceItem))),u=e.computed(()=>s(n.selectedBalanceItem)),c=e.computed(()=>Bt(n.selectedBalanceItem,n.subscriptions??[])),h=e.ref();e.watch(c,U=>{var E;U.some(({id:ne})=>ne===h.value)||(h.value=(E=U[0])==null?void 0:E.id)},{immediate:!0});const _=e.computed(()=>c.value.length>1),S=e.computed(()=>c.value.map(({id:U,name:$})=>({value:U,label:$}))),f=e.computed(()=>Object.fromEntries(c.value.flatMap(({id:U,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:ne})=>ne===U);return E?[[U,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const U=c.value.find(({id:E})=>E===h.value);return U?Ut(n.selectedBalanceItem,U.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),p=e.computed(()=>Ne(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:D}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),g=e.ref("TOP_UP"),T=e.computed(()=>(n.paymentMethods??[]).length>0),m=e.computed(()=>!D.value&&(w.value??[]).length===0),C=e.computed(()=>g.value==="TOP_UP"&&!T.value&&m.value),B=e.ref(),A=e.ref(),y=()=>{L(),a("payment-success")},{paneRef:x,isActive:q,isSaving:Q,open:R,leave:L,submit:G}=Ge({step:g,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Ke(),Y=e.ref(),X=e.computed(()=>{var U;return(U=Y.value)==null?void 0:U.chargedValue}),H=e.computed(()=>{var U;return Q.value||!!((U=Y.value)!=null&&U.isCharging)}),{title:K,subTitle:r,cancelButtonText:d,confirmButtonText:b}=ao({step:g,currentBalance:u,topUpValue:X}),N=()=>{var U;if(q.value){G();return}(U=Y.value)==null||U.submit()},V=async({rule:U,paymentMethodId:$})=>{const{saved:E}=await W(Qe({rule:U,walletBalanceItem:n.selectedBalanceItem,chargeTarget:je(void 0,p.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=U=>{var $;B.value=U,A.value=($=Y.value)==null?void 0:$.chargedValue,g.value="SUCCESS"},O=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(q.value){L();return}if(g.value==="SUCCESS"){O();return}a("close")}},fe=e.ref(0);return e.watch(()=>n.showModal,U=>{U&&(g.value="TOP_UP",B.value=void 0,A.value=void 0,fe.value+=1)}),(U,$)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:e.unref(K),"sub-title":e.unref(r),"cancel-button-text":e.unref(d),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(St),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(D),"is-adding-payment-method":e.unref(q),onConfirm:N,onCancel:F,onPaymentSuccess:y,onPaymentFailed:$[1]||($[1]=E=>U.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[_.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(xe._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:S.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(it._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",mo,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:fe.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":p.value,"payment-methods":t.paymentMethods,"auto-top-up-config":l.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(()=>[B.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:B.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[g.value==="SUCCESS"||C.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",fo,[g.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:O},{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(d)),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"]))}}),ho=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],go={class:"grid grid-cols-1 gap-4"},_o=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:s}=oe(),l=e.ref("AUTO_TOP_UP"),u=e.computed(()=>s(n.walletBalanceItem)),c=e.computed(()=>Ne(n.walletBalanceItem)),h=e.computed(()=>Oe(c.value)),_=e.computed(()=>He(n.walletBalanceItem)),S=e.computed(()=>ze(_.value)),f=e.computed(()=>je(n.topUpItem,c.value)),v=e.ref(),p=e.computed(()=>{var O,F;const k=(F=(O=v.value)==null?void 0:O.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:D}=Le({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:T,isPending:m}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:C,isActive:B,isSaving:A,open:y,leave:x,submit:q}=Ge({step:l,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Ke(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=I.useValidation({paymentMethodId:{required:I.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"}),I.required)}},G),Y=e.computed(()=>l.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"})),X=e.computed(()=>l.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:u.value})),H=e.computed(()=>l.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"})),K=e.computed(()=>l.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:O}=await Q(Qe({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}O&&a("payment-failed",O)}const d=()=>{if(B.value){q();return}r()},b=()=>{x(),a("payment-success")},N=()=>{if(!L.value){if(B.value){x();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(l.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,O)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:C,"show-modal":t.showModal,title:Y.value,"sub-title":X.value,"cancel-button-text":H.value,"confirm-button-text":K.value,"is-pending":L.value,panes:e.unref(ho),step:l.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(g),"is-payment-method-options-pending":e.unref(m),"is-adding-payment-method":e.unref(B),onConfirm:d,onCancel:N,onPaymentSuccess:b,onPaymentFailed:O[1]||(O[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",go,[h.value?(e.openBlock(),e.createBlock(Fe,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},h.value,{config:S.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ie,{"pricing-plan-schedule-id":w.value,"pricing-items":p.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(le._sfc_main,{modelValue:P.value,"onUpdate:modelValue":O[0]||(O[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(D),"payment-method-options":e.unref(T),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"]))}}),yo={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},bo=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(),s=M.useLogger(),{formatValue:l}=oe(),{deactivateAutoTopUpConfig:u}=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,p=(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"}):p?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:l({amount:p}),threshold:l(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:l(v)})}),S=async()=>{var p;const v=(p=n.config)==null?void 0:p.id;if(!(!v||c.value)){c.value=!0,h.value=!1;try{await u(v),a("confirmed"),a("close")}catch(w){s.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,p)=>(e.openBlock(),e.createBlock(e.unref(Ae.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:S,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",yo,[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(Me._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"]))}}),wo=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(),s=e.ref(),l=e.computed(()=>ve(n.walletBalances,s.value)),u=e.computed(()=>!!l.value),c=e.ref(),h=e.computed(()=>!!c.value),_=e.computed(()=>ve(n.walletBalances,c.value)),S=e.ref(),f=e.computed(()=>!!S.value);return(v,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Se._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(Me._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(Tt),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:p[0]||(p[0]=w=>s.value=w),onAutoTopUp:p[1]||(p[1]=w=>c.value=w),onCancelAutoTopUp:p[2]||(p[2]=w=>S.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(vo,{key:3,"show-modal":u.value,"selected-balance-item":l.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:p[3]||(p[3]=w=>s.value=void 0),onConfirm:p[4]||(p[4]=w=>a("top-up-charged")),onPaymentSuccess:p[5]||(p[5]=w=>a("payment-method-stored")),onPaymentFailed:p[6]||(p[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(_o,{key:4,"show-modal":h.value,"wallet-balance-item":_.value,"top-up-item":c.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:p[7]||(p[7]=w=>c.value=void 0),onSaved:p[8]||(p[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:p[9]||(p[9]=w=>a("payment-method-stored")),onPaymentFailed:p[10]||(p[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(bo,{key:5,"show-modal":f.value,config:S.value,onClose:p[11]||(p[11]=w=>S.value=void 0),onConfirmed:p[12]||(p[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=wo;exports.useCustomerWalletBalances=Mt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),t=require("./usePayments-SQF_V7oL.js"),r=require("./useLoadInitialData-CezlvhBV.js"),d=e.defineComponent({__name:"InvoiceHeader",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(n){return(i,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-invoice-header sv-root sv-component","payment-attempts":n.payments??[],invoice:n.invoice,"download-service":()=>n.invoiceDownloadService(n.invoice.id),"show-download-button":n.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]))}}),v=e.defineComponent({__name:"InvoiceEntryView",props:{invoiceId:{type:String}},setup(n){const i=n,o=t.useInvoice({invoiceId:i.invoiceId}),c=t.usePayments(),{isLoading:a}=r.useLoadInitialData(o.get(),c.get(i.invoiceId));return(s,u)=>e.renderSlot(s.$slots,"default",{invoice:e.unref(o).invoice.value,invoiceDownloadService:e.unref(o).downloadInvoicePdf,payments:e.unref(c),isLoading:e.unref(a)})}});exports._sfc_main=v;exports._sfc_main$1=d;
|