@solvimon/solvimon-web 0.1.0-alpha.21 → 0.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DJCMa2Lz.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B70SyWOB.mjs} +6 -6
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B9WTpz0k.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js} +1 -1
- package/dist/Alert.vue.es-RyK53a2P.js +1 -0
- package/dist/Alert.vue.es-lIiAWf2S.mjs +146 -0
- package/dist/{Avatar.vue.es-ChcLSNaN.mjs → Avatar.vue.es-2E3laNRb.mjs} +1 -1
- package/dist/{Avatar.vue.es-CJw5z7Uu.js → Avatar.vue.es-DdJreyr_.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CTQ5RMtx.js → BillingInformation.vue_vue_type_script_setup_true_lang-ConpyC8n.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DApMAncl.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-D5EoBLhj.mjs} +4 -4
- package/dist/{Button.vue.es-VQCd3V3C.mjs → Button.vue.es-BJEy-e9C.mjs} +1 -1
- package/dist/{Button.vue.es-BWl37nzm.js → Button.vue.es-CJNxYacb.js} +1 -1
- package/dist/Checkout.entry.ce-BfLlnQyb.js +1 -0
- package/dist/{Checkout.entry.ce-DRHqEFd7.mjs → Checkout.entry.ce-CQkrWscC.mjs} +1397 -1302
- package/dist/{Chip.vue.es-CXG8o1Qf.mjs → Chip.vue.es-DGbc4L_D.mjs} +2 -2
- package/dist/{Chip.vue.es-DUgjuRWm.js → Chip.vue.es-DLQ4QEPo.js} +1 -1
- package/dist/{ContextMenu.vue.es-BllxeDTt.js → ContextMenu.vue.es-Bd2kmeVq.js} +1 -1
- package/dist/{ContextMenu.vue.es-C6TKlSXs.mjs → ContextMenu.vue.es-DL1M7pcr.mjs} +4 -4
- package/dist/{CustomerBillingInformation.vue.es-CKQH_ds0.mjs → CustomerBillingInformation.vue.es-CE94ASC3.mjs} +2 -2
- package/dist/{CustomerBillingInformation.vue.es-CMCZ-lIM.js → CustomerBillingInformation.vue.es-hiFzB43w.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BE21tqgW.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BxwllXwU.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bhih7rPR.mjs} +5 -5
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CtaoLbrM.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C5zc9n64.mjs} +486 -502
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D018AmFA.js +1 -0
- package/dist/{DividerText.vue.es-Bomiy4if.mjs → DividerText.vue.es-CFZUQ62L.mjs} +1 -1
- package/dist/{DividerText.vue.es-BBdydUy_.js → DividerText.vue.es-CvCgHHXN.js} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C9elbdbF.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-YcaBJDzx.mjs} +4 -4
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js} +1 -1
- package/dist/{ErrorNotification.vue.es-C6ngWAVU.mjs → ErrorNotification.vue.es-B3mvv79S.mjs} +2 -2
- package/dist/ErrorNotification.vue.es-DI2B7WiR.js +1 -0
- package/dist/IconButton.vue.es-Dp8h4YOx.js +1 -0
- package/dist/IconButton.vue.es-GLcGhoHC.mjs +56 -0
- package/dist/{IconTitle.vue.es-Bbusc4wK.mjs → IconTitle.vue.es-CzuPQtOX.mjs} +3 -3
- package/dist/{IconTitle.vue.es-D-q6w2E-.js → IconTitle.vue.es-DN9r6nfK.js} +1 -1
- package/dist/{Input.vue.es-AY1c0Rui.mjs → Input.vue.es-5Cq8a7oH.mjs} +2 -2
- package/dist/{Input.vue.es-BN95nPBw.js → Input.vue.es-DM81HeVv.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-1WjSbPEP.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D75LSIL8.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-qiBCPY8l.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-w8w52LcV.js} +1 -1
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-DB5h39LA.js +1 -0
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-D99nuBRE.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-dRLsZPNh.mjs} +3 -3
- package/dist/{InvoiceSummary.vue.es-Bs5c2Ovx.mjs → InvoiceSummary.vue.es-DbtqsTuP.mjs} +692 -705
- package/dist/InvoiceSummary.vue.es-Qy99kLZs.js +1 -0
- package/dist/{Modal.vue.es-Chi6_MH_.js → Modal.vue.es-DgLl6XBV.js} +1 -1
- package/dist/{Modal.vue.es-DSkC4eMv.mjs → Modal.vue.es-Z2DWAN2u.mjs} +5 -5
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBm51C7c.js +1 -0
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DYuFPIqs.mjs +294 -0
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DVif_ME8.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CcdhYTB1.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-budeR7ep.mjs → PaymentHistoryBlock-CjP_514k.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-DGJ_PiVq.js → PaymentHistoryBlock-DS1j-8m-.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dv-3suBX.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CSTfMB8U.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C28ofG7N.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dr2jtJhK.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-DqqGcEP1.js → PaymentIntegrationForm-80b19Lkq.js} +1 -1
- package/dist/{PaymentIntegrationForm-Crrhar96.mjs → PaymentIntegrationForm-CpOZUf-W.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C4bk0m8g.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BgztoQH5.mjs} +3 -3
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CcEEdHQJ.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DKXhthkA.js} +1 -1
- package/dist/{PaymentIntegrationFormAdyen-DM-xMcm0.mjs → PaymentIntegrationFormAdyen-BQcgDcik.mjs} +281 -204
- package/dist/PaymentIntegrationFormAdyen-DElXsJ96.js +98 -0
- package/dist/PaymentIntegrationFormStripe-CMwLqOe6.js +102 -0
- package/dist/{PaymentIntegrationFormStripe-yBm4KnpV.mjs → PaymentIntegrationFormStripe-Dx1H3fZ2.mjs} +249 -178
- package/dist/{PaymentMethod.vue.es-BdMcKq8_.mjs → PaymentMethod.vue.es-EhRCfeax.mjs} +3 -3
- package/dist/{PaymentMethod.vue.es-Ctw9Es1g.js → PaymentMethod.vue.es-pLCCzVxN.js} +1 -1
- package/dist/{PaymentMethodForm-BQ5TVHlS.js → PaymentMethodForm-Bw2e1tXo.js} +1 -1
- package/dist/{PaymentMethodForm-C1bIGX10.mjs → PaymentMethodForm-D3OY8zK5.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-V88bCeDt.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-DHXw6qD0.js} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-5KKkuVt5.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-vGprVPpn.mjs} +5 -5
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-B_207kq5.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CdT1YyeU.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CnmZ9dvP.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-D7b0HhDc.mjs} +6 -6
- package/dist/PlanCustomizationEditor-BQqkgmzL.mjs +877 -0
- package/dist/PlanCustomizationEditor-RC8kj2rC.js +1 -0
- package/dist/{PricingGroupRangeInput.vue.es-D82XvoC_.js → PricingGroupRangeInput.vue.es-ClkE98ML.js} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-Bnb-ARie.mjs → PricingGroupRangeInput.vue.es-DNsiUZyT.mjs} +4 -4
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CxMkCmti.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-BJfQLRcS.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-skQMgHEL.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CURXAgMT.mjs} +5 -5
- package/dist/RadioGroupExtended.vue.es-Dk9xdj76.js +1 -0
- package/dist/{RadioGroupExtended.vue.es-WDbo_yj1.mjs → RadioGroupExtended.vue.es-vUqn2ZUP.mjs} +3 -3
- package/dist/{Section.vue.es-By1JltGi.mjs → Section.vue.es-C2_topx4.mjs} +1 -1
- package/dist/{Section.vue.es-DuK52y67.js → Section.vue.es-Cybk1Nb8.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CS3KIkPL.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-C9q_qwjt.mjs} +6 -6
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Ct3ZNq-j.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DIgVzXLg.js} +1 -1
- package/dist/{SubscriptionSchedules-DDCjVEbG.mjs → SubscriptionSchedules-BlCU_xc5.mjs} +1 -1
- package/dist/{SubscriptionSchedules-DEjIERyF.js → SubscriptionSchedules-CNTg_oRy.js} +1 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-6LbR_Vni.js +1 -0
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-JAedXFzq.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cf3Dy8Yn.mjs} +1655 -1620
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js} +1 -1
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DVMS4gJQ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-CjzjchsS.mjs} +3 -3
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BckZJtOc.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-CxdrAanb.mjs} +7 -7
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DiXmEjUD.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-Dz4s3CH_.js} +1 -1
- package/dist/{TooltipParagraph.vue.es-DYu2ReL7.mjs → TooltipParagraph.vue.es-Fu9Od3Vr.mjs} +1 -1
- package/dist/{TooltipParagraph.vue.es-sTgWAgcd.js → TooltipParagraph.vue.es-OX6bAWP9.js} +1 -1
- package/dist/{TrialChip.vue.es-Cl-9_pdr.js → TrialChip.vue.es-CbjdkR4i.js} +1 -1
- package/dist/{TrialChip.vue.es-DX53r0ku.mjs → TrialChip.vue.es-c7tZOIW3.mjs} +2 -2
- package/dist/{cn.es-DjnGlmqV.mjs → cn.es-C8Ogac5T.mjs} +2 -2
- package/dist/{cn.es-CNvIP217.js → cn.es-lC4_Xd0R.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +5 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +7 -7
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +5 -5
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +10 -10
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +8 -8
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +4 -4
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +9 -9
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +5 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +6 -6
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +4 -4
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +26 -23
- package/dist/{customElements-Bt8PbjIn.js → customElements-BYIdPSzQ.js} +43 -19
- package/dist/{customElements-Com2NiGU.mjs → customElements-Df6dGrN-.mjs} +603 -572
- package/dist/{customer-CKgMJEgv.mjs → customer-DmsKYpVi.mjs} +1 -1
- package/dist/{customer-Q4JGfVfq.js → customer-DoLHZuMG.js} +1 -1
- package/dist/{de-DE-DqLD4IX2.js → de-DE-BSlbAnPE.js} +1 -1
- package/dist/{de-DE-CVCmzlNH.mjs → de-DE-Bgm9bnmp.mjs} +21 -0
- package/dist/{de-DE-Ds_yJLS3.js → de-DE-CAL9Mji2.js} +1 -1
- package/dist/{de-DE-DBO5f-Eu.mjs → de-DE-DXsG-vXA.mjs} +13 -8
- 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-E86eRIxh.mjs} +21 -0
- package/dist/{en-US-C51ILrVv.js → en-US-_xe5H4TQ.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{invoices-CV9iAUHf.mjs → invoices-CrO6p4Ms.mjs} +8 -5
- package/dist/invoices-mw87cNTS.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-Dxw59eR_.js → it-IT-QFQ1Ajbb.js} +1 -1
- package/dist/{it-IT-CDMnnFKZ.mjs → it-IT-co1BfV5s.mjs} +23 -2
- package/dist/{nl-NL-Btbfd9p2.js → nl-NL-CJXJC1bx.js} +1 -1
- package/dist/nl-NL-DfkhOJKc.js +1 -0
- package/dist/{nl-NL-o3UvtSNg.mjs → nl-NL-Drv2E66B.mjs} +21 -0
- package/dist/{nl-NL-BWGkVweu.mjs → nl-NL-na2I4aiP.mjs} +8 -3
- package/dist/paymentFailure-Bh60UhxA.mjs +47 -0
- package/dist/paymentFailure-Cki8c5BX.js +1 -0
- package/dist/{paymentMethods-BuwoJ1y9.mjs → paymentMethods-BNQbW_f1.mjs} +1 -1
- package/dist/{paymentMethods-ChWAwDSF.js → paymentMethods-CQdhZwq4.js} +1 -1
- package/dist/{payments-DGckugN0.js → payments-KTjVHqOa.js} +1 -1
- package/dist/{payments-C_cMXQzE.mjs → payments-VS_N2xpJ.mjs} +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 +21 -21
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +14 -14
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +10 -10
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +21 -21
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +20 -20
- package/dist/sessionReference-3h-6FdrC.mjs +43 -0
- package/dist/sessionReference-m_6Rp4X1.js +1 -0
- package/dist/{subscription-CvfAEJeP.mjs → subscription-CrVOr5MF.mjs} +1 -1
- package/dist/{subscription-9GORG-Gt.js → subscription-ZA62t4E9.js} +1 -1
- package/dist/subscriptions-Dugd-oZ1.js +1 -0
- package/dist/{subscriptions-B5VqRayX.mjs → subscriptions-U4xg2CO1.mjs} +2 -2
- package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +1 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.lib.d.ts +2 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +10 -1
- 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/types/types/errors.d.ts +5 -0
- package/dist/{useActionDispatchProvider-B54GYEY7.js → useActionDispatchProvider-CTyDGRX8.js} +1 -1
- package/dist/{useActionDispatchProvider-e2lQXTid.mjs → useActionDispatchProvider-DyQbRCxR.mjs} +1 -1
- package/dist/{useCustomer-BJwJ9BkJ.js → useCustomer-BXI5Vmit.js} +1 -1
- package/dist/{useCustomer-CC9zxV6c.mjs → useCustomer-dcmU1539.mjs} +1 -1
- package/dist/useCustomerFormLabels-BC1WfqWo.mjs +968 -0
- package/dist/useCustomerFormLabels-Ct6vD_b8.js +1 -0
- package/dist/{useExperimentalFeature-B0IFn3Uw.mjs → useExperimentalFeature-4Y-ppDr7.mjs} +1 -1
- package/dist/{useExperimentalFeature-8Mzpj5wc.js → useExperimentalFeature-9-p9_nP6.js} +1 -1
- package/dist/{useInvoiceData-6mHUZC9a.mjs → useInvoiceData-B2Z9aD2w.mjs} +2 -2
- package/dist/{useInvoiceData-Bblwdl0f.js → useInvoiceData-CGvtl7Ai.js} +1 -1
- package/dist/{useInvoicesList-_U1-tn9_.js → useInvoicesList-Ba0GO8p-.js} +1 -1
- package/dist/{useInvoicesList-B5H5JfvY.mjs → useInvoicesList-DJPznhig.mjs} +7 -7
- package/dist/{useLoadInitialData-CezlvhBV.js → useLoadInitialData-BO9ZsSsF.js} +1 -1
- package/dist/{useLoadInitialData-ux_wpNiR.mjs → useLoadInitialData-CWyI3_RR.mjs} +1 -1
- package/dist/{usePaymentMethodAvailability-CkR4TwoV.mjs → usePaymentMethodAvailability-DqIvkjLF.mjs} +4 -4
- package/dist/{usePaymentMethodAvailability-DRwrBdto.js → usePaymentMethodAvailability-bkmDrPXY.js} +1 -1
- package/dist/{usePaymentMethodOptions-B6GIM9q4.js → usePaymentMethodOptions-BPBVGNDg.js} +1 -1
- package/dist/{usePaymentMethodOptions-BfnLBZOo.mjs → usePaymentMethodOptions-MSEp39xQ.mjs} +1 -1
- package/dist/{usePaymentMethods-GFmQRp0X.js → usePaymentMethods-BAOtOJZD.js} +1 -1
- package/dist/{usePaymentMethods-C3QfLSrP.mjs → usePaymentMethods-U7gnZ0F5.mjs} +1 -1
- package/dist/{usePayments-BkwGyZT0.mjs → usePayments-Dq2V6bTV.mjs} +6 -6
- package/dist/{usePayments-SQF_V7oL.js → usePayments-G-HpKpK8.js} +1 -1
- package/dist/{usePortal-BdM7hDge.js → usePortal-BplmMkBG.js} +1 -1
- package/dist/{usePortal-DDG9b6FI.mjs → usePortal-CMHV-ShD.mjs} +1 -1
- package/dist/{useSubscription-Q4C2DPhw.js → useSubscription-CvB8ROBt.js} +1 -1
- package/dist/{useSubscription-BJJYHYgr.mjs → useSubscription-V53WsZwQ.mjs} +1 -1
- package/dist/{useTimePeriod.es-pepm2TpV.js → useTimePeriod.es-CtCTu9cz.js} +1 -1
- package/dist/{useTimePeriod.es-9tZvAhyb.mjs → useTimePeriod.es-D31Zl1MJ.mjs} +1 -1
- package/dist/wallets.es-CNIMW5ay.js +1 -0
- package/dist/wallets.es-eH2C2ygn.mjs +102 -0
- package/package.json +2 -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/ErrorNotification.vue.es-0ZC_DozN.js +0 -1
- package/dist/IconButton.vue.es-DAR7e8NA.mjs +0 -198
- package/dist/IconButton.vue.es-DGLIdHkR.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/PaymentErrorCard.vue_vue_type_script_setup_true_lang-Draz_8Ts.js +0 -1
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-vD88j_U7.mjs +0 -144
- package/dist/PaymentIntegrationFormAdyen-DronjwO3.js +0 -98
- package/dist/PaymentIntegrationFormStripe-ybM6wirp.js +0 -102
- package/dist/PlanCustomizationEditor-CCOTD6Qu.mjs +0 -769
- package/dist/PlanCustomizationEditor-CiZnVCM6.js +0 -1
- package/dist/RadioGroupExtended.vue.es-B1YtLNKG.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BlX0W6lw.js +0 -1
- package/dist/component-5wqcK7yz.mjs +0 -8
- package/dist/component-B7ZDyqBp.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/subscriptions-X0Ciw8z3.js +0 -1
- package/dist/useCustomerFormLabels-72Pxw8X5.js +0 -1
- package/dist/useCustomerFormLabels-V2YuYMLU.mjs +0 -930
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../../formatting.es-C72Nsrmh.js"),k=require("../../Button.vue.es-BWl37nzm.js"),x=require("../../index.es-BclokHQX.js"),w=require("../../usePayments-SQF_V7oL.js"),B=require("../../InvoiceSummary.vue.es-B0MPR0oI.js"),M=require("../../Section.vue.es-DuK52y67.js"),f=require("../../customElements-Bt8PbjIn.js"),_=require("../../ContentWithAsideLayout-C6yMIVJF.js"),O=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CcEEdHQJ.js"),g=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),S=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js"),P=require("../../usePaymentMethodAvailability-DRwrBdto.js"),V=require("../../customer.es-BButyYo0.js"),A=require("../../useLoadInitialData-CezlvhBV.js"),I=require("../../usePaymentMethodOptions-B6GIM9q4.js"),N=require("../../usePaymentMethods-GFmQRp0X.js"),T=require("../../component-B7ZDyqBp.js"),q={class:"flex items-center gap-1 border-0 py-0"},z=["id","name","disabled","value"],E=["for"],L=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean},label:{},id:{},name:{},value:{},disabled:{type:Boolean},size:{default:"md"}},setup(t){const n=t,o=x.useVModel(n,"modelValue"),s={sm:"size-2",md:"size-4"},r=e.computed(()=>s[n.size]),l={sm:"text-xs",md:"text-sm"},c=e.computed(()=>l[n.size]);return(a,i)=>(e.openBlock(),e.createElementBlock("label",q,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.id},a.$attrs,{"onUpdate:modelValue":i[0]||(i[0]=m=>e.isRef(o)?o.value=m:null),name:t.name,disabled:t.disabled,value:t.value,type:"checkbox",class:["rounded checked:bg-primary-600 checked:hover:bg-primary-700",{"border border-gray-300 checked:border-gray-300 checked:bg-gray-400 checked:hover:bg-gray-500":t.disabled,"bg-gray-100":t.disabled&&!e.unref(o),"bg-gray-300 text-primary-600":!t.disabled&&e.unref(o),"cursor-pointer":!t.disabled,[r.value]:!0}],onClickCapture:i[1]||(i[1]=e.withModifiers(()=>{},["stop"]))}),null,16,z),[[e.vModelCheckbox,e.unref(o)]]),e.createElementVNode("span",{for:t.id,class:e.normalizeClass(["leading-tight",{[c.value]:!0}])},e.toDisplayString(t.label),11,E)]))}}),j=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},intent:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String},preventDoubleClick:{type:Boolean}},emits:["click"],setup(t){const n=t,{$t:o}=f.useIntl(),s=e.computed(()=>({intent:n.intent??"primary",disabled:n.disabled,iconPrefix:n.iconPrefix,iconSuffix:n.iconSuffix,loading:n.loading,pill:n.pill,size:n.size??"lg",square:n.square,tag:n.tag,type:n.type})),r=e.computed(()=>{var c,a,i;switch((c=n.paymentMethod)==null?void 0:c.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(a=n.paymentMethod)!=null&&a.paymentMethodType?e.capitalize((i=n.paymentMethod)==null?void 0:i.paymentMethodType):""}}),l=e.computed(()=>n.amount&&n.paymentMethod?o({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:b.formatAmount(n.amount),type:r.value}):n.amount?o({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:b.formatAmount(n.amount),type:r.value}):o({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(c,a)=>(e.openBlock(),e.createBlock(e.unref(k._sfc_main),e.mergeProps(s.value,{class:"w-full",onClick:a[0]||(a[0]=i=>c.$emit("click",i))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},16))}}),$={class:"mt-4"},D={key:0},R=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:n}=f.useIntl(),o=t,{availability:s}=P.usePaymentMethodAvailability({paymentMethodOptions:()=>o.paymentMethodOptions,isLoading:()=>o.isLoading,context:()=>{var y;return{invoiceId:(y=o.invoice)==null?void 0:y.id}}}),r=e.ref(),l=e.ref(!0),c=e.ref(),a=e.ref(!1);function i(){if(!c.value)throw new Error("payment integration form not found");a.value=!0,c.value.submit()}const m=()=>{o.configuration.onPaymentSuccess&&o.configuration.onPaymentSuccess()},v=()=>{a.value=!1};return(y,d)=>(e.openBlock(),e.createBlock(e.unref(_.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(w._sfc_main),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var h,u;return[t.isLoading?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(h=t.invoice)!=null&&h.paid?(e.openBlock(),e.createBlock(S._sfc_main,{key:1,status:"success",title:e.unref(n)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main$1),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(b.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(S._sfc_main,{key:2,status:"error",title:e.unref(n)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.unref(s)==="READY"?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,title:e.unref(n)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":a.value})},[e.createVNode(O._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:c,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"store-payment-method":l.value,"invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions??[],variant:"AUTHORIZE",onPaymentSuccess:m,onPaymentFailed:v,onSelect:d[0]||(d[0]=p=>r.value=p)},null,8,["amount","country-code","context","customer-id","store-payment-method","invoice-id","payment-method-options"]),e.createElementVNode("div",$,[e.createVNode(e.unref(L),{id:"pay-invoice-store-payment-method",modelValue:l.value,"onUpdate:modelValue":d[1]||(d[1]=p=>l.value=p),label:e.unref(n)({id:"pay_invoice.store_payment_method.label",defaultMessage:"Save this payment method for future payments",description:"Label of the checkbox that stores the payment method while paying an invoice"})},null,8,["modelValue","label"])])],2)]),_:1},8,["title"])):(e.openBlock(),e.createBlock(P._sfc_main,{key:1,variant:"AUTHORIZE","seller-name":(u=t.invoice.billing_entity)==null?void 0:u.legal_name},{default:e.withCtx(()=>[t.downloadService?(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:0,type:"button",intent:"secondary",onClick:d[2]||(d[2]=()=>{var p;return(p=t.downloadService)==null?void 0:p.call(t,t.invoice.id)})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Download invoice",description:"Button that downloads the invoice when it cannot be paid online",id:"pay_invoice.unavailable.download_invoice"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["seller-name"]))],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(g._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice&&!t.invoice.paid&&e.unref(s)==="READY"?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(j,{disabled:!r.value||a.value,loading:a.value,amount:t.amount,"payment-method":r.value,onClick:i},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),F=e.defineComponent({__name:"PayInvoice.entry.view",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}},setup(t){const n=t,{invoice:o,get:s,downloadInvoicePdf:r,error:l}=w.useInvoice({invoiceId:n.configuration.invoiceId}),{payments:c,get:a}=w.usePayments(),{fetchInitial:i}=N.usePaymentMethods({customerId:n.portalObject.customer_id}),{paymentMethodOptions:m,get:v}=I.usePaymentMethodOptions(),y=async()=>{const u=await s();await v({customerId:u.customer.id,amount:u.open_invoice_amount})},{isLoading:d}=A.useLoadInitialData(y(),i(),a(n.configuration.invoiceId)),h=e.computed(()=>{var u;return(u=o.value)!=null&&u.customer?V.getCustomerCountry(o.value.customer):void 0});return(u,p)=>{var C;return e.renderSlot(u.$slots,"default",{invoice:e.unref(o),isLoading:e.unref(d),amount:(C=e.unref(o))==null?void 0:C.open_invoice_amount,countryCode:h.value,paymentMethodOptions:e.unref(m),paymentAttempts:e.unref(c),downloadService:e.unref(r),error:e.unref(l)})}}}),U=e.defineComponent({__name:"PayInvoice.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}},setup(t){const n=T.getComponentName("pay-invoice");return(o,s)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main$1),{entry:o.$props,"component-name":e.unref(n),"allowed-portal-types":["CUSTOMER"],onError:s[0]||(s[0]=r=>o.$emit("error",r))},{default:e.withCtx(()=>[e.createVNode(F,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:r,isLoading:l,amount:c,countryCode:a,paymentMethodOptions:i,paymentAttempts:m,downloadService:v,error:y})=>[e.createVNode(R,{"is-loading":l,invoice:r,amount:c,"country-code":a,"payment-method-options":i,configuration:t.configuration,"payment-attempts":m??[],"download-service":v,error:y},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service","error"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:W}=f.createSolvimonElement(U,"pay-invoice");exports.defineSolvimonPayInvoice=W;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../../formatting.es-C72Nsrmh.js"),k=require("../../Button.vue.es-CJNxYacb.js"),x=require("../../index.es-BclokHQX.js"),w=require("../../usePayments-G-HpKpK8.js"),B=require("../../InvoiceSummary.vue.es-Qy99kLZs.js"),M=require("../../Section.vue.es-Cybk1Nb8.js"),f=require("../../customElements-BYIdPSzQ.js"),_=require("../../ContentWithAsideLayout-C6yMIVJF.js"),O=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DKXhthkA.js"),g=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),S=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js"),P=require("../../usePaymentMethodAvailability-bkmDrPXY.js"),V=require("../../customer.es-BButyYo0.js"),A=require("../../useLoadInitialData-BO9ZsSsF.js"),I=require("../../usePaymentMethodOptions-BPBVGNDg.js"),N=require("../../usePaymentMethods-BAOtOJZD.js"),T=require("../../sessionReference-m_6Rp4X1.js"),q={class:"flex items-center gap-1 border-0 py-0"},z=["id","name","disabled","value"],E=["for"],L=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean},label:{},id:{},name:{},value:{},disabled:{type:Boolean},size:{default:"md"}},setup(t){const n=t,o=x.useVModel(n,"modelValue"),s={sm:"size-2",md:"size-4"},r=e.computed(()=>s[n.size]),l={sm:"text-xs",md:"text-sm"},c=e.computed(()=>l[n.size]);return(a,i)=>(e.openBlock(),e.createElementBlock("label",q,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.id},a.$attrs,{"onUpdate:modelValue":i[0]||(i[0]=m=>e.isRef(o)?o.value=m:null),name:t.name,disabled:t.disabled,value:t.value,type:"checkbox",class:["rounded checked:bg-primary-600 checked:hover:bg-primary-700",{"border border-gray-300 checked:border-gray-300 checked:bg-gray-400 checked:hover:bg-gray-500":t.disabled,"bg-gray-100":t.disabled&&!e.unref(o),"bg-gray-300 text-primary-600":!t.disabled&&e.unref(o),"cursor-pointer":!t.disabled,[r.value]:!0}],onClickCapture:i[1]||(i[1]=e.withModifiers(()=>{},["stop"]))}),null,16,z),[[e.vModelCheckbox,e.unref(o)]]),e.createElementVNode("span",{for:t.id,class:e.normalizeClass(["leading-tight",{[c.value]:!0}])},e.toDisplayString(t.label),11,E)]))}}),j=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},intent:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String},preventDoubleClick:{type:Boolean}},emits:["click"],setup(t){const n=t,{$t:o}=f.useIntl(),s=e.computed(()=>({intent:n.intent??"primary",disabled:n.disabled,iconPrefix:n.iconPrefix,iconSuffix:n.iconSuffix,loading:n.loading,pill:n.pill,size:n.size??"lg",square:n.square,tag:n.tag,type:n.type})),r=e.computed(()=>{var c,a,i;switch((c=n.paymentMethod)==null?void 0:c.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(a=n.paymentMethod)!=null&&a.paymentMethodType?e.capitalize((i=n.paymentMethod)==null?void 0:i.paymentMethodType):""}}),l=e.computed(()=>n.amount&&n.paymentMethod?o({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:b.formatAmount(n.amount),type:r.value}):n.amount?o({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:b.formatAmount(n.amount),type:r.value}):o({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(c,a)=>(e.openBlock(),e.createBlock(e.unref(k._sfc_main),e.mergeProps(s.value,{class:"w-full",onClick:a[0]||(a[0]=i=>c.$emit("click",i))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},16))}}),$={class:"mt-4"},R={key:0},D=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:n}=f.useIntl(),o=t,{availability:s}=P.usePaymentMethodAvailability({paymentMethodOptions:()=>o.paymentMethodOptions,isLoading:()=>o.isLoading,context:()=>{var y;return{invoiceId:(y=o.invoice)==null?void 0:y.id}}}),r=e.ref(),l=e.ref(!0),c=e.ref(),a=e.ref(!1);function i(){if(!c.value)throw new Error("payment integration form not found");a.value=!0,c.value.submit()}const m=()=>{o.configuration.onPaymentSuccess&&o.configuration.onPaymentSuccess()},v=()=>{a.value=!1};return(y,d)=>(e.openBlock(),e.createBlock(e.unref(_.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(w._sfc_main),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var h,u;return[t.isLoading?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(h=t.invoice)!=null&&h.paid?(e.openBlock(),e.createBlock(S._sfc_main,{key:1,status:"success",title:e.unref(n)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main$1),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(b.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(S._sfc_main,{key:2,status:"error",title:e.unref(n)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.unref(s)==="READY"?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,title:e.unref(n)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":a.value})},[e.createVNode(O._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:c,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"store-payment-method":l.value,"invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions??[],variant:"AUTHORIZE",onPaymentSuccess:m,onPaymentFailed:v,onSelect:d[0]||(d[0]=p=>r.value=p)},null,8,["amount","country-code","context","customer-id","store-payment-method","invoice-id","payment-method-options"]),e.createElementVNode("div",$,[e.createVNode(e.unref(L),{id:"pay-invoice-store-payment-method",modelValue:l.value,"onUpdate:modelValue":d[1]||(d[1]=p=>l.value=p),label:e.unref(n)({id:"pay_invoice.store_payment_method.label",defaultMessage:"Save this payment method for future payments",description:"Label of the checkbox that stores the payment method while paying an invoice"})},null,8,["modelValue","label"])])],2)]),_:1},8,["title"])):(e.openBlock(),e.createBlock(P._sfc_main,{key:1,variant:"AUTHORIZE","seller-name":(u=t.invoice.billing_entity)==null?void 0:u.legal_name},{default:e.withCtx(()=>[t.downloadService?(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:0,type:"button",intent:"secondary",onClick:d[2]||(d[2]=()=>{var p;return(p=t.downloadService)==null?void 0:p.call(t,t.invoice)})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Download invoice",description:"Button that downloads the invoice when it cannot be paid online",id:"pay_invoice.unavailable.download_invoice"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["seller-name"]))],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(g._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice&&!t.invoice.paid&&e.unref(s)==="READY"?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(j,{disabled:!r.value||a.value,loading:a.value,amount:t.amount,"payment-method":r.value,onClick:i},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),F=e.defineComponent({__name:"PayInvoice.entry.view",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}},setup(t){const n=t,{invoice:o,get:s,downloadInvoicePdf:r,error:l}=w.useInvoice({invoiceId:n.configuration.invoiceId}),{payments:c,get:a}=w.usePayments(),{fetchInitial:i}=N.usePaymentMethods({customerId:n.portalObject.customer_id}),{paymentMethodOptions:m,get:v}=I.usePaymentMethodOptions(),y=async()=>{const u=await s();await v({customerId:u.customer.id,amount:u.open_invoice_amount})},{isLoading:d}=A.useLoadInitialData(y(),i(),a(n.configuration.invoiceId)),h=e.computed(()=>{var u;return(u=o.value)!=null&&u.customer?V.getCustomerCountry(o.value.customer):void 0});return(u,p)=>{var C;return e.renderSlot(u.$slots,"default",{invoice:e.unref(o),isLoading:e.unref(d),amount:(C=e.unref(o))==null?void 0:C.open_invoice_amount,countryCode:h.value,paymentMethodOptions:e.unref(m),paymentAttempts:e.unref(c),downloadService:e.unref(r),error:e.unref(l)})}}}),U=e.defineComponent({__name:"PayInvoice.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}},setup(t){const n=T.getComponentName("pay-invoice");return(o,s)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main$1),{entry:o.$props,"component-name":e.unref(n),"allowed-portal-types":["CUSTOMER"],onError:s[0]||(s[0]=r=>o.$emit("error",r))},{default:e.withCtx(()=>[e.createVNode(F,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:r,isLoading:l,amount:c,countryCode:a,paymentMethodOptions:i,paymentAttempts:m,downloadService:v,error:y})=>[e.createVNode(D,{"is-loading":l,invoice:r,amount:c,"country-code":a,"payment-method-options":i,configuration:t.configuration,"payment-attempts":m??[],"download-service":v,error:y},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service","error"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:W}=f.createSolvimonElement(U,"pay-invoice");exports.defineSolvimonPayInvoice=W;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { defineComponent as k, computed as w, openBlock as l, createElementBlock as I, withDirectives as R, createElementVNode as O, mergeProps as L, withModifiers as _, unref as n, isRef as F, vModelCheckbox as D, normalizeClass as j, toDisplayString as S, capitalize as N, createBlock as u, withCtx as r, createTextVNode as x, ref as M, createVNode as p, createCommentVNode as b, Fragment as U, renderSlot as W, normalizeProps as q, guardReactiveProps as H } from "vue";
|
|
2
2
|
import { f as $ } from "../../formatting.es-RclXHhKo.mjs";
|
|
3
|
-
import { _ as V, a as K } from "../../Button.vue.es-
|
|
3
|
+
import { _ as V, a as K } from "../../Button.vue.es-BJEy-e9C.mjs";
|
|
4
4
|
import { u as Y } from "../../index.es-CXkP_k3u.mjs";
|
|
5
|
-
import { _ as Z, u as G, a as J } from "../../usePayments-
|
|
6
|
-
import { _ as Q } from "../../InvoiceSummary.vue.es-
|
|
7
|
-
import { _ as X } from "../../Section.vue.es-
|
|
8
|
-
import { u as E, _ as z, d as ee, e as te } from "../../customElements-
|
|
5
|
+
import { _ as Z, u as G, a as J } from "../../usePayments-Dq2V6bTV.mjs";
|
|
6
|
+
import { _ as Q } from "../../InvoiceSummary.vue.es-DbtqsTuP.mjs";
|
|
7
|
+
import { _ as X } from "../../Section.vue.es-C2_topx4.mjs";
|
|
8
|
+
import { u as E, _ as z, d as ee, e as te } from "../../customElements-Df6dGrN-.mjs";
|
|
9
9
|
import { C as ne } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
|
|
10
|
-
import { _ as ae } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { _ as ae } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BgztoQH5.mjs";
|
|
11
11
|
import { _ as A } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
|
|
12
|
-
import { _ as T } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-
|
|
13
|
-
import { u as oe, _ as ie } from "../../usePaymentMethodAvailability-
|
|
12
|
+
import { _ as T } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CcdhYTB1.mjs";
|
|
13
|
+
import { u as oe, _ as ie } from "../../usePaymentMethodAvailability-DqIvkjLF.mjs";
|
|
14
14
|
import { g as re } from "../../customer.es-B5ppZf0j.mjs";
|
|
15
|
-
import { u as se } from "../../useLoadInitialData-
|
|
16
|
-
import { u as ce } from "../../usePaymentMethodOptions-
|
|
17
|
-
import { u as le } from "../../usePaymentMethods-
|
|
18
|
-
import {
|
|
15
|
+
import { u as se } from "../../useLoadInitialData-CWyI3_RR.mjs";
|
|
16
|
+
import { u as ce } from "../../usePaymentMethodOptions-MSEp39xQ.mjs";
|
|
17
|
+
import { u as le } from "../../usePaymentMethods-U7gnZ0F5.mjs";
|
|
18
|
+
import { a as de } from "../../sessionReference-3h-6FdrC.mjs";
|
|
19
19
|
const me = { class: "flex items-center gap-1 border-0 py-0" }, ue = ["id", "name", "disabled", "value"], ye = ["for"], pe = /* @__PURE__ */ k({
|
|
20
20
|
__name: "Checkbox",
|
|
21
21
|
props: {
|
|
@@ -238,7 +238,7 @@ const me = { class: "flex items-center gap-1 border-0 py-0" }, ue = ["id", "name
|
|
|
238
238
|
key: 0,
|
|
239
239
|
invoice: e.invoice,
|
|
240
240
|
"payment-attempts": e.paymentAttempts,
|
|
241
|
-
"download-service": () => e.downloadService(e.invoice
|
|
241
|
+
"download-service": () => e.downloadService(e.invoice)
|
|
242
242
|
}, null, 8, ["invoice", "payment-attempts", "download-service"])) : b("", !0)
|
|
243
243
|
]),
|
|
244
244
|
_: 1
|
|
@@ -366,7 +366,7 @@ const me = { class: "flex items-center gap-1 border-0 py-0" }, ue = ["id", "name
|
|
|
366
366
|
intent: "secondary",
|
|
367
367
|
onClick: v[2] || (v[2] = () => {
|
|
368
368
|
var h;
|
|
369
|
-
return (h = e.downloadService) == null ? void 0 : h.call(e, e.invoice
|
|
369
|
+
return (h = e.downloadService) == null ? void 0 : h.call(e, e.invoice);
|
|
370
370
|
})
|
|
371
371
|
}, {
|
|
372
372
|
default: r(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("../../Button.vue.es-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("../../Button.vue.es-CJNxYacb.js"),y=require("../../Section.vue.es-Cybk1Nb8.js"),c=require("../../customElements-BYIdPSzQ.js"),f=require("../../ContentWithAsideLayout-C6yMIVJF.js"),g=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-CdT1YyeU.js"),h=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-DHXw6qD0.js"),_=require("../../useCustomer-BXI5Vmit.js"),v=require("../../usePaymentMethods-BAOtOJZD.js"),S=require("../../usePaymentMethodOptions-BPBVGNDg.js"),C=require("../../useLoadInitialData-BO9ZsSsF.js"),M=require("../../sessionReference-m_6Rp4X1.js"),k={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},O={key:0},B=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup(o){return(r,a)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",null,[e.createVNode(e.unref(c._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]),_:1}),o.description?(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{key:0,variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.description),1)]),_:1})):e.createCommentVNode("",!0)]),r.$slots.right?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(r.$slots,"right")])):e.createCommentVNode("",!0)]))}}),b=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default","delete","added"],setup(o,{emit:r}){const a=r,{$t:i}=c.useIntl(),n=e.ref(!1),m=()=>{n.value=!1,a("added")};return(d,t)=>(e.openBlock(),e.createBlock(e.unref(f.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(B,{title:e.unref(i)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(i)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(y._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(g._sfc_main,{"payment-methods":o.paymentMethods,onSetDefault:t[0]||(t[0]=s=>a("set-default")),onDelete:t[1]||(t[1]=s=>a("delete"))},null,8,["payment-methods"])]),_:1}),n.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,customer:o.customer,"payment-method-options":o.paymentMethodOptions,onSuccess:m},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:1,intent:"secondary",onClick:t[2]||(t[2]=s=>n.value=!1)},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:2,intent:"secondary",onClick:t[3]||(t[3]=s=>n.value=!0)},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),P=e.defineComponent({__name:"PaymentMethodsManagement.entry.view",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}},setup(o){const r=o,a=r.portalObject.customer_id,{customer:i,get:n}=_.useCustomer({customerId:a}),{items:m,fetchInitial:d}=v.usePaymentMethods({customerId:r.portalObject.customer_id}),{paymentMethodOptions:t,get:s}=S.usePaymentMethodOptions(),{isLoading:p}=C.useLoadInitialData(n.execute(),d(),s({customerId:r.portalObject.customer_id}));return(u,x)=>e.renderSlot(u.$slots,"default",{customer:e.unref(i),paymentMethods:e.unref(m),paymentMethodOptions:e.unref(t),isLoading:e.unref(p),refreshPaymentMethods:e.unref(d)})}}),w=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup(o){const r=M.getComponentName("payment-methods-management");return(a,i)=>(e.openBlock(),e.createBlock(e.unref(c._sfc_main$1),{entry:a.$props,"component-name":e.unref(r),"allowed-portal-types":["CUSTOMER"],onError:i[0]||(i[0]=n=>a.$emit("error",n))},{default:e.withCtx(()=>[e.createVNode(P,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:n,paymentMethods:m,paymentMethodOptions:d,isLoading:t,refreshPaymentMethods:s})=>[n?(e.openBlock(),e.createBlock(b,{key:0,"is-loading":t,"payment-methods":m,"payment-method-options":d,customer:n,onSetDefault:s,onDelete:s,onAdded:s},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault","onDelete","onAdded"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:N}=c.createSolvimonElement(w,"payment-methods-management");exports.defineSolvimonPaymentMethodsManagement=N;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as f, openBlock as i, createElementBlock as h, createElementVNode as b, createVNode as c, unref as t, withCtx as m, createTextVNode as u, toDisplayString as _, createBlock as p, createCommentVNode as g, renderSlot as M, ref as C, normalizeProps as A, guardReactiveProps as j } from "vue";
|
|
2
|
-
import { _ as S } from "../../Button.vue.es-
|
|
3
|
-
import { _ as k } from "../../Section.vue.es-
|
|
4
|
-
import { _ as v, u as P, d as L, e as w } from "../../customElements-
|
|
2
|
+
import { _ as S } from "../../Button.vue.es-BJEy-e9C.mjs";
|
|
3
|
+
import { _ as k } from "../../Section.vue.es-C2_topx4.mjs";
|
|
4
|
+
import { _ as v, u as P, d as L, e as w } from "../../customElements-Df6dGrN-.mjs";
|
|
5
5
|
import { C as D } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
|
|
6
|
-
import { _ as T } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { _ as B } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { u as I } from "../../useCustomer-
|
|
9
|
-
import { u as N } from "../../usePaymentMethods-
|
|
10
|
-
import { u as x } from "../../usePaymentMethodOptions-
|
|
11
|
-
import { u as E } from "../../useLoadInitialData-
|
|
12
|
-
import {
|
|
6
|
+
import { _ as T } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-D7b0HhDc.mjs";
|
|
7
|
+
import { _ as B } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-vGprVPpn.mjs";
|
|
8
|
+
import { u as I } from "../../useCustomer-dcmU1539.mjs";
|
|
9
|
+
import { u as N } from "../../usePaymentMethods-U7gnZ0F5.mjs";
|
|
10
|
+
import { u as x } from "../../usePaymentMethodOptions-MSEp39xQ.mjs";
|
|
11
|
+
import { u as E } from "../../useLoadInitialData-CWyI3_RR.mjs";
|
|
12
|
+
import { a as F } from "../../sessionReference-3h-6FdrC.mjs";
|
|
13
13
|
const R = { class: "grid gap-4 sm:grid-cols-1 md:grid-cols-2" }, V = { key: 0 }, z = /* @__PURE__ */ f({
|
|
14
14
|
__name: "ScreenTitle",
|
|
15
15
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("../../IconButton.vue.es-DGLIdHkR.js"),P=require("../../Button.vue.es-BWl37nzm.js"),A=require("../../ErrorNotification.vue.es-0ZC_DozN.js"),b=require("../../customElements-Bt8PbjIn.js"),$=require("../../ContentWithAsideLayout-C6yMIVJF.js"),I=require("../../useActionDispatchProvider-B54GYEY7.js"),E=require("../../subscription-9GORG-Gt.js"),L=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C_yKvYtG.js"),O=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js"),R=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js"),U=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),T=require("../../Section.vue.es-DuK52y67.js"),j=require("../../pricing-BVAld27Y.js"),V=require("../../formatting.es-C72Nsrmh.js"),W=require("../../PaymentMethod.vue.es-Ctw9Es1g.js"),F=require("../../Modal.vue.es-Chi6_MH_.js"),Y=require("../../subscriptions-X0Ciw8z3.js"),z=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js"),G=require("../../api.es-duCDtZD9.js"),H=require("../../useIncrementalLoading-CaWOE8Xl.js"),Z=require("../../paymentMethods-ChWAwDSF.js"),J=require("../../error-CmduqgVq.js"),K=require("../../useSubscription-Q4C2DPhw.js"),Q=require("../../useCustomer-BJwJ9BkJ.js"),X=require("../../usePaymentMethods-GFmQRp0X.js"),ee=require("../../useLoadInitialData-CezlvhBV.js"),te=require("../../component-B7ZDyqBp.js");function ne({subscription:t}){const{dispatchAction:s}=I.useActionDispatchProvider(),i=e.computed(()=>{if(!t.value)return!1;const u=t.value.inactive_periods;return!u||u.length===0}),n=e.computed(()=>{var g;const u=(g=t.value)==null?void 0:g.inactive_periods;return Array.isArray(u)&&u.length>0}),a=e.ref();return{isCancellable:i,isRenewable:n,pendingVariant:a,cancel:()=>{t.value&&(a.value="CANCEL")},renew:()=>{t.value&&(a.value="RENEW")},dismiss:()=>{a.value=void 0},manage:()=>{t.value&&s({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}function ie(t){var n,a,o,r,c,d,u;const s=(o=(a=(n=t.items)==null?void 0:n[0])==null?void 0:a.configs)==null?void 0:o[0],i=(c=(r=s==null?void 0:s.details)==null?void 0:r.bands)==null?void 0:c[0];return{amount:(i==null?void 0:i.amount)??(i==null?void 0:i.fixed_amount),billingPeriod:((d=s==null?void 0:s.details)==null?void 0:d.pricing_period)??((u=s==null?void 0:s.details)==null?void 0:u.billing_period)}}function oe(t){var n,a,o;const s=new Set((((n=t.pricing_plan_schedule)==null?void 0:n.enabled_pricings)??[]).map(({pricing_id:r})=>r));return s.size===0?[]:(((o=(a=t.pricing_plan_version)==null?void 0:a.pricing_categories)==null?void 0:o.flatMap(r=>r.pricing_groups??[]))??[]).flatMap(r=>(r.pricings??[]).filter(c=>s.has(c.id)).map(c=>({pricingId:c.id,pricingGroupId:r.id,groupName:r.name,name:j.getNameFromPricing(c)||r.name,...ie(c)})))}const ae={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},se={class:"sv-enabled-pricings-list__item-content grow"},re=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>{const{amount:a,billingPeriod:o}=s.entry;if(a)return o?i({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:V.formatAmount(a),period:V.formatBillingPeriod(o,{short:!0,hideValueForExactPeriods:!0})}):V.formatAmount(a)});return(a,o)=>(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",se,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"subtle",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),n.value?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(P._sfc_main),{intent:"secondary",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:o[0]||(o[0]=r=>a.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),ce={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},le=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>oe(s.pricingPlanSchedule));return(a,o)=>n.value.length>0?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(i)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(re,{key:r.pricingId,entry:r,onUpgrade:o[0]||(o[0]=c=>a.$emit("upgrade",c))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});function ue({variant:t,renewableUntil:s,billingPeriodEndsAt:i}){const{$t:n}=b.useIntl(),a=e.computed(()=>t.value==="RENEW"),o=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):n({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),r=e.computed(()=>a.value?s.value?n({defaultMessage:"You can renew your subscription until {date}. After this period you can only create a new subscription.",description:"Explanation of the deadline for undoing a cancellation, shown in the renew subscription modal",id:"subscription_cancellation_modal.renew.explanation_with_date"},{date:s.value}):n({defaultMessage:"Your subscription will continue as before, and billing will resume on its usual schedule.",description:"Explanation of what happens when a cancellation is undone, shown in the renew subscription modal when no end date is known",id:"subscription_cancellation_modal.renew.explanation"}):i.value?n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until {date}.",description:"Explanation of what happens when a running subscription is cancelled, naming the date access ends, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation_with_date"},{date:i.value}):n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until the end of the billing period.",description:"Explanation of what happens when a running subscription is cancelled, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation"})),c=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):n({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),d=e.computed(()=>n({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),u=e.computed(()=>a.value?n({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):n({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}));return{title:o,explanation:r,confirmButtonText:c,cancelButtonText:d,errorMessage:u}}const de=50;function pe(){const{getPaymentMethods:t}=Z.createPaymentMethodsService(),s=e.shallowRef();return{paymentMethod:s,get:async({customerId:n,paymentMethodId:a})=>{const o=await G.getPaginatedFullList(async r=>{const c=await t({customerId:n,pagination:{page:r,pageSize:de}});if(!H.isApiSuccessCollectionResponse(c))throw new Error("Could not load the customer’s payment methods.");return c});return s.value=o.data.find(({id:r})=>r===a),s.value}}}const me={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},be={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},fe={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},ge=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(t,{emit:s}){const i=t,n=s,{$t:a,formatDate:o}=b.useIntl(),r=b.useLogger(),{setSubscriptionCancellation:c}=Y.createSubscriptionsService(),d=e.computed(()=>i.variant),u=e.computed(()=>{var _;const l=((_=i.subscription)==null?void 0:_.inactive_periods)??[],f=l.find(({type:N})=>N==="CANCEL")??l[0];if(f)return o({date:f.start_at,format:"date",offsetType:"local"})}),g=e.computed(()=>{var f,_;const l=(_=(f=i.subscription)==null?void 0:f.next_invoice)==null?void 0:_.invoice_date;if(l)return o({date:l,format:"date",offsetType:"local"})}),y=g,w=e.computed(()=>{var l,f;return(((f=(l=E.getMostRecentScheduleInfo(i.subscription))==null?void 0:l.pricing_plan_schedule)==null?void 0:f.enabled_pricings)??[]).map(({pricing_id:_})=>_).filter(_=>!!_)}),{title:h,explanation:C,confirmButtonText:S,cancelButtonText:k,errorMessage:B}=ue({variant:d,renewableUntil:u,billingPeriodEndsAt:g}),{paymentMethod:v,get:M}=pe();e.watch([()=>i.showModal,()=>{var l;return(l=i.subscription)==null?void 0:l.payment_method_id},()=>{var l;return(l=i.subscription)==null?void 0:l.customer_id}],([l,f,_])=>{var N;!l||!f||!_||f!==((N=v.value)==null?void 0:N.id)&&M({customerId:_,paymentMethodId:f}).catch(()=>{})},{immediate:!0});const p=e.ref(!1),m=e.ref(!1);e.watch(()=>i.showModal,l=>{l&&(m.value=!1)});const x=async()=>{if(!(!i.subscription||!i.variant||p.value)){p.value=!0,m.value=!1;try{await c({id:i.subscription.id,variant:i.variant}),n("confirmed"),n("close")}catch(l){r.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:i.variant},l),m.value=!0}finally{p.value=!1}}},q=()=>{p.value||n("close")};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(F.Modal),{size:"md","show-modal":t.showModal,title:e.unref(h),"confirm-button-text":e.unref(S),"cancel-button-text":e.unref(k),"is-loading":p.value,"no-click-away":p.value,"no-backdrop-close":p.value,onConfirm:x,onClose:q},{body:e.withCtx(()=>[e.createElementVNode("div",me,[e.createVNode(e.unref(b._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1}),t.subscription?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(z._sfc_main,{subscription:t.subscription,avatar:t.avatar,"enabled-pricing-ids":w.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(y)||e.unref(v)?(e.openBlock(),e.createElementBlock("div",be,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Renews",description:"Label before the date the subscription renews, shown in the cancel subscription modal",id:"subscription_cancellation_modal.renews_label"})),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createBlock(e.unref(W._sfc_main),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(v)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(B)},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","title","confirm-button-text","cancel-button-text","is-loading","no-click-away","no-backdrop-close"]))}}),_e={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},he=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},avatar:{type:String},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","subscription-changed"],setup(t,{emit:s}){const i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../SubscriptionSchedules-DEjIERyF.js"))),n=t,a=s,{$t:o}=b.useIntl(),{isCancellable:r,isRenewable:c,pendingVariant:d,cancel:u,renew:g,dismiss:y,manage:w}=ne({subscription:e.toRef(n,"subscription")}),h=e.ref();e.watch(d,p=>{p&&(h.value=void 0)});const C=()=>{h.value=d.value,a("subscription-changed")},S=e.computed(()=>{if(h.value)return h.value==="RENEW"?o({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):o({defaultMessage:"Your subscription has been cancelled. You keep access until the end of the billing period.",id:"subscription_details.cancel_success",description:"Confirmation shown after a subscription has been cancelled"})}),k=e.computed(()=>E.getMostRecentScheduleInfo(n.subscription)),B=e.computed(()=>(n.paymentMethods??[]).find(({id:p})=>{var m;return p===((m=n.subscription)==null?void 0:m.payment_method_id)})),v=e.computed(()=>n.subscription?[n.subscription]:[]),M=e.computed(()=>E.getSubscriptionName({subscription:n.subscription,fallback:o({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(p,m)=>(e.openBlock(),e.createBlock(e.unref($.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(e.unref(b._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M.value),1)]),_:1}),e.unref(c)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:1,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[S.value?(e.openBlock(),e.createBlock(e.unref(D._sfc_main),{key:0,class:"sv-subscription-details__cancellation-success",type:"success",title:S.value},null,8,["title"])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(o)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(U._sfc_main,{key:2,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createBlock(e.unref(i),{key:3,class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])):(e.openBlock(),e.createBlock(R._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(L._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":!!t.hasWalletBalancesError,"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:v.value,onTopUpCharged:m[0]||(m[0]=x=>p.$emit("top-up-charged")),onAutoTopUpSaved:m[1]||(m[1]=x=>p.$emit("auto-top-up-saved")),onAutoTopUpCancelled:m[2]||(m[2]=x=>p.$emit("auto-top-up-cancelled")),onPaymentMethodStored:m[3]||(m[3]=x=>p.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),k.value?(e.openBlock(),e.createBlock(le,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":k.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(O._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[B.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(ge,{"show-modal":!!e.unref(d),variant:e.unref(d),subscription:t.subscription,avatar:t.avatar,onConfirmed:C,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),ve=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},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}},setup(t){const s=t,i=s.portalObject.customer_id,{subscription:n,withPlanData:a,get:o,error:r}=K.useSubscription({subscriptionId:s.configuration.subscriptionId}),{customer:c,get:d}=Q.useCustomer({customerId:i}),{items:u,fetchAll:g}=X.usePaymentMethods({customerId:i}),{walletBalances:y,apiStatus:w,fetch:h}=L.useCustomerWalletBalances({customerId:i}),{isLoading:C}=ee.useLoadInitialData(o(),d.execute(),g(),h()),S=e.computed(()=>n.value?a(n.value):[]),k=e.computed(()=>{var v;return((v=y.value)==null?void 0:v.wallet_balances)??[]}),B=e.computed(()=>w.value===J.ApiStatus.Failed);return(v,M)=>e.renderSlot(v.$slots,"default",{subscription:e.unref(n),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(u),walletBalances:k.value,hasWalletBalancesError:B.value,isLoading:e.unref(C),error:e.unref(r),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(g),refreshSubscription:e.unref(o)})}}),ye=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},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}},setup(t){const s=te.getComponentName("subscription-details");return(i,n)=>(e.openBlock(),e.createBlock(e.unref(b._sfc_main$1),{entry:i.$props,"component-name":e.unref(s),"allowed-portal-types":["CUSTOMER"],onError:n[0]||(n[0]=a=>i.$emit("error",a))},{default:e.withCtx(()=>[e.createVNode(ve,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({subscription:a,schedulesData:o,customer:r,paymentMethods:c,walletBalances:d,hasWalletBalancesError:u,isLoading:g,error:y,refreshWalletBalances:w,refreshPaymentMethods:h,refreshSubscription:C})=>[e.createVNode(he,{subscription:a,"schedules-data":o,customer:r,avatar:t.configuration.avatar,"payment-methods":c,"wallet-balances":d,"has-wallet-balances-error":u,"is-loading":g,error:y,onTopUpCharged:w,onAutoTopUpSaved:w,onAutoTopUpCancelled:w,onPaymentMethodStored:h,onSubscriptionChanged:C},null,8,["subscription","schedules-data","customer","avatar","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onAutoTopUpSaved","onAutoTopUpCancelled","onPaymentMethodStored","onSubscriptionChanged"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:we}=b.createSolvimonElement(ye,"subscription-details");exports.defineSolvimonSubscriptionDetails=we;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("../../Alert.vue.es-RyK53a2P.js"),P=require("../../Button.vue.es-CJNxYacb.js"),T=require("../../ErrorNotification.vue.es-DI2B7WiR.js"),b=require("../../customElements-BYIdPSzQ.js"),$=require("../../ContentWithAsideLayout-C6yMIVJF.js"),I=require("../../useActionDispatchProvider-CTyDGRX8.js"),E=require("../../subscription-ZA62t4E9.js"),L=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D018AmFA.js"),O=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BE21tqgW.js"),R=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js"),U=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),A=require("../../Section.vue.es-Cybk1Nb8.js"),j=require("../../pricing-BVAld27Y.js"),V=require("../../formatting.es-C72Nsrmh.js"),W=require("../../PaymentMethod.vue.es-pLCCzVxN.js"),F=require("../../Modal.vue.es-DgLl6XBV.js"),Y=require("../../subscriptions-Dugd-oZ1.js"),z=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js"),G=require("../../api.es-duCDtZD9.js"),H=require("../../useIncrementalLoading-CaWOE8Xl.js"),Z=require("../../paymentMethods-CQdhZwq4.js"),J=require("../../error-CmduqgVq.js"),K=require("../../useSubscription-CvB8ROBt.js"),Q=require("../../useCustomer-BXI5Vmit.js"),X=require("../../usePaymentMethods-BAOtOJZD.js"),ee=require("../../useLoadInitialData-BO9ZsSsF.js"),te=require("../../sessionReference-m_6Rp4X1.js");function ne({subscription:t}){const{dispatchAction:s}=I.useActionDispatchProvider(),i=e.computed(()=>{if(!t.value)return!1;const u=t.value.inactive_periods;return!u||u.length===0}),n=e.computed(()=>{var g;const u=(g=t.value)==null?void 0:g.inactive_periods;return Array.isArray(u)&&u.length>0}),a=e.ref();return{isCancellable:i,isRenewable:n,pendingVariant:a,cancel:()=>{t.value&&(a.value="CANCEL")},renew:()=>{t.value&&(a.value="RENEW")},dismiss:()=>{a.value=void 0},manage:()=>{t.value&&s({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}function ie(t){var n,a,o,r,c,d,u;const s=(o=(a=(n=t.items)==null?void 0:n[0])==null?void 0:a.configs)==null?void 0:o[0],i=(c=(r=s==null?void 0:s.details)==null?void 0:r.bands)==null?void 0:c[0];return{amount:(i==null?void 0:i.amount)??(i==null?void 0:i.fixed_amount),billingPeriod:((d=s==null?void 0:s.details)==null?void 0:d.pricing_period)??((u=s==null?void 0:s.details)==null?void 0:u.billing_period)}}function oe(t){var n,a,o;const s=new Set((((n=t.pricing_plan_schedule)==null?void 0:n.enabled_pricings)??[]).map(({pricing_id:r})=>r));return s.size===0?[]:(((o=(a=t.pricing_plan_version)==null?void 0:a.pricing_categories)==null?void 0:o.flatMap(r=>r.pricing_groups??[]))??[]).flatMap(r=>(r.pricings??[]).filter(c=>s.has(c.id)).map(c=>({pricingId:c.id,pricingGroupId:r.id,groupName:r.name,name:j.getNameFromPricing(c)||r.name,...ie(c)})))}const ae={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},se={class:"sv-enabled-pricings-list__item-content grow"},re=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>{const{amount:a,billingPeriod:o}=s.entry;if(a)return o?i({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:V.formatAmount(a),period:V.formatBillingPeriod(o,{short:!0,hideValueForExactPeriods:!0})}):V.formatAmount(a)});return(a,o)=>(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",se,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"subtle",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),n.value?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(P._sfc_main),{intent:"secondary",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:o[0]||(o[0]=r=>a.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),ce={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},le=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>oe(s.pricingPlanSchedule));return(a,o)=>n.value.length>0?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(i)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(re,{key:r.pricingId,entry:r,onUpgrade:o[0]||(o[0]=c=>a.$emit("upgrade",c))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});function ue({variant:t,renewableUntil:s,billingPeriodEndsAt:i}){const{$t:n}=b.useIntl(),a=e.computed(()=>t.value==="RENEW"),o=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):n({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),r=e.computed(()=>a.value?s.value?n({defaultMessage:"You can renew your subscription until {date}. After this period you can only create a new subscription.",description:"Explanation of the deadline for undoing a cancellation, shown in the renew subscription modal",id:"subscription_cancellation_modal.renew.explanation_with_date"},{date:s.value}):n({defaultMessage:"Your subscription will continue as before, and billing will resume on its usual schedule.",description:"Explanation of what happens when a cancellation is undone, shown in the renew subscription modal when no end date is known",id:"subscription_cancellation_modal.renew.explanation"}):i.value?n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until {date}.",description:"Explanation of what happens when a running subscription is cancelled, naming the date access ends, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation_with_date"},{date:i.value}):n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until the end of the billing period.",description:"Explanation of what happens when a running subscription is cancelled, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation"})),c=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):n({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),d=e.computed(()=>n({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),u=e.computed(()=>a.value?n({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):n({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}));return{title:o,explanation:r,confirmButtonText:c,cancelButtonText:d,errorMessage:u}}const de=50;function pe(){const{getPaymentMethods:t}=Z.createPaymentMethodsService(),s=e.shallowRef();return{paymentMethod:s,get:async({customerId:n,paymentMethodId:a})=>{const o=await G.getPaginatedFullList(async r=>{const c=await t({customerId:n,pagination:{page:r,pageSize:de}});if(!H.isApiSuccessCollectionResponse(c))throw new Error("Could not load the customer’s payment methods.");return c});return s.value=o.data.find(({id:r})=>r===a),s.value}}}const me={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},be={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},fe={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},ge=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(t,{emit:s}){const i=t,n=s,{$t:a,formatDate:o}=b.useIntl(),r=b.useLogger(),{setSubscriptionCancellation:c}=Y.createSubscriptionsService(),d=e.computed(()=>i.variant),u=e.computed(()=>{var _;const l=((_=i.subscription)==null?void 0:_.inactive_periods)??[],f=l.find(({type:N})=>N==="CANCEL")??l[0];if(f)return o({date:f.start_at,format:"date",offsetType:"local"})}),g=e.computed(()=>{var f,_;const l=(_=(f=i.subscription)==null?void 0:f.next_invoice)==null?void 0:_.invoice_date;if(l)return o({date:l,format:"date",offsetType:"local"})}),y=g,w=e.computed(()=>{var l,f;return(((f=(l=E.getMostRecentScheduleInfo(i.subscription))==null?void 0:l.pricing_plan_schedule)==null?void 0:f.enabled_pricings)??[]).map(({pricing_id:_})=>_).filter(_=>!!_)}),{title:h,explanation:C,confirmButtonText:S,cancelButtonText:k,errorMessage:B}=ue({variant:d,renewableUntil:u,billingPeriodEndsAt:g}),{paymentMethod:v,get:M}=pe();e.watch([()=>i.showModal,()=>{var l;return(l=i.subscription)==null?void 0:l.payment_method_id},()=>{var l;return(l=i.subscription)==null?void 0:l.customer_id}],([l,f,_])=>{var N;!l||!f||!_||f!==((N=v.value)==null?void 0:N.id)&&M({customerId:_,paymentMethodId:f}).catch(()=>{})},{immediate:!0});const p=e.ref(!1),m=e.ref(!1);e.watch(()=>i.showModal,l=>{l&&(m.value=!1)});const x=async()=>{if(!(!i.subscription||!i.variant||p.value)){p.value=!0,m.value=!1;try{await c({id:i.subscription.id,variant:i.variant}),n("confirmed"),n("close")}catch(l){r.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:i.variant},l),m.value=!0}finally{p.value=!1}}},q=()=>{p.value||n("close")};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(F.Modal),{size:"md","show-modal":t.showModal,title:e.unref(h),"confirm-button-text":e.unref(S),"cancel-button-text":e.unref(k),"is-loading":p.value,"no-click-away":p.value,"no-backdrop-close":p.value,onConfirm:x,onClose:q},{body:e.withCtx(()=>[e.createElementVNode("div",me,[e.createVNode(e.unref(b._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1}),t.subscription?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(z._sfc_main,{subscription:t.subscription,avatar:t.avatar,"enabled-pricing-ids":w.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(y)||e.unref(v)?(e.openBlock(),e.createElementBlock("div",be,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Renews",description:"Label before the date the subscription renews, shown in the cancel subscription modal",id:"subscription_cancellation_modal.renews_label"})),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createBlock(e.unref(W._sfc_main),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(v)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(B)},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","title","confirm-button-text","cancel-button-text","is-loading","no-click-away","no-backdrop-close"]))}}),_e={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},he=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},avatar:{type:String},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","subscription-changed"],setup(t,{emit:s}){const i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../SubscriptionSchedules-CNTg_oRy.js"))),n=t,a=s,{$t:o}=b.useIntl(),{isCancellable:r,isRenewable:c,pendingVariant:d,cancel:u,renew:g,dismiss:y,manage:w}=ne({subscription:e.toRef(n,"subscription")}),h=e.ref();e.watch(d,p=>{p&&(h.value=void 0)});const C=()=>{h.value=d.value,a("subscription-changed")},S=e.computed(()=>{if(h.value)return h.value==="RENEW"?o({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):o({defaultMessage:"Your subscription has been cancelled. You keep access until the end of the billing period.",id:"subscription_details.cancel_success",description:"Confirmation shown after a subscription has been cancelled"})}),k=e.computed(()=>E.getMostRecentScheduleInfo(n.subscription)),B=e.computed(()=>(n.paymentMethods??[]).find(({id:p})=>{var m;return p===((m=n.subscription)==null?void 0:m.payment_method_id)})),v=e.computed(()=>n.subscription?[n.subscription]:[]),M=e.computed(()=>E.getSubscriptionName({subscription:n.subscription,fallback:o({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(p,m)=>(e.openBlock(),e.createBlock(e.unref($.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(e.unref(b._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M.value),1)]),_:1}),e.unref(c)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:1,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[S.value?(e.openBlock(),e.createBlock(e.unref(D._sfc_main),{key:0,class:"sv-subscription-details__cancellation-success",type:"success",title:S.value},null,8,["title"])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(o)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(U._sfc_main,{key:2,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createBlock(e.unref(i),{key:3,class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])):(e.openBlock(),e.createBlock(R._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(L._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":!!t.hasWalletBalancesError,"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:v.value,onTopUpCharged:m[0]||(m[0]=x=>p.$emit("top-up-charged")),onAutoTopUpSaved:m[1]||(m[1]=x=>p.$emit("auto-top-up-saved")),onAutoTopUpCancelled:m[2]||(m[2]=x=>p.$emit("auto-top-up-cancelled")),onPaymentMethodStored:m[3]||(m[3]=x=>p.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),k.value?(e.openBlock(),e.createBlock(le,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":k.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(O._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[B.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(ge,{"show-modal":!!e.unref(d),variant:e.unref(d),subscription:t.subscription,avatar:t.avatar,onConfirmed:C,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),ve=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},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}},setup(t){const s=t,i=s.portalObject.customer_id,{subscription:n,withPlanData:a,get:o,error:r}=K.useSubscription({subscriptionId:s.configuration.subscriptionId}),{customer:c,get:d}=Q.useCustomer({customerId:i}),{items:u,fetchAll:g}=X.usePaymentMethods({customerId:i}),{walletBalances:y,apiStatus:w,fetch:h}=L.useCustomerWalletBalances({customerId:i}),{isLoading:C}=ee.useLoadInitialData(o(),d.execute(),g(),h()),S=e.computed(()=>n.value?a(n.value):[]),k=e.computed(()=>{var v;return((v=y.value)==null?void 0:v.wallet_balances)??[]}),B=e.computed(()=>w.value===J.ApiStatus.Failed);return(v,M)=>e.renderSlot(v.$slots,"default",{subscription:e.unref(n),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(u),walletBalances:k.value,hasWalletBalancesError:B.value,isLoading:e.unref(C),error:e.unref(r),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(g),refreshSubscription:e.unref(o)})}}),ye=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},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}},setup(t){const s=te.getComponentName("subscription-details");return(i,n)=>(e.openBlock(),e.createBlock(e.unref(b._sfc_main$1),{entry:i.$props,"component-name":e.unref(s),"allowed-portal-types":["CUSTOMER"],onError:n[0]||(n[0]=a=>i.$emit("error",a))},{default:e.withCtx(()=>[e.createVNode(ve,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({subscription:a,schedulesData:o,customer:r,paymentMethods:c,walletBalances:d,hasWalletBalancesError:u,isLoading:g,error:y,refreshWalletBalances:w,refreshPaymentMethods:h,refreshSubscription:C})=>[e.createVNode(he,{subscription:a,"schedules-data":o,customer:r,avatar:t.configuration.avatar,"payment-methods":c,"wallet-balances":d,"has-wallet-balances-error":u,"is-loading":g,error:y,onTopUpCharged:w,onAutoTopUpSaved:w,onAutoTopUpCancelled:w,onPaymentMethodStored:h,onSubscriptionChanged:C},null,8,["subscription","schedules-data","customer","avatar","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onAutoTopUpSaved","onAutoTopUpCancelled","onPaymentMethodStored","onSubscriptionChanged"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:we}=b.createSolvimonElement(ye,"subscription-details");exports.defineSolvimonSubscriptionDetails=we;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { computed as u, ref as D, defineComponent as O, openBlock as c, createBlock as m, unref as e, withCtx as p, createElementVNode as U, createVNode as M, createTextVNode as w, toDisplayString as S, createCommentVNode as C, createElementBlock as F, Fragment as Z, renderList as J, shallowRef as K, watch as W, defineAsyncComponent as Q, toRef as X, renderSlot as ee, normalizeProps as te, guardReactiveProps as ne } from "vue";
|
|
2
|
-
import { _ as ae } from "../../
|
|
3
|
-
import { _ as V } from "../../Button.vue.es-
|
|
4
|
-
import { _ as G } from "../../ErrorNotification.vue.es-
|
|
5
|
-
import { u as N, _ as E, b as se, d as ie, e as oe } from "../../customElements-
|
|
2
|
+
import { _ as ae } from "../../Alert.vue.es-lIiAWf2S.mjs";
|
|
3
|
+
import { _ as V } from "../../Button.vue.es-BJEy-e9C.mjs";
|
|
4
|
+
import { _ as G } from "../../ErrorNotification.vue.es-B3mvv79S.mjs";
|
|
5
|
+
import { u as N, _ as E, b as se, d as ie, e as oe } from "../../customElements-Df6dGrN-.mjs";
|
|
6
6
|
import { C as re } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
|
|
7
|
-
import { u as le } from "../../useActionDispatchProvider-
|
|
8
|
-
import { b as q, a as ce } from "../../subscription-
|
|
9
|
-
import { _ as ue, u as de } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { _ as pe } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
import { _ as me } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { u as le } from "../../useActionDispatchProvider-DyQbRCxR.mjs";
|
|
8
|
+
import { b as q, a as ce } from "../../subscription-CrVOr5MF.mjs";
|
|
9
|
+
import { _ as ue, u as de } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C5zc9n64.mjs";
|
|
10
|
+
import { _ as pe } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bhih7rPR.mjs";
|
|
11
|
+
import { _ as me } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-YcaBJDzx.mjs";
|
|
12
12
|
import { _ as be } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
|
|
13
|
-
import { _ as Y } from "../../Section.vue.es-
|
|
13
|
+
import { _ as Y } from "../../Section.vue.es-C2_topx4.mjs";
|
|
14
14
|
import { g as ge } from "../../pricing-DLOeiAIB.mjs";
|
|
15
15
|
import { f as z, b as fe } from "../../formatting.es-RclXHhKo.mjs";
|
|
16
|
-
import { _ as he } from "../../PaymentMethod.vue.es-
|
|
17
|
-
import { M as ve } from "../../Modal.vue.es-
|
|
18
|
-
import { c as _e } from "../../subscriptions-
|
|
19
|
-
import { _ as ye } from "../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-
|
|
16
|
+
import { _ as he } from "../../PaymentMethod.vue.es-EhRCfeax.mjs";
|
|
17
|
+
import { M as ve } from "../../Modal.vue.es-Z2DWAN2u.mjs";
|
|
18
|
+
import { c as _e } from "../../subscriptions-U4xg2CO1.mjs";
|
|
19
|
+
import { _ as ye } from "../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-CjzjchsS.mjs";
|
|
20
20
|
import { g as we } from "../../api.es-QaC926Xu.mjs";
|
|
21
21
|
import { i as Se } from "../../useIncrementalLoading-Cgxw2GD7.mjs";
|
|
22
|
-
import { c as Ce } from "../../paymentMethods-
|
|
22
|
+
import { c as Ce } from "../../paymentMethods-BNQbW_f1.mjs";
|
|
23
23
|
import { A as Me } from "../../error-BHVZJGwD.mjs";
|
|
24
|
-
import { u as xe } from "../../useSubscription-
|
|
25
|
-
import { u as $e } from "../../useCustomer-
|
|
26
|
-
import { u as Pe } from "../../usePaymentMethods-
|
|
27
|
-
import { u as Ae } from "../../useLoadInitialData-
|
|
28
|
-
import {
|
|
24
|
+
import { u as xe } from "../../useSubscription-V53WsZwQ.mjs";
|
|
25
|
+
import { u as $e } from "../../useCustomer-dcmU1539.mjs";
|
|
26
|
+
import { u as Pe } from "../../usePaymentMethods-U7gnZ0F5.mjs";
|
|
27
|
+
import { u as Ae } from "../../useLoadInitialData-CWyI3_RR.mjs";
|
|
28
|
+
import { a as ke } from "../../sessionReference-3h-6FdrC.mjs";
|
|
29
29
|
function Ee({
|
|
30
30
|
subscription: t
|
|
31
31
|
}) {
|
|
@@ -470,7 +470,7 @@ const Fe = { class: "sv-subscription-cancellation-modal sv-subscription-cancella
|
|
|
470
470
|
emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "subscription-changed"],
|
|
471
471
|
setup(t, { emit: o }) {
|
|
472
472
|
const a = Q(
|
|
473
|
-
() => import("../../SubscriptionSchedules-
|
|
473
|
+
() => import("../../SubscriptionSchedules-BlCU_xc5.mjs")
|
|
474
474
|
), n = t, i = o, { $t: s } = N(), {
|
|
475
475
|
isCancellable: r,
|
|
476
476
|
isRenewable: l,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A=require("../../Button.vue.es-BWl37nzm.js"),L=require("../../ErrorNotification.vue.es-0ZC_DozN.js"),m=require("../../customElements-Bt8PbjIn.js"),Y=require("../../ContentWithAsideLayout-C6yMIVJF.js"),K=require("../../useActionDispatchProvider-B54GYEY7.js"),H=require("../../usePortal-BdM7hDge.js"),J=require("../../useSubscription-Q4C2DPhw.js"),Q=require("../../useCustomer-BJwJ9BkJ.js"),X=require("../../usePaymentMethods-GFmQRp0X.js"),Z=require("../../usePaymentMethodOptions-B6GIM9q4.js"),ee=require("../../useLoadInitialData-CezlvhBV.js"),te=require("../../invoices-CvpL4rv5.js"),E=require("../../pricingPlanSchedule-COfmWv_o.js"),ne=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Ct3ZNq-j.js"),ie=require("../../Divider.vue.es-UwnWvUTl.js"),ae=require("../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CxMkCmti.js"),T=require("../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B9WTpz0k.js"),oe=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js"),se=require("../../Section.vue.es-DuK52y67.js"),j=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),re=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js"),ce=require("../../Modal.vue.es-Chi6_MH_.js"),ue=require("../../component-B7ZDyqBp.js");function le(){const{getInvoicePreview:t}=te.createInvoicesService(),a=m.useLogger(),n=e.ref(),o=e.ref(!1),c=e.ref(),p=m.createLatestGuard();return{invoice:n,isPending:o,error:c,load:async({subscription:u,enabledPricingIds:f})=>{const s=E.getScheduleCustomizations({enabledPricings:f.map(d=>({pricing_id:d})),pricingPlanScheduleInfos:u.pricing_plan_schedule_infos});if(!s){n.value=void 0;return}const i=p();o.value=!0,c.value=void 0;try{const d=await t({forExistingSubscription:!0,pricingPlanSubscriptionId:u.id,customizations:s});if(!i())return;n.value=d.invoice}catch(d){if(!i())return;a.error("INVOICE_PREVIEW_FAILED","Failed to preview the subscription upgrade",{},d),c.value=d,n.value=void 0}finally{i()&&(o.value=!1)}}}}function de(){const t=m.createRequestService(),a=m.useConfig();function n({scheduleId:c}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules/${c}/on-demand-pricing-items`})}function o({pricingPlanSubscriptionId:c,enabledPricings:p}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules`,options:{method:"POST"},data:{pricing_plan_subscription_id:c,enabled_pricings:p,start_at:new Date().toJSON()}})}return{getOnDemandPricingItems:n,createPricingPlanSchedule:o}}const me={class:"sv-subscription-management-form__body grid grid-cols-1 gap-4"},pe=e.defineComponent({__name:"SubscriptionManagementForm",props:e.mergeModels({pricingGroup:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},billingPeriod:{type:Object},currency:{type:String},disabled:{type:Boolean}},{enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{},paymentMethodId:{},paymentMethodIdModifiers:{}}),emits:e.mergeModels(["add-payment-method"],["update:enabledPricingIds","update:paymentMethodId"]),setup(t,{emit:a}){const n=t,o=a,c=e.useModel(t,"enabledPricingIds"),p=e.useModel(t,"paymentMethodId"),{$t:_}=m.useIntl(),u=s=>{const i=s?Date.parse(s):NaN;return Number.isFinite(i)?i:0},f=e.computed(()=>[...n.paymentMethods??[]].sort((s,i)=>u(i.created_at)-u(s.created_at)));return e.watch(()=>n.paymentMethods,(s,i)=>{var P;const d=s==null?void 0:s.find(({id:b})=>!(i!=null&&i.some(B=>B.id===b)));if(d&&(i!=null&&i.length)){p.value=d.id;return}s!=null&&s.some(({id:b})=>b===p.value)||(p.value=(P=(s==null?void 0:s.find(({is_default:b})=>b))??f.value[0])==null?void 0:P.id)},{immediate:!0}),(s,i)=>(e.openBlock(),e.createElementBlock("form",{class:"sv-subscription-management-form",onSubmit:i[3]||(i[3]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",me,[e.createVNode(ae._sfc_main,{modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=d=>c.value=d),class:"sv-subscription-management-form__pricing-group","group-name":t.pricingGroup.name,pricings:t.pricingGroup.pricings,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"]),e.createElementVNode("div",null,[e.createVNode(e.unref(ie._sfc_main),{spacing:"xs"})]),e.createVNode(T._sfc_main,{modelValue:p.value,"onUpdate:modelValue":i[1]||(i[1]=d=>p.value=d),class:"sv-subscription-management-form__payment-methods","payment-methods":f.value,"payment-method-options":t.paymentMethodOptions,required:"",disabled:t.disabled,label:e.unref(_)({defaultMessage:"Payment method",id:"subscription_management.payment_method_selector.label",description:"Label above the payment method that pays for the subscription change"}),onAddPaymentMethod:i[2]||(i[2]=d=>o("add-payment-method"))},null,8,["modelValue","payment-methods","payment-method-options","disabled","label"])])],32))}}),ge=e.defineComponent({__name:"TranslationOverride",props:{messages:{type:Object}},setup(t){const a=t,n=e.inject(m.TRANSLATION_SETTINGS_KEY,void 0),o=e.computed(()=>({...n==null?void 0:n.messages.value,...a.messages}));return(c,p)=>{var _,u;return e.openBlock(),e.createBlock(e.unref(m._sfc_main$2),{locale:(_=e.unref(n))==null?void 0:_.locale.value,"date-locale":(u=e.unref(n))==null?void 0:u.dateLocale.value,messages:o.value,"show-timezones":!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["locale","date-locale","messages"])}}}),fe=e.defineComponent({__name:"SubscriptionManagementSummary",props:{invoice:{type:Object},isPending:{type:Boolean},hasError:{type:Boolean}},setup(t){const{$t:a}=m.useIntl(),n=e.computed(()=>({"invoice_preview.total_due_today_heading":a({defaultMessage:"Total due",id:"subscription_management.summary.total_due_heading",description:'Heading above the total of the invoice previewing a subscription change, replacing the shared preview’s "Total due today"'})}));return(o,c)=>(e.openBlock(),e.createBlock(e.unref(se._sfc_main),{class:"sv-subscription-management-summary",title:e.unref(a)({defaultMessage:"Order summary",id:"subscription_management.summary.title",description:"Title of the block previewing what a subscription change is invoiced for"})},{default:e.withCtx(()=>[t.hasError?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management-summary__error sv-error",title:e.unref(a)({defaultMessage:"Unable to calculate the total. Please try again.",id:"subscription_management.summary.error",description:"Error shown when the invoice preview for a subscription change cannot be loaded"})},null,8,["title"])):t.isPending||!t.invoice?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"sv-subscription-management-summary__skeleton min-h-[120px]"},{default:e.withCtx(()=>[t.isPending?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,variant:"body-sm",color:"subtle",tag:"div",class:"sv-subscription-management-summary__empty-state"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select your plan to see what it costs.",id:"subscription_management.summary.empty_state",description:"Shown in the order summary before a plan has been picked to preview"})),1)]),_:1}))]),_:1})):(e.openBlock(),e.createBlock(ge,{key:2,messages:n.value},{default:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main$1),{class:"sv-subscription-management-summary__invoice",invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1},8,["messages"]))]),_:1},8,["title"]))}}),_e={class:"sv-subscription-management-success grid grid-cols-1 gap-4"},ve={class:"sv-subscription-management-success__message"},be=e.defineComponent({__name:"SubscriptionManagementSuccess",props:{pricingGroupName:{type:String}},setup(t){const a=t,{$t:n}=m.useIntl(),o=e.computed(()=>n({defaultMessage:"Subscription updated",description:"Title shown on the manage subscription screen once the change is committed",id:"subscription_management.success.title"})),c=e.computed(()=>a.pricingGroupName?n({defaultMessage:"Your {subject} has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of the pricing group a committed subscription change applied to",id:"subscription_management.success.message"},{subject:a.pricingGroupName}):n({defaultMessage:"Your subscription has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of a committed subscription change when the pricing group is not known",id:"subscription_management.success.message_generic"}));return(p,_)=>(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(re._sfc_main,{status:"success",title:o.value},{default:e.withCtx(()=>[e.createElementVNode("span",ve,e.toDisplayString(c.value),1)]),_:1},8,["title"])]))}}),he=e.defineComponent({__name:"AddPaymentMethodModal",props:{showModal:{type:Boolean},customer:{type:Object},paymentMethodOptions:{type:Array},isLoading:{type:Boolean}},emits:["success","failure","close"],setup(t,{emit:a}){const n=a,{$t:o}=m.useIntl(),c=e.ref(),p=e.computed(()=>{var u;return!!((u=c.value)!=null&&u.isSaving)}),_=()=>{var u;(u=c.value)==null||u.submit()};return(u,f)=>(e.openBlock(),e.createBlock(e.unref(ce.Modal),{"no-click-away":"",size:"lg","show-modal":t.showModal,"is-loading":p.value,title:e.unref(o)({defaultMessage:"Add payment method",id:"add_payment_method_modal.title",description:"Title of the modal for adding a payment method"}),"sub-title":e.unref(o)({defaultMessage:"Add a new payment method to pay with.",id:"add_payment_method_modal.subtitle",description:"Subtitle of the modal for adding a payment method"}),"confirm-button-text":e.unref(o)({defaultMessage:"Save payment method",id:"add_payment_method_modal.confirm_button.label",description:"Label of the button that stores the payment method being added"}),"cancel-button-text":e.unref(o)({defaultMessage:"Cancel",id:"add_payment_method_modal.cancel_button.label",description:"Label of the button that abandons adding a payment method"}),onConfirm:_,onClose:f[2]||(f[2]=s=>n("close"))},{body:e.withCtx(()=>[e.createVNode(T._sfc_main$1,{ref_key:"addPaymentMethodRef",ref:c,class:"sv-add-payment-method-modal sv-add-payment-method-modal__form",customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isLoading,"is-active":t.showModal,onSuccess:f[0]||(f[0]=s=>n("success")),onFailure:f[1]||(f[1]=s=>n("failure",s))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:1},8,["show-modal","is-loading","title","sub-title","confirm-button-text","cancel-button-text"]))}}),ye={class:"sv-subscription-management__header"},we={class:"flex flex-col gap-2"},Se=e.defineComponent({__name:"SubscriptionManagement",props:{configuration:{type:Object}},setup(t){const a=t,{$t:n}=m.useIntl(),o=H.usePortal(),c=m.useLogger(),{dispatchAction:p}=K.useActionDispatchProvider(),{createPricingPlanSchedule:_}=de(),{subscription:u,get:f}=J.useSubscription({subscriptionId:a.configuration.subscriptionId}),{items:s,fetchAll:i}=X.usePaymentMethods({customerId:o.value.customer_id}),{customer:d,get:P}=Q.useCustomer({customerId:o.value.customer_id}),{paymentMethodOptions:b,get:B}=Z.usePaymentMethodOptions(),{isLoading:C}=ee.useLoadInitialData(f(),i(),P.execute(),B({customerId:o.value.customer_id})),k=e.ref(!1),D=async()=>{await i(),k.value=!1},N=e.computed(()=>{var r;return E.getActiveDefaultScheduleInfo(((r=u.value)==null?void 0:r.pricing_plan_schedule_infos)??[])}),w=e.computed(()=>{var h;const r=N.value;if(!r)return;const{enabledPricingId:l}=a.configuration;return(l?[l]:(((h=r.pricing_plan_schedule)==null?void 0:h.enabled_pricings)??[]).map(({pricing_id:g})=>g)).map(g=>E.getPricingGroupByPricingId({pricingPlanScheduleInfo:r,pricingId:g})).find(g=>!!g)}),U=e.computed(()=>{var r;return n({defaultMessage:"Manage {subject}",id:"subscription_management.title",description:"Title for the manage subscription page, naming the pricing group being changed"},{subject:((r=w.value)==null?void 0:r.name)||n({defaultMessage:"subscription",id:"subscription_management.title.default_subject",description:'Stands in for the pricing group name in the manage subscription title when no group is known, e.g. "Manage subscription"'})})}),y=e.ref([]),x=e.ref();e.watch([N,w],([r,l])=>{var q;const v=(((q=r==null?void 0:r.pricing_plan_schedule)==null?void 0:q.enabled_pricings)??[]).map(({pricing_id:S})=>S),{enabledPricingId:h}=a.configuration,g=((l==null?void 0:l.pricings)??[]).map(({id:S})=>S);y.value=h&&g.includes(h)?[...v.filter(S=>!g.includes(S)),h]:v},{immediate:!0});const{invoice:G,isPending:F,error:R,load:z}=le();e.watch([y,u],([r,l])=>{!l||r.length===0||z({subscription:l,enabledPricingIds:r})},{immediate:!0});const M=e.ref(!1),I=e.ref(),V=e.ref(!1),$=e.computed(()=>!C.value&&!M.value&&y.value.length>0&&!!u.value&&!!x.value),W=async()=>{if(!(!$.value||!u.value)){M.value=!0,I.value=void 0;try{await _({pricingPlanSubscriptionId:u.value.id,enabledPricings:y.value.map(r=>({pricing_id:r}))}),V.value=!0}catch(r){c.error("SUBSCRIPTION_UPDATE_FAILED","Failed to start a new pricing plan schedule",{},r),I.value=n({defaultMessage:"Something went wrong. Please try again.",id:"subscription_management.update_error",description:"Error shown when committing a subscription change fails"})}finally{M.value=!1}}},O=e.computed(()=>{var r,l,v;return((l=(r=N.value)==null?void 0:r.pricing_plan_schedule)==null?void 0:l.billing_period)??((v=u.value)==null?void 0:v.billing_period)});return(r,l)=>(e.openBlock(),e.createBlock(e.unref(Y.ContentWithAsideLayout),{class:"sv-subscription-management sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(m._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-management__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value),1)]),_:1})])]),content:e.withCtx(()=>{var v,h;return[V.value?(e.openBlock(),e.createBlock(be,{key:0,class:"sv-subscription-management__success","pricing-group-name":(v=w.value)==null?void 0:v.name},null,8,["pricing-group-name"])):e.unref(C)?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"min-h-[220px]"})):w.value&&O.value?(e.openBlock(),e.createBlock(pe,{key:2,"enabled-pricing-ids":y.value,"onUpdate:enabledPricingIds":l[0]||(l[0]=g=>y.value=g),"payment-method-id":x.value,"onUpdate:paymentMethodId":l[1]||(l[1]=g=>x.value=g),class:"sv-subscription-management__form","pricing-group":w.value,"payment-methods":e.unref(s),"payment-method-options":e.unref(b),"billing-period":O.value,currency:(h=e.unref(u))==null?void 0:h.billing_currency,onAddPaymentMethod:l[2]||(l[2]=g=>k.value=!0)},null,8,["enabled-pricing-ids","payment-method-id","pricing-group","payment-methods","payment-method-options","billing-period","currency"])):e.createCommentVNode("",!0),e.createVNode(he,{"show-modal":k.value,customer:e.unref(d),"payment-method-options":e.unref(b),onSuccess:D,onClose:l[3]||(l[3]=g=>k.value=!1)},null,8,["show-modal","customer","payment-method-options"])]}),aside:e.withCtx(()=>[V.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__done w-full",type:"button",onClick:l[4]||(l[4]=v=>e.unref(p)({action:"navigate-to-customer-overview"}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Done",id:"subscription_management.done_button.label",description:"Label of the button that leaves the manage subscription screen once the change is committed"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(fe,{class:"sv-subscription-management__summary",invoice:e.unref(G),"is-pending":e.unref(C)||e.unref(F),"has-error":!!e.unref(R)},null,8,["invoice","is-pending","has-error"]),I.value?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management__update-error sv-error",title:I.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",we,[e.createVNode(e.unref(A._sfc_main),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__update w-full",type:"button",disabled:!$.value,loading:M.value,onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Update subscription",id:"subscription_management.update_button.label",description:"Label of the button that commits the subscription change"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(ne._sfc_main$1,{class:"sv-subscription-management__kpi","payment-method-options":e.unref(b)},null,8,["payment-method-options"])])],64))]),_:1}))}}),Pe=e.defineComponent({__name:"SubscriptionManagement.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}},setup(t){const a=ue.getComponentName("subscription-management");return(n,o)=>(e.openBlock(),e.createBlock(e.unref(m._sfc_main$1),{entry:n.$props,"component-name":e.unref(a),"allowed-portal-types":["CUSTOMER"],onError:o[0]||(o[0]=c=>n.$emit("error",c))},{default:e.withCtx(()=>[e.createVNode(Se,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["entry","component-name"]))}}),{define:ke}=m.createSolvimonElement(Pe,"subscription-management");exports.defineSolvimonSubscriptionManagement=ke;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A=require("../../Button.vue.es-CJNxYacb.js"),L=require("../../ErrorNotification.vue.es-DI2B7WiR.js"),m=require("../../customElements-BYIdPSzQ.js"),Y=require("../../ContentWithAsideLayout-C6yMIVJF.js"),K=require("../../useActionDispatchProvider-CTyDGRX8.js"),H=require("../../usePortal-BplmMkBG.js"),J=require("../../useSubscription-CvB8ROBt.js"),Q=require("../../useCustomer-BXI5Vmit.js"),X=require("../../usePaymentMethods-BAOtOJZD.js"),Z=require("../../usePaymentMethodOptions-BPBVGNDg.js"),ee=require("../../useLoadInitialData-BO9ZsSsF.js"),te=require("../../invoices-mw87cNTS.js"),E=require("../../pricingPlanSchedule-BM8vsKkV.js"),ne=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DIgVzXLg.js"),ie=require("../../Divider.vue.es-UwnWvUTl.js"),ae=require("../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-BJfQLRcS.js"),T=require("../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js"),oe=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js"),se=require("../../Section.vue.es-Cybk1Nb8.js"),j=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),re=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js"),ce=require("../../Modal.vue.es-DgLl6XBV.js"),ue=require("../../sessionReference-m_6Rp4X1.js");function le(){const{getInvoicePreview:t}=te.createInvoicesService(),a=m.useLogger(),n=e.ref(),o=e.ref(!1),c=e.ref(),p=m.createLatestGuard();return{invoice:n,isPending:o,error:c,load:async({subscription:u,enabledPricingIds:f})=>{const s=E.getScheduleCustomizations({enabledPricings:f.map(d=>({pricing_id:d})),pricingPlanScheduleInfos:u.pricing_plan_schedule_infos});if(!s){n.value=void 0;return}const i=p();o.value=!0,c.value=void 0;try{const d=await t({forExistingSubscription:!0,pricingPlanSubscriptionId:u.id,customizations:s});if(!i())return;n.value=d.invoice}catch(d){if(!i())return;a.error("INVOICE_PREVIEW_FAILED","Failed to preview the subscription upgrade",{},d),c.value=d,n.value=void 0}finally{i()&&(o.value=!1)}}}}function de(){const t=m.createRequestService(),a=m.useConfig();function n({scheduleId:c}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules/${c}/on-demand-pricing-items`})}function o({pricingPlanSubscriptionId:c,enabledPricings:p}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules`,options:{method:"POST"},data:{pricing_plan_subscription_id:c,enabled_pricings:p,start_at:new Date().toJSON()}})}return{getOnDemandPricingItems:n,createPricingPlanSchedule:o}}const me={class:"sv-subscription-management-form__body grid grid-cols-1 gap-4"},pe=e.defineComponent({__name:"SubscriptionManagementForm",props:e.mergeModels({pricingGroup:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},billingPeriod:{type:Object},currency:{type:String},disabled:{type:Boolean}},{enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{},paymentMethodId:{},paymentMethodIdModifiers:{}}),emits:e.mergeModels(["add-payment-method"],["update:enabledPricingIds","update:paymentMethodId"]),setup(t,{emit:a}){const n=t,o=a,c=e.useModel(t,"enabledPricingIds"),p=e.useModel(t,"paymentMethodId"),{$t:_}=m.useIntl(),u=s=>{const i=s?Date.parse(s):NaN;return Number.isFinite(i)?i:0},f=e.computed(()=>[...n.paymentMethods??[]].sort((s,i)=>u(i.created_at)-u(s.created_at)));return e.watch(()=>n.paymentMethods,(s,i)=>{var P;const d=s==null?void 0:s.find(({id:b})=>!(i!=null&&i.some(B=>B.id===b)));if(d&&(i!=null&&i.length)){p.value=d.id;return}s!=null&&s.some(({id:b})=>b===p.value)||(p.value=(P=(s==null?void 0:s.find(({is_default:b})=>b))??f.value[0])==null?void 0:P.id)},{immediate:!0}),(s,i)=>(e.openBlock(),e.createElementBlock("form",{class:"sv-subscription-management-form",onSubmit:i[3]||(i[3]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",me,[e.createVNode(ae._sfc_main,{modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=d=>c.value=d),class:"sv-subscription-management-form__pricing-group","group-name":t.pricingGroup.name,pricings:t.pricingGroup.pricings,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"]),e.createElementVNode("div",null,[e.createVNode(e.unref(ie._sfc_main),{spacing:"xs"})]),e.createVNode(T._sfc_main,{modelValue:p.value,"onUpdate:modelValue":i[1]||(i[1]=d=>p.value=d),class:"sv-subscription-management-form__payment-methods","payment-methods":f.value,"payment-method-options":t.paymentMethodOptions,required:"",disabled:t.disabled,label:e.unref(_)({defaultMessage:"Payment method",id:"subscription_management.payment_method_selector.label",description:"Label above the payment method that pays for the subscription change"}),onAddPaymentMethod:i[2]||(i[2]=d=>o("add-payment-method"))},null,8,["modelValue","payment-methods","payment-method-options","disabled","label"])])],32))}}),ge=e.defineComponent({__name:"TranslationOverride",props:{messages:{type:Object}},setup(t){const a=t,n=e.inject(m.TRANSLATION_SETTINGS_KEY,void 0),o=e.computed(()=>({...n==null?void 0:n.messages.value,...a.messages}));return(c,p)=>{var _,u;return e.openBlock(),e.createBlock(e.unref(m._sfc_main$2),{locale:(_=e.unref(n))==null?void 0:_.locale.value,"date-locale":(u=e.unref(n))==null?void 0:u.dateLocale.value,messages:o.value,"show-timezones":!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["locale","date-locale","messages"])}}}),fe=e.defineComponent({__name:"SubscriptionManagementSummary",props:{invoice:{type:Object},isPending:{type:Boolean},hasError:{type:Boolean}},setup(t){const{$t:a}=m.useIntl(),n=e.computed(()=>({"invoice_preview.total_due_today_heading":a({defaultMessage:"Total due",id:"subscription_management.summary.total_due_heading",description:'Heading above the total of the invoice previewing a subscription change, replacing the shared preview’s "Total due today"'})}));return(o,c)=>(e.openBlock(),e.createBlock(e.unref(se._sfc_main),{class:"sv-subscription-management-summary",title:e.unref(a)({defaultMessage:"Order summary",id:"subscription_management.summary.title",description:"Title of the block previewing what a subscription change is invoiced for"})},{default:e.withCtx(()=>[t.hasError?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management-summary__error sv-error",title:e.unref(a)({defaultMessage:"Unable to calculate the total. Please try again.",id:"subscription_management.summary.error",description:"Error shown when the invoice preview for a subscription change cannot be loaded"})},null,8,["title"])):t.isPending||!t.invoice?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"sv-subscription-management-summary__skeleton min-h-[120px]"},{default:e.withCtx(()=>[t.isPending?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,variant:"body-sm",color:"subtle",tag:"div",class:"sv-subscription-management-summary__empty-state"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select your plan to see what it costs.",id:"subscription_management.summary.empty_state",description:"Shown in the order summary before a plan has been picked to preview"})),1)]),_:1}))]),_:1})):(e.openBlock(),e.createBlock(ge,{key:2,messages:n.value},{default:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main$1),{class:"sv-subscription-management-summary__invoice",invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1},8,["messages"]))]),_:1},8,["title"]))}}),_e={class:"sv-subscription-management-success grid grid-cols-1 gap-4"},ve={class:"sv-subscription-management-success__message"},be=e.defineComponent({__name:"SubscriptionManagementSuccess",props:{pricingGroupName:{type:String}},setup(t){const a=t,{$t:n}=m.useIntl(),o=e.computed(()=>n({defaultMessage:"Subscription updated",description:"Title shown on the manage subscription screen once the change is committed",id:"subscription_management.success.title"})),c=e.computed(()=>a.pricingGroupName?n({defaultMessage:"Your {subject} has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of the pricing group a committed subscription change applied to",id:"subscription_management.success.message"},{subject:a.pricingGroupName}):n({defaultMessage:"Your subscription has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of a committed subscription change when the pricing group is not known",id:"subscription_management.success.message_generic"}));return(p,_)=>(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(re._sfc_main,{status:"success",title:o.value},{default:e.withCtx(()=>[e.createElementVNode("span",ve,e.toDisplayString(c.value),1)]),_:1},8,["title"])]))}}),he=e.defineComponent({__name:"AddPaymentMethodModal",props:{showModal:{type:Boolean},customer:{type:Object},paymentMethodOptions:{type:Array},isLoading:{type:Boolean}},emits:["success","failure","close"],setup(t,{emit:a}){const n=a,{$t:o}=m.useIntl(),c=e.ref(),p=e.computed(()=>{var u;return!!((u=c.value)!=null&&u.isSaving)}),_=()=>{var u;(u=c.value)==null||u.submit()};return(u,f)=>(e.openBlock(),e.createBlock(e.unref(ce.Modal),{"no-click-away":"",size:"lg","show-modal":t.showModal,"is-loading":p.value,title:e.unref(o)({defaultMessage:"Add payment method",id:"add_payment_method_modal.title",description:"Title of the modal for adding a payment method"}),"sub-title":e.unref(o)({defaultMessage:"Add a new payment method to pay with.",id:"add_payment_method_modal.subtitle",description:"Subtitle of the modal for adding a payment method"}),"confirm-button-text":e.unref(o)({defaultMessage:"Save payment method",id:"add_payment_method_modal.confirm_button.label",description:"Label of the button that stores the payment method being added"}),"cancel-button-text":e.unref(o)({defaultMessage:"Cancel",id:"add_payment_method_modal.cancel_button.label",description:"Label of the button that abandons adding a payment method"}),onConfirm:_,onClose:f[2]||(f[2]=s=>n("close"))},{body:e.withCtx(()=>[e.createVNode(T._sfc_main$1,{ref_key:"addPaymentMethodRef",ref:c,class:"sv-add-payment-method-modal sv-add-payment-method-modal__form",customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isLoading,"is-active":t.showModal,onSuccess:f[0]||(f[0]=s=>n("success")),onFailure:f[1]||(f[1]=s=>n("failure",s))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:1},8,["show-modal","is-loading","title","sub-title","confirm-button-text","cancel-button-text"]))}}),ye={class:"sv-subscription-management__header"},we={class:"flex flex-col gap-2"},Se=e.defineComponent({__name:"SubscriptionManagement",props:{configuration:{type:Object}},setup(t){const a=t,{$t:n}=m.useIntl(),o=H.usePortal(),c=m.useLogger(),{dispatchAction:p}=K.useActionDispatchProvider(),{createPricingPlanSchedule:_}=de(),{subscription:u,get:f}=J.useSubscription({subscriptionId:a.configuration.subscriptionId}),{items:s,fetchAll:i}=X.usePaymentMethods({customerId:o.value.customer_id}),{customer:d,get:P}=Q.useCustomer({customerId:o.value.customer_id}),{paymentMethodOptions:b,get:B}=Z.usePaymentMethodOptions(),{isLoading:C}=ee.useLoadInitialData(f(),i(),P.execute(),B({customerId:o.value.customer_id})),k=e.ref(!1),D=async()=>{await i(),k.value=!1},N=e.computed(()=>{var r;return E.getActiveDefaultScheduleInfo(((r=u.value)==null?void 0:r.pricing_plan_schedule_infos)??[])}),w=e.computed(()=>{var h;const r=N.value;if(!r)return;const{enabledPricingId:l}=a.configuration;return(l?[l]:(((h=r.pricing_plan_schedule)==null?void 0:h.enabled_pricings)??[]).map(({pricing_id:g})=>g)).map(g=>E.getPricingGroupByPricingId({pricingPlanScheduleInfo:r,pricingId:g})).find(g=>!!g)}),U=e.computed(()=>{var r;return n({defaultMessage:"Manage {subject}",id:"subscription_management.title",description:"Title for the manage subscription page, naming the pricing group being changed"},{subject:((r=w.value)==null?void 0:r.name)||n({defaultMessage:"subscription",id:"subscription_management.title.default_subject",description:'Stands in for the pricing group name in the manage subscription title when no group is known, e.g. "Manage subscription"'})})}),y=e.ref([]),x=e.ref();e.watch([N,w],([r,l])=>{var q;const v=(((q=r==null?void 0:r.pricing_plan_schedule)==null?void 0:q.enabled_pricings)??[]).map(({pricing_id:S})=>S),{enabledPricingId:h}=a.configuration,g=((l==null?void 0:l.pricings)??[]).map(({id:S})=>S);y.value=h&&g.includes(h)?[...v.filter(S=>!g.includes(S)),h]:v},{immediate:!0});const{invoice:G,isPending:F,error:R,load:z}=le();e.watch([y,u],([r,l])=>{!l||r.length===0||z({subscription:l,enabledPricingIds:r})},{immediate:!0});const M=e.ref(!1),I=e.ref(),V=e.ref(!1),$=e.computed(()=>!C.value&&!M.value&&y.value.length>0&&!!u.value&&!!x.value),W=async()=>{if(!(!$.value||!u.value)){M.value=!0,I.value=void 0;try{await _({pricingPlanSubscriptionId:u.value.id,enabledPricings:y.value.map(r=>({pricing_id:r}))}),V.value=!0}catch(r){c.error("SUBSCRIPTION_UPDATE_FAILED","Failed to start a new pricing plan schedule",{},r),I.value=n({defaultMessage:"Something went wrong. Please try again.",id:"subscription_management.update_error",description:"Error shown when committing a subscription change fails"})}finally{M.value=!1}}},O=e.computed(()=>{var r,l,v;return((l=(r=N.value)==null?void 0:r.pricing_plan_schedule)==null?void 0:l.billing_period)??((v=u.value)==null?void 0:v.billing_period)});return(r,l)=>(e.openBlock(),e.createBlock(e.unref(Y.ContentWithAsideLayout),{class:"sv-subscription-management sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(m._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-management__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value),1)]),_:1})])]),content:e.withCtx(()=>{var v,h;return[V.value?(e.openBlock(),e.createBlock(be,{key:0,class:"sv-subscription-management__success","pricing-group-name":(v=w.value)==null?void 0:v.name},null,8,["pricing-group-name"])):e.unref(C)?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"min-h-[220px]"})):w.value&&O.value?(e.openBlock(),e.createBlock(pe,{key:2,"enabled-pricing-ids":y.value,"onUpdate:enabledPricingIds":l[0]||(l[0]=g=>y.value=g),"payment-method-id":x.value,"onUpdate:paymentMethodId":l[1]||(l[1]=g=>x.value=g),class:"sv-subscription-management__form","pricing-group":w.value,"payment-methods":e.unref(s),"payment-method-options":e.unref(b),"billing-period":O.value,currency:(h=e.unref(u))==null?void 0:h.billing_currency,onAddPaymentMethod:l[2]||(l[2]=g=>k.value=!0)},null,8,["enabled-pricing-ids","payment-method-id","pricing-group","payment-methods","payment-method-options","billing-period","currency"])):e.createCommentVNode("",!0),e.createVNode(he,{"show-modal":k.value,customer:e.unref(d),"payment-method-options":e.unref(b),onSuccess:D,onClose:l[3]||(l[3]=g=>k.value=!1)},null,8,["show-modal","customer","payment-method-options"])]}),aside:e.withCtx(()=>[V.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__done w-full",type:"button",onClick:l[4]||(l[4]=v=>e.unref(p)({action:"navigate-to-customer-overview"}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Done",id:"subscription_management.done_button.label",description:"Label of the button that leaves the manage subscription screen once the change is committed"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(fe,{class:"sv-subscription-management__summary",invoice:e.unref(G),"is-pending":e.unref(C)||e.unref(F),"has-error":!!e.unref(R)},null,8,["invoice","is-pending","has-error"]),I.value?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management__update-error sv-error",title:I.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",we,[e.createVNode(e.unref(A._sfc_main),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__update w-full",type:"button",disabled:!$.value,loading:M.value,onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Update subscription",id:"subscription_management.update_button.label",description:"Label of the button that commits the subscription change"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(ne._sfc_main$1,{class:"sv-subscription-management__kpi","payment-method-options":e.unref(b)},null,8,["payment-method-options"])])],64))]),_:1}))}}),Pe=e.defineComponent({__name:"SubscriptionManagement.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}},setup(t){const a=ue.getComponentName("subscription-management");return(n,o)=>(e.openBlock(),e.createBlock(e.unref(m._sfc_main$1),{entry:n.$props,"component-name":e.unref(a),"allowed-portal-types":["CUSTOMER"],onError:o[0]||(o[0]=c=>n.$emit("error",c))},{default:e.withCtx(()=>[e.createVNode(Se,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["entry","component-name"]))}}),{define:ke}=m.createSolvimonElement(Pe,"subscription-management");exports.defineSolvimonSubscriptionManagement=ke;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { ref as S, defineComponent as I, useModel as H, computed as _, watch as F, openBlock as m, createElementBlock as z, withModifiers as ce, createElementVNode as A, createVNode as h, unref as e, mergeModels as J, inject as le, createBlock as f, withCtx as b, renderSlot as de, createTextVNode as T, toDisplayString as C, createCommentVNode as R, Fragment as me } from "vue";
|
|
2
|
-
import { _ as K } from "../../Button.vue.es-
|
|
3
|
-
import { _ as Q } from "../../ErrorNotification.vue.es-
|
|
4
|
-
import { b as X, g as ue, c as pe, a as ge, u as E, h as fe, i as be, _ as Z, d as ve, e as he } from "../../customElements-
|
|
2
|
+
import { _ as K } from "../../Button.vue.es-BJEy-e9C.mjs";
|
|
3
|
+
import { _ as Q } from "../../ErrorNotification.vue.es-B3mvv79S.mjs";
|
|
4
|
+
import { b as X, g as ue, c as pe, a as ge, u as E, h as fe, i as be, _ as Z, d as ve, e as he } from "../../customElements-Df6dGrN-.mjs";
|
|
5
5
|
import { C as _e } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
|
|
6
|
-
import { u as ye } from "../../useActionDispatchProvider-
|
|
7
|
-
import { u as we } from "../../usePortal-
|
|
8
|
-
import { u as Se } from "../../useSubscription-
|
|
9
|
-
import { u as Pe } from "../../useCustomer-
|
|
10
|
-
import { u as Me } from "../../usePaymentMethods-
|
|
11
|
-
import { u as Ie } from "../../usePaymentMethodOptions-
|
|
12
|
-
import { u as $e } from "../../useLoadInitialData-
|
|
13
|
-
import { c as Oe } from "../../invoices-
|
|
14
|
-
import { b as ke, c as Ce, d as Ae } from "../../pricingPlanSchedule-
|
|
15
|
-
import { a as Ee } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { u as ye } from "../../useActionDispatchProvider-DyQbRCxR.mjs";
|
|
7
|
+
import { u as we } from "../../usePortal-CMHV-ShD.mjs";
|
|
8
|
+
import { u as Se } from "../../useSubscription-V53WsZwQ.mjs";
|
|
9
|
+
import { u as Pe } from "../../useCustomer-dcmU1539.mjs";
|
|
10
|
+
import { u as Me } from "../../usePaymentMethods-U7gnZ0F5.mjs";
|
|
11
|
+
import { u as Ie } from "../../usePaymentMethodOptions-MSEp39xQ.mjs";
|
|
12
|
+
import { u as $e } from "../../useLoadInitialData-CWyI3_RR.mjs";
|
|
13
|
+
import { c as Oe } from "../../invoices-CrO6p4Ms.mjs";
|
|
14
|
+
import { b as ke, c as Ce, d as Ae } from "../../pricingPlanSchedule-BPrS2WRd.mjs";
|
|
15
|
+
import { a as Ee } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-C9q_qwjt.mjs";
|
|
16
16
|
import { _ as Le } from "../../Divider.vue.es-DnP_HqLz.mjs";
|
|
17
|
-
import { _ as xe } from "../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as je, a as Ne } from "../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { a as Te } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-
|
|
20
|
-
import { _ as Ue } from "../../Section.vue.es-
|
|
17
|
+
import { _ as xe } from "../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CURXAgMT.mjs";
|
|
18
|
+
import { _ as je, a as Ne } from "../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B70SyWOB.mjs";
|
|
19
|
+
import { a as Te } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-YcaBJDzx.mjs";
|
|
20
|
+
import { _ as Ue } from "../../Section.vue.es-C2_topx4.mjs";
|
|
21
21
|
import { _ as ee } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
|
|
22
|
-
import { _ as Be } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { M as Ve } from "../../Modal.vue.es-
|
|
24
|
-
import {
|
|
22
|
+
import { _ as Be } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CcdhYTB1.mjs";
|
|
23
|
+
import { M as Ve } from "../../Modal.vue.es-Z2DWAN2u.mjs";
|
|
24
|
+
import { a as De } from "../../sessionReference-3h-6FdrC.mjs";
|
|
25
25
|
function Ge() {
|
|
26
26
|
const { getInvoicePreview: t } = Oe(), a = X(), n = S(), s = S(!1), c = S(), p = ue();
|
|
27
27
|
return { invoice: n, isPending: s, error: c, load: async ({
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const f = "solvimon-", m = ["ALL"];
|
|
2
|
+
function y(e) {
|
|
3
|
+
return `${f}${e}`;
|
|
4
|
+
}
|
|
5
|
+
const r = "solvimon.sdk.session-reference", s = "SV", c = 8, i = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ", a = new RegExp(`^${s}-[${i}]{${c}}$`);
|
|
6
|
+
let n;
|
|
7
|
+
function u(e) {
|
|
8
|
+
const t = new Uint8Array(e);
|
|
9
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function")
|
|
10
|
+
return crypto.getRandomValues(t), t;
|
|
11
|
+
for (let o = 0; o < e; o += 1)
|
|
12
|
+
t[o] = Math.floor(Math.random() * 256);
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function d() {
|
|
16
|
+
const e = Array.from(u(c), (t) => i[t & 31]).join("");
|
|
17
|
+
return `${s}-${e}`;
|
|
18
|
+
}
|
|
19
|
+
function E() {
|
|
20
|
+
try {
|
|
21
|
+
const e = window.sessionStorage.getItem(r);
|
|
22
|
+
return e && a.test(e) ? e : void 0;
|
|
23
|
+
} catch {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function R(e) {
|
|
28
|
+
try {
|
|
29
|
+
window.sessionStorage.setItem(r, e);
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function A() {
|
|
34
|
+
if (n)
|
|
35
|
+
return n;
|
|
36
|
+
const e = E();
|
|
37
|
+
return n = e ?? d(), e || R(n), n;
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
m as E,
|
|
41
|
+
y as a,
|
|
42
|
+
A as g
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f="solvimon-",a=["ALL"];function u(e){return`${f}${e}`}const r="solvimon.sdk.session-reference",s="SV",c=8,i="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",d=new RegExp(`^${s}-[${i}]{${c}}$`);let t;function E(e){const n=new Uint8Array(e);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(n),n;for(let o=0;o<e;o+=1)n[o]=Math.floor(Math.random()*256);return n}function R(){const e=Array.from(E(c),n=>i[n&31]).join("");return`${s}-${e}`}function m(){try{const e=window.sessionStorage.getItem(r);return e&&d.test(e)?e:void 0}catch{return}}function A(e){try{window.sessionStorage.setItem(r,e)}catch{}}function y(){if(t)return t;const e=m();return t=e??R(),e||A(t),t}exports.EXPAND_ALL=a;exports.getComponentName=u;exports.getSessionReference=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const l=require("./pricingPlanSchedule-
|
|
1
|
+
const l=require("./pricingPlanSchedule-BM8vsKkV.js");function g(t){var e;return(e=t==null?void 0:t.pricing_plan_schedule_infos)==null?void 0:e.at(-1)}function d(t){var e,n;return(n=(e=g(t))==null?void 0:e.pricing_plan_version)==null?void 0:n.pricing_plan}function f({subscription:t,fallback:e}){var n;return(t==null?void 0:t.name)||((n=d(t))==null?void 0:n.name)||e}function s(t,e){const n=[];function a(i){Array.isArray(i)?i.forEach(a):i&&typeof i=="object"&&(i.object_type==="PRICING"&&e.includes(i.id)&&n.push(i),Object.values(i).forEach(a))}return a(t),n}function o(t){return t.pricing_plan_schedule_infos.flatMap(e=>{var n;return((n=e.pricing_plan_version.pricing_categories)==null?void 0:n.flatMap(a=>a.pricing_groups??[]))??[]})}function _(t){var c;const e={trialStartDate:void 0,trialEndDate:void 0,subscriptionStartDate:void 0,subscriptionEndDate:void 0};if(!((c=t==null?void 0:t.pricing_plan_schedule_infos)!=null&&c.length))return e;const n=new Date,a=l.getFirstPricingPlanScheduleOfType({type:"TRIAL",pricingPlanScheduleInfos:t.pricing_plan_schedule_infos});if(a!=null&&a.start_at&&(e.trialStartDate=n,a.end_at)){const r=new Date(a.end_at).getTime()-new Date(a.start_at).getTime();e.trialEndDate=new Date(n.getTime()+r)}const i=l.getFirstPricingPlanScheduleOfType({type:"DEFAULT",pricingPlanScheduleInfos:t.pricing_plan_schedule_infos});if(i!=null&&i.start_at&&(e.trialEndDate?e.subscriptionStartDate=e.trialEndDate:e.subscriptionStartDate=n,i.end_at)){const r=new Date(i.end_at).getTime()-new Date(i.start_at).getTime();e.subscriptionEndDate=new Date(n.getTime()+r)}return e}exports.findPricingsByIds=s;exports.getFallbackTrialAndSubscriptionStartAndEndDates=_;exports.getMostRecentPricingPlan=d;exports.getMostRecentScheduleInfo=g;exports.getPricingGroupsFromExtendedPricingPlanSubscription=o;exports.getSubscriptionName=f;
|