@solvimon/solvimon-web 0.1.0-alpha.15 → 0.1.0-alpha.16

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 (88) hide show
  1. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-xuCWAVgf.js → BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js} +1 -1
  2. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-ugPPvTKf.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BYBAO4Au.mjs} +1 -1
  3. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D_PE2UbX.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs} +2 -2
  4. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BpN9nSMC.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js} +1 -1
  5. package/dist/{PaymentIntegrationForm-BGxjGJGz.mjs → PaymentIntegrationForm-CypW6fZY.mjs} +1 -1
  6. package/dist/{PaymentIntegrationForm-liOVNKEG.js → PaymentIntegrationForm-D4QupHWl.js} +1 -1
  7. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js +1 -0
  8. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs} +5 -5
  9. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-h-JUw1DV.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-B8eNptZp.mjs} +1 -1
  10. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-DfdaWRO0.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-eWmC5GOT.js} +1 -1
  11. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-j5VNsyu7.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs} +1 -1
  12. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DxndhDxR.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js} +1 -1
  13. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-D6hHXndB.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js} +1 -1
  14. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-Cv6lz35J.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs} +2 -2
  15. package/dist/{component-BSnccqm1.mjs → component-Bg2JVC_O.mjs} +1 -1
  16. package/dist/{component-B53Df2Rt.js → component-Bs8oszfD.js} +1 -1
  17. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  18. package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
  19. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  20. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +2 -2
  21. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  22. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
  23. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  24. package/dist/components/Invoice/Invoice.es.js +3 -3
  25. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  26. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +2 -2
  27. package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
  28. package/dist/components/InvoiceHeader/InvoiceHeader.es.js +3 -3
  29. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  30. package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
  31. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  32. package/dist/components/PaymentHistory/PaymentHistory.es.js +2 -2
  33. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  34. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +5 -5
  35. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  36. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +3 -3
  37. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  38. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
  39. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  40. package/dist/components/WalletBalances/WalletBalances.es.js +3 -3
  41. package/dist/core/index.cjs.js +1 -1
  42. package/dist/core/index.es.js +1 -1
  43. package/dist/{customer-CANPEYH9.mjs → customer-Bv_fqXzO.mjs} +1 -1
  44. package/dist/{customer-B5b2tLhw.js → customer-_W8gIX5m.js} +1 -1
  45. package/dist/index.cjs.js +1 -1
  46. package/dist/index.es.js +1 -1
  47. package/dist/{invoices-DBv0qkgm.mjs → invoices-BGb0AwVF.mjs} +1 -1
  48. package/dist/{invoices-BCmE_nnb.js → invoices-D-OKipCg.js} +1 -1
  49. package/dist/{paymentMethods-u5y9B5ng.js → paymentMethods-DIbB759g.js} +1 -1
  50. package/dist/{paymentMethods-D-5FNN8W.mjs → paymentMethods-DvqlWe96.mjs} +1 -1
  51. package/dist/{payments-BK8yzqJ5.mjs → payments-CpzTVrQM.mjs} +1 -1
  52. package/dist/{payments-BTTtcfyI.js → payments-DMDDI3MK.js} +1 -1
  53. package/dist/{registry-CMo7X2FD.mjs → registry-B-If1W_u.mjs} +1 -1
  54. package/dist/{registry-Cx7p19-6.js → registry-uG2isab0.js} +1 -1
  55. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  56. package/dist/screens/Checkout/Checkout.es.js +8 -8
  57. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  58. package/dist/screens/CustomerOverview/CustomerOverview.es.js +11 -11
  59. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
  60. package/dist/screens/PayInvoice/PayInvoice.es.js +6 -6
  61. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
  62. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +7 -7
  63. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  64. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +8 -8
  65. package/dist/{subscriptions-DHjXDyH1.mjs → subscriptions-BPYyv09M.mjs} +1 -1
  66. package/dist/{subscriptions-AMC4DirD.js → subscriptions-CC61I6Nj.js} +1 -1
  67. package/dist/{useActionDispatchProvider-CizNgRwv.js → useActionDispatchProvider-BHTknMoH.js} +1 -1
  68. package/dist/{useActionDispatchProvider-DmhD9mYX.mjs → useActionDispatchProvider-Dz8-e4gZ.mjs} +1 -1
  69. package/dist/{useCustomer-DCPq7eHM.mjs → useCustomer-VVJi8z2w.mjs} +1 -1
  70. package/dist/{useCustomer-DYc54GVD.js → useCustomer-Z24KchWC.js} +1 -1
  71. package/dist/{useInvoiceData-BajCyf-x.js → useInvoiceData-Bl87gzIS.js} +1 -1
  72. package/dist/{useInvoiceData-BgtUKbHY.mjs → useInvoiceData-Di5pLPM0.mjs} +2 -2
  73. package/dist/{useInvoicesList-wnvjyB_H.js → useInvoicesList-CFk-_oVK.js} +1 -1
  74. package/dist/{useInvoicesList-DRD5yix0.mjs → useInvoicesList-z19cteaD.mjs} +2 -2
  75. package/dist/{useLoadInitialData-BObRB7Vo.js → useLoadInitialData-CTqfiMTN.js} +1 -1
  76. package/dist/{useLoadInitialData-IlbmC6p0.mjs → useLoadInitialData-CkpryfjF.mjs} +1 -1
  77. package/dist/{usePaymentMethodOptions-DRkWBjv6.mjs → usePaymentMethodOptions-BoGHJjng.mjs} +1 -1
  78. package/dist/{usePaymentMethodOptions-CzqsebhN.js → usePaymentMethodOptions-BsCZnCQW.js} +1 -1
  79. package/dist/{usePaymentMethods-ZPxKg5Y3.js → usePaymentMethods-AC-4rrR9.js} +1 -1
  80. package/dist/{usePaymentMethods-DFkRNreh.mjs → usePaymentMethods-ocHmNoP7.mjs} +1 -1
  81. package/dist/{usePayments-DwiGafZj.js → usePayments-CgXZeWrU.js} +1 -1
  82. package/dist/{usePayments-E_Jsqo98.mjs → usePayments-D85eB5l4.mjs} +2 -2
  83. package/dist/{usePortal-DcOz9FEL.mjs → usePortal-B1O1zgdV.mjs} +1 -1
  84. package/dist/{usePortal-CxTS2TQh.js → usePortal-DVD7PcWI.js} +1 -1
  85. package/dist/{useWalletBalanceItems-BQEXDCBg.js → useWalletBalanceItems-BL-R5foK.js} +1 -1
  86. package/dist/{useWalletBalanceItems-MlHgedWR.mjs → useWalletBalanceItems-COQDLfoZ.mjs} +1 -1
  87. package/package.json +1 -1
  88. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js +0 -1
@@ -1,20 +1,20 @@
1
1
  import { ref, computed, onMounted, watch, defineComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, useModel, createElementBlock, withModifiers, Fragment, createCommentVNode, createSlots, normalizeClass, mergeModels, renderList, renderSlot, toRef, nextTick, withDirectives, withKeys, vShow, defineAsyncComponent } from "vue";
2
2
  import { X as taxId, n as isEqual, Y as convertDateRangeToTimePeriod, M as useValidation, N as objectDiff, Z as isEmpty, u as useIntl, $ as _sfc_main$o, e as _sfc_main$p, a0 as isEUCountry, a1 as isValidCountryCode, a2 as getCountryNameByCode, _ as _sfc_main$q, R as _sfc_main$r, S as _sfc_main$s, c as _sfc_main$t, a3 as _sfc_main$u, U as _sfc_main$v, a4 as _sfc_main$w, a5 as _sfc_main$x, a6 as _sfc_main$y, a7 as TooltipContent, a8 as _sfc_main$z, a9 as formatBillingPeriod, B as formatAmount, aa as _sfc_main$B, ab as useTimePeriod, k as _sfc_main$C, ac as _sfc_main$E, ad as _sfc_main$F, F as _sfc_main$G, H as _sfc_main$I, ae as _sfc_main$J, A as _sfc_main$K, af as usePricingItem, ag as _sfc_main$L, ah as _sfc_main$M, ai as uniqueId, E as _sfc_main$N } from "../../vendor-ui-B8IlviSs.mjs";
