@solvimon/solvimon-web 0.1.0-alpha.20 → 0.1.0-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (636) hide show
  1. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Co3XAxaY.js +1 -0
  2. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs +223 -0
  3. package/dist/Amount.vue.es-DExaYBqm.js +1 -0
  4. package/dist/Amount.vue.es-DPqHB8Xd.mjs +22 -0
  5. package/dist/Avatar.vue.es-D42J_izE.js +1 -0
  6. package/dist/Avatar.vue.es-DNJ-jexx.mjs +81 -0
  7. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BEVkWJXT.js +1 -0
  8. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-D1uVidXk.mjs +60 -0
  9. package/dist/Button.vue.es-Dz-2L8dJ.mjs +368 -0
  10. package/dist/Button.vue.es-M_jXZda4.js +1 -0
  11. package/dist/Checkout.entry.ce-B5-0AM67.mjs +3747 -0
  12. package/dist/Checkout.entry.ce-C52gkrNZ.js +1 -0
  13. package/dist/Chip.vue.es-DMK9C78d.mjs +114 -0
  14. package/dist/Chip.vue.es-G8doKsZb.js +1 -0
  15. package/dist/Comparators.vue.es-CwhX3rbx.mjs +93 -0
  16. package/dist/Comparators.vue.es-DmkxV0gb.js +1 -0
  17. package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +32 -0
  18. package/dist/ContentWithAsideLayout-C6yMIVJF.js +1 -0
  19. package/dist/ContextMenu.vue.es-B3Rz6Ojk.js +1 -0
  20. package/dist/ContextMenu.vue.es-CzkkNoJG.mjs +573 -0
  21. package/dist/CustomerBillingInformation.vue.es-BmtU9Pk0.js +1 -0
  22. package/dist/CustomerBillingInformation.vue.es-Db6bN2RZ.mjs +153 -0
  23. package/dist/CustomerPaymentMethods.lib-B_753rau.mjs +4 -0
  24. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js +1 -0
  25. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-fESZVyPe.mjs +140 -0
  26. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js +1 -0
  27. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DdMHG1_Y.mjs +2684 -0
  28. package/dist/Divider.vue.es-DnP_HqLz.mjs +22 -0
  29. package/dist/Divider.vue.es-UwnWvUTl.js +1 -0
  30. package/dist/DividerText.vue.es-D-QxT2OD.js +1 -0
  31. package/dist/DividerText.vue.es-IK2fns6f.mjs +56 -0
  32. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js +1 -0
  33. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs +335 -0
  34. package/dist/ErrorNotification.vue.es-BGckEwHf.mjs +31 -0
  35. package/dist/ErrorNotification.vue.es-Cd2UKPAz.js +1 -0
  36. package/dist/Expand.vue.es-BleuAfDz.mjs +32 -0
  37. package/dist/Expand.vue.es-BtM0EZEr.js +1 -0
  38. package/dist/FormMessage.vue.es-dqATjC2N.js +1 -0
  39. package/dist/FormMessage.vue.es-jG3fQZms.mjs +29 -0
  40. package/dist/IconButton.vue.es-BTAkuFsm.js +1 -0
  41. package/dist/IconButton.vue.es-C4dQEQAc.mjs +198 -0
  42. package/dist/IconTitle.vue.es-BmX68uJx.mjs +103 -0
  43. package/dist/IconTitle.vue.es-CmR2xoeu.js +1 -0
  44. package/dist/Input.vue.es-BGPELaZU.mjs +235 -0
  45. package/dist/Input.vue.es-CTOrmrcB.js +1 -0
  46. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CMEOOuSU.mjs +92 -0
  47. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-bheNAKzK.js +1 -0
  48. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-Xo9BR6AD.js +1 -0
  49. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-avhwysNq.mjs +41 -0
  50. package/dist/InvoiceSummary.vue.es-BWLiwlNs.mjs +2585 -0
  51. package/dist/InvoiceSummary.vue.es-hpG8Tq1D.js +1 -0
  52. package/dist/Modal.vue.es-BD4vUaOQ.js +1 -0
  53. package/dist/Modal.vue.es-B_G8NQS2.mjs +387 -0
  54. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-BnilyGBO.mjs +144 -0
  55. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-CSv-Luvz.js +1 -0
  56. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js +1 -0
  57. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DuorCFo9.mjs +51 -0
  58. package/dist/PaymentHistoryBlock-ComJzB3H.mjs +4 -0
  59. package/dist/{PaymentHistoryBlock-Ci8aSJeb.js → PaymentHistoryBlock-DSHW_eW1.js} +1 -1
  60. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DUN0Hf2v.js +1 -0
  61. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-hjtksV2D.mjs +93 -0
  62. package/dist/PaymentIntegrationForm-CH5B6BY5.mjs +4 -0
  63. package/dist/{PaymentIntegrationForm-CsuueDE0.js → PaymentIntegrationForm-CwfCLnKt.js} +1 -1
  64. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BqYk4_T9.mjs +138 -0
  65. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DzSQC951.js +1 -0
  66. package/dist/PaymentIntegrationFormAdyen-DfN7cPYZ.mjs +621 -0
  67. package/dist/PaymentIntegrationFormAdyen-Q48aDXR7.js +98 -0
  68. package/dist/PaymentIntegrationFormStripe-BSEqarl7.js +102 -0
  69. package/dist/PaymentIntegrationFormStripe-CBsXDuhy.mjs +488 -0
  70. package/dist/PaymentMethod.vue.es-D18g-QB4.js +1 -0
  71. package/dist/PaymentMethod.vue.es-DkQdPXfk.mjs +623 -0
  72. package/dist/PaymentMethodForm-CpIZKfPH.mjs +4 -0
  73. package/dist/{PaymentMethodForm-hZuVHAti.js → PaymentMethodForm-DK8ntFA0.js} +1 -1
  74. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-C1tGJsay.mjs +167 -0
  75. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-D7fDguwa.js +1 -0
  76. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs +169 -0
  77. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js +1 -0
  78. package/dist/PlanCustomizationEditor-0zCXN-cv.mjs +877 -0
  79. package/dist/PlanCustomizationEditor-XpofGULc.js +1 -0
  80. package/dist/PricingGroupRangeInput.vue.es-8_5nfZDI.mjs +627 -0
  81. package/dist/PricingGroupRangeInput.vue.es-QnpfHxaY.js +185 -0
  82. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CGJhKKNL.js +1 -0
  83. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-t6h1j6WD.mjs +131 -0
  84. package/dist/RadioGroupExtended.vue.es-C92xlCFQ.mjs +163 -0
  85. package/dist/RadioGroupExtended.vue.es-Cb1iD73r.js +1 -0
  86. package/dist/Section.vue.es-Btff-cLY.js +1 -0
  87. package/dist/Section.vue.es-DQ5H7mqW.mjs +72 -0
  88. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BfvX14E3.js +1 -0
  89. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DKsunuGT.mjs +687 -0
  90. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs +51 -0
  91. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js +1 -0
  92. package/dist/SubscriptionSchedules-Dc0rUnnf.mjs +4 -0
  93. package/dist/SubscriptionSchedules-pzNsego6.js +1 -0
  94. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Brs9qDs5.mjs +5291 -0
  95. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-nmVRb6hj.js +1 -0
  96. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs +91 -0
  97. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js +1 -0
  98. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CFmCJK8M.js +1 -0
  99. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DSoNs7Xx.mjs +284 -0
  100. package/dist/TooltipParagraph.vue.es-BaqCDjl8.js +1 -0
  101. package/dist/TooltipParagraph.vue.es-CIedcXGT.mjs +129 -0
  102. package/dist/TrialChip.vue.es-BzNI94k0.js +1 -0
  103. package/dist/TrialChip.vue.es-DkBuMNr_.mjs +35 -0
  104. package/dist/accel.svg.es-C0hqmmEY.mjs +4 -0
  105. package/dist/accel.svg.es-DFJXdioD.js +1 -0
  106. package/dist/ach.svg.es-BYP873jU.js +1 -0
  107. package/dist/ach.svg.es-DduMiYM2.mjs +4 -0
  108. package/dist/adyen-BJfC7N6f.js +1 -0
  109. package/dist/adyen-Bugab0JE.mjs +4 -0
  110. package/dist/adyen-CvsH5fok.mjs +117 -0
  111. package/dist/adyen-Druit6gz.js +1 -0
  112. package/dist/adyenSdk-B01MB9Ia.mjs +58 -0
  113. package/dist/adyenSdk-BP2XXzeJ.js +1 -0
  114. package/dist/amazon-pay.svg.es-BACIX6C7.mjs +4 -0
  115. package/dist/amazon-pay.svg.es-CQWgtowB.js +1 -0
  116. package/dist/amex.svg.es-DKhW4Txt.js +1 -0
  117. package/dist/amex.svg.es-DjTEMRVg.mjs +4 -0
  118. package/dist/api.es-QaC926Xu.mjs +43 -0
  119. package/dist/api.es-duCDtZD9.js +1 -0
  120. package/dist/apple-pay.svg.es-B3tkA54p.mjs +4 -0
  121. package/dist/apple-pay.svg.es-Dyojd0F-.js +1 -0
  122. package/dist/bacs.svg.es-CZIjZIE8.mjs +4 -0
  123. package/dist/bacs.svg.es-GJpZs1sD.js +1 -0
  124. package/dist/bancontact.svg.es-B26-JwdE.mjs +4 -0
  125. package/dist/bancontact.svg.es-BQh7nAup.js +1 -0
  126. package/dist/carnet.svg.es-BtO3AmNu.mjs +4 -0
  127. package/dist/carnet.svg.es-DY04-F2L.js +1 -0
  128. package/dist/cartes-bancaires.svg.es-BleHMlkN.js +1 -0
  129. package/dist/cartes-bancaires.svg.es-DEPpdLvi.mjs +4 -0
  130. package/dist/cashapp.svg.es-DOGwRjXp.mjs +4 -0
  131. package/dist/cashapp.svg.es-MwXGYom6.js +1 -0
  132. package/dist/{cn.es-BEU5D0Wz.mjs → cn.es-BGqYNPM3.mjs} +657 -927
  133. package/dist/cn.es-CvmLj7KH.js +1 -0
  134. package/dist/comparators.es-D8WGL-c4.mjs +153 -0
  135. package/dist/comparators.es-OGt19O9U.js +1 -0
  136. package/dist/component-5wqcK7yz.mjs +8 -0
  137. package/dist/component-B7ZDyqBp.js +1 -0
  138. package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
  139. package/dist/components/BillingInformation/BillingInformation.mjs +39 -48
  140. package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
  141. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +256 -307
  142. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
  143. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +43 -52
  144. package/dist/components/Invoice/Invoice.cjs +1 -1
  145. package/dist/components/Invoice/Invoice.mjs +372 -430
  146. package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
  147. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +55 -65
  148. package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
  149. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +41 -46
  150. package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
  151. package/dist/components/InvoicesList/InvoicesList.mjs +43 -53
  152. package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
  153. package/dist/components/PaymentHistory/PaymentHistory.mjs +58 -68
  154. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
  155. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +51 -63
  156. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
  157. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +41 -50
  158. package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
  159. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +49 -60
  160. package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
  161. package/dist/components/WalletBalances/WalletBalances.mjs +59 -70
  162. package/dist/configuration-BytDBAWs.mjs +14 -0
  163. package/dist/configuration-akTS7Wiw.js +1 -0
  164. package/dist/core/index.cjs +1 -1
  165. package/dist/core/index.mjs +89 -104
  166. package/dist/{countryData.es--zJAd6LA.mjs → countryData.es-BegoD-cZ.mjs} +2 -2
  167. package/dist/countryData.es-C4jHBzfo.js +1 -0
  168. package/dist/customElements-CSE7dwUr.mjs +6561 -0
  169. package/dist/customElements-Vox1PB6G.js +1211 -0
  170. package/dist/customer-5krPxZ8i.mjs +31 -0
  171. package/dist/customer-Dsq-Moea.js +1 -0
  172. package/dist/customer.es-B5ppZf0j.mjs +20 -0
  173. package/dist/customer.es-BButyYo0.js +1 -0
  174. package/dist/dana.svg.es-BDtZLpwd.js +1 -0
  175. package/dist/dana.svg.es-Cy8Q6DZi.mjs +4 -0
  176. package/dist/dankort.svg.es-B7VqJdWq.mjs +4 -0
  177. package/dist/dankort.svg.es-CksaipXF.js +1 -0
  178. package/dist/{de-DE-_40QfLNJ.js → de-DE-BSlbAnPE.js} +1 -1
  179. package/dist/de-DE-C3DzP1nj.js +1 -0
  180. package/dist/{de-DE-BeyQVhTv.mjs → de-DE-DXsG-vXA.mjs} +46 -59
  181. package/dist/{de-DE-CI2zQkiP.mjs → de-DE-DsFtpLsx.mjs} +7 -5
  182. package/dist/diners.svg.es-BP9enCow.mjs +4 -0
  183. package/dist/diners.svg.es-D6Mu1pqP.js +1 -0
  184. package/dist/discover.svg.es-DEsEJBYh.mjs +4 -0
  185. package/dist/discover.svg.es-DgqWCMUM.js +1 -0
  186. package/dist/eftpos.svg.es--js6-yfk.mjs +4 -0
  187. package/dist/eftpos.svg.es-Dk2DOT8W.js +1 -0
  188. package/dist/elo.svg.es-C-BzjuRP.js +1 -0
  189. package/dist/elo.svg.es-CMZPAxcn.mjs +4 -0
  190. package/dist/{en-US--NRsi7Hz.js → en-US-9xdcz3T5.js} +1 -1
  191. package/dist/{en-US-5YWNEi-V.mjs → en-US-C939IZ5i.mjs} +50 -63
  192. package/dist/{en-US-DksUWPIu.mjs → en-US-DvkvbV0p.mjs} +7 -5
  193. package/dist/en-US-X_pSFsNm.js +1 -0
  194. package/dist/eps.svg.es-B_85bP-W.js +1 -0
  195. package/dist/eps.svg.es-CzIPBSb9.mjs +4 -0
  196. package/dist/error-BHVZJGwD.mjs +13 -0
  197. package/dist/error-CmduqgVq.js +1 -0
  198. package/dist/floating-ui.vue.es-Bly3DGWm.js +1 -0
  199. package/dist/floating-ui.vue.es-CYt0fSY7.mjs +1108 -0
  200. package/dist/formatting.es-C72Nsrmh.js +1 -0
  201. package/dist/formatting.es-RclXHhKo.mjs +61 -0
  202. package/dist/gcash.svg.es-BKAdhWzv.js +1 -0
  203. package/dist/gcash.svg.es-BpDtvraq.mjs +4 -0
  204. package/dist/getComposedString.es-C__uhJpd.mjs +10 -0
  205. package/dist/getComposedString.es-haS4bAj7.js +1 -0
  206. package/dist/getCountryNameByCode.es-BDHua7VM.mjs +8 -0
  207. package/dist/getCountryNameByCode.es-Xxc0nZsH.js +1 -0
  208. package/dist/girocard.svg.es-HSOEvDif.js +1 -0
  209. package/dist/girocard.svg.es-Riswtk8Z.mjs +4 -0
  210. package/dist/go-pay.svg.es-CiIyLELZ.mjs +4 -0
  211. package/dist/go-pay.svg.es-DQjtunZ_.js +1 -0
  212. package/dist/google-pay.svg.es-Dgj_N6nz.mjs +4 -0
  213. package/dist/google-pay.svg.es-hzc_EgiJ.js +1 -0
  214. package/dist/hipercard.svg.es-B80bu8Vd.mjs +4 -0
  215. package/dist/hipercard.svg.es-CbCsRY2q.js +1 -0
  216. package/dist/icon-sprite.svg.es-Bt21fMEt.mjs +4 -0
  217. package/dist/icon-sprite.svg.es-Dauis9LS.js +1 -0
  218. package/dist/ideal.svg.es-Booz1IML.js +1 -0
  219. package/dist/ideal.svg.es-DaqTS2Ax.mjs +4 -0
  220. package/dist/index-BPU8tIml.mjs +828 -0
  221. package/dist/index-BPZPnOQQ.js +7 -0
  222. package/dist/index-CTwLxoOS.mjs +7250 -0
  223. package/dist/index-DwueOtPi.js +1 -0
  224. package/dist/index.cjs +1 -1
  225. package/dist/index.es-BclokHQX.js +1 -0
  226. package/dist/index.es-CXkP_k3u.mjs +345 -0
  227. package/dist/index.mjs +40 -40
  228. package/dist/invoices-DRgfpkJ6.mjs +118 -0
  229. package/dist/invoices-xOV2YaEV.js +1 -0
  230. package/dist/{it-IT-B6blp8MI.mjs → it-IT-BxpwB3oJ.mjs} +46 -59
  231. package/dist/it-IT-DT3rfjOY.js +1 -0
  232. package/dist/{it-IT-CMy1tHKZ.mjs → it-IT-TE7oqvXa.mjs} +7 -5
  233. package/dist/it-IT-YBtHAao1.js +1 -0
  234. package/dist/jcb.svg.es-B3WPB8c2.js +1 -0
  235. package/dist/jcb.svg.es-Couw-2p9.mjs +4 -0
  236. package/dist/kakao-pay.svg.es-CIFT8fob.mjs +4 -0
  237. package/dist/kakao-pay.svg.es-Cs-lCW74.js +1 -0
  238. package/dist/klarna.svg.es-Cs6XaHD7.js +1 -0
  239. package/dist/klarna.svg.es-WKt8_NZa.mjs +4 -0
  240. package/dist/maestro.svg.es-BvK4oPg4.js +1 -0
  241. package/dist/maestro.svg.es-DbdxwYUE.mjs +4 -0
  242. package/dist/mastercard.svg.es-B7T3PS12.mjs +4 -0
  243. package/dist/mastercard.svg.es-lp4AXyyV.js +1 -0
  244. package/dist/momo.svg.es-C5aLYf_R.js +1 -0
  245. package/dist/momo.svg.es-X5XB25fM.mjs +4 -0
  246. package/dist/nl-NL-C8wnyKju.js +1 -0
  247. package/dist/nl-NL-DfkhOJKc.js +1 -0
  248. package/dist/{nl-NL-CckNM7R9.mjs → nl-NL-Di3-JArV.mjs} +7 -5
  249. package/dist/{nl-NL-CjoW8r_M.mjs → nl-NL-na2I4aiP.mjs} +46 -59
  250. package/dist/nyce.svg.es-ArAivAZW.js +1 -0
  251. package/dist/nyce.svg.es-DcPsO_sh.mjs +4 -0
  252. package/dist/object.es-8aLDIncs.mjs +12 -0
  253. package/dist/object.es-CdriXMPs.js +1 -0
  254. package/dist/open-banking.svg.es-C4mPhwsn.mjs +4 -0
  255. package/dist/open-banking.svg.es-Q3rRkCvP.js +1 -0
  256. package/dist/paymentMethods-CRDIw9lz.js +1 -0
  257. package/dist/paymentMethods-PmkHYomw.mjs +75 -0
  258. package/dist/payments-Dvqh6CGW.mjs +45 -0
  259. package/dist/payments-jAgXhdp_.js +1 -0
  260. package/dist/paypal.svg.es-BC2AP20j.mjs +4 -0
  261. package/dist/paypal.svg.es-Cjp5sNI3.js +1 -0
  262. package/dist/pricing-BVAld27Y.js +1 -0
  263. package/dist/pricing-DLOeiAIB.mjs +16 -0
  264. package/dist/pricingItemConfigs.es-D4aYkYcf.js +1 -0
  265. package/dist/pricingItemConfigs.es-ORxsk_YS.mjs +77 -0
  266. package/dist/pricingPlanSchedule-BM8vsKkV.js +1 -0
  267. package/dist/pricingPlanSchedule-BPrS2WRd.mjs +132 -0
  268. package/dist/pulse.svg.es-Dit33E8S.js +1 -0
  269. package/dist/pulse.svg.es-Rmoz-9Ej.mjs +4 -0
  270. package/dist/screens/Checkout/Checkout.cjs +1 -1
  271. package/dist/screens/Checkout/Checkout.mjs +3 -5237
  272. package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
  273. package/dist/screens/CustomerOverview/CustomerOverview.mjs +112 -138
  274. package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
  275. package/dist/screens/PayInvoice/PayInvoice.mjs +348 -397
  276. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
  277. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +153 -170
  278. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
  279. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +609 -720
  280. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
  281. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +466 -555
  282. package/dist/sepa.svg.es-0t4DKeA1.js +1 -0
  283. package/dist/sepa.svg.es-DIO_K345.mjs +4 -0
  284. package/dist/slots.es-BA4MyEAa.mjs +5 -0
  285. package/dist/slots.es-T9ZJRGtG.js +1 -0
  286. package/dist/sorting.es-DCihKqD2.mjs +77 -0
  287. package/dist/sorting.es-DQsjKr8A.js +1 -0
  288. package/dist/star.svg.es-BUZNUnYq.mjs +4 -0
  289. package/dist/star.svg.es-D2JncY7b.js +1 -0
  290. package/dist/subscription-CrVOr5MF.mjs +69 -0
  291. package/dist/subscription-ZA62t4E9.js +1 -0
  292. package/dist/subscriptions-XDyI2Cqm.mjs +55 -0
  293. package/dist/subscriptions-fJcj88X9.js +1 -0
  294. package/dist/trustly.svg.es-AM7Ha-3Y.mjs +4 -0
  295. package/dist/trustly.svg.es-GJByiFAs.js +1 -0
  296. package/dist/twint.svg.es-BJ2f48og.js +1 -0
  297. package/dist/twint.svg.es-DZogAQG6.mjs +4 -0
  298. package/dist/typeGuards.es-B4XMtlkM.mjs +8 -0
  299. package/dist/typeGuards.es-DS3vZaJn.js +1 -0
  300. package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +1 -0
  301. package/dist/types/components/payments/PaymentCompletedCard/PaymentCompletedCard.types.d.ts +6 -0
  302. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +7 -0
  303. package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +2 -1
  304. package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +1 -0
  305. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +6 -0
  306. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +6 -0
  307. package/dist/types/composables/useInvoicePreview.types.d.ts +1 -0
  308. package/dist/types/public/components/Invoice/Invoice.types.d.ts +1 -1
  309. package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +1 -1
  310. package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.types.d.ts +7 -0
  311. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +1 -1
  312. package/dist/unionpay.svg.es-DjFZ5EMQ.js +1 -0
  313. package/dist/unionpay.svg.es-me7q-nTI.mjs +4 -0
  314. package/dist/url-BNKStNY9.js +1 -0
  315. package/dist/url-DwiuKYpu.mjs +20 -0
  316. package/dist/useActionDispatchProvider-B8-oycQk.mjs +11 -0
  317. package/dist/useActionDispatchProvider-CNAuaHdm.js +1 -0
  318. package/dist/useCustomer-CP8eWUZV.mjs +20 -0
  319. package/dist/useCustomer-DSx-wN-6.js +1 -0
  320. package/dist/useCustomerFormLabels-DW6jnDYH.mjs +968 -0
  321. package/dist/useCustomerFormLabels-TVTgy0MT.js +1 -0
  322. package/dist/useExperimentalFeature-BvE_EOX-.mjs +6 -0
  323. package/dist/useExperimentalFeature-CC-DrIcL.js +1 -0
  324. package/dist/useIncrementalLoading-CaWOE8Xl.js +1 -0
  325. package/dist/useIncrementalLoading-Cgxw2GD7.mjs +48 -0
  326. package/dist/useInvoiceData-CRRPdXc6.js +1 -0
  327. package/dist/useInvoiceData-D8ds05CX.mjs +38 -0
  328. package/dist/useInvoicesList-DIfQcvER.js +1 -0
  329. package/dist/useInvoicesList-SJU5YWBQ.mjs +500 -0
  330. package/dist/useLoadInitialData-DsabgMLZ.js +1 -0
  331. package/dist/useLoadInitialData-MUljS38K.mjs +15 -0
  332. package/dist/usePaymentMethodAvailability-Bt7P9InI.js +1 -0
  333. package/dist/usePaymentMethodAvailability-D0NUanyF.mjs +118 -0
  334. package/dist/usePaymentMethodOptions-B7JYkGsw.mjs +37 -0
  335. package/dist/usePaymentMethodOptions-cT1o-BA1.js +1 -0
  336. package/dist/usePaymentMethods-CpzqXQUT.mjs +15 -0
  337. package/dist/usePaymentMethods-DNVw2eVg.js +1 -0
  338. package/dist/usePayments-D9Eo-uBk.js +1 -0
  339. package/dist/usePayments-Gx9kBvNB.mjs +318 -0
  340. package/dist/usePortal-3VCZwSUE.mjs +11 -0
  341. package/dist/usePortal-DsebXdhx.js +1 -0
  342. package/dist/useService-Bh47bllz.mjs +50 -0
  343. package/dist/useService-H7BjLg8P.js +1 -0
  344. package/dist/useSubscription-DnL1wVh1.mjs +210 -0
  345. package/dist/useSubscription-K_gP9TeX.js +1 -0
  346. package/dist/useTimePeriod.es-CmltiTE-.js +1 -0
  347. package/dist/useTimePeriod.es-DMtKzcoB.mjs +93 -0
  348. package/dist/useViewport-BgdA2PPt.mjs +29 -0
  349. package/dist/useViewport-hPRVDWCm.js +1 -0
  350. package/dist/useWatchDebounced-CAU1WI1P.js +1 -0
  351. package/dist/useWatchDebounced-DT5IicPp.mjs +14 -0
  352. package/dist/visa.svg.es-B0T5Su99.mjs +4 -0
  353. package/dist/visa.svg.es-NY3BHhda.js +1 -0
  354. package/dist/vpay.svg.es-VViQi42w.js +1 -0
  355. package/dist/vpay.svg.es-Zt3rrmCy.mjs +4 -0
  356. package/dist/wallets.es-CNIMW5ay.js +1 -0
  357. package/dist/wallets.es-eH2C2ygn.mjs +102 -0
  358. package/dist/zip.svg.es-C9S_F31W.js +1 -0
  359. package/dist/zip.svg.es-QC6dxzC7.mjs +4 -0
  360. package/package.json +3 -3
  361. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Ce30EXY5.mjs +0 -240
  362. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-kmam2c7P.js +0 -1
  363. package/dist/Amount.vue.es-BO5sS1UX.mjs +0 -25
  364. package/dist/Amount.vue.es-JDVa_3H-.js +0 -1
  365. package/dist/Avatar.vue.es-BGTZSAqU.js +0 -1
  366. package/dist/Avatar.vue.es-DJzJiYtv.mjs +0 -91
  367. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-Bq2mTdUs.mjs +0 -66
  368. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BtNTRSqH.js +0 -1
  369. package/dist/Button.vue.es-Cm9pLU9i.mjs +0 -421
  370. package/dist/Button.vue.es-O8mNivLL.js +0 -1
  371. package/dist/Chip.vue.es-BBmn-qJp.mjs +0 -120
  372. package/dist/Chip.vue.es-DmCjC1hi.js +0 -1
  373. package/dist/Comparators.vue.es-CYfxd5H-.mjs +0 -120
  374. package/dist/Comparators.vue.es-DK8wGjxM.js +0 -1
  375. package/dist/ContentWithAsideLayout-DHpnJfGA.js +0 -1
  376. package/dist/ContentWithAsideLayout-Dy9xgxuF.mjs +0 -39
  377. package/dist/ContextMenu.vue.es-CTc1ktXb.mjs +0 -681
  378. package/dist/ContextMenu.vue.es-DaW0yp4Y.js +0 -1
  379. package/dist/CustomerBillingInformation.vue.es-BX0Da7Kr.js +0 -1
  380. package/dist/CustomerBillingInformation.vue.es-CMZO8oLj.mjs +0 -175
  381. package/dist/CustomerPaymentMethods.lib-CcSt0sl1.mjs +0 -4
  382. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bi_dCntQ.js +0 -1
  383. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CtdFharm.mjs +0 -150
  384. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BDqBXbJq.mjs +0 -3264
  385. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-ZyN2vlNu.js +0 -1
  386. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  387. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  388. package/dist/DividerText.vue.es-CeAHAe_Y.mjs +0 -72
  389. package/dist/DividerText.vue.es-DjT4i_YD.js +0 -1
  390. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DLE5-9wz.mjs +0 -562
  391. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DkIK-lID.js +0 -1
  392. package/dist/ErrorNotification.vue.es-CHyVTBGs.mjs +0 -38
  393. package/dist/ErrorNotification.vue.es-CaEFTi2k.js +0 -1
  394. package/dist/Expand.vue.es-C-lnbA1v.js +0 -1
  395. package/dist/Expand.vue.es-C4_XmqbR.mjs +0 -50
  396. package/dist/FormMessage.vue.es-Bd4_NG9H.js +0 -1
  397. package/dist/FormMessage.vue.es-C3oxwq_8.mjs +0 -46
  398. package/dist/IconButton.vue.es-BHdQskx0.js +0 -1
  399. package/dist/IconButton.vue.es-KywqWWvr.mjs +0 -228
  400. package/dist/IconTitle.vue.es-BmjBdZb_.mjs +0 -107
  401. package/dist/IconTitle.vue.es-D9Wc3PIq.js +0 -1
  402. package/dist/Input.vue.es-DqKJhFTr.js +0 -1
  403. package/dist/Input.vue.es-WZGF8dfr.mjs +0 -251
  404. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B6efz7NU.mjs +0 -97
  405. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-LE6zBLKM.js +0 -1
  406. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-C2aLMfu6.mjs +0 -49
  407. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-CtpFzWU3.js +0 -1
  408. package/dist/InvoiceSummary.vue.es-BI5sD_8F.mjs +0 -2944
  409. package/dist/InvoiceSummary.vue.es-BWYIHezU.js +0 -1
  410. package/dist/Modal.vue.es-B_1aqm_m.js +0 -1
  411. package/dist/Modal.vue.es-qdUHDOnU.mjs +0 -483
  412. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-BKKXQbge.js +0 -1
  413. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-Ch1TFO7x.mjs +0 -154
  414. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CsH47WSM.mjs +0 -54
  415. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-mKNNYnMU.js +0 -1
  416. package/dist/PaymentHistoryBlock-CgNUV8Gy.mjs +0 -4
  417. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DZwnDzha.js +0 -1
  418. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Uj1aK-dp.mjs +0 -101
  419. package/dist/PaymentIntegrationForm-CLokpXvK.mjs +0 -4
  420. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CRUs7sP4.mjs +0 -167
  421. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-kKkzRi6w.js +0 -1
  422. package/dist/PaymentIntegrationFormAdyen-C885o8IE.mjs +0 -699
  423. package/dist/PaymentIntegrationFormAdyen-Co19AgvG.js +0 -1
  424. package/dist/PaymentIntegrationFormStripe-BjMdJmDC.mjs +0 -547
  425. package/dist/PaymentIntegrationFormStripe-DWff6wzK.js +0 -1
  426. package/dist/PaymentMethod.vue.es-CdskNJ3Z.js +0 -1
  427. package/dist/PaymentMethod.vue.es-rv-pu1CC.mjs +0 -677
  428. package/dist/PaymentMethodForm-IEuDxEPN.mjs +0 -4
  429. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-Cj60U90J.js +0 -1
  430. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-gA74Rak9.mjs +0 -172
  431. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-B3H_AWMM.js +0 -1
  432. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-CTn-OxM6.mjs +0 -189
  433. package/dist/PricingGroupRangeInput.vue.es-ButaePib.mjs +0 -632
  434. package/dist/PricingGroupRangeInput.vue.es-Cls2lm80.js +0 -1
  435. package/dist/Section.vue.es-CAJvEDn6.js +0 -1
  436. package/dist/Section.vue.es-DX_9ueCG.mjs +0 -79
  437. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CQAkPfJz.js +0 -1
  438. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DVtMzgjc.mjs +0 -1044
  439. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs +0 -78
  440. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +0 -1
  441. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BJVXCHny.js +0 -1
  442. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-ByO-L6nm.mjs +0 -6171
  443. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-C5zB3CgZ.mjs +0 -101
  444. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-CabskT-r.js +0 -1
  445. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D-T1wGg7.js +0 -1
  446. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DKd2DIVb.mjs +0 -309
  447. package/dist/TooltipParagraph.vue.es-C5RTcrid.mjs +0 -136
  448. package/dist/TooltipParagraph.vue.es-H9fI7zzt.js +0 -1
  449. package/dist/TrialChip.vue.es-B1puKyR-.mjs +0 -56
  450. package/dist/TrialChip.vue.es-CCs50m02.js +0 -1
  451. package/dist/accel.svg.es-CE5tIWtm.mjs +0 -4
  452. package/dist/accel.svg.es-Dt_1wJmV.js +0 -1
  453. package/dist/ach.svg.es-B4tn0_IV.js +0 -1
  454. package/dist/ach.svg.es-D4QPcIU-.mjs +0 -4
  455. package/dist/adyen-51SvcyqV.mjs +0 -4
  456. package/dist/adyen-BXi_D9TQ.mjs +0 -123
  457. package/dist/adyen-DZsyEXkw.js +0 -1
  458. package/dist/adyen-VS2sDW0m.js +0 -1
  459. package/dist/amazon-pay.svg.es-B428S4f3.js +0 -1
  460. package/dist/amazon-pay.svg.es-DUScOW15.mjs +0 -4
  461. package/dist/amex.svg.es-BCXkaVLN.mjs +0 -4
  462. package/dist/amex.svg.es-Bn9e31C3.js +0 -1
  463. package/dist/api.es-C5pe8LUl.mjs +0 -62
  464. package/dist/api.es-Czekkp_X.js +0 -1
  465. package/dist/apple-pay.svg.es-Cfgn0K28.js +0 -1
  466. package/dist/apple-pay.svg.es-DlCfkt39.mjs +0 -4
  467. package/dist/bacs.svg.es-BKsvSeIP.mjs +0 -4
  468. package/dist/bacs.svg.es-hL7hLPkQ.js +0 -1
  469. package/dist/bancontact.svg.es-BbRqGgZ9.mjs +0 -4
  470. package/dist/bancontact.svg.es-DU2ejvNL.js +0 -1
  471. package/dist/carnet.svg.es-C5SFaOsa.js +0 -1
  472. package/dist/carnet.svg.es-Db-KEb13.mjs +0 -4
  473. package/dist/cartes-bancaires.svg.es-ByD-JAAi.mjs +0 -4
  474. package/dist/cartes-bancaires.svg.es-CbBJQZrk.js +0 -1
  475. package/dist/cashapp.svg.es-CnS5r_D8.mjs +0 -4
  476. package/dist/cashapp.svg.es-DE4vMu_p.js +0 -1
  477. package/dist/cn.es-DxSeYcoP.js +0 -1
  478. package/dist/comparators.es-9VsCB-JI.mjs +0 -175
  479. package/dist/comparators.es-wrKHduVq.js +0 -1
  480. package/dist/component-BG6DmXcy.mjs +0 -9
  481. package/dist/component-hDuDTBt5.js +0 -1
  482. package/dist/configuration-BjYwV4_B.js +0 -1
  483. package/dist/configuration-CD8cOXAJ.mjs +0 -15
  484. package/dist/countryData.es-D3MFzU92.js +0 -1
  485. package/dist/customElements-B-89a5oH.mjs +0 -6810
  486. package/dist/customElements-DD7bpqkx.js +0 -1
  487. package/dist/customer-DozNwS_a.js +0 -1
  488. package/dist/customer-Dzj1g9lV.mjs +0 -32
  489. package/dist/customer.es-C_vSWcVA.mjs +0 -30
  490. package/dist/customer.es-D42Md24r.js +0 -1
  491. package/dist/dana.svg.es-Bbn6_ktN.mjs +0 -4
  492. package/dist/dana.svg.es-DKZaseoJ.js +0 -1
  493. package/dist/dankort.svg.es-D8FgSiFf.js +0 -1
  494. package/dist/dankort.svg.es-DtAdliQq.mjs +0 -4
  495. package/dist/de-DE-BvHD68Ay.js +0 -1
  496. package/dist/diners.svg.es-DhchsD1D.mjs +0 -4
  497. package/dist/diners.svg.es-SydF_H-Z.js +0 -1
  498. package/dist/discover.svg.es-B8vgzVNG.js +0 -1
  499. package/dist/discover.svg.es-BnqYPvnV.mjs +0 -4
  500. package/dist/eftpos.svg.es-DO0YPaY1.js +0 -1
  501. package/dist/eftpos.svg.es-DRLaafYa.mjs +0 -4
  502. package/dist/elo.svg.es-CTOm1rvj.js +0 -1
  503. package/dist/elo.svg.es-CgkEOP_O.mjs +0 -4
  504. package/dist/en-US-dqfKx3GS.js +0 -1
  505. package/dist/eps.svg.es-CApyGjyU.js +0 -1
  506. package/dist/eps.svg.es-D6IHsRYP.mjs +0 -4
  507. package/dist/error-Cg-i7gGl.js +0 -1
  508. package/dist/error-DY_I2hPx.mjs +0 -13
  509. package/dist/floating-ui.vue.es-Bv94BfDm.js +0 -1
  510. package/dist/floating-ui.vue.es-DWY7pdz8.mjs +0 -1573
  511. package/dist/formatting.es-DBtYnvI5.js +0 -1
  512. package/dist/formatting.es-eYgXv_AK.mjs +0 -70
  513. package/dist/gcash.svg.es-BhJ-eA2z.mjs +0 -4
  514. package/dist/gcash.svg.es-JaL4fpZr.js +0 -1
  515. package/dist/getComposedString.es-CELkn0I7.mjs +0 -14
  516. package/dist/getComposedString.es-DvSNX-_z.js +0 -1
  517. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  518. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  519. package/dist/girocard.svg.es-D_3LML4l.mjs +0 -4
  520. package/dist/girocard.svg.es-tVgtT23w.js +0 -1
  521. package/dist/go-pay.svg.es-6UtgwVBA.mjs +0 -4
  522. package/dist/go-pay.svg.es-fYX6yMzJ.js +0 -1
  523. package/dist/google-pay.svg.es-BYXX1em8.js +0 -1
  524. package/dist/google-pay.svg.es-CRxXgFVl.mjs +0 -4
  525. package/dist/hipercard.svg.es-Ct1-mF9F.mjs +0 -4
  526. package/dist/hipercard.svg.es-D-nmiFXB.js +0 -1
  527. package/dist/icon-sprite.svg.es-BpwT0GQ5.js +0 -1
  528. package/dist/icon-sprite.svg.es-YYqtl2IP.mjs +0 -4
  529. package/dist/ideal.svg.es-D23EhJJ2.mjs +0 -4
  530. package/dist/ideal.svg.es-DXtHE0Jb.js +0 -1
  531. package/dist/index-Cai7laNY.mjs +0 -1069
  532. package/dist/index-DIFK3mcJ.js +0 -6
  533. package/dist/index-DyvRdSR7.mjs +0 -9673
  534. package/dist/index-IZaUTAsE.js +0 -1
  535. package/dist/index.es-2JWHHSgP.js +0 -1
  536. package/dist/index.es-D5xOw_SJ.mjs +0 -542
  537. package/dist/invoices-1oYkdQQV.mjs +0 -121
  538. package/dist/invoices-BAoh6X2a.js +0 -1
  539. package/dist/it-IT-CEP3oeWs.js +0 -1
  540. package/dist/it-IT-aPQY57ht.js +0 -1
  541. package/dist/jcb.svg.es-Bz6J-c0s.js +0 -1
  542. package/dist/jcb.svg.es-CcH08OoO.mjs +0 -4
  543. package/dist/kakao-pay.svg.es-DcgRDAsc.mjs +0 -4
  544. package/dist/kakao-pay.svg.es-qVTABboW.js +0 -1
  545. package/dist/klarna.svg.es-Clu-7zkp.js +0 -1
  546. package/dist/klarna.svg.es-DfIPX0gr.mjs +0 -4
  547. package/dist/maestro.svg.es-CVmNVokN.mjs +0 -4
  548. package/dist/maestro.svg.es-e8E_H2QU.js +0 -1
  549. package/dist/mastercard.svg.es-B8z0ZySS.mjs +0 -4
  550. package/dist/mastercard.svg.es-YO3_jGD6.js +0 -1
  551. package/dist/momo.svg.es-BXTQlQRy.js +0 -1
  552. package/dist/momo.svg.es-Bm5zCTOT.mjs +0 -4
  553. package/dist/nl-NL-e_vf6OuT.js +0 -1
  554. package/dist/nl-NL-zRUAuEHg.js +0 -1
  555. package/dist/nyce.svg.es-CgurqLKH.mjs +0 -4
  556. package/dist/nyce.svg.es-DM6esO47.js +0 -1
  557. package/dist/object.es-DFXiU9p3.js +0 -1
  558. package/dist/object.es-jvvnR8Kr.mjs +0 -12
  559. package/dist/open-banking.svg.es-DUM360xB.js +0 -1
  560. package/dist/open-banking.svg.es-DzzLCVp_.mjs +0 -4
  561. package/dist/paymentMethods-CZ3ydybI.js +0 -1
  562. package/dist/paymentMethods-DIV78w0O.mjs +0 -78
  563. package/dist/payments--lkjiwCt.js +0 -1
  564. package/dist/payments-Cvqdrprv.mjs +0 -47
  565. package/dist/paypal.svg.es-BdkNTf3c.js +0 -1
  566. package/dist/paypal.svg.es-DltWzW4V.mjs +0 -4
  567. package/dist/pricing-3W7XLwL6.js +0 -1
  568. package/dist/pricing-CJxS2hr2.mjs +0 -17
  569. package/dist/pricingItemConfigs.es-BPIm6S8M.mjs +0 -107
  570. package/dist/pricingItemConfigs.es-C73cQlxQ.js +0 -1
  571. package/dist/pricingPlanSchedule-B9HFiXy-.js +0 -1
  572. package/dist/pricingPlanSchedule-CXG3CQ61.mjs +0 -146
  573. package/dist/pulse.svg.es-BdpWAuIN.js +0 -1
  574. package/dist/pulse.svg.es-BecAwT-p.mjs +0 -4
  575. package/dist/sepa.svg.es-BF8PYKZg.js +0 -1
  576. package/dist/sepa.svg.es-cbE9g8gV.mjs +0 -4
  577. package/dist/slots.es-BpwYO3A3.mjs +0 -18
  578. package/dist/slots.es-Dq1PTUOv.js +0 -1
  579. package/dist/sorting.es-CjTrRfSW.mjs +0 -105
  580. package/dist/sorting.es-RyvcgbSL.js +0 -1
  581. package/dist/star.svg.es-DsCD-tSp.mjs +0 -4
  582. package/dist/star.svg.es-Q50IzqXr.js +0 -1
  583. package/dist/subscription-C41lG-rH.mjs +0 -89
  584. package/dist/subscription-b0OPx8Du.js +0 -1
  585. package/dist/subscriptions-300o4ae0.js +0 -1
  586. package/dist/subscriptions-DcMHBPVJ.mjs +0 -58
  587. package/dist/trustly.svg.es-C0Ou1HWk.mjs +0 -4
  588. package/dist/trustly.svg.es-CHojqNqm.js +0 -1
  589. package/dist/twint.svg.es-CQ-ZDfy8.js +0 -1
  590. package/dist/twint.svg.es-WrZYquRs.mjs +0 -4
  591. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  592. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  593. package/dist/unionpay.svg.es-DYgo83Hf.mjs +0 -4
  594. package/dist/unionpay.svg.es-YqJKKFEj.js +0 -1
  595. package/dist/url-CjULBkjW.js +0 -1
  596. package/dist/url-CvNDq4wp.mjs +0 -22
  597. package/dist/useActionDispatchProvider-BVOBO0Jx.mjs +0 -12
  598. package/dist/useActionDispatchProvider-Cv9amjTf.js +0 -1
  599. package/dist/useCustomer-DLHOs4BR.js +0 -1
  600. package/dist/useCustomer-EDhref7T.mjs +0 -25
  601. package/dist/useCustomerFormLabels-B61-4xQ7.mjs +0 -1168
  602. package/dist/useCustomerFormLabels-C6wW4n2e.js +0 -1
  603. package/dist/useExperimentalFeature-0yFoaEzV.js +0 -1
  604. package/dist/useExperimentalFeature-DvxOrFPU.mjs +0 -9
  605. package/dist/useIncrementalLoading-BK9pRYAU.mjs +0 -71
  606. package/dist/useIncrementalLoading-CdtGJm_Y.js +0 -1
  607. package/dist/useInvoiceData-BSjVeJrI.js +0 -1
  608. package/dist/useInvoiceData-C0Y5WrbT.mjs +0 -45
  609. package/dist/useInvoicesList-BRDZqsaB.js +0 -1
  610. package/dist/useInvoicesList-CYoE7q0u.mjs +0 -580
  611. package/dist/useLoadInitialData-Cp1OA8y6.mjs +0 -18
  612. package/dist/useLoadInitialData-u7IyXqb6.js +0 -1
  613. package/dist/usePaymentMethodAvailability-B3s1lqQ2.js +0 -1
  614. package/dist/usePaymentMethodAvailability-EuhZPghG.mjs +0 -141
  615. package/dist/usePaymentMethodOptions--8QpMvNm.js +0 -1
  616. package/dist/usePaymentMethodOptions-Cljh7HYp.mjs +0 -36
  617. package/dist/usePaymentMethods-BJzoI8dZ.mjs +0 -16
  618. package/dist/usePaymentMethods-DvEnJWmB.js +0 -1
  619. package/dist/usePayments-CANj0QVc.js +0 -1
  620. package/dist/usePayments-CaT1CBzE.mjs +0 -362
  621. package/dist/usePortal-BjGoSeLy.js +0 -1
  622. package/dist/usePortal-CMPQ0M9R.mjs +0 -12
  623. package/dist/useService-D73FNBjT.js +0 -1
  624. package/dist/useService-W3Kxems4.mjs +0 -72
  625. package/dist/useSubscription-D1UKnZAx.mjs +0 -250
  626. package/dist/useSubscription-DZfRHbL7.js +0 -1
  627. package/dist/useViewport-Bu0cyeSi.mjs +0 -38
  628. package/dist/useViewport-CKRY1CKR.js +0 -1
  629. package/dist/useWatchDebounced-C_YxgoQ6.js +0 -1
  630. package/dist/useWatchDebounced-Zmxd6InB.mjs +0 -16
  631. package/dist/visa.svg.es-B6aU_qRs.mjs +0 -4
  632. package/dist/visa.svg.es-D6sc4YTE.js +0 -1
  633. package/dist/vpay.svg.es-4qIqS4aX.mjs +0 -4
  634. package/dist/vpay.svg.es-CLGTyB09.js +0 -1
  635. package/dist/zip.svg.es-3PzSBe1E.mjs +0 -4
  636. package/dist/zip.svg.es-BRsgmur-.js +0 -1
