@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.9

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 (217) hide show
  1. package/README.md +124 -0
  2. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  3. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs} +6 -6
  5. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js +1 -0
  6. package/dist/ContentWithAsideLayout-B5B8Kwaw.js +1 -0
  7. package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-DhfUkZZg.mjs} +10 -16
  8. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs} +21 -13
  9. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs} +19 -9
  11. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +1 -0
  12. package/dist/PaymentHistoryBlock-BiiFJkpT.js +1 -0
  13. package/dist/PaymentHistoryBlock-D_B099M7.mjs +4 -0
  14. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs} +16 -13
  15. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +1 -0
  16. package/dist/PaymentIntegrationForm-D1oJA9mC.js +1 -0
  17. package/dist/PaymentIntegrationForm-DNkjhqMF.mjs +4 -0
  18. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs} +95 -199
  19. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D5bxFJ-p.js +1 -0
  20. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs} +5 -31
  21. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +1 -0
  22. package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs → Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs} +9 -6
  23. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +1 -0
  24. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +1 -0
  25. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs} +28 -22
  26. package/dist/adyen-B_QrYdaC.mjs +4 -0
  27. package/dist/adyen-Bwewy3HC.mjs +172 -0
  28. package/dist/adyen-R6aSZ0Yf.js +1 -0
  29. package/dist/adyen-mQEEOjgl.js +1 -0
  30. package/dist/adyen.css +1 -0
  31. package/dist/component-BOqPDAVk.js +1 -0
  32. package/dist/component-Djrf1L-Z.mjs +889 -0
  33. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  34. package/dist/components/BillingInformation/BillingInformation.es.js +8 -9
  35. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  36. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +14 -18
  37. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  38. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +10 -10
  39. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  40. package/dist/components/Invoice/Invoice.es.js +70 -2673
  41. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  42. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +10 -10
  43. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  44. package/dist/components/InvoicesList/InvoicesList.es.js +7 -8
  45. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  46. package/dist/components/PaymentHistory/PaymentHistory.es.js +10 -10
  47. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  48. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +16 -38
  49. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  50. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +17 -4826
  51. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  52. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +11 -11
  53. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  54. package/dist/components/WalletBalances/WalletBalances.es.js +9 -9
  55. package/dist/core/index.cjs.js +1 -1
  56. package/dist/core/index.d.ts +1 -0
  57. package/dist/core/index.es.js +1 -1
  58. package/dist/core/types.d.ts +6 -2
  59. package/dist/{customer-CJrpbGX4.mjs → customer-B31QzznT.mjs} +1 -1
  60. package/dist/{customer-CcQR-JIm.js → customer-hDxW1Dbp.js} +1 -1
  61. package/dist/en-US-CgPY97Vq.js +1 -0
  62. package/dist/en-US-N3CUCsVy.mjs +179 -0
  63. package/dist/index-CzL1ZcGi.mjs +85 -0
  64. package/dist/index-DIFK3mcJ.js +6 -0
  65. package/dist/index-DRdBmZ2-.js +1 -0
  66. package/dist/index-DyvRdSR7.mjs +9673 -0
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.es.js +4 -1
  70. package/dist/{invoices-CNK1Ushv.mjs → invoices-DIYPN2j_.mjs} +2 -15
  71. package/dist/invoices-DzkA1jDc.js +1 -0
  72. package/dist/nl-NL-B8U9b85I.mjs +197 -0
  73. package/dist/nl-NL-qMRaTRrM.js +1 -0
  74. package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-67b3UlTZ.mjs} +2 -2
  75. package/dist/paymentMethods-C_sdTkSF.js +1 -0
  76. package/dist/{payments-CLt0SExf.js → payments-DkHhTHto.js} +1 -1
  77. package/dist/{payments-CE9U7aKK.mjs → payments-Dq6R37Fz.mjs} +1 -1
  78. package/dist/registry-BkViv4tv.js +1 -0
  79. package/dist/{registry-B99ZnfEn.mjs → registry-Df_26rJy.mjs} +6 -4
  80. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  81. package/dist/screens/Checkout/Checkout.es.js +632 -2538
  82. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  83. package/dist/screens/CustomerOverview/CustomerOverview.es.js +23 -17
  84. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  85. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  86. package/dist/screens/PayInvoice/PayInvoice.es.js +458 -0
  87. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  88. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +147 -99
  89. package/dist/solvimon-web.css +1 -1
  90. package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-ClGIr_aS.mjs} +2 -2
  91. package/dist/subscriptions-jelITJcX.js +1 -0
  92. package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-BC57-Ufn.mjs} +1 -1
  93. package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-rw9kWeE0.js} +1 -1
  94. package/dist/{useCustomer--jycAz--.mjs → useCustomer-Ba9WRtuT.mjs} +2 -2
  95. package/dist/{useCustomer-PthyTFLl.js → useCustomer-CUcaeQn_.js} +1 -1
  96. package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-Cnzh2mAz.mjs} +3 -8
  97. package/dist/useIncrementalLoading-DoTTXM2Y.js +1 -0
  98. package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-BJwwDur7.mjs} +6 -12
  99. package/dist/useInvoiceData-D2jkdmlA.js +1 -0
  100. package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-CFzAxyae.mjs} +34 -267
  101. package/dist/useInvoicesList-CaBCGs4h.js +1 -0
  102. package/dist/{useLoadInitialData-Dm48tlSO.mjs → useLoadInitialData-5sgImpzc.mjs} +5 -0
  103. package/dist/useLoadInitialData-DjwRHcAH.js +1 -0
  104. package/dist/usePaymentMethodOptions-C2k4npCQ.mjs +26 -0
  105. package/dist/usePaymentMethodOptions-DYO6xr3-.js +1 -0
  106. package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-CRWbH48K.mjs} +2 -2
  107. package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-ryN_YohI.js} +1 -1
  108. package/dist/usePayments-Cw5PPEJa.mjs +36 -0
  109. package/dist/usePayments-DWXPGFvp.js +1 -0
  110. package/dist/usePortal-CxX4nrE4.js +1 -0
  111. package/dist/usePortal-cmE08vYs.mjs +12 -0
  112. package/dist/useService-Bb9r_sOQ.js +1 -0
  113. package/dist/useService-BsSEI8DZ.mjs +53 -0
  114. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  115. package/dist/useViewport-CKRY1CKR.js +1 -0
  116. package/dist/useWalletBalanceItems-CkDqmk36.mjs +109 -0
  117. package/dist/useWalletBalanceItems-CpZ1NWPr.js +1 -0
  118. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  119. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  120. package/dist/vendor-ui-5pJF5KBP.js +1 -0
  121. package/dist/vendor-ui-C0K3osvz.mjs +27645 -0
  122. package/package.json +20 -12
  123. package/dist/Alert.vue.es-DMPvSykx.js +0 -1
  124. package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
  125. package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
  126. package/dist/Amount.vue.es-h8wulbBG.js +0 -1
  127. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
  128. package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
  129. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
  130. package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
  131. package/dist/Button.vue.es-BC4_TItq.js +0 -1
  132. package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
  133. package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
  134. package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
  135. package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
  136. package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
  137. package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
  138. package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
  139. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
  140. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
  141. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
  142. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  143. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  144. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
  145. package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
  146. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
  147. package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
  148. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
  149. package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
  150. package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
  151. package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
  152. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
  153. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
  154. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
  155. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
  156. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
  157. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
  158. package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
  159. package/dist/Section.vue.es-BuzTXRLP.js +0 -1
  160. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js +0 -1
  161. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
  162. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
  163. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
  164. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
  165. package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
  166. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  167. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  168. package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
  169. package/dist/_flatRest.es-dFffnTpX.js +0 -1
  170. package/dist/adyen-51SvcyqV.mjs +0 -4
  171. package/dist/adyen-DZsyEXkw.js +0 -1
  172. package/dist/api.es-B4qAAJKr.js +0 -1
  173. package/dist/api.es-UkfpLiLL.mjs +0 -83
  174. package/dist/auto-DzZuCneB.mjs +0 -14387
  175. package/dist/auto-PpnAChnH.js +0 -6
  176. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  177. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  178. package/dist/cn.es-C7xoIs3C.js +0 -1
  179. package/dist/cn.es-tfxVlz02.mjs +0 -3191
  180. package/dist/component-ZRZIt3ZW.js +0 -1
  181. package/dist/component-dpA83LIN.mjs +0 -6569
  182. package/dist/countryData.es--zJAd6LA.mjs +0 -252
  183. package/dist/countryData.es-D3MFzU92.js +0 -1
  184. package/dist/customer.es-D42Md24r.js +0 -1
  185. package/dist/customer.es-LIW2YmLL.mjs +0 -30
  186. package/dist/formatting.es-9hM8aHSg.js +0 -1
  187. package/dist/formatting.es-D5H_ySFv.mjs +0 -68
  188. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  189. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  190. package/dist/index-2jo9BSPM.js +0 -1
  191. package/dist/index-BFZ0dPh9.mjs +0 -179
  192. package/dist/index-CI71bVGE.mjs +0 -2521
  193. package/dist/index-CWSXne1Q.js +0 -1
  194. package/dist/index-D3v7hAtc.mjs +0 -253
  195. package/dist/index-WLSPwi90.js +0 -1
  196. package/dist/index.es-BBJF2O2l.js +0 -1
  197. package/dist/index.es-LCAKs4tH.mjs +0 -438
  198. package/dist/invoices-3kVHsAXr.js +0 -1
  199. package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
  200. package/dist/isEmpty.es-Dycf-CD_.js +0 -1
  201. package/dist/paymentMethods-DZRf0WRl.js +0 -1
  202. package/dist/pick.es-BgDAfhAl.js +0 -1
  203. package/dist/pick.es-DdVOyp0Q.mjs +0 -45
  204. package/dist/registry-ClZ43bQn.js +0 -1
  205. package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
  206. package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
  207. package/dist/subscriptions-CS8HTxzC.js +0 -1
  208. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  209. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  210. package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
  211. package/dist/useInvoiceData-DvQO_nKz.js +0 -1
  212. package/dist/useInvoicesList-CHkwSNO9.js +0 -1
  213. package/dist/useLoadInitialData-BRg7IWqW.js +0 -1
  214. package/dist/useService-B67YWAcN.js +0 -1
  215. package/dist/useService-DG_zedHV.mjs +0 -282
  216. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
  217. package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../ContentWithAsideLayout-UHovpjZu.js"),r=require("../../useInvoicesList-CHkwSNO9.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js"),s=require("../../useCustomer-PthyTFLl.js"),a=require("../../usePaymentMethods-BRQ7-dUr.js"),i=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js"),u=require("../../useLoadInitialData-BRg7IWqW.js"),l=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js"),c=require("../../paymentMethods-DZRf0WRl.js"),m=require("../../useService-B67YWAcN.js"),p=require("../../useWalletBalanceItems-BY3gq0fc.js"),d=require("../../component-ZRZIt3ZW.js");const v=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(d){var v;const y=null==(v=o.usePortal().value)?void 0:v.customer_id,f=s.useCustomer({customerId:y}),g=r.useInvoicesList({customerId:y,batchSize:5}),_=n.useSubscriptionsList({customerId:y,batchSize:2}),h=a.usePaymentMethods({customerId:y}),C=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=c.createPaymentMethodsService(),{data:r,execute:n,error:s,apiStatus:a,isPending:i}=m.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:s,apiStatus:a,items:r,fetch:n,isPending:i}}({customerId:y}),S=p.useCustomerWalletBalances({customerId:y}),j=p.useWalletBalanceItems(S.walletBalances),{isLoading:b}=u.useLoadInitialData(f.get.execute(),g.fetchInitial(),_.fetchInitial(),h.fetchAll(),C.fetch(),S.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.unref(f).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,customer:e.unref(f).customer.value,subscriptions:e.unref(_).items.value,"payment-methods":e.unref(h).items.value,"is-loading":e.unref(b),onLoadMore:e.unref(_).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(b),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(p._sfc_main,{"has-error":e.unref(S).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(b),"wallet-balances":e.unref(j)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(l._sfc_main,{"is-loading":e.unref(b),"payment-methods":e.unref(h).items.value},null,8,["is-loading","payment-methods"]),e.unref(f).customer.value?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,"is-loading":e.unref(b),customer:e.unref(f).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,r)=>{var n,s,a,i;return e.openBlock(),e.createBlock(d._sfc_main$1,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(n=t.branding)?void 0:n.colors)?void 0:s.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(v)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=d.defineCustomElement(y),g=d.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=f,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,f)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),r=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),o=require("../../useInvoicesList-CaBCGs4h.js"),s=require("../../usePortal-CxX4nrE4.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js"),i=require("../../useCustomer-CUcaeQn_.js"),a=require("../../usePaymentMethods-ryN_YohI.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js"),l=require("../../useLoadInitialData-DjwRHcAH.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js"),m=require("../../paymentMethods-C_sdTkSF.js"),d=require("../../useService-Bb9r_sOQ.js"),v=require("../../useWalletBalanceItems-CpZ1NWPr.js"),p=require("../../component-BOqPDAVk.js");const y=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(p){var y;const f=null==(y=s.usePortal().value)?void 0:y.customer_id,_=i.useCustomer({customerId:f}),g=o.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=a.usePaymentMethods({customerId:f}),S=function({customerId:e,amount:t}){const{getPaymentMethodOptions:r}=m.createPaymentMethodsService(),{data:o,execute:s,error:n,apiStatus:i,isPending:a}=d.useService({initialValue:[],service:async()=>(await r({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:i,items:o,fetch:s,isPending:a}}({customerId:f}),j=v.useCustomerWalletBalances({customerId:f}),C=v.useWalletBalanceItems(j.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),S.fetch(),j.fetch());return(s,i)=>(e.openBlock(),e.createBlock(e.unref(r.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(_).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(_).customer.value,subscriptions:e.unref(h).items.value,"payment-methods":e.unref(b).items.value,"is-loading":e.unref(w),onLoadMore:e.unref(h).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(o._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(w),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(v._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(j).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(C)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{class:"sv-customer-overview__payment-methods","is-loading":e.unref(w),"payment-methods":e.unref(b).items.value},null,8,["is-loading","payment-methods"]),e.unref(_).customer.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(w),customer:e.unref(_).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),f=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:t=>(r,o)=>{var s,n,i,a;return e.openBlock(),e.createBlock(p._sfc_main,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(s=t.branding)?void 0:s.colors)?void 0:n.primary,"secondary-color":null==(a=null==(i=t.branding)?void 0:i.colors)?void 0:a.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:o[0]||(o[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),_=p.defineCustomElement(f),g=p.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=_,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,_)};