3
- import { a as useLogger, _ as _sfc_main$Q, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
4
- import { c as createSubscriptionsService } from "../../subscriptions-DHjXDyH1.mjs";
3
+ import { a as useLogger, _ as _sfc_main$Q, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
4
+ import { c as createSubscriptionsService } from "../../subscriptions-BPYyv09M.mjs";
5
5
  import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
6
- import { c as createInvoicesService } from "../../invoices-DBv0qkgm.mjs";
6
+ import { c as createInvoicesService } from "../../invoices-BGb0AwVF.mjs";
7
7
  import { a as requiredIf, r as required, e as email } from "../../index-CzL1ZcGi.mjs";
8
8
  import { u as useWatchDebounced } from "../../useWatchDebounced-Zmxd6InB.mjs";
9
- import { c as createPaymentMethodsService } from "../../paymentMethods-D-5FNN8W.mjs";
9
+ import { c as createPaymentMethodsService } from "../../paymentMethods-DvqlWe96.mjs";
10
10
  import { u as useService } from "../../useService-DF57xuDd.mjs";
11
11
  import { g as getQueryParam, P as PAYMENT_ACCEPTOR_ID_QUERY_STRING, _ as _sfc_main$A, e as getAdyenExpressCheckoutConfiguration, d as transformObjectToAdyenObject, c as createReturnUrl, s as safeUrlRedirect } from "../../url-1Lbg5Yni.mjs";
12
- import { u as usePortal } from "../../usePortal-DcOz9FEL.mjs";
13
- import { c as createCustomerService } from "../../customer-CANPEYH9.mjs";
12
+ import { u as usePortal } from "../../usePortal-B1O1zgdV.mjs";
13
+ import { c as createCustomerService } from "../../customer-Bv_fqXzO.mjs";
14
14
  import { _ as _sfc_main$D, a as _sfc_main$O, b as _sfc_main$P } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs";
15
15
  import { u as useViewport } from "../../useViewport-Bu0cyeSi.mjs";
16
16
  import { _ as _sfc_main$H } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
17
- import { c as createPaymentsService } from "../../payments-BK8yzqJ5.mjs";
17
+ import { c as createPaymentsService } from "../../payments-CpzTVrQM.mjs";
18
18
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
19
19
  function getFirstPricingPlanScheduleOfType({
20
20
  pricingPlanScheduleInfos,
@@ -4173,7 +4173,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4173
4173
  setup(__props, { emit: __emit }) {
4174
4174
  var _a, _b, _c, _d, _e, _f, _g, _h;
4175
4175
  const PaymentIntegrationForm = defineAsyncComponent(
4176
- () => import("../../PaymentIntegrationForm-BGxjGJGz.mjs")
4176
+ () => import("../../PaymentIntegrationForm-CypW6fZY.mjs")
4177
4177
  );
4178
4178
  const props = __props;
4179
4179
  const emit = __emit;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../useInvoicesList-wnvjyB_H.js"),s=require("../../usePortal-CxTS2TQh.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-D6hHXndB.js"),a=require("../../useCustomer-DYc54GVD.js"),i=require("../../usePaymentMethods-ZPxKg5Y3.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-xuCWAVgf.js"),l=require("../../useLoadInitialData-BObRB7Vo.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BpN9nSMC.js"),m=require("../../paymentMethods-u5y9B5ng.js"),d=require("../../useService-CHrkefKd.js"),v=require("../../useWalletBalanceItems-BQEXDCBg.js"),p=require("../../component-B53Df2Rt.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,_=a.useCustomer({customerId:f}),g=r.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=i.usePaymentMethods({customerId:f}),j=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=m.createPaymentMethodsService(),{data:r,execute:s,error:n,apiStatus:a,isPending:i}=d.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:a,items:r,fetch:s,isPending:i}}({customerId:f}),C=v.useCustomerWalletBalances({customerId:f}),S=v.useWalletBalanceItems(C.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),j.fetch(),C.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.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(r._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(C).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(S)},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=>(o,r)=>{var s,n,a,i;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==(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,"css-overrides":t.cssOverrides,onError:r[0]||(r[0]=e=>o.$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
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../useInvoicesList-CFk-_oVK.js"),s=require("../../usePortal-DVD7PcWI.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js"),a=require("../../useCustomer-Z24KchWC.js"),i=require("../../usePaymentMethods-AC-4rrR9.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js"),l=require("../../useLoadInitialData-CTqfiMTN.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js"),m=require("../../paymentMethods-DIbB759g.js"),d=require("../../useService-CHrkefKd.js"),v=require("../../useWalletBalanceItems-BL-R5foK.js"),p=require("../../component-Bs8oszfD.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,_=a.useCustomer({customerId:f}),g=r.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=i.usePaymentMethods({customerId:f}),j=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=m.createPaymentMethodsService(),{data:r,execute:s,error:n,apiStatus:a,isPending:i}=d.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:a,items:r,fetch:s,isPending:i}}({customerId:f}),C=v.useCustomerWalletBalances({customerId:f}),S=v.useWalletBalanceItems(C.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),j.fetch(),C.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.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(r._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(C).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(S)},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=>(o,r)=>{var s,n,a,i;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==(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,"css-overrides":t.cssOverrides,onError:r[0]||(r[0]=e=>o.$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,18 +1,18 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
2
2
  import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
3
3
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
4
- import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-DRD5yix0.mjs";
5
- import { u as usePortal } from "../../usePortal-DcOz9FEL.mjs";
6
- import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-Cv6lz35J.mjs";
7
- import { u as useCustomer } from "../../useCustomer-DCPq7eHM.mjs";
8
- import { u as usePaymentMethods } from "../../usePaymentMethods-DFkRNreh.mjs";
9
- import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-ugPPvTKf.mjs";
10
- import { u as useLoadInitialData } from "../../useLoadInitialData-IlbmC6p0.mjs";
11
- import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D_PE2UbX.mjs";
12
- import { c as createPaymentMethodsService } from "../../paymentMethods-D-5FNN8W.mjs";
4
+ import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-z19cteaD.mjs";
5
+ import { u as usePortal } from "../../usePortal-B1O1zgdV.mjs";
6
+ import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-VVJi8z2w.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-ocHmNoP7.mjs";
9
+ import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-BYBAO4Au.mjs";
10
+ import { u as useLoadInitialData } from "../../useLoadInitialData-CkpryfjF.mjs";
11
+ import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs";
12
+ import { c as createPaymentMethodsService } from "../../paymentMethods-DvqlWe96.mjs";
13
13
  import { u as useService } from "../../useService-DF57xuDd.mjs";
14
- import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-MlHgedWR.mjs";
15
- import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
14
+ import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-COQDLfoZ.mjs";
15
+ import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
16
16
  function useCustomerPaymentMethodOptions({
17
17
  customerId,
18
18
  amount
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B53Df2Rt.js"),n=require("../../vendor-ui-C3Tq-qY_.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../url-B6-3PkW2.js"),c=require("../../useLoadInitialData-BObRB7Vo.js"),l=require("../../usePayments-DwiGafZj.js"),s=require("../../usePaymentMethodOptions-CzqsebhN.js"),u=require("../../usePaymentMethods-ZPxKg5Y3.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$1),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))}}),d={key:0},m=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(),m=e.ref(!1);function y(){if(!u.value)throw new Error("payment integration form not found");m.value=!0,u.value.submit()}const v=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()},f=()=>{m.value=!1};return(l,g)=>(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$2),{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$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$14),{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$3),{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),{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.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":m.value})},[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:v,onPaymentFailed:f,onSelect:g[0]||(g[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])],2)]),_: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$15),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value||m.value,loading:m.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=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:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(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(y),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(y,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(m,{"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)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-Bs8oszfD.js"),n=require("../../vendor-ui-C3Tq-qY_.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../url-B6-3PkW2.js"),c=require("../../useLoadInitialData-CTqfiMTN.js"),l=require("../../usePayments-CgXZeWrU.js"),s=require("../../usePaymentMethodOptions-BsCZnCQW.js"),u=require("../../usePaymentMethods-AC-4rrR9.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$1),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))}}),d={key:0},m=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(),m=e.ref(!1);function y(){if(!u.value)throw new Error("payment integration form not found");m.value=!0,u.value.submit()}const v=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()},f=()=>{m.value=!1};return(l,g)=>(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$2),{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$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$14),{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$3),{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),{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.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":m.value})},[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:v,onPaymentFailed:f,onSelect:g[0]||(g[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])],2)]),_: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$15),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value||m.value,loading:m.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=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:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(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(y),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(y,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(m,{"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)};
@@ -1,14 +1,14 @@
1
1
  import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, createElementVNode, normalizeClass, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
- import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
2
+ import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
3
3
  import { u as useIntl, B as formatAmount, c as _sfc_main$4, C as _sfc_main$6, e as _sfc_main$8, A as _sfc_main$9, _ as _sfc_main$a, d as _sfc_main$c, g as getCustomerCountry } from "../../vendor-ui-B8IlviSs.mjs";
4
4
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
5
- import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs";
5
+ import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs";
6
6
  import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
7
7
  import { _ as _sfc_main$7 } from "../../url-1Lbg5Yni.mjs";
8
- import { u as useLoadInitialData } from "../../useLoadInitialData-IlbmC6p0.mjs";
9
- import { u as useInvoice, a as usePayments } from "../../usePayments-E_Jsqo98.mjs";
10
- import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-DRkWBjv6.mjs";
11
- import { u as usePaymentMethods } from "../../usePaymentMethods-DFkRNreh.mjs";
8
+ import { u as useLoadInitialData } from "../../useLoadInitialData-CkpryfjF.mjs";
9
+ import { u as useInvoice, a as usePayments } from "../../usePayments-D85eB5l4.mjs";
10
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-BoGHJjng.mjs";
11
+ import { u as usePaymentMethods } from "../../usePaymentMethods-ocHmNoP7.mjs";
12
12
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13
13
  __name: "PayButton",