@@ -0,0 +1,2684 @@
1
+ import { defineComponent as z, ref as E, onMounted as xt, onBeforeUnmount as Pe, computed as s, openBlock as w, createBlock as C, withCtx as h, createElementVNode as k, toDisplayString as N, createVNode as A, createTextVNode as F, createElementBlock as W, unref as r, createCommentVNode as R, renderSlot as se, createSlots as re, Fragment as ge, renderList as he, useModel as $t, watch as ee, isRef as Et, mergeModels as Ot, mergeProps as le, reactive as Ae, normalizeClass as ze, withModifiers as Ne, normalizeStyle as ke } from "vue";
2
+ import { w as Bt } from "./api.es-QaC926Xu.mjs";
3
+ import { u as Q, _ as X, c as Qe, a as Ge, b as _e, g as It } from "./customElements-CSE7dwUr.mjs";
4
+ import { E as Dt } from "./component-5wqcK7yz.mjs";
5
+ import { u as Nt } from "./useService-Bh47bllz.mjs";
6
+ import { _ as Ke } from "./ErrorNotification.vue.es-BGckEwHf.mjs";
7
+ import { i as kt, a as Me, h as Rt } from "./pricingItemConfigs.es-ORxsk_YS.mjs";
8
+ import { b as Ce } from "./wallets.es-eH2C2ygn.mjs";
9
+ import { _ as ue, a as Vt } from "./Button.vue.es-Dz-2L8dJ.mjs";
10
+ import { _ as Xe, T as Je, a as Ze } from "./TooltipParagraph.vue.es-CIedcXGT.mjs";
11
+ import { _ as fe } from "./Section.vue.es-DQ5H7mqW.mjs";
12
+ import { _ as et } from "./Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
13
+ import { _ as tt } from "./RadioGroupExtended.vue.es-C92xlCFQ.mjs";
14
+ import { u as xe, c as ie, _ as qt, a as Ft, r as ot } from "./index-BPU8tIml.mjs";
15
+ import { f as $e } from "./formatting.es-RclXHhKo.mjs";
16
+ import { _ as Lt } from "./Divider.vue.es-DnP_HqLz.mjs";
17
+ import { _ as nt } from "./Expand.vue.es-BleuAfDz.mjs";
18
+ import { a as at } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs";
19
+ import { _ as Yt } from "./cn.es-BGqYNPM3.mjs";
20
+ import { c as it } from "./invoices-DRgfpkJ6.mjs";
21
+ import { u as Ht } from "./useWatchDebounced-DT5IicPp.mjs";
22
+ import { _ as Wt } from "./Input.vue.es-BGPELaZU.mjs";
23
+ import { _ as st, a as jt } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs";
24
+ import { _ as zt } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs";
25
+ import { g as Qt } from "./customer.es-B5ppZf0j.mjs";
26
+ import { u as Gt } from "./usePaymentMethodOptions-B7JYkGsw.mjs";
27
+ import { M as lt } from "./Modal.vue.es-B_G8NQS2.mjs";
28
+ const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
29
+ __name: "DateTimeAgo",
30
+ props: {
31
+ date: {},
32
+ actionVerb: {}
33
+ },
34
+ setup(e) {
35
+ const t = 60 * we, o = 24 * t, n = e, { $t: a, formatDate: i } = Q(), u = E(Date.now());
36
+ let l;
37
+ xt(() => {
38
+ l = setInterval(() => {
39
+ u.value = Date.now();
40
+ }, Kt);
41
+ }), Pe(() => {
42
+ clearInterval(l);
43
+ });
44
+ const p = (v, g) => {
45
+ const m = (g.getFullYear() - v.getFullYear()) * Te + (g.getMonth() - v.getMonth());
46
+ return g.getDate() < v.getDate() ? m - 1 : m;
47
+ }, y = s(() => {
48
+ const v = Math.max(0, (u.value - n.date.getTime()) / 1e3);
49
+ if (v < we)
50
+ return a(
51
+ {
52
+ defaultMessage: "{count, plural, one {# second} other {# seconds}} ago",
53
+ id: "dateTimeAgo.seconds",
54
+ description: "Relative time in whole seconds"
55
+ },
56
+ { count: Math.trunc(v) }
57
+ );
58
+ if (v < t)
59
+ return a(
60
+ {
61
+ defaultMessage: "{count, plural, one {# minute} other {# minutes}} ago",
62
+ id: "dateTimeAgo.minutes",
63
+ description: "Relative time in whole minutes"
64
+ },
65
+ { count: Math.trunc(v / we) }
66
+ );
67
+ if (v < o)
68
+ return a(
69
+ {
70
+ defaultMessage: "{count, plural, one {# hour} other {# hours}} ago",
71
+ id: "dateTimeAgo.hours",
72
+ description: "Relative time in whole hours"
73
+ },
74
+ { count: Math.trunc(v / t) }
75
+ );
76
+ const g = p(n.date, new Date(u.value));
77
+ if (g < 1) {
78
+ const m = Math.trunc(v / o);
79
+ return m === 1 ? a({
80
+ defaultMessage: "yesterday",
81
+ id: "dateTimeAgo.yesterday",
82
+ description: 'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'
83
+ }) : a(
84
+ {
85
+ defaultMessage: "{count, plural, one {# day} other {# days}} ago",
86
+ id: "dateTimeAgo.days",
87
+ description: "Relative time in whole days"
88
+ },
89
+ { count: m }
90
+ );
91
+ }
92
+ return g < Te ? a(
93
+ {
94
+ defaultMessage: "{count, plural, one {# month} other {# months}} ago",
95
+ id: "dateTimeAgo.months",
96
+ description: "Relative time in whole months"
97
+ },
98
+ { count: g }
99
+ ) : a(
100
+ {
101
+ defaultMessage: "{count, plural, one {# year} other {# years}} ago",
102
+ id: "dateTimeAgo.years",
103
+ description: "Relative time in whole years"
104
+ },
105
+ { count: Math.trunc(g / Te) }
106
+ );
107
+ }), T = s(
108
+ () => n.actionVerb ? `${n.actionVerb} ${y.value}` : y.value
109
+ ), x = s(
110
+ () => i({ date: n.date, format: "dateTime", offsetType: "local" })
111
+ );
112
+ return (v, g) => (w(), C(Xe, null, {
113
+ tooltip: h(() => [
114
+ A(Je, null, {
115
+ default: h(() => [
116
+ A(Ze, null, {
117
+ default: h(() => [
118
+ F(N(x.value), 1)
119
+ ]),
120
+ _: 1
121
+ })
122
+ ]),
123
+ _: 1
124
+ })
125
+ ]),
126
+ default: h(() => [
127
+ k("span", null, N(T.value), 1)
128
+ ]),
129
+ _: 1
130
+ }));
131
+ }
132
+ }), Jt = (e) => {
133
+ const { $t: t, formatNumber: o } = Q(), n = (_) => Ce(t, o, _), a = s(
134
+ () => {
135
+ var _, S;
136
+ return ((S = (_ = e.walletBalance.wallet) == null ? void 0 : _.wallet_type) == null ? void 0 : S.name) || t({
137
+ defaultMessage: "Balance",
138
+ id: "wallet_balance.balance_label",
139
+ description: "Label shown above a wallet's balance amount"
140
+ });
141
+ }
142
+ ), i = (_) => {
143
+ var S;
144
+ return (((S = _.pricing_item) == null ? void 0 : S.configs) ?? []).filter((f) => !!f.on_demand);
145
+ }, u = s(
146
+ () => (e.walletBalance.charge_on_demand_pricing_items ?? []).filter(
147
+ (_) => i(_).some(
148
+ (S) => kt(S) || Me(S)
149
+ )
150
+ )
151
+ ), l = s(
152
+ () => u.value.find(
153
+ (_) => i(_).some((S) => Me(S))
154
+ )
155
+ ), p = s(
156
+ () => !!e.showManualTopUp && u.value.length > 0
157
+ ), y = s(() => !!e.showAutoTopUp && !!l.value), T = s(
158
+ () => {
159
+ var _, S;
160
+ return (S = (_ = e.walletBalance.wallet) == null ? void 0 : _.auto_top_up_configs) == null ? void 0 : S.find(
161
+ (f) => f.status === "ACTIVE"
162
+ );
163
+ }
164
+ ), x = s(
165
+ () => {
166
+ var _, S;
167
+ return (S = (_ = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : _.credits) == null ? void 0 : S.credit_type;
168
+ }
169
+ ), v = (_, S) => n({
170
+ credits: {
171
+ quantity: _,
172
+ credit_type_id: S,
173
+ credit_type: x.value
174
+ }
175
+ }), g = (_) => _.amount ? n({ amount: _.amount }) : _.credits ? v(_.credits.quantity, _.credits.credit_type_id) : "", m = s(() => {
176
+ var _, S;
177
+ const f = (_ = T.value) == null ? void 0 : _.pricing_item_id;
178
+ if (!f)
179
+ return;
180
+ const P = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((D) => D.pricing_item_id === f).flatMap((D) => i(D)).flatMap((D) => D.wallet_grants ?? []), O = (S = e.walletBalance.wallet) == null ? void 0 : S.wallet_type_id;
181
+ return P.find((D) => D.wallet_type_id === O) ?? P[0];
182
+ }), U = s(() => {
183
+ var _, S;
184
+ const f = (_ = T.value) == null ? void 0 : _.topup_amount, P = (S = m.value) == null ? void 0 : S.credits_grant;
185
+ if (!f || !P)
186
+ return "";
187
+ if (P.credits)
188
+ return v(
189
+ P.credits.quantity,
190
+ P.credits.credit_type_id
191
+ );
192
+ if (P.conversion) {
193
+ const O = Number(f.quantity) * Number(P.conversion.rate);
194
+ return v(String(O), P.conversion.credit_type_id);
195
+ }
196
+ return "";
197
+ }), I = s(
198
+ () => T.value ? t({
199
+ defaultMessage: "Auto top-up enabled",
200
+ id: "wallet_balance.auto_top_up_enabled_label",
201
+ description: "Label shown when a wallet tops itself up automatically"
202
+ }) : t({
203
+ defaultMessage: "No auto top-up enabled",
204
+ id: "wallet_balance.auto_top_up_disabled_label",
205
+ description: "Label shown when a wallet has no automatic top-up configured"
206
+ })
207
+ ), G = s(() => {
208
+ const _ = T.value;
209
+ if (!_)
210
+ return t({
211
+ defaultMessage: "Set up an automatic top-up and your balance is increased for you whenever it drops below an amount you choose, so you never run out.",
212
+ id: "wallet_balance.auto_top_up_setup_explanation",
213
+ description: "Tooltip explaining what automatic top-ups do, shown when none is configured yet"
214
+ });
215
+ const S = _.topup_amount ? n({ amount: _.topup_amount }) : "", f = g(_.threshold);
216
+ return !S || !f ? t({
217
+ defaultMessage: "Your balance is topped up automatically once it runs low.",
218
+ id: "wallet_balance.auto_top_up_generic_explanation",
219
+ description: "Tooltip shown for an active automatic top-up whose amount or threshold is unknown"
220
+ }) : U.value ? t(
221
+ {
222
+ defaultMessage: "Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",
223
+ id: "wallet_balance.auto_top_up_credits_explanation",
224
+ description: "Tooltip explaining an automatic top-up that grants credits for a paid amount"
225
+ },
226
+ { topUpCredits: U.value, topUpAmount: S, threshold: f }
227
+ ) : t(
228
+ {
229
+ defaultMessage: "Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",
230
+ id: "wallet_balance.auto_top_up_explanation",
231
+ description: "Tooltip explaining how the automatic top-up of a wallet balance works"
232
+ },
233
+ { topUpAmount: S, threshold: f }
234
+ );
235
+ });
236
+ return {
237
+ walletName: a,
238
+ formatBalance: n,
239
+ manualTopUpItems: u,
240
+ flexibleManualTopUpItem: l,
241
+ showManualTopUp: p,
242
+ showAutoTopUp: y,
243
+ activeTopUpConfig: T,
244
+ autoTopUpLabel: I,
245
+ autoTopUpExplanation: G
246
+ };
247
+ }, Zt = { class: "flex flex-col gap-3 py-3" }, eo = { class: "flex flex-col gap-1 px-4" }, to = { class: "flex w-full justify-between gap-3" }, oo = { class: "flex w-full items-center gap-4" }, no = { key: 0 }, ao = {
248
+ key: 1,
249
+ class: "flex w-full justify-between gap-3 px-4"
250
+ }, io = { class: "flex min-w-0 items-center gap-1" }, so = { class: "flex min-w-0 items-center gap-1" }, lo = { class: "shrink-0" }, uo = /* @__PURE__ */ z({
251
+ __name: "WalletBalancesItem",
252
+ props: {
253
+ walletBalance: {},
254
+ showAutoTopUp: { type: Boolean },
255
+ showManualTopUp: { type: Boolean }
256
+ },
257
+ emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
258
+ setup(e) {
259
+ const t = e, { $t: o } = Q(), {
260
+ walletName: n,
261
+ formatBalance: a,
262
+ manualTopUpItems: i,
263
+ flexibleManualTopUpItem: u,
264
+ showManualTopUp: l,
265
+ showAutoTopUp: p,
266
+ activeTopUpConfig: y,
267
+ autoTopUpLabel: T,
268
+ autoTopUpExplanation: x
269
+ } = Jt(t);
270
+ return (v, g) => (w(), W("div", Zt, [
271
+ k("div", eo, [
272
+ k("div", to, [
273
+ A(X, {
274
+ variant: "body-xs",
275
+ color: "subtle",
276
+ "no-spacing": ""
277
+ }, {
278
+ default: h(() => [
279
+ F(N(r(n)), 1)
280
+ ]),
281
+ _: 1
282
+ }),
283
+ A(X, {
284
+ variant: "body-xs",
285
+ color: "subtle",
286
+ "no-spacing": ""
287
+ }, {
288
+ default: h(() => {
289
+ var m, U;
290
+ return [
291
+ (m = e.walletBalance.wallet_balance) != null && m.balance_at ? (w(), C(Xt, {
292
+ key: 0,
293
+ date: new Date((U = e.walletBalance.wallet_balance) == null ? void 0 : U.balance_at),
294
+ "action-verb": r(o)({
295
+ defaultMessage: "updated",
296
+ id: "wallet_balance.updated_action_verb",
297
+ description: "Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"
298
+ })
299
+ }, null, 8, ["date", "action-verb"])) : R("", !0)
300
+ ];
301
+ }),
302
+ _: 1
303
+ })
304
+ ]),
305
+ k("div", oo, [
306
+ A(X, {
307
+ variant: "body-lg",
308
+ weight: "semibold",
309
+ "no-spacing": "",
310
+ class: "grow"
311
+ }, {
312
+ default: h(() => [
313
+ F(N(r(a)(t.walletBalance.wallet_balance.open_balance)), 1)
314
+ ]),
315
+ _: 1
316
+ }),
317
+ r(l) ? (w(), C(r(ue), {
318
+ key: 0,
319
+ size: "xs",
320
+ onClick: g[0] || (g[0] = (m) => v.$emit("top-up", r(i)[0]))
321
+ }, {
322
+ default: h(() => [
323
+ F(N(r(o)({
324
+ defaultMessage: "Top up",
325
+ id: "v1V8kA",
326
+ description: "Button to top up a wallet balance"
327
+ })), 1)
328
+ ]),
329
+ _: 1
330
+ })) : R("", !0)
331
+ ])
332
+ ]),
333
+ v.$slots.graph ? (w(), W("div", no, [
334
+ se(v.$slots, "graph")
335
+ ])) : R("", !0),
336
+ r(p) ? (w(), W("div", ao, [
337
+ k("div", io, [
338
+ A(Xe, { class: "min-w-0" }, {
339
+ tooltip: h(() => [
340
+ A(Je, null, {
341
+ default: h(() => [
342
+ A(Ze, null, {
343
+ default: h(() => [
344
+ F(N(r(x)), 1)
345
+ ]),
346
+ _: 1
347
+ })
348
+ ]),
349
+ _: 1
350
+ })
351
+ ]),
352
+ default: h(() => [
353
+ k("div", so, [
354
+ A(X, {
355
+ variant: "body-sm",
356
+ color: "secondary",
357
+ "no-spacing": "",
358
+ class: "truncate"
359
+ }, {
360
+ default: h(() => [
361
+ F(N(r(T)), 1)
362
+ ]),
363
+ _: 1
364
+ }),
365
+ A(Vt, {
366
+ icon: "info",
367
+ size: "2xs",
368
+ class: "shrink-0 cursor-help text-gray-400"
369
+ })
370
+ ])
371
+ ]),
372
+ _: 1
373
+ })
374
+ ]),
375
+ k("div", lo, [
376
+ r(y) ? (w(), C(r(ue), {
377
+ key: 0,
378
+ size: "xs",
379
+ intent: "secondary",
380
+ onClick: g[1] || (g[1] = (m) => v.$emit("cancel-auto-top-up", r(y)))
381
+ }, {
382
+ default: h(() => [
383
+ F(N(r(o)({
384
+ defaultMessage: "Disable",
385
+ id: "wallet_balance.auto_top_up_disable_button",
386
+ description: "Button to turn off a wallet's automatic top-up"
387
+ })), 1)
388
+ ]),
389
+ _: 1
390
+ })) : (w(), C(r(ue), {
391
+ key: 1,
392
+ size: "xs",
393
+ intent: "secondary",
394
+ onClick: g[2] || (g[2] = (m) => v.$emit("auto-top-up", r(u)))
395
+ }, {
396
+ default: h(() => [
397
+ F(N(r(o)({
398
+ defaultMessage: "Enable",
399
+ id: "wallet_balance.auto_top_up_enable_button",
400
+ description: "Button to set up a wallet's automatic top-up"
401
+ })), 1)
402
+ ]),
403
+ _: 1
404
+ }))
405
+ ])
406
+ ])) : R("", !0)
407
+ ]));
408
+ }
409
+ }), ro = { class: "flex flex-col gap-2" }, co = /* @__PURE__ */ z({
410
+ __name: "WalletBalances",
411
+ props: {
412
+ customerWalletBalances: {},
413
+ title: { default: void 0 },
414
+ showAutoTopUp: { type: Boolean, default: !1 },
415
+ showManualTopUp: { type: Boolean, default: !1 }
416
+ },
417
+ emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
418
+ setup(e) {
419
+ return (t, o) => (w(), C(fe, {
420
+ "no-spacing": "",
421
+ "no-border": "",
422
+ title: e.title
423
+ }, re({
424
+ default: h(() => [
425
+ k("div", ro, [
426
+ (w(!0), W(ge, null, he(e.customerWalletBalances, (n) => (w(), C(fe, {
427
+ key: n.wallet_id,
428
+ "no-spacing": ""
429
+ }, {
430
+ default: h(() => [
431
+ A(uo, {
432
+ "wallet-balance": n,
433
+ "show-auto-top-up": e.showAutoTopUp,
434
+ "show-manual-top-up": e.showManualTopUp,
435
+ onTopUp: o[0] || (o[0] = (a) => t.$emit("top-up", a)),
436
+ onAutoTopUp: o[1] || (o[1] = (a) => t.$emit("auto-top-up", a)),
437
+ onCancelAutoTopUp: o[2] || (o[2] = (a) => t.$emit("cancel-auto-top-up", a))
438
+ }, null, 8, ["wallet-balance", "show-auto-top-up", "show-manual-top-up"])
439
+ ]),
440
+ _: 2
441
+ }, 1024))), 128))
442
+ ])
443
+ ]),
444
+ _: 2
445
+ }, [
446
+ t.$slots["heading-right"] ? {
447
+ name: "right",
448
+ fn: h(() => [
449
+ se(t.$slots, "heading-right")
450
+ ]),
451
+ key: "0"
452
+ } : void 0
453
+ ]), 1032, ["title"]));
454
+ }
455
+ });
456
+ function po() {
457
+ const e = Qe(), t = Ge();
458
+ function o(n) {
459
+ return e({
460
+ url: `${t.apiUrls.config}/portal/customers/${n}/wallets/balance`,
461
+ query: Bt({ expandParams: Dt }),
462
+ options: { method: "POST" },
463
+ data: {}
464
+ });
465
+ }
466
+ return {
467
+ getCustomerWalletBalances: o
468
+ };
469
+ }
470
+ function Nn({ customerId: e }) {
471
+ const { getCustomerWalletBalances: t } = po(), { data: o, execute: n, apiStatus: a, error: i, isPending: u } = Nt({
472
+ service: () => t(e)
473
+ });
474
+ return { walletBalances: s(
475
+ () => o.value ?? null
476
+ ), apiStatus: a, error: i, fetch: n, isPending: u };
477
+ }
478
+ const Re = (e = [], t) => {
479
+ if (t != null && t.pricing_item_id)
480
+ return e.find(
481
+ (o) => (o.charge_on_demand_pricing_items ?? []).some(
482
+ ({ pricing_item_id: n }) => n === t.pricing_item_id
483
+ )
484
+ );
485
+ }, mo = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], Ee = (e) => typeof e == "object" && e !== null && "pricing_item" in e, fo = (e) => [
486
+ ...new Set(
487
+ ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap(
488
+ (t) => Ee(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
489
+ )
490
+ )
491
+ ], vo = (e, t) => {
492
+ const o = new Set(fo(e));
493
+ return t.flatMap((n) => {
494
+ const a = (n.pricing_plan_schedule_infos ?? []).filter(
495
+ ({ id: i }) => o.has(i)
496
+ );
497
+ return a.length === 0 ? [] : [
498
+ {
499
+ id: n.id,
500
+ name: n.name || n.reference || n.id,
501
+ scheduleIds: a.map(({ id: i }) => i),
502
+ enabledPricingIds: a.flatMap(
503
+ (i) => {
504
+ var u;
505
+ return (((u = i.pricing_plan_schedule) == null ? void 0 : u.enabled_pricings) ?? []).flatMap(
506
+ ({ pricing_id: l }) => l ? [l] : []
507
+ );
508
+ }
509
+ )
510
+ }
511
+ ];
512
+ });
513
+ }, go = (e, t) => {
514
+ if (!e || t.length === 0)
515
+ return e;
516
+ const o = new Set(t);
517
+ return {
518
+ ...e,
519
+ charge_on_demand_pricing_items: (e.charge_on_demand_pricing_items ?? []).filter(
520
+ (n) => Ee(n) && !!n.pricing_plan_schedule_id && o.has(n.pricing_plan_schedule_id)
521
+ )
522
+ };
523
+ }, ut = (e) => ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap((t) => {
524
+ var n, a;
525
+ if (!Ee(t))
526
+ return [];
527
+ const o = t.pricing_item_id ?? ((n = t.pricing_item) == null ? void 0 : n.id);
528
+ return o ? (((a = t.pricing_item) == null ? void 0 : a.configs) ?? []).map((i) => {
529
+ const u = bo(i, e), l = ho(i, e);
530
+ return {
531
+ pricingItemId: o,
532
+ ...t.pricing_plan_schedule_id && {
533
+ pricingPlanScheduleId: t.pricing_plan_schedule_id
534
+ },
535
+ config: i,
536
+ ...u && { flexiblePricing: u },
537
+ ...l && { fixedPricing: l }
538
+ };
539
+ }) : [];
540
+ });
541
+ function ho(e, t) {
542
+ var i, u, l;
543
+ if (!e.on_demand || !Rt(e, ["FIXED"]))
544
+ return;
545
+ const o = (l = (u = (i = e.details) == null ? void 0 : i.bands) == null ? void 0 : u[0]) == null ? void 0 : l.fixed_amount;
546
+ if (!o)
547
+ return;
548
+ const n = rt(t), a = n ? yo(e, t) : void 0;
549
+ return {
550
+ amount: o,
551
+ value: a && n ? Oe(a.quantity, n) : { amount: o }
552
+ };
553
+ }
554
+ const rt = (e) => {
555
+ var t;
556
+ return (t = e == null ? void 0 : e.wallet_balance.balance) == null ? void 0 : t.credits;
557
+ }, dt = (e, t) => {
558
+ var n;
559
+ const o = (n = t == null ? void 0 : t.wallet) == null ? void 0 : n.wallet_type_id;
560
+ return (e.wallet_grants ?? []).filter(
561
+ ({ wallet_type_id: a }) => !o || a === o
562
+ );
563
+ }, _o = (e, t) => {
564
+ var o, n;
565
+ return (n = (o = dt(e, t).find(
566
+ ({ credits_grant: a }) => a == null ? void 0 : a.conversion
567
+ )) == null ? void 0 : o.credits_grant) == null ? void 0 : n.conversion;
568
+ }, yo = (e, t) => {
569
+ var o, n;
570
+ return (n = (o = dt(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
571
+ }, Oe = (e, t) => ({ credits: { ...t, quantity: e } }), ct = (e, t) => {
572
+ const o = Number(e), n = Number(t);
573
+ return Number.isFinite(o) && Number.isFinite(n) ? String(o * n) : void 0;
574
+ };
575
+ function bo(e, t) {
576
+ var p, y, T, x, v, g, m;
577
+ if (!e.on_demand || !Me(e))
578
+ return;
579
+ const o = (y = (p = e.details) == null ? void 0 : p.bands) == null ? void 0 : y[0], n = ((T = o == null ? void 0 : o.minimum_amount) == null ? void 0 : T.currency) ?? ((x = o == null ? void 0 : o.maximum_amount) == null ? void 0 : x.currency) ?? ((g = (v = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : v.amount) == null ? void 0 : g.currency);
580
+ if (!n)
581
+ return;
582
+ const a = rt(t), i = a ? _o(e, t) : void 0, u = (m = a == null ? void 0 : a.credit_type) == null ? void 0 : m.unit_name, l = (U) => {
583
+ if (!U)
584
+ return;
585
+ const I = a && i ? ct(U.quantity, i.rate) : void 0;
586
+ return I !== void 0 && a ? Oe(I, a) : { amount: U };
587
+ };
588
+ return {
589
+ config: {
590
+ ...(o == null ? void 0 : o.minimum_amount) && { minimum_amount: o.minimum_amount },
591
+ ...(o == null ? void 0 : o.maximum_amount) && { maximum_amount: o.maximum_amount }
592
+ },
593
+ currency: n,
594
+ ...i && {
595
+ creditsConfiguration: {
596
+ conversionRate: i.rate,
597
+ ...(u == null ? void 0 : u.singular) && { unitNameSingle: u.singular },
598
+ ...(u == null ? void 0 : u.plural) && { unitNamePlural: u.plural }
599
+ }
600
+ },
601
+ bounds: {
602
+ ...l(o == null ? void 0 : o.minimum_amount) && { minimum: l(o == null ? void 0 : o.minimum_amount) },
603
+ ...l(o == null ? void 0 : o.maximum_amount) && { maximum: l(o == null ? void 0 : o.maximum_amount) }
604
+ }
605
+ };
606
+ }
607
+ const wo = (e) => {
608
+ var t, o, n, a, i;
609
+ return !!((t = e.fixedPricing) != null && t.value.credits) || !!((o = e.flexiblePricing) != null && o.creditsConfiguration) || !!((i = ((n = e.flexiblePricing) == null ? void 0 : n.bounds.minimum) ?? ((a = e.flexiblePricing) == null ? void 0 : a.bounds.maximum)) != null && i.credits);
610
+ }, To = (e) => {
611
+ var t;
612
+ for (const { fixedPricing: o, flexiblePricing: n } of e) {
613
+ const a = (o == null ? void 0 : o.value.credits) ?? ((t = (n == null ? void 0 : n.bounds.minimum) ?? (n == null ? void 0 : n.bounds.maximum)) == null ? void 0 : t.credits);
614
+ if (a != null && a.credit_type_id)
615
+ return a.credit_type_id;
616
+ }
617
+ }, Mo = (e = []) => {
618
+ for (const { flexiblePricing: t, fixedPricing: o } of e) {
619
+ const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
620
+ if (n)
621
+ return n;
622
+ }
623
+ }, pt = (e = []) => {
624
+ var t, o, n;
625
+ for (const { fixedPricing: a, flexiblePricing: i } of e) {
626
+ const u = (a == null ? void 0 : a.value.credits) ?? ((t = (i == null ? void 0 : i.bounds.minimum) ?? (i == null ? void 0 : i.bounds.maximum)) == null ? void 0 : t.credits);
627
+ if ((n = (o = u == null ? void 0 : u.credit_type) == null ? void 0 : o.unit_name) != null && n.plural)
628
+ return u.credit_type.unit_name.plural;
629
+ }
630
+ }, Uo = (e = []) => {
631
+ var t;
632
+ for (const { flexiblePricing: o } of e) {
633
+ const n = (t = o == null ? void 0 : o.creditsConfiguration) == null ? void 0 : t.conversionRate;
634
+ if (n)
635
+ return n;
636
+ }
637
+ }, So = (e = []) => {
638
+ for (const { flexiblePricing: t } of e) {
639
+ const { minimum_amount: o, maximum_amount: n } = (t == null ? void 0 : t.config) ?? {};
640
+ if (o || n)
641
+ return { ...o && { minimum: o }, ...n && { maximum: n } };
642
+ }
643
+ return {};
644
+ }, Po = (e = []) => {
645
+ if (e.some(wo)) {
646
+ const t = To(e);
647
+ return t ? { creditTypeId: t } : void 0;
648
+ }
649
+ for (const { flexiblePricing: t, fixedPricing: o } of e) {
650
+ const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
651
+ if (n)
652
+ return { currency: n };
653
+ }
654
+ }, Ao = (e, t) => {
655
+ var u;
656
+ if (e.fixedPricing)
657
+ return e.fixedPricing.value;
658
+ if (!e.flexiblePricing || !t)
659
+ return;
660
+ const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (u = o.minimum ?? o.maximum) == null ? void 0 : u.credits, i = n ? ct(t.quantity, n.conversionRate) : void 0;
661
+ return a && i !== void 0 ? Oe(i, a) : { amount: t };
662
+ }, mt = (e = []) => {
663
+ const t = Po(e);
664
+ if (t)
665
+ return {
666
+ denomination: t,
667
+ chargeCurrency: Mo(e) ?? "",
668
+ creditUnitName: pt(e),
669
+ conversionRate: Uo(e),
670
+ topUpBounds: So(e)
671
+ };
672
+ }, Co = 400;
673
+ function xo({
674
+ pricingPlanScheduleId: e,
675
+ pricingItems: t
676
+ }) {
677
+ const { previewChargeOnDemandPricingItems: o } = it(), n = _e(), a = E(), i = E(!1), u = It(), l = async () => {
678
+ const p = e.value, y = u();
679
+ if (!p || !t.value) {
680
+ t.value && !p && n.warn(
681
+ "INVOICE_PREVIEW_SKIPPED",
682
+ "Skipped the top-up invoice preview: no schedule to charge it on",
683
+ { missing: ["pricingPlanScheduleId"] }
684
+ ), a.value = void 0, i.value = !1;
685
+ return;
686
+ }
687
+ i.value = !0;
688
+ try {
689
+ const T = await o({
690
+ pricingPlanScheduleId: p,
691
+ pricingItems: t.value
692
+ });
693
+ y() && (a.value = T);
694
+ } catch (T) {
695
+ y() && (a.value = void 0), n.error(
696
+ "INVOICE_PREVIEW_FAILED",
697
+ "Failed to load top-up invoice preview",
698
+ {},
699
+ T
700
+ );
701
+ } finally {
702
+ y() && (i.value = !1);
703
+ }
704
+ };
705
+ return Ht(t, () => void l(), {
706
+ debounce: Co,
707
+ deep: !0
708
+ }), l(), { invoicePreview: a, isPreviewPending: i, loadPreview: l };
709
+ }
710
+ const $o = { key: 0 }, ft = /* @__PURE__ */ z({
711
+ __name: "TopUpInvoicePreview",
712
+ props: {
713
+ pricingPlanScheduleId: { type: String },
714
+ pricingItems: { type: Array }
715
+ },
716
+ setup(e) {
717
+ const t = e, { $t: o } = Q(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i } = xo({ pricingPlanScheduleId: n, pricingItems: a });
718
+ return (u, l) => (w(), C(et, {
719
+ class: "sv-top-up-invoice-preview h-[152px]",
720
+ "data-testid": "top-up-invoice-preview-skeleton"
721
+ }, {
722
+ default: h(() => [
723
+ r(i) ? (w(), W("div", $o, [
724
+ A(r(Yt), { required: "" }, {
725
+ default: h(() => [
726
+ F(N(r(o)({
727
+ defaultMessage: "You will pay",
728
+ description: "Label above the preview of what topping up will be invoiced for",
729
+ id: "topup_modal.invoice_preview.label"
730
+ })), 1)
731
+ ]),
732
+ _: 1
733
+ }),
734
+ A(r(fe), { "content-background": "none" }, {
735
+ default: h(() => [
736
+ A(r(at), {
737
+ invoice: r(i),
738
+ "is-customer-facing": ""
739
+ }, null, 8, ["invoice"])
740
+ ]),
741
+ _: 1
742
+ })
743
+ ])) : R("", !0)
744
+ ]),
745
+ _: 1
746
+ }));
747
+ }
748
+ }), vt = (e, t) => e.currency ?? t ?? e.creditTypeId ?? "", Ve = (e, t) => ({
749
+ quantity: e ?? null,
750
+ currency: t
751
+ }), Ue = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
752
+ var i, u, l, p, y;
753
+ return {
754
+ enabled: (e == null ? void 0 : e.status) === "ACTIVE",
755
+ threshold: Ve(
756
+ ((u = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : u.quantity) ?? ((p = (l = e == null ? void 0 : e.threshold) == null ? void 0 : l.credits) == null ? void 0 : p.quantity),
757
+ vt(t, n)
758
+ ),
759
+ topUpAmount: Ve(((y = e == null ? void 0 : e.topup_amount) == null ? void 0 : y.quantity) ?? a, o)
760
+ };
761
+ }, Eo = (e, t) => {
762
+ var n;
763
+ const o = (n = e.threshold) == null ? void 0 : n.quantity;
764
+ return o ? t.creditTypeId ? { credits: { quantity: o, credit_type_id: t.creditTypeId } } : { amount: { quantity: o, currency: t.currency ?? "" } } : {};
765
+ }, qe = (e, t) => {
766
+ var o;
767
+ return (o = e.topUpAmount) != null && o.quantity ? {
768
+ quantity: e.topUpAmount.quantity,
769
+ currency: e.topUpAmount.currency ?? t
770
+ } : void 0;
771
+ }, gt = (e, { denomination: t, chargeCurrency: o }) => ({
772
+ status: e.enabled ? "ACTIVE" : "INACTIVE",
773
+ threshold: Eo(e, t),
774
+ ...qe(e, o) && {
775
+ topup_amount: qe(e, o)
776
+ }
777
+ }), Fe = (e, t) => gt(Ue(e, t), t), Le = (e, t) => JSON.stringify(e) === JSON.stringify(t), Ye = (e) => {
778
+ const t = Number(e == null ? void 0 : e.quantity);
779
+ return e != null && e.quantity && Number.isFinite(t) ? t : void 0;
780
+ }, Oo = (e, t) => {
781
+ const o = Number(t == null ? void 0 : t.quantity);
782
+ return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e >= o;
783
+ }, Bo = (e, t) => {
784
+ const o = Number(t == null ? void 0 : t.quantity);
785
+ return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e <= o;
786
+ }, ve = (e) => {
787
+ const t = Number(e);
788
+ return e != null && e !== "" && Number.isFinite(t) ? t : void 0;
789
+ }, Be = (e, t, o) => {
790
+ const n = ve(e), a = ve(o);
791
+ if (!(n === void 0 || a === void 0 || a <= 0))
792
+ return t === "CREDITS" ? n / a : n * a;
793
+ }, He = (e, t, o, n) => t === o ? ve(e) : Be(e, t, n), Io = (e, t, o) => t === "CREDITS" ? Be(e, "AMOUNT", o) : ve(e), Ie = (e) => e.toFixed(2), We = (e, t) => t === "AMOUNT" ? Ie(e) : String(Number(e.toFixed(6))), ht = (e, t, o, n) => {
794
+ const a = Io(e == null ? void 0 : e.quantity, t, o);
795
+ if (a !== void 0)
796
+ return t === "CREDITS" ? n(a) : Ie(a);
797
+ }, Do = ["data-testid"], Se = /* @__PURE__ */ z({
798
+ __name: "ConvertedAmountInput",
799
+ props: /* @__PURE__ */ Ot({
800
+ unit: { type: String },
801
+ modelBase: { type: String },
802
+ entryBase: { type: String },
803
+ conversionRate: { type: String },
804
+ showConversionHint: { type: Boolean },
805
+ currency: { type: String },
806
+ creditUnitName: { type: String },
807
+ bounds: { type: Object },
808
+ label: { type: String },
809
+ name: { type: String },
810
+ required: { type: Boolean },
811
+ disabled: { type: Boolean },
812
+ error: { type: [String, Object, Array] }
813
+ }, {
814
+ modelValue: { default: "" },
815
+ modelModifiers: {}
816
+ }),
817
+ emits: ["update:modelValue"],
818
+ setup(e) {
819
+ const t = e, o = $t(e, "modelValue"), { $t: n, formatNumber: a } = Q(), i = s(() => t.entryBase ?? t.modelBase), u = s(
820
+ () => i.value !== t.modelBase && ve(t.conversionRate) !== void 0
821
+ ), l = E("");
822
+ ee(
823
+ () => [o.value, i.value, t.modelBase, t.conversionRate],
824
+ ([f]) => {
825
+ if (!u.value) {
826
+ l.value = f ?? "";
827
+ return;
828
+ }
829
+ if (f === y(l.value))
830
+ return;
831
+ const P = He(
832
+ f,
833
+ t.modelBase,
834
+ i.value,
835
+ t.conversionRate
836
+ );
837
+ l.value = P === void 0 ? "" : We(P, i.value);
838
+ },
839
+ { immediate: !0 }
840
+ );
841
+ function p(f) {
842
+ return typeof f == "string" ? f : typeof f == "number" ? String(f) : "";
843
+ }
844
+ function y(f) {
845
+ const P = He(f, i.value, t.modelBase, t.conversionRate);
846
+ return P === void 0 ? "" : We(P, t.modelBase);
847
+ }
848
+ const T = s({
849
+ get: () => l.value,
850
+ set: (f) => {
851
+ l.value = p(f), o.value = u.value ? y(l.value) : l.value;
852
+ }
853
+ }), x = s(
854
+ () => Be(l.value, i.value, t.conversionRate)
855
+ ), v = s(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
856
+ defaultMessage: "credits",
857
+ description: "Generic name for a wallet credit, where its credit type does not name one",
858
+ id: "converted_amount_input.credits"
859
+ })), g = (f, P) => $e({ quantity: Ie(f), currency: P }), m = (f) => `${a(f)} ${v.value}`, U = s(() => {
860
+ const f = t.error;
861
+ return Array.isArray(f) ? f.length > 0 : !!(Et(f) ? f.value : f);
862
+ }), I = s(() => {
863
+ const f = x.value;
864
+ if (!(U.value || !t.showConversionHint || f === void 0))
865
+ return i.value === "CREDITS" ? t.currency ? n(
866
+ {
867
+ defaultMessage: "Will cost {amount} excluding taxes",
868
+ description: "Helper text under a credits field, naming what those credits cost in money",
869
+ id: "converted_amount_input.cost"
870
+ },
871
+ { amount: g(f, t.currency) }
872
+ ) : void 0 : n(
873
+ {
874
+ defaultMessage: "Buys about {credits}",
875
+ description: "Helper text under a money field, naming the credits that amount converts into",
876
+ id: "converted_amount_input.buys"
877
+ },
878
+ { credits: m(f) }
879
+ );
880
+ }), G = (f) => ht(f, i.value, t.conversionRate, a), _ = s(
881
+ () => {
882
+ var f, P, O, D;
883
+ return i.value === "CREDITS" ? v.value : ((P = (f = t.bounds) == null ? void 0 : f.minimum) == null ? void 0 : P.currency) ?? ((D = (O = t.bounds) == null ? void 0 : O.maximum) == null ? void 0 : D.currency) ?? t.unit;
884
+ }
885
+ ), S = s(() => {
886
+ var D, b;
887
+ const f = G((D = t.bounds) == null ? void 0 : D.minimum), P = G((b = t.bounds) == null ? void 0 : b.maximum), O = _.value;
888
+ if (f && P)
889
+ return n(
890
+ {
891
+ defaultMessage: "Between {minimum} and {maximum} {unit}",
892
+ description: "Range of what a flexible top-up may be charged for, beside its label",
893
+ id: "converted_amount_input.bounds.range"
894
+ },
895
+ { minimum: f, maximum: P, unit: O }
896
+ );
897
+ if (f)
898
+ return n(
899
+ {
900
+ defaultMessage: "At least {minimum} {unit}",
901
+ description: "Smallest amount a flexible top-up may be charged for, beside its label",
902
+ id: "converted_amount_input.bounds.minimum"
903
+ },
904
+ { minimum: f, unit: O }
905
+ );
906
+ if (P)
907
+ return n(
908
+ {
909
+ defaultMessage: "Up to {maximum} {unit}",
910
+ description: "Largest amount a flexible top-up may be charged for, beside its label",
911
+ id: "converted_amount_input.bounds.maximum"
912
+ },
913
+ { maximum: P, unit: O }
914
+ );
915
+ });
916
+ return (f, P) => (w(), C(r(Wt), {
917
+ modelValue: T.value,
918
+ "onUpdate:modelValue": P[0] || (P[0] = (O) => T.value = O),
919
+ class: "sv-converted-amount-input",
920
+ type: "number",
921
+ "as-text-type": "",
922
+ name: e.name,
923
+ label: e.label,
924
+ required: e.required,
925
+ disabled: e.disabled,
926
+ error: e.error
927
+ }, re({
928
+ suffix: h(() => [
929
+ k("span", {
930
+ "data-testid": `${e.name}-unit`
931
+ }, N(e.unit), 9, Do)
932
+ ]),
933
+ _: 2
934
+ }, [
935
+ S.value ? {
936
+ name: "label-suffix",
937
+ fn: h(() => [
938
+ A(r(X), {
939
+ tag: "span",
940
+ variant: "body-xs",
941
+ color: "subtle",
942
+ "no-spacing": "",
943
+ "data-testid": `${e.name}-bounds`
944
+ }, {
945
+ default: h(() => [
946
+ F(N(S.value), 1)
947
+ ]),
948
+ _: 1
949
+ }, 8, ["data-testid"])
950
+ ]),
951
+ key: "0"
952
+ } : void 0,
953
+ I.value ? {
954
+ name: "helper",
955
+ fn: h(() => [
956
+ A(r(X), {
957
+ tag: "span",
958
+ variant: "body-xs",
959
+ color: "subtle",
960
+ "no-spacing": "",
961
+ "data-testid": `${e.name}-conversion`
962
+ }, {
963
+ default: h(() => [
964
+ F(N(I.value), 1)
965
+ ]),
966
+ _: 1
967
+ }, 8, ["data-testid"])
968
+ ]),
969
+ key: "1"
970
+ } : void 0
971
+ ]), 1032, ["modelValue", "name", "label", "required", "disabled", "error"]));
972
+ }
973
+ }), No = /* @__PURE__ */ z({
974
+ __name: "Section",
975
+ props: {
976
+ emphasized: { type: Boolean, default: !1 },
977
+ contentClasses: { type: String },
978
+ contentBackground: { type: String },
979
+ title: { type: String },
980
+ noSpacing: { type: Boolean },
981
+ hasError: { type: Boolean },
982
+ noBorder: { type: Boolean }
983
+ },
984
+ setup(e) {
985
+ const t = e, o = [
986
+ "sv-section__accent relative",
987
+ "before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5",
988
+ "before:rounded-full before:bg-primary-600"
989
+ ].join(" "), n = s(
990
+ () => [t.emphasized ? o : void 0, t.contentClasses].filter(Boolean).join(" ")
991
+ ), a = s(() => {
992
+ const { emphasized: i, ...u } = t;
993
+ return u;
994
+ });
995
+ return (i, u) => (w(), C(r(fe), le(a.value, {
996
+ class: "sv-section",
997
+ "content-classes": n.value
998
+ }), re({
999
+ default: h(() => [
1000
+ se(i.$slots, "default")
1001
+ ]),
1002
+ _: 2
1003
+ }, [
1004
+ i.$slots.right ? {
1005
+ name: "right",
1006
+ fn: h(() => [
1007
+ se(i.$slots, "right")
1008
+ ]),
1009
+ key: "0"
1010
+ } : void 0
1011
+ ]), 1040, ["content-classes"]));
1012
+ }
1013
+ }), ko = { class: "flex grow flex-col" }, _t = /* @__PURE__ */ z({
1014
+ __name: "AutoTopUpConfig",
1015
+ props: {
1016
+ config: { type: Object },
1017
+ denomination: { type: Object },
1018
+ creditUnitName: { type: String },
1019
+ chargeCurrency: { type: String },
1020
+ conversionRate: { type: String },
1021
+ topUpBounds: { type: Object },
1022
+ showThresholdConversion: { type: Boolean, default: !0 },
1023
+ contained: { type: Boolean },
1024
+ alwaysEnabled: { type: Boolean },
1025
+ disabled: { type: Boolean }
1026
+ },
1027
+ emits: ["save"],
1028
+ setup(e, { expose: t, emit: o }) {
1029
+ const n = e, a = o, { $t: i, formatNumber: u } = Q(), l = s(() => {
1030
+ var b, $;
1031
+ return {
1032
+ denomination: n.denomination,
1033
+ chargeCurrency: n.chargeCurrency,
1034
+ creditUnitName: n.creditUnitName,
1035
+ minimumTopUp: ($ = (b = n.topUpBounds) == null ? void 0 : b.minimum) == null ? void 0 : $.quantity
1036
+ };
1037
+ }), p = E(Ue(n.config, l.value)), y = s(() => vt(n.denomination, n.creditUnitName)), T = s(
1038
+ () => n.denomination.creditTypeId ? "CREDITS" : "AMOUNT"
1039
+ ), x = s(
1040
+ () => T.value === "CREDITS" ? y.value : n.chargeCurrency
1041
+ ), v = s({
1042
+ get: () => {
1043
+ var b;
1044
+ return ((b = p.value.threshold) == null ? void 0 : b.quantity) ?? "";
1045
+ },
1046
+ set: (b) => {
1047
+ p.value.threshold = { quantity: b || null, currency: y.value };
1048
+ }
1049
+ }), g = s({
1050
+ get: () => {
1051
+ var b;
1052
+ return ((b = p.value.topUpAmount) == null ? void 0 : b.quantity) ?? "";
1053
+ },
1054
+ set: (b) => {
1055
+ p.value.topUpAmount = { quantity: b || null, currency: n.chargeCurrency };
1056
+ }
1057
+ });
1058
+ ee(
1059
+ () => [n.config, l.value],
1060
+ ([b, $]) => {
1061
+ Le(Fe(b, $), I()) || (p.value = Ue(b, $));
1062
+ }
1063
+ );
1064
+ const m = s({
1065
+ get: () => n.alwaysEnabled || p.value.enabled,
1066
+ set: (b) => {
1067
+ p.value.enabled = b;
1068
+ }
1069
+ }), U = s(
1070
+ () => gt({ ...p.value, enabled: m.value }, l.value)
1071
+ ), I = () => U.value, G = Ae({
1072
+ threshold: s(() => Ye(p.value.threshold) ?? null),
1073
+ topUpAmount: s(() => Ye(p.value.topUpAmount) ?? null)
1074
+ }), _ = (b) => {
1075
+ if (!b)
1076
+ return "";
1077
+ const $ = ht(b, T.value, n.conversionRate, u);
1078
+ return $ === void 0 ? $e(b) : `${$} ${x.value}`;
1079
+ }, S = Ft(() => m.value), f = xe(
1080
+ {
1081
+ threshold: {
1082
+ required: ie.withMessage(
1083
+ () => i({
1084
+ defaultMessage: "Enter the balance to top up at.",
1085
+ description: "Error shown under the auto top-up threshold when it is left empty",
1086
+ id: "auto_topup_config.threshold.required"
1087
+ }),
1088
+ S
1089
+ ),
1090
+ notNegative: ie.withMessage(
1091
+ () => i({
1092
+ defaultMessage: "The balance to top up at cannot be negative.",
1093
+ description: "Error shown under the auto top-up threshold when it is below zero",
1094
+ id: "auto_topup_config.threshold.not_negative"
1095
+ }),
1096
+ (b) => b === null || b >= 0
1097
+ )
1098
+ },
1099
+ topUpAmount: {
1100
+ required: ie.withMessage(
1101
+ () => i({
1102
+ defaultMessage: "Enter the amount to top up with.",
1103
+ description: "Error shown under the auto top-up amount when it is left empty",
1104
+ id: "auto_topup_config.amount.required"
1105
+ }),
1106
+ S
1107
+ ),
1108
+ positive: ie.withMessage(
1109
+ () => i({
1110
+ defaultMessage: "Top up with more than zero.",
1111
+ description: "Error shown under the auto top-up amount when it is zero or negative",
1112
+ id: "auto_topup_config.amount.positive"
1113
+ }),
1114
+ (b) => b === null || b > 0
1115
+ ),
1116
+ atLeastMinimum: ie.withMessage(
1117
+ () => {
1118
+ var b;
1119
+ return i(
1120
+ {
1121
+ defaultMessage: "Top up with at least {minimum}.",
1122
+ description: "Error shown under the auto top-up amount when it is below what the pricing allows",
1123
+ id: "auto_topup_config.amount.at_least_minimum"
1124
+ },
1125
+ { minimum: _((b = n.topUpBounds) == null ? void 0 : b.minimum) }
1126
+ );
1127
+ },
1128
+ (b) => {
1129
+ var $;
1130
+ return Oo(b, ($ = n.topUpBounds) == null ? void 0 : $.minimum);
1131
+ }
1132
+ ),
1133
+ withinMaximum: ie.withMessage(
1134
+ () => {
1135
+ var b;
1136
+ return i(
1137
+ {
1138
+ defaultMessage: "Top up with at most {maximum}.",
1139
+ description: "Error shown under the auto top-up amount when it is above what the pricing allows",
1140
+ id: "auto_topup_config.amount.within_maximum"
1141
+ },
1142
+ { maximum: _((b = n.topUpBounds) == null ? void 0 : b.maximum) }
1143
+ );
1144
+ },
1145
+ (b) => {
1146
+ var $;
1147
+ return Bo(b, ($ = n.topUpBounds) == null ? void 0 : $.maximum);
1148
+ }
1149
+ )
1150
+ }
1151
+ },
1152
+ G
1153
+ ), P = s(
1154
+ () => !Le(
1155
+ I(),
1156
+ Fe(n.config, l.value)
1157
+ )
1158
+ );
1159
+ function O() {
1160
+ return f.value.$touch(), f.value.$invalid ? void 0 : I();
1161
+ }
1162
+ function D() {
1163
+ const b = O();
1164
+ b && a("save", b);
1165
+ }
1166
+ return t({
1167
+ submit: D,
1168
+ validate: O,
1169
+ rule: U,
1170
+ hasChanges: P,
1171
+ isInvalid: s(() => f.value.$invalid)
1172
+ }), (b, $) => (w(), C(No, {
1173
+ class: "sv-auto-topup-config",
1174
+ "content-background": e.contained ? "gray" : "none",
1175
+ "no-spacing": !e.contained,
1176
+ "no-border": !e.contained
1177
+ }, {
1178
+ default: h(() => [
1179
+ e.alwaysEnabled ? R("", !0) : (w(), C(r(qt), {
1180
+ key: 0,
1181
+ modelValue: m.value,
1182
+ "onUpdate:modelValue": $[0] || ($[0] = (K) => m.value = K),
1183
+ "no-spacing": "",
1184
+ "label-position": "before",
1185
+ class: "!flex",
1186
+ disabled: e.disabled
1187
+ }, {
1188
+ "inline-label": h(() => [
1189
+ k("div", ko, [
1190
+ A(r(X), {
1191
+ tag: "span",
1192
+ variant: "body-sm"
1193
+ }, {
1194
+ default: h(() => [
1195
+ F(N(r(i)({
1196
+ defaultMessage: "Auto top-up",
1197
+ description: "Title of the automatic wallet top-up settings",
1198
+ id: "auto_topup_config.title"
1199
+ })), 1)
1200
+ ]),
1201
+ _: 1
1202
+ }),
1203
+ A(r(X), {
1204
+ tag: "span",
1205
+ variant: "body-xs",
1206
+ color: "subtle"
1207
+ }, {
1208
+ default: h(() => [
1209
+ F(N(r(i)({
1210
+ defaultMessage: "Automatically top up your balance when it runs low.",
1211
+ description: "Subtitle of the automatic wallet top-up settings",
1212
+ id: "auto_topup_config.subtitle"
1213
+ })), 1)
1214
+ ]),
1215
+ _: 1
1216
+ })
1217
+ ])
1218
+ ]),
1219
+ _: 1
1220
+ }, 8, ["modelValue", "disabled"])),
1221
+ A(r(nt), { "is-open": m.value }, {
1222
+ default: h(() => [
1223
+ m.value ? (w(), W("div", {
1224
+ key: 0,
1225
+ class: ze(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
1226
+ }, [
1227
+ A(Se, {
1228
+ modelValue: v.value,
1229
+ "onUpdate:modelValue": $[1] || ($[1] = (K) => v.value = K),
1230
+ name: "auto-top-up-threshold",
1231
+ unit: y.value,
1232
+ "model-base": T.value,
1233
+ "entry-base": T.value,
1234
+ currency: e.chargeCurrency,
1235
+ "conversion-rate": e.conversionRate,
1236
+ "show-conversion-hint": e.showThresholdConversion,
1237
+ required: "",
1238
+ disabled: e.disabled,
1239
+ error: r(f).threshold.$errors,
1240
+ label: r(i)({
1241
+ defaultMessage: "When your balance falls below",
1242
+ description: "Label of the balance at which an automatic top-up is charged",
1243
+ id: "auto_topup_config.threshold.label"
1244
+ })
1245
+ }, null, 8, ["modelValue", "unit", "model-base", "entry-base", "currency", "conversion-rate", "show-conversion-hint", "disabled", "error", "label"]),
1246
+ A(Se, {
1247
+ modelValue: g.value,
1248
+ "onUpdate:modelValue": $[2] || ($[2] = (K) => g.value = K),
1249
+ name: "auto-top-up-amount",
1250
+ unit: x.value,
1251
+ "model-base": "AMOUNT",
1252
+ "entry-base": T.value,
1253
+ currency: e.chargeCurrency,
1254
+ "credit-unit-name": e.creditUnitName,
1255
+ "conversion-rate": e.conversionRate,
1256
+ bounds: e.topUpBounds,
1257
+ "show-conversion-hint": "",
1258
+ required: "",
1259
+ disabled: e.disabled,
1260
+ error: r(f).topUpAmount.$errors,
1261
+ label: r(i)({
1262
+ defaultMessage: "Top-up with",
1263
+ description: "Label of the amount every automatic top-up adds",
1264
+ id: "auto_topup_config.amount.label"
1265
+ })
1266
+ }, null, 8, ["modelValue", "unit", "entry-base", "currency", "credit-unit-name", "conversion-rate", "bounds", "disabled", "error", "label"])
1267
+ ], 2)) : R("", !0)
1268
+ ]),
1269
+ _: 1
1270
+ }, 8, ["is-open"])
1271
+ ]),
1272
+ _: 1
1273
+ }, 8, ["content-background", "no-spacing", "no-border"]));
1274
+ }
1275
+ }), je = (e) => {
1276
+ const t = Date.parse(e ?? "");
1277
+ return Number.isFinite(t) ? t : 0;
1278
+ };
1279
+ function yt({
1280
+ paymentMethods: e,
1281
+ selectedPaymentMethodId: t,
1282
+ preferredPaymentMethodId: o
1283
+ }) {
1284
+ const n = s(
1285
+ () => [...e.value ?? []].sort(
1286
+ (a, i) => je(i.created_at) - je(a.created_at)
1287
+ )
1288
+ );
1289
+ return ee(
1290
+ () => [
1291
+ e.value,
1292
+ o == null ? void 0 : o.value,
1293
+ t.value
1294
+ ],
1295
+ ([a, i, u], l) => {
1296
+ var x;
1297
+ const p = l == null ? void 0 : l[0], y = a == null ? void 0 : a.find(
1298
+ ({ id: v }) => !(p != null && p.some((g) => g.id === v))
1299
+ );
1300
+ if (y && (p != null && p.length)) {
1301
+ t.value = y.id;
1302
+ return;
1303
+ }
1304
+ const T = (v) => !!v && !!(a != null && a.some((g) => g.id === v));
1305
+ T(u) || (t.value = T(i) ? i : (x = (a == null ? void 0 : a.find(({ is_default: v }) => v)) ?? n.value[0]) == null ? void 0 : x.id);
1306
+ },
1307
+ { immediate: !0 }
1308
+ ), { sortedPaymentMethods: n };
1309
+ }
1310
+ function ye() {
1311
+ const { $t: e, formatNumber: t } = Q(), o = (a) => Ce(e, t, a);
1312
+ return { formatValue: o, formatOpenBalance: (a) => o(a == null ? void 0 : a.wallet_balance.open_balance) };
1313
+ }
1314
+ const Ro = { class: "sv-top-up-form" }, Vo = { class: "grid grid-cols-1 gap-4" }, qo = { class: "grid grid-cols-1 gap-1" }, Fo = { class: "sv-top-up-form__option-details" }, Lo = { key: 0 }, Yo = /* @__PURE__ */ z({
1315
+ __name: "TopUpModalForm",
1316
+ props: {
1317
+ topUpPricingItems: { type: null },
1318
+ paymentMethods: { type: Array },
1319
+ paymentMethodOptions: { type: Array },
1320
+ autoTopUpConfig: { type: Object }
1321
+ },
1322
+ emits: ["add-payment-method", "success", "save-auto-top-up", "failure"],
1323
+ setup(e, { expose: t, emit: o }) {
1324
+ const n = e, a = o, { $t: i } = Q(), { formatValue: u } = ye(), l = E({
1325
+ pricing_plan_schedule_id: "",
1326
+ pricing_items: [],
1327
+ start_at: "",
1328
+ finalize_immediately: !1,
1329
+ payment_method_id: void 0,
1330
+ preview: !0
1331
+ }), p = s(() => {
1332
+ const d = (n.topUpPricingItems ?? []).filter(
1333
+ (c) => c.flexiblePricing || c.fixedPricing
1334
+ );
1335
+ return [
1336
+ ...d.filter(({ flexiblePricing: c }) => c),
1337
+ ...d.filter(({ flexiblePricing: c }) => !c)
1338
+ ];
1339
+ }), y = (d) => p.value.find((c) => c.pricingItemId === d), T = s(
1340
+ () => {
1341
+ var d, c;
1342
+ return (c = (d = n.topUpPricingItems) == null ? void 0 : d.find((M) => M.pricingPlanScheduleId)) == null ? void 0 : c.pricingPlanScheduleId;
1343
+ }
1344
+ );
1345
+ ee(
1346
+ T,
1347
+ (d) => {
1348
+ l.value.pricing_plan_schedule_id = d ?? "";
1349
+ },
1350
+ { immediate: !0 }
1351
+ );
1352
+ const x = (d) => {
1353
+ const { config: c, currency: M } = d.flexiblePricing ?? {}, V = c == null ? void 0 : c.minimum_amount;
1354
+ return V && M ? { quantity: V.quantity, currency: M } : void 0;
1355
+ }, v = s({
1356
+ get: () => {
1357
+ var d;
1358
+ return (d = l.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id;
1359
+ },
1360
+ set: (d) => {
1361
+ const c = y(typeof d == "string" ? d : void 0);
1362
+ if (!c) {
1363
+ l.value.pricing_items = [];
1364
+ return;
1365
+ }
1366
+ const M = x(c);
1367
+ l.value.pricing_items = [
1368
+ {
1369
+ pricing_item_id: c.pricingItemId,
1370
+ ...M && { flexible_amount: M }
1371
+ }
1372
+ ];
1373
+ }
1374
+ });
1375
+ ee(
1376
+ p,
1377
+ (d) => {
1378
+ if (d.some(
1379
+ ({ pricingItemId: V }) => {
1380
+ var Y;
1381
+ return V === ((Y = l.value.pricing_items[0]) == null ? void 0 : Y.pricing_item_id);
1382
+ }
1383
+ ))
1384
+ return;
1385
+ const M = d.find(({ flexiblePricing: V }) => V) ?? d[0];
1386
+ v.value = M == null ? void 0 : M.pricingItemId;
1387
+ },
1388
+ { immediate: !0 }
1389
+ );
1390
+ const g = s({
1391
+ get: () => {
1392
+ var d;
1393
+ return (d = l.value.pricing_items[0]) == null ? void 0 : d.flexible_amount;
1394
+ },
1395
+ set: (d) => {
1396
+ var M;
1397
+ const c = (M = l.value.pricing_items[0]) == null ? void 0 : M.pricing_item_id;
1398
+ c && (l.value.pricing_items = [
1399
+ { pricing_item_id: c, ...d && { flexible_amount: d } }
1400
+ ]);
1401
+ }
1402
+ }), m = (d) => {
1403
+ var M;
1404
+ const c = (M = y(String(d))) == null ? void 0 : M.fixedPricing;
1405
+ return c != null && c.value.credits ? $e(c.amount) : void 0;
1406
+ }, U = s(
1407
+ () => {
1408
+ var d;
1409
+ return (d = y(String(v.value))) == null ? void 0 : d.flexiblePricing;
1410
+ }
1411
+ ), I = s({
1412
+ get: () => {
1413
+ var d;
1414
+ return ((d = g.value) == null ? void 0 : d.quantity) ?? "";
1415
+ },
1416
+ set: (d) => {
1417
+ var M;
1418
+ const c = (M = U.value) == null ? void 0 : M.currency;
1419
+ g.value = d && c ? { quantity: d, currency: c } : void 0;
1420
+ }
1421
+ }), G = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", _ = s(() => pt(n.topUpPricingItems)), S = (d) => d.creditsConfiguration ? _.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, f = (d) => {
1422
+ var M;
1423
+ const c = (M = y(String(d))) == null ? void 0 : M.flexiblePricing;
1424
+ return c ? [c] : [];
1425
+ }, P = (d) => {
1426
+ var c;
1427
+ return !!((c = y(String(d))) != null && c.flexiblePricing);
1428
+ }, O = s(
1429
+ () => p.value.map((d) => {
1430
+ var c;
1431
+ return {
1432
+ value: d.pricingItemId,
1433
+ label: d.fixedPricing ? u(d.fixedPricing.value) : i({
1434
+ defaultMessage: "Choose your own amount",
1435
+ description: "Label of the choose-your-amount option in the top-up modal",
1436
+ id: "topup_modal.flexible_option.label"
1437
+ }),
1438
+ ...((c = d.flexiblePricing) == null ? void 0 : c.bounds.minimum) && d.flexiblePricing.bounds.maximum && {
1439
+ description: i(
1440
+ {
1441
+ defaultMessage: "Between {minimum} and {maximum}",
1442
+ description: "Bounds of the choose-your-amount option in the top-up modal",
1443
+ id: "topup_modal.flexible_option.bounds"
1444
+ },
1445
+ {
1446
+ minimum: u(d.flexiblePricing.bounds.minimum),
1447
+ maximum: u(d.flexiblePricing.bounds.maximum)
1448
+ }
1449
+ )
1450
+ }
1451
+ };
1452
+ })
1453
+ ), D = s(() => {
1454
+ const d = l.value.pricing_items.filter(
1455
+ (c) => {
1456
+ var M;
1457
+ return !((M = y(c.pricing_item_id)) != null && M.flexiblePricing) || !!c.flexible_amount;
1458
+ }
1459
+ );
1460
+ return d.length > 0 ? d : void 0;
1461
+ }), b = s(() => !n.autoTopUpConfig && p.value.some(({ flexiblePricing: c }) => c) ? mt(n.topUpPricingItems) : void 0), $ = E(), { chargeOnDemandPricingItems: K } = it(), de = _e(), J = E(!1), te = s(
1462
+ () => !!l.value.pricing_plan_schedule_id && !!D.value && !!l.value.payment_method_id
1463
+ ), ce = Ae({
1464
+ paymentMethodId: s(() => l.value.payment_method_id ?? null)
1465
+ }), ne = xe(
1466
+ {
1467
+ paymentMethodId: {
1468
+ required: ie.withMessage(
1469
+ () => i({
1470
+ defaultMessage: "Select a payment method to pay for this top-up.",
1471
+ description: "Error shown under the payment methods in the top-up modal when none is selected on submit",
1472
+ id: "topup_modal.payment_method_required"
1473
+ }),
1474
+ ot
1475
+ )
1476
+ }
1477
+ },
1478
+ ce
1479
+ ), oe = s(() => {
1480
+ const [d] = l.value.pricing_items, c = y(d == null ? void 0 : d.pricing_item_id);
1481
+ return c ? Ao(c, d == null ? void 0 : d.flexible_amount) : void 0;
1482
+ });
1483
+ async function pe() {
1484
+ var c, M, V;
1485
+ ne.value.$touch();
1486
+ const d = (c = $.value) == null ? void 0 : c.validate();
1487
+ if (!(ne.value.$invalid || (M = $.value) != null && M.isInvalid || !te.value || J.value)) {
1488
+ J.value = !0;
1489
+ try {
1490
+ const Y = await K({
1491
+ pricing_plan_schedule_id: l.value.pricing_plan_schedule_id,
1492
+ pricing_items: D.value ?? [],
1493
+ payment_method_id: l.value.payment_method_id,
1494
+ preview: !1
1495
+ });
1496
+ d && ((V = $.value) != null && V.hasChanges) && l.value.payment_method_id && a("save-auto-top-up", {
1497
+ rule: d,
1498
+ paymentMethodId: l.value.payment_method_id
1499
+ }), a("success", Y);
1500
+ } catch (Y) {
1501
+ de.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, Y), a("failure", Y);
1502
+ } finally {
1503
+ J.value = !1;
1504
+ }
1505
+ }
1506
+ }
1507
+ t({ submit: pe, isCharging: J, canSubmit: te, chargedValue: oe });
1508
+ const ae = s({
1509
+ get: () => l.value.payment_method_id ?? void 0,
1510
+ set: (d) => {
1511
+ l.value.payment_method_id = d;
1512
+ }
1513
+ }), { sortedPaymentMethods: me } = yt({
1514
+ paymentMethods: s(() => n.paymentMethods),
1515
+ selectedPaymentMethodId: ae
1516
+ });
1517
+ return (d, c) => (w(), W("form", Ro, [
1518
+ k("div", Vo, [
1519
+ k("div", qo, [
1520
+ O.value.length > 0 ? (w(), C(r(tt), {
1521
+ key: 0,
1522
+ modelValue: v.value,
1523
+ "onUpdate:modelValue": c[3] || (c[3] = (M) => v.value = M),
1524
+ class: "sv-top-up-form__options",
1525
+ name: "top-up-pricing-item",
1526
+ direction: "column",
1527
+ required: "",
1528
+ disabled: J.value,
1529
+ options: O.value,
1530
+ "show-radio": !1,
1531
+ label: r(i)({
1532
+ defaultMessage: "Top up amount",
1533
+ description: "Label above the list of ways to top up the wallet in the top-up modal",
1534
+ id: "topup_modal.pricing_items.label"
1535
+ })
1536
+ }, {
1537
+ label: h(({ option: M, optionValue: V }) => [
1538
+ k("span", null, N(M.label), 1),
1539
+ m(V) ? (w(), C(r(X), {
1540
+ key: 0,
1541
+ tag: "span",
1542
+ variant: "body-sm",
1543
+ color: "subtle",
1544
+ weight: "normal",
1545
+ "no-spacing": "",
1546
+ class: "sv-top-up-form__option-cost"
1547
+ }, {
1548
+ default: h(() => [
1549
+ F(N(m(V)), 1)
1550
+ ]),
1551
+ _: 2
1552
+ }, 1024)) : R("", !0)
1553
+ ]),
1554
+ description: h(({ option: M, optionValue: V }) => [
1555
+ k("div", Fo, [
1556
+ M.description && !P(V) ? (w(), C(r(X), {
1557
+ key: 0,
1558
+ tag: "span",
1559
+ variant: "body-xs",
1560
+ color: "subtle",
1561
+ "no-spacing": ""
1562
+ }, {
1563
+ default: h(() => [
1564
+ F(N(M.description), 1)
1565
+ ]),
1566
+ _: 2
1567
+ }, 1024)) : R("", !0),
1568
+ f(V).length > 0 ? (w(), C(r(nt), {
1569
+ key: 1,
1570
+ "is-open": String(V) === v.value,
1571
+ lazy: ""
1572
+ }, {
1573
+ default: h(() => [
1574
+ (w(!0), W(ge, null, he(f(V), (Y) => {
1575
+ var q;
1576
+ return w(), W("div", {
1577
+ key: Y.currency,
1578
+ class: "sv-top-up-form__amount grid grid-cols-1 gap-3",
1579
+ onClick: c[1] || (c[1] = Ne(() => {
1580
+ }, ["stop"])),
1581
+ onKeydown: c[2] || (c[2] = Ne(() => {
1582
+ }, ["stop"]))
1583
+ }, [
1584
+ M.description ? (w(), C(r(X), {
1585
+ key: 0,
1586
+ tag: "span",
1587
+ variant: "body-xs",
1588
+ color: "subtle",
1589
+ "no-spacing": ""
1590
+ }, {
1591
+ default: h(() => [
1592
+ F(N(M.description), 1)
1593
+ ]),
1594
+ _: 2
1595
+ }, 1024)) : R("", !0),
1596
+ A(Se, {
1597
+ modelValue: I.value,
1598
+ "onUpdate:modelValue": c[0] || (c[0] = (j) => I.value = j),
1599
+ name: "top-up-amount",
1600
+ "model-base": "AMOUNT",
1601
+ unit: S(Y),
1602
+ "entry-base": G(Y),
1603
+ currency: Y.currency,
1604
+ "conversion-rate": (q = Y.creditsConfiguration) == null ? void 0 : q.conversionRate,
1605
+ required: "",
1606
+ disabled: J.value
1607
+ }, null, 8, ["modelValue", "unit", "entry-base", "currency", "conversion-rate", "disabled"])
1608
+ ], 32);
1609
+ }), 128))
1610
+ ]),
1611
+ _: 2
1612
+ }, 1032, ["is-open"])) : R("", !0)
1613
+ ])
1614
+ ]),
1615
+ _: 1
1616
+ }, 8, ["modelValue", "disabled", "options", "label"])) : R("", !0)
1617
+ ]),
1618
+ k("div", null, [
1619
+ A(ft, {
1620
+ "pricing-plan-schedule-id": T.value,
1621
+ "pricing-items": D.value
1622
+ }, null, 8, ["pricing-plan-schedule-id", "pricing-items"])
1623
+ ]),
1624
+ b.value ? (w(), W("div", Lo, [
1625
+ A(_t, le({
1626
+ ref_key: "autoTopUpFormRef",
1627
+ ref: $,
1628
+ class: "sv-top-up-form__auto-top-up"
1629
+ }, b.value, {
1630
+ contained: "",
1631
+ "show-threshold-conversion": !1,
1632
+ disabled: J.value
1633
+ }), null, 16, ["disabled"])
1634
+ ])) : R("", !0),
1635
+ k("div", null, [
1636
+ A(r(Lt), { spacing: "xs" })
1637
+ ]),
1638
+ k("div", null, [
1639
+ se(d.$slots, "payment-method", {}, () => [
1640
+ A(st, {
1641
+ modelValue: ae.value,
1642
+ "onUpdate:modelValue": c[4] || (c[4] = (M) => ae.value = M),
1643
+ class: "sv-top-up-form__payment-methods",
1644
+ "payment-methods": r(me),
1645
+ required: "",
1646
+ error: r(ne).paymentMethodId.$errors,
1647
+ "payment-method-options": e.paymentMethodOptions,
1648
+ disabled: J.value,
1649
+ label: r(i)({
1650
+ defaultMessage: "Payment method",
1651
+ description: "Label above the payment method that pays for the top-up, in the top-up modal",
1652
+ id: "topup_modal.payment_method_selector.label"
1653
+ }),
1654
+ onAddPaymentMethod: c[5] || (c[5] = (M) => a("add-payment-method"))
1655
+ }, null, 8, ["modelValue", "payment-methods", "error", "payment-method-options", "disabled", "label"])
1656
+ ])
1657
+ ])
1658
+ ])
1659
+ ]));
1660
+ }
1661
+ }), Ho = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, Wo = /* @__PURE__ */ z({
1662
+ __name: "TopUpModalSuccess",
1663
+ props: {
1664
+ addedValue: { type: Object },
1665
+ invoice: { type: Object }
1666
+ },
1667
+ setup(e) {
1668
+ const { $t: t } = Q();
1669
+ return (o, n) => (w(), W("div", Ho, [
1670
+ e.invoice ? (w(), C(r(fe), {
1671
+ key: 0,
1672
+ "content-background": "none"
1673
+ }, {
1674
+ default: h(() => [
1675
+ A(r(X), {
1676
+ tag: "span",
1677
+ variant: "body-sm",
1678
+ weight: "semibold",
1679
+ class: "mb-2 block"
1680
+ }, {
1681
+ default: h(() => [
1682
+ F(N(r(t)({
1683
+ defaultMessage: "Receipt",
1684
+ description: "Heading above the invoice a completed top-up produced",
1685
+ id: "topup_modal.success.receipt.heading"
1686
+ })), 1)
1687
+ ]),
1688
+ _: 1
1689
+ }),
1690
+ A(r(at), {
1691
+ invoice: e.invoice,
1692
+ "is-customer-facing": ""
1693
+ }, null, 8, ["invoice"])
1694
+ ]),
1695
+ _: 1
1696
+ })) : R("", !0)
1697
+ ]));
1698
+ }
1699
+ });
1700
+ function jo({
1701
+ step: e,
1702
+ currentBalance: t,
1703
+ topUpValue: o
1704
+ }) {
1705
+ const { $t: n, formatNumber: a } = Q(), i = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1706
+ defaultMessage: "Add payment method",
1707
+ description: "Title of the top-up modal while the customer is adding a payment method",
1708
+ id: "topup_modal.add_payment_method.title"
1709
+ }) : e.value === "SUCCESS" ? n({
1710
+ defaultMessage: "Top-up complete",
1711
+ description: "Title of the top-up modal once the top-up has been charged",
1712
+ id: "topup_modal.success.modal_title"
1713
+ }) : n({
1714
+ defaultMessage: "Top up balance",
1715
+ description: "Title of the wallet top-up modal",
1716
+ id: "topup_modal.title"
1717
+ })), u = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1718
+ defaultMessage: "Add a new payment method for topping up your balance.",
1719
+ description: "Subtitle of the top-up modal while the customer is adding a payment method",
1720
+ id: "topup_modal.add_payment_method.subtitle"
1721
+ }) : e.value === "SUCCESS" ? n({
1722
+ defaultMessage: "Your payment went through.",
1723
+ description: "Subtitle of the top-up modal once the top-up has been charged",
1724
+ id: "topup_modal.success.modal_subtitle"
1725
+ }) : n(
1726
+ {
1727
+ defaultMessage: "Your current balance is {balance}.",
1728
+ description: "Subtitle of the top-up modal showing the current wallet balance",
1729
+ id: "topup_modal.subtitle"
1730
+ },
1731
+ { balance: t.value }
1732
+ )), l = s(
1733
+ () => e.value === "ADD_PAYMENT_METHOD" ? n({
1734
+ defaultMessage: "Back",
1735
+ description: "Label of the button that leaves the add payment method step in the top-up modal",
1736
+ id: "topup_modal.back_button.label"
1737
+ }) : n({
1738
+ defaultMessage: "Cancel",
1739
+ description: "Label of the button that closes the top-up modal",
1740
+ id: "topup_modal.cancel_button.label"
1741
+ })
1742
+ ), p = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1743
+ defaultMessage: "Save payment method",
1744
+ description: "Label of the confirm button in the top-up modal while adding a payment method",
1745
+ id: "topup_modal.save_payment_method.label"
1746
+ }) : e.value === "SUCCESS" ? n({
1747
+ defaultMessage: "Done",
1748
+ description: "Label of the button that dismisses the top-up modal once the top-up has been charged",
1749
+ id: "topup_modal.done_button.label"
1750
+ }) : o.value ? n(
1751
+ {
1752
+ defaultMessage: "Top up balance with {value}",
1753
+ description: "Label of the confirm button in the top-up modal once an amount is entered",
1754
+ id: "topup_modal.confirm_button.label"
1755
+ },
1756
+ { value: Ce(n, a, o.value) }
1757
+ ) : n({
1758
+ defaultMessage: "Top up balance",
1759
+ description: "Label of the confirm button in the top-up modal while no amount is entered",
1760
+ id: "topup_modal.confirm_button.empty.label"
1761
+ }));
1762
+ return { title: i, subTitle: u, cancelButtonText: l, confirmButtonText: p };
1763
+ }
1764
+ function bt({
1765
+ isOpen: e,
1766
+ customer: t
1767
+ }) {
1768
+ const { paymentMethodOptions: o, get: n, isPending: a } = Gt();
1769
+ ee(
1770
+ () => [e.value, t.value],
1771
+ ([u, l]) => {
1772
+ !u || !l || n({
1773
+ customerId: l.id,
1774
+ country: Qt(l)
1775
+ });
1776
+ },
1777
+ { immediate: !0 }
1778
+ );
1779
+ const i = s(
1780
+ () => a.value ? void 0 : o.value
1781
+ );
1782
+ return { paymentMethodOptions: o, settledOptions: i, isPending: a };
1783
+ }
1784
+ function zo(e) {
1785
+ const t = E(0), o = (a) => {
1786
+ t.value = (a == null ? void 0 : a.offsetHeight) ?? 0;
1787
+ }, n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
1788
+ var u;
1789
+ const i = (u = a[0]) == null ? void 0 : u.target;
1790
+ o(i instanceof HTMLElement ? i : void 0);
1791
+ });
1792
+ return ee(
1793
+ e,
1794
+ (a, i) => {
1795
+ i && (n == null || n.unobserve(i)), o(a), a && (n == null || n.observe(a));
1796
+ },
1797
+ // `post` so the callback runs after the render that assigns the template ref, not before.
1798
+ { immediate: !0, flush: "post" }
1799
+ ), Pe(() => {
1800
+ n == null || n.disconnect();
1801
+ }), t;
1802
+ }
1803
+ const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
1804
+ __name: "SlidingPanes",
1805
+ props: {
1806
+ panes: { type: Array },
1807
+ current: { type: String }
1808
+ },
1809
+ setup(e) {
1810
+ const t = e, o = E(!1);
1811
+ let n;
1812
+ ee(
1813
+ () => t.current,
1814
+ () => {
1815
+ o.value = !0, clearTimeout(n), n = setTimeout(() => {
1816
+ o.value = !1;
1817
+ }, Go);
1818
+ }
1819
+ ), Pe(() => {
1820
+ clearTimeout(n);
1821
+ });
1822
+ const a = E({}), i = {}, u = (T) => i[T] ?? (i[T] = (x) => {
1823
+ a.value[T] = x instanceof HTMLElement ? x : void 0;
1824
+ }), l = s(() => a.value[t.current]), p = zo(l), y = s(() => {
1825
+ const T = t.panes.indexOf(t.current);
1826
+ return T > 0 ? `translateX(calc(${-T} * (100% + ${Ko})))` : "translateX(0px)";
1827
+ });
1828
+ return (T, x) => (w(), W("div", {
1829
+ class: ze([
1830
+ "sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",
1831
+ o.value ? "transition-[height] duration-300 ease-in-out motion-reduce:transition-none" : ""
1832
+ ]),
1833
+ style: ke(r(p) ? { height: `${r(p)}px` } : void 0)
1834
+ }, [
1835
+ k("div", {
1836
+ class: "sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",
1837
+ style: ke({ transform: y.value })
1838
+ }, [
1839
+ (w(!0), W(ge, null, he(e.panes, (v) => (w(), W("div", {
1840
+ key: v,
1841
+ class: "sv-sliding-panes__pane w-full shrink-0",
1842
+ inert: v !== e.current || void 0
1843
+ }, [
1844
+ k("div", {
1845
+ ref_for: !0,
1846
+ ref: u(v)
1847
+ }, [
1848
+ se(T.$slots, v)
1849
+ ], 512)
1850
+ ], 8, Qo))), 128))
1851
+ ], 4)
1852
+ ], 6));
1853
+ }
1854
+ }), Jo = { class: "grid grid-cols-1 gap-4 pb-4" }, wt = /* @__PURE__ */ z({
1855
+ __name: "WalletModalShell",
1856
+ props: {
1857
+ showModal: { type: Boolean },
1858
+ title: { type: String },
1859
+ subTitle: { type: String },
1860
+ cancelButtonText: { type: String },
1861
+ confirmButtonText: { type: String },
1862
+ isPending: { type: Boolean },
1863
+ panes: { type: Array },
1864
+ step: { type: String },
1865
+ addPaymentMethodPane: { type: String },
1866
+ customer: { type: Object },
1867
+ paymentMethodOptions: { type: Array },
1868
+ isPaymentMethodOptionsPending: { type: Boolean },
1869
+ isAddingPaymentMethod: { type: Boolean }
1870
+ },
1871
+ emits: ["confirm", "cancel", "payment-success", "payment-failed"],
1872
+ setup(e, { expose: t }) {
1873
+ const o = e, n = E(), a = s(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
1874
+ return t({
1875
+ submit: () => {
1876
+ var i;
1877
+ return (i = n.value) == null ? void 0 : i.submit();
1878
+ },
1879
+ isSaving: s(() => {
1880
+ var i;
1881
+ return !!((i = n.value) != null && i.isSaving);
1882
+ })
1883
+ }), (i, u) => (w(), C(r(lt), {
1884
+ "no-click-away": "",
1885
+ "show-modal": e.showModal,
1886
+ size: "lg",
1887
+ title: e.title,
1888
+ "sub-title": e.subTitle,
1889
+ "cancel-button-text": e.cancelButtonText,
1890
+ "confirm-button-text": e.confirmButtonText,
1891
+ "is-loading": e.isPending,
1892
+ onConfirm: u[2] || (u[2] = (l) => i.$emit("confirm")),
1893
+ onClose: u[3] || (u[3] = (l) => i.$emit("cancel"))
1894
+ }, re({
1895
+ body: h(() => [
1896
+ k("div", Jo, [
1897
+ A(Xo, {
1898
+ panes: e.panes,
1899
+ current: e.step
1900
+ }, re({
1901
+ [e.addPaymentMethodPane]: h(() => [
1902
+ A(jt, {
1903
+ ref_key: "paneRef",
1904
+ ref: n,
1905
+ customer: e.customer,
1906
+ "payment-method-options": e.paymentMethodOptions,
1907
+ "is-loading": e.isPaymentMethodOptionsPending,
1908
+ "is-active": e.isAddingPaymentMethod,
1909
+ onSuccess: u[0] || (u[0] = (l) => i.$emit("payment-success")),
1910
+ onFailure: u[1] || (u[1] = (l) => i.$emit("payment-failed", l))
1911
+ }, null, 8, ["customer", "payment-method-options", "is-loading", "is-active"])
1912
+ ]),
1913
+ _: 2
1914
+ }, [
1915
+ he(a.value, (l) => ({
1916
+ name: l,
1917
+ fn: h(() => [
1918
+ se(i.$slots, l)
1919
+ ])
1920
+ }))
1921
+ ]), 1032, ["panes", "current"])
1922
+ ])
1923
+ ]),
1924
+ _: 2
1925
+ }, [
1926
+ i.$slots.footer ? {
1927
+ name: "footer",
1928
+ fn: h(() => [
1929
+ se(i.$slots, "footer")
1930
+ ]),
1931
+ key: "0"
1932
+ } : void 0
1933
+ ]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-loading"]));
1934
+ }
1935
+ }), Tt = (e) => {
1936
+ var t;
1937
+ return (((t = e == null ? void 0 : e.wallet) == null ? void 0 : t.auto_top_up_configs) ?? []).find(
1938
+ ({ status: o }) => o === "ACTIVE"
1939
+ );
1940
+ }, Mt = (e) => e ? {
1941
+ status: e.status,
1942
+ threshold: e.threshold,
1943
+ ...e.topup_amount && { topup_amount: e.topup_amount }
1944
+ } : void 0, Ut = (e, t = []) => {
1945
+ if (e != null && e.pricing_item_id && e.pricing_plan_schedule_id)
1946
+ return {
1947
+ pricingItemId: e.pricing_item_id,
1948
+ pricingPlanScheduleId: e.pricing_plan_schedule_id
1949
+ };
1950
+ const o = t.find(
1951
+ ({ flexiblePricing: n, pricingPlanScheduleId: a }) => n && a
1952
+ );
1953
+ return o != null && o.pricingPlanScheduleId ? {
1954
+ pricingItemId: o.pricingItemId,
1955
+ pricingPlanScheduleId: o.pricingPlanScheduleId
1956
+ } : void 0;
1957
+ }, St = ({
1958
+ rule: e,
1959
+ walletBalanceItem: t,
1960
+ chargeTarget: o,
1961
+ paymentMethodId: n
1962
+ }) => {
1963
+ var i, u;
1964
+ const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((u = e == null ? void 0 : e.threshold) == null ? void 0 : u.credits));
1965
+ if (!(!e || !a || !(t != null && t.wallet_id) || !o || !n))
1966
+ return {
1967
+ wallet_id: t.wallet_id,
1968
+ status: e.status,
1969
+ threshold: e.threshold,
1970
+ pricing_plan_schedule_id: o.pricingPlanScheduleId,
1971
+ pricing_item_id: o.pricingItemId,
1972
+ payment_method_id: n,
1973
+ ...e.topup_amount && { topup_amount: e.topup_amount }
1974
+ };
1975
+ };
1976
+ function Pt({
1977
+ step: e,
1978
+ name: t,
1979
+ returnTo: o
1980
+ }) {
1981
+ const n = E();
1982
+ return {
1983
+ paneRef: n,
1984
+ isActive: s(() => e.value === t),
1985
+ isSaving: s(() => {
1986
+ var a;
1987
+ return !!((a = n.value) != null && a.isSaving);
1988
+ }),
1989
+ open: () => {
1990
+ e.value = t;
1991
+ },
1992
+ leave: () => {
1993
+ e.value = o;
1994
+ },
1995
+ submit: () => {
1996
+ var a;
1997
+ return (a = n.value) == null ? void 0 : a.submit();
1998
+ }
1999
+ };
2000
+ }
2001
+ function At() {
2002
+ const e = Qe(), t = Ge(), o = "/portal/auto-top-up-configs";
2003
+ function n(l) {
2004
+ return e({
2005
+ url: `${t.apiUrls.config}${o}`,
2006
+ query: { ...l },
2007
+ isCollection: !0
2008
+ });
2009
+ }
2010
+ function a(l) {
2011
+ return e({
2012
+ url: `${t.apiUrls.config}${o}/${l}`
2013
+ });
2014
+ }
2015
+ function i(l) {
2016
+ return e({
2017
+ url: `${t.apiUrls.config}${o}`,
2018
+ options: { method: "POST" },
2019
+ data: l
2020
+ });
2021
+ }
2022
+ function u(l) {
2023
+ return e({
2024
+ url: `${t.apiUrls.config}${o}/${l}/deactivate`,
2025
+ options: { method: "POST" }
2026
+ });
2027
+ }
2028
+ return {
2029
+ getAutoTopUpConfigs: n,
2030
+ getAutoTopUpConfig: a,
2031
+ createAutoTopUpConfig: i,
2032
+ deactivateAutoTopUpConfig: u
2033
+ };
2034
+ }
2035
+ function Ct() {
2036
+ const { createAutoTopUpConfig: e } = At(), t = _e(), o = E(!1);
2037
+ return { save: async (a) => {
2038
+ if (!a || o.value)
2039
+ return { saved: !1 };
2040
+ o.value = !0;
2041
+ try {
2042
+ return await e(a), { saved: !0 };
2043
+ } catch (i) {
2044
+ return t.error(
2045
+ "AUTO_TOP_UP_SAVE_FAILED",
2046
+ "Failed to save the automatic top-up rule",
2047
+ {},
2048
+ i
2049
+ ), { saved: !1, error: i };
2050
+ } finally {
2051
+ o.value = !1;
2052
+ }
2053
+ }, isSaving: o };
2054
+ }
2055
+ const Zo = {
2056
+ key: 0,
2057
+ class: "mb-4"
2058
+ }, en = { class: "sr-only" }, tn = { class: "flex flex-col gap-2" }, on = /* @__PURE__ */ z({
2059
+ __name: "TopUpModal",
2060
+ props: {
2061
+ showModal: { type: Boolean },
2062
+ selectedBalanceItem: { type: Object },
2063
+ paymentMethods: { type: Array },
2064
+ customer: { type: Object },
2065
+ subscriptions: { type: Array }
2066
+ },
2067
+ emits: ["confirm", "close", "auto-top-up-saved", "payment-success", "payment-failed"],
2068
+ setup(e, { emit: t }) {
2069
+ const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(), u = s(
2070
+ () => Mt(Tt(o.selectedBalanceItem))
2071
+ ), l = s(() => i(o.selectedBalanceItem)), p = s(
2072
+ () => vo(o.selectedBalanceItem, o.subscriptions ?? [])
2073
+ ), y = E();
2074
+ ee(
2075
+ p,
2076
+ (B) => {
2077
+ var L;
2078
+ B.some(
2079
+ ({ id: be }) => be === y.value
2080
+ ) || (y.value = (L = B[0]) == null ? void 0 : L.id);
2081
+ },
2082
+ { immediate: !0 }
2083
+ );
2084
+ const T = s(() => p.value.length > 1), x = s(
2085
+ () => p.value.map(({ id: B, name: H }) => ({ value: B, label: H }))
2086
+ ), v = s(
2087
+ () => Object.fromEntries(
2088
+ p.value.flatMap(({ id: B, enabledPricingIds: H }) => {
2089
+ const L = (o.subscriptions ?? []).find(({ id: be }) => be === B);
2090
+ return L ? [[B, { subscription: L, enabledPricingIds: H }]] : [];
2091
+ })
2092
+ )
2093
+ ), g = s(() => {
2094
+ var H;
2095
+ if (!o.selectedBalanceItem || !((H = o.subscriptions) != null && H.length))
2096
+ return o.selectedBalanceItem;
2097
+ const B = p.value.find(({ id: L }) => L === y.value);
2098
+ return B ? go(o.selectedBalanceItem, B.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
2099
+ }), m = s(() => ut(g.value)), {
2100
+ paymentMethodOptions: U,
2101
+ settledOptions: I,
2102
+ isPending: G
2103
+ } = bt({
2104
+ isOpen: s(() => o.showModal),
2105
+ customer: s(() => o.customer)
2106
+ }), _ = E("TOP_UP"), S = s(() => (o.paymentMethods ?? []).length > 0), f = s(
2107
+ () => !G.value && (U.value ?? []).length === 0
2108
+ ), P = s(
2109
+ () => _.value === "TOP_UP" && !S.value && f.value
2110
+ ), O = E(), D = E(), b = () => {
2111
+ te(), n("payment-success");
2112
+ }, {
2113
+ paneRef: $,
2114
+ isActive: K,
2115
+ isSaving: de,
2116
+ open: J,
2117
+ leave: te,
2118
+ submit: ce
2119
+ } = Pt({ step: _, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: ne } = Ct(), oe = E(), pe = s(() => {
2120
+ var B;
2121
+ return (B = oe.value) == null ? void 0 : B.chargedValue;
2122
+ }), ae = s(() => {
2123
+ var B;
2124
+ return de.value || !!((B = oe.value) != null && B.isCharging);
2125
+ }), { title: me, subTitle: d, cancelButtonText: c, confirmButtonText: M } = jo({
2126
+ step: _,
2127
+ currentBalance: l,
2128
+ topUpValue: pe
2129
+ }), V = () => {
2130
+ var B;
2131
+ if (K.value) {
2132
+ ce();
2133
+ return;
2134
+ }
2135
+ (B = oe.value) == null || B.submit();
2136
+ }, Y = async ({
2137
+ rule: B,
2138
+ paymentMethodId: H
2139
+ }) => {
2140
+ const { saved: L } = await ne(
2141
+ St({
2142
+ rule: B,
2143
+ walletBalanceItem: o.selectedBalanceItem,
2144
+ chargeTarget: Ut(void 0, m.value),
2145
+ paymentMethodId: H
2146
+ })
2147
+ );
2148
+ L && n("auto-top-up-saved");
2149
+ }, q = (B) => {
2150
+ var H;
2151
+ O.value = B, D.value = (H = oe.value) == null ? void 0 : H.chargedValue, _.value = "SUCCESS";
2152
+ }, j = () => {
2153
+ n("confirm"), n("close");
2154
+ }, Z = () => {
2155
+ if (!ae.value) {
2156
+ if (K.value) {
2157
+ te();
2158
+ return;
2159
+ }
2160
+ if (_.value === "SUCCESS") {
2161
+ j();
2162
+ return;
2163
+ }
2164
+ n("close");
2165
+ }
2166
+ }, De = E(0);
2167
+ return ee(
2168
+ () => o.showModal,
2169
+ (B) => {
2170
+ B && (_.value = "TOP_UP", O.value = void 0, D.value = void 0, De.value += 1);
2171
+ }
2172
+ ), (B, H) => (w(), C(wt, {
2173
+ ref_key: "addPaymentMethodRef",
2174
+ ref: $,
2175
+ "show-modal": e.showModal,
2176
+ title: r(me),
2177
+ "sub-title": r(d),
2178
+ "cancel-button-text": r(c),
2179
+ "confirm-button-text": r(M),
2180
+ "is-pending": ae.value,
2181
+ panes: r(mo),
2182
+ step: _.value,
2183
+ "add-payment-method-pane": "ADD_PAYMENT_METHOD",
2184
+ customer: e.customer,
2185
+ "payment-method-options": r(U),
2186
+ "is-payment-method-options-pending": r(G),
2187
+ "is-adding-payment-method": r(K),
2188
+ onConfirm: V,
2189
+ onCancel: Z,
2190
+ onPaymentSuccess: b,
2191
+ onPaymentFailed: H[1] || (H[1] = (L) => B.$emit("payment-failed", L))
2192
+ }, re({
2193
+ TOP_UP: h(() => [
2194
+ T.value ? (w(), W("div", Zo, [
2195
+ A(r(tt), {
2196
+ modelValue: y.value,
2197
+ "onUpdate:modelValue": H[0] || (H[0] = (L) => y.value = L),
2198
+ class: "sv-topup-modal__subscription",
2199
+ name: "top-up-subscription",
2200
+ direction: "column",
2201
+ required: "",
2202
+ options: x.value,
2203
+ "show-radio": !1,
2204
+ label: r(a)({
2205
+ defaultMessage: "Subscription to top up",
2206
+ description: "Label above the list of subscriptions a top-up can be charged against, in the top-up modal",
2207
+ id: "topup_modal.subscriptions.label"
2208
+ })
2209
+ }, {
2210
+ prefix: h(({ optionValue: L }) => [
2211
+ v.value[String(L)] ? (w(), C(zt, {
2212
+ key: 0,
2213
+ class: "sv-topup-modal__subscription-option grow",
2214
+ "no-spacing": "",
2215
+ subscription: v.value[String(L)].subscription,
2216
+ "enabled-pricing-ids": v.value[String(L)].enabledPricingIds
2217
+ }, null, 8, ["subscription", "enabled-pricing-ids"])) : R("", !0)
2218
+ ]),
2219
+ label: h(({ option: L }) => [
2220
+ k("span", en, N(L.label), 1)
2221
+ ]),
2222
+ _: 1
2223
+ }, 8, ["modelValue", "options", "label"])
2224
+ ])) : R("", !0),
2225
+ (w(), C(Yo, {
2226
+ key: De.value,
2227
+ ref_key: "topUpFormRef",
2228
+ ref: oe,
2229
+ "top-up-pricing-items": m.value,
2230
+ "payment-methods": e.paymentMethods,
2231
+ "auto-top-up-config": u.value,
2232
+ "payment-method-options": r(I),
2233
+ onAddPaymentMethod: r(J),
2234
+ onSuccess: q,
2235
+ onSaveAutoTopUp: Y
2236
+ }, null, 8, ["top-up-pricing-items", "payment-methods", "auto-top-up-config", "payment-method-options", "onAddPaymentMethod"]))
2237
+ ]),
2238
+ SUCCESS: h(() => [
2239
+ O.value ? (w(), C(Wo, {
2240
+ key: 0,
2241
+ "added-value": D.value,
2242
+ invoice: O.value
2243
+ }, null, 8, ["added-value", "invoice"])) : R("", !0)
2244
+ ]),
2245
+ _: 2
2246
+ }, [
2247
+ _.value === "SUCCESS" || P.value ? {
2248
+ name: "footer",
2249
+ fn: h(() => [
2250
+ k("div", tn, [
2251
+ _.value === "SUCCESS" ? (w(), C(r(ue), {
2252
+ key: 0,
2253
+ size: "lg",
2254
+ "data-testid": "done",
2255
+ onClick: j
2256
+ }, {
2257
+ default: h(() => [
2258
+ F(N(r(M)), 1)
2259
+ ]),
2260
+ _: 1
2261
+ })) : (w(), W(ge, { key: 1 }, [
2262
+ A(r(ue), {
2263
+ size: "lg",
2264
+ disabled: "",
2265
+ "data-testid": "confirm"
2266
+ }, {
2267
+ default: h(() => [
2268
+ F(N(r(M)), 1)
2269
+ ]),
2270
+ _: 1
2271
+ }),
2272
+ A(r(ue), {
2273
+ size: "lg",
2274
+ intent: "subtle",
2275
+ "data-testid": "cancel",
2276
+ onClick: Z
2277
+ }, {
2278
+ default: h(() => [
2279
+ F(N(r(c)), 1)
2280
+ ]),
2281
+ _: 1
2282
+ })
2283
+ ], 64))
2284
+ ])
2285
+ ]),
2286
+ key: "0"
2287
+ } : void 0
2288
+ ]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-pending", "panes", "step", "customer", "payment-method-options", "is-payment-method-options-pending", "is-adding-payment-method"]));
2289
+ }
2290
+ }), nn = ["AUTO_TOP_UP", "ADD_PAYMENT_METHOD"], an = { class: "grid grid-cols-1 gap-4" }, sn = /* @__PURE__ */ z({
2291
+ __name: "AutoTopUpModal",
2292
+ props: {
2293
+ showModal: { type: Boolean },
2294
+ walletBalanceItem: { type: Object },
2295
+ topUpItem: { type: Object },
2296
+ paymentMethods: { type: Array },
2297
+ customer: { type: Object }
2298
+ },
2299
+ emits: ["saved", "close", "payment-success", "payment-failed"],
2300
+ setup(e, { emit: t }) {
2301
+ const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(), u = E("AUTO_TOP_UP"), l = s(() => i(o.walletBalanceItem)), p = s(() => ut(o.walletBalanceItem)), y = s(() => mt(p.value)), T = s(() => Tt(o.walletBalanceItem)), x = s(() => Mt(T.value)), v = s(
2302
+ () => Ut(o.topUpItem, p.value)
2303
+ ), g = E(), m = s(() => {
2304
+ var j, Z;
2305
+ const q = (Z = (j = g.value) == null ? void 0 : j.rule) == null ? void 0 : Z.topup_amount;
2306
+ return q != null && q.quantity && v.value ? [{ pricing_item_id: v.value.pricingItemId, flexible_amount: q }] : void 0;
2307
+ }), U = s(() => {
2308
+ var q;
2309
+ return (q = v.value) == null ? void 0 : q.pricingPlanScheduleId;
2310
+ }), I = E(), { sortedPaymentMethods: G } = yt({
2311
+ paymentMethods: s(() => o.paymentMethods),
2312
+ selectedPaymentMethodId: I,
2313
+ preferredPaymentMethodId: s(() => {
2314
+ var q;
2315
+ return (q = T.value) == null ? void 0 : q.payment_method_id;
2316
+ })
2317
+ }), {
2318
+ paymentMethodOptions: _,
2319
+ settledOptions: S,
2320
+ isPending: f
2321
+ } = bt({
2322
+ isOpen: s(() => o.showModal),
2323
+ customer: s(() => o.customer)
2324
+ }), {
2325
+ paneRef: P,
2326
+ isActive: O,
2327
+ isSaving: D,
2328
+ open: b,
2329
+ leave: $,
2330
+ submit: K
2331
+ } = Pt({ step: u, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: de, isSaving: J } = Ct(), te = s(() => D.value || J.value), ce = Ae({
2332
+ paymentMethodId: s(() => I.value ?? null)
2333
+ }), ne = xe(
2334
+ {
2335
+ paymentMethodId: {
2336
+ required: ie.withMessage(
2337
+ () => a({
2338
+ defaultMessage: "Select a payment method to pay for automatic top-ups.",
2339
+ description: "Error shown in the auto top-up modal when no payment method is selected",
2340
+ id: "auto_topup_modal.payment_method.required"
2341
+ }),
2342
+ ot
2343
+ )
2344
+ }
2345
+ },
2346
+ ce
2347
+ ), oe = s(
2348
+ () => u.value === "ADD_PAYMENT_METHOD" ? a({
2349
+ defaultMessage: "Add payment method",
2350
+ description: "Title of the auto top-up modal while the customer is adding a payment method",
2351
+ id: "auto_topup_modal.add_payment_method.title"
2352
+ }) : a({
2353
+ defaultMessage: "Automatic top-up",
2354
+ description: "Title of the automatic wallet top-up modal",
2355
+ id: "auto_topup_modal.title"
2356
+ })
2357
+ ), pe = s(
2358
+ () => u.value === "ADD_PAYMENT_METHOD" ? a({
2359
+ defaultMessage: "This method pays for every automatic top-up.",
2360
+ description: "Subtitle of the auto top-up modal while the customer is adding a payment method",
2361
+ id: "auto_topup_modal.add_payment_method.subtitle"
2362
+ }) : a(
2363
+ {
2364
+ defaultMessage: "Your current balance is {balance}. Enable auto top so you can stay productive",
2365
+ description: "Subtitle of the automatic wallet top-up modal, naming the balance",
2366
+ id: "auto_topup_modal.subtitle"
2367
+ },
2368
+ { balance: l.value }
2369
+ )
2370
+ ), ae = s(
2371
+ () => u.value === "ADD_PAYMENT_METHOD" ? a({
2372
+ defaultMessage: "Back",
2373
+ description: "Button returning from adding a payment method to the auto top-up rule",
2374
+ id: "auto_topup_modal.add_payment_method.cancel"
2375
+ }) : a({
2376
+ defaultMessage: "Cancel",
2377
+ description: "Button dismissing the auto top-up modal",
2378
+ id: "auto_topup_modal.cancel"
2379
+ })
2380
+ ), me = s(
2381
+ () => u.value === "ADD_PAYMENT_METHOD" ? a({
2382
+ defaultMessage: "Add payment method",
2383
+ description: "Button storing the payment method being added in the auto top-up modal",
2384
+ id: "auto_topup_modal.add_payment_method.confirm"
2385
+ }) : a({
2386
+ defaultMessage: "Save",
2387
+ description: "Button saving the automatic top-up rule",
2388
+ id: "auto_topup_modal.confirm"
2389
+ })
2390
+ );
2391
+ async function d() {
2392
+ var Z;
2393
+ if (ne.value.$touch(), te.value)
2394
+ return;
2395
+ const { saved: q, error: j } = await de(
2396
+ St({
2397
+ rule: (Z = g.value) == null ? void 0 : Z.validate(),
2398
+ walletBalanceItem: o.walletBalanceItem,
2399
+ chargeTarget: v.value,
2400
+ paymentMethodId: I.value
2401
+ })
2402
+ );
2403
+ if (q) {
2404
+ n("saved"), n("close");
2405
+ return;
2406
+ }
2407
+ j && n("payment-failed", j);
2408
+ }
2409
+ const c = () => {
2410
+ if (O.value) {
2411
+ K();
2412
+ return;
2413
+ }
2414
+ d();
2415
+ }, M = () => {
2416
+ $(), n("payment-success");
2417
+ }, V = () => {
2418
+ if (!te.value) {
2419
+ if (O.value) {
2420
+ $();
2421
+ return;
2422
+ }
2423
+ n("close");
2424
+ }
2425
+ }, Y = E(0);
2426
+ return ee(
2427
+ () => o.showModal,
2428
+ (q) => {
2429
+ q && (u.value = "AUTO_TOP_UP", I.value = void 0, Y.value += 1);
2430
+ }
2431
+ ), (q, j) => (w(), C(wt, {
2432
+ ref_key: "addPaymentMethodRef",
2433
+ ref: P,
2434
+ "show-modal": e.showModal,
2435
+ title: oe.value,
2436
+ "sub-title": pe.value,
2437
+ "cancel-button-text": ae.value,
2438
+ "confirm-button-text": me.value,
2439
+ "is-pending": te.value,
2440
+ panes: r(nn),
2441
+ step: u.value,
2442
+ "add-payment-method-pane": "ADD_PAYMENT_METHOD",
2443
+ customer: e.customer,
2444
+ "payment-method-options": r(_),
2445
+ "is-payment-method-options-pending": r(f),
2446
+ "is-adding-payment-method": r(O),
2447
+ onConfirm: c,
2448
+ onCancel: V,
2449
+ onPaymentSuccess: M,
2450
+ onPaymentFailed: j[1] || (j[1] = (Z) => q.$emit("payment-failed", Z))
2451
+ }, {
2452
+ AUTO_TOP_UP: h(() => [
2453
+ k("div", an, [
2454
+ y.value ? (w(), C(_t, le({
2455
+ key: Y.value,
2456
+ ref_key: "autoTopUpFormRef",
2457
+ ref: g,
2458
+ class: "sv-auto-topup-modal__rule"
2459
+ }, y.value, {
2460
+ config: x.value,
2461
+ "always-enabled": "",
2462
+ disabled: te.value
2463
+ }), null, 16, ["config", "disabled"])) : R("", !0),
2464
+ A(ft, {
2465
+ "pricing-plan-schedule-id": U.value,
2466
+ "pricing-items": m.value
2467
+ }, null, 8, ["pricing-plan-schedule-id", "pricing-items"]),
2468
+ A(st, {
2469
+ modelValue: I.value,
2470
+ "onUpdate:modelValue": j[0] || (j[0] = (Z) => I.value = Z),
2471
+ class: "sv-auto-topup-modal__payment-method",
2472
+ "payment-methods": r(G),
2473
+ "payment-method-options": r(S),
2474
+ disabled: te.value,
2475
+ error: r(ne).paymentMethodId.$errors,
2476
+ label: r(a)({
2477
+ defaultMessage: "Pay automatic top-ups with",
2478
+ description: "Label above the payment method an automatic top-up is charged to",
2479
+ id: "auto_topup_modal.payment_method.label"
2480
+ }),
2481
+ onAddPaymentMethod: r(b)
2482
+ }, null, 8, ["modelValue", "payment-methods", "payment-method-options", "disabled", "error", "label", "onAddPaymentMethod"])
2483
+ ])
2484
+ ]),
2485
+ _: 1
2486
+ }, 8, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-pending", "panes", "step", "customer", "payment-method-options", "is-payment-method-options-pending", "is-adding-payment-method"]));
2487
+ }
2488
+ }), ln = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3" }, un = /* @__PURE__ */ z({
2489
+ __name: "AutoTopUpCancellationModal",
2490
+ props: {
2491
+ showModal: { type: Boolean },
2492
+ config: { type: Object }
2493
+ },
2494
+ emits: ["confirmed", "close"],
2495
+ setup(e, { emit: t }) {
2496
+ const o = e, n = t, { $t: a } = Q(), i = _e(), { formatValue: u } = ye(), { deactivateAutoTopUpConfig: l } = At(), p = E(!1), y = E(!1);
2497
+ ee(
2498
+ () => o.showModal,
2499
+ (g) => {
2500
+ g && (y.value = !1);
2501
+ }
2502
+ );
2503
+ const T = s(() => {
2504
+ var U, I;
2505
+ const g = (U = o.config) == null ? void 0 : U.threshold, m = (I = o.config) == null ? void 0 : I.topup_amount;
2506
+ return !(g != null && g.amount) && !(g != null && g.credits) ? a({
2507
+ defaultMessage: "Your balance will no longer be topped up automatically. You can still top up whenever you want to.",
2508
+ description: "Explanation in the modal that turns a wallet automatic top-up off",
2509
+ id: "auto_topup_cancellation_modal.explanation"
2510
+ }) : m ? a(
2511
+ {
2512
+ defaultMessage: "Your balance will no longer be topped up with {amount} when it falls below {threshold}. You can still top up whenever you want to.",
2513
+ description: "Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",
2514
+ id: "auto_topup_cancellation_modal.explanation_with_amount"
2515
+ },
2516
+ { amount: u({ amount: m }), threshold: u(g) }
2517
+ ) : a(
2518
+ {
2519
+ defaultMessage: "Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",
2520
+ description: "Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",
2521
+ id: "auto_topup_cancellation_modal.explanation_with_threshold"
2522
+ },
2523
+ { threshold: u(g) }
2524
+ );
2525
+ }), x = async () => {
2526
+ var m;
2527
+ const g = (m = o.config) == null ? void 0 : m.id;
2528
+ if (!(!g || p.value)) {
2529
+ p.value = !0, y.value = !1;
2530
+ try {
2531
+ await l(g), n("confirmed"), n("close");
2532
+ } catch (U) {
2533
+ i.error(
2534
+ "AUTO_TOP_UP_CANCELLATION_FAILED",
2535
+ "Failed to turn off a wallet's automatic top-up",
2536
+ {},
2537
+ U
2538
+ ), y.value = !0;
2539
+ } finally {
2540
+ p.value = !1;
2541
+ }
2542
+ }
2543
+ }, v = () => {
2544
+ p.value || n("close");
2545
+ };
2546
+ return (g, m) => (w(), C(r(lt), {
2547
+ size: "sm",
2548
+ "show-modal": e.showModal,
2549
+ "is-loading": p.value,
2550
+ "no-click-away": p.value,
2551
+ "no-backdrop-close": p.value,
2552
+ title: r(a)({
2553
+ defaultMessage: "Turn off automatic top-up",
2554
+ description: "Title of the modal that turns a wallet automatic top-up off",
2555
+ id: "auto_topup_cancellation_modal.title"
2556
+ }),
2557
+ "confirm-button-text": r(a)({
2558
+ defaultMessage: "Yes, turn it off",
2559
+ description: "Button confirming that a wallet automatic top-up is turned off",
2560
+ id: "auto_topup_cancellation_modal.confirm"
2561
+ }),
2562
+ "cancel-button-text": r(a)({
2563
+ defaultMessage: "Cancel",
2564
+ description: "Button dismissing the modal that turns a wallet automatic top-up off",
2565
+ id: "auto_topup_cancellation_modal.cancel"
2566
+ }),
2567
+ onConfirm: x,
2568
+ onClose: v
2569
+ }, {
2570
+ body: h(() => [
2571
+ k("div", ln, [
2572
+ A(r(X), {
2573
+ variant: "body-sm",
2574
+ color: "subtle",
2575
+ tag: "p",
2576
+ class: "sv-auto-topup-cancellation-modal__explanation"
2577
+ }, {
2578
+ default: h(() => [
2579
+ F(N(T.value), 1)
2580
+ ]),
2581
+ _: 1
2582
+ }),
2583
+ y.value ? (w(), C(r(Ke), {
2584
+ key: 0,
2585
+ class: "sv-auto-topup-cancellation-modal__error sv-error",
2586
+ title: r(a)({
2587
+ defaultMessage: "Could not turn off the automatic top-up. Please try again later.",
2588
+ description: "Error shown when turning a wallet automatic top-up off failed",
2589
+ id: "auto_topup_cancellation_modal.failed"
2590
+ })
2591
+ }, null, 8, ["title"])) : R("", !0)
2592
+ ])
2593
+ ]),
2594
+ _: 1
2595
+ }, 8, ["show-modal", "is-loading", "no-click-away", "no-backdrop-close", "title", "confirm-button-text", "cancel-button-text"]));
2596
+ }
2597
+ }), kn = /* @__PURE__ */ z({
2598
+ inheritAttrs: !1,
2599
+ __name: "CustomerWalletBalances",
2600
+ props: {
2601
+ hasError: { type: Boolean },
2602
+ isLoading: { type: Boolean },
2603
+ walletBalances: { type: Array },
2604
+ showTopUpButton: { type: Boolean },
2605
+ customer: { type: Object },
2606
+ paymentMethods: { type: Array },
2607
+ subscriptions: { type: Array }
2608
+ },
2609
+ emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "payment-failed"],
2610
+ setup(e, { emit: t }) {
2611
+ const o = e, n = t, { $t: a } = Q(), i = E(), u = s(
2612
+ () => Re(o.walletBalances, i.value)
2613
+ ), l = s(() => !!u.value), p = E(), y = s(() => !!p.value), T = s(
2614
+ () => Re(o.walletBalances, p.value)
2615
+ ), x = E(), v = s(() => !!x.value);
2616
+ return (g, m) => (w(), W(ge, null, [
2617
+ e.isLoading ? (w(), C(et, le({
2618
+ key: 0,
2619
+ variant: "section"
2620
+ }, g.$attrs, {
2621
+ class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48",
2622
+ "data-testid": "customer-wallet-balances-skeleton"
2623
+ }), null, 16)) : e.hasError ? (w(), C(r(Ke), le({ key: 1 }, g.$attrs, {
2624
+ class: "sv-wallet-balances sv-root sv-component sv-error",
2625
+ title: r(a)({
2626
+ defaultMessage: "Could not load wallet balances",
2627
+ description: "Error shown when wallet balances fail to load",
2628
+ id: "wallet_balance.load_failed"
2629
+ })
2630
+ }), null, 16, ["title"])) : e.walletBalances.length > 0 ? (w(), C(r(co), le({ key: 2 }, g.$attrs, {
2631
+ class: "sv-wallet-balances sv-root sv-component",
2632
+ "customer-wallet-balances": e.walletBalances,
2633
+ "show-auto-top-up": "",
2634
+ "show-manual-top-up": "",
2635
+ title: r(a)(
2636
+ {
2637
+ defaultMessage: "{count, plural, one {Wallet} other {Wallets}}",
2638
+ description: "Title for the wallets block on the customer overview page",
2639
+ id: "customer_overview.wallet_balances_block.title"
2640
+ },
2641
+ { count: String(e.walletBalances.length) }
2642
+ ),
2643
+ onTopUp: m[0] || (m[0] = (U) => i.value = U),
2644
+ onAutoTopUp: m[1] || (m[1] = (U) => p.value = U),
2645
+ onCancelAutoTopUp: m[2] || (m[2] = (U) => x.value = U)
2646
+ }), null, 16, ["customer-wallet-balances", "title"])) : R("", !0),
2647
+ e.showTopUpButton ? (w(), C(on, {
2648
+ key: 3,
2649
+ "show-modal": l.value,
2650
+ "selected-balance-item": u.value,
2651
+ "payment-methods": e.paymentMethods,
2652
+ customer: e.customer,
2653
+ subscriptions: e.subscriptions,
2654
+ onClose: m[3] || (m[3] = (U) => i.value = void 0),
2655
+ onConfirm: m[4] || (m[4] = (U) => n("top-up-charged")),
2656
+ onPaymentSuccess: m[5] || (m[5] = (U) => n("payment-method-stored")),
2657
+ onPaymentFailed: m[6] || (m[6] = (U) => n("payment-failed", U))
2658
+ }, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : R("", !0),
2659
+ e.showTopUpButton ? (w(), C(sn, {
2660
+ key: 4,
2661
+ "show-modal": y.value,
2662
+ "wallet-balance-item": T.value,
2663
+ "top-up-item": p.value,
2664
+ "payment-methods": e.paymentMethods,
2665
+ customer: e.customer,
2666
+ onClose: m[7] || (m[7] = (U) => p.value = void 0),
2667
+ onSaved: m[8] || (m[8] = (U) => n("auto-top-up-saved")),
2668
+ onPaymentSuccess: m[9] || (m[9] = (U) => n("payment-method-stored")),
2669
+ onPaymentFailed: m[10] || (m[10] = (U) => n("payment-failed", U))
2670
+ }, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) : R("", !0),
2671
+ e.showTopUpButton ? (w(), C(un, {
2672
+ key: 5,
2673
+ "show-modal": v.value,
2674
+ config: x.value,
2675
+ onClose: m[11] || (m[11] = (U) => x.value = void 0),
2676
+ onConfirmed: m[12] || (m[12] = (U) => n("auto-top-up-cancelled"))
2677
+ }, null, 8, ["show-modal", "config"])) : R("", !0)
2678
+ ], 64));
2679
+ }
2680
+ });
2681
+ export {
2682
+ kn as _,
2683
+ Nn as u
2684
+ };