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

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