14
14
  props: {
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B53Df2Rt.js"),o=require("../../vendor-ui-C3Tq-qY_.js"),n=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-DxndhDxR.js"),a=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-DfdaWRO0.js"),s=require("../../useCustomer-DYc54GVD.js"),i=require("../../usePaymentMethods-ZPxKg5Y3.js"),l=require("../../usePaymentMethodOptions-CzqsebhN.js"),m=require("../../useLoadInitialData-BObRB7Vo.js"),p={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},d={key:0},c=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup:t=>(n,r)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",null,[e.createVNode(e.unref(o._sfc_main$3),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$3),{key:0,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})):e.createCommentVNode("",!0)]),n.$slots.right?(e.openBlock(),e.createElementBlock("div",d,[e.renderSlot(n.$slots,"right")])):e.createCommentVNode("",!0)]))}),u=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default"],setup(t,{emit:s}){const i=s,{$t:l}=o.useIntl(),m=e.ref(!1);return(s,p)=>(e.openBlock(),e.createBlock(e.unref(n.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(c,{title:e.unref(l)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(l)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(o._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,{"payment-methods":t.paymentMethods,onSetDefault:p[0]||(p[0]=e=>i("set-default"))},null,8,["payment-methods"])]),_:1}),m.value?(e.openBlock(),e.createBlock(a._sfc_main,{key:0,customer:t.customer,"payment-method-options":t.paymentMethodOptions},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:1,color:"gray",variant:"outline",onClick:p[1]||(p[1]=e=>m.value=!1)},{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:2,color:"gray",variant:"outline",onClick:p[2]||(p[2]=e=>m.value=!0)},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),y=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup(t){const o=t,n=o.portalObject.customer_id,{customer:r,get:a}=s.useCustomer({customerId:n}),{items:p,fetchInitial:d}=i.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:c,get:u}=l.usePaymentMethodOptions(),{isLoading:y}=m.useLoadInitialData(a.execute(),d(),u({customerId:o.portalObject.customer_id}));return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(r),paymentMethods:e.unref(p),paymentMethodOptions:e.unref(c),isLoading:e.unref(y),refreshPaymentMethods:e.unref(d)})}}),g=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup:o=>(n,r)=>{var a,s,i,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(f),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(a=o.branding)?void 0:a.colors)?void 0:s.primary,"secondary-color":null==(l=null==(i=o.branding)?void 0:i.colors)?void 0:l.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:r[0]||(r[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({customer:t,paymentMethods:o,paymentMethodOptions:n,isLoading:r,refreshPaymentMethods:a})=>[t?(e.openBlock(),e.createBlock(u,{key:0,"is-loading":r,"payment-methods":o,"payment-method-options":n,customer:t,onSetDefault:a},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),h=t.defineCustomElement(g),f=t.getComponentName("payment-methods-management");exports.COMPONENT_NAME=f,exports.SolvimonPaymentMethodsManagement=h,exports.defineSolvimonPaymentMethodsManagement=()=>{customElements.get(f)||customElements.define(f,h)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-Bs8oszfD.js"),o=require("../../vendor-ui-C3Tq-qY_.js"),n=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js"),a=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-eWmC5GOT.js"),s=require("../../useCustomer-Z24KchWC.js"),i=require("../../usePaymentMethods-AC-4rrR9.js"),l=require("../../usePaymentMethodOptions-BsCZnCQW.js"),m=require("../../useLoadInitialData-CTqfiMTN.js"),p={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},d={key:0},c=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup:t=>(n,r)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",null,[e.createVNode(e.unref(o._sfc_main$3),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$3),{key:0,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})):e.createCommentVNode("",!0)]),n.$slots.right?(e.openBlock(),e.createElementBlock("div",d,[e.renderSlot(n.$slots,"right")])):e.createCommentVNode("",!0)]))}),u=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default"],setup(t,{emit:s}){const i=s,{$t:l}=o.useIntl(),m=e.ref(!1);return(s,p)=>(e.openBlock(),e.createBlock(e.unref(n.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(c,{title:e.unref(l)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(l)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(o._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,{"payment-methods":t.paymentMethods,onSetDefault:p[0]||(p[0]=e=>i("set-default"))},null,8,["payment-methods"])]),_:1}),m.value?(e.openBlock(),e.createBlock(a._sfc_main,{key:0,customer:t.customer,"payment-method-options":t.paymentMethodOptions},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:1,color:"gray",variant:"outline",onClick:p[1]||(p[1]=e=>m.value=!1)},{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:2,color:"gray",variant:"outline",onClick:p[2]||(p[2]=e=>m.value=!0)},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),y=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup(t){const o=t,n=o.portalObject.customer_id,{customer:r,get:a}=s.useCustomer({customerId:n}),{items:p,fetchInitial:d}=i.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:c,get:u}=l.usePaymentMethodOptions(),{isLoading:y}=m.useLoadInitialData(a.execute(),d(),u({customerId:o.portalObject.customer_id}));return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(r),paymentMethods:e.unref(p),paymentMethodOptions:e.unref(c),isLoading:e.unref(y),refreshPaymentMethods:e.unref(d)})}}),g=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup:o=>(n,r)=>{var a,s,i,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(f),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(a=o.branding)?void 0:a.colors)?void 0:s.primary,"secondary-color":null==(l=null==(i=o.branding)?void 0:i.colors)?void 0:l.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:r[0]||(r[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({customer:t,paymentMethods:o,paymentMethodOptions:n,isLoading:r,refreshPaymentMethods:a})=>[t?(e.openBlock(),e.createBlock(u,{key:0,"is-loading":r,"payment-methods":o,"payment-method-options":n,customer:t,onSetDefault:a},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),h=t.defineCustomElement(g),f=t.getComponentName("payment-methods-management");exports.COMPONENT_NAME=f,exports.SolvimonPaymentMethodsManagement=h,exports.defineSolvimonPaymentMethodsManagement=()=>{customElements.get(f)||customElements.define(f,h)};
@@ -1,13 +1,13 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, renderSlot, ref, normalizeProps, guardReactiveProps } from "vue";
2
- import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
2
+ import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
3
3
  import { e as _sfc_main$4, u as useIntl, _ as _sfc_main$5, c as _sfc_main$8 } from "../../vendor-ui-B8IlviSs.mjs";
4
4
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
5
- import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-j5VNsyu7.mjs";
6
- import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-h-JUw1DV.mjs";
7
- import { u as useCustomer } from "../../useCustomer-DCPq7eHM.mjs";
8
- import { u as usePaymentMethods } from "../../usePaymentMethods-DFkRNreh.mjs";
9
- import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-DRkWBjv6.mjs";
10
- import { u as useLoadInitialData } from "../../useLoadInitialData-IlbmC6p0.mjs";
5
+ import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs";
6
+ import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-B8eNptZp.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-VVJi8z2w.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-ocHmNoP7.mjs";
9
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-BoGHJjng.mjs";
10
+ import { u as useLoadInitialData } from "../../useLoadInitialData-CkpryfjF.mjs";
11
11
  const _hoisted_1 = { class: "grid gap-4 sm:grid-cols-1 md:grid-cols-2" };
12
12
  const _hoisted_2 = { key: 0 };
13
13
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-C3Tq-qY_.js"),i=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js"),a=require("../../ContentWithAsideLayout-DHpnJfGA.js"),n=require("../../component-B53Df2Rt.js"),r=require("../../useActionDispatchProvider-CizNgRwv.js"),o=require("../../usePortal-CxTS2TQh.js"),s=require("../../subscriptions-AMC4DirD.js"),l=require("../../customer-B5b2tLhw.js"),c=require("../../paymentMethods-u5y9B5ng.js"),d=require("../../invoices-BCmE_nnb.js"),u=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js"),p=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),m=require("../../url-B6-3PkW2.js"),g=require("../../useViewport-CKRY1CKR.js"),v={class:"sv-order-summary__body grid grid-cols-1 gap-1"},_={class:"flex items-center justify-center gap-2 px-3 py-5"},f={class:"flex flex-row gap-3 px-3 py-2"},y={class:"grow"},h={class:"sv-order-summary__items grid grid-cols-1 gap-1"},b={class:"flex flex-row gap-2 px-3 py-2"},w={class:"flex flex-row gap-3 px-3 py-2"},k={class:"grow"},x={class:"flex flex-row gap-2 px-3 py-2"},N=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},loading:{type:Boolean}},setup(i){const a=i,{$t:n}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,i,a,n,r;const o=null==(r=null==(n=null==(a=null==(i=null==(t=e.items)?void 0:t[0])?void 0:i.configs)?void 0:a[0])?void 0:n.bands)?void 0:r[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)},s=e.computed(()=>{var e,t,i,r,o,s,c,d;const u=null==(r=null==(i=null==(t=null==(e=a.invoice)?void 0:e.periods)?void 0:t[0])?void 0:i.groups)?void 0:r[0],p=null==(o=null==u?void 0:u.products)?void 0:o[0],m=l.value.length;return{title:(null==p?void 0:p.name)??(null==(s=null==u?void 0:u.product_category)?void 0:s.name)??(null==(c=l.value[0])?void 0:c.description),subtitle:m>1?n({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.item_count",description:"Subtitle shown below the product name when multiple one-off items are selected"},{count:String(m)}):null==(d=l.value[0])?void 0:d.description}}),l=e.computed(()=>{var e;return((null==(e=a.invoice)?void 0:e.periods)??[]).flatMap((e,t)=>e.groups.flatMap((e,i)=>(e.lines??[]).map((a,n)=>{var r,o,s,l,c;return{key:`${t}-${i}-${n}`,description:a.description??(null==(o=null==(r=a.product_items)?void 0:r[0])?void 0:o.name)??(null==(l=null==(s=e.products)?void 0:s[0])?void 0:l.name)??(null==(c=e.product_category)?void 0:c.name)??"—",amount:a.amount_excluding_tax}})))}),c=e.computed(()=>a.selectedPricings.map(e=>{var t,i;return{key:e.id,description:e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)??"—",amount:o(e)}})),d=e.computed(()=>n({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"}));return(a,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-order-summary sv-upgrade-subscription__order-summary","no-border":"","no-spacing":"","content-background":"none",title:d.value},{default:e.withCtx(()=>[e.createElementVNode("div",v,[r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(t._sfc_main$14),{icon:"shopping_cart",class:"text-gray-500"}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Select your items",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no items are selected in the order summary"})),1)]),_:1})])]),_:1})):i.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value.title?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.title),1)]),_:1}),s.value.subtitle?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.subtitle),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",b,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128))]),e.createVNode(e.unref(t._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$18),{class:"sv-order-summary__invoice-preview",variant:"without-products",invoice:i.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",k,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"Selected items",id:"upgrade_subscription.order_summary.selected_items_title",description:"Temporary order summary title shown while the invoice preview is loading"}):null==(t=c.value[0])?void 0:t.description),1)]}),_:1}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.selected_item_count",description:"Temporary order summary subtitle shown while the invoice preview is loading"},{count:String(c.value.length)}):e.unref(n)({defaultMessage:"one-off",id:"upgrade_subscription.order_summary.one_off_label",description:"One-off payment label next to a line item in order summary"})),1)]),_:1})])])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",x,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128)),i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,class:"sv-order-summary__totals"},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("div",{class:"grid grid-cols-1 gap-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-40 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-16 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"border-t border-gray-200 pt-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-5 w-36 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-5 w-24 animate-pulse rounded bg-gray-100"})])])],-1)])]),_:1})):e.createCommentVNode("",!0)],64))])]),_:1},8,["title"]))}}),V=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean},loading:{type:Boolean}},emits:["toggle"],setup(a,{emit:n}){const r=a,o=n,{$t:s}=t.useIntl(),l=e.computed(()=>{var e,t,i,a,n,o;return r.pricing.name??(null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.product_items)?void 0:i[0])?void 0:a.name)??(null==(o=null==(n=r.pricing.products)?void 0:n[0])?void 0:o.name)??"—"}),c=e.computed(()=>{var e,t,i,a,n;const o=null==(n=null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:i[0])?void 0:a.bands)?void 0:n[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)}),d=e.computed(()=>c.value?`${t.formatAmount(c.value)} ${s({defaultMessage:"one-off",id:"on_demand_pricing_row.one_off_label",description:"One-off label shown next to the price in an on-demand pricing row"})}`:"");return(n,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"content-background":a.selected?"none":"gray","content-classes":a.selected?"!border-primary-600 ring-1 ring-primary-600":void 0},{default:e.withCtx(()=>[e.createVNode(i._sfc_main,{name:l.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",loading:a.loading,onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1},8,["loading"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:1,color:"primary",size:"sm","icon-prefix":"add",loading:a.loading,onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add to cart",id:"on_demand_pricing_row.add_to_cart_button_label",description:"Label for the add to cart button in an on-demand pricing row"})),1)]),_:1},8,["loading"]))]),_:1},8,["name","description"])]),_:1},8,["content-background","content-classes"]))}}),B={class:"sv-pricing-list__items grid grid-cols-1 gap-1"},C=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array},loadingPricingId:{type:String}},emits:["toggle"],setup(i,{emit:a}){const n=i,r=a,{$t:o}=t.useIntl(),s=e.computed(()=>[...n.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0))),l=e=>{var t;return(null==(t=e.product_category)?void 0:t.name)??e.name??o({defaultMessage:"Items",id:"on_demand_pricing_list.category_fallback_title",description:"Fallback title for the selectable pricing items when no product category name is available"})};return(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"sv-pricing-list__category flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-3",tag:"h2",class:"sv-pricing-list__category-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(a)),1)]),_:2},1024),e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[0]||(n[0]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricing_groups,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold",class:"sv-pricing-list__group-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[1]||(n[1]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128))],64))),128))])]))),128))}});const E={key:0,class:"sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"},S={class:"flex flex-col items-center text-center"},T={class:"sv-upgrade-subscription__header"},P={key:1,class:"sv-upgrade-subscription__pricing-list"},I={key:2,class:"sv-upgrade-subscription__loading p-4"},$={class:"sv-upgrade-subscription__payment-methods"},D={key:0,class:"sv-upgrade-subscription__payment-methods-body"},M={key:1,class:"sv-upgrade-subscription__payment-form"},j={class:"sv-upgrade-subscription__order-summary"},O={class:"flex flex-col gap-2"},A=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(v){const _=v,{$t:f}=t.useIntl(),{getSubscription:y}=s.createSubscriptionsService(),{getCustomer:h}=l.createCustomerService(),{getOnDemandPricingItems:b}=function(){const e=n.createRequestService(),t=n.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:i,pricingPlanVersionId:a,pricingItemIds:n,startAt:r,finalizeImmediately:o=!0,paymentMethodId:s}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:n,...r?{start_at:r}:{},finalize_immediately:o,...s?{payment_method_id:s}:{}}})},getOnDemandPricingItems:function({scheduleId:i}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/on-demand-pricing-items`})}}}(),{getPaymentMethodOptions:w}=c.createPaymentMethodsService(),{previewChargeOnDemandPricingItems:k}=d.createInvoicesService(),x=o.usePortal(),V=n.useLogger(),{dispatchAction:B}=r.useActionDispatchProvider(),{isMobileViewport:A}=g.useViewport(),F=e.computed(()=>x.value.customer_id),L={currency:"EUR",quantity:"0"},q=e.ref([]),U=e.ref(!1),R=e.ref([]),z=e.ref([]),W=e.ref(!1),G=e.ref(!1),H=e.ref(!1),Y=e.ref(void 0),K=e.ref(void 0),Z=e.ref(),J=e.ref(void 0),Q=e.ref(void 0),X=e.ref(void 0),ee=(e,t=[])=>t.find(t=>t.id===e.id),te=(e,t)=>(e.items??[]).map(i=>{var a,n,r,o,s,l,c;const d=null==(a=null==t?void 0:t.items)?void 0:a.find(e=>e.id===i.id),u=i.product_items??(null==d?void 0:d.product_items);return{...e,id:i.id,name:(null==(r=null==(n=i.product_items)?void 0:n[0])?void 0:r.name)??(null==(s=null==(o=null==d?void 0:d.product_items)?void 0:o[0])?void 0:s.name)??e.name??(null==t?void 0:t.name)??(null==(c=null==(l=null==t?void 0:t.products)?void 0:l[0])?void 0:c.name),products:e.products??(null==t?void 0:t.products),items:[{...i,product_items:u}]}}),ie=async()=>{var e,i,a;W.value=!0,K.value=void 0;try{const n=await(async()=>{const e=[...(await y({id:_.configuration.subscriptionId,expanded:!0})).pricing_plan_schedule_infos??[]].sort((e,t)=>Date.parse(t.start_at)-Date.parse(e.start_at)),t=Date.now(),i=e.find(e=>{var i;const a=(null==(i=e.pricing_plan_schedule)?void 0:i.type)??e.type,n=Date.parse(e.start_at),r=e.end_at?Date.parse(e.end_at):void 0,o=Number.isFinite(n)&&n<=t,s=void 0===r||!Number.isFinite(r)||r>t;return"DEFAULT"===a&&o&&s});if(!(null==i?void 0:i.id))throw new Error("No pricing plan schedule found for subscription");return i})();J.value=n.id;const[r,o,s]=await Promise.all([b({scheduleId:J.value}),w({customerId:F.value}),h(F.value)]);R.value=(i=r.pricing_categories??[],a=(null==(e=n.pricing_plan_version)?void 0:e.pricing_categories)??[],i.map(e=>{var t;const i=((e,t)=>t.find(t=>t.product_category_id===e.product_category_id))(e,a);return{...e,name:e.name??(null==(t=null==i?void 0:i.product_category)?void 0:t.name),product_category:e.product_category??(null==i?void 0:i.product_category),pricings:(e.pricings??[]).flatMap(e=>te(e,ee(e,null==i?void 0:i.pricings))),pricing_groups:(e.pricing_groups??[]).map(e=>{var t;const a=null==(t=null==i?void 0:i.pricing_groups)?void 0:t.find(t=>t.id===e.id);return{...e,name:e.name??(null==a?void 0:a.name),pricings:(e.pricings??[]).flatMap(e=>te(e,ee(e,null==a?void 0:a.pricings)))}})}})),z.value=o,X.value=t.getCustomerCountry(s)}catch(n){V.error("INITIAL_DATA_LOAD_FAILED","Failed to load on-demand pricing items",{},n),K.value=f({defaultMessage:"Unable to load items. Please try again later.",id:"upgrade_subscription.load_error",description:"Error message shown when the one-off items cannot be loaded on the upgrade subscription page"})}finally{W.value=!1}};e.onMounted(()=>{ie()});const ae=e.computed(()=>R.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),ne=e.computed(()=>ae.value.filter(e=>q.value.includes(e.id))),re=e.computed(()=>ne.value.flatMap(e=>e.items??[]).map(e=>e.id).filter(e=>!!e)),oe=e.computed(()=>{var e,t;return null==(t=null==(e=Q.value)?void 0:e.tax_summary)?void 0:t.total_amount}),se=e.computed(()=>oe.value??L);let le,ce=0;e.watch([re,J],([e,t])=>{clearTimeout(le);const i=++ce;if(me.value=void 0,!t||0===e.length)return Q.value=void 0,G.value=!1,void(Y.value=void 0);G.value=!0,le=setTimeout(()=>{k({pricingPlanScheduleId:t,pricingItemIds:e}).then(e=>{i===ce&&(Q.value=e)}).catch(e=>{i===ce&&(V.error("INVOICE_PREVIEW_FAILED","Failed to load charge-on-demand invoice preview",{},e),me.value=f({defaultMessage:"Unable to calculate the total. Please try again.",id:"upgrade_subscription.preview_error",description:"Error message shown when the upgrade subscription invoice preview cannot be loaded"}),Q.value=void 0)}).finally(()=>{i===ce&&(G.value=!1,Y.value=void 0)})},400)});const de=e.computed(()=>{if(!J.value)throw new Error("Cannot create charge-on-demand authorization context without a schedule.");return{type:"CHARGE_ON_DEMAND",charge_on_demand:{pricing_plan_schedule_id:J.value,pricing_items:re.value.map(e=>({pricing_item_id:e}))}}}),ue=e=>{Y.value=e,q.value.includes(e)?q.value=q.value.filter(t=>t!==e):q.value=[...q.value,e]},pe=e.computed(()=>re.value.length>0&&!!J.value&&!!oe.value&&!G.value&&z.value.length>0),me=e.ref(void 0),ge=async()=>{var e;pe.value&&!H.value&&(me.value=void 0,H.value=!0,null==(e=Z.value)||e.submit())},ve=async()=>pe.value;let _e;const fe=()=>{H.value=!1,U.value=!0,_e=setTimeout(()=>{B({action:"navigate-to-customer-overview"})},3e3)},ye=e=>{H.value=!1,me.value=e.message||f({defaultMessage:"Something went wrong. Please try again.",id:"upgrade_subscription.purchase_error",description:"Error message shown when the purchase call fails on the upgrade subscription page"})};return e.onUnmounted(()=>{clearTimeout(le),clearTimeout(_e)}),(n,r)=>U.value?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(m._sfc_main,{class:"sv-upgrade-subscription__success",status:"success",title:e.unref(f)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful upgrade purchase"})},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-message mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Your purchase has been completed.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful upgrade purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-redirect mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"You will be redirected shortly…",id:"upgrade_subscription.success.redirect",description:"Shown below the success message while the redirect timer is running"})),1)]),_:1})])]),_:1},8,["title"])])):(e.openBlock(),e.createBlock(e.unref(a.ContentWithAsideLayout),{key:1,class:"sv-upgrade-subscription sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",T,[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-2",tag:"h1",class:"sv-upgrade-subscription__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Upgrade subscription",id:"upgrade_subscription.title",description:"Title for the upgrade subscription page"})),1)]),_:1})])]),content:e.withCtx(()=>[e.unref(A)?(e.openBlock(),e.createBlock(N,{key:0,class:"sv-upgrade-subscription__mobile-order-summary","selected-pricings":ne.value,invoice:Q.value,loading:G.value},null,8,["selected-pricings","invoice","loading"])):e.createCommentVNode("",!0),!W.value&&!K.value&&R.value.length>0?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(C,{categories:R.value,"selected-pricing-ids":q.value,"loading-pricing-id":Y.value,onToggle:ue},null,8,["categories","selected-pricing-ids","loading-pricing-id"])])):W.value?(e.openBlock(),e.createElementBlock("div",I,[...r[0]||(r[0]=[e.createElementVNode("div",{class:"sv-skeleton h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):K.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{key:3,class:"sv-upgrade-subscription__load-error sv-error m-4",title:K.value},null,8,["title"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:4,variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__empty-state p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No one-off items are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no one-off items available for the subscription"})),1)]),_:1})),e.createElementVNode("div",$,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!W.value||W.value&&z.value.length>0?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-3",tag:"h2",class:"sv-upgrade-subscription__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Payment method",id:"upgrade_subscription.payment_method_block.title",description:"The title of the payment method block in the upgrade subscription flow"})),1)]),_:1}),0===z.value.length?(e.openBlock(),e.createBlock(i._sfc_main$2,{key:0,class:"sv-upgrade-subscription__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No payment methods available",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):X.value&&J.value?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{class:e.normalizeClass(["sv-upgrade-subscription__payment-method-picker",{"pointer-events-none opacity-60":H.value}])},[e.createVNode(u._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:Z,"customer-id":F.value,"country-code":X.value,context:de.value,amount:se.value,variant:"AUTHORIZE","payment-method-options":z.value,"validate-on-submit":ve,"force-store-payment-method":"",onPaymentSuccess:fe,onPaymentFailed:ye},null,8,["customer-id","country-code","context","amount","payment-method-options"])],2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])]),aside:e.withCtx(()=>[e.createElementVNode("div",j,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>[e.createVNode(N,{"selected-pricings":ne.value,invoice:Q.value,loading:G.value},null,8,["selected-pricings","invoice","loading"])]),_:1})]),me.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{key:0,class:"sv-upgrade-subscription__error sv-error",title:me.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",O,[e.createVNode(p._sfc_main,{class:"sv-upgrade-subscription__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase w-full",type:"button",disabled:!pe.value||H.value,loading:H.value,onClick:ge},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"])]),_:1}),e.createVNode(i._sfc_main$1,{"payment-method-options":z.value},null,8,["payment-method-options"])])]),_:1}))}}),F=e.defineComponent({__name:"UpgradeSubscription.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=>(i,a)=>{var r,o,s,l;return e.openBlock(),e.createBlock(n._sfc_main,{"custom-element-name":e.unref(q),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=t.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(l=null==(s=t.branding)?void 0:s.colors)?void 0:l.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:a[0]||(a[0]=e=>i.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(A,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),L=n.defineCustomElement(F),q=n.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=q,exports.SolvimonUpgradeSubscription=L,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(q)||customElements.define(q,L)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-C3Tq-qY_.js"),i=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js"),a=require("../../ContentWithAsideLayout-DHpnJfGA.js"),n=require("../../component-Bs8oszfD.js"),r=require("../../useActionDispatchProvider-BHTknMoH.js"),o=require("../../usePortal-DVD7PcWI.js"),s=require("../../subscriptions-CC61I6Nj.js"),l=require("../../customer-_W8gIX5m.js"),c=require("../../paymentMethods-DIbB759g.js"),d=require("../../invoices-D-OKipCg.js"),u=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js"),p=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),m=require("../../url-B6-3PkW2.js"),g=require("../../useViewport-CKRY1CKR.js"),v={class:"sv-order-summary__body grid grid-cols-1 gap-1"},_={class:"flex items-center justify-center gap-2 px-3 py-5"},f={class:"flex flex-row gap-3 px-3 py-2"},y={class:"grow"},h={class:"sv-order-summary__items grid grid-cols-1 gap-1"},b={class:"flex flex-row gap-2 px-3 py-2"},w={class:"flex flex-row gap-3 px-3 py-2"},k={class:"grow"},x={class:"flex flex-row gap-2 px-3 py-2"},N=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},loading:{type:Boolean}},setup(i){const a=i,{$t:n}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,i,a,n,r;const o=null==(r=null==(n=null==(a=null==(i=null==(t=e.items)?void 0:t[0])?void 0:i.configs)?void 0:a[0])?void 0:n.bands)?void 0:r[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)},s=e.computed(()=>{var e,t,i,r,o,s,c,d;const u=null==(r=null==(i=null==(t=null==(e=a.invoice)?void 0:e.periods)?void 0:t[0])?void 0:i.groups)?void 0:r[0],p=null==(o=null==u?void 0:u.products)?void 0:o[0],m=l.value.length;return{title:(null==p?void 0:p.name)??(null==(s=null==u?void 0:u.product_category)?void 0:s.name)??(null==(c=l.value[0])?void 0:c.description),subtitle:m>1?n({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.item_count",description:"Subtitle shown below the product name when multiple one-off items are selected"},{count:String(m)}):null==(d=l.value[0])?void 0:d.description}}),l=e.computed(()=>{var e;return((null==(e=a.invoice)?void 0:e.periods)??[]).flatMap((e,t)=>e.groups.flatMap((e,i)=>(e.lines??[]).map((a,n)=>{var r,o,s,l,c;return{key:`${t}-${i}-${n}`,description:a.description??(null==(o=null==(r=a.product_items)?void 0:r[0])?void 0:o.name)??(null==(l=null==(s=e.products)?void 0:s[0])?void 0:l.name)??(null==(c=e.product_category)?void 0:c.name)??"—",amount:a.amount_excluding_tax}})))}),c=e.computed(()=>a.selectedPricings.map(e=>{var t,i;return{key:e.id,description:e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)??"—",amount:o(e)}})),d=e.computed(()=>n({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"}));return(a,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-order-summary sv-upgrade-subscription__order-summary","no-border":"","no-spacing":"","content-background":"none",title:d.value},{default:e.withCtx(()=>[e.createElementVNode("div",v,[r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(t._sfc_main$14),{icon:"shopping_cart",class:"text-gray-500"}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Select your items",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no items are selected in the order summary"})),1)]),_:1})])]),_:1})):i.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value.title?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.title),1)]),_:1}),s.value.subtitle?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.subtitle),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",b,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128))]),e.createVNode(e.unref(t._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$18),{class:"sv-order-summary__invoice-preview",variant:"without-products",invoice:i.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",k,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"Selected items",id:"upgrade_subscription.order_summary.selected_items_title",description:"Temporary order summary title shown while the invoice preview is loading"}):null==(t=c.value[0])?void 0:t.description),1)]}),_:1}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.selected_item_count",description:"Temporary order summary subtitle shown while the invoice preview is loading"},{count:String(c.value.length)}):e.unref(n)({defaultMessage:"one-off",id:"upgrade_subscription.order_summary.one_off_label",description:"One-off payment label next to a line item in order summary"})),1)]),_:1})])])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",x,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128)),i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,class:"sv-order-summary__totals"},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("div",{class:"grid grid-cols-1 gap-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-40 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-16 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"border-t border-gray-200 pt-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-5 w-36 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-5 w-24 animate-pulse rounded bg-gray-100"})])])],-1)])]),_:1})):e.createCommentVNode("",!0)],64))])]),_:1},8,["title"]))}}),V=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean},loading:{type:Boolean}},emits:["toggle"],setup(a,{emit:n}){const r=a,o=n,{$t:s}=t.useIntl(),l=e.computed(()=>{var e,t,i,a,n,o;return r.pricing.name??(null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.product_items)?void 0:i[0])?void 0:a.name)??(null==(o=null==(n=r.pricing.products)?void 0:n[0])?void 0:o.name)??"—"}),c=e.computed(()=>{var e,t,i,a,n;const o=null==(n=null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:i[0])?void 0:a.bands)?void 0:n[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)}),d=e.computed(()=>c.value?`${t.formatAmount(c.value)} ${s({defaultMessage:"one-off",id:"on_demand_pricing_row.one_off_label",description:"One-off label shown next to the price in an on-demand pricing row"})}`:"");return(n,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"content-background":a.selected?"none":"gray","content-classes":a.selected?"!border-primary-600 ring-1 ring-primary-600":void 0},{default:e.withCtx(()=>[e.createVNode(i._sfc_main,{name:l.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",loading:a.loading,onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1},8,["loading"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:1,color:"primary",size:"sm","icon-prefix":"add",loading:a.loading,onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add to cart",id:"on_demand_pricing_row.add_to_cart_button_label",description:"Label for the add to cart button in an on-demand pricing row"})),1)]),_:1},8,["loading"]))]),_:1},8,["name","description"])]),_:1},8,["content-background","content-classes"]))}}),B={class:"sv-pricing-list__items grid grid-cols-1 gap-1"},C=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array},loadingPricingId:{type:String}},emits:["toggle"],setup(i,{emit:a}){const n=i,r=a,{$t:o}=t.useIntl(),s=e.computed(()=>[...n.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0))),l=e=>{var t;return(null==(t=e.product_category)?void 0:t.name)??e.name??o({defaultMessage:"Items",id:"on_demand_pricing_list.category_fallback_title",description:"Fallback title for the selectable pricing items when no product category name is available"})};return(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"sv-pricing-list__category flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-3",tag:"h2",class:"sv-pricing-list__category-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(a)),1)]),_:2},1024),e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[0]||(n[0]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricing_groups,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold",class:"sv-pricing-list__group-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[1]||(n[1]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128))],64))),128))])]))),128))}});const E={key:0,class:"sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"},S={class:"flex flex-col items-center text-center"},T={class:"sv-upgrade-subscription__header"},P={key:1,class:"sv-upgrade-subscription__pricing-list"},I={key:2,class:"sv-upgrade-subscription__loading p-4"},$={class:"sv-upgrade-subscription__payment-methods"},D={key:0,class:"sv-upgrade-subscription__payment-methods-body"},M={key:1,class:"sv-upgrade-subscription__payment-form"},j={class:"sv-upgrade-subscription__order-summary"},O={class:"flex flex-col gap-2"},A=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(v){const _=v,{$t:f}=t.useIntl(),{getSubscription:y}=s.createSubscriptionsService(),{getCustomer:h}=l.createCustomerService(),{getOnDemandPricingItems:b}=function(){const e=n.createRequestService(),t=n.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:i,pricingPlanVersionId:a,pricingItemIds:n,startAt:r,finalizeImmediately:o=!0,paymentMethodId:s}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:n,...r?{start_at:r}:{},finalize_immediately:o,...s?{payment_method_id:s}:{}}})},getOnDemandPricingItems:function({scheduleId:i}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/on-demand-pricing-items`})}}}(),{getPaymentMethodOptions:w}=c.createPaymentMethodsService(),{previewChargeOnDemandPricingItems:k}=d.createInvoicesService(),x=o.usePortal(),V=n.useLogger(),{dispatchAction:B}=r.useActionDispatchProvider(),{isMobileViewport:A}=g.useViewport(),F=e.computed(()=>x.value.customer_id),L={currency:"EUR",quantity:"0"},q=e.ref([]),U=e.ref(!1),R=e.ref([]),z=e.ref([]),W=e.ref(!1),G=e.ref(!1),H=e.ref(!1),Y=e.ref(void 0),K=e.ref(void 0),Z=e.ref(),J=e.ref(void 0),Q=e.ref(void 0),X=e.ref(void 0),ee=(e,t=[])=>t.find(t=>t.id===e.id),te=(e,t)=>(e.items??[]).map(i=>{var a,n,r,o,s,l,c;const d=null==(a=null==t?void 0:t.items)?void 0:a.find(e=>e.id===i.id),u=i.product_items??(null==d?void 0:d.product_items);return{...e,id:i.id,name:(null==(r=null==(n=i.product_items)?void 0:n[0])?void 0:r.name)??(null==(s=null==(o=null==d?void 0:d.product_items)?void 0:o[0])?void 0:s.name)??e.name??(null==t?void 0:t.name)??(null==(c=null==(l=null==t?void 0:t.products)?void 0:l[0])?void 0:c.name),products:e.products??(null==t?void 0:t.products),items:[{...i,product_items:u}]}}),ie=async()=>{var e,i,a;W.value=!0,K.value=void 0;try{const n=await(async()=>{const e=[...(await y({id:_.configuration.subscriptionId,expanded:!0})).pricing_plan_schedule_infos??[]].sort((e,t)=>Date.parse(t.start_at)-Date.parse(e.start_at)),t=Date.now(),i=e.find(e=>{var i;const a=(null==(i=e.pricing_plan_schedule)?void 0:i.type)??e.type,n=Date.parse(e.start_at),r=e.end_at?Date.parse(e.end_at):void 0,o=Number.isFinite(n)&&n<=t,s=void 0===r||!Number.isFinite(r)||r>t;return"DEFAULT"===a&&o&&s});if(!(null==i?void 0:i.id))throw new Error("No pricing plan schedule found for subscription");return i})();J.value=n.id;const[r,o,s]=await Promise.all([b({scheduleId:J.value}),w({customerId:F.value}),h(F.value)]);R.value=(i=r.pricing_categories??[],a=(null==(e=n.pricing_plan_version)?void 0:e.pricing_categories)??[],i.map(e=>{var t;const i=((e,t)=>t.find(t=>t.product_category_id===e.product_category_id))(e,a);return{...e,name:e.name??(null==(t=null==i?void 0:i.product_category)?void 0:t.name),product_category:e.product_category??(null==i?void 0:i.product_category),pricings:(e.pricings??[]).flatMap(e=>te(e,ee(e,null==i?void 0:i.pricings))),pricing_groups:(e.pricing_groups??[]).map(e=>{var t;const a=null==(t=null==i?void 0:i.pricing_groups)?void 0:t.find(t=>t.id===e.id);return{...e,name:e.name??(null==a?void 0:a.name),pricings:(e.pricings??[]).flatMap(e=>te(e,ee(e,null==a?void 0:a.pricings)))}})}})),z.value=o,X.value=t.getCustomerCountry(s)}catch(n){V.error("INITIAL_DATA_LOAD_FAILED","Failed to load on-demand pricing items",{},n),K.value=f({defaultMessage:"Unable to load items. Please try again later.",id:"upgrade_subscription.load_error",description:"Error message shown when the one-off items cannot be loaded on the upgrade subscription page"})}finally{W.value=!1}};e.onMounted(()=>{ie()});const ae=e.computed(()=>R.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),ne=e.computed(()=>ae.value.filter(e=>q.value.includes(e.id))),re=e.computed(()=>ne.value.flatMap(e=>e.items??[]).map(e=>e.id).filter(e=>!!e)),oe=e.computed(()=>{var e,t;return null==(t=null==(e=Q.value)?void 0:e.tax_summary)?void 0:t.total_amount}),se=e.computed(()=>oe.value??L);let le,ce=0;e.watch([re,J],([e,t])=>{clearTimeout(le);const i=++ce;if(me.value=void 0,!t||0===e.length)return Q.value=void 0,G.value=!1,void(Y.value=void 0);G.value=!0,le=setTimeout(()=>{k({pricingPlanScheduleId:t,pricingItemIds:e}).then(e=>{i===ce&&(Q.value=e)}).catch(e=>{i===ce&&(V.error("INVOICE_PREVIEW_FAILED","Failed to load charge-on-demand invoice preview",{},e),me.value=f({defaultMessage:"Unable to calculate the total. Please try again.",id:"upgrade_subscription.preview_error",description:"Error message shown when the upgrade subscription invoice preview cannot be loaded"}),Q.value=void 0)}).finally(()=>{i===ce&&(G.value=!1,Y.value=void 0)})},400)});const de=e.computed(()=>{if(!J.value)throw new Error("Cannot create charge-on-demand authorization context without a schedule.");return{type:"CHARGE_ON_DEMAND",charge_on_demand:{pricing_plan_schedule_id:J.value,pricing_items:re.value.map(e=>({pricing_item_id:e}))}}}),ue=e=>{Y.value=e,q.value.includes(e)?q.value=q.value.filter(t=>t!==e):q.value=[...q.value,e]},pe=e.computed(()=>re.value.length>0&&!!J.value&&!!oe.value&&!G.value&&z.value.length>0),me=e.ref(void 0),ge=async()=>{var e;pe.value&&!H.value&&(me.value=void 0,H.value=!0,null==(e=Z.value)||e.submit())},ve=async()=>pe.value;let _e;const fe=()=>{H.value=!1,U.value=!0,_e=setTimeout(()=>{B({action:"navigate-to-customer-overview"})},3e3)},ye=e=>{H.value=!1,me.value=e.message||f({defaultMessage:"Something went wrong. Please try again.",id:"upgrade_subscription.purchase_error",description:"Error message shown when the purchase call fails on the upgrade subscription page"})};return e.onUnmounted(()=>{clearTimeout(le),clearTimeout(_e)}),(n,r)=>U.value?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(m._sfc_main,{class:"sv-upgrade-subscription__success",status:"success",title:e.unref(f)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful upgrade purchase"})},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-message mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Your purchase has been completed.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful upgrade purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-redirect mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"You will be redirected shortly…",id:"upgrade_subscription.success.redirect",description:"Shown below the success message while the redirect timer is running"})),1)]),_:1})])]),_:1},8,["title"])])):(e.openBlock(),e.createBlock(e.unref(a.ContentWithAsideLayout),{key:1,class:"sv-upgrade-subscription sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",T,[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-2",tag:"h1",class:"sv-upgrade-subscription__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Upgrade subscription",id:"upgrade_subscription.title",description:"Title for the upgrade subscription page"})),1)]),_:1})])]),content:e.withCtx(()=>[e.unref(A)?(e.openBlock(),e.createBlock(N,{key:0,class:"sv-upgrade-subscription__mobile-order-summary","selected-pricings":ne.value,invoice:Q.value,loading:G.value},null,8,["selected-pricings","invoice","loading"])):e.createCommentVNode("",!0),!W.value&&!K.value&&R.value.length>0?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(C,{categories:R.value,"selected-pricing-ids":q.value,"loading-pricing-id":Y.value,onToggle:ue},null,8,["categories","selected-pricing-ids","loading-pricing-id"])])):W.value?(e.openBlock(),e.createElementBlock("div",I,[...r[0]||(r[0]=[e.createElementVNode("div",{class:"sv-skeleton h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):K.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{key:3,class:"sv-upgrade-subscription__load-error sv-error m-4",title:K.value},null,8,["title"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:4,variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__empty-state p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No one-off items are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no one-off items available for the subscription"})),1)]),_:1})),e.createElementVNode("div",$,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!W.value||W.value&&z.value.length>0?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-3",tag:"h2",class:"sv-upgrade-subscription__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Payment method",id:"upgrade_subscription.payment_method_block.title",description:"The title of the payment method block in the upgrade subscription flow"})),1)]),_:1}),0===z.value.length?(e.openBlock(),e.createBlock(i._sfc_main$2,{key:0,class:"sv-upgrade-subscription__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No payment methods available",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):X.value&&J.value?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{class:e.normalizeClass(["sv-upgrade-subscription__payment-method-picker",{"pointer-events-none opacity-60":H.value}])},[e.createVNode(u._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:Z,"customer-id":F.value,"country-code":X.value,context:de.value,amount:se.value,variant:"AUTHORIZE","payment-method-options":z.value,"validate-on-submit":ve,"force-store-payment-method":"",onPaymentSuccess:fe,onPaymentFailed:ye},null,8,["customer-id","country-code","context","amount","payment-method-options"])],2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])]),aside:e.withCtx(()=>[e.createElementVNode("div",j,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>[e.createVNode(N,{"selected-pricings":ne.value,invoice:Q.value,loading:G.value},null,8,["selected-pricings","invoice","loading"])]),_:1})]),me.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{key:0,class:"sv-upgrade-subscription__error sv-error",title:me.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",O,[e.createVNode(p._sfc_main,{class:"sv-upgrade-subscription__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase w-full",type:"button",disabled:!pe.value||H.value,loading:H.value,onClick:ge},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"])]),_:1}),e.createVNode(i._sfc_main$1,{"payment-method-options":z.value},null,8,["payment-method-options"])])]),_:1}))}}),F=e.defineComponent({__name:"UpgradeSubscription.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=>(i,a)=>{var r,o,s,l;return e.openBlock(),e.createBlock(n._sfc_main,{"custom-element-name":e.unref(q),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=t.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(l=null==(s=t.branding)?void 0:s.colors)?void 0:l.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:a[0]||(a[0]=e=>i.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(A,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),L=n.defineCustomElement(F),q=n.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=q,exports.SolvimonUpgradeSubscription=L,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(q)||customElements.define(q,L)};
@@ -2,14 +2,14 @@ import { defineComponent, computed, openBlock, createBlock, unref, withCtx, crea
2
2
  import { u as useIntl, _ as _sfc_main$5, A as _sfc_main$6, e as _sfc_main$7, x as _sfc_main$8, F as _sfc_main$9, B as formatAmount, c as _sfc_main$b, E as _sfc_main$e, g as getCustomerCountry } from "../../vendor-ui-B8IlviSs.mjs";
3
3
  import { _ as _sfc_main$a, a as _sfc_main$f, b as _sfc_main$g } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs";
4
4
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
5
- import { c as createRequestService, u as useConfig, a as useLogger, _ as _sfc_main$i, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
6
- import { u as useActionDispatchProvider } from "../../useActionDispatchProvider-DmhD9mYX.mjs";
7
- import { u as usePortal } from "../../usePortal-DcOz9FEL.mjs";
8
- import { c as createSubscriptionsService } from "../../subscriptions-DHjXDyH1.mjs";
9
- import { c as createCustomerService } from "../../customer-CANPEYH9.mjs";
10
- import { c as createPaymentMethodsService } from "../../paymentMethods-D-5FNN8W.mjs";
11
- import { c as createInvoicesService } from "../../invoices-DBv0qkgm.mjs";
12
- import { _ as _sfc_main$h } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs";
5
+ import { c as createRequestService, u as useConfig, a as useLogger, _ as _sfc_main$i, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
6
+ import { u as useActionDispatchProvider } from "../../useActionDispatchProvider-Dz8-e4gZ.mjs";
7
+ import { u as usePortal } from "../../usePortal-B1O1zgdV.mjs";
8
+ import { c as createSubscriptionsService } from "../../subscriptions-BPYyv09M.mjs";
9
+ import { c as createCustomerService } from "../../customer-Bv_fqXzO.mjs";
10
+ import { c as createPaymentMethodsService } from "../../paymentMethods-DvqlWe96.mjs";
11
+ import { c as createInvoicesService } from "../../invoices-BGb0AwVF.mjs";
12
+ import { _ as _sfc_main$h } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs";
13
13
  import { _ as _sfc_main$d } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
14
14
  import { _ as _sfc_main$c } from "../../url-1Lbg5Yni.mjs";
15
15
  import { u as useViewport } from "../../useViewport-Bu0cyeSi.mjs";
@@ -1,5 +1,5 @@
1
1
  import { w as withExpand, s as serializeQueryParams, a as withPagination } from "./vendor-ui-B8IlviSs.mjs";
2
- import { u as useConfig, c as createRequestService } from "./component-BSnccqm1.mjs";
2
+ import { u as useConfig, c as createRequestService } from "./component-Bg2JVC_O.mjs";
3
3
  const ENDPOINT = "/portal/pricing-plan-subscriptions";
4
4
  function createSubscriptionsService() {
5
5
  const config = useConfig();
@@ -1 +1 @@
1
- const i=require("./vendor-ui-C3Tq-qY_.js"),e=require("./component-B53Df2Rt.js"),r="/portal/pricing-plan-subscriptions";exports.createSubscriptionsService=function(){const n=e.useConfig(),_=e.createRequestService();return{getSubscription:function({id:e,expanded:c=!1}){const s=c?["pricing_plan_schedule_infos.id","pricing_plan_schedule_infos.pricing_plan_version_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_plan_id","pricing_plan_schedule_infos.pricing_plan_version.credit_types","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.product_category_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.product_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.entitlements.feature_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.configs.conditions.meter_properties.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.configs.wallet_grants.wallet_type_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_item_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_based.meter_value_calculation_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter_value_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_values.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.product_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.configs.conditions.meter_properties.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.configs.wallet_grants.wallet_type_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_item_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_based.meter_value_calculation_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter_value_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_values","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_values.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties.id"]:[];return _({url:`${n.apiUrls.config}${r}/${e}${i.serializeQueryParams(i.withExpand({expandParams:s}))}`})},getActiveSubscriptions:function({customerId:e,pagination:c}){const s=c??{},p=i.withExpand({initialParams:{customer_id:e,statuses:["ACTIVE"],type:"BILLING"},expandParams:["pricing_plan_schedule_infos.pricing_plan_version_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_plan_id"]}),t=i.serializeQueryParams(i.withPagination(p,s));return _({url:`${n.apiUrls.config}${r}${t}`,isCollection:!0})}}};
1
+ const i=require("./vendor-ui-C3Tq-qY_.js"),e=require("./component-Bs8oszfD.js"),r="/portal/pricing-plan-subscriptions";exports.createSubscriptionsService=function(){const n=e.useConfig(),_=e.createRequestService();return{getSubscription:function({id:e,expanded:c=!1}){const s=c?["pricing_plan_schedule_infos.id","pricing_plan_schedule_infos.pricing_plan_version_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_plan_id","pricing_plan_schedule_infos.pricing_plan_version.credit_types","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.product_category_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.product_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.entitlements.feature_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.configs.conditions.meter_properties.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.configs.wallet_grants.wallet_type_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_item_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_based.meter_value_calculation_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter_value_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_values.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.product_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.configs.conditions.meter_properties.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.configs.wallet_grants.wallet_type_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_item_ids","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_based.meter_value_calculation_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter_value_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_values","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_values.id","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties","pricing_plan_schedule_infos.pricing_plan_version.pricing_categories.pricing_groups.pricings.items.product_items.usage_metric.meter_value_calculation.meter.meter_properties.id"]:[];return _({url:`${n.apiUrls.config}${r}/${e}${i.serializeQueryParams(i.withExpand({expandParams:s}))}`})},getActiveSubscriptions:function({customerId:e,pagination:c}){const s=c??{},p=i.withExpand({initialParams:{customer_id:e,statuses:["ACTIVE"],type:"BILLING"},expandParams:["pricing_plan_schedule_infos.pricing_plan_version_id","pricing_plan_schedule_infos.pricing_plan_version.pricing_plan_id"]}),t=i.serializeQueryParams(i.withPagination(p,s));return _({url:`${n.apiUrls.config}${r}${t}`,isCollection:!0})}}};
@@ -1 +1 @@
1
- const t=require("vue"),i=require("./component-B53Df2Rt.js");exports.useActionDispatchProvider=function(){const o=t.inject(i.ACTION_DISPATCHER_PROVIDER_INJECTION_KEY);if(!o)throw new Error("dispatchAction is not provided");return{dispatchAction:o}};
1
+ const t=require("vue"),i=require("./component-Bs8oszfD.js");exports.useActionDispatchProvider=function(){const o=t.inject(i.ACTION_DISPATCHER_PROVIDER_INJECTION_KEY);if(!o)throw new Error("dispatchAction is not provided");return{dispatchAction:o}};
@@ -1,5 +1,5 @@
1
1
  import { inject } from "vue";
2
- import { A as ACTION_DISPATCHER_PROVIDER_INJECTION_KEY } from "./component-BSnccqm1.mjs";
2
+ import { A as ACTION_DISPATCHER_PROVIDER_INJECTION_KEY } from "./component-Bg2JVC_O.mjs";
3
3
  function useActionDispatchProvider() {
4
4
  const dispatchAction = inject(ACTION_DISPATCHER_PROVIDER_INJECTION_KEY);
5
5
  if (!dispatchAction) {
@@ -1,5 +1,5 @@
1
1
  import { ref } from "vue";
2
- import { c as createCustomerService } from "./customer-CANPEYH9.mjs";
2
+ import { c as createCustomerService } from "./customer-Bv_fqXzO.mjs";
3
3
  import { u as useService } from "./useService-DF57xuDd.mjs";
4
4
  function useCustomer({ customerId }) {
5
5
  const { getCustomer, updateCustomer } = createCustomerService();
@@ -1 +1 @@
1
- const e=require("vue"),r=require("./customer-B5b2tLhw.js"),t=require("./useService-CHrkefKd.js");exports.useCustomer=function({customerId:u}){const{getCustomer:s,updateCustomer:c}=r.createCustomerService(),a=e.ref(),{data:o,...i}=t.useService({service:async()=>{const e=await s(u);return a.value=e,e}}),{data:n,...v}=t.useService({service:async e=>{const r=await c(u,e);return a.value=r,r}});return{customer:a,get:i,update:v}};
1
+ const e=require("vue"),r=require("./customer-_W8gIX5m.js"),t=require("./useService-CHrkefKd.js");exports.useCustomer=function({customerId:u}){const{getCustomer:s,updateCustomer:c}=r.createCustomerService(),a=e.ref(),{data:o,...i}=t.useService({service:async()=>{const e=await s(u);return a.value=e,e}}),{data:n,...v}=t.useService({service:async e=>{const r=await c(u,e);return a.value=r,r}});return{customer:a,get:i,update:v}};
@@ -1 +1 @@
1
- const e=require("./invoices-BCmE_nnb.js"),t=require("./payments-BTTtcfyI.js"),n=require("vue"),a=require("./useWatchDebounced-C_YxgoQ6.js");exports.useInvoiceData=function(c){const{getInvoice:r}=e.createInvoicesService(),{getPayments:s}=t.createPaymentsService();return(({getData:e,onError:t,watchValue:c,debounce:r=200})=>{const s=n.ref(),u=n.ref(!0),i=async()=>{try{s.value=await e(c)}catch(n){null==t||t(n)}finally{u.value=!1}};return c&&a.useWatchDebounced(c,()=>{i()},{debounce:r}),n.onMounted(async()=>{i()}),{data:s,isPending:u}})({getData:async()=>{const[e,t]=await Promise.all([r(c),s(c)]);return{invoice:e,paymentAttempts:t}}})};
1
+ const e=require("./invoices-D-OKipCg.js"),t=require("./payments-DMDDI3MK.js"),n=require("vue"),a=require("./useWatchDebounced-C_YxgoQ6.js");exports.useInvoiceData=function(c){const{getInvoice:r}=e.createInvoicesService(),{getPayments:s}=t.createPaymentsService();return(({getData:e,onError:t,watchValue:c,debounce:r=200})=>{const s=n.ref(),u=n.ref(!0),i=async()=>{try{s.value=await e(c)}catch(n){null==t||t(n)}finally{u.value=!1}};return c&&a.useWatchDebounced(c,()=>{i()},{debounce:r}),n.onMounted(async()=>{i()}),{data:s,isPending:u}})({getData:async()=>{const[e,t]=await Promise.all([r(c),s(c)]);return{invoice:e,paymentAttempts:t}}})};
@@ -1,5 +1,5 @@
1
- import { c as createInvoicesService } from "./invoices-DBv0qkgm.mjs";
2
- import { c as createPaymentsService } from "./payments-BK8yzqJ5.mjs";
1
+ import { c as createInvoicesService } from "./invoices-BGb0AwVF.mjs";
2
+ import { c as createPaymentsService } from "./payments-CpzTVrQM.mjs";
3
3
  import { ref, onMounted } from "vue";
4
4
  import { u as useWatchDebounced } from "./useWatchDebounced-Zmxd6InB.mjs";
5
5
  const useData = ({
@@ -1 +1 @@
1
- const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),i=require("./useActionDispatchProvider-CizNgRwv.js"),o=require("./useIncrementalLoading-CuSndpP2.js"),a=require("./invoices-BCmE_nnb.js"),n={class:"sv-table sv-invoices-list__table grid-cols-1 gap-4"},s=["onClick"],c={class:"flex flex-col"},l={class:"sv-invoices-list__load-more mt-2 flex items-center justify-center"},r=e.defineComponent({__name:"InvoiceTable",props:{invoices:{type:Array},isLoading:{type:Boolean},hasMoreItems:{type:Boolean},configuration:{type:Object}},emits:["view-invoice","pay-invoice","load-more"],setup(i){const o=i,{formatDate:a,$t:r}=t.useIntl(),d=e.computed(()=>o.configuration.showPayButton),u=e.computed(()=>o.configuration.showViewButton),_=e.computed(()=>o.hasMoreItems);return(o,v)=>(e.openBlock(),e.createElementBlock("div",n,[e.createVNode(e.unref(t._sfc_main$7),{striped:"","no-border":"",rounded:"",hoverable:"","stripe-class":"group-odd:bg-gray-50/50"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.TableHead),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t.TableHeadRow),{class:"sv-table__head"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--invoice"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Invoice",description:"The title of the invoice number header column of the invoice table",id:"invoice_table.header.invoice_number"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--date hidden md:table-cell"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Date",description:"The title of the invoice date header column of the invoice table",id:"invoice_table.header.date"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--amount"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Amount",description:"The title of the invoice amount header column of the invoice table",id:"invoice_table.header.amount"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--status text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Status",description:"The title of the invoice status header column of the invoice table",id:"invoice_table.header.status"})),1)]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(t.TableBody),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.invoices,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$9),{key:i.id,class:"sv-table__row sv-invoices-list__row"},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$10),{"has-padding":"",class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--invoice h-14"},{default:e.withCtx(()=>[e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-sm",class:"md:hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:i.invoice_date,format:"date",offsetType:"offsetted",timezone:i.customer.timezone})),1)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.invoice_number),1)]),_:2},1024)])]),_:2},1024),e.createVNode(e.unref(t._sfc_main$10),{class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--date hidden h-14 md:table-cell"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:i.invoice_date,format:"date",offsetType:"offsetted",timezone:i.customer.timezone})),1)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$10),{class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--amount h-14"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",weight:"semibold"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.invoice_amount_including_tax},null,8,["value"])]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$10),{class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--status h-14 text-right"},{default:e.withCtx(()=>[i.paid?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$5),{key:0,color:"green"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Paid",description:"The label of the chip for paid invoices",id:"invoice_table.chip.paid"})),1)]),_:1})):d.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:1,variant:"outline",color:"gray",size:"sm",class:"sv-action sv-action--secondary sv-invoices-list__pay",type:"button",onClick:e.withModifiers(e=>o.$emit("pay-invoice",{invoiceId:i.id}),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Pay",description:"The label for the pay invoice button",id:"customer.invoice_table.pay_invoice_button.label"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},[u.value?{name:"link",fn:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"sv-invoices-list__row-action absolute inset-0 h-full w-full",onClick:e=>o.$emit("view-invoice",{invoiceId:i.id})},null,8,s)]),key:"0"}:void 0]),1024))),128))]),_:1})]),_:1}),e.createElementVNode("div",l,[_.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,variant:"outline",color:"gray",size:"sm",class:"sv-action sv-action--secondary sv-action--full-width w-full",loading:i.isLoading,onClick:v[0]||(v[0]=e=>o.$emit("load-more"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Load more",description:"The label for the load more button",id:"invoice_table.button.load_more"})),1)]),_:1},8,["loading"])):e.createCommentVNode("",!0)])]))}}),d=e.defineComponent({__name:"InvoicesList",props:{invoices:{type:Array},isLoading:{type:Boolean},hasMoreItems:{type:Boolean},configuration:{default:()=>({showPayButton:!0,showViewButton:!0,pagination:{batchSize:15,enabled:!0}}),type:Object}},emits:["load-more"],setup(o){const{$t:a}=t.useIntl(),{dispatchAction:n}=i.useActionDispatchProvider();return(i,s)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-invoices-list sv-root sv-component","no-border":"","no-spacing":"","content-background":"none",title:e.unref(a)({defaultMessage:"Invoices",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(r,{class:"sv-invoices-list__table",configuration:o.configuration,"has-more-items":o.hasMoreItems,invoices:o.invoices,"is-loading":o.isLoading,onLoadMore:s[0]||(s[0]=e=>i.$emit("load-more")),onViewInvoice:s[1]||(s[1]=t=>e.unref(n)({action:"view-invoice",data:{invoiceId:t.invoiceId}})),onPayInvoice:s[2]||(s[2]=t=>e.unref(n)({action:"pay-invoice",data:{invoiceId:t.invoiceId}}))},null,8,["configuration","has-more-items","invoices","is-loading"])]),_:1},8,["title"]))}});exports._sfc_main=d,exports.useInvoicesList=function({customerId:e,batchSize:t=15}){const i=a.createInvoicesService();return o.useIncrementalLoading({service:async o=>i.getInvoices({customerId:e,pagination:{page:o,pageSize:t}})})};
1
+ const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),i=require("./useActionDispatchProvider-BHTknMoH.js"),o=require("./useIncrementalLoading-CuSndpP2.js"),a=require("./invoices-D-OKipCg.js"),n={class:"sv-table sv-invoices-list__table grid-cols-1 gap-4"},s=["onClick"],c={class:"flex flex-col"},l={class:"sv-invoices-list__load-more mt-2 flex items-center justify-center"},r=e.defineComponent({__name:"InvoiceTable",props:{invoices:{type:Array},isLoading:{type:Boolean},hasMoreItems:{type:Boolean},configuration:{type:Object}},emits:["view-invoice","pay-invoice","load-more"],setup(i){const o=i,{formatDate:a,$t:r}=t.useIntl(),d=e.computed(()=>o.configuration.showPayButton),u=e.computed(()=>o.configuration.showViewButton),_=e.computed(()=>o.hasMoreItems);return(o,v)=>(e.openBlock(),e.createElementBlock("div",n,[e.createVNode(e.unref(t._sfc_main$7),{striped:"","no-border":"",rounded:"",hoverable:"","stripe-class":"group-odd:bg-gray-50/50"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.TableHead),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t.TableHeadRow),{class:"sv-table__head"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--invoice"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Invoice",description:"The title of the invoice number header column of the invoice table",id:"invoice_table.header.invoice_number"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--date hidden md:table-cell"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Date",description:"The title of the invoice date header column of the invoice table",id:"invoice_table.header.date"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--amount"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Amount",description:"The title of the invoice amount header column of the invoice table",id:"invoice_table.header.amount"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$8),{class:"sv-table__cell sv-invoices-list__cell--status text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Status",description:"The title of the invoice status header column of the invoice table",id:"invoice_table.header.status"})),1)]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(t.TableBody),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.invoices,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$9),{key:i.id,class:"sv-table__row sv-invoices-list__row"},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$10),{"has-padding":"",class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--invoice h-14"},{default:e.withCtx(()=>[e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-sm",class:"md:hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:i.invoice_date,format:"date",offsetType:"offsetted",timezone:i.customer.timezone})),1)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.invoice_number),1)]),_:2},1024)])]),_:2},1024),e.createVNode(e.unref(t._sfc_main$10),{class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--date hidden h-14 md:table-cell"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:i.invoice_date,format:"date",offsetType:"offsetted",timezone:i.customer.timezone})),1)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$10),{class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--amount h-14"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",weight:"semibold"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.invoice_amount_including_tax},null,8,["value"])]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$10),{class:"sv-table__cell sv-invoices-list__cell sv-invoices-list__cell--status h-14 text-right"},{default:e.withCtx(()=>[i.paid?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$5),{key:0,color:"green"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Paid",description:"The label of the chip for paid invoices",id:"invoice_table.chip.paid"})),1)]),_:1})):d.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:1,variant:"outline",color:"gray",size:"sm",class:"sv-action sv-action--secondary sv-invoices-list__pay",type:"button",onClick:e.withModifiers(e=>o.$emit("pay-invoice",{invoiceId:i.id}),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Pay",description:"The label for the pay invoice button",id:"customer.invoice_table.pay_invoice_button.label"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},[u.value?{name:"link",fn:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"sv-invoices-list__row-action absolute inset-0 h-full w-full",onClick:e=>o.$emit("view-invoice",{invoiceId:i.id})},null,8,s)]),key:"0"}:void 0]),1024))),128))]),_:1})]),_:1}),e.createElementVNode("div",l,[_.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,variant:"outline",color:"gray",size:"sm",class:"sv-action sv-action--secondary sv-action--full-width w-full",loading:i.isLoading,onClick:v[0]||(v[0]=e=>o.$emit("load-more"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Load more",description:"The label for the load more button",id:"invoice_table.button.load_more"})),1)]),_:1},8,["loading"])):e.createCommentVNode("",!0)])]))}}),d=e.defineComponent({__name:"InvoicesList",props:{invoices:{type:Array},isLoading:{type:Boolean},hasMoreItems:{type:Boolean},configuration:{default:()=>({showPayButton:!0,showViewButton:!0,pagination:{batchSize:15,enabled:!0}}),type:Object}},emits:["load-more"],setup(o){const{$t:a}=t.useIntl(),{dispatchAction:n}=i.useActionDispatchProvider();return(i,s)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-invoices-list sv-root sv-component","no-border":"","no-spacing":"","content-background":"none",title:e.unref(a)({defaultMessage:"Invoices",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(r,{class:"sv-invoices-list__table",configuration:o.configuration,"has-more-items":o.hasMoreItems,invoices:o.invoices,"is-loading":o.isLoading,onLoadMore:s[0]||(s[0]=e=>i.$emit("load-more")),onViewInvoice:s[1]||(s[1]=t=>e.unref(n)({action:"view-invoice",data:{invoiceId:t.invoiceId}})),onPayInvoice:s[2]||(s[2]=t=>e.unref(n)({action:"pay-invoice",data:{invoiceId:t.invoiceId}}))},null,8,["configuration","has-more-items","invoices","is-loading"])]),_:1},8,["title"]))}});exports._sfc_main=d,exports.useInvoicesList=function({customerId:e,batchSize:t=15}){const i=a.createInvoicesService();return o.useIncrementalLoading({service:async o=>i.getInvoices({customerId:e,pagination:{page:o,pageSize:t}})})};
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, Fragment, renderList, createBlock, createSlots, createElementVNode, withModifiers, createCommentVNode } from "vue";
2
2
  import { u as useIntl, o as _sfc_main$2, T as TableHead, p as TableHeadRow, q as _sfc_main$3, r as TableBody, t as _sfc_main$4, v as _sfc_main$5, e as _sfc_main$6, x as _sfc_main$7, k as _sfc_main$8, c as _sfc_main$9, _ as _sfc_main$a } from "./vendor-ui-B8IlviSs.mjs";
3
- import { u as useActionDispatchProvider } from "./useActionDispatchProvider-DmhD9mYX.mjs";
3
+ import { u as useActionDispatchProvider } from "./useActionDispatchProvider-Dz8-e4gZ.mjs";
4
4
  import { u as useIncrementalLoading } from "./useIncrementalLoading-DmOT2MXH.mjs";
5
- import { c as createInvoicesService } from "./invoices-DBv0qkgm.mjs";
5
+ import { c as createInvoicesService } from "./invoices-BGb0AwVF.mjs";
6
6
  const _hoisted_1 = { class: "sv-table sv-invoices-list__table grid-cols-1 gap-4" };
7
7
  const _hoisted_2 = ["onClick"];
8
8
  const _hoisted_3 = { class: "flex flex-col" };
@@ -1 +1 @@
1
- const e=require("vue"),a=require("./component-B53Df2Rt.js");exports.useLoadInitialData=function(...o){const t=e.ref(!0),n=a.useLogger();return e.onMounted(async()=>{await Promise.all(o).then(()=>{t.value=!1}).catch(e=>{t.value=!1,n.error("INITIAL_DATA_LOAD_FAILED","Failed to load initial data",{},e)})}),{isLoading:t}};
1
+ const e=require("vue"),a=require("./component-Bs8oszfD.js");exports.useLoadInitialData=function(...o){const t=e.ref(!0),n=a.useLogger();return e.onMounted(async()=>{await Promise.all(o).then(()=>{t.value=!1}).catch(e=>{t.value=!1,n.error("INITIAL_DATA_LOAD_FAILED","Failed to load initial data",{},e)})}),{isLoading:t}};
@@ -1,5 +1,5 @@
1
1
  import { ref, onMounted } from "vue";
