@solvimon/solvimon-web 0.1.0-alpha.25 → 0.1.0-alpha.27

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