@solvimon/solvimon-web 0.1.0-alpha.28 → 0.1.0-alpha.29

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.
Files changed (189) hide show
  1. package/README.md +26 -1
  2. package/dist/{Alert.vue.es-lIiAWf2S.mjs → Alert.vue.es-CNrEaLvh.mjs} +58 -46
  3. package/dist/AuthProvider.handle-DKfNs8rr.mjs +50 -0
  4. package/dist/{Avatar.vue.es-Beg7umjO.mjs → Avatar.vue.es-r0NbcIib.mjs} +1 -1
  5. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DBGe1PvD.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-Cp4yGqaw.mjs} +8 -8
  6. package/dist/{Button.vue.es-rh6mITmN.mjs → Button.vue.es-Zw--kuaU.mjs} +4 -4
  7. package/dist/{ChargeOnDemandModal-CPjPa_uq.mjs → ChargeOnDemandModal-B8FDkS9U.mjs} +35 -34
  8. package/dist/Checkout.entry.ce-DsGl-5aR.mjs +4202 -0
  9. package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-2D8VM_7W.mjs +828 -0
  10. package/dist/{Chip.vue.es-Cn2R_0mE.mjs → Chip.vue.es-D3UDSyXC.mjs} +3 -3
  11. package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +32 -0
  12. package/dist/{ContextMenu.vue.es-DRxsa7bZ.mjs → ContextMenu.vue.es-B9mFpUQK.mjs} +87 -88
  13. package/dist/{CustomerBillingInformation.vue.es-DQfL5RMR.mjs → CustomerBillingInformation.vue.es-B8NiQaJs.mjs} +3 -3
  14. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Ct-eYaEN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DBivC5Eb.mjs} +21 -20
  15. package/dist/CustomerShippingAddresses-Bj8Y17O8.mjs +397 -0
  16. package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BzTSwo4i.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BmPKfIjT.mjs} +798 -792
  17. package/dist/{DividerText.vue.es-M0XqSz55.mjs → DividerText.vue.es-CNbgif-3.mjs} +1 -1
  18. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CVP-7ne3.mjs +55 -0
  19. package/dist/{ErrorNotification.vue.es-CKlt4hr2.mjs → ErrorNotification.vue.es-DNd65mQq.mjs} +2 -2
  20. package/dist/FormMessage.vue.es-Cjv358Ab.mjs +39 -0
  21. package/dist/{IconButton.vue.es-oe4MVBK1.mjs → IconButton.vue.es-C8lYFx5_.mjs} +2 -2
  22. package/dist/{IconTitle.vue.es-BO6KBS4v.mjs → IconTitle.vue.es-O2kcqgKm.mjs} +3 -3
  23. package/dist/{Input.vue.es-DAlPmtE_.mjs → Input.vue.es-D8Oj8MWv.mjs} +23 -22
  24. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CCTl5GWa.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-rhqYVdfV.mjs} +2 -2
  25. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DMGqj_Uk.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-06R-M8Q3.mjs} +4 -4
  26. package/dist/InvoicePreview.vue.es-4Q2hzaFS.mjs +286 -0
  27. package/dist/InvoicePricingClauseChip.vue.es-DKU0xu0t.mjs +124 -0
  28. package/dist/Label.vue.es-DtpLM1KH.mjs +113 -0
  29. package/dist/{Modal.vue.es-CTNACAst.mjs → Modal.vue.es-C8ZcO117.mjs} +109 -103
  30. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-3DQLCR3U.mjs +441 -0
  31. package/dist/PaymentCompletedCard.vue_vue_type_script_setup_true_lang-DfTb9psX.mjs +48 -0
  32. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DLfAfB_m.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BoGTtg5G.mjs} +46 -88
  33. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CKm-XYuF.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BIAm22Kq.mjs} +3 -3
  34. package/dist/{PaymentHistoryBlock-BmA8jbMb.mjs → PaymentHistoryBlock-BvY2nXGV.mjs} +1 -1
  35. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BDMse2lO.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-bQKhUonq.mjs} +4 -4
  36. package/dist/{PaymentIntegrationForm-D1Xw-xIt.mjs → PaymentIntegrationForm-CcfQSzKM.mjs} +1 -1
  37. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CCxw0PCv.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvzcLJVq.mjs} +68 -69
  38. package/dist/{PaymentIntegrationFormAdyen-CfT5aD4L.mjs → PaymentIntegrationFormAdyen-DqgDfO6K.mjs} +126 -117
  39. package/dist/{PaymentIntegrationFormStripe-DKXJ-mjd.mjs → PaymentIntegrationFormStripe-BYdAkvLt.mjs} +193 -179
  40. package/dist/{PaymentMethod.vue.es-Cauxx4Xr.mjs → PaymentMethod.vue.es-b0p3a0L-.mjs} +7 -7
  41. package/dist/{PaymentMethodForm-CypZOYUZ.mjs → PaymentMethodForm-BsTrTwCg.mjs} +1 -1
  42. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-De8FgdYD.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-sUOmLORl.mjs} +7 -7
  43. package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Dw28tfpD.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DsnAhR79.mjs} +36 -35
  44. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-OtjVO7lR.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CSW4LfmH.mjs} +7 -7
  45. package/dist/{PlanCustomizationEditor-Xtww2r9K.mjs → PlanCustomizationEditor-D29N4HUM.mjs} +9 -9
  46. package/dist/PortalLinkUnverified-B_EE2wTJ.mjs +52 -0
  47. package/dist/{PortalNotAvailable-B_59GUwN.mjs → PortalNotAvailable-DPE9y37H.mjs} +2 -2
  48. package/dist/{PricingGroupRangeInput.vue.es-C9LJW3b8.mjs → PricingGroupRangeInput.vue.es-tIMXIhpZ.mjs} +14 -13
  49. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DdWxoB8q.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DqxWxSQe.mjs} +32 -32
  50. package/dist/RadioGroupExtended.vue.es-3nDXqIGi.mjs +176 -0
  51. package/dist/{Section.vue.es-iS8hVGWA.mjs → Section.vue.es-CvX9tg2f.mjs} +1 -1
  52. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cl7I1Apo.mjs +60 -0
  53. package/dist/ShippingAddressesModal-C4p1IXXk.mjs +418 -0
  54. package/dist/{StepInput.vue.es-Dpan1RQd.mjs → StepInput.vue.es-DweyzpkL.mjs} +4 -4
  55. package/dist/{SubscriptionDetails.entry.ce-DufQX3uI.mjs → SubscriptionDetails.entry.ce-D5SwM0YS.mjs} +230 -225
  56. package/dist/{SubscriptionSchedules-DAahcNoI.mjs → SubscriptionSchedules-BZqlpAtk.mjs} +1 -1
  57. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BH7DdOWK.mjs +5185 -0
  58. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-Wmjqy7RZ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs} +3 -3
  59. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BeRLuEyR.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BbjdBHSQ.mjs} +23 -22
  60. package/dist/TooltipParagraph.vue.es-Dw0ndjle.mjs +132 -0
  61. package/dist/TranslationOverride.vue_vue_type_script_setup_true_lang-BhjZVMSx.mjs +31 -0
  62. package/dist/{TrialChip.vue.es-B-XBSHWE.mjs → TrialChip.vue.es-DOopmaXA.mjs} +2 -2
  63. package/dist/{api.es-QaC926Xu.mjs → api.es-qgvzNMU-.mjs} +2 -2
  64. package/dist/{cn.es-2bVdkiFV.mjs → cn.es-B8acFrov.mjs} +380 -476
  65. package/dist/components/BillingInformation/BillingInformation.mjs +9 -7
  66. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +57 -54
  67. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +20 -18
  68. package/dist/components/Invoice/Invoice.mjs +2660 -193
  69. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +6 -4
  70. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +18 -17
  71. package/dist/components/InvoicesList/InvoicesList.mjs +13 -11
  72. package/dist/components/PaymentHistory/PaymentHistory.mjs +8 -6
  73. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +19 -17
  74. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +19 -17
  75. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +20 -18
  76. package/dist/components/WalletBalances/WalletBalances.mjs +17 -15
  77. package/dist/customElements-BTj4ii4f.mjs +5072 -0
  78. package/dist/{customer-CqddTiOr.mjs → customer-BIjC0CWJ.mjs} +1 -1
  79. package/dist/customer.es-DQKl6wFt.mjs +24 -0
  80. package/dist/{de-DE-BW8dMvhW.mjs → de-DE-DBbERiFr.mjs} +38 -0
  81. package/dist/{de-DE-BNMj3boy.mjs → de-DE-UJ6X6jXu.mjs} +1 -1
  82. package/dist/floating-ui.vue.es-BvAf8-si.mjs +1003 -0
  83. package/dist/{formControl-CsITfsBk.mjs → formControl-BZQLHnOO.mjs} +5 -5
  84. package/dist/fr-FR-Cvvbkwlj.mjs +307 -0
  85. package/dist/fr-FR-IWJE-urI.mjs +431 -0
  86. package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +4 -0
  87. package/dist/{index.es-CXkP_k3u.mjs → index.es-C7J3WGGo.mjs} +4 -4
  88. package/dist/index.es-CpmQmvOg.mjs +633 -0
  89. package/dist/index.mjs +2 -2
  90. package/dist/{invoices-Cf1qDAv4.mjs → invoices-e1sKLgxg.mjs} +3 -3
  91. package/dist/{it-IT-Byg06KWc.mjs → it-IT-B7ui2oxO.mjs} +38 -0
  92. package/dist/{it-IT-DRvuxM1F.mjs → it-IT-DnJP5URH.mjs} +1 -1
  93. package/dist/{nl-NL-x3zQqzZ7.mjs → nl-NL-Bafh2xoT.mjs} +38 -0
  94. package/dist/{nl-NL-DLUwWbMG.mjs → nl-NL-q9xfTZF0.mjs} +1 -1
  95. package/dist/{paymentMethods-BUuOmDq9.mjs → paymentMethods-B_82JGk_.mjs} +2 -2
  96. package/dist/paymentMethods-Nfv9HdkS.mjs +61 -0
  97. package/dist/{paymentOutcome-D17VD4MV.mjs → paymentOutcome-BXEU5-84.mjs} +5 -5
  98. package/dist/payments-BnxbzQUC.mjs +68 -0
  99. package/dist/pricing-BOhvWWMj.mjs +29 -0
  100. package/dist/{pricingPlanScheduleOverrides-COr9F8DO.mjs → pricingPlanScheduleOverrides-Dxv5FOBd.mjs} +2 -2
  101. package/dist/{pricingPlanSchedules-BK_o9p6h.mjs → pricingPlanSchedules-Dv7ZCgNp.mjs} +1 -1
  102. package/dist/screens/Checkout/Checkout.mjs +2 -2
  103. package/dist/screens/CustomerOverview/CustomerOverview.mjs +128 -83
  104. package/dist/screens/PayInvoice/PayInvoice.mjs +572 -218
  105. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +21 -19
  106. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
  107. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +261 -266
  108. package/dist/{sorting.es-qtEN8J8T.mjs → sorting.es-CVyKw23D.mjs} +1 -1
  109. package/dist/subscriptions-BWXZGK0E.mjs +66 -0
  110. package/dist/taxId.es-DkD3Ltr8.mjs +243 -0
  111. package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -0
  112. package/dist/types/components/customer/ShippingAddressForm/ShippingAddressForm.types.d.ts +9 -0
  113. package/dist/types/components/customer/ShippingAddresses/ShippingAddressCard.types.d.ts +11 -0
  114. package/dist/types/components/customer/ShippingAddresses/ShippingAddressList.types.d.ts +9 -0
  115. package/dist/types/components/customer/ShippingAddresses/ShippingAddressesModal.types.d.ts +26 -0
  116. package/dist/types/components/invoices/InvoiceOrderSummary/InvoiceOrderSummary.types.d.ts +5 -0
  117. package/dist/types/components/payments/PayButton/PayButton.types.d.ts +2 -0
  118. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +11 -0
  119. package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +4 -1
  120. package/dist/types/components/providers/AuthProvider/AuthProvider.handle.d.ts +17 -0
  121. package/dist/types/components/providers/AuthProvider/AuthProvider.lib.d.ts +23 -1
  122. package/dist/types/components/providers/AuthProvider/AuthProvider.types.d.ts +12 -0
  123. package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +3 -1
  124. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
  125. package/dist/types/components/providers/Provider/Provider.types.d.ts +1 -1
  126. package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -1
  127. package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +16 -0
  128. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +2 -0
  129. package/dist/types/public/components/CustomerShippingAddresses/CustomerShippingAddresses.types.d.ts +12 -0
  130. package/dist/types/public/core/types.d.ts +5 -0
  131. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +3 -1
  132. package/dist/types/translations/supported.d.ts +1 -1
  133. package/dist/types/types/portalAuthentication.d.ts +2 -0
  134. package/dist/types/types/portalToken.d.ts +9 -0
  135. package/dist/types/types/shippingAddress.d.ts +9 -0
  136. package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +2 -0
  137. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +1 -1
  138. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalRequests.d.ts +27 -6
  139. package/dist/types/vendor/@solvimon/solvimon-types/types/ConfigMeterProperties.d.ts +3 -0
  140. package/dist/types/vendor/@solvimon/solvimon-types/types/Entitlement.d.ts +6 -0
  141. package/dist/types/vendor/@solvimon/solvimon-types/types/Integrations.d.ts +9 -1
  142. package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +16 -1
  143. package/dist/types/vendor/@solvimon/solvimon-types/types/JWT.d.ts +10 -0
  144. package/dist/types/vendor/@solvimon/solvimon-types/types/MeterPropertyVariable.d.ts +16 -0
  145. package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +6 -0
  146. package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
  147. package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +12 -3
  148. package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +71 -0
  149. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +14 -0
  150. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +1 -0
  151. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteVersions.d.ts +35 -0
  152. package/dist/types/vendor/@solvimon/solvimon-types/types/Quotes.d.ts +16 -0
  153. package/dist/types/vendor/@solvimon/solvimon-types/types/ShippingAddress.d.ts +54 -0
  154. package/dist/{useActionDispatchProvider-DC_fUykI.mjs → useActionDispatchProvider-3W2vEyIg.mjs} +1 -1
  155. package/dist/{useCustomer-C3kTh7wn.mjs → useCustomer-cObBvDOu.mjs} +2 -2
  156. package/dist/useCustomerFormLabels-DJWf2O17.mjs +1173 -0
  157. package/dist/{useIncrementalLoading-C_sHmW7d.mjs → useIncrementalLoading-CATuO36d.mjs} +2 -2
  158. package/dist/{useInvoiceData-BIh8-h8b.mjs → useInvoiceData-DD44HTl7.mjs} +2 -2
  159. package/dist/{useInvoicesList-Y6p0Pqpy.mjs → useInvoicesList-CpB-41MQ.mjs} +10 -10
  160. package/dist/useLazyFloating.es-CycqRyeb.mjs +68 -0
  161. package/dist/useLoadInitialData-qzdnBoui.mjs +15 -0
  162. package/dist/{usePaymentFormHold-FfNc578l.mjs → usePaymentFormHold-ByUZi3A-.mjs} +28 -36
  163. package/dist/{usePaymentMethodAvailability-CnYTvG15.mjs → usePaymentMethodAvailability-DUdrs0Ji.mjs} +4 -4
  164. package/dist/usePaymentMethods-ByaKF7mf.mjs +21 -0
  165. package/dist/{usePayments-CykCZPG2.mjs → usePayments-BXABv-lF.mjs} +9 -9
  166. package/dist/{usePortal-CxzKGhbK.mjs → usePortal-CwR_FxTb.mjs} +1 -1
  167. package/dist/{useService-B0OQJmif.mjs → useService-BZcbUZHI.mjs} +3 -3
  168. package/dist/{useTimePeriod.es-JkXdHNWr.mjs → useTimePeriod.es-BpdiVwg8.mjs} +1 -1
  169. package/package.json +7 -7
  170. package/dist/Checkbox.vue.es-DsyiJ-VY.mjs +0 -50
  171. package/dist/Checkout.entry.ce-BZ1rYQvt.mjs +0 -5279
  172. package/dist/ContentWithAsideLayout-BCM8tmZN.mjs +0 -38
  173. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-Bk4zwyWa.mjs +0 -362
  174. package/dist/FormMessage.vue.es-jG3fQZms.mjs +0 -29
  175. package/dist/InvoiceSummary.vue.es-DbNoGfYN.mjs +0 -2596
  176. package/dist/RadioGroupExtended.vue.es-UtKsdmiv.mjs +0 -163
  177. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Djc1SkEU.mjs +0 -688
  178. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DNr1CqVj.mjs +0 -5221
  179. package/dist/TooltipParagraph.vue.es-BjCn2BF6.mjs +0 -129
  180. package/dist/customElements-Di3zwlEU.mjs +0 -6447
  181. package/dist/customer.es-B5ppZf0j.mjs +0 -20
  182. package/dist/floating-ui.vue.es-CYt0fSY7.mjs +0 -1108
  183. package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +0 -4
  184. package/dist/payments-Ci8bF4C6.mjs +0 -45
  185. package/dist/subscriptions-CwogJODR.mjs +0 -54
  186. package/dist/useCustomerFormLabels-CK7K50nB.mjs +0 -1369
  187. package/dist/useLoadInitialData-4k_Cyqef.mjs +0 -15
  188. package/dist/usePaymentMethodOptions-1QBcmgUf.mjs +0 -40
  189. package/dist/usePaymentMethods-gvr-rmwE.mjs +0 -15
@@ -0,0 +1,4202 @@
1
+ import { defineComponent as de, openBlock as m, createElementBlock as R, createElementVNode as E, createVNode as A, unref as t, withCtx as b, createTextVNode as G, toDisplayString as z, withModifiers as st, ref as H, computed as c, toValue as In, watch as he, onMounted as qe, toRaw as Gn, shallowRef as Yn, nextTick as Ve, createBlock as S, useModel as An, mergeModels as ft, reactive as Kn, Fragment as ye, renderList as lt, createCommentVNode as x, createSlots as _t, normalizeClass as Le, renderSlot as ht, resolveComponent as Hn, onBeforeUnmount as Qn, mergeProps as we, withDirectives as Zn, withKeys as qt, vShow as qn, defineAsyncComponent as Xt, isRef as Wt } from "vue";
2
+ import { a as Pe, d as ce, e as ke, k as Xn, C as Wn, g as Jn, h as ei, j as ti } from "./customElements-BTj4ii4f.mjs";
3
+ import { u as bt } from "./useTimePeriod.es-BpdiVwg8.mjs";
4
+ import { f as be } from "./formatting.es-RclXHhKo.mjs";
5
+ import { _ as Oe, a as nt } from "./Button.vue.es-Zw--kuaU.mjs";
6
+ import { _ as Jt } from "./ErrorNotification.vue.es-DNd65mQq.mjs";
7
+ import { i as Ge, g as at, b as ni, a as en, f as Mt, h as ii, j as tn, r as oi, D as ai, t as Pn, k as nn, u as si, c as on, _ as it } from "./useCustomerFormLabels-DJWf2O17.mjs";
8
+ import { t as It, o as li } from "./taxId.es-DkD3Ltr8.mjs";
9
+ import { e as At, u as ri, b as an, r as ui, f as De, a as _e, d as ci } from "./formControl-BZQLHnOO.mjs";
10
+ import { c as di } from "./subscriptions-BWXZGK0E.mjs";
11
+ import { A as Te } from "./ApiStatus-CSFKl_ra.mjs";
12
+ import { c as pi, _ as mi } from "./TrialChip.vue.es-DOopmaXA.mjs";
13
+ import { a as gi, u as yi } from "./useService-BZcbUZHI.mjs";
14
+ import { c as vi } from "./invoices-e1sKLgxg.mjs";
15
+ import { g as $e, b as Cn, e as fi } from "./pricingPlanSchedule-BPrS2WRd.mjs";
16
+ import { u as hi, s as _i, a as sn, r as bi, _ as ln } from "./CheckoutAddressFields.vue_vue_type_script_setup_true_lang-2D8VM_7W.mjs";
17
+ import { u as Mi, _ as Nn, a as Ii } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs";
18
+ import { u as Ai } from "./paymentMethods-Nfv9HdkS.mjs";
19
+ import { b as Pt, a as Pi, e as Ci } from "./subscription-BhxoqwcT.mjs";
20
+ import { b as Ni, a as Di, c as Ei } from "./pricing-BOhvWWMj.mjs";
21
+ import { s as Li, a as ki, g as Si, b as rn, c as ot, d as un, _ as Ti, i as wi } from "./OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-3DQLCR3U.mjs";
22
+ import { h as Oi, i as Ri, j as xi, e as zi, t as cn, a as ji, u as Bi, s as Ui, k as Fi } from "./usePaymentFormHold-ByUZi3A-.mjs";
23
+ import { u as Vi } from "./usePortal-CwR_FxTb.mjs";
24
+ import { g as dn } from "./getCountryNameByCode.es-BDHua7VM.mjs";
25
+ import { _ as pn } from "./Expand.vue.es-BleuAfDz.mjs";
26
+ import { _ as Qe } from "./Input.vue.es-D8Oj8MWv.mjs";
27
+ import { _ as mn, u as $i } from "./Label.vue.es-DtpLM1KH.mjs";
28
+ import { _ as Ae } from "./Section.vue.es-CvX9tg2f.mjs";
29
+ import { _ as Gi } from "./Alert.vue.es-CNrEaLvh.mjs";
30
+ import { c as Yi } from "./customer-BIjC0CWJ.mjs";
31
+ import { a as Ki } from "./InvoicePreview.vue.es-4Q2hzaFS.mjs";
32
+ import { _ as Hi, T as Qi, a as Zi } from "./TooltipParagraph.vue.es-Dw0ndjle.mjs";
33
+ import { _ as qi } from "./PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BIAm22Kq.mjs";
34
+ import { _ as gn } from "./Chip.vue.es-D3UDSyXC.mjs";
35
+ import { S as Xi } from "./index.es-CpmQmvOg.mjs";
36
+ import { u as Dn } from "./useViewport-psZejz_H.mjs";
37
+ import { _ as vt } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CVP-7ne3.mjs";
38
+ import { _ as Ee } from "./Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
39
+ import { _ as Wi } from "./DividerText.vue.es-CNbgif-3.mjs";
40
+ import { l as rt } from "./adyenSdk-B01MB9Ia.mjs";
41
+ import { c as Ji } from "./payments-BnxbzQUC.mjs";
42
+ import { c as eo, b as to, i as no } from "./paymentOutcome-BXEU5-84.mjs";
43
+ import { C as io } from "./ContentWithAsideLayout-Bnbsq8_5.mjs";
44
+ import { _ as oo } from "./SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cl7I1Apo.mjs";
45
+ const ao = {
46
+ AT: "Austria",
47
+ BE: "Belgium",
48
+ BG: "Bulgaria",
49
+ CY: "Cyprus",
50
+ CZ: "Czech Republic",
51
+ DE: "Germany",
52
+ DK: "Denmark",
53
+ EE: "Estonia",
54
+ ES: "Spain",
55
+ FI: "Finland",
56
+ FR: "France",
57
+ GR: "Greece",
58
+ HR: "Croatia",
59
+ HU: "Hungary",
60
+ IE: "Ireland",
61
+ IT: "Italy",
62
+ LT: "Lithuania",
63
+ LU: "Luxembourg",
64
+ LV: "Latvia",
65
+ MT: "Malta",
66
+ NL: "Netherlands",
67
+ PL: "Poland",
68
+ PT: "Portugal",
69
+ RO: "Romania",
70
+ SE: "Sweden",
71
+ SI: "Slovenia",
72
+ SK: "Slovakia"
73
+ };
74
+ function En(e) {
75
+ return Object.keys(ao).includes(e);
76
+ }
77
+ const so = { class: "flex min-h-96 w-full items-center justify-center" }, lo = { class: "max-w-sm" }, ro = /* @__PURE__ */ de({
78
+ __name: "CheckoutNotAvailable",
79
+ setup(e) {
80
+ const { $t: i } = Pe(), o = () => {
81
+ window.location.reload();
82
+ };
83
+ return (a, n) => (m(), R("div", so, [
84
+ E("div", lo, [
85
+ A(t(ce), { variant: "heading-1" }, {
86
+ default: b(() => [
87
+ G(z(t(i)({
88
+ defaultMessage: "Checkout not available",
89
+ id: "checkout.not_available.title",
90
+ description: "The title of the checkout not available page"
91
+ })), 1)
92
+ ]),
93
+ _: 1
94
+ }),
95
+ A(t(ce), {
96
+ variant: "body-sm",
97
+ color: "subtle"
98
+ }, {
99
+ default: b(() => [
100
+ G(z(t(i)({
101
+ defaultMessage: "The checkout is currently not available.",
102
+ id: "checkout.not_available.description",
103
+ description: "The description of the checkout not available page"
104
+ })) + " ", 1),
105
+ E("a", {
106
+ href: "#",
107
+ class: "text-primary-900 hover:underline",
108
+ onClick: st(o, ["prevent"])
109
+ }, z(t(i)({
110
+ defaultMessage: "Reload",
111
+ id: "checkout.not_available.reload_button",
112
+ description: "The label of the reload button"
113
+ })), 1),
114
+ G(" " + z(t(i)({
115
+ defaultMessage: "this page to try again, or contact customer support.",
116
+ id: "checkout.not_available.contact_support_message",
117
+ description: "The message shown when the user wants to contact customer support"
118
+ })), 1)
119
+ ]),
120
+ _: 1
121
+ })
122
+ ])
123
+ ]));
124
+ }
125
+ }), uo = [
126
+ "companyLegalName",
127
+ "firstName",
128
+ "infix",
129
+ "lastName",
130
+ "addressLine1",
131
+ "addressLine2",
132
+ "postalCode",
133
+ "city",
134
+ "state",
135
+ "companyVatNumber",
136
+ "promotionCode",
137
+ "shippingAddressLine1",
138
+ "shippingAddressLine2",
139
+ "shippingPostalCode",
140
+ "shippingCity",
141
+ "shippingState",
142
+ "shippingPhoneNumber",
143
+ "shippingFirstName",
144
+ "shippingLastName",
145
+ "shippingAttentionName"
146
+ ], co = /^\d{1,9}$/, yn = (e) => Ge(e), Ln = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
147
+ function vn(e) {
148
+ if (!Array.isArray(e)) return;
149
+ const i = e.flatMap(
150
+ (o) => Ln(o) && typeof o.pricing_item_config_id == "string" && typeof o.number == "string" && co.test(o.number) ? [{ pricing_item_config_id: o.pricing_item_config_id, number: o.number }] : []
151
+ );
152
+ return i.length === e.length ? i : void 0;
153
+ }
154
+ function po(e) {
155
+ if (!Ln(e)) return {};
156
+ const i = {};
157
+ uo.forEach((n) => {
158
+ const u = e[n];
159
+ typeof u == "string" && (i[n] = u);
160
+ }), typeof e.email == "string" && At.$validator(e.email, {}, {}) && (i.email = e.email), typeof e.country == "string" && yn(e.country) && (i.country = e.country), typeof e.shippingCountry == "string" && yn(e.shippingCountry) && (i.shippingCountry = e.shippingCountry), typeof e.billingAddressSameAsShipping == "boolean" && (i.billingAddressSameAsShipping = e.billingAddressSameAsShipping), (e.type === "INDIVIDUAL" || e.type === "ORGANIZATION") && (i.type = e.type);
161
+ const o = vn(e.seatsValues);
162
+ o && (i.seatsValues = o);
163
+ const a = vn(e.unitsValues);
164
+ return a && (i.unitsValues = a), Array.isArray(e.enabledPricingIds) && e.enabledPricingIds.every((n) => typeof n == "string") && (i.enabledPricingIds = e.enabledPricingIds), i;
165
+ }
166
+ const mo = "preview", go = "NL", kn = (e) => {
167
+ var i, o;
168
+ if ("organization" in e)
169
+ return (i = e.organization) == null ? void 0 : i.registered_address;
170
+ if ("individual" in e)
171
+ return (o = e.individual) == null ? void 0 : o.residential_address;
172
+ }, yo = (e) => {
173
+ const i = kn(e);
174
+ return {
175
+ ...(i == null ? void 0 : i.line1) && { line1: i.line1 },
176
+ ...(i == null ? void 0 : i.line2) && { line2: i.line2 },
177
+ ...(i == null ? void 0 : i.city) && { city: i.city },
178
+ ...(i == null ? void 0 : i.state) && { state: i.state },
179
+ country: (i == null ? void 0 : i.country) || go,
180
+ ...(i == null ? void 0 : i.postal_code) && { postal_code: i.postal_code }
181
+ };
182
+ }, vo = (e) => {
183
+ var a, n;
184
+ const i = yo(e), o = e.type ?? "INDIVIDUAL";
185
+ if (o === "ORGANIZATION") {
186
+ const u = "organization" in e ? e.organization : void 0, y = (n = (a = u == null ? void 0 : u.tax_ids) == null ? void 0 : a[0]) == null ? void 0 : n.id;
187
+ return {
188
+ type: o,
189
+ organization: {
190
+ legal_name: (u == null ? void 0 : u.legal_name) || mo,
191
+ registered_address: i,
192
+ ...y && {
193
+ tax_id: It.$validator(y, {}, {}) ? y : void 0
194
+ }
195
+ }
196
+ };
197
+ }
198
+ return {
199
+ type: o,
200
+ individual: {
201
+ residential_address: i
202
+ }
203
+ };
204
+ }, fo = {
205
+ AD: "EUR",
206
+ AE: "AED",
207
+ AF: "AFN",
208
+ AG: "XCD",
209
+ AI: "XCD",
210
+ AL: "ALL",
211
+ AM: "AMD",
212
+ AO: "AOA",
213
+ AR: "ARS",
214
+ AS: "USD",
215
+ AT: "EUR",
216
+ AU: "AUD",
217
+ AW: "AWG",
218
+ AX: "EUR",
219
+ AZ: "AZN",
220
+ BA: "BAM",
221
+ BB: "BBD",
222
+ BD: "BDT",
223
+ BE: "EUR",
224
+ BF: "XOF",
225
+ BG: "BGN",
226
+ BH: "BHD",
227
+ BI: "BIF",
228
+ BJ: "XOF",
229
+ BL: "EUR",
230
+ BM: "BMD",
231
+ BN: "BND",
232
+ BO: "BOB",
233
+ BQ: "USD",
234
+ BR: "BRL",
235
+ BS: "BSD",
236
+ BT: "BTN",
237
+ BV: "NOK",
238
+ BW: "BWP",
239
+ BY: "BYN",
240
+ BZ: "BZD",
241
+ CA: "CAD",
242
+ CC: "AUD",
243
+ CD: "CDF",
244
+ CF: "XAF",
245
+ CG: "XAF",
246
+ CH: "CHF",
247
+ CI: "XOF",
248
+ CK: "NZD",
249
+ CL: "CLP",
250
+ CM: "XAF",
251
+ CN: "CNY",
252
+ CO: "COP",
253
+ CR: "CRC",
254
+ CU: "CUP",
255
+ CV: "CVE",
256
+ CW: "ANG",
257
+ CX: "AUD",
258
+ CY: "EUR",
259
+ CZ: "CZK",
260
+ DE: "EUR",
261
+ DJ: "DJF",
262
+ DK: "DKK",
263
+ DM: "XCD",
264
+ DO: "DOP",
265
+ DZ: "DZD",
266
+ EC: "USD",
267
+ EE: "EUR",
268
+ EG: "EGP",
269
+ EH: "MAD",
270
+ ER: "ERN",
271
+ ES: "EUR",
272
+ ET: "ETB",
273
+ FI: "EUR",
274
+ FJ: "FJD",
275
+ FK: "FKP",
276
+ FM: "USD",
277
+ FO: "DKK",
278
+ FR: "EUR",
279
+ GA: "XAF",
280
+ GB: "GBP",
281
+ GD: "XCD",
282
+ GE: "GEL",
283
+ GF: "EUR",
284
+ GG: "GBP",
285
+ GH: "GHS",
286
+ GI: "GIP",
287
+ GL: "DKK",
288
+ GM: "GMD",
289
+ GN: "GNF",
290
+ GP: "EUR",
291
+ GQ: "XAF",
292
+ GR: "EUR",
293
+ GS: "GBP",
294
+ GT: "GTQ",
295
+ GU: "USD",
296
+ GW: "XOF",
297
+ GY: "GYD",
298
+ HK: "HKD",
299
+ HM: "AUD",
300
+ HN: "HNL",
301
+ HR: "EUR",
302
+ HT: "HTG",
303
+ HU: "HUF",
304
+ ID: "IDR",
305
+ IE: "EUR",
306
+ IL: "ILS",
307
+ IM: "GBP",
308
+ IN: "INR",
309
+ IO: "USD",
310
+ IQ: "IQD",
311
+ IR: "IRR",
312
+ IS: "ISK",
313
+ IT: "EUR",
314
+ JE: "GBP",
315
+ JM: "JMD",
316
+ JO: "JOD",
317
+ JP: "JPY",
318
+ KE: "KES",
319
+ KG: "KGS",
320
+ KH: "KHR",
321
+ KI: "AUD",
322
+ KM: "KMF",
323
+ KN: "XCD",
324
+ KP: "KPW",
325
+ KR: "KRW",
326
+ KW: "KWD",
327
+ KY: "KYD",
328
+ KZ: "KZT",
329
+ LA: "LAK",
330
+ LB: "LBP",
331
+ LC: "XCD",
332
+ LI: "CHF",
333
+ LK: "LKR",
334
+ LR: "LRD",
335
+ LS: "LSL",
336
+ LT: "EUR",
337
+ LU: "EUR",
338
+ LV: "EUR",
339
+ LY: "LYD",
340
+ MA: "MAD",
341
+ MC: "EUR",
342
+ MD: "MDL",
343
+ ME: "EUR",
344
+ MF: "EUR",
345
+ MG: "MGA",
346
+ MH: "USD",
347
+ MK: "MKD",
348
+ ML: "XOF",
349
+ MM: "MMK",
350
+ MN: "MNT",
351
+ MO: "MOP",
352
+ MP: "USD",
353
+ MQ: "EUR",
354
+ MR: "MRU",
355
+ MS: "XCD",
356
+ MT: "EUR",
357
+ MU: "MUR",
358
+ MV: "MVR",
359
+ MW: "MWK",
360
+ MX: "MXN",
361
+ MY: "MYR",
362
+ MZ: "MZN",
363
+ NA: "NAD",
364
+ NC: "XPF",
365
+ NE: "XOF",
366
+ NF: "AUD",
367
+ NG: "NGN",
368
+ NI: "NIO",
369
+ NL: "EUR",
370
+ NO: "NOK",
371
+ NP: "NPR",
372
+ NR: "AUD",
373
+ NU: "NZD",
374
+ NZ: "NZD",
375
+ OM: "OMR",
376
+ PA: "PAB",
377
+ PE: "PEN",
378
+ PF: "XPF",
379
+ PG: "PGK",
380
+ PH: "PHP",
381
+ PK: "PKR",
382
+ PL: "PLN",
383
+ PM: "EUR",
384
+ PN: "NZD",
385
+ PR: "USD",
386
+ PS: "ILS",
387
+ PT: "EUR",
388
+ PW: "USD",
389
+ PY: "PYG",
390
+ QA: "QAR",
391
+ RE: "EUR",
392
+ RO: "RON",
393
+ RS: "RSD",
394
+ RU: "RUB",
395
+ RW: "RWF",
396
+ SA: "SAR",
397
+ SB: "SBD",
398
+ SC: "SCR",
399
+ SD: "SDG",
400
+ SE: "SEK",
401
+ SG: "SGD",
402
+ SH: "SHP",
403
+ SI: "EUR",
404
+ SJ: "NOK",
405
+ SK: "EUR",
406
+ SL: "SLE",
407
+ SM: "EUR",
408
+ SN: "XOF",
409
+ SO: "SOS",
410
+ SR: "SRD",
411
+ SS: "SSP",
412
+ ST: "STN",
413
+ SV: "USD",
414
+ SX: "ANG",
415
+ SY: "SYP",
416
+ SZ: "SZL",
417
+ TC: "USD",
418
+ TD: "XAF",
419
+ TF: "EUR",
420
+ TG: "XOF",
421
+ TH: "THB",
422
+ TJ: "TJS",
423
+ TK: "NZD",
424
+ TL: "USD",
425
+ TM: "TMT",
426
+ TN: "TND",
427
+ TO: "TOP",
428
+ TR: "TRY",
429
+ TT: "TTD",
430
+ TV: "AUD",
431
+ TW: "TWD",
432
+ TZ: "TZS",
433
+ UA: "UAH",
434
+ UG: "UGX",
435
+ US: "USD",
436
+ UY: "UYU",
437
+ UZ: "UZS",
438
+ VA: "EUR",
439
+ VC: "XCD",
440
+ VE: "VES",
441
+ VG: "USD",
442
+ VI: "USD",
443
+ VN: "VND",
444
+ VU: "VUV",
445
+ WF: "XPF",
446
+ WS: "WST",
447
+ YE: "YER",
448
+ YT: "EUR",
449
+ ZA: "ZAR",
450
+ ZM: "ZMW",
451
+ ZW: "ZWL"
452
+ }, ho = (e) => {
453
+ if (e)
454
+ return fo[e];
455
+ }, Sn = ({
456
+ country: e,
457
+ pricingCurrencySettings: i,
458
+ fallbackCurrency: o
459
+ }) => {
460
+ const a = ho(e), n = (i == null ? void 0 : i.pricing_currencies) ?? [];
461
+ return a && n.includes(a) ? a : (i == null ? void 0 : i.default_pricing_currency) ?? o ?? a;
462
+ }, _o = () => {
463
+ const { getInvoicePreview: e } = vi(), i = ke(), o = H(), a = H(), n = H(), u = H({}), y = H(Te.Initial), d = H({}), M = H(), s = (I) => `${I.type}:${I.value}`;
464
+ let D = 0, T = Promise.resolve(), P = () => {
465
+ }, O = new Promise((I) => P = I);
466
+ const K = (I) => {
467
+ const $ = ++D;
468
+ return T = _(I, $), P(), O = new Promise((ae) => P = ae), T;
469
+ }, N = async () => {
470
+ for (; ; ) {
471
+ const I = T;
472
+ if (await Promise.race([
473
+ I.then(
474
+ () => !0,
475
+ (ae) => {
476
+ if (I === T) throw ae;
477
+ return !1;
478
+ }
479
+ ),
480
+ O.then(() => !1)
481
+ ]) && I === T) return;
482
+ }
483
+ }, _ = async ({
484
+ subscription: I,
485
+ subscriptionStartAt: $,
486
+ customer: ae = {},
487
+ seatsValues: Z,
488
+ unitsValues: ne,
489
+ enabledPricingIds: te,
490
+ promotionCode: p
491
+ }, r) => {
492
+ var J, q, X, ie, me, C;
493
+ const L = vo(ae);
494
+ y.value = Te.Loading;
495
+ const f = $e({
496
+ pricingPlanScheduleInfos: I.pricing_plan_schedule_infos,
497
+ type: "DEFAULT"
498
+ }), g = (J = f == null ? void 0 : f.pricing_plan_version) == null ? void 0 : J.pricing_currency_settings, Y = (((q = g == null ? void 0 : g.pricing_currencies) == null ? void 0 : q.length) ?? 0) > 1, l = ((ie = (X = f == null ? void 0 : f.pricing_plan_version) == null ? void 0 : X.billing_period_settings) == null ? void 0 : ie.billing_periods) ?? [], h = l.length > 0 ? l.map(({ period: k }) => k) : I.billing_period ? [I.billing_period] : [], F = Sn({
499
+ country: (me = kn(ae)) == null ? void 0 : me.country,
500
+ pricingCurrencySettings: g,
501
+ fallbackCurrency: I.billing_currency
502
+ });
503
+ if (!h.length) {
504
+ i.warn("INVOICE_PREVIEW_SKIPPED", "No billing period to preview an invoice for", {
505
+ subscriptionId: I.id
506
+ }), y.value = Te.Done;
507
+ return;
508
+ }
509
+ const j = I.billing_period ? s(I.billing_period) : s(h[0]), re = h.map(async (k) => {
510
+ var oe;
511
+ const w = s(k), V = Cn({
512
+ enabledPricings: te == null ? void 0 : te.map((se) => ({
513
+ pricing_id: se
514
+ })),
515
+ seatsValues: Z,
516
+ unitsValues: ne,
517
+ pricingPlanScheduleInfos: I.pricing_plan_schedule_infos,
518
+ pricingCurrency: Y ? F : void 0,
519
+ // Required by the API whenever the version has billing period settings.
520
+ billingPeriod: l.length > 0 ? k : void 0
521
+ }) ?? [];
522
+ if (p) {
523
+ const se = (oe = I.pricing_plan_schedule_infos.find(
524
+ ({ pricing_plan_schedule: ge }) => ge.type === "DEFAULT"
525
+ )) == null ? void 0 : oe.id;
526
+ if (se) {
527
+ const ge = V.find(
528
+ ({ pricing_plan_schedule_id: Me }) => Me === se
529
+ );
530
+ ge ? ge.promotion_codes = [p] : V.push({
531
+ pricing_plan_schedule_id: se,
532
+ promotion_codes: [p]
533
+ });
534
+ }
535
+ }
536
+ const Q = {
537
+ pricingPlanSubscriptionId: I.id,
538
+ startAt: $,
539
+ customizations: V,
540
+ customer: L
541
+ }, ue = d.value[w];
542
+ if (ue && gi(Q, ue))
543
+ return { periodKey: w, payload: Q, response: void 0 };
544
+ const W = await e(Q);
545
+ return { periodKey: w, payload: Q, response: W };
546
+ });
547
+ try {
548
+ const k = await Promise.all(re);
549
+ if (r !== D) return T;
550
+ const w = {
551
+ ...u.value
552
+ }, V = { ...d.value }, Q = I.pricing_plan_schedule_infos.find(
553
+ ({ pricing_plan_schedule: W }) => W.type === "TRIAL"
554
+ ), ue = (C = I.pricing_plan_schedule_infos.find(
555
+ ({ pricing_plan_schedule: W }) => W.type === "DEFAULT"
556
+ )) == null ? void 0 : C.id;
557
+ k.forEach(({ periodKey: W, payload: oe, response: se }) => {
558
+ var ve;
559
+ if (!se) return;
560
+ V[W] = oe, M.value = (ve = se.invoice_infos.at(-1)) == null ? void 0 : ve.pricing_plan_schedule_id, Q && (a.value = se.first_invoice, Q.start_at && Q.end_at && (o.value = pi(
561
+ new Date(Q.start_at),
562
+ new Date(Q.end_at)
563
+ )));
564
+ const ge = se.invoice_infos.find(
565
+ ({ pricing_plan_schedule_id: Re }) => Re === ue
566
+ ), Me = ge == null ? void 0 : ge.invoices[0];
567
+ Me && (w[W] = Me);
568
+ }), d.value = V, u.value = w, n.value = w[j], y.value = Te.Done;
569
+ } catch (k) {
570
+ if (i.error(
571
+ "INVOICE_PREVIEW_FAILED",
572
+ "Failed to load the invoice preview",
573
+ { preview: "CHECKOUT" },
574
+ k
575
+ ), r !== D) return T;
576
+ throw y.value = Te.Failed, k;
577
+ }
578
+ };
579
+ return {
580
+ loadInvoicePreview: K,
581
+ invoicePreview: n,
582
+ invoicePreviewByBillingPeriod: u,
583
+ trialInvoicePreview: a,
584
+ trialPeriod: o,
585
+ lastPreviewScheduleId: M,
586
+ isPending: c(() => y.value === Te.Loading),
587
+ isFailed: c(() => y.value === Te.Failed),
588
+ /** Settles as the preview asked for last does, however many take over meanwhile. */
589
+ whenLoaded: N
590
+ };
591
+ };
592
+ function bo() {
593
+ return {
594
+ /**
595
+ * Get geolocation information from the user
596
+ */
597
+ getGeoLocation() {
598
+ return fetch("https://api.country.is/").then((e) => e.json());
599
+ }
600
+ };
601
+ }
602
+ function Mo({
603
+ initialState: e,
604
+ onRequiredFieldChange: i,
605
+ isShippingAddressRequired: o
606
+ }) {
607
+ const a = c(() => In(o) ?? !1), n = H(at(e)), u = H(at(e));
608
+ a.value && !n.value.shippingCountry && (n.value.shippingCountry = n.value.country, u.value.shippingCountry = n.value.country);
609
+ const y = (r) => {
610
+ const L = at({ ...Gn(n.value), ...r });
611
+ n.value = L, u.value = structuredClone(L);
612
+ }, { formatOf: d } = hi({
613
+ isNeeded: () => a.value,
614
+ countries: [() => n.value.shippingCountry, () => n.value.country]
615
+ }), M = c(() => d(n.value.shippingCountry)), s = c(
616
+ () => a.value && !n.value.billingAddressSameAsShipping
617
+ ), D = c(
618
+ () => s.value ? d(n.value.country) : void 0
619
+ ), T = c(() => {
620
+ const r = n.value.type === "ORGANIZATION" ? [] : ["shippingLastName"];
621
+ return [
622
+ ...ni(n.value.country),
623
+ ...a.value ? [
624
+ ...en(
625
+ "SHIPPING",
626
+ n.value.shippingCountry,
627
+ M.value
628
+ ),
629
+ "shippingPhoneNumber",
630
+ ...r
631
+ ] : [],
632
+ ...s.value ? en(
633
+ "BILLING",
634
+ n.value.country,
635
+ D.value
636
+ ) : []
637
+ ];
638
+ }), P = (r) => T.value.includes(r), O = ri(
639
+ c(() => ({
640
+ ...sn("BILLING", () => D.value, P),
641
+ ...sn("SHIPPING", () => M.value, P),
642
+ email: { required: an, email: At },
643
+ country: { required: an },
644
+ companyLegalName: {
645
+ required: ui(() => n.value.type === "ORGANIZATION")
646
+ },
647
+ companyVatNumber: Mt(n.value) ? { taxId: It } : {},
648
+ ..._i(P)
649
+ })),
650
+ n
651
+ ), K = bo(), N = async () => {
652
+ try {
653
+ const { country: r } = await K.getGeoLocation();
654
+ if (typeof r != "string" || !Ge(r))
655
+ return;
656
+ n.value.country || (n.value.country = r), a.value && !n.value.shippingCountry && (n.value.shippingCountry = r);
657
+ } catch {
658
+ }
659
+ }, _ = [
660
+ "type",
661
+ "companyVatNumber",
662
+ "seatsValues",
663
+ "unitsValues",
664
+ "enabledPricingIds"
665
+ ], I = (r) => _.includes(r) || (a.value ? tn("SHIPPING", n.value.shippingCountry) : tn("BILLING", n.value.country)).includes(r), $ = () => JSON.parse(JSON.stringify(n.value));
666
+ let ae = $();
667
+ const Z = (r) => Object.keys(li({ from: ae, to: r })).filter(Io).some(I);
668
+ he(
669
+ () => [
670
+ a.value,
671
+ n.value.billingAddressSameAsShipping,
672
+ n.value.shippingAddressLine1,
673
+ n.value.shippingAddressLine2,
674
+ n.value.shippingPostalCode,
675
+ n.value.shippingCity,
676
+ n.value.shippingState,
677
+ n.value.shippingCountry,
678
+ M.value
679
+ ],
680
+ () => {
681
+ !a.value || !n.value.billingAddressSameAsShipping || Object.assign(
682
+ n.value,
683
+ ii(n.value, M.value)
684
+ );
685
+ },
686
+ { immediate: !0 }
687
+ );
688
+ const ne = H(!1), te = (r) => {
689
+ const L = Z(r);
690
+ ae = r, ne.value = !1, L && i(r);
691
+ };
692
+ he(
693
+ $,
694
+ (r) => {
695
+ ne.value = Z(r);
696
+ },
697
+ { flush: "sync" }
698
+ );
699
+ const p = () => {
700
+ ne.value && te($());
701
+ };
702
+ return qe(() => {
703
+ e != null && e.country || N();
704
+ }), Mi($, te, { debounce: 200 }), {
705
+ form: n,
706
+ validation: O,
707
+ getIsFieldRequired: P,
708
+ shippingAddressFormat: M,
709
+ updateInitialState: y,
710
+ initialState: u,
711
+ isPreviewStale: ne,
712
+ flushPreviewChange: p
713
+ };
714
+ }
715
+ function Io(e) {
716
+ return e in at();
717
+ }
718
+ function Ao(e, i = void 0) {
719
+ const o = i ?? [], a = Pt(e);
720
+ for (const n of a)
721
+ if (["EXACTLY_ONE", "AT_LEAST_ONE"].includes(n.selection_constraint)) {
722
+ const u = n.pricings.map((y) => y.id);
723
+ if (i != null && i.some((y) => u.includes(y)))
724
+ continue;
725
+ o.push(n.pricings[0].id);
726
+ }
727
+ return o;
728
+ }
729
+ function Po(e) {
730
+ return Pt(e).some(
731
+ (o) => o.selection_constraint === "EXACTLY_ONE" || o.selection_constraint === "AT_LEAST_ONE"
732
+ );
733
+ }
734
+ function Co(e) {
735
+ const i = Ni(e.pricing_plan_schedule_infos), o = Pt(e);
736
+ return i.some((a) => a.product_type === "ADDON") || o.some((a) => a.object_type === "ADDON");
737
+ }
738
+ const fn = (e) => (e ?? []).flatMap(
739
+ (i) => i.configs ?? []
740
+ ), No = (e) => [
741
+ ...e.configs ?? [],
742
+ ...fn(e.billing_period_configs),
743
+ ...(e.pricing_currency_configs ?? []).flatMap((i) => [
744
+ ...i.configs ?? [],
745
+ ...fn(i.billing_period_configs)
746
+ ])
747
+ ];
748
+ function ll({
749
+ pricings: e,
750
+ pricingItemConfigId: i
751
+ }) {
752
+ var u, y;
753
+ const o = e.flatMap((d) => d.items ?? []).find((d) => {
754
+ var M;
755
+ return (M = d.configs) == null ? void 0 : M.some((s) => s.id === i);
756
+ }), a = (u = o == null ? void 0 : o.configs) == null ? void 0 : u.find((d) => d.id === i), n = (y = o == null ? void 0 : o.product_items) == null ? void 0 : y[0];
757
+ return {
758
+ config: a,
759
+ productItem: n
760
+ };
761
+ }
762
+ const Do = "1", Eo = {
763
+ seats: { schedule: "seats_values", planDefault: "default_seats_value" },
764
+ units: { schedule: "units", planDefault: "default_units" }
765
+ };
766
+ function hn(e, i) {
767
+ var y;
768
+ const o = Eo[e], a = (y = i == null ? void 0 : i.pricing_plan_schedule) == null ? void 0 : y[o.schedule];
769
+ if (!i || !(a != null && a.length))
770
+ return;
771
+ const n = i.pricing_plan_version ? Di(i).flatMap((d) => d.items ?? []).flatMap(No) : [], u = new Map(
772
+ n.flatMap((d) => {
773
+ var s;
774
+ const M = (s = d[o.planDefault]) == null ? void 0 : s.number;
775
+ return M ? [[d.id, M]] : [];
776
+ })
777
+ );
778
+ return a.map(({ pricing_item_config_id: d, number: M }) => ({
779
+ pricing_item_config_id: d,
780
+ number: M || u.get(d) || Do
781
+ }));
782
+ }
783
+ const Lo = "solvimon_checkout_redirect_state", ko = "solvimon_checkout_redirect_state:", So = 3600 * 1e3;
784
+ function To(e) {
785
+ return typeof e == "object" && e !== null && "savedAt" in e && typeof e.savedAt == "number" && "form" in e;
786
+ }
787
+ function _n(e, i) {
788
+ if (!e || !i) return;
789
+ const o = new Map(
790
+ e.map(({ pricing_item_config_id: n, number: u }) => [n, u])
791
+ ), a = new Set(
792
+ i.map(({ pricing_item_config_id: n }) => n)
793
+ );
794
+ if (![...o.keys()].some((n) => !a.has(n)))
795
+ return i.map((n) => {
796
+ const u = Number(o.get(n.pricing_item_config_id)), y = Number(n.number);
797
+ return u > y ? { ...n, number: String(u) } : n;
798
+ });
799
+ }
800
+ const wo = 1e4;
801
+ function Oo({
802
+ initialCountry: e,
803
+ initialEmail: i,
804
+ subscriptionId: o,
805
+ enabledPricingIds: a,
806
+ isShippingAddressRequired: n
807
+ }) {
808
+ const u = ke(), y = (() => {
809
+ if (e) {
810
+ if (Ge(e)) return e;
811
+ u.error("INVALID_COUNTRY_CODE", `invalid country code provided: "${e}"`);
812
+ }
813
+ })(), d = (() => {
814
+ if (i) {
815
+ if (At.$validator(i, {}, {}) === !0) return i;
816
+ u.error("INVALID_EMAIL", "invalid email provided");
817
+ }
818
+ })(), M = H(!1), s = H(), D = Yn({}), { getSubscription: T } = di(), P = _o(), O = c(() => s.value && r.form.value.country && l.value), {
819
+ paymentMethodOptions: K,
820
+ get: N,
821
+ isPending: _,
822
+ error: I
823
+ } = Ai(), $ = async (C, k) => {
824
+ try {
825
+ await N({
826
+ subscriptionId: s.value.id,
827
+ country: C,
828
+ amount: k
829
+ });
830
+ } catch (w) {
831
+ u.error(
832
+ "PAYMENT_METHOD_OPTIONS_LOAD_FAILED",
833
+ "Failed to load the payment methods that can be offered",
834
+ { flow: "CHECKOUT" },
835
+ w
836
+ );
837
+ }
838
+ }, ae = c(() => I.value !== null), Z = () => {
839
+ const { country: C } = r.form.value;
840
+ !s.value || !C || !l.value || $(C, l.value);
841
+ }, ne = () => ({
842
+ isShipped: !!n,
843
+ format: r.shippingAddressFormat.value
844
+ }), te = () => {
845
+ const C = r.form.value;
846
+ return P.loadInvoicePreview({
847
+ subscription: s.value,
848
+ customer: nn(C, ne()),
849
+ seatsValues: C.seatsValues,
850
+ unitsValues: C.unitsValues,
851
+ enabledPricingIds: C.enabledPricingIds ?? a,
852
+ promotionCode: C.promotionCode
853
+ });
854
+ }, p = async (C) => {
855
+ const k = C.promotionCode ?? r.form.value.promotionCode, w = C.enabledPricingIds ?? r.form.value.enabledPricingIds, V = { ...r.form.value, ...C };
856
+ return await P.loadInvoicePreview({
857
+ subscription: s.value,
858
+ customer: nn(V, ne()),
859
+ seatsValues: V.seatsValues,
860
+ unitsValues: V.unitsValues,
861
+ enabledPricingIds: w,
862
+ promotionCode: k
863
+ }), {
864
+ trialInvoicePreview: P.trialInvoicePreview.value,
865
+ invoicePreview: P.invoicePreview.value
866
+ };
867
+ }, r = Mo({
868
+ isShippingAddressRequired: n,
869
+ initialState: {
870
+ country: y,
871
+ email: d
872
+ },
873
+ onRequiredFieldChange: () => {
874
+ s.value && te().catch(() => {
875
+ });
876
+ }
877
+ }), L = async () => {
878
+ var ue, W, oe, se;
879
+ const C = await T({
880
+ id: o,
881
+ expanded: !0
882
+ }), k = $e({
883
+ pricingPlanScheduleInfos: C.pricing_plan_schedule_infos,
884
+ type: "DEFAULT"
885
+ }), w = (se = (oe = (W = (ue = k == null ? void 0 : k.pricing_plan_version) == null ? void 0 : ue.billing_period_settings) == null ? void 0 : W.billing_periods) == null ? void 0 : oe[0]) == null ? void 0 : se.period;
886
+ s.value = {
887
+ ...C,
888
+ billing_period: w ?? C.billing_period
889
+ };
890
+ const V = hn("seats", k), Q = hn("units", k);
891
+ D.value = { seatsValues: V, unitsValues: Q }, r.updateInitialState({
892
+ ...r.form.value,
893
+ enabledPricingIds: Ao(C, a),
894
+ ...V ? { seatsValues: V } : {},
895
+ ...Q ? { unitsValues: Q } : {}
896
+ });
897
+ };
898
+ let f;
899
+ const g = () => f ?? (f = bi()), Y = c(() => {
900
+ var Me, ve, Re, xe, Ye, Xe, fe, ze, Ke, We;
901
+ const C = r.form.value.firstName || r.form.value.infix || r.form.value.lastName ? {
902
+ ...r.form.value.firstName ? { first_name: r.form.value.firstName } : {},
903
+ ...r.form.value.infix ? { infix: r.form.value.infix } : {},
904
+ ...r.form.value.lastName ? { last_name: r.form.value.lastName } : {}
905
+ } : {}, k = {
906
+ ...r.form.value.addressLine1 && {
907
+ line1: r.form.value.addressLine1
908
+ },
909
+ ...r.form.value.addressLine2 && {
910
+ line2: r.form.value.addressLine2
911
+ },
912
+ ...r.form.value.city && { city: r.form.value.city },
913
+ ...r.form.value.postalCode && {
914
+ postal_code: r.form.value.postalCode
915
+ },
916
+ ...r.form.value.state && { state: r.form.value.state },
917
+ country: r.form.value.country ?? ""
918
+ }, w = n ? oi(r.form.value, "BILLING") : k, V = $e({
919
+ pricingPlanScheduleInfos: ((Me = s.value) == null ? void 0 : Me.pricing_plan_schedule_infos) ?? [],
920
+ type: "DEFAULT"
921
+ }), Q = (ve = V == null ? void 0 : V.pricing_plan_version) == null ? void 0 : ve.pricing_currency_settings, ue = (((Re = Q == null ? void 0 : Q.pricing_currencies) == null ? void 0 : Re.length) ?? 0) > 1, W = !!((Xe = (Ye = (xe = V == null ? void 0 : V.pricing_plan_version) == null ? void 0 : xe.billing_period_settings) == null ? void 0 : Ye.billing_periods) != null && Xe.length), oe = Cn({
922
+ enabledPricings: (fe = r.form.value.enabledPricingIds) == null ? void 0 : fe.map((Ce) => ({
923
+ pricing_id: Ce
924
+ })),
925
+ seatsValues: r.form.value.seatsValues,
926
+ unitsValues: r.form.value.unitsValues,
927
+ pricingPlanScheduleInfos: ((ze = s.value) == null ? void 0 : ze.pricing_plan_schedule_infos) ?? [],
928
+ pricingCurrency: ue ? (Ke = s.value) == null ? void 0 : Ke.billing_currency : void 0,
929
+ billingPeriod: W ? (We = s.value) == null ? void 0 : We.billing_period : void 0
930
+ }), se = r.form.value.promotionCode, ge = se && s.value ? (() => {
931
+ var Je, Ie, Be;
932
+ const Ce = oe ? [...oe] : [], He = ((Je = Ce[0]) == null ? void 0 : Je.pricing_plan_schedule_id) ?? ((Be = $e({
933
+ pricingPlanScheduleInfos: ((Ie = s.value) == null ? void 0 : Ie.pricing_plan_schedule_infos) ?? [],
934
+ type: "DEFAULT"
935
+ })) == null ? void 0 : Be.id);
936
+ if (!He)
937
+ return oe;
938
+ const je = Ce.find(
939
+ ({ pricing_plan_schedule_id: pe }) => pe === He
940
+ );
941
+ if (je)
942
+ je.promotion_codes = [se];
943
+ else {
944
+ const pe = oe == null ? void 0 : oe[0];
945
+ Ce.push({
946
+ pricing_plan_schedule_id: He,
947
+ ...(pe == null ? void 0 : pe.enabled_pricings) && {
948
+ enabled_pricings: pe.enabled_pricings
949
+ },
950
+ ...(pe == null ? void 0 : pe.seats_values) && {
951
+ seats_values: pe.seats_values
952
+ },
953
+ ...(pe == null ? void 0 : pe.units) && {
954
+ units: pe.units
955
+ },
956
+ promotion_codes: [se]
957
+ });
958
+ }
959
+ return Ce;
960
+ })() : oe;
961
+ return {
962
+ type: "INIT_PRICING_PLAN_SUBSCRIPTION",
963
+ init_pricing_plan_subscription: {
964
+ template_pricing_plan_subscription_id: o,
965
+ ...ge && {
966
+ pricing_plan_schedule_customizations: ge
967
+ },
968
+ ...n && {
969
+ shipping_address_details: Pn(
970
+ r.form.value,
971
+ g(),
972
+ r.shippingAddressFormat.value
973
+ )
974
+ },
975
+ customer_details: {
976
+ email: r.form.value.email ?? "",
977
+ type: r.form.value.type,
978
+ ...r.form.value.type === "INDIVIDUAL" ? {
979
+ individual: {
980
+ residential_address: w,
981
+ ...C ? { name: C } : {}
982
+ }
983
+ } : {
984
+ organization: {
985
+ registered_address: w,
986
+ legal_name: r.form.value.companyLegalName ?? "",
987
+ ...r.form.value.companyVatNumber && Mt(r.form.value) && It.$validator(r.form.value.companyVatNumber, {}, {}) ? {
988
+ tax_ids: [
989
+ {
990
+ id: r.form.value.companyVatNumber,
991
+ type: ai
992
+ }
993
+ ]
994
+ } : {}
995
+ }
996
+ }
997
+ }
998
+ }
999
+ };
1000
+ }), l = c(() => {
1001
+ var C, k;
1002
+ return ((C = P.trialInvoicePreview.value) == null ? void 0 : C.invoice_amount_including_tax) ?? ((k = P.invoicePreview.value) == null ? void 0 : k.invoice_amount_including_tax);
1003
+ }), h = c(
1004
+ () => P.invoicePreview.value ? Li(P.invoicePreview.value) : void 0
1005
+ ), F = c(() => {
1006
+ var C;
1007
+ return ((C = h.value) == null ? void 0 : C.hasOneOff) ?? !1;
1008
+ }), j = c(() => {
1009
+ var k;
1010
+ const C = h.value;
1011
+ if (C)
1012
+ return C.hasOneOff ? C.hasUnattributed ? void 0 : C.recurring.includingTax : (k = P.invoicePreview.value) == null ? void 0 : k.invoice_amount_including_tax;
1013
+ });
1014
+ he(
1015
+ [() => r.form.value.country, l],
1016
+ ([C, k]) => {
1017
+ !s.value || !C || !k || $(C, k);
1018
+ }
1019
+ );
1020
+ const re = `${ko}${o}`, J = Oi();
1021
+ function q() {
1022
+ const C = { savedAt: Date.now(), form: r.form.value };
1023
+ try {
1024
+ sessionStorage.setItem(re, JSON.stringify(C));
1025
+ } catch (k) {
1026
+ u.warn(
1027
+ "CHECKOUT_FORM_STATE_NOT_SAVED",
1028
+ "Could not keep the checkout form for a redirect return",
1029
+ {},
1030
+ k
1031
+ );
1032
+ }
1033
+ }
1034
+ function X() {
1035
+ try {
1036
+ sessionStorage.removeItem(re), sessionStorage.removeItem(Lo);
1037
+ } catch {
1038
+ }
1039
+ }
1040
+ function ie() {
1041
+ let C = null;
1042
+ try {
1043
+ C = sessionStorage.getItem(re);
1044
+ } catch {
1045
+ return;
1046
+ }
1047
+ if (X(), !C || !J) return;
1048
+ let k;
1049
+ try {
1050
+ k = JSON.parse(C);
1051
+ } catch {
1052
+ return;
1053
+ }
1054
+ if (!To(k)) return;
1055
+ const w = Date.now() - k.savedAt;
1056
+ if (w < 0 || w > So) return;
1057
+ const V = po(k.form);
1058
+ return d && delete V.email, Object.keys(V).length ? V : void 0;
1059
+ }
1060
+ qe(async () => {
1061
+ const C = ie();
1062
+ C && r.updateInitialState(C);
1063
+ try {
1064
+ await L();
1065
+ } catch (k) {
1066
+ u.error(
1067
+ "SUBSCRIPTION_LOAD_FAILED",
1068
+ "Failed to load the subscription the checkout prices",
1069
+ {},
1070
+ k
1071
+ );
1072
+ return;
1073
+ }
1074
+ try {
1075
+ await te();
1076
+ } catch {
1077
+ }
1078
+ if (C) {
1079
+ const { seatsValues: k, unitsValues: w, ...V } = C, Q = _n(k, D.value.seatsValues), ue = _n(w, D.value.unitsValues);
1080
+ r.updateInitialState({
1081
+ ...V,
1082
+ ...Q ? { seatsValues: Q } : {},
1083
+ ...ue ? { unitsValues: ue } : {}
1084
+ });
1085
+ }
1086
+ });
1087
+ const me = async () => {
1088
+ if (!s.value) return "FAILED";
1089
+ r.flushPreviewChange(), P.isFailed.value && te().catch(() => {
1090
+ });
1091
+ let C;
1092
+ const k = new Promise((w) => {
1093
+ C = setTimeout(() => w(!1), wo);
1094
+ });
1095
+ try {
1096
+ if (!await Promise.race([
1097
+ P.whenLoaded().then(() => !0),
1098
+ k
1099
+ ])) return "FAILED";
1100
+ } catch {
1101
+ return "FAILED";
1102
+ } finally {
1103
+ clearTimeout(C);
1104
+ }
1105
+ return await Ve(), r.isPreviewStale.value || P.isPending.value ? "CHANGED" : "SETTLED";
1106
+ };
1107
+ return he(
1108
+ O,
1109
+ (C) => {
1110
+ C && Z();
1111
+ },
1112
+ { once: !0 }
1113
+ ), {
1114
+ /** What the host configured, once anything unusable has been dropped and reported. */
1115
+ validatedEmail: d,
1116
+ validatedCountry: y,
1117
+ invoicePreview: P.invoicePreview,
1118
+ invoicePreviewByBillingPeriod: P.invoicePreviewByBillingPeriod,
1119
+ trialInvoicePreview: P.trialInvoicePreview,
1120
+ trialPeriod: P.trialPeriod,
1121
+ loadInvoicePreview: te,
1122
+ updateInvoicePreviewOnBillingInformationChange: p,
1123
+ lastPreviewScheduleId: P.lastPreviewScheduleId,
1124
+ paymentMethodOptions: K,
1125
+ hasPaymentMethodOptionsError: ae,
1126
+ retryPaymentMethodOptions: Z,
1127
+ isPaymentMethodsPending: _,
1128
+ isInvoicePreviewPending: P.isPending,
1129
+ isInvoicePreviewStale: r.isPreviewStale,
1130
+ settleInvoicePreview: me,
1131
+ subscription: s,
1132
+ orderMeterValues: D,
1133
+ checkoutForm: r,
1134
+ authorizationContext: Y,
1135
+ isPaid: M,
1136
+ amount: l,
1137
+ recurringAmount: j,
1138
+ hasOneOffCharges: F,
1139
+ saveFormStateForRedirect: q,
1140
+ clearSavedFormState: X
1141
+ };
1142
+ }
1143
+ function Ro({
1144
+ checkoutForm: e,
1145
+ updateInvoicePreviewOnBillingInformationChange: i,
1146
+ formatErrorMessage: o,
1147
+ onInvalidPromotionCode: a,
1148
+ onApplyError: n
1149
+ }) {
1150
+ const u = ke(), y = H(!1), d = H(null), M = (P, O) => {
1151
+ d.value = o ? o({ action: P, error: O }) : P === "apply" ? "Promotion code could not be applied. Please try again." : "Promotion code could not be removed. Please try again.";
1152
+ };
1153
+ let s = 0;
1154
+ const D = async (P) => {
1155
+ const O = P == null ? void 0 : P.trim();
1156
+ if (!O)
1157
+ return;
1158
+ const K = ++s;
1159
+ d.value = null, e.form.value.promotionCode = O, y.value = !0;
1160
+ try {
1161
+ await i({
1162
+ promotionCode: O
1163
+ });
1164
+ } catch (N) {
1165
+ if (K !== s) return;
1166
+ const _ = Xn(N);
1167
+ _ ? u.warn(
1168
+ "PROMOTION_CODE_REJECTED",
1169
+ "The promotion code was not accepted",
1170
+ {},
1171
+ N
1172
+ ) : u.capture(N, {
1173
+ code: "PROMOTION_CODE_APPLY_FAILED",
1174
+ message: "Failed to apply promotion code"
1175
+ }), M("apply", N), n == null || n(), _ && (a == null || a()), y.value = !1, T({ suppressError: !0, preserveErrorMessage: !0 });
1176
+ return;
1177
+ }
1178
+ K === s && (y.value = !1);
1179
+ }, T = async ({
1180
+ suppressError: P = !1,
1181
+ preserveErrorMessage: O = !1
1182
+ } = {}) => {
1183
+ const K = ++s;
1184
+ O || (d.value = null), delete e.form.value.promotionCode, y.value = !0;
1185
+ try {
1186
+ await i({});
1187
+ } catch (N) {
1188
+ if (K !== s) return;
1189
+ u.capture(N, {
1190
+ code: "PROMOTION_CODE_REMOVE_FAILED",
1191
+ message: "Failed to remove promotion code"
1192
+ }), P || M("remove", N);
1193
+ }
1194
+ K === s && (y.value = !1);
1195
+ };
1196
+ return {
1197
+ applyPromotionCode: D,
1198
+ removePromotionCode: T,
1199
+ isPromotionCodePending: y,
1200
+ promotionCodeErrorMessage: d
1201
+ };
1202
+ }
1203
+ function xo({
1204
+ subscription: e,
1205
+ promotionCode: i,
1206
+ appliedPromotionCode: o,
1207
+ applyPromotionCode: a
1208
+ }) {
1209
+ he(
1210
+ e,
1211
+ (n) => {
1212
+ const u = In(i);
1213
+ n && u && (o.value = u, a(u));
1214
+ },
1215
+ { once: !0 }
1216
+ );
1217
+ }
1218
+ const zo = { class: "flex items-center gap-2" }, jo = /* @__PURE__ */ de({
1219
+ __name: "TaxIDCheckNotice",
1220
+ props: {
1221
+ status: { type: String }
1222
+ },
1223
+ setup(e) {
1224
+ const i = e, { formatMessage: o } = Pe(), a = c(() => {
1225
+ switch (i.status) {
1226
+ case "VALID":
1227
+ return "success";
1228
+ case "NOT_VALID":
1229
+ return "danger";
1230
+ default:
1231
+ return "neutral";
1232
+ }
1233
+ }), n = c(() => {
1234
+ switch (i.status) {
1235
+ case "VALID":
1236
+ return o({
1237
+ defaultMessage: "VAT number is valid.",
1238
+ id: "tax_check.valid_vat_number",
1239
+ description: "The message shown when the VAT number is valid"
1240
+ });
1241
+ case "NOT_VALID":
1242
+ return o({
1243
+ defaultMessage: "VAT number is invalid.",
1244
+ id: "tax_check.invalid_vat_number",
1245
+ description: "The message shown when the VAT number is invalid"
1246
+ });
1247
+ default:
1248
+ return o({
1249
+ defaultMessage: "The VAT number could not be checked right now.",
1250
+ id: "tax_check.unknown_vat_number",
1251
+ description: "The message shown when the VAT number check could not give an answer, for instance because the EU VAT service is unavailable"
1252
+ });
1253
+ }
1254
+ });
1255
+ return (u, y) => (m(), S(t(Gi), {
1256
+ type: a.value,
1257
+ icon: !1
1258
+ }, {
1259
+ default: b(() => [
1260
+ E("div", zo, [
1261
+ A(t(ce), { variant: "body-xs" }, {
1262
+ default: b(() => [
1263
+ G(z(n.value), 1)
1264
+ ]),
1265
+ _: 1
1266
+ })
1267
+ ])
1268
+ ]),
1269
+ _: 1
1270
+ }, 8, ["type"]));
1271
+ }
1272
+ }), Bo = { class: "flex grow flex-col" }, Uo = /* @__PURE__ */ de({
1273
+ __name: "CompanyPurchaseToggle",
1274
+ props: /* @__PURE__ */ ft({
1275
+ noSpacing: { type: Boolean }
1276
+ }, {
1277
+ modelValue: { type: Boolean, required: !0 },
1278
+ modelModifiers: {}
1279
+ }),
1280
+ emits: ["update:modelValue"],
1281
+ setup(e) {
1282
+ const i = An(e, "modelValue"), { $t: o } = Pe();
1283
+ return (a, n) => (m(), S(t(Nn), {
1284
+ modelValue: i.value,
1285
+ "onUpdate:modelValue": n[0] || (n[0] = (u) => i.value = u),
1286
+ "no-spacing": e.noSpacing,
1287
+ size: "sm",
1288
+ "label-position": "before"
1289
+ }, {
1290
+ "inline-label": b(() => [
1291
+ E("div", Bo, [
1292
+ A(t(ce), { tag: "span" }, {
1293
+ default: b(() => [
1294
+ G(z(t(o)({
1295
+ defaultMessage: "Company purchase",
1296
+ id: "checkout.company_purchase_toggle.title",
1297
+ description: "The title of the company purchase toggle in the checkout"
1298
+ })), 1)
1299
+ ]),
1300
+ _: 1
1301
+ }),
1302
+ A(t(ce), {
1303
+ tag: "span",
1304
+ variant: "body-xs",
1305
+ color: "subtle"
1306
+ }, {
1307
+ default: b(() => [
1308
+ G(z(t(o)({
1309
+ defaultMessage: "I am purchasing on behalf of a company",
1310
+ id: "checkout.company_purchase_toggle.sub_title",
1311
+ description: "The subtitle of the company purchase toggle in the checkout"
1312
+ })), 1)
1313
+ ]),
1314
+ _: 1
1315
+ })
1316
+ ])
1317
+ ]),
1318
+ _: 1
1319
+ }, 8, ["modelValue", "no-spacing"]));
1320
+ }
1321
+ });
1322
+ function Fo(e) {
1323
+ const { checkTaxID: i } = Yi(), {
1324
+ data: o,
1325
+ error: a,
1326
+ execute: n,
1327
+ settle: u,
1328
+ isPending: y
1329
+ } = yi({ service: i, isCollection: !0 }), d = c(() => {
1330
+ var _;
1331
+ return (_ = o.value) == null ? void 0 : _[0];
1332
+ }), M = c(
1333
+ () => {
1334
+ var _;
1335
+ return a.value ? "UNKNOWN" : (_ = d.value) == null ? void 0 : _.valid;
1336
+ }
1337
+ ), s = c(() => {
1338
+ var _;
1339
+ return ((_ = e.value.companyVatNumber) == null ? void 0 : _.trim()) ?? "";
1340
+ }), D = c(() => e.value.companyLegalName ?? ""), T = c(() => e.value.country);
1341
+ he([s, D, T], () => u([]));
1342
+ const P = c(() => En(T.value ?? "")), O = c(
1343
+ () => !!(s.value && D.value && T.value)
1344
+ ), K = c(() => P.value && s.value);
1345
+ async function N() {
1346
+ if (!(!O.value || !P.value || !T.value))
1347
+ try {
1348
+ await n({
1349
+ type: "ORGANIZATION",
1350
+ organization: {
1351
+ legal_name: D.value,
1352
+ tax_ids: [{ id: s.value, type: "GENERIC_TAX_ID" }],
1353
+ registered_address: {
1354
+ country: T.value
1355
+ }
1356
+ }
1357
+ });
1358
+ } catch {
1359
+ }
1360
+ }
1361
+ return {
1362
+ runTaxIDCheck: N,
1363
+ taxIdValidationData: d,
1364
+ taxIdCheckStatus: M,
1365
+ isTaxIDCheckPending: y,
1366
+ isTaxIDCheckEnabled: O,
1367
+ showViesCheckNotice: K,
1368
+ isSelectedCountryEU: P
1369
+ };
1370
+ }
1371
+ const Vo = { class: "grid grid-cols-1 gap-4" }, $o = {
1372
+ key: 0,
1373
+ class: "grid grid-cols-1 gap-2"
1374
+ }, Go = {
1375
+ key: 1,
1376
+ class: "flex flex-col gap-2"
1377
+ }, Yo = { key: 0 }, Ko = { class: "mt-2 flex flex-col gap-2" }, Ho = { class: "grid grid-cols-3 gap-2" }, Qo = {
1378
+ key: 3,
1379
+ class: "mt-2"
1380
+ }, Zo = { class: "flex flex-col gap-2" }, qo = { class: "mt-2" }, Xo = { key: 0 }, Wo = { class: "mt-2 flex flex-col gap-2" }, Jo = "checkout-form", ea = /* @__PURE__ */ de({
1381
+ __name: "CheckoutForm",
1382
+ props: /* @__PURE__ */ ft({
1383
+ validation: { type: null },
1384
+ initialState: { type: Object },
1385
+ readOnlyEmail: { type: String },
1386
+ showCustomerInfoOnTop: { type: Boolean },
1387
+ isBillingInformationMandatory: { type: Boolean },
1388
+ isShippingAddressRequired: { type: Boolean },
1389
+ getIsFieldRequired: { type: Function },
1390
+ shippingAddressFormat: { type: Object },
1391
+ readOnly: { type: Boolean }
1392
+ }, {
1393
+ modelValue: { required: !0 },
1394
+ modelModifiers: {}
1395
+ }),
1396
+ emits: /* @__PURE__ */ ft(["submit"], ["update:modelValue"]),
1397
+ setup(e) {
1398
+ const i = (L) => Ge(L), o = e, a = H(!1), n = An(e, "modelValue"), u = c({
1399
+ get: () => n.value.type === "ORGANIZATION",
1400
+ set: (L) => {
1401
+ n.value.type = L ? "ORGANIZATION" : "INDIVIDUAL";
1402
+ }
1403
+ }), y = c(() => n.value.type === "ORGANIZATION"), d = Kn({
1404
+ email: De(n, "email", _e),
1405
+ addressLine1: De(n, "addressLine1", _e),
1406
+ addressLine2: De(n, "addressLine2", _e),
1407
+ postalCode: De(n, "postalCode", _e),
1408
+ city: De(n, "city", _e),
1409
+ state: De(n, "state", _e),
1410
+ companyLegalName: De(n, "companyLegalName", _e),
1411
+ companyVatNumber: De(n, "companyVatNumber", _e)
1412
+ }), M = c({
1413
+ get: () => n.value.country,
1414
+ set: (L) => {
1415
+ const f = _e(L);
1416
+ n.value.country = f !== void 0 && i(f) ? f : void 0;
1417
+ }
1418
+ }), s = c({
1419
+ get: () => n.value.shippingCountry,
1420
+ set: (L) => {
1421
+ const f = _e(L);
1422
+ n.value.shippingCountry = f !== void 0 && i(f) ? f : void 0;
1423
+ }
1424
+ }), D = c(() => Mt(n.value)), { isTaxIDCheckEnabled: T, isTaxIDCheckPending: P, taxIdCheckStatus: O, runTaxIDCheck: K } = Fo(n), { $t: N } = Pe(), _ = si(), I = (L) => o.getIsFieldRequired(L) ? "" : " " + N({
1425
+ defaultMessage: "(optional)",
1426
+ id: "checkout.optional_suffix.label",
1427
+ description: "The suffix for optional fields in the checkout form"
1428
+ }), $ = c(
1429
+ () => n.value.country ? dn(n.value.country) : void 0
1430
+ ), ae = c(() => {
1431
+ var Y, l;
1432
+ const { recipient: L, address: f } = Pn(
1433
+ n.value,
1434
+ "",
1435
+ o.shippingAddressFormat
1436
+ ), g = (Y = L.individual) == null ? void 0 : Y.name;
1437
+ return [
1438
+ ((l = L.organization) == null ? void 0 : l.attention_name) ?? [g == null ? void 0 : g.first_name, g == null ? void 0 : g.last_name].filter(Boolean).join(" "),
1439
+ f.line1,
1440
+ f.line2,
1441
+ [f.postal_code, f.city].filter(Boolean).join(" "),
1442
+ f.state,
1443
+ f.country && dn(f.country)
1444
+ ].filter((h) => !!h);
1445
+ }), Z = c({
1446
+ get: () => n.value.billingAddressSameAsShipping,
1447
+ set: (L) => {
1448
+ n.value.billingAddressSameAsShipping = L;
1449
+ }
1450
+ }), ne = c(
1451
+ () => o.isShippingAddressRequired ? N({
1452
+ defaultMessage: "Shipping information",
1453
+ id: "checkout.shipping_information_block.title",
1454
+ description: "The title of the shipping information block in the checkout form"
1455
+ }) : _.contactInformationTitle
1456
+ ), te = c(
1457
+ () => N({
1458
+ defaultMessage: "Shipping address",
1459
+ id: "checkout.shipping_address.title",
1460
+ description: "Label above the address an order is shipped to in the checkout form"
1461
+ })
1462
+ ), p = c(
1463
+ () => N({
1464
+ defaultMessage: "Shipping country",
1465
+ id: "checkout.shipping_country.label",
1466
+ description: "Label of the country an order is shipped to in the checkout form"
1467
+ })
1468
+ ), r = c(
1469
+ () => N({
1470
+ defaultMessage: "Shipping country",
1471
+ id: "checkout.shipping_country.placeholder",
1472
+ description: "Placeholder of the shipping country select while no country is chosen"
1473
+ })
1474
+ );
1475
+ return (L, f) => (m(), R("form", {
1476
+ id: Jo,
1477
+ onSubmit: f[16] || (f[16] = st((g) => L.$emit("submit", n.value), ["prevent"]))
1478
+ }, [
1479
+ E("div", Vo, [
1480
+ A(t(Ae), { title: ne.value }, {
1481
+ default: b(() => [
1482
+ e.readOnly ? (m(), R("div", $o, [
1483
+ A(t(ce), {
1484
+ variant: "body",
1485
+ tag: "span",
1486
+ weight: "semibold",
1487
+ "no-spacing": ""
1488
+ }, {
1489
+ default: b(() => [
1490
+ G(z(n.value.email), 1)
1491
+ ]),
1492
+ _: 1
1493
+ }),
1494
+ e.isShippingAddressRequired ? (m(!0), R(ye, { key: 0 }, lt(ae.value, (g, Y) => (m(), S(t(ce), {
1495
+ key: Y,
1496
+ variant: "body-sm",
1497
+ tag: "span",
1498
+ color: "subtle",
1499
+ "no-spacing": "",
1500
+ class: "sv-checkout__shipping-address-summary"
1501
+ }, {
1502
+ default: b(() => [
1503
+ G(z(g), 1)
1504
+ ]),
1505
+ _: 2
1506
+ }, 1024))), 128)) : (m(), S(t(ce), {
1507
+ key: 1,
1508
+ variant: "body-sm",
1509
+ tag: "span",
1510
+ color: "subtle",
1511
+ "no-spacing": ""
1512
+ }, {
1513
+ default: b(() => [
1514
+ G(z($.value), 1)
1515
+ ]),
1516
+ _: 1
1517
+ }))
1518
+ ])) : (m(), R("div", Go, [
1519
+ A(t(Qe), {
1520
+ modelValue: d.email,
1521
+ "onUpdate:modelValue": f[0] || (f[0] = (g) => d.email = g),
1522
+ required: "",
1523
+ type: "email",
1524
+ name: "email",
1525
+ autocomplete: "email",
1526
+ disabled: !!e.readOnlyEmail,
1527
+ label: t(_).emailLabel,
1528
+ placeholder: t(_).emailPlaceholder + I("email"),
1529
+ error: e.validation.value.email.$errors
1530
+ }, null, 8, ["modelValue", "disabled", "label", "placeholder", "error"]),
1531
+ e.isShippingAddressRequired ? x("", !0) : (m(), S(t(on), {
1532
+ key: 0,
1533
+ "single-model-value": M.value,
1534
+ "onUpdate:singleModelValue": f[3] || (f[3] = (g) => M.value = g),
1535
+ i18n: { placeholderDefault: t(_).countryPlaceholder },
1536
+ required: "",
1537
+ name: "country",
1538
+ label: t(_).countryLabel + I("country"),
1539
+ error: e.validation.value.country.$errors
1540
+ }, {
1541
+ "label-suffix": b(() => [
1542
+ !a.value && !e.isBillingInformationMandatory ? (m(), S(t(Oe), {
1543
+ key: 0,
1544
+ size: "xs",
1545
+ intent: "subtle",
1546
+ "icon-prefix": "add",
1547
+ class: "py-0.5",
1548
+ onClick: f[1] || (f[1] = (g) => a.value = !0)
1549
+ }, {
1550
+ default: b(() => [
1551
+ G(z(t(N)({
1552
+ defaultMessage: "More billing details",
1553
+ description: "Label of the button in the checkout that lets you fill out all billing details",
1554
+ id: "checkout.billing_details.add_billing_details_button.label"
1555
+ })), 1)
1556
+ ]),
1557
+ _: 1
1558
+ })) : x("", !0),
1559
+ a.value && !e.isBillingInformationMandatory ? (m(), S(t(Oe), {
1560
+ key: 1,
1561
+ size: "sm",
1562
+ intent: "subtle",
1563
+ "icon-prefix": "close",
1564
+ class: "py-0.5",
1565
+ onClick: f[2] || (f[2] = (g) => a.value = !1)
1566
+ }, {
1567
+ default: b(() => [
1568
+ G(z(t(N)({
1569
+ defaultMessage: "Remove billing details",
1570
+ id: "checkout.billing_details.remove_billing_details_button.label",
1571
+ description: "Label of the button in the checkout that lets you remove the billing details"
1572
+ })), 1)
1573
+ ]),
1574
+ _: 1
1575
+ })) : x("", !0)
1576
+ ]),
1577
+ _: 1
1578
+ }, 8, ["single-model-value", "i18n", "label", "error"]))
1579
+ ])),
1580
+ e.isShippingAddressRequired ? x("", !0) : (m(), S(t(pn), {
1581
+ key: 2,
1582
+ "is-open": a.value || !!e.isBillingInformationMandatory
1583
+ }, {
1584
+ default: b(() => [
1585
+ a.value || e.isBillingInformationMandatory ? (m(), R("div", Yo, [
1586
+ E("div", Ko, [
1587
+ A(t(Qe), {
1588
+ modelValue: d.addressLine1,
1589
+ "onUpdate:modelValue": f[4] || (f[4] = (g) => d.addressLine1 = g),
1590
+ name: "address_line_1",
1591
+ autocomplete: "billing address-line1",
1592
+ label: t(N)({
1593
+ defaultMessage: "Billing address",
1594
+ id: "checkout.address.title",
1595
+ description: "Label of the billing address, above its first line, in the checkout and billing information forms"
1596
+ }),
1597
+ placeholder: t(N)({
1598
+ defaultMessage: "Address line 1",
1599
+ id: "checkout.address.line1.placeholder",
1600
+ description: "Address line 1 of the customer address in the checkout form"
1601
+ }) + I("addressLine1"),
1602
+ required: "",
1603
+ error: e.validation.value.addressLine1.$errors
1604
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
1605
+ A(it, {
1606
+ modelValue: d.addressLine2,
1607
+ "onUpdate:modelValue": f[5] || (f[5] = (g) => d.addressLine2 = g),
1608
+ name: "address_line_2",
1609
+ autocomplete: "billing address-line2",
1610
+ label: t(_).addressLine2Label,
1611
+ placeholder: t(N)({
1612
+ defaultMessage: "Address line 2",
1613
+ id: "checkout.address.line2.placeholder",
1614
+ description: "Address line 2 of the customer address in the checkout form"
1615
+ }) + I("addressLine2")
1616
+ }, null, 8, ["modelValue", "label", "placeholder"]),
1617
+ E("div", Ho, [
1618
+ A(it, {
1619
+ modelValue: d.postalCode,
1620
+ "onUpdate:modelValue": f[6] || (f[6] = (g) => d.postalCode = g),
1621
+ name: "postal_code",
1622
+ autocomplete: "billing postal-code",
1623
+ label: t(_).postalCodeLabel,
1624
+ placeholder: t(_).postalCodePlaceholder + I("postalCode"),
1625
+ error: e.validation.value.postalCode.$errors
1626
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
1627
+ A(it, {
1628
+ modelValue: d.city,
1629
+ "onUpdate:modelValue": f[7] || (f[7] = (g) => d.city = g),
1630
+ name: "city",
1631
+ autocomplete: "billing address-level2",
1632
+ label: t(_).cityLabel,
1633
+ placeholder: t(_).cityPlaceholder + I("city")
1634
+ }, null, 8, ["modelValue", "label", "placeholder"]),
1635
+ A(it, {
1636
+ modelValue: d.state,
1637
+ "onUpdate:modelValue": f[8] || (f[8] = (g) => d.state = g),
1638
+ name: "state",
1639
+ autocomplete: "billing address-level1",
1640
+ label: t(_).stateLabel,
1641
+ placeholder: t(_).statePlaceholder + I("state"),
1642
+ error: e.validation.value.state.$errors
1643
+ }, null, 8, ["modelValue", "label", "placeholder", "error"])
1644
+ ])
1645
+ ])
1646
+ ])) : x("", !0)
1647
+ ]),
1648
+ _: 1
1649
+ }, 8, ["is-open"])),
1650
+ e.isShippingAddressRequired && !e.readOnly ? (m(), R("fieldset", Qo, [
1651
+ E("legend", null, [
1652
+ A(t(mn), {
1653
+ tag: "span",
1654
+ required: ""
1655
+ }, {
1656
+ default: b(() => [
1657
+ G(z(te.value), 1)
1658
+ ]),
1659
+ _: 1
1660
+ })
1661
+ ]),
1662
+ E("div", Zo, [
1663
+ A(t(on), {
1664
+ "single-model-value": s.value,
1665
+ "onUpdate:singleModelValue": f[9] || (f[9] = (g) => s.value = g),
1666
+ i18n: { placeholderDefault: r.value },
1667
+ required: "",
1668
+ "label-screen-reader-only": "",
1669
+ name: "shipping_country",
1670
+ label: p.value,
1671
+ error: e.validation.value.shippingCountry.$errors
1672
+ }, null, 8, ["single-model-value", "i18n", "label", "error"]),
1673
+ A(ln, {
1674
+ modelValue: n.value,
1675
+ "onUpdate:modelValue": f[10] || (f[10] = (g) => n.value = g),
1676
+ variant: "SHIPPING",
1677
+ class: "sv-checkout__shipping-address",
1678
+ "get-optional-suffix": I,
1679
+ format: e.shippingAddressFormat,
1680
+ errors: {
1681
+ addressLine1: e.validation.value.shippingAddressLine1.$errors,
1682
+ postalCode: e.validation.value.shippingPostalCode.$errors,
1683
+ city: e.validation.value.shippingCity.$errors,
1684
+ state: e.validation.value.shippingState.$errors,
1685
+ phoneNumber: e.validation.value.shippingPhoneNumber.$errors,
1686
+ lastName: e.validation.value.shippingLastName.$errors
1687
+ }
1688
+ }, null, 8, ["modelValue", "format", "errors"])
1689
+ ]),
1690
+ E("div", qo, [
1691
+ A(t(ki), {
1692
+ modelValue: Z.value,
1693
+ "onUpdate:modelValue": f[11] || (f[11] = (g) => Z.value = g),
1694
+ name: "billing_address_same_as_shipping",
1695
+ class: "sv-checkout__billing-same-as-shipping",
1696
+ label: t(N)({
1697
+ defaultMessage: "Billing address is the same as shipping address",
1698
+ id: "checkout.billing_address_same_as_shipping.label",
1699
+ description: "Label of the checkbox that bills the order to the address it ships to"
1700
+ })
1701
+ }, null, 8, ["modelValue", "label"])
1702
+ ])
1703
+ ])) : x("", !0)
1704
+ ]),
1705
+ _: 1
1706
+ }, 8, ["title"]),
1707
+ e.isShippingAddressRequired && !e.readOnly ? (m(), R(ye, { key: 0 }, [
1708
+ Z.value ? x("", !0) : (m(), S(t(Ae), {
1709
+ key: 0,
1710
+ class: "sv-checkout__billing-section"
1711
+ }, {
1712
+ default: b(() => [
1713
+ E("fieldset", null, [
1714
+ E("legend", null, [
1715
+ A(t(mn), {
1716
+ tag: "span",
1717
+ required: ""
1718
+ }, {
1719
+ default: b(() => [
1720
+ G(z(t(_).addressTitle), 1)
1721
+ ]),
1722
+ _: 1
1723
+ })
1724
+ ]),
1725
+ A(ln, {
1726
+ modelValue: n.value,
1727
+ "onUpdate:modelValue": f[12] || (f[12] = (g) => n.value = g),
1728
+ variant: "BILLING",
1729
+ class: "sv-checkout__billing-address",
1730
+ "with-country": "",
1731
+ "country-label": t(_).countryLabel,
1732
+ "get-optional-suffix": I,
1733
+ errors: {
1734
+ addressLine1: e.validation.value.addressLine1.$errors,
1735
+ postalCode: e.validation.value.postalCode.$errors,
1736
+ city: e.validation.value.city.$errors,
1737
+ state: e.validation.value.state.$errors,
1738
+ country: e.validation.value.country.$errors
1739
+ }
1740
+ }, null, 8, ["modelValue", "country-label", "errors"])
1741
+ ])
1742
+ ]),
1743
+ _: 1
1744
+ }))
1745
+ ], 64)) : x("", !0),
1746
+ e.readOnly ? x("", !0) : (m(), S(t(Ae), { key: 1 }, {
1747
+ default: b(() => [
1748
+ A(Uo, {
1749
+ modelValue: u.value,
1750
+ "onUpdate:modelValue": f[13] || (f[13] = (g) => u.value = g),
1751
+ "no-spacing": "",
1752
+ class: "!flex"
1753
+ }, null, 8, ["modelValue"]),
1754
+ A(t(pn), { "is-open": y.value }, {
1755
+ default: b(() => [
1756
+ y.value ? (m(), R("div", Xo, [
1757
+ E("div", Wo, [
1758
+ A(t(Qe), {
1759
+ modelValue: d.companyLegalName,
1760
+ "onUpdate:modelValue": f[14] || (f[14] = (g) => d.companyLegalName = g),
1761
+ required: "",
1762
+ name: "legal_name",
1763
+ autocomplete: "billing organization",
1764
+ label: t(_).legalNameLabel,
1765
+ placeholder: t(_).legalNamePlaceholder,
1766
+ error: e.validation.value.companyLegalName.$errors
1767
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
1768
+ D.value ? (m(), S(t(Qe), {
1769
+ key: 0,
1770
+ modelValue: d.companyVatNumber,
1771
+ "onUpdate:modelValue": f[15] || (f[15] = (g) => d.companyVatNumber = g),
1772
+ name: "vat_number",
1773
+ autocomplete: "off",
1774
+ "input-class": "focus:outline-none focus:ring-0",
1775
+ label: t(_).vatNumberLabel,
1776
+ placeholder: t(_).vatNumberPlaceholder,
1777
+ error: e.validation.value.companyVatNumber.$errors,
1778
+ "suffix-class": "px-2 border-l-0"
1779
+ }, _t({ _: 2 }, [
1780
+ t(En)(n.value.country ?? "") ? {
1781
+ name: "suffix",
1782
+ fn: b(() => [
1783
+ A(t(Oe), {
1784
+ type: "button",
1785
+ size: "sm",
1786
+ intent: "secondary",
1787
+ disabled: !t(T) || t(P) || e.validation.value.companyVatNumber.$invalid,
1788
+ onClick: t(K)
1789
+ }, {
1790
+ default: b(() => [
1791
+ G(z(t(N)({
1792
+ defaultMessage: "Check",
1793
+ id: "checkout.vat_number.check_button.label",
1794
+ description: "The label for the check button in the checkout form"
1795
+ })), 1)
1796
+ ]),
1797
+ _: 1
1798
+ }, 8, ["disabled", "onClick"])
1799
+ ]),
1800
+ key: "0"
1801
+ } : void 0
1802
+ ]), 1032, ["modelValue", "label", "placeholder", "error"])) : x("", !0),
1803
+ t(O) ? (m(), R("div", {
1804
+ key: 1,
1805
+ class: Le({ "opacity-75": t(P) })
1806
+ }, [
1807
+ A(jo, { status: t(O) }, null, 8, ["status"])
1808
+ ], 2)) : x("", !0)
1809
+ ])
1810
+ ])) : x("", !0)
1811
+ ]),
1812
+ _: 1
1813
+ }, 8, ["is-open"])
1814
+ ]),
1815
+ _: 1
1816
+ }))
1817
+ ])
1818
+ ], 32));
1819
+ }
1820
+ }), ta = (e) => typeof e == "object" && e !== null && typeof Reflect.get(e, "strong") == "string", Fe = (e) => ({
1821
+ strong: e.filter((i) => typeof i == "string").join("")
1822
+ });
1823
+ function na(e) {
1824
+ return (Array.isArray(e) ? e : [e]).flatMap((o) => typeof o == "string" ? o ? [{ text: o, strong: !1 }] : [] : ta(o) ? [{ text: o.strong, strong: !0 }] : []);
1825
+ }
1826
+ const ia = {
1827
+ key: 0,
1828
+ class: "flex items-center"
1829
+ }, oa = { key: 1 }, aa = { key: 0 }, sa = /* @__PURE__ */ de({
1830
+ __name: "CheckoutTitle",
1831
+ props: {
1832
+ trialPeriod: { type: Object },
1833
+ subscriptionName: { type: String },
1834
+ amount: { type: Object },
1835
+ dueTodayAmount: { type: Object },
1836
+ recurringAmount: { type: Object },
1837
+ hasOneOffCharges: { type: Boolean },
1838
+ hasRecurringCharge: { type: Boolean },
1839
+ hasUsageCharges: { type: Boolean },
1840
+ billingPeriod: { type: Object },
1841
+ countryCode: { type: null },
1842
+ trialStartDate: { type: Date },
1843
+ subscriptionStartDate: { type: Date }
1844
+ },
1845
+ setup(e) {
1846
+ const i = e, { $t: o } = Pe(), { formatTimePeriod: a } = bt(), n = c(
1847
+ () => a(i.billingPeriod, { short: !0, hideValueForExactPeriods: !0 })
1848
+ ), u = c(() => {
1849
+ const M = be(i.dueTodayAmount), s = () => o(
1850
+ {
1851
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today.",
1852
+ id: "checkout.one_off_description",
1853
+ description: "The description of an order that is charged once and does not renew"
1854
+ },
1855
+ // @ts-expect-error formatjs does not support this type yet
1856
+ { due_today: M, strong: Fe }
1857
+ );
1858
+ if (i.recurringAmount) {
1859
+ if (Number(i.recurringAmount.quantity) === 0) {
1860
+ if (i.hasUsageCharges)
1861
+ return o(
1862
+ {
1863
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today. Usage is billed every {period_name}.",
1864
+ id: "checkout.usage_with_one_off_description",
1865
+ description: "The description of a usage-based subscription whose first invoice also charges something only once"
1866
+ },
1867
+ // @ts-expect-error formatjs does not support this type yet
1868
+ { due_today: M, period_name: n.value, strong: Fe }
1869
+ );
1870
+ if (!i.hasRecurringCharge)
1871
+ return s();
1872
+ }
1873
+ const T = be(i.recurringAmount);
1874
+ return i.trialStartDate ? o(
1875
+ {
1876
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today, then <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",
1877
+ id: "checkout.trial_period_description_with_one_off",
1878
+ description: "The description of a trial whose first invoice also charges something only once"
1879
+ },
1880
+ {
1881
+ due_today: M,
1882
+ price: T,
1883
+ period_name: n.value,
1884
+ // @ts-expect-error formatjs does not support this type yet
1885
+ startDate: i.subscriptionStartDate,
1886
+ // @ts-expect-error formatjs does not support this type yet
1887
+ strong: Fe
1888
+ }
1889
+ ) : o(
1890
+ {
1891
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today, then <strong>{price}</strong> per {period_name}.",
1892
+ id: "checkout.subscription_description_with_one_off",
1893
+ description: "The description of a subscription whose first invoice also charges something only once"
1894
+ },
1895
+ // @ts-expect-error formatjs does not support this type yet
1896
+ { due_today: M, price: T, period_name: n.value, strong: Fe }
1897
+ );
1898
+ }
1899
+ if (i.hasOneOffCharges)
1900
+ return s();
1901
+ const D = be(i.amount);
1902
+ return i.trialStartDate ? o(
1903
+ {
1904
+ defaultMessage: "You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",
1905
+ id: "checkout.trial_period_description",
1906
+ description: "The description of the trial period"
1907
+ },
1908
+ {
1909
+ price: D,
1910
+ // @ts-expect-error formatjs does not support this type yet
1911
+ startDate: i.subscriptionStartDate,
1912
+ period_name: n.value,
1913
+ // @ts-expect-error formatjs does not support this type yet
1914
+ strong: Fe
1915
+ }
1916
+ ) : o(
1917
+ {
1918
+ defaultMessage: "You will be billed <strong>{price}</strong> per {period_name}, starting today.",
1919
+ id: "checkout.subscription_description",
1920
+ description: "The description of the subscription"
1921
+ },
1922
+ // @ts-expect-error formatjs does not support this type yet
1923
+ { price: D, period_name: n.value, strong: Fe }
1924
+ );
1925
+ }), y = c(() => na(u.value)), d = c(
1926
+ () => i.trialStartDate ? o(
1927
+ {
1928
+ defaultMessage: "per {period_name} starting, {startDate, date, long}",
1929
+ id: "checkout.trial_period_description_without_price",
1930
+ description: "The description of the trial period, while the price is still being determined"
1931
+ },
1932
+ {
1933
+ // @ts-expect-error formatjs does not support this type yet
1934
+ startDate: i.subscriptionStartDate,
1935
+ period_name: n.value
1936
+ }
1937
+ ) : o(
1938
+ {
1939
+ defaultMessage: "per {period_name}, starting today",
1940
+ id: "checkout.subscription_description_without_price",
1941
+ description: "The description of the subscription, while the price is still being determined"
1942
+ },
1943
+ { period_name: n.value }
1944
+ )
1945
+ );
1946
+ return (M, s) => (m(), R("div", null, [
1947
+ E("div", null, [
1948
+ A(t(ce), {
1949
+ variant: "heading-1",
1950
+ class: "inline-block"
1951
+ }, {
1952
+ default: b(() => [
1953
+ G(z(e.trialStartDate ? e.subscriptionName : t(o)({
1954
+ defaultMessage: "Pay and subscribe",
1955
+ id: "checkout.page_title",
1956
+ description: "The title of the checkout page"
1957
+ })) + z(" "), 1),
1958
+ e.trialPeriod ? (m(), S(t(mi), {
1959
+ key: 0,
1960
+ "trial-period": e.trialPeriod,
1961
+ size: "lg",
1962
+ class: "-translate-y-0.5"
1963
+ }, null, 8, ["trial-period"])) : x("", !0)
1964
+ ]),
1965
+ _: 1
1966
+ })
1967
+ ]),
1968
+ A(t(ce), {
1969
+ variant: "body-sm",
1970
+ color: "subtle",
1971
+ "no-spacing": ""
1972
+ }, {
1973
+ default: b(() => [
1974
+ e.countryCode ? (m(), R("span", oa, [
1975
+ (m(!0), R(ye, null, lt(y.value, (D, T) => (m(), R(ye, { key: T }, [
1976
+ D.strong ? (m(), R("strong", aa, z(D.text), 1)) : (m(), R(ye, { key: 1 }, [
1977
+ G(z(D.text), 1)
1978
+ ], 64))
1979
+ ], 64))), 128))
1980
+ ])) : (m(), R("span", ia, [
1981
+ A(t(Hi), { "is-dark-mode": "" }, {
1982
+ tooltip: b(() => [
1983
+ A(t(Qi), null, {
1984
+ default: b(() => [
1985
+ A(t(Zi), null, {
1986
+ default: b(() => [
1987
+ G(z(t(o)({
1988
+ defaultMessage: "Will be determined by billing information",
1989
+ description: "Tooltip content for the invoice preview when taxes are not determined by billing information",
1990
+ id: "invoice_preview.taxes_not_determined_by_billing_information_tooltip"
1991
+ })), 1)
1992
+ ]),
1993
+ _: 1
1994
+ })
1995
+ ]),
1996
+ _: 1
1997
+ })
1998
+ ]),
1999
+ default: b(() => [
2000
+ A(t(Ki), {
2001
+ "width-class": "w-10",
2002
+ "height-class": "h-4",
2003
+ shade: "darker",
2004
+ class: "mr-1.5 inline-block"
2005
+ })
2006
+ ]),
2007
+ _: 1
2008
+ }),
2009
+ E("span", null, z(d.value), 1)
2010
+ ]))
2011
+ ]),
2012
+ _: 1
2013
+ })
2014
+ ]));
2015
+ }
2016
+ }), la = /* @__PURE__ */ de({
2017
+ __name: "SubscriptionPaymentCompletedCard",
2018
+ setup(e) {
2019
+ const { $t: i } = Pe();
2020
+ return (o, a) => (m(), S(qi, {
2021
+ status: "success",
2022
+ title: t(i)({
2023
+ defaultMessage: "Payment successful",
2024
+ id: "subscription_payment_completed_card.title",
2025
+ description: "The title for when a payment has been successful"
2026
+ })
2027
+ }, {
2028
+ default: b(() => [
2029
+ A(t(ce), {
2030
+ variant: "body-xs",
2031
+ color: "subtle",
2032
+ tag: "span"
2033
+ }, {
2034
+ default: b(() => [
2035
+ G(z(t(i)({
2036
+ defaultMessage: "Thank you for subscribing.",
2037
+ id: "subscription_payment_completed_card.thank_you_for_subscribing",
2038
+ description: "The text shown after a successful message before a redirect"
2039
+ })), 1)
2040
+ ]),
2041
+ _: 1
2042
+ })
2043
+ ]),
2044
+ _: 1
2045
+ }, 8, ["title"]));
2046
+ }
2047
+ }), ra = { class: "flex items-start" }, ua = { class: "flex grow flex-col" }, ca = { class: "flex items-center gap-1" }, da = { class: "ml-4 flex items-center self-center" }, pa = /* @__PURE__ */ de({
2048
+ __name: "PricingGroupContent",
2049
+ props: {
2050
+ name: { type: String },
2051
+ description: { type: String }
2052
+ },
2053
+ setup(e) {
2054
+ return (i, o) => (m(), R("div", ra, [
2055
+ E("div", ua, [
2056
+ E("div", ca, [
2057
+ A(t(ce), {
2058
+ tag: "span",
2059
+ variant: "body-sm",
2060
+ weight: "semibold"
2061
+ }, {
2062
+ default: b(() => [
2063
+ G(z(e.name), 1)
2064
+ ]),
2065
+ _: 1
2066
+ }),
2067
+ ht(i.$slots, "badge")
2068
+ ]),
2069
+ A(t(ce), {
2070
+ tag: "span",
2071
+ variant: "body-xs",
2072
+ color: "subtle"
2073
+ }, {
2074
+ default: b(() => [
2075
+ G(z(e.description), 1)
2076
+ ]),
2077
+ _: 1
2078
+ })
2079
+ ]),
2080
+ E("div", da, [
2081
+ ht(i.$slots, "default")
2082
+ ])
2083
+ ]));
2084
+ }
2085
+ }), ma = { class: "sv-order-summary__body grid grid-cols-1 gap-1" }, ga = { class: "px-3 py-2" }, ya = { class: "sv-order-summary__billing-period flex flex-col gap-3" }, va = { class: "px-3 py-2" }, fa = {
2086
+ key: 0,
2087
+ class: "sv-order-summary__renewal flex flex-row gap-2 pt-1.5"
2088
+ }, bn = /* @__PURE__ */ de({
2089
+ __name: "OrderSummary",
2090
+ props: {
2091
+ subscription: { type: Object },
2092
+ invoice: { type: Object },
2093
+ invoicePreviewByBillingPeriod: { type: Object },
2094
+ trialInvoice: { type: Object },
2095
+ enabledPricingIds: { type: Array },
2096
+ avatar: { type: String },
2097
+ isPaid: { type: Boolean },
2098
+ isUsageBased: { type: Boolean },
2099
+ collapsible: { type: String },
2100
+ noTitle: { type: Boolean },
2101
+ countryCode: { type: null },
2102
+ variant: { type: String }
2103
+ },
2104
+ emits: ["billing-period-change"],
2105
+ setup(e, { emit: i }) {
2106
+ const o = e, a = i, { $t: n } = Pe(), { map: u, formatTimePeriod: y } = bt(), { isMobileViewport: d } = Dn(), M = c(() => d.value ? "sm" : "xs"), s = (l) => `${l.type}:${l.value}`, D = ["DAY", "WEEK", "MONTH", "YEAR"], T = (l) => D.includes(l), P = (l) => {
2107
+ if (!l)
2108
+ return;
2109
+ const [h, F] = l.split(":"), j = Number(F);
2110
+ if (!(!j || !T(h)))
2111
+ return { type: h, value: j };
2112
+ }, O = c({
2113
+ get: () => {
2114
+ const l = o.subscription.billing_period;
2115
+ return l ? s(l) : void 0;
2116
+ },
2117
+ set: (l) => {
2118
+ const h = P(l);
2119
+ h && a("billing-period-change", h);
2120
+ }
2121
+ }), K = c({
2122
+ get: () => O.value,
2123
+ set: (l) => {
2124
+ O.value = _e(l);
2125
+ }
2126
+ }), N = (l) => {
2127
+ var h;
2128
+ return rn((h = o.invoicePreviewByBillingPeriod) == null ? void 0 : h[l]);
2129
+ }, _ = (l) => {
2130
+ const h = N(s(l));
2131
+ if (!h)
2132
+ return;
2133
+ const F = l.type === "MONTH" && l.value === 3 ? n({
2134
+ defaultMessage: "/quarter",
2135
+ id: "checkout.order_summary_block.billing_period.per_quarter",
2136
+ description: "Period label for quarterly billing"
2137
+ }) : n(
2138
+ {
2139
+ defaultMessage: "/{period}",
2140
+ id: "checkout.order_summary_block.billing_period.per_label",
2141
+ description: "Period label for billing cycles"
2142
+ },
2143
+ {
2144
+ period: y(l, {
2145
+ prefix: !1,
2146
+ hideValueForExactPeriods: !0
2147
+ })
2148
+ }
2149
+ );
2150
+ return n(
2151
+ {
2152
+ defaultMessage: "{amount}{period}",
2153
+ id: "checkout.order_summary_block.billing_period.sub_label",
2154
+ description: "Billing period option sublabel showing price per period"
2155
+ },
2156
+ {
2157
+ amount: be(h),
2158
+ period: F
2159
+ }
2160
+ );
2161
+ }, I = (l) => {
2162
+ if (!l)
2163
+ return;
2164
+ const h = n(
2165
+ {
2166
+ defaultMessage: "Save {amount}",
2167
+ id: "checkout.order_summary_block.billing_period.save_badge.prefix",
2168
+ description: "First line for the savings badge label"
2169
+ },
2170
+ { amount: be(l) }
2171
+ ), F = n({
2172
+ defaultMessage: "/year",
2173
+ id: "checkout.order_summary_block.billing_period.save_badge.suffix",
2174
+ description: "Second line for the savings badge label"
2175
+ });
2176
+ return `${h}${F}`;
2177
+ }, $ = c(
2178
+ () => o.invoice ? Si(o.invoice) : { recurring: [], oneOff: [], other: [] }
2179
+ ), ae = c(
2180
+ () => $.value.recurring.length > 0 && $.value.oneOff.length > 0
2181
+ ), Z = c(
2182
+ () => ae.value ? rn(o.invoice) : void 0
2183
+ ), ne = c(
2184
+ () => Z.value && Number(Z.value.quantity) !== 0 ? Z.value : void 0
2185
+ ), te = c(() => {
2186
+ var me, C, k;
2187
+ const l = $e({
2188
+ pricingPlanScheduleInfos: o.subscription.pricing_plan_schedule_infos ?? [],
2189
+ type: "DEFAULT"
2190
+ }), h = ((C = (me = l == null ? void 0 : l.pricing_plan_version) == null ? void 0 : me.billing_period_settings) == null ? void 0 : C.billing_periods) ?? [], F = /* @__PURE__ */ new Map(), j = (w) => {
2191
+ w && F.set(s(w), w);
2192
+ }, re = (w) => {
2193
+ var V;
2194
+ (V = w == null ? void 0 : w.items) == null || V.forEach((Q) => {
2195
+ var ue, W;
2196
+ (ue = Q.billing_period_configs) == null || ue.forEach(
2197
+ (oe) => j(oe.billing_period)
2198
+ ), (W = Q.pricing_currency_configs) == null || W.forEach((oe) => {
2199
+ var se;
2200
+ (se = oe.billing_period_configs) == null || se.forEach(
2201
+ (ge) => j(ge.billing_period)
2202
+ );
2203
+ });
2204
+ });
2205
+ };
2206
+ if ((((k = l == null ? void 0 : l.pricing_plan_version) == null ? void 0 : k.pricing_categories) ?? []).forEach((w) => {
2207
+ var V, Q;
2208
+ (V = w.pricings) == null || V.forEach((ue) => re(ue)), (Q = w.pricing_groups) == null || Q.forEach(
2209
+ (ue) => {
2210
+ var W;
2211
+ return (W = ue.pricings) == null ? void 0 : W.forEach((oe) => re(oe));
2212
+ }
2213
+ );
2214
+ }), !F.size)
2215
+ return [];
2216
+ const q = h.map((w) => F.get(s(w.period))).filter((w) => !!w), X = new Set(q.map(s)), ie = [...F.values()].filter(
2217
+ (w) => !X.has(s(w))
2218
+ );
2219
+ return [...q, ...ie];
2220
+ }), p = c(() => {
2221
+ const l = te.value[te.value.length - 1], h = l ? ot(
2222
+ l,
2223
+ N(s(l))
2224
+ ) : void 0;
2225
+ return te.value.map((j) => {
2226
+ const re = j.type === "MONTH" && j.value === 3 ? n({
2227
+ defaultMessage: "Billed quarterly",
2228
+ id: "checkout.order_summary_block.billing_period.quarterly",
2229
+ description: "Billing period option label for quarterly billing"
2230
+ }) : n(
2231
+ {
2232
+ defaultMessage: "Billed {period}",
2233
+ id: "checkout.order_summary_block.billing_period.label",
2234
+ description: "Billing period option label for the selected period"
2235
+ },
2236
+ { period: u.value[j.type].full }
2237
+ ), J = N(s(j)), q = ot(j, J), X = l && j.type === l.type && j.value === l.value ? void 0 : un(q, h), ie = I(X);
2238
+ return {
2239
+ label: re,
2240
+ subLabel: _(j),
2241
+ labelSuffixComponent: ie ? {
2242
+ component: gn,
2243
+ props: {
2244
+ color: "primary",
2245
+ content: ie,
2246
+ size: M.value,
2247
+ class: "whitespace-nowrap text-left leading-tight"
2248
+ }
2249
+ } : void 0,
2250
+ hidden: O.value === s(j),
2251
+ value: s(j)
2252
+ };
2253
+ });
2254
+ }), r = c(() => {
2255
+ const l = p.value, h = l[0], F = l[l.length - 1];
2256
+ return {
2257
+ smallestPeriod: h == null ? void 0 : h.value,
2258
+ biggestPeriod: F == null ? void 0 : F.value
2259
+ };
2260
+ }), L = c(
2261
+ () => p.value.find((l) => l.value === r.value.biggestPeriod)
2262
+ ), f = c(
2263
+ () => p.value.find((l) => l.value === O.value)
2264
+ ), g = c(() => {
2265
+ const l = p.value, h = l[l.length - 1], F = O.value;
2266
+ if (!h || !F || F === h.value)
2267
+ return "";
2268
+ const j = P(h.value);
2269
+ if (!j)
2270
+ return "";
2271
+ const re = N(h.value), J = P(F), q = N(F);
2272
+ if (!J || !q)
2273
+ return "";
2274
+ const X = ot(J, q), ie = ot(j, re);
2275
+ return I(un(X, ie)) ?? "";
2276
+ }), Y = (l) => {
2277
+ const { smallestPeriod: h, biggestPeriod: F } = r.value;
2278
+ O.value = l ? F : h;
2279
+ };
2280
+ return (l, h) => (m(), S(t(Ae), {
2281
+ class: "sv-order-summary",
2282
+ "no-border": "",
2283
+ "no-spacing": "",
2284
+ "content-background": "none",
2285
+ title: e.noTitle ? void 0 : t(n)({
2286
+ defaultMessage: "Order summary",
2287
+ id: "checkout.order_summary_block.title",
2288
+ description: "The title of the order summary block that lists the subscription cost in the checkout"
2289
+ })
2290
+ }, {
2291
+ default: b(() => [
2292
+ E("div", ma, [
2293
+ A(t(Ae), {
2294
+ "no-spacing": "",
2295
+ class: "sv-order-summary__subscription"
2296
+ }, {
2297
+ default: b(() => [
2298
+ e.subscription ? (m(), S(Ii, {
2299
+ key: 0,
2300
+ avatar: e.avatar,
2301
+ subscription: e.subscription,
2302
+ "enabled-pricing-ids": e.enabledPricingIds
2303
+ }, null, 8, ["avatar", "subscription", "enabled-pricing-ids"])) : x("", !0)
2304
+ ]),
2305
+ _: 1
2306
+ }),
2307
+ p.value.length === 2 ? (m(), S(t(Ae), {
2308
+ key: 0,
2309
+ "no-spacing": "",
2310
+ "content-classes": O.value === r.value.biggestPeriod ? "border-primary-500" : void 0
2311
+ }, {
2312
+ default: b(() => {
2313
+ var F;
2314
+ return [
2315
+ E("div", ga, [
2316
+ E("div", ya, [
2317
+ L.value ? (m(), S(pa, {
2318
+ key: 0,
2319
+ name: L.value.label,
2320
+ description: ((F = f.value) == null ? void 0 : F.subLabel) ?? ""
2321
+ }, _t({
2322
+ default: b(() => [
2323
+ A(t(Nn), {
2324
+ "model-value": O.value === r.value.biggestPeriod,
2325
+ size: "sm",
2326
+ "onUpdate:modelValue": Y
2327
+ }, null, 8, ["model-value"])
2328
+ ]),
2329
+ _: 2
2330
+ }, [
2331
+ g.value ? {
2332
+ name: "badge",
2333
+ fn: b(() => [
2334
+ A(t(gn), {
2335
+ intent: "brand",
2336
+ content: g.value,
2337
+ size: M.value,
2338
+ class: "whitespace-nowrap text-left leading-tight"
2339
+ }, null, 8, ["content", "size"])
2340
+ ]),
2341
+ key: "0"
2342
+ } : void 0
2343
+ ]), 1032, ["name", "description"])) : x("", !0)
2344
+ ])
2345
+ ])
2346
+ ];
2347
+ }),
2348
+ _: 1
2349
+ }, 8, ["content-classes"])) : p.value.length > 2 ? (m(), S(t(Xi), {
2350
+ key: 1,
2351
+ "single-model-value": K.value,
2352
+ "onUpdate:singleModelValue": h[0] || (h[0] = (F) => K.value = F),
2353
+ class: "sv-order-summary__billing-period",
2354
+ options: p.value,
2355
+ size: "xl",
2356
+ "has-large-dropdown": "",
2357
+ "show-sub-label-in-input": "",
2358
+ "show-suffix-in-closed-input": ""
2359
+ }, null, 8, ["single-model-value", "options"])) : x("", !0),
2360
+ e.isUsageBased ? (m(), S(t(Ae), {
2361
+ key: 2,
2362
+ "no-spacing": "",
2363
+ class: "sv-order-summary__usage"
2364
+ }, {
2365
+ default: b(() => [
2366
+ E("div", va, [
2367
+ A(t(ce), {
2368
+ "no-spacing": "",
2369
+ variant: "body-sm",
2370
+ color: "subtle"
2371
+ }, {
2372
+ default: b(() => [
2373
+ G(z(t(n)({
2374
+ defaultMessage: "+ Usage",
2375
+ id: "checkout.invoice_preview.usage_based_message",
2376
+ description: "The message shown for the usage based invoice preview"
2377
+ })), 1)
2378
+ ]),
2379
+ _: 1
2380
+ })
2381
+ ])
2382
+ ]),
2383
+ _: 1
2384
+ })) : x("", !0),
2385
+ e.invoice ? (m(), S(Ti, {
2386
+ key: 3,
2387
+ invoice: e.invoice,
2388
+ "trial-invoice": e.trialInvoice,
2389
+ "is-paid": e.isPaid,
2390
+ collapsible: e.collapsible,
2391
+ "is-preview-without-taxes": !e.countryCode,
2392
+ variant: e.variant
2393
+ }, {
2394
+ default: b(() => [
2395
+ ne.value ? (m(), R("div", fa, [
2396
+ A(t(ce), {
2397
+ tag: "span",
2398
+ variant: "body-xs",
2399
+ color: "subtle",
2400
+ class: "grow"
2401
+ }, {
2402
+ default: b(() => [
2403
+ G(z(t(n)(
2404
+ {
2405
+ defaultMessage: "Then {amount} per {period}",
2406
+ id: "checkout.order_summary_block.renews_at",
2407
+ description: "The amount the subscription is charged every period after the first invoice"
2408
+ },
2409
+ {
2410
+ amount: t(be)(ne.value),
2411
+ period: t(y)(e.subscription.billing_period, {
2412
+ prefix: !1,
2413
+ singular: !0,
2414
+ hideValueForExactPeriods: !0
2415
+ })
2416
+ }
2417
+ )), 1)
2418
+ ]),
2419
+ _: 1
2420
+ })
2421
+ ])) : x("", !0)
2422
+ ]),
2423
+ _: 1
2424
+ }, 8, ["invoice", "trial-invoice", "is-paid", "collapsible", "is-preview-without-taxes", "variant"])) : (m(), S(t(Ae), {
2425
+ key: 4,
2426
+ class: "sv-order-summary__totals"
2427
+ }, {
2428
+ default: b(() => [
2429
+ A(t(ce), {
2430
+ variant: "body-sm",
2431
+ color: "subtle",
2432
+ class: "sv-order-summary__empty"
2433
+ }, {
2434
+ default: b(() => [
2435
+ G(z(t(n)({
2436
+ defaultMessage: "Please select a country first",
2437
+ description: "The message shown for the invoice preview when no country is set",
2438
+ id: "checkout.invoice_preview.no_country_selected_message"
2439
+ })), 1)
2440
+ ]),
2441
+ _: 1
2442
+ })
2443
+ ]),
2444
+ _: 1
2445
+ }))
2446
+ ])
2447
+ ]),
2448
+ _: 1
2449
+ }, 8, ["title"]));
2450
+ }
2451
+ }), ha = { key: 1 }, _a = { key: 2 }, ba = { key: 3 }, Ma = { key: 4 }, Ia = ["href"], Aa = /* @__PURE__ */ de({
2452
+ __name: "MarkdownInline",
2453
+ props: {
2454
+ nodes: { type: Array }
2455
+ },
2456
+ setup(e) {
2457
+ return (i, o) => {
2458
+ const a = Hn("MarkdownInline", !0);
2459
+ return m(!0), R(ye, null, lt(e.nodes, (n, u) => (m(), R(ye, { key: u }, [
2460
+ n.type === "text" ? (m(), R(ye, { key: 0 }, [
2461
+ G(z(n.value), 1)
2462
+ ], 64)) : n.type === "break" ? (m(), R("br", ha)) : n.type === "bold" ? (m(), R("strong", _a, [
2463
+ A(a, {
2464
+ nodes: n.children
2465
+ }, null, 8, ["nodes"])
2466
+ ])) : n.type === "italic" ? (m(), R("em", ba, [
2467
+ A(a, {
2468
+ nodes: n.children
2469
+ }, null, 8, ["nodes"])
2470
+ ])) : n.type === "underline" ? (m(), R("u", Ma, [
2471
+ A(a, {
2472
+ nodes: n.children
2473
+ }, null, 8, ["nodes"])
2474
+ ])) : n.type === "link" ? (m(), R("a", {
2475
+ key: 5,
2476
+ href: n.href,
2477
+ target: "_blank",
2478
+ rel: "noopener noreferrer",
2479
+ class: "underline"
2480
+ }, [
2481
+ A(a, {
2482
+ nodes: n.children
2483
+ }, null, 8, ["nodes"])
2484
+ ], 8, Ia)) : x("", !0)
2485
+ ], 64))), 128);
2486
+ };
2487
+ }
2488
+ }), Pa = /^<u>([\s\S]*?)<\/u>/i, Ca = /^\*\*([\s\S]+?)\*\*/, Na = /^\*([\s\S]+?)\*/, Da = /^_([\s\S]+?)_(?![\p{L}\p{N}])/u, Ea = /[\p{L}\p{N}]/u, La = /^\[([^\]]*)\]\(\s*([^)\s]*)\s*\)/, ka = /^<([a-z][a-z0-9+.-]*:[^>\s]+)>/i, Sa = /\n[ \t]*\n/;
2489
+ function Ze(e) {
2490
+ const i = [];
2491
+ let o = "";
2492
+ const a = () => {
2493
+ o && (i.push({ type: "text", value: o }), o = "");
2494
+ };
2495
+ let n = 0;
2496
+ for (; n < e.length; ) {
2497
+ const u = e.slice(n), y = Ca.exec(u);
2498
+ if (y) {
2499
+ a(), i.push({ type: "bold", children: Ze(y[1]) }), n += y[0].length;
2500
+ continue;
2501
+ }
2502
+ const d = Na.exec(u) ?? (Ta(e, n) ? Da.exec(u) : null);
2503
+ if (d) {
2504
+ a(), i.push({ type: "italic", children: Ze(d[1]) }), n += d[0].length;
2505
+ continue;
2506
+ }
2507
+ const M = Pa.exec(u);
2508
+ if (M) {
2509
+ a(), i.push({ type: "underline", children: Ze(M[1]) }), n += M[0].length;
2510
+ continue;
2511
+ }
2512
+ const s = La.exec(u);
2513
+ if (s) {
2514
+ a(), i.push(Mn(s[2], Ze(s[1]))), n += s[0].length;
2515
+ continue;
2516
+ }
2517
+ const D = ka.exec(u);
2518
+ if (D) {
2519
+ a(), i.push(Mn(D[1], [{ type: "text", value: D[1] }])), n += D[0].length;
2520
+ continue;
2521
+ }
2522
+ if (e[n] === `
2523
+ `) {
2524
+ a(), i.push({ type: "break" }), n += 1;
2525
+ continue;
2526
+ }
2527
+ o += e[n], n += 1;
2528
+ }
2529
+ return a(), i;
2530
+ }
2531
+ function Ta(e, i) {
2532
+ return i === 0 || !Ea.test(e[i - 1]);
2533
+ }
2534
+ function Mn(e, i) {
2535
+ const o = Ri(e);
2536
+ return o ? { type: "link", href: o, children: i } : { type: "text", value: Tn(i) };
2537
+ }
2538
+ function Tn(e) {
2539
+ return e.map((i) => i.type === "text" ? i.value : i.type === "break" ? " " : Tn(i.children)).join("");
2540
+ }
2541
+ function wa(e) {
2542
+ return e != null && e.trim() ? e.split(Sa).map((i) => i.trim()).filter(Boolean).map((i) => ({ type: "paragraph", children: Ze(i) })) : [];
2543
+ }
2544
+ const Oa = { key: 0 }, Ra = /* @__PURE__ */ de({
2545
+ __name: "MarkdownText",
2546
+ props: {
2547
+ source: { type: [String, null] }
2548
+ },
2549
+ setup(e) {
2550
+ const i = e, o = c(() => wa(i.source));
2551
+ return (a, n) => o.value.length ? (m(), R("div", Oa, [
2552
+ (m(!0), R(ye, null, lt(o.value, (u, y) => (m(), R("p", {
2553
+ key: y,
2554
+ class: Le({ "mt-2": y > 0 })
2555
+ }, [
2556
+ A(Aa, {
2557
+ nodes: u.children
2558
+ }, null, 8, ["nodes"])
2559
+ ], 2))), 128))
2560
+ ])) : x("", !0);
2561
+ }
2562
+ });
2563
+ async function wn(e, i, { onSubmit: o } = {}) {
2564
+ const { AdyenCheckout: a } = await rt();
2565
+ return a(
2566
+ xi({
2567
+ locale: e.locale,
2568
+ amount: e.amount,
2569
+ countryCode: e.countryCode,
2570
+ paymentMethodOptionResponse: e.paymentMethodOptionsResponse,
2571
+ logger: i,
2572
+ onSubmit: o
2573
+ })
2574
+ );
2575
+ }
2576
+ function On({
2577
+ props: e,
2578
+ create: i,
2579
+ onMissingButton: o,
2580
+ onMountFailed: a,
2581
+ afterMount: n
2582
+ }) {
2583
+ const u = H(), y = ke(), d = async () => {
2584
+ const M = await wn(e, y), s = await i(M);
2585
+ if (!u.value) {
2586
+ o();
2587
+ return;
2588
+ }
2589
+ try {
2590
+ await s.isAvailable(), s.mount(u.value), n == null || n();
2591
+ } catch (D) {
2592
+ a(D);
2593
+ }
2594
+ };
2595
+ return qe(() => {
2596
+ d();
2597
+ }), { buttonRef: u };
2598
+ }
2599
+ const xa = {
2600
+ key: 0,
2601
+ id: "svg-logo",
2602
+ viewBox: "0 0 35 15",
2603
+ class: "h-[44px]"
2604
+ }, za = {
2605
+ key: 1,
2606
+ src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",
2607
+ role: "presentation",
2608
+ class: "h-[22px]"
2609
+ }, Ct = /* @__PURE__ */ de({
2610
+ __name: "ExpressPaymentMethodButton",
2611
+ props: {
2612
+ type: { type: String }
2613
+ },
2614
+ emits: ["click"],
2615
+ setup(e, { emit: i }) {
2616
+ const o = e, a = i, n = c(() => {
2617
+ switch (o.type) {
2618
+ case "applepay":
2619
+ return "Apple Pay";
2620
+ case "googlepay":
2621
+ return "Google Pay";
2622
+ case "paypal":
2623
+ return "PayPal";
2624
+ default:
2625
+ return;
2626
+ }
2627
+ }), u = c(() => {
2628
+ switch (o.type) {
2629
+ case "applepay":
2630
+ return "!bg-black !py-0";
2631
+ case "googlepay":
2632
+ return "!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";
2633
+ case "paypal":
2634
+ return "!bg-[#ffc439]";
2635
+ default:
2636
+ return;
2637
+ }
2638
+ });
2639
+ function y() {
2640
+ a("click");
2641
+ }
2642
+ return (d, M) => (m(), S(t(Oe), {
2643
+ size: "lg",
2644
+ "aria-label": n.value,
2645
+ class: Le([u.value, "!block h-11 w-full bg-center bg-no-repeat"]),
2646
+ onClick: y
2647
+ }, {
2648
+ default: b(() => [
2649
+ o.type === "applepay" ? (m(), R("svg", xa, [...M[0] || (M[0] = [
2650
+ E("svg", {
2651
+ id: "svg-logo",
2652
+ x: "0",
2653
+ y: "3.85",
2654
+ height: "7.3",
2655
+ width: "35",
2656
+ class: "logo",
2657
+ viewBox: "0 0 105 43",
2658
+ version: "1.1",
2659
+ xmlns: "http://www.w3.org/2000/svg"
2660
+ }, [
2661
+ E("title", null, "Apple Logo"),
2662
+ E("g", {
2663
+ stroke: "none",
2664
+ "stroke-width": "1",
2665
+ fill: "none",
2666
+ "fill-rule": "evenodd"
2667
+ }, [
2668
+ E("g", { fill: "#FFF" }, [
2669
+ E("path", { d: "M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674" }),
2670
+ E("path", { d: "M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926" }),
2671
+ E("path", { d: "M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381" }),
2672
+ E("path", { d: "M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z" }),
2673
+ E("path", { d: "M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345" })
2674
+ ])
2675
+ ])
2676
+ ], -1)
2677
+ ])])) : o.type === "paypal" ? (m(), R("img", za)) : x("", !0)
2678
+ ]),
2679
+ _: 1
2680
+ }, 8, ["aria-label", "class"]));
2681
+ }
2682
+ }), ja = { class: "absolute h-[1px] w-[1px] overflow-hidden opacity-0" }, Ba = "ADYEN", Ua = /* @__PURE__ */ de({
2683
+ __name: "ExpressPaymentMethodApplePay",
2684
+ props: {
2685
+ onBillingInformationChange: { type: Function },
2686
+ context: { type: Object },
2687
+ validateOnSubmit: { type: Function },
2688
+ amount: { type: Object },
2689
+ countryCode: { type: String },
2690
+ locale: { type: String },
2691
+ isVisible: { type: Boolean },
2692
+ paymentMethodOptionsResponse: { type: Object },
2693
+ billingInformation: { type: Object }
2694
+ },
2695
+ emits: ["ready", "unavailable", "update-billing-information", "payment-success", "payment-failed"],
2696
+ setup(e, { emit: i }) {
2697
+ const o = e, a = i, n = H();
2698
+ let u, y = 0;
2699
+ const d = ke(), { authorizePayment: M } = Ji(), s = o.paymentMethodOptionsResponse.payment_acceptor.id;
2700
+ function D(p) {
2701
+ return eo({
2702
+ gateway: "ADYEN",
2703
+ paymentAcceptorId: s,
2704
+ paymentMethodType: "applepay",
2705
+ ...p
2706
+ });
2707
+ }
2708
+ const T = (p) => {
2709
+ var r;
2710
+ return p.status === "SUCCESS" && ((r = p.payment) == null ? void 0 : r.result) === "AUTHORIZED";
2711
+ }, P = () => Object.assign(new Error("Apple Pay payment could not be confirmed"), {
2712
+ code: "PAYMENT_OUTCOME_UNCONFIRMED"
2713
+ }), O = async (p, r) => {
2714
+ var f;
2715
+ const L = (g) => {
2716
+ r.reject(), a("payment-failed", g);
2717
+ };
2718
+ try {
2719
+ const g = await M({
2720
+ payment_acceptor_id: s,
2721
+ payment_gateway_variant: Ba,
2722
+ adyen: {
2723
+ payment_method: cn(p.data.paymentMethod),
2724
+ ...p.data.riskData && {
2725
+ risk_data: cn(p.data.riskData)
2726
+ },
2727
+ store_payment_method: !0
2728
+ // Required for recurring payments
2729
+ },
2730
+ amount: o.amount,
2731
+ ...o.context ? { context: o.context } : {},
2732
+ return_url: zi({ paymentAcceptorId: s, redirectUrl: window.location.href })
2733
+ });
2734
+ if (T(g)) {
2735
+ r.resolve({ resultCode: "Authorised" }), a("payment-success");
2736
+ return;
2737
+ }
2738
+ if (to(g) === "UNCONFIRMED") {
2739
+ d.warn(
2740
+ "PAYMENT_OUTCOME_UNCONFIRMED",
2741
+ "The payment outcome could not be confirmed yet",
2742
+ D({
2743
+ reason: "PAYMENT_PENDING",
2744
+ extra: {
2745
+ paymentStatus: g.status,
2746
+ paymentResult: (f = g.payment) == null ? void 0 : f.result
2747
+ }
2748
+ })
2749
+ ), L(P());
2750
+ return;
2751
+ }
2752
+ d.error(
2753
+ "APPLE_PAY_AUTHORIZATION_FAILED",
2754
+ "Payment authorization failed",
2755
+ D({
2756
+ reason: "APPLE_PAY_AUTHORIZATION_REJECTED",
2757
+ extra: { paymentStatus: g.status }
2758
+ })
2759
+ ), L(new Error(`Apple Pay payment was not authorized (${g.status})`));
2760
+ } catch (g) {
2761
+ if (d.error(
2762
+ "APPLE_PAY_AUTHORIZATION_FAILED",
2763
+ "Apple Pay authorization failed",
2764
+ D({ reason: "APPLE_PAY_AUTHORIZATION_FAILED", cause: g }),
2765
+ g
2766
+ ), no(g)) {
2767
+ L(P());
2768
+ return;
2769
+ }
2770
+ L(g instanceof Error ? g : new Error("Apple Pay authorization failed"));
2771
+ }
2772
+ }, K = async () => {
2773
+ const p = y, { ApplePay: r } = await rt(), L = await wn(o, d, {
2774
+ onSubmit: (Y, l, h) => void O(Y, h)
2775
+ }), f = o.billingInformation.regular ? {
2776
+ paymentDescription: o.billingInformation.description,
2777
+ billingAgreement: o.billingInformation.agreement,
2778
+ managementURL: o.billingInformation.managementURL,
2779
+ ...o.billingInformation.trial && {
2780
+ trialBilling: {
2781
+ label: o.billingInformation.trial.label,
2782
+ amount: o.billingInformation.trial.amount.quantity.toString(),
2783
+ type: "final",
2784
+ paymentTiming: "recurring",
2785
+ recurringPaymentStartDate: o.billingInformation.trial.startDate,
2786
+ recurringPaymentEndDate: o.billingInformation.trial.endDate
2787
+ }
2788
+ },
2789
+ regularBilling: {
2790
+ label: o.billingInformation.regular.label,
2791
+ amount: o.billingInformation.regular.amount.quantity.toString(),
2792
+ type: "final",
2793
+ paymentTiming: "recurring",
2794
+ recurringPaymentStartDate: o.billingInformation.regular.startDate,
2795
+ ..._(
2796
+ o.billingInformation.regular.interval ?? { type: "MONTH", value: 1 }
2797
+ )
2798
+ }
2799
+ } : void 0, g = new r(L, {
2800
+ isExpress: !0,
2801
+ ...f && { recurringPaymentRequest: f },
2802
+ requiredBillingContactFields: ["postalAddress"],
2803
+ requiredShippingContactFields: ["email"],
2804
+ onPaymentMethodSelected: async (Y, l, h) => {
2805
+ var J, q, X, ie, me, C, k, w;
2806
+ const { invoicePreview: F, trialInvoicePreview: j } = await o.onBillingInformationChange({
2807
+ ...((J = h.paymentMethod.billingContact) == null ? void 0 : J.postalCode) && {
2808
+ postalCode: h.paymentMethod.billingContact.postalCode
2809
+ },
2810
+ ...((q = h.paymentMethod.billingContact) == null ? void 0 : q.locality) && {
2811
+ city: h.paymentMethod.billingContact.locality
2812
+ },
2813
+ ...ae((X = h.paymentMethod.billingContact) == null ? void 0 : X.countryCode) && {
2814
+ country: ae((ie = h.paymentMethod.billingContact) == null ? void 0 : ie.countryCode)
2815
+ }
2816
+ }), re = j ? j.invoice_amount_including_tax.quantity.toString() : F.invoice_amount_including_tax.quantity.toString();
2817
+ a("update-billing-information", {
2818
+ postal_code: (me = h.paymentMethod.billingContact) == null ? void 0 : me.postalCode,
2819
+ city: (C = h.paymentMethod.billingContact) == null ? void 0 : C.locality,
2820
+ country: (k = h.paymentMethod.billingContact) == null ? void 0 : k.countryCode
2821
+ }), Y({
2822
+ newTotal: {
2823
+ label: ((w = o.billingInformation.regular) == null ? void 0 : w.label) ?? o.billingInformation.description,
2824
+ amount: re,
2825
+ type: "final"
2826
+ }
2827
+ });
2828
+ },
2829
+ onError: (Y) => {
2830
+ d.error(
2831
+ "APPLE_PAY_ERROR",
2832
+ "Apple Pay error",
2833
+ D({ reason: "APPLE_PAY_ERROR", cause: Y }),
2834
+ Y
2835
+ );
2836
+ },
2837
+ /**
2838
+ * Resolving here is what starts Adyen's payment flow, which calls `onSubmit` above. The
2839
+ * charge is not made from this callback — the form is checked here instead, because a
2840
+ * rejection shows the customer an error in the sheet rather than taking their money for a
2841
+ * subscription the checkout cannot create.
2842
+ */
2843
+ onAuthorized: async (Y, l) => {
2844
+ var h, F, j, re;
2845
+ try {
2846
+ const J = (h = Y.authorizedEvent.payment) == null ? void 0 : h.billingContact, q = J ? I(J) : Y.billingAddress ? $(Y.billingAddress) : void 0, X = (j = (F = Y.authorizedEvent.payment) == null ? void 0 : F.shippingContact) == null ? void 0 : j.emailAddress;
2847
+ if ((q || X) && (a("update-billing-information", { ...q, ...X && { email: X } }), await Ve()), !(await ((re = o.validateOnSubmit) == null ? void 0 : re.call(o)) ?? !0)) {
2848
+ d.warn(
2849
+ "APPLE_PAY_FORM_INCOMPLETE",
2850
+ "Apple Pay authorization stopped: the checkout form is incomplete",
2851
+ D({ reason: "APPLE_PAY_FORM_INVALID" })
2852
+ ), l.reject(), a("payment-failed", new Error("The checkout form is incomplete"));
2853
+ return;
2854
+ }
2855
+ l.resolve();
2856
+ } catch (J) {
2857
+ d.error(
2858
+ "APPLE_PAY_AUTHORIZATION_FAILED",
2859
+ "Apple Pay authorization failed",
2860
+ D({ reason: "APPLE_PAY_AUTHORIZATION_FAILED", cause: J }),
2861
+ J
2862
+ ), l.reject(), a(
2863
+ "payment-failed",
2864
+ J instanceof Error ? J : new Error("Apple Pay authorization failed")
2865
+ );
2866
+ }
2867
+ }
2868
+ });
2869
+ if (!n.value) {
2870
+ d.error("APPLE_PAY_ERROR", "Apple Pay button ref not found");
2871
+ return;
2872
+ }
2873
+ try {
2874
+ if (await g.isAvailable(), p !== y)
2875
+ return;
2876
+ g.mount(n.value), u = g, a("ready");
2877
+ } catch (Y) {
2878
+ d.error("APPLE_PAY_ERROR", "Apple Pay not available on this device", {}, Y), p === y && a("unavailable");
2879
+ }
2880
+ }, N = () => {
2881
+ y += 1, u == null || u.unmount(), u = void 0;
2882
+ }, _ = (p) => {
2883
+ if (!p.value)
2884
+ return;
2885
+ let r = p.value ?? 1, L = p.type.toLowerCase();
2886
+ if (p.type === "WEEK" && (L = "day", r = p.value * 7), L === "day" || L === "month" || L === "year" || L === "hour" || L === "minute")
2887
+ return {
2888
+ recurringPaymentIntervalUnit: L,
2889
+ recurringPaymentIntervalCount: r
2890
+ };
2891
+ }, I = (p) => {
2892
+ var r, L;
2893
+ return {
2894
+ ...((r = p.addressLines) == null ? void 0 : r[0]) && { line1: p.addressLines[0] },
2895
+ ...((L = p.addressLines) == null ? void 0 : L[1]) && { line2: p.addressLines[1] },
2896
+ ...p.administrativeArea && { state: p.administrativeArea },
2897
+ postal_code: p.postalCode,
2898
+ city: p.locality,
2899
+ country: p.countryCode
2900
+ };
2901
+ }, $ = (p) => ({
2902
+ ...p.street && { line1: p.street },
2903
+ ...p.houseNumberOrName && { line2: p.houseNumberOrName },
2904
+ ...p.stateOrProvince && { state: p.stateOrProvince },
2905
+ postal_code: p.postalCode,
2906
+ city: p.city,
2907
+ country: p.country
2908
+ }), ae = (p) => p && Z(p) ? p : void 0, Z = (p) => Ge(p), ne = () => {
2909
+ var r;
2910
+ const p = (r = n.value) == null ? void 0 : r.querySelector("apple-pay-button");
2911
+ if (p) {
2912
+ const L = new MouseEvent("click", {
2913
+ bubbles: !0,
2914
+ cancelable: !0,
2915
+ view: window
2916
+ });
2917
+ p.dispatchEvent(L);
2918
+ }
2919
+ }, te = async () => {
2920
+ try {
2921
+ await K();
2922
+ } catch (p) {
2923
+ d.error(
2924
+ "APPLE_PAY_ERROR",
2925
+ "Apple Pay could not be set up",
2926
+ D({ reason: "APPLE_PAY_SETUP_FAILED", cause: p }),
2927
+ p
2928
+ );
2929
+ }
2930
+ };
2931
+ return qe(() => {
2932
+ te();
2933
+ }), he(
2934
+ // By value: `amount` is rebuilt by every invoice preview, and `onPaymentMethodSelected` asks
2935
+ // for one as the sheet opens — comparing objects would tear down the live session.
2936
+ () => [o.amount.quantity, o.amount.currency, o.billingInformation.agreement].join(
2937
+ "|"
2938
+ ),
2939
+ () => {
2940
+ N(), te();
2941
+ }
2942
+ ), Qn(N), (p, r) => (m(), R(ye, null, [
2943
+ e.isVisible ? (m(), S(Ct, {
2944
+ key: 0,
2945
+ type: "applepay",
2946
+ onClick: ne
2947
+ })) : x("", !0),
2948
+ E("div", ja, [
2949
+ E("div", {
2950
+ ref_key: "applePayButtonRef",
2951
+ ref: n
2952
+ }, null, 512)
2953
+ ])
2954
+ ], 64));
2955
+ }
2956
+ }), Fa = { class: "relative overflow-hidden" }, Va = /* @__PURE__ */ de({
2957
+ __name: "ExpressPaymentMethodPaypal",
2958
+ props: {
2959
+ amount: { type: Object },
2960
+ countryCode: { type: String },
2961
+ locale: { type: String },
2962
+ isVisible: { type: Boolean },
2963
+ paymentMethodOptionsResponse: { type: Object },
2964
+ billingInformation: { type: Object }
2965
+ },
2966
+ emits: ["ready", "unavailable", "update-billing-information", "payment-success", "payment-failed"],
2967
+ setup(e, { emit: i }) {
2968
+ const o = e, a = i, n = ke(), { buttonRef: u } = On({
2969
+ props: o,
2970
+ onMissingButton: () => n.error(
2971
+ "EXPRESS_CHECKOUT_PAYPAL_ERROR",
2972
+ "The PayPal button reference is not found and cannot be mounted"
2973
+ ),
2974
+ onMountFailed: (y) => n.error("EXPRESS_CHECKOUT_PAYPAL_ERROR", "Failed mounting PayPal express button", {
2975
+ error: y
2976
+ }),
2977
+ create: async (y) => {
2978
+ const { PayPal: d } = await rt();
2979
+ return new d(y, {
2980
+ isExpress: !0,
2981
+ blockPayPalPayLaterButton: !0,
2982
+ blockPayPalCreditButton: !0,
2983
+ blockPayPalVenmoButton: !0,
2984
+ style: {
2985
+ height: 55
2986
+ },
2987
+ onInit: () => {
2988
+ a("ready");
2989
+ }
2990
+ });
2991
+ }
2992
+ });
2993
+ return (y, d) => (m(), R("div", Fa, [
2994
+ e.isVisible ? (m(), S(Ct, {
2995
+ key: 0,
2996
+ type: "paypal",
2997
+ class: "w-full"
2998
+ })) : x("", !0),
2999
+ E("div", {
3000
+ ref_key: "paypalButtonRef",
3001
+ ref: u,
3002
+ class: "absolute inset-0 opacity-[0.0001]"
3003
+ }, null, 512)
3004
+ ]));
3005
+ }
3006
+ }), $a = { class: "absolute h-[1px] w-[1px] overflow-hidden opacity-0" }, Ga = /* @__PURE__ */ de({
3007
+ __name: "ExpressPaymentMethodGooglePay",
3008
+ props: {
3009
+ amount: { type: Object },
3010
+ countryCode: { type: String },
3011
+ locale: { type: String },
3012
+ isVisible: { type: Boolean },
3013
+ paymentMethodOptionsResponse: { type: Object },
3014
+ billingInformation: { type: Object }
3015
+ },
3016
+ emits: ["ready", "unavailable", "update-billing-information", "payment-success", "payment-failed"],
3017
+ setup(e, { emit: i }) {
3018
+ const o = e, a = i, n = ke(), { buttonRef: u } = On({
3019
+ props: o,
3020
+ onMissingButton: () => n.error(
3021
+ "EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR",
3022
+ "The Google Pay button reference is not found and cannot be mounted"
3023
+ ),
3024
+ onMountFailed: (d) => n.error(
3025
+ "EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR",
3026
+ "Failed mounting Google Pay express button",
3027
+ {},
3028
+ d
3029
+ ),
3030
+ create: async (d) => {
3031
+ const { GooglePay: M } = await rt();
3032
+ return new M(d, { isExpress: !0 });
3033
+ },
3034
+ afterMount: () => a("ready")
3035
+ }), y = () => {
3036
+ var M;
3037
+ const d = (M = u.value) == null ? void 0 : M.querySelector("#gpay-button-online-api-id");
3038
+ if (d) {
3039
+ const s = new MouseEvent("click", {
3040
+ bubbles: !0,
3041
+ cancelable: !0,
3042
+ view: window
3043
+ });
3044
+ d.dispatchEvent(s);
3045
+ }
3046
+ };
3047
+ return (d, M) => (m(), R(ye, null, [
3048
+ e.isVisible ? (m(), S(Ct, {
3049
+ key: 0,
3050
+ type: "googlepay",
3051
+ onClick: y
3052
+ })) : x("", !0),
3053
+ E("div", $a, [
3054
+ E("div", {
3055
+ ref_key: "googlePayButtonRef",
3056
+ ref: u
3057
+ }, null, 512)
3058
+ ])
3059
+ ], 64));
3060
+ }
3061
+ }), Ya = {
3062
+ key: 0,
3063
+ class: "mt-4n"
3064
+ }, Ka = { class: "mb-2" }, Ha = { class: "grid grid-cols-6 gap-1 md:gap-2" }, Qa = { class: "mt-4 h-4" }, Za = 2, qa = /* @__PURE__ */ de({
3065
+ __name: "ExpressPaymentMethods",
3066
+ props: {
3067
+ amount: { type: Object },
3068
+ countryCode: { type: String },
3069
+ locale: { type: String },
3070
+ paymentMethodsOptionsResponse: { type: null },
3071
+ billingInformation: { type: Object },
3072
+ onBillingInformationChange: { type: Function },
3073
+ context: { type: Object },
3074
+ validateOnSubmit: { type: Function }
3075
+ },
3076
+ emits: ["update-billing-information", "payment-success", "payment-failed"],
3077
+ setup(e) {
3078
+ const i = ["applepay"], o = e, { $t: a } = Pe(), n = H(!1), u = H(!1), y = H(!1), d = H(!1), M = c(() => {
3079
+ var N;
3080
+ if (i.includes("applepay"))
3081
+ return (N = o.paymentMethodsOptionsResponse) == null ? void 0 : N.find(
3082
+ (_) => {
3083
+ var I;
3084
+ return (I = _.options) == null ? void 0 : I.some(
3085
+ ($) => $.name.toLowerCase() === "apple pay" && $.payment_gateway_variant === "ADYEN"
3086
+ );
3087
+ }
3088
+ );
3089
+ }), s = c(() => u.value ? void 0 : M.value), D = c(() => {
3090
+ var N;
3091
+ if (i.includes("paypal"))
3092
+ return (N = o.paymentMethodsOptionsResponse) == null ? void 0 : N.find(
3093
+ (_) => {
3094
+ var I;
3095
+ return (I = _.options) == null ? void 0 : I.some(
3096
+ ($) => $.name.toLowerCase() === "paypal" && $.payment_gateway_variant === "ADYEN"
3097
+ );
3098
+ }
3099
+ );
3100
+ }), T = c(() => {
3101
+ var N;
3102
+ if (i.includes("googlepay"))
3103
+ return (N = o.paymentMethodsOptionsResponse) == null ? void 0 : N.find(
3104
+ (_) => {
3105
+ var I;
3106
+ return (I = _.options) == null ? void 0 : I.some(
3107
+ ($) => $.name.toLowerCase() === "google pay" && $.payment_gateway_variant === "ADYEN"
3108
+ );
3109
+ }
3110
+ );
3111
+ }), P = c(() => !!(s.value || T.value || D.value)), O = c(() => {
3112
+ var $;
3113
+ if ((($ = o.paymentMethodsOptionsResponse) == null ? void 0 : $.length) === 0)
3114
+ return !1;
3115
+ const N = !s.value || n.value, _ = !T.value || y.value, I = !D.value || d.value;
3116
+ return N && _ && I;
3117
+ }), K = c(() => O.value ? (s.value ? 1 : 0) + (T.value ? 1 : 0) + (D.value ? 1 : 0) : Za);
3118
+ return (N, _) => P.value ? (m(), R("div", Ya, [
3119
+ E("div", Ka, [
3120
+ O.value ? (m(), S(t(ce), {
3121
+ key: 1,
3122
+ variant: "heading-3",
3123
+ tag: "h2"
3124
+ }, {
3125
+ default: b(() => [
3126
+ G(z(t(a)({
3127
+ defaultMessage: "Subscribe instantly with",
3128
+ id: "checkout.express_payment_methods.title",
3129
+ description: "The title of the express payment methods block in the checkout form"
3130
+ })), 1)
3131
+ ]),
3132
+ _: 1
3133
+ })) : (m(), S(Ee, {
3134
+ key: 0,
3135
+ variant: "title"
3136
+ }))
3137
+ ]),
3138
+ E("div", Ha, [
3139
+ O.value ? x("", !0) : (m(), R(ye, { key: 0 }, [
3140
+ A(Ee, { class: "col-span-3 h-11" }),
3141
+ A(Ee, { class: "col-span-3 h-11" })
3142
+ ], 64)),
3143
+ E("div", {
3144
+ class: Le(["col-span-3 md:col-span-2", {
3145
+ hidden: !s.value,
3146
+ "!col-span-6": K.value === 1,
3147
+ "md:!col-span-3": K.value === 2,
3148
+ "!col-span-6 md:!col-span-2": K.value === 3
3149
+ }])
3150
+ }, [
3151
+ s.value ? (m(), S(Ua, {
3152
+ key: 0,
3153
+ amount: e.amount,
3154
+ "billing-information": e.billingInformation,
3155
+ "country-code": e.countryCode,
3156
+ locale: e.locale,
3157
+ "is-visible": O.value,
3158
+ "payment-method-options-response": s.value,
3159
+ "on-billing-information-change": e.onBillingInformationChange,
3160
+ context: e.context,
3161
+ "validate-on-submit": e.validateOnSubmit,
3162
+ onReady: _[0] || (_[0] = (I) => n.value = !0),
3163
+ onUnavailable: _[1] || (_[1] = (I) => u.value = !0),
3164
+ onUpdateBillingInformation: _[2] || (_[2] = (I) => N.$emit("update-billing-information", I)),
3165
+ onPaymentSuccess: _[3] || (_[3] = (I) => N.$emit("payment-success")),
3166
+ onPaymentFailed: _[4] || (_[4] = (I) => N.$emit("payment-failed", I))
3167
+ }, null, 8, ["amount", "billing-information", "country-code", "locale", "is-visible", "payment-method-options-response", "on-billing-information-change", "context", "validate-on-submit"])) : x("", !0)
3168
+ ], 2),
3169
+ E("div", {
3170
+ class: Le(["col-span-3 md:col-span-2", {
3171
+ hidden: !T.value,
3172
+ "col-span-6 md:col-span-6": K.value === 1,
3173
+ "md:!col-span-3": K.value === 2
3174
+ }])
3175
+ }, [
3176
+ T.value ? (m(), S(Ga, {
3177
+ key: 0,
3178
+ amount: e.amount,
3179
+ "billing-information": e.billingInformation,
3180
+ "country-code": e.countryCode,
3181
+ locale: e.locale,
3182
+ "is-visible": O.value,
3183
+ "payment-method-options-response": T.value,
3184
+ onReady: _[5] || (_[5] = (I) => y.value = !0)
3185
+ }, null, 8, ["amount", "billing-information", "country-code", "locale", "is-visible", "payment-method-options-response"])) : x("", !0)
3186
+ ], 2),
3187
+ E("div", {
3188
+ class: Le(["col-span-3 md:col-span-2", {
3189
+ hidden: !D.value,
3190
+ "col-span-6 md:col-span-6": K.value === 1,
3191
+ "md:!col-span-3": K.value === 2
3192
+ }])
3193
+ }, [
3194
+ D.value ? (m(), S(Va, {
3195
+ key: 0,
3196
+ amount: e.amount,
3197
+ "billing-information": e.billingInformation,
3198
+ "country-code": e.countryCode,
3199
+ locale: e.locale,
3200
+ "is-visible": O.value,
3201
+ "payment-method-options-response": D.value,
3202
+ onReady: _[6] || (_[6] = (I) => d.value = !0)
3203
+ }, null, 8, ["amount", "billing-information", "country-code", "locale", "is-visible", "payment-method-options-response"])) : x("", !0)
3204
+ ], 2)
3205
+ ]),
3206
+ E("div", Qa, [
3207
+ O.value ? (m(), S(t(Wi), {
3208
+ key: 1,
3209
+ text: t(a)({
3210
+ defaultMessage: "Or",
3211
+ id: "checkout.express_payment_methods.divider_text",
3212
+ description: "The text of the divider text in the express payment methods block in the checkout form"
3213
+ }),
3214
+ "text-position": "center"
3215
+ }, null, 8, ["text"])) : (m(), S(Ee, {
3216
+ key: 0,
3217
+ variant: "divider-text"
3218
+ }))
3219
+ ])
3220
+ ])) : x("", !0);
3221
+ }
3222
+ }), Xa = ["aria-expanded", "aria-label"], Wa = { class: "flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2" }, Ja = { class: "flex flex-row items-center gap-2" }, es = ["onKeydown"], ts = ["aria-label"], ns = { class: "flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2" }, is = { class: "flex flex-row items-center gap-2" }, os = {
3223
+ class: "sr-only",
3224
+ "aria-live": "polite"
3225
+ }, as = /* @__PURE__ */ de({
3226
+ inheritAttrs: !1,
3227
+ __name: "PromotionCodeSection",
3228
+ props: {
3229
+ promotionCode: { default: null, type: [String, null] },
3230
+ isPending: { type: Boolean, default: !1 }
3231
+ },
3232
+ emits: ["update:appliedCode", "apply", "remove"],
3233
+ setup(e, { emit: i }) {
3234
+ const { $t: o } = Pe(), a = e, n = i, u = H(!1), y = H(""), d = H(""), M = H(!1), s = H(null), D = H(null), T = $i("promotion-code-"), P = `${T}-label`, O = `${T}-panel`, K = c({
3235
+ get: () => y.value,
3236
+ set: (g) => y.value = ci(g)
3237
+ }), N = c(() => a.promotionCode !== null && a.promotionCode !== ""), _ = c(() => y.value.trim().length > 0), I = c(
3238
+ () => a.promotionCode ?? o({
3239
+ defaultMessage: "Promotion applied",
3240
+ id: "checkout.promotion_code.applied_label",
3241
+ description: "Fallback label for an applied promotion code in checkout"
3242
+ })
3243
+ ), $ = c(
3244
+ () => u.value ? o({
3245
+ defaultMessage: "Collapse promotion code input",
3246
+ id: "checkout.promotion_code.collapse_aria_label",
3247
+ description: "Aria label for the promotion code toggle button in checkout, while the input is open"
3248
+ }) : o({
3249
+ defaultMessage: "Expand promotion code input",
3250
+ id: "checkout.promotion_code.expand_aria_label",
3251
+ description: "Aria label for the promotion code toggle button in checkout, while the input is closed"
3252
+ })
3253
+ ), ae = c(
3254
+ () => o({
3255
+ defaultMessage: "Apply promotion code",
3256
+ id: "checkout.promotion_code.apply_aria_label",
3257
+ description: "Aria label for the promotion code apply button in checkout"
3258
+ })
3259
+ ), Z = c(
3260
+ () => o({
3261
+ defaultMessage: "Remove promotion code",
3262
+ id: "checkout.promotion_code.remove_aria_label",
3263
+ description: "Aria label for the promotion code remove button in checkout"
3264
+ })
3265
+ ), ne = () => {
3266
+ y.value = "";
3267
+ }, te = () => {
3268
+ var Y;
3269
+ const g = (Y = D.value) == null ? void 0 : Y.querySelector("input");
3270
+ g instanceof HTMLInputElement && g.focus();
3271
+ }, p = () => {
3272
+ u.value && (u.value = !1);
3273
+ }, r = () => {
3274
+ N.value || (u.value = !u.value);
3275
+ }, L = () => {
3276
+ if (!_.value)
3277
+ return;
3278
+ const g = y.value.trim();
3279
+ d.value = "", M.value = !0, n("update:appliedCode", g), n("apply", g), u.value = !1;
3280
+ }, f = () => {
3281
+ M.value = !1, n("update:appliedCode", null), n("remove"), d.value = o({
3282
+ defaultMessage: "Promotion code removed",
3283
+ id: "checkout.promotion_code.removed_status",
3284
+ description: "Aria live message when a promotion code is removed in checkout"
3285
+ }), ne(), Ve(() => {
3286
+ var g;
3287
+ (g = s.value) == null || g.focus();
3288
+ });
3289
+ };
3290
+ return he(u, (g) => {
3291
+ if (!g) {
3292
+ ne(), Ve(() => {
3293
+ var Y;
3294
+ (Y = s.value) == null || Y.focus();
3295
+ });
3296
+ return;
3297
+ }
3298
+ Ve(() => {
3299
+ te();
3300
+ });
3301
+ }), he(
3302
+ () => a.promotionCode,
3303
+ (g) => {
3304
+ g || ne();
3305
+ }
3306
+ ), he(
3307
+ () => a.isPending,
3308
+ (g) => {
3309
+ g || !M.value || (M.value = !1, N.value && (d.value = o({
3310
+ defaultMessage: "Promotion code applied",
3311
+ id: "checkout.promotion_code.applied_status",
3312
+ description: "Aria live message when a promotion code is applied in checkout"
3313
+ })));
3314
+ }
3315
+ ), (g, Y) => (m(), R(ye, null, [
3316
+ N.value ? (m(), S(t(Ae), we({ key: 1 }, g.$attrs, {
3317
+ "no-border": "",
3318
+ "no-spacing": "",
3319
+ "content-background": "none",
3320
+ class: "relative w-full"
3321
+ }), {
3322
+ default: b(() => [
3323
+ E("button", {
3324
+ type: "button",
3325
+ class: "w-full rounded border border-primary-900 bg-white",
3326
+ "aria-label": Z.value,
3327
+ onClick: f
3328
+ }, [
3329
+ E("div", ns, [
3330
+ E("div", is, [
3331
+ A(t(nt), { icon: "local_activity" }),
3332
+ A(t(ce), {
3333
+ variant: "body-sm",
3334
+ class: "font-semibold"
3335
+ }, {
3336
+ default: b(() => [
3337
+ G(z(I.value), 1)
3338
+ ]),
3339
+ _: 1
3340
+ })
3341
+ ]),
3342
+ A(t(nt), { icon: "close" })
3343
+ ])
3344
+ ], 8, ts)
3345
+ ]),
3346
+ _: 1
3347
+ }, 16)) : (m(), S(t(Ae), we({ key: 0 }, g.$attrs, {
3348
+ "no-spacing": "",
3349
+ class: "relative w-full"
3350
+ }), {
3351
+ default: b(() => [
3352
+ E("button", {
3353
+ ref_key: "toggleRef",
3354
+ ref: s,
3355
+ type: "button",
3356
+ class: "w-full",
3357
+ "aria-expanded": u.value,
3358
+ "aria-controls": O,
3359
+ "aria-label": $.value,
3360
+ onClick: r
3361
+ }, [
3362
+ E("div", Wa, [
3363
+ E("div", Ja, [
3364
+ A(t(nt), { icon: "local_activity" }),
3365
+ A(t(ce), {
3366
+ id: P,
3367
+ variant: "body-sm"
3368
+ }, {
3369
+ default: b(() => [
3370
+ G(z(t(o)({
3371
+ defaultMessage: "Add promotion code",
3372
+ id: "checkout.promotion_code.add_label",
3373
+ description: "Label for adding a promotion code in checkout"
3374
+ })), 1)
3375
+ ]),
3376
+ _: 1
3377
+ })
3378
+ ]),
3379
+ A(t(nt), {
3380
+ icon: u.value ? "remove" : "add"
3381
+ }, null, 8, ["icon"])
3382
+ ])
3383
+ ], 8, Xa),
3384
+ Zn(E("div", {
3385
+ id: O,
3386
+ ref_key: "panelRef",
3387
+ ref: D,
3388
+ role: "region",
3389
+ "aria-labelledby": P,
3390
+ class: "flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",
3391
+ onKeydown: qt(st(p, ["prevent"]), ["esc"])
3392
+ }, [
3393
+ A(t(Qe), {
3394
+ modelValue: K.value,
3395
+ "onUpdate:modelValue": Y[0] || (Y[0] = (l) => K.value = l),
3396
+ placeholder: t(o)({
3397
+ defaultMessage: "Promotion code",
3398
+ id: "checkout.promotion_code.placeholder",
3399
+ description: "Placeholder for promotion code input in checkout"
3400
+ }),
3401
+ "aria-label": t(o)({
3402
+ defaultMessage: "Promotion code",
3403
+ id: "checkout.promotion_code.input_aria_label",
3404
+ description: "Aria label for promotion code input in checkout"
3405
+ }),
3406
+ class: "w-full",
3407
+ onKeydown: qt(st(L, ["self", "prevent"]), ["enter"])
3408
+ }, null, 8, ["modelValue", "placeholder", "aria-label", "onKeydown"]),
3409
+ A(t(Oe), {
3410
+ type: "button",
3411
+ disabled: !_.value,
3412
+ "aria-label": ae.value,
3413
+ "aria-disabled": !_.value,
3414
+ onClick: L
3415
+ }, {
3416
+ default: b(() => [
3417
+ G(z(t(o)({
3418
+ defaultMessage: "Apply",
3419
+ id: "checkout.promotion_code.apply_button",
3420
+ description: "Button label for applying a promotion code in checkout"
3421
+ })), 1)
3422
+ ]),
3423
+ _: 1
3424
+ }, 8, ["disabled", "aria-label", "aria-disabled"])
3425
+ ], 40, es), [
3426
+ [qn, u.value]
3427
+ ])
3428
+ ]),
3429
+ _: 1
3430
+ }, 16)),
3431
+ E("span", os, z(d.value), 1)
3432
+ ], 64));
3433
+ }
3434
+ }), ss = { class: "sv-checkout__header" }, ls = { class: "sv-checkout__payment-methods" }, rs = {
3435
+ key: 0,
3436
+ class: "sv-checkout__payment-methods-body"
3437
+ }, us = {
3438
+ key: 3,
3439
+ class: "sv-checkout__payment-form"
3440
+ }, cs = { class: "sv-checkout__order-summary" }, ds = { class: "flex flex-col gap-4" }, ps = /* @__PURE__ */ de({
3441
+ __name: "Checkout",
3442
+ props: {
3443
+ configuration: { type: Object }
3444
+ },
3445
+ emits: ["error", "ready"],
3446
+ setup(e, { emit: i }) {
3447
+ var xt, zt, jt, Bt, Ut, Ft, Vt, $t, Gt, Yt, Kt, Ht, Qt;
3448
+ const o = Xt(
3449
+ () => import("./PaymentIntegrationForm-CcfQSzKM.mjs")
3450
+ ), a = Xt(
3451
+ () => import("./PlanCustomizationEditor-D29N4HUM.mjs")
3452
+ ), n = e, u = i, y = c(() => n.configuration), d = H(), M = ke(), { $t: s, locale: D } = Pe(), { formatTimePeriod: T } = bt(), P = Vi(), { isMobileViewport: O } = Dn();
3453
+ if (M.info("COMPONENT_INITIALIZED", "Checkout component initialized"), ((xt = P.value) == null ? void 0 : xt.type) !== "INIT_PRICING_PLAN_SUBSCRIPTION")
3454
+ throw new Wn("INVALID_TOKEN", "Invalid token");
3455
+ const K = (jt = (zt = P.value) == null ? void 0 : zt.init_pricing_plan_subscription) == null ? void 0 : jt.pricing_plan_subscription_id, N = (Ut = (Bt = P.value) == null ? void 0 : Bt.init_pricing_plan_subscription) == null ? void 0 : Ut.success_url, _ = (($t = (Vt = (Ft = P.value) == null ? void 0 : Ft.init_pricing_plan_subscription) == null ? void 0 : Vt.note) == null ? void 0 : $t.trim()) || void 0, I = ((Yt = (Gt = P.value) == null ? void 0 : Gt.init_pricing_plan_subscription) == null ? void 0 : Yt.use_shipping_addresses) === !0, {
3456
+ validatedEmail: $,
3457
+ validatedCountry: ae,
3458
+ paymentMethodOptions: Z,
3459
+ hasPaymentMethodOptionsError: ne,
3460
+ retryPaymentMethodOptions: te,
3461
+ subscription: p,
3462
+ orderMeterValues: r,
3463
+ isPaymentMethodsPending: L,
3464
+ isInvoicePreviewPending: f,
3465
+ isInvoicePreviewStale: g,
3466
+ settleInvoicePreview: Y,
3467
+ checkoutForm: l,
3468
+ invoicePreview: h,
3469
+ invoicePreviewByBillingPeriod: F,
3470
+ trialInvoicePreview: j,
3471
+ trialPeriod: re,
3472
+ authorizationContext: J,
3473
+ isPaid: q,
3474
+ amount: X,
3475
+ recurringAmount: ie,
3476
+ hasOneOffCharges: me,
3477
+ loadInvoicePreview: C,
3478
+ updateInvoicePreviewOnBillingInformationChange: k,
3479
+ saveFormStateForRedirect: w,
3480
+ clearSavedFormState: V
3481
+ } = Oo({
3482
+ initialCountry: (Kt = n.configuration) == null ? void 0 : Kt.countryCode,
3483
+ initialEmail: (Ht = n.configuration) == null ? void 0 : Ht.email,
3484
+ subscriptionId: K,
3485
+ enabledPricingIds: (Qt = n.configuration) == null ? void 0 : Qt.enabledPricingIds,
3486
+ isShippingAddressRequired: I
3487
+ }), Q = ji(), ue = c(
3488
+ () => {
3489
+ var v;
3490
+ return !!((v = Q == null ? void 0 : Q.value) != null && v["express-checkout"]);
3491
+ }
3492
+ ), W = H(!1), { isFormHeld: oe, handleActionRequired: se } = Bi(W), ge = async () => {
3493
+ await l.validation.value.$validate(), !(l.validation.value.$invalid || !d.value) && (Me(), d.value.submit());
3494
+ }, Me = () => {
3495
+ W.value = !0, ve.value = null, w();
3496
+ }, ve = H(null), Re = () => {
3497
+ W.value = !1, fe.value = void 0, V();
3498
+ }, xe = H(!1), Ye = (v) => {
3499
+ if (W.value = !1, fe.value = void 0, V(), (v == null ? void 0 : v.code) === "PAYMENT_OUTCOME_UNCONFIRMED") {
3500
+ xe.value = !0;
3501
+ return;
3502
+ }
3503
+ ve.value = (v == null ? void 0 : v.message) ?? s({
3504
+ defaultMessage: "The payment did not go through. Please try again.",
3505
+ id: "checkout.payment_failed",
3506
+ description: "Error shown when a payment the customer started did not complete"
3507
+ });
3508
+ }, Xe = (v) => {
3509
+ Ye(v), (v == null ? void 0 : v.code) === "PAYMENT_OUTCOME_UNCONFIRMED" && (ve.value = s({
3510
+ defaultMessage: "Your payment could not be confirmed yet and may still go through, so please do not pay again.",
3511
+ id: "checkout.payment_unconfirmed",
3512
+ description: "Shown when it is not yet known whether an express payment the customer made went through"
3513
+ }));
3514
+ }, fe = H(), ze = c(() => fe.value ? { inert: !0 } : {}), Ke = async () => {
3515
+ if (await l.validation.value.$validate(), l.validation.value.$invalid) return !1;
3516
+ const v = await Y();
3517
+ return v === "CHANGED" ? (ve.value = s({
3518
+ defaultMessage: "The price changed with your last edit. Check it and pay again.",
3519
+ id: "checkout.price_changed",
3520
+ description: "Shown when a payment is held back because the customer changed the order while it waited for the price"
3521
+ }), !1) : v === "FAILED" ? (ve.value = s({
3522
+ defaultMessage: "The price could not be brought up to date. Please try again.",
3523
+ id: "checkout.price_not_settled",
3524
+ description: "Error shown when a payment is held back because the price of the latest changes could not be loaded"
3525
+ }), !1) : (X.value && (fe.value = { amount: X.value, context: J.value }, await Ve()), !0);
3526
+ }, We = c(() => !!j.value), Ce = c(
3527
+ () => Ei(et.value, {
3528
+ enabledPricingIds: l.form.value.enabledPricingIds
3529
+ })
3530
+ ), He = c(
3531
+ () => [...Ce.value].some((v) => v !== "ONE_OFF")
3532
+ ), je = c(() => Ce.value.has("USAGE_BASED")), Je = c(
3533
+ () => je.value || (h.value ? wi(h.value) : !1)
3534
+ ), Ie = c(
3535
+ () => {
3536
+ var v;
3537
+ return ie.value ?? ((v = h.value) == null ? void 0 : v.tax_summary.total_amount);
3538
+ }
3539
+ );
3540
+ he(
3541
+ () => me.value && !ie.value && !!h.value,
3542
+ (v) => {
3543
+ v && M.warn(
3544
+ "RECURRING_AMOUNT_UNRESOLVED",
3545
+ "Could not tell the recurring part of the invoice from the one-off part; the mandate states the invoice total",
3546
+ { flow: "CHECKOUT" }
3547
+ );
3548
+ }
3549
+ );
3550
+ const Be = c(
3551
+ () => He.value || !!Ie.value && Number(Ie.value.quantity) !== 0
3552
+ ), pe = c(
3553
+ () => me.value ? ie.value : void 0
3554
+ ), Rn = c(
3555
+ () => l.form.value.country && ["US", "CA"].includes(l.form.value.country) || !1
3556
+ ), ut = c({
3557
+ get: () => l.form.value.enabledPricingIds ?? [],
3558
+ set: (v) => {
3559
+ l.form.value.enabledPricingIds = v;
3560
+ }
3561
+ }), et = c(
3562
+ () => p.value ? $e({
3563
+ pricingPlanScheduleInfos: p.value.pricing_plan_schedule_infos,
3564
+ type: "DEFAULT"
3565
+ }) : void 0
3566
+ ), Nt = c(() => {
3567
+ var B, U;
3568
+ if (!p.value)
3569
+ return;
3570
+ const v = (U = (B = et.value) == null ? void 0 : B.pricing_plan_version) == null ? void 0 : U.pricing_currency_settings;
3571
+ return Sn({
3572
+ country: l.form.value.country,
3573
+ pricingCurrencySettings: v,
3574
+ fallbackCurrency: p.value.billing_currency
3575
+ });
3576
+ }), Dt = c(() => {
3577
+ if (!et.value || !p.value)
3578
+ return /* @__PURE__ */ new Set();
3579
+ const v = fi({
3580
+ pricingPlanScheduleInfo: et.value
3581
+ }), B = Nt.value, U = p.value.billing_period, ee = /* @__PURE__ */ new Set();
3582
+ return v.forEach((le, Ne) => {
3583
+ B && le.currency !== B || U && le.billingPeriod && (le.billingPeriod.type !== U.type || le.billingPeriod.value !== U.value) || ee.add(Ne);
3584
+ }), ee;
3585
+ }), Et = (v) => c({
3586
+ get: () => {
3587
+ const B = l.form.value[v] ?? [], U = Dt.value;
3588
+ return U.size ? B.filter(({ pricing_item_config_id: ee }) => U.has(ee)) : B;
3589
+ },
3590
+ set: (B) => {
3591
+ const U = l.form.value[v] ?? [], ee = Dt.value;
3592
+ if (!ee.size) {
3593
+ l.form.value[v] = B;
3594
+ return;
3595
+ }
3596
+ const le = U.filter(
3597
+ ({ pricing_item_config_id: Ne }) => !ee.has(Ne)
3598
+ );
3599
+ l.form.value[v] = le.concat(B);
3600
+ }
3601
+ }), ct = Et("seatsValues"), dt = Et("unitsValues"), tt = c(
3602
+ () => {
3603
+ var v;
3604
+ return T(((v = h.value) == null ? void 0 : v.billing_period) ?? { type: "MONTH", value: 1 }, {
3605
+ short: !0,
3606
+ singular: !0,
3607
+ hideValueForExactPeriods: !0
3608
+ });
3609
+ }
3610
+ ), xn = c(() => {
3611
+ var v;
3612
+ if (j.value)
3613
+ return s(
3614
+ {
3615
+ defaultMessage: "{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",
3616
+ id: "checkout.agreement.trial",
3617
+ description: "The agreement for the trial period"
3618
+ },
3619
+ {
3620
+ discounted_amount: Number(j.value.tax_summary.total_amount.quantity) === 0 ? s({
3621
+ defaultMessage: "Free",
3622
+ id: "checkout.agreement.trial.free",
3623
+ description: "The free amount for the trial period"
3624
+ }) : be(j.value.tax_summary.total_amount),
3625
+ trial_period: T(re.value, { short: !0 }),
3626
+ subscription_amount: be(
3627
+ Ie.value ?? {
3628
+ quantity: "0.00",
3629
+ currency: j.value.tax_summary.total_amount.currency
3630
+ }
3631
+ ),
3632
+ billing_period: tt.value,
3633
+ // @ts-expect-error formatjs does not support this type yet
3634
+ start_date: new Date(Se.value)
3635
+ }
3636
+ );
3637
+ if (me.value && ie.value) {
3638
+ const B = be(
3639
+ ((v = h.value) == null ? void 0 : v.tax_summary.total_amount) ?? {
3640
+ quantity: "0.00",
3641
+ currency: ie.value.currency
3642
+ }
3643
+ );
3644
+ return Be.value ? je.value && Number(ie.value.quantity) === 0 ? s(
3645
+ {
3646
+ defaultMessage: "{due_today} today, then usage billed every {billing_period} until canceled.",
3647
+ id: "checkout.agreement.usage_with_one_off",
3648
+ description: "The agreement for a usage-based subscription whose first invoice also charges something only once"
3649
+ },
3650
+ {
3651
+ due_today: B,
3652
+ billing_period: tt.value
3653
+ }
3654
+ ) : s(
3655
+ {
3656
+ defaultMessage: "{due_today} today, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",
3657
+ id: "checkout.agreement.subscription_with_one_off",
3658
+ description: "The agreement for a subscription whose first invoice also charges something only once"
3659
+ },
3660
+ {
3661
+ due_today: B,
3662
+ subscription_amount: be(ie.value),
3663
+ billing_period: tt.value,
3664
+ // @ts-expect-error formatjs does not support this type yet
3665
+ start_date: new Date(Se.value)
3666
+ }
3667
+ ) : s(
3668
+ {
3669
+ defaultMessage: "{due_today} today. One-time purchase.",
3670
+ id: "checkout.agreement.one_off",
3671
+ description: "The agreement for an order that is charged once and does not renew"
3672
+ },
3673
+ { due_today: B }
3674
+ );
3675
+ }
3676
+ return s(
3677
+ {
3678
+ defaultMessage: "{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",
3679
+ id: "checkout.agreement.subscription",
3680
+ description: "The agreement for the subscription"
3681
+ },
3682
+ {
3683
+ subscription_amount: Ie.value ? be(Ie.value) : "",
3684
+ billing_period: tt.value,
3685
+ // @ts-expect-error formatjs does not support this type yet
3686
+ start_date: new Date(Se.value)
3687
+ }
3688
+ );
3689
+ }), Lt = c(() => {
3690
+ var v;
3691
+ return {
3692
+ invoicePreviewByBillingPeriod: F.value,
3693
+ trialInvoice: j.value,
3694
+ enabledPricingIds: ut.value,
3695
+ countryCode: l.form.value.country,
3696
+ avatar: (v = y.value) == null ? void 0 : v.avatar,
3697
+ isPaid: q.value,
3698
+ isUsageBased: Je.value
3699
+ };
3700
+ }), kt = c(() => {
3701
+ var B;
3702
+ if (!h.value)
3703
+ return;
3704
+ const v = Pi({
3705
+ subscription: p.value,
3706
+ fallback: s({
3707
+ defaultMessage: "Subscription",
3708
+ description: "The fallback name for when no subscription name can be determined",
3709
+ id: "customer_overview.subscriptions_block.fallback_subscription_name"
3710
+ })
3711
+ });
3712
+ return {
3713
+ description: v,
3714
+ managementURL: "https://www.solvimon.com/account/billing",
3715
+ agreement: xn.value,
3716
+ ...j.value && re.value && {
3717
+ trial: {
3718
+ label: s({
3719
+ defaultMessage: "Trial",
3720
+ id: "checkout.trial.label",
3721
+ description: "The label of the trial"
3722
+ }),
3723
+ amount: j.value.tax_summary.total_amount,
3724
+ startDate: pt.value ? new Date(pt.value) : void 0,
3725
+ endDate: St.value ? new Date(St.value) : void 0
3726
+ }
3727
+ },
3728
+ // Left off entirely, so the sheet mandates no charge that is never going to be made.
3729
+ ...Be.value && Ie.value && {
3730
+ regular: {
3731
+ label: v,
3732
+ amount: Ie.value,
3733
+ startDate: Se.value ? new Date(Se.value) : void 0,
3734
+ interval: ((B = p.value) == null ? void 0 : B.billing_period) ?? { type: "MONTH", value: 1 }
3735
+ }
3736
+ }
3737
+ };
3738
+ }), zn = (v) => Ge(v), jn = (v) => {
3739
+ const { line1: B, line2: U, postal_code: ee, city: le, state: Ne, country: yt, email: Zt } = v;
3740
+ l.updateInitialState({
3741
+ ...B && { addressLine1: B },
3742
+ ...U && { addressLine2: U },
3743
+ ...ee && { postalCode: ee },
3744
+ ...le && { city: le },
3745
+ ...Ne && { state: Ne },
3746
+ ...Zt && { email: Zt },
3747
+ ...yt && zn(yt) ? { country: yt } : {}
3748
+ });
3749
+ }, Bn = c(() => !($ && ae)), pt = c(() => {
3750
+ var U, ee, le;
3751
+ const v = (ee = (U = j.value) == null ? void 0 : U.periods) == null ? void 0 : ee[0], B = (le = mt.value) == null ? void 0 : le.trialStartDate;
3752
+ return v != null && v.start_at ? new Date(v.start_at) : B;
3753
+ }), mt = c(() => Ci(p.value)), St = c(() => {
3754
+ var U, ee, le;
3755
+ const v = (ee = (U = j.value) == null ? void 0 : U.periods) == null ? void 0 : ee[0], B = (le = mt.value) == null ? void 0 : le.trialEndDate;
3756
+ return v != null && v.end_at ? new Date(v.end_at) : B;
3757
+ }), Se = c(() => {
3758
+ var U, ee, le;
3759
+ const v = (ee = (U = h.value) == null ? void 0 : U.periods) == null ? void 0 : ee[0], B = (le = mt.value) == null ? void 0 : le.subscriptionStartDate;
3760
+ return v != null && v.start_at ? new Date(v.start_at) : B;
3761
+ }), Un = c(() => !!(l.form.value.seatsValues && l.form.value.seatsValues.length > 0 || l.form.value.unitsValues && l.form.value.unitsValues.length > 0 || p.value && Po(p.value) || p.value && Co(p.value))), Ue = H(null);
3762
+ he(
3763
+ () => l.form.value.promotionCode,
3764
+ (v) => {
3765
+ Ue.value = v ?? null;
3766
+ }
3767
+ );
3768
+ const {
3769
+ applyPromotionCode: Tt,
3770
+ removePromotionCode: Fn,
3771
+ isPromotionCodePending: wt,
3772
+ promotionCodeErrorMessage: gt
3773
+ } = Ro({
3774
+ checkoutForm: l,
3775
+ updateInvoicePreviewOnBillingInformationChange: k,
3776
+ formatErrorMessage: ({ action: v }) => s(v === "apply" ? {
3777
+ defaultMessage: "Promotion code could not be applied. Please try again.",
3778
+ id: "checkout.promotion_code.apply_failed",
3779
+ description: "Error message when applying a promotion code in checkout failed"
3780
+ } : {
3781
+ defaultMessage: "Promotion code could not be removed. Please try again.",
3782
+ id: "checkout.promotion_code.remove_failed",
3783
+ description: "Error message when removing a promotion code in checkout failed"
3784
+ }),
3785
+ onInvalidPromotionCode: () => {
3786
+ Ue.value = null;
3787
+ },
3788
+ onApplyError: () => {
3789
+ Ue.value = null;
3790
+ }
3791
+ });
3792
+ xo({
3793
+ subscription: p,
3794
+ promotionCode: () => {
3795
+ var v;
3796
+ return (v = n.configuration) == null ? void 0 : v.couponCode;
3797
+ },
3798
+ appliedPromotionCode: Ue,
3799
+ applyPromotionCode: Tt
3800
+ });
3801
+ const Vn = () => {
3802
+ N && Ui(N);
3803
+ }, $n = c(
3804
+ () => {
3805
+ var v;
3806
+ return !((v = n.configuration) != null && v.onPaymentSuccess) && !!N;
3807
+ }
3808
+ ), Ot = () => {
3809
+ var v;
3810
+ if (q.value = !0, fe.value = void 0, V(), gt.value = null, ve.value = null, (v = n.configuration) != null && v.onPaymentSuccess) {
3811
+ n.configuration.onPaymentSuccess();
3812
+ return;
3813
+ }
3814
+ if (N) {
3815
+ Vn();
3816
+ return;
3817
+ }
3818
+ }, Rt = (v) => {
3819
+ p.value && (p.value = {
3820
+ ...p.value,
3821
+ billing_period: v
3822
+ }, C().catch(() => {
3823
+ }));
3824
+ };
3825
+ return qe(() => {
3826
+ u("ready");
3827
+ }), (v, B) => (m(), S(t(io), {
3828
+ class: Le(["sv-checkout sv-root sv-screen", { "sv-checkout--paid": t(q) }])
3829
+ }, {
3830
+ header: b(() => [
3831
+ E("div", ss, [
3832
+ A(Ee, { class: "min-h-[52px] w-96" }, {
3833
+ default: b(() => {
3834
+ var U, ee, le, Ne;
3835
+ return [
3836
+ t(h) && t(p) && Se.value ? (m(), S(sa, {
3837
+ key: 0,
3838
+ class: "sv-checkout__title",
3839
+ "trial-start-date": pt.value,
3840
+ "trial-period": t(re),
3841
+ "subscription-start-date": Se.value,
3842
+ "subscription-name": ((U = t(p)) == null ? void 0 : U.name) ?? "",
3843
+ amount: (ee = t(h)) == null ? void 0 : ee.invoice_amount_including_tax,
3844
+ "due-today-amount": t(X) ?? ((le = t(h)) == null ? void 0 : le.invoice_amount_including_tax),
3845
+ "recurring-amount": pe.value,
3846
+ "has-one-off-charges": t(me),
3847
+ "has-recurring-charge": Be.value,
3848
+ "has-usage-charges": je.value,
3849
+ "billing-period": (Ne = t(p)) == null ? void 0 : Ne.billing_period,
3850
+ "country-code": t(l).form.value.country
3851
+ }, null, 8, ["trial-start-date", "trial-period", "subscription-start-date", "subscription-name", "amount", "due-today-amount", "recurring-amount", "has-one-off-charges", "has-recurring-charge", "has-usage-charges", "billing-period", "country-code"])) : x("", !0)
3852
+ ];
3853
+ }),
3854
+ _: 1
3855
+ })
3856
+ ])
3857
+ ]),
3858
+ content: b(() => [
3859
+ t(q) ? (m(), S(la, {
3860
+ key: 0,
3861
+ class: "sv-checkout__completed-payment"
3862
+ })) : (m(), R(ye, { key: 1 }, [
3863
+ t(p) && t(O) ? (m(), S(bn, we({
3864
+ key: 0,
3865
+ class: "sv-checkout__mobile-order-summary"
3866
+ }, Lt.value, {
3867
+ subscription: t(p),
3868
+ invoice: t(h),
3869
+ collapsible: "collapsed",
3870
+ variant: "products-inline",
3871
+ onBillingPeriodChange: Rt
3872
+ }), null, 16, ["subscription", "invoice"])) : x("", !0),
3873
+ Un.value && t(p) ? (m(), S(t(a), we({ key: 1 }, ze.value, {
3874
+ "seats-values": t(ct),
3875
+ "onUpdate:seatsValues": B[0] || (B[0] = (U) => Wt(ct) ? ct.value = U : null),
3876
+ "units-values": t(dt),
3877
+ "onUpdate:unitsValues": B[1] || (B[1] = (U) => Wt(dt) ? dt.value = U : null),
3878
+ "enabled-pricing-ids": ut.value,
3879
+ "onUpdate:enabledPricingIds": B[2] || (B[2] = (U) => ut.value = U),
3880
+ class: "sv-checkout__plan-customization",
3881
+ subscription: t(p),
3882
+ "initial-seats-values": t(r).seatsValues,
3883
+ "initial-units-values": t(r).unitsValues,
3884
+ "billing-period": t(p).billing_period,
3885
+ currency: Nt.value
3886
+ }), null, 16, ["seats-values", "units-values", "enabled-pricing-ids", "subscription", "initial-seats-values", "initial-units-values", "billing-period", "currency"])) : x("", !0),
3887
+ ue.value && !xe.value && t(l).form.value.country && t(X) && kt.value ? (m(), S(qa, {
3888
+ key: 2,
3889
+ class: "sv-checkout__express-payment-methods",
3890
+ amount: t(X),
3891
+ "country-code": t(l).form.value.country,
3892
+ locale: t(D),
3893
+ "payment-methods-options-response": t(Z) ?? [],
3894
+ "billing-information": kt.value,
3895
+ "on-billing-information-change": t(k),
3896
+ context: t(J),
3897
+ "validate-on-submit": Ke,
3898
+ onUpdateBillingInformation: jn,
3899
+ onPaymentSuccess: Ot,
3900
+ onPaymentFailed: Xe
3901
+ }, null, 8, ["amount", "country-code", "locale", "payment-methods-options-response", "billing-information", "on-billing-information-change", "context"])) : x("", !0),
3902
+ A(ea, we({
3903
+ modelValue: t(l).form.value,
3904
+ "onUpdate:modelValue": B[3] || (B[3] = (U) => t(l).form.value = U),
3905
+ class: "sv-checkout__customer-form",
3906
+ validation: t(l).validation,
3907
+ "read-only-email": t($),
3908
+ "show-customer-info-on-top": Bn.value || t(q),
3909
+ "is-billing-information-mandatory": Rn.value,
3910
+ "is-shipping-address-required": I,
3911
+ "get-is-field-required": t(l).getIsFieldRequired,
3912
+ "shipping-address-format": t(l).shippingAddressFormat.value,
3913
+ "read-only": t(q)
3914
+ }, ze.value), null, 16, ["modelValue", "validation", "read-only-email", "show-customer-info-on-top", "is-billing-information-mandatory", "get-is-field-required", "shipping-address-format", "read-only"]),
3915
+ E("div", ls, [
3916
+ A(Ee, {
3917
+ variant: "section",
3918
+ class: "min-h-[130px]"
3919
+ }, {
3920
+ default: b(() => {
3921
+ var U, ee;
3922
+ return [
3923
+ !t(L) || t(L) && t(Z).length > 0 ? (m(), R("div", rs, [
3924
+ A(t(ce), {
3925
+ variant: "heading-3",
3926
+ tag: "h2",
3927
+ class: "sv-checkout__payment-methods-title mb-2"
3928
+ }, {
3929
+ default: b(() => [
3930
+ G(z(t(s)({
3931
+ defaultMessage: "Payment method",
3932
+ id: "checkout.payment_method_block.title",
3933
+ description: "The title of the payment method block in the checkout form"
3934
+ })), 1)
3935
+ ]),
3936
+ _: 1
3937
+ }),
3938
+ t(l).form.value.country ? t(ne) ? (m(), S(vt, {
3939
+ key: 1,
3940
+ class: "sv-checkout__payment-methods-error",
3941
+ icon: "error"
3942
+ }, {
3943
+ title: b(() => [
3944
+ G(z(t(s)({
3945
+ defaultMessage: "Could not load payment methods",
3946
+ id: "checkout.payment_method_block.load_failed_title",
3947
+ description: "The title shown when the payment methods failed to load"
3948
+ })), 1)
3949
+ ]),
3950
+ message: b(() => [
3951
+ G(z(t(s)({
3952
+ defaultMessage: "Check your connection and try again.",
3953
+ id: "checkout.payment_method_block.load_failed_message",
3954
+ description: "The message shown when the payment methods failed to load"
3955
+ })), 1)
3956
+ ]),
3957
+ action: b(() => [
3958
+ A(t(Oe), {
3959
+ type: "button",
3960
+ intent: "secondary",
3961
+ size: "sm",
3962
+ class: "sv-action sv-action--secondary sv-checkout__payment-methods-retry",
3963
+ onClick: t(te)
3964
+ }, {
3965
+ default: b(() => [
3966
+ G(z(t(s)({
3967
+ defaultMessage: "Try again",
3968
+ id: "checkout.payment_method_block.load_failed_retry_button.label",
3969
+ description: "The label of the button that loads the payment methods again"
3970
+ })), 1)
3971
+ ]),
3972
+ _: 1
3973
+ }, 8, ["onClick"])
3974
+ ]),
3975
+ _: 1
3976
+ })) : t(Z).length === 0 ? (m(), S(vt, {
3977
+ key: 2,
3978
+ class: "sv-checkout__payment-methods-empty",
3979
+ icon: "credit_card_off"
3980
+ }, {
3981
+ title: b(() => [
3982
+ G(z(t(s)({
3983
+ defaultMessage: "No payment methods available",
3984
+ id: "checkout.payment_method_block.no_payment_methods_available_title",
3985
+ description: "The title shown when there are no available payment methods"
3986
+ })), 1)
3987
+ ]),
3988
+ _: 1
3989
+ })) : t(X) && t(l).form.value.country ? (m(), R("div", us, [
3990
+ E("div", {
3991
+ class: Le({ "pointer-events-none opacity-60": t(oe) })
3992
+ }, [
3993
+ A(t(o), {
3994
+ ref_key: "paymentIntegrationFormRef",
3995
+ ref: d,
3996
+ "country-code": t(l).form.value.country,
3997
+ context: fe.value ? fe.value.context : t(J),
3998
+ amount: fe.value ? fe.value.amount : t(X),
3999
+ email: t(l).form.value.email,
4000
+ variant: "AUTHORIZE",
4001
+ "payment-method-options": t(Z) ?? [],
4002
+ "validate-on-submit": Ke,
4003
+ "redirects-on-success": $n.value,
4004
+ "force-store-payment-method": "",
4005
+ "billing-entity-name": (ee = (U = t(p)) == null ? void 0 : U.billing_entity) == null ? void 0 : ee.legal_name,
4006
+ onPaymentSuccess: Ot,
4007
+ onPaymentFailed: Ye,
4008
+ onInvalid: Re,
4009
+ onSubmitting: Me,
4010
+ onActionRequired: t(se),
4011
+ onReady: B[4] || (B[4] = (le) => u("ready"))
4012
+ }, null, 8, ["country-code", "context", "amount", "email", "payment-method-options", "redirects-on-success", "billing-entity-name", "onActionRequired"])
4013
+ ], 2)
4014
+ ])) : x("", !0) : (m(), S(vt, {
4015
+ key: 0,
4016
+ class: "sv-checkout__payment-methods-empty",
4017
+ icon: "captive_portal"
4018
+ }, {
4019
+ title: b(() => [
4020
+ G(z(t(s)({
4021
+ defaultMessage: "Select your billing country",
4022
+ id: "checkout.payment_method_block.no_country_selected_title",
4023
+ description: "The title shown when no country is selected"
4024
+ })), 1)
4025
+ ]),
4026
+ message: b(() => [
4027
+ G(z(t(s)({
4028
+ defaultMessage: "Payment methods will be shown after you select the billing country.",
4029
+ id: "checkout.payment_method_block.no_country_selected_message",
4030
+ description: "The message shown when no country is selected"
4031
+ })), 1)
4032
+ ]),
4033
+ _: 1
4034
+ }))
4035
+ ])) : x("", !0)
4036
+ ];
4037
+ }),
4038
+ _: 1
4039
+ })
4040
+ ])
4041
+ ], 64))
4042
+ ]),
4043
+ aside: b(() => [
4044
+ E("div", cs, [
4045
+ A(Ee, {
4046
+ variant: "section",
4047
+ class: "min-h-[220px]"
4048
+ }, {
4049
+ default: b(() => [
4050
+ t(p) && t(h) ? (m(), S(bn, we({ key: 0 }, Lt.value, {
4051
+ subscription: t(p),
4052
+ invoice: t(h),
4053
+ onBillingPeriodChange: Rt
4054
+ }), null, 16, ["subscription", "invoice"])) : x("", !0)
4055
+ ]),
4056
+ _: 1
4057
+ })
4058
+ ]),
4059
+ t(q) ? x("", !0) : (m(), R(ye, { key: 0 }, [
4060
+ A(as, we({ class: "sv-checkout__promotion-code" }, ze.value, {
4061
+ "promotion-code": Ue.value,
4062
+ "is-pending": t(wt),
4063
+ "onUpdate:appliedCode": B[5] || (B[5] = (U) => Ue.value = U),
4064
+ onRemove: t(Fn),
4065
+ onApply: t(Tt)
4066
+ }), null, 16, ["promotion-code", "is-pending", "onRemove", "onApply"]),
4067
+ t(gt) ? (m(), S(t(Jt), {
4068
+ key: 0,
4069
+ class: "sv-checkout__promotion-error mt-2",
4070
+ title: t(gt)
4071
+ }, null, 8, ["title"])) : x("", !0),
4072
+ ve.value ? (m(), S(t(Jt), {
4073
+ key: 1,
4074
+ class: "sv-checkout__payment-error mt-2",
4075
+ title: ve.value
4076
+ }, null, 8, ["title"])) : x("", !0),
4077
+ E("div", ds, [
4078
+ A(Ee, { class: "sv-checkout__submit-skeleton min-h-10" }, {
4079
+ default: b(() => [
4080
+ t(h) ? (m(), S(t(Oe), {
4081
+ key: 0,
4082
+ type: "button",
4083
+ size: "md",
4084
+ class: "sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",
4085
+ disabled: t(wt) || t(f) || t(g) || t(ne) || t(Z).length === 0 || W.value || xe.value,
4086
+ loading: W.value,
4087
+ onClick: ge
4088
+ }, {
4089
+ default: b(() => [
4090
+ G(z(We.value ? t(s)({
4091
+ defaultMessage: "Start trial",
4092
+ id: "checkout.pay_and_subscribe_button_trial.label",
4093
+ description: "The label of the start trial button in the checkout form"
4094
+ }) : t(s)({
4095
+ defaultMessage: "Pay and subscribe",
4096
+ id: "checkout.pay_and_subscribe_button.label",
4097
+ description: "The label of the pay and subscribe button in the checkout form"
4098
+ })), 1)
4099
+ ]),
4100
+ _: 1
4101
+ }, 8, ["disabled", "loading"])) : x("", !0)
4102
+ ]),
4103
+ _: 1
4104
+ }),
4105
+ A(oo, { "payment-method-options": t(Z) }, null, 8, ["payment-method-options"]),
4106
+ t(_) ? (m(), S(t(ce), {
4107
+ key: 0,
4108
+ tag: "div",
4109
+ variant: "body-xs",
4110
+ color: "subtle",
4111
+ class: "sv-checkout__terms px-4 text-center"
4112
+ }, {
4113
+ default: b(() => [
4114
+ A(Ra, { source: t(_) }, null, 8, ["source"])
4115
+ ]),
4116
+ _: 1
4117
+ })) : x("", !0)
4118
+ ])
4119
+ ], 64))
4120
+ ]),
4121
+ _: 1
4122
+ }, 8, ["class"]));
4123
+ }
4124
+ }), ms = 256, gs = /^[^\s\p{C}]+$/u;
4125
+ function ys(e) {
4126
+ const i = e == null ? void 0 : e.trim();
4127
+ if (!(!i || i.length > ms || !gs.test(i)))
4128
+ return i;
4129
+ }
4130
+ const vs = /* @__PURE__ */ de({
4131
+ __name: "Checkout.entry",
4132
+ props: {
4133
+ portalToken: { type: Object },
4134
+ environment: { type: String },
4135
+ locale: { type: String },
4136
+ dateLocale: { type: String },
4137
+ messages: { type: Object },
4138
+ primaryColor: { type: String },
4139
+ secondaryColor: { type: String },
4140
+ isShadowRoot: { type: Boolean },
4141
+ experimentalFeatures: { type: Array },
4142
+ logLevel: { type: String },
4143
+ onLog: { type: Function },
4144
+ allowedPortalTypes: { type: Array },
4145
+ portalObject: { type: Object },
4146
+ cssOverrides: { type: [String, Array] },
4147
+ branding: { type: Object },
4148
+ configuration: { type: Object }
4149
+ },
4150
+ emits: ["ready", "error"],
4151
+ setup(e, { emit: i }) {
4152
+ const o = ei("checkout"), a = e, n = i, u = c(
4153
+ () => {
4154
+ var y;
4155
+ return ((y = a.configuration) == null ? void 0 : y.couponCode) ?? ys(Fi("coupon_code"));
4156
+ }
4157
+ );
4158
+ return (y, d) => (m(), S(t(Jn), {
4159
+ entry: y.$props,
4160
+ "component-name": t(o),
4161
+ "allowed-portal-types": ["INIT_PRICING_PLAN_SUBSCRIPTION"],
4162
+ onError: d[1] || (d[1] = (M) => y.$emit("error", M))
4163
+ }, {
4164
+ "portal-unavailable": b(() => [
4165
+ A(ro, { class: "sv-checkout sv-root sv-screen sv-checkout--error" })
4166
+ ]),
4167
+ default: b(() => {
4168
+ var M, s, D, T, P;
4169
+ return [
4170
+ A(ps, {
4171
+ configuration: {
4172
+ avatar: (s = (M = e.branding) == null ? void 0 : M.emblem) == null ? void 0 : s.public_url,
4173
+ email: (D = e.configuration) == null ? void 0 : D.email,
4174
+ countryCode: (T = e.configuration) == null ? void 0 : T.countryCode,
4175
+ enabledPricingIds: (P = e.configuration) == null ? void 0 : P.enabledPricingIds,
4176
+ couponCode: u.value
4177
+ },
4178
+ onReady: d[0] || (d[0] = (O) => n("ready"))
4179
+ }, _t({ _: 2 }, [
4180
+ y.$slots["terms-and-conditions"] ? {
4181
+ name: "terms-and-conditions",
4182
+ fn: b(() => [
4183
+ ht(y.$slots, "terms-and-conditions")
4184
+ ]),
4185
+ key: "0"
4186
+ } : void 0
4187
+ ]), 1032, ["configuration"])
4188
+ ];
4189
+ }),
4190
+ _: 3
4191
+ }, 8, ["entry", "component-name"]));
4192
+ }
4193
+ }), { define: rl } = ti(
4194
+ vs,
4195
+ "checkout"
4196
+ );
4197
+ export {
4198
+ Do as F,
4199
+ pa as _,
4200
+ rl as d,
4201
+ ll as g
4202
+ };