2
- import { a as useLogger } from "./component-BSnccqm1.mjs";
2
+ import { a as useLogger } from "./component-Bg2JVC_O.mjs";
3
3
  function useLoadInitialData(...services) {
4
4
  const isLoading = ref(true);
5
5
  const logger = useLogger();
@@ -1,5 +1,5 @@
1
1
  import { u as useService } from "./useService-DF57xuDd.mjs";
2
- import { c as createPaymentMethodsService } from "./paymentMethods-D-5FNN8W.mjs";
2
+ import { c as createPaymentMethodsService } from "./paymentMethods-DvqlWe96.mjs";
3
3
  function hasCustomerId(payload) {
4
4
  return payload.customerId !== void 0;
5
5
  }
@@ -1 +1 @@
1
- const e=require("./useService-CHrkefKd.js"),t=require("./paymentMethods-u5y9B5ng.js");exports.usePaymentMethodOptions=function(){const{getPaymentMethodOptions:n}=t.createPaymentMethodsService(),{data:o,execute:r,apiStatus:u,error:i,isPending:s}=e.useService({initialValue:[],service:e=>function(e){return void 0!==e.customerId}(e)?n({customerId:e.customerId,amount:e.amount,country:e.country}):n({subscriptionId:e.subscriptionId,amount:e.amount,country:e.country})});return{paymentMethodOptions:o,get:r,apiStatus:u,error:i,isPending:s}};
1
+ const e=require("./useService-CHrkefKd.js"),t=require("./paymentMethods-DIbB759g.js");exports.usePaymentMethodOptions=function(){const{getPaymentMethodOptions:n}=t.createPaymentMethodsService(),{data:o,execute:r,apiStatus:u,error:i,isPending:s}=e.useService({initialValue:[],service:e=>function(e){return void 0!==e.customerId}(e)?n({customerId:e.customerId,amount:e.amount,country:e.country}):n({subscriptionId:e.subscriptionId,amount:e.amount,country:e.country})});return{paymentMethodOptions:o,get:r,apiStatus:u,error:i,isPending:s}};