@@ -1,17 +1,18 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
2
- import { A as ApiStatus } from "../../_Uint8Array-DHE03FZr.mjs";
3
- import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Ct24RV-2.mjs";
4
- import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-DFhF_gp7.mjs";
5
- import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs";
6
- import { u as useCustomer } from "../../useCustomer--jycAz--.mjs";
7
- import { u as usePaymentMethods } from "../../usePaymentMethods-BX2RnHZN.mjs";
8
- import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs";
9
- import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
10
- import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs";
11
- import { c as createPaymentMethodsService } from "../../paymentMethods-C-ApE-G4.mjs";
12
- import { u as useService } from "../../useService-DG_zedHV.mjs";
13
- import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-B5FMmoU2.mjs";
14
- import { b as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-dpA83LIN.mjs";
2
+ import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
3
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
4
+ import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-CFzAxyae.mjs";
5
+ import { u as usePortal } from "../../usePortal-cmE08vYs.mjs";
6
+ import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-Ba9WRtuT.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.mjs";
9
+ import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs";
10
+ import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
11
+ import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs";
12
+ import { c as createPaymentMethodsService } from "../../paymentMethods-67b3UlTZ.mjs";
13
+ import { u as useService } from "../../useService-BsSEI8DZ.mjs";
14
+ import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-CkDqmk36.mjs";
15
+ import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
15
16
  function useCustomerPaymentMethodOptions({
16
17
  customerId,
17
18
  amount
@@ -52,10 +53,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
52
53
  customerWalletBalances.fetch()
53
54
  );
54
55
  return (_ctx, _cache) => {
55
- return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
56
+ return openBlock(), createBlock(unref(ContentWithAsideLayout), { class: "sv-customer-overview sv-root sv-screen" }, {
56
57
  header: withCtx(() => [
57
58
  unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$6, {
58
59
  key: 0,
60
+ class: "sv-customer-overview__subscriptions",
59
61
  customer: unref(customer).customer.value,
60
62
  subscriptions: unref(subscriptions).items.value,
61
63
  "payment-methods": unref(paymentMethods).items.value,
@@ -65,6 +67,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
65
67
  ]),
66
68
  content: withCtx(() => [
67
69
  createVNode(_sfc_main$5, {
70
+ class: "sv-customer-overview__invoices",
68
71
  invoices: unref(invoices).items.value,
69
72
  "has-more-items": unref(invoices).hasNextBatch.value,
70
73
  "is-loading": unref(isLoading),
@@ -73,16 +76,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
73
76
  ]),
74
77
  aside: withCtx(() => [
75
78
  createVNode(_sfc_main$2, {
79
+ class: "sv-customer-overview__wallet-balances",
76
80
  "has-error": unref(customerWalletBalances).apiStatus.value === unref(ApiStatus).Failed,
77
81
  "is-loading": unref(isLoading),
78
82
  "wallet-balances": unref(walletBalanceItems)
79
83
  }, null, 8, ["has-error", "is-loading", "wallet-balances"]),
80
84
  createVNode(_sfc_main$3, {
85
+ class: "sv-customer-overview__payment-methods",
81
86
  "is-loading": unref(isLoading),
82
87
  "payment-methods": unref(paymentMethods).items.value
83
88
  }, null, 8, ["is-loading", "payment-methods"]),
84
89
  unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$4, {
85
90
  key: 0,
91
+ class: "sv-customer-overview__billing-information",
86
92
  "is-loading": unref(isLoading),
87
93
  customer: unref(customer).customer.value
88
94
  }, null, 8, ["is-loading", "customer"])) : createCommentVNode("", true)
@@ -99,7 +105,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
99
105
  locale: { type: String },
100
106
  dateLocale: { type: String },
101
107
  messages: { type: Object },
102
- showTimezones: { type: Boolean },
103
108
  primaryColor: { type: String },
104
109
  secondaryColor: { type: String },
105
110
  isShadowRoot: { type: Boolean },
@@ -108,7 +113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
108
113
  onLog: { type: Function },
109
114
  allowedPortalTypes: { type: Array },
110
115
  portalObject: { type: Object },
111
- customElementName: { type: String },
116
+ cssOverrides: { type: [String, Array] },
112
117
  branding: { type: Object },
113
118
  configuration: { type: Object }
114
119
  },
@@ -126,13 +131,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
126
131
  "experimental-features": __props.experimentalFeatures,
127
132
  "log-level": __props.logLevel,
128
133
  "on-log": __props.onLog,
134
+ "css-overrides": __props.cssOverrides,
129
135
  onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
130
136
  }, {
131
137
  default: withCtx(() => [
132
138
  createVNode(_sfc_main$1)
133
139
  ]),
134
140
  _: 1
135
- }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
141
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
136
142
  };
137
143
  }
138
144
  });
@@ -0,0 +1,3 @@
1
+ export declare const SolvimonPayInvoice: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
+ export declare const COMPONENT_NAME: string;
3
+ export declare const defineSolvimonPayInvoice: () => void;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-BOqPDAVk.js"),n=require("../../vendor-ui-5pJF5KBP.js"),o=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D5bxFJ-p.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../adyen-R6aSZ0Yf.js"),c=require("../../useLoadInitialData-DjwRHcAH.js"),l=require("../../usePayments-DWXPGFvp.js"),s=require("../../usePaymentMethodOptions-DYO6xr3-.js"),u=require("../../usePaymentMethods-ryN_YohI.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$3),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),m={key:0},y=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref();function y(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const d=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()};return(l,v)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$13),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$6),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:d,onSelect:v[0]||(v[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$12),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(p,{disabled:!s.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),d=e.defineComponent({__name:"PayInvoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:m}=l.usePayments(),{fetchInitial:y}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:d,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),y(),m(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(d),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=e.defineComponent({__name:"PayInvoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(d,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(y,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
@@ -0,0 +1,458 @@
1
+ import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
3
+ import { u as useIntl, x as formatAmount, e as _sfc_main$4, y as _sfc_main$6, _ as _sfc_main$8, l as _sfc_main$9, b as _sfc_main$a, z as _sfc_main$c, v as getCustomerCountry } from "../../vendor-ui-C0K3osvz.mjs";
4
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
5
+ import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs";
6
+ import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
7
+ import { _ as _sfc_main$7 } from "../../adyen-Bwewy3HC.mjs";
8
+ import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
9
+ import { u as useInvoice, a as usePayments } from "../../usePayments-Cw5PPEJa.mjs";
10
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-C2k4npCQ.mjs";
11
+ import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.mjs";
12
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13
+ __name: "PayButton",
14
+ props: {
15
+ amount: { type: Object },
16
+ paymentMethod: { type: Object },
17
+ type: { type: String },
18
+ variant: { type: String },
19
+ color: { type: String },
20
+ size: { type: String },
21
+ pill: { type: Boolean },
22
+ square: { type: Boolean },
23
+ loading: { type: Boolean },
24
+ disabled: { type: Boolean },
25
+ iconPrefix: { type: null },
26
+ iconSuffix: { type: null },
27
+ tag: { type: String }
28
+ },
29
+ emits: ["click"],
30
+ setup(__props) {
31
+ const props = __props;
32
+ const { $t } = useIntl();
33
+ const buttonProps = computed(() => ({
34
+ color: props.color ?? "primary",
35
+ disabled: props.disabled,
36
+ iconPrefix: props.iconPrefix,
37
+ iconSuffix: props.iconSuffix,
38
+ loading: props.loading,
39
+ pill: props.pill,
40
+ size: props.size ?? "lg",
41
+ square: props.square,
42
+ tag: props.tag,
43
+ type: props.type,
44
+ variant: props.variant
45
+ }));
46
+ const paymentMethodTypeLabel = computed(() => {
47
+ var _a, _b, _c;
48
+ switch ((_a = props.paymentMethod) == null ? void 0 : _a.paymentMethodType) {
49
+ case "scheme":
50
+ return "Credit Card";
51
+ case "applepay":
52
+ return "Apple Pay";
53
+ case "googlepay":
54
+ return "Google Pay";
55
+ case "paypal":
56
+ return "PayPal";
57
+ case "ideal":
58
+ return "iDeal";
59
+ case "klarna":
60
+ return "Klarna";
61
+ case "bcmc":
62
+ return "BCMC";
63
+ case "sepadirectdebit":
64
+ return "SEPA";
65
+ case "twint":
66
+ return "Twint";
67
+ case "swish":
68
+ return "Swish";
69
+ case "vipps":
70
+ return "Vipps";
71
+ case "mbway":
72
+ return "MBway";
73
+ case "alipay":
74
+ return "AliPay";
75
+ case "wechatpayWeb":
76
+ return "WeChatPay";
77
+ case "afterpay_default":
78
+ return "Afterpay";
79
+ case "affirm":
80
+ return "Affirm";
81
+ case "ach":
82
+ return "ACH";
83
+ case "blik":
84
+ return "Blik";
85
+ case "cashapp":
86
+ return "Cash App Pay";
87
+ case "amazonpay":
88
+ return "Amazon Pay";
89
+ case "venmo":
90
+ return "Venmo";
91
+ case "clicktopay":
92
+ return "Click to Pay";
93
+ case "upi":
94
+ return "UPI";
95
+ case "revolutpay":
96
+ return "Revolut Pay";
97
+ case "ratepay":
98
+ return "Ratepay";
99
+ case "walley":
100
+ return "Walley";
101
+ case "alma":
102
+ return "Alma";
103
+ case "facilypay_3x":
104
+ case "facilypay_4x":
105
+ return "Oney";
106
+ case "samsungpay":
107
+ return "Samsung Pay";
108
+ case "bizum":
109
+ return "Bizum";
110
+ case "pix":
111
+ return "Pix";
112
+ case "multibanco":
113
+ return "Multibanco";
114
+ case "openbanking_UK":
115
+ return "Open Banking";
116
+ default:
117
+ return ((_b = props.paymentMethod) == null ? void 0 : _b.paymentMethodType) ? capitalize((_c = props.paymentMethod) == null ? void 0 : _c.paymentMethodType) : "";
118
+ }
119
+ });
120
+ const buttonText = computed(() => {
121
+ if (props.amount && props.paymentMethod) {
122
+ return $t(
123
+ {
124
+ defaultMessage: "Pay {amount} with {type}",
125
+ id: "pay_button.label.amount_and_payment_method",
126
+ description: "The label for the pay button when both the amount and the payment method are known"
127
+ },
128
+ {
129
+ amount: formatAmount(props.amount),
130
+ type: paymentMethodTypeLabel.value
131
+ }
132
+ );
133
+ }
134
+ if (props.amount) {
135
+ return $t(
136
+ {
137
+ defaultMessage: "Pay {amount}",
138
+ id: "pay_button.label.amount_only",
139
+ description: "The label for the pay button when only the amount is known"
140
+ },
141
+ {
142
+ amount: formatAmount(props.amount),
143
+ type: paymentMethodTypeLabel.value
144
+ }
145
+ );
146
+ }
147
+ return $t({
148
+ defaultMessage: "Pay",
149
+ id: "pay_button.label.default",
150
+ description: "The default label for the pay button when no amount and payment method are known"
151
+ });
152
+ });
153
+ return (_ctx, _cache) => {
154
+ return openBlock(), createBlock(unref(_sfc_main$4), mergeProps(buttonProps.value, {
155
+ class: "w-full",
156
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
157
+ }), {
158
+ default: withCtx(() => [
159
+ createTextVNode(toDisplayString(buttonText.value), 1)
160
+ ]),
161
+ _: 1
162
+ }, 16);
163
+ };
164
+ }
165
+ });
166
+ const _hoisted_1 = { key: 0 };
167
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
168
+ __name: "PayInvoice",
169
+ props: {
170
+ invoice: { type: Object },
171
+ paymentMethodOptions: { type: Array },
172
+ paymentAttempts: { default: () => [], type: Array },
173
+ countryCode: { type: String },
174
+ amount: { type: Object },
175
+ downloadService: { type: Function },
176
+ configuration: { type: Object },
177
+ isLoading: { type: Boolean },
178
+ error: { type: null }
179
+ },
180
+ setup(__props) {
181
+ const { $t } = useIntl();
182
+ const props = __props;
183
+ const selectedPaymentMethod = ref();
184
+ const paymentIntegrationFormRef = ref();
185
+ function handleSubmit() {
186
+ if (!paymentIntegrationFormRef.value) {
187
+ throw new Error("payment integration form not found");
188
+ }
189
+ paymentIntegrationFormRef.value.submit();
190
+ }
191
+ const handlePaymentSuccess = () => {
192
+ if (props.configuration.onPaymentSuccess) {
193
+ props.configuration.onPaymentSuccess();
194
+ }
195
+ };
196
+ return (_ctx, _cache) => {
197
+ return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
198
+ header: withCtx(() => [
199
+ createVNode(_sfc_main$5, { class: "min-h-[52px] w-96" }, {
200
+ default: withCtx(() => [
201
+ __props.invoice && __props.downloadService ? (openBlock(), createBlock(unref(_sfc_main$c), {
202
+ key: 0,
203
+ invoice: __props.invoice,
204
+ "payment-attempts": __props.paymentAttempts,
205
+ "download-service": () => __props.downloadService(__props.invoice.id)
206
+ }, null, 8, ["invoice", "payment-attempts", "download-service"])) : createCommentVNode("", true)
207
+ ]),
208
+ _: 1
209
+ })
210
+ ]),
211
+ content: withCtx(() => {
212
+ var _a, _b;
213
+ return [
214
+ __props.isLoading ? (openBlock(), createBlock(_sfc_main$5, {
215
+ key: 0,
216
+ variant: "section",
217
+ class: "min-h-[300px]"
218
+ })) : createCommentVNode("", true),
219
+ ((_a = __props.invoice) == null ? void 0 : _a.paid) ? (openBlock(), createBlock(_sfc_main$7, {
220
+ key: 1,
221
+ status: "success",
222
+ title: unref($t)({ id: "pay_invoice.paid.title", defaultMessage: "Thank you for your payment!", description: "Title shown when the invoice has already been paid" }),
223
+ class: "mt-8"
224
+ }, {
225
+ default: withCtx(() => [
226
+ createVNode(unref(_sfc_main$8), {
227
+ variant: "body-sm",
228
+ class: "mt-1"
229
+ }, {
230
+ default: withCtx(() => [
231
+ createVNode(unref(_sfc_main$9), { icon: "check" }),
232
+ createTextVNode(toDisplayString(unref(formatAmount)(__props.invoice.tax_summary.total_amount)), 1)
233
+ ]),
234
+ _: 1
235
+ })
236
+ ]),
237
+ _: 1
238
+ }, 8, ["title"])) : __props.error ? (openBlock(), createBlock(_sfc_main$7, {
239
+ key: 2,
240
+ status: "error",
241
+ title: unref($t)({ id: "pay_invoice.error.title", defaultMessage: "Something went wrong", description: "Title shown when the invoice payment fails to load" })
242
+ }, {
243
+ default: withCtx(() => [
244
+ createVNode(unref(_sfc_main$8), {
245
+ variant: "body-sm",
246
+ class: "mt-1"
247
+ }, {
248
+ default: withCtx(() => [
249
+ createTextVNode(toDisplayString(unref($t)({ id: "pay_invoice.error.description", defaultMessage: "Please try again or contact support.", description: "Body text shown when the invoice payment fails to load" })), 1)
250
+ ]),
251
+ _: 1
252
+ })
253
+ ]),
254
+ _: 1
255
+ }, 8, ["title"])) : !__props.isLoading && __props.countryCode && __props.amount && __props.invoice ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
256
+ ((_b = __props.paymentMethodOptions) == null ? void 0 : _b.length) ? (openBlock(), createBlock(unref(_sfc_main$a), {
257
+ key: 0,
258
+ title: unref($t)({ id: "pay_invoice.payment_methods.title", defaultMessage: "Payment methods", description: "Section title for the payment method selector on the pay invoice screen" }),
259
+ "content-background": "none",
260
+ "no-border": "",
261
+ "no-spacing": ""
262
+ }, {
263
+ default: withCtx(() => [
264
+ createVNode(_sfc_main$b, {
265
+ ref_key: "paymentIntegrationFormRef",
266
+ ref: paymentIntegrationFormRef,
267
+ amount: __props.amount,
268
+ "country-code": __props.countryCode,
269
+ context: {
270
+ type: "INVOICE",
271
+ related_resource_ids: [
272
+ {
273
+ type: "INVOICE",
274
+ id: __props.invoice.id
275
+ }
276
+ ]
277
+ },
278
+ "customer-id": __props.invoice.customer.id,
279
+ "force-store-payment-method": "",
280
+ "invoice-id": __props.invoice.id,
281
+ "payment-method-options": __props.paymentMethodOptions,
282
+ variant: "AUTHORIZE",
283
+ onPaymentSuccess: handlePaymentSuccess,
284
+ onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload)
285
+ }, null, 8, ["amount", "country-code", "context", "customer-id", "invoice-id", "payment-method-options"])
286
+ ]),
287
+ _: 1
288
+ }, 8, ["title"])) : createCommentVNode("", true)
289
+ ], 64)) : createCommentVNode("", true)
290
+ ];
291
+ }),
292
+ aside: withCtx(() => [
293
+ createVNode(_sfc_main$5, {
294
+ variant: "section",
295
+ class: "min-h-[200px]"
296
+ }, {
297
+ default: withCtx(() => [
298
+ __props.invoice ? (openBlock(), createBlock(unref(_sfc_main$6), {
299
+ key: 0,
300
+ invoice: __props.invoice
301
+ }, null, 8, ["invoice"])) : createCommentVNode("", true)
302
+ ]),
303
+ _: 1
304
+ }),
305
+ __props.invoice ? (openBlock(), createElementBlock("div", _hoisted_1, [
306
+ createVNode(_sfc_main$3, {
307
+ disabled: !selectedPaymentMethod.value,
308
+ amount: __props.amount,
309
+ "payment-method": selectedPaymentMethod.value,
310
+ onClick: handleSubmit
311
+ }, null, 8, ["disabled", "amount", "payment-method"])
312
+ ])) : createCommentVNode("", true)
313
+ ]),
314
+ _: 1
315
+ });
316
+ };
317
+ }
318
+ });
319
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
320
+ __name: "PayInvoice.entry.view",
321
+ props: {
322
+ environment: { type: String },
323
+ locale: { type: String },
324
+ dateLocale: { type: String },
325
+ messages: { type: Object },
326
+ primaryColor: { type: String },
327
+ secondaryColor: { type: String },
328
+ isShadowRoot: { type: Boolean },
329
+ experimentalFeatures: { type: Array },
330
+ logLevel: { type: String },
331
+ onLog: { type: Function },
332
+ allowedPortalTypes: { type: Array },
333
+ portalObject: { type: Object },
334
+ cssOverrides: { type: [String, Array] },
335
+ branding: { type: Object },
336
+ configuration: { type: Object }
337
+ },
338
+ setup(__props) {
339
+ const props = __props;
340
+ const {
341
+ invoice,
342
+ get: getInvoice,
343
+ downloadInvoicePdf
344
+ } = useInvoice({ invoiceId: props.configuration.invoiceId });
345
+ const { payments, get: getPayments } = usePayments();
346
+ const { fetchInitial } = usePaymentMethods({
347
+ customerId: props.portalObject.customer_id
348
+ });
349
+ const { paymentMethodOptions, get: getPaymentMethodOptions } = usePaymentMethodOptions();
350
+ const getInvoiceAndPaymentMethodOptions = async () => {
351
+ const invoice2 = await getInvoice();
352
+ await getPaymentMethodOptions({
353
+ customerId: invoice2.customer.id,
354
+ amount: invoice2.open_invoice_amount
355
+ });
356
+ };
357
+ const { isLoading } = useLoadInitialData(
358
+ getInvoiceAndPaymentMethodOptions(),
359
+ fetchInitial(),
360
+ getPayments(props.configuration.invoiceId)
361
+ );
362
+ const countryCode = computed(
363
+ () => {
364
+ var _a;
365
+ return ((_a = invoice.value) == null ? void 0 : _a.customer) ? getCustomerCountry(invoice.value.customer) : void 0;
366
+ }
367
+ );
368
+ return (_ctx, _cache) => {
369
+ var _a;
370
+ return renderSlot(_ctx.$slots, "default", {
371
+ invoice: unref(invoice),
372
+ isLoading: unref(isLoading),
373
+ amount: (_a = unref(invoice)) == null ? void 0 : _a.open_invoice_amount,
374
+ countryCode: countryCode.value,
375
+ paymentMethodOptions: unref(paymentMethodOptions),
376
+ paymentAttempts: unref(payments),
377
+ downloadService: unref(downloadInvoicePdf)
378
+ });
379
+ };
380
+ }
381
+ });
382
+ const _sfc_main = /* @__PURE__ */ defineComponent({
383
+ __name: "PayInvoice.entry",
384
+ props: {
385
+ environment: { type: String },
386
+ locale: { type: String },
387
+ dateLocale: { type: String },
388
+ messages: { type: Object },
389
+ primaryColor: { type: String },
390
+ secondaryColor: { type: String },
391
+ isShadowRoot: { type: Boolean },
392
+ experimentalFeatures: { type: Array },
393
+ logLevel: { type: String },
394
+ onLog: { type: Function },
395
+ allowedPortalTypes: { type: Array },
396
+ portalObject: { type: Object },
397
+ cssOverrides: { type: [String, Array] },
398
+ branding: { type: Object },
399
+ configuration: { type: Object }
400
+ },
401
+ setup(__props) {
402
+ return (_ctx, _cache) => {
403
+ var _a, _b, _c, _d;
404
+ return openBlock(), createBlock(unref(_sfc_main$d), {
405
+ "custom-element-name": unref(COMPONENT_NAME),
406
+ environment: __props.environment,
407
+ locale: __props.locale,
408
+ "portal-object": __props.portalObject,
409
+ "allowed-portal-types": ["CUSTOMER"],
410
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
411
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
412
+ "experimental-features": __props.experimentalFeatures,
413
+ "log-level": __props.logLevel,
414
+ "on-log": __props.onLog,
415
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
416
+ }, {
417
+ default: withCtx(() => [
418
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
419
+ default: withCtx(({
420
+ invoice,
421
+ isLoading,
422
+ amount,
423
+ countryCode,
424
+ paymentMethodOptions,
425
+ paymentAttempts,
426
+ downloadService
427
+ }) => [
428
+ createVNode(_sfc_main$2, {
429
+ "is-loading": isLoading,
430
+ invoice,
431
+ amount,
432
+ "country-code": countryCode,
433
+ "payment-method-options": paymentMethodOptions,
434
+ configuration: __props.configuration,
435
+ "payment-attempts": paymentAttempts ?? [],
436
+ "download-service": downloadService
437
+ }, null, 8, ["is-loading", "invoice", "amount", "country-code", "payment-method-options", "configuration", "payment-attempts", "download-service"])
438
+ ]),
439
+ _: 1
440
+ }, 16)
441
+ ]),
442
+ _: 1
443
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
444
+ };
445
+ }
446
+ });
447
+ const SolvimonPayInvoice = defineCustomElement(_sfc_main);
448
+ const COMPONENT_NAME = getComponentName("pay-invoice");
449
+ const defineSolvimonPayInvoice = () => {
450
+ if (!customElements.get(COMPONENT_NAME)) {
451
+ customElements.define(COMPONENT_NAME, SolvimonPayInvoice);
452
+ }
453
+ };
454
+ export {
455
+ COMPONENT_NAME,
456
+ SolvimonPayInvoice,
457
+ defineSolvimonPayInvoice
458
+ };