@solvimon/solvimon-web 0.1.0-alpha.4 → 0.1.0-alpha.5
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.
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-LQgNMjOT.js → BillingInformation.vue_vue_type_script_setup_true_lang-BouYyZhD.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-_GGUwxEJ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CvUwy_tp.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-BQpDxDXI.js → ContentWithAsideLayout-BjJufFeN.js} +1 -1
- package/dist/{ContentWithAsideLayout-BJ0Ccghd.mjs → ContentWithAsideLayout-CKbnuXMU.mjs} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DxoeHBT0.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DaEPSNrY.mjs} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BgcSUvE1.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-sbmK2un9.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CCJ-J0t4.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CLU-8-Ao.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BKlI9Y8m.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-NRmK7iN3.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dhoaaymm.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ck_1lRDB.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D_JmUGZS.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DFCX2tcj.mjs} +3 -3
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-DCfpg7nK.js → PricingGroupContent.vue_vue_type_script_setup_true_lang-BOZurit_.js} +1 -1
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-wxetfLSR.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-DAwMy1l8.mjs} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DcunVa40.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Cj4cnM8z.mjs} +4 -4
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-C6AOtXAD.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-D49i1DHa.js} +1 -1
- package/dist/{component-BhrlC5ZJ.mjs → component-B0RYS5uK.mjs} +1 -1
- package/dist/{component-B5y7wYnP.js → component-BeqkeC9h.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +3 -3
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +2 -2
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -3
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +5 -5
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +2 -2
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +4 -4
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +2 -2
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -4
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +2 -2
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{invoices-BYnoNgSR.js → invoices-CUrXmVXe.js} +1 -1
- package/dist/{invoices-C8nfTLon.mjs → invoices-CoEBP5UT.mjs} +1 -1
- package/dist/{paymentMethods-BJVTwjzp.mjs → paymentMethods-C2gWIbEr.mjs} +1 -1
- package/dist/{paymentMethods-CwzFgccc.js → paymentMethods-D_rYLg3F.js} +1 -1
- package/dist/{payments-Da5LVn5H.js → payments-ClJySb0d.js} +1 -1
- package/dist/{payments-AWzaFsBd.mjs → payments-DLjkq_hN.mjs} +1 -1
- package/dist/{registry-DN-NWLUK.js → registry-EPF-VAYZ.js} +1 -1
- package/dist/{registry-Dll2lIBv.mjs → registry-bo_7pcbl.mjs} +2 -2
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +8 -8
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +9 -9
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +5 -5
- package/dist/{subscriptions-CMBt--lb.mjs → subscriptions-BepBTXR5.mjs} +1 -1
- package/dist/{subscriptions-0_i6paaS.js → subscriptions-DERHtyHo.js} +1 -1
- package/dist/{useActionDispatchProvider-J1S-vXqg.mjs → useActionDispatchProvider-B_SkyymZ.mjs} +1 -1
- package/dist/{useActionDispatchProvider-C-uVJcgJ.js → useActionDispatchProvider-D4OtXsNA.js} +1 -1
- package/dist/{useCustomer-DZKD_AMw.mjs → useCustomer-C0RKKfGJ.mjs} +1 -1
- package/dist/{useCustomer-ClGwkeNn.js → useCustomer-CEFUPIDZ.js} +1 -1
- package/dist/{useCustomerPaymentMethodOptions-D_5UvLze.js → useCustomerPaymentMethodOptions-BgCFkLeQ.js} +1 -1
- package/dist/{useCustomerPaymentMethodOptions-CbnzYwYp.mjs → useCustomerPaymentMethodOptions-BlFH4zxG.mjs} +3 -3
- package/dist/{useIncrementalLoading-DbQxYZ1J.mjs → useIncrementalLoading-BqD4k_-r.mjs} +1 -1
- package/dist/{useIncrementalLoading-DrgYXlRK.js → useIncrementalLoading-CDpeHhKs.js} +1 -1
- package/dist/{useInvoiceData-ca_-ah5G.mjs → useInvoiceData-7mqBeSPa.mjs} +2 -2
- package/dist/{useInvoiceData-BtxiSooD.js → useInvoiceData-DvNf2402.js} +1 -1
- package/dist/{useInvoicesList-CbzCTBaM.mjs → useInvoicesList-B5vYDRyl.mjs} +4 -4
- package/dist/{useInvoicesList-BMeLWF8r.js → useInvoicesList-CBqZG_rw.js} +1 -1
- package/dist/{usePaymentMethods-CuhSSaz4.mjs → usePaymentMethods-4Io2ZHlo.mjs} +2 -2
- package/dist/{usePaymentMethods-CaE9qm2M.js → usePaymentMethods-BdZkt6re.js} +1 -1
- package/dist/{useWalletBalanceItems-Cjis6nYZ.mjs → useWalletBalanceItems-B0NZuM3W.mjs} +1 -1
- package/dist/{useWalletBalanceItems-B-6IRohi.js → useWalletBalanceItems-CzV3PcJH.js} +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { unref, inject, ref, computed, onMounted, watch, defineComponent, useModel, openBlock, createElementBlock, withModifiers, createElementVNode, createVNode, withCtx, Fragment, createTextVNode, toDisplayString, createBlock, createCommentVNode, mergeModels, createSlots, renderSlot, normalizeClass, renderList, toRef, nextTick, withDirectives, withKeys, vShow } from "vue";
|
|
2
|
-
import { a3 as I18N_INJECTION_KEY, a4 as convertDateRangeToTimePeriod, G as useValidation, H as objectDiff, b as useIntl, a5 as getCountryNameByCode, d as _sfc_main$1g, _ as _sfc_main$2$1, K as _sfc_main$2a, L as _sfc_main$1$, m as _sfc_main$2H, a6 as _sfc_main$2j, M as _sfc_main$20, a7 as _sfc_main$15, a8 as _sfc_main$2e, k as _sfc_main$14, a9 as TooltipContent, aa as _sfc_main$1s, ab as formatBillingPeriod, O as formatAmount, ac as _sfc_main$2K, ad as useTimePeriod, e as _sfc_main$3$1, ae as _sfc_main$1T, af as _sfc_main$a$1, ag as _sfc_main$9$1, n as _sfc_main$4$1, ah as isValidCountryCode, S as _sfc_main$2q, ai as _sfc_main$1Y, aj as usePricingItem, ak as _sfc_main$1X, al as _sfc_main$1L, D as _sfc_main$16, p as _sfc_main$t, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
3
|
-
import { c as createSubscriptionsService } from "../../subscriptions-
|
|
2
|
+
import { a3 as I18N_INJECTION_KEY, a4 as convertDateRangeToTimePeriod, G as useValidation, H as objectDiff, b as useIntl, a5 as getCountryNameByCode, d as _sfc_main$1g, _ as _sfc_main$2$1, K as _sfc_main$2a, L as _sfc_main$1$, m as _sfc_main$2H, a6 as _sfc_main$2j, M as _sfc_main$20, a7 as _sfc_main$15, a8 as _sfc_main$2e, k as _sfc_main$14, a9 as TooltipContent, aa as _sfc_main$1s, ab as formatBillingPeriod, O as formatAmount, ac as _sfc_main$2K, ad as useTimePeriod, e as _sfc_main$3$1, ae as _sfc_main$1T, af as _sfc_main$a$1, ag as _sfc_main$9$1, n as _sfc_main$4$1, ah as isValidCountryCode, S as _sfc_main$2q, ai as _sfc_main$1Y, aj as usePricingItem, ak as _sfc_main$1X, al as _sfc_main$1L, D as _sfc_main$16, p as _sfc_main$t, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
3
|
+
import { c as createSubscriptionsService } from "../../subscriptions-BepBTXR5.mjs";
|
|
4
4
|
import { S as Symbol$1, m as isArrayLike, d as isArray, i as isBuffer, c as isTypedArray, p as isArguments, a as getTag, k as isPrototype, q as baseKeys, A as ApiStatus } from "../../_Uint8Array-DHE03FZr.mjs";
|
|
5
|
-
import { l as lodashExports, a as _sfc_main$o, u as useLogger, g as getAdyenExpressCheckoutConfiguration, t as transformObjectToAdyenObject, c as createReturnUrl, _ as _sfc_main$s } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { c as createInvoicesService } from "../../invoices-
|
|
5
|
+
import { l as lodashExports, a as _sfc_main$o, u as useLogger, g as getAdyenExpressCheckoutConfiguration, t as transformObjectToAdyenObject, c as createReturnUrl, _ as _sfc_main$s } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DFCX2tcj.mjs";
|
|
6
|
+
import { c as createInvoicesService } from "../../invoices-CoEBP5UT.mjs";
|
|
7
7
|
import { a as requiredIf, r as required, e as email } from "../../index-CzL1ZcGi.mjs";
|
|
8
8
|
import { w as watchDebounced, f as watchOnce } from "../../index-BFZ0dPh9.mjs";
|
|
9
9
|
import { c as cloneDeep } from "../../cloneDeep-sm9cY-u2.mjs";
|
|
10
|
-
import { c as createPaymentMethodsService } from "../../paymentMethods-
|
|
10
|
+
import { c as createPaymentMethodsService } from "../../paymentMethods-C2gWIbEr.mjs";
|
|
11
11
|
import { u as useService } from "../../useService-B4qv5N2D.mjs";
|
|
12
|
-
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
13
|
-
import { _ as _sfc_main$p, a as _sfc_main$r } from "../../PricingGroupContent.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-CKbnuXMU.mjs";
|
|
13
|
+
import { _ as _sfc_main$p, a as _sfc_main$r } from "../../PricingGroupContent.vue_vue_type_script_setup_true_lang-DAwMy1l8.mjs";
|
|
14
14
|
import { a as useBreakpoints, b as breakpointsTailwind } from "../../index-D3v7hAtc.mjs";
|
|
15
15
|
import { _ as _sfc_main$q } from "../../Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs";
|
|
16
|
-
import { c as createPaymentsService } from "../../payments-
|
|
16
|
+
import { c as createPaymentsService } from "../../payments-DLjkq_hN.mjs";
|
|
17
17
|
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0;
|
|
18
18
|
symbolProto ? symbolProto.toString : void 0;
|
|
19
19
|
function baseToString(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../ContentWithAsideLayout-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../ContentWithAsideLayout-BjJufFeN.js"),r=require("../../useInvoicesList-CBqZG_rw.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-D49i1DHa.js"),s=require("../../useCustomer-CEFUPIDZ.js"),a=require("../../usePaymentMethods-BdZkt6re.js"),i=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BouYyZhD.js"),l=require("../../useLoadInitialData-BRg7IWqW.js"),u=require("../../useCustomerPaymentMethodOptions-BgCFkLeQ.js"),m=require("../../useWalletBalanceItems-CzV3PcJH.js"),c=require("../../component-BeqkeC9h.js"),p=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(c){var p;const d=null==(p=o.usePortal().value)?void 0:p.customer_id,v=s.useCustomer({customerId:d}),y=r.useInvoicesList({customerId:d,batchSize:5}),f=n.useSubscriptionsList({customerId:d,batchSize:2}),g=a.usePaymentMethods({customerId:d}),h=u.useCustomerPaymentMethodOptions({customerId:d}),_=m.useCustomerWalletBalances({customerId:d}),C=m.useWalletBalanceItems(_.walletBalances),{isLoading:b}=l.useLoadInitialData(v.get.execute(),y.fetchInitial(),f.fetchInitial(),g.fetchAll(),h.fetch(),_.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.unref(v).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,customer:e.unref(v).customer.value,subscriptions:e.unref(f).items.value,"payment-methods":e.unref(g).items.value,"is-loading":e.unref(b),"has-more-items":e.unref(f).hasNextBatch.value,onLoadMore:e.unref(f).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","has-more-items","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{invoices:e.unref(y).items.value,"has-more-items":e.unref(y).hasNextBatch.value,"is-loading":e.unref(b),onLoadMore:e.unref(y).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(m._sfc_main,{"has-error":e.unref(_).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(b),"wallet-balances":e.unref(C)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(u._sfc_main,{"is-loading":e.unref(b),"payment-methods":e.unref(g).items.value,"payment-methods-options":e.unref(h).items.value},null,8,["is-loading","payment-methods","payment-methods-options"]),e.unref(v).customer.value?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,"is-loading":e.unref(b),customer:e.unref(v).customer.value,"payment-methods":e.unref(g).items.value},null,8,["is-loading","customer","payment-methods"])):e.createCommentVNode("",!0)]),_:1}))}}),d=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,r)=>{var n,s,a,i;return e.openBlock(),e.createBlock(c._sfc_main$1,{"custom-element-name":e.unref(y),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(n=t.branding)?void 0:n.colors)?void 0:s.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(p)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=c.defineCustomElement(d),y=c.getComponentName("customer-overview");exports.COMPONENT_NAME=y,exports.SolvimonCustomerOverview=v,exports.defineSolvimonCustomerOverview=()=>{customElements.get(y)||customElements.define(y,v)};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { A as ApiStatus } from "../../_Uint8Array-DHE03FZr.mjs";
|
|
3
|
-
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
4
|
-
import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-
|
|
5
|
-
import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
7
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
8
|
-
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-CKbnuXMU.mjs";
|
|
4
|
+
import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-B5vYDRyl.mjs";
|
|
5
|
+
import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-Cj4cnM8z.mjs";
|
|
6
|
+
import { u as useCustomer } from "../../useCustomer-C0RKKfGJ.mjs";
|
|
7
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-4Io2ZHlo.mjs";
|
|
8
|
+
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CvUwy_tp.mjs";
|
|
9
9
|
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
10
|
-
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$3 } from "../../useCustomerPaymentMethodOptions-
|
|
11
|
-
import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-
|
|
12
|
-
import { p as _sfc_main$7, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
10
|
+
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$3 } from "../../useCustomerPaymentMethodOptions-BlFH4zxG.mjs";
|
|
11
|
+
import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-B0NZuM3W.mjs";
|
|
12
|
+
import { p as _sfc_main$7, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
13
13
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
14
14
|
__name: "CustomerOverview",
|
|
15
15
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B5y7wYnP.js"),n=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-DCfpg7nK.js"),a=require("../../paymentMethods-CwzFgccc.js"),i=require("../../ContentWithAsideLayout-BQpDxDXI.js"),r=require("../../useActionDispatchProvider-C-uVJcgJ.js"),o={id:"ppsu_hwDeeN0vhvcVCsAIdp1G",pricing_plan_schedule_infos:[{id:"ppsc_IwDeeN0vhvcVCIAQdq1a",pricing_plan_version_id:"ppve_MwDeeN0vhvcEuaADdd1f",start_at:"2026-04-05T22:00:00Z",pricing_plan_version:{pricing_categories:[{product_category:{id:"proc_iwDeeN0vhphn6VAtBD1w",name:"Add ons"},display_order:1,pricings:[{id:"pric_ywDeeN0vhvcPguAadr1V",name:"Integration setup",products:[{name:"Integration setup"}],items:[{id:"prii_NwDeeN0vhvcPguAxds12",product_items:[{name:"Rillet integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{fixed_amount:{quantity:"5000.00",currency:"EUR"}}]}]},{id:"prii_IwDeeN0vhvcPgvAsdS1Q",product_items:[{name:"Attio integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{amount:{quantity:"50000.00",currency:"EUR"}}]}]}]}],pricing_groups:[]}]}}]},l=e=>{var t,n;return((null==(t=e.configs)?void 0:t.some(e=>e.on_demand))??!1)&&((null==(n=e.product_items)?void 0:n.some(e=>"ONE_OFF"===e.model_type))??!1)},c=e=>{var t,n;return{id:e.id,name:null==(n=null==(t=e.product_items)?void 0:t[0])?void 0:n.name,items:[{id:e.id,configs:(e.configs??[]).map(e=>({bands:(e.bands??[]).map(e=>({fixed_amount:e.fixed_amount??e.amount}))}))}]}},s=e=>(e.items??[]).filter(l).map(c),d=e=>({display_order:e.display_order,product_category:e.product_category,pricings:(e.pricings??[]).flatMap(s),pricing_groups:(e.pricing_groups??[]).map(e=>({id:e.id,name:e.name,pricings:(e.pricings??[]).flatMap(s)})).filter(e=>e.pricings.length>0)}),u=Object.fromEntries(o.pricing_plan_schedule_infos.flatMap(e=>e.pricing_plan_version.pricing_categories).flatMap(e=>e.pricings).flatMap(e=>e.items).filter(l).map(e=>{var t,n,a,i,r;const o=null==(a=null==(n=null==(t=e.configs)?void 0:t[0])?void 0:n.bands)?void 0:a[0],l=(null==(i=null==o?void 0:o.fixed_amount)?void 0:i.quantity)??(null==(r=null==o?void 0:o.amount)?void 0:r.quantity)??"0";return[e.id,parseFloat(l)]})),p=e=>({quantity:e.toFixed(2),currency:"EUR"}),m={id:"paya_NwDeeN0vgXgeP1AyNx14",object_type:"PAYMENT_ACCEPTOR",status:"ACTIVE",reference:"mock-payment-acceptor",name:"Mock payment acceptor",type:"PAYMENT_GATEWAY"},g={id:"intg_zwDeeN0vgXgeM6APNW1g",object_type:"INTEGRATION",reference:"mock-payment-integration",name:"Mock payment integration",description:"Mock payment integration",status:"ACTIVE",type:"PAYMENT_GATEWAY"},_={class:"mb-3 flex flex-col gap-2"},f={class:"flex flex-col gap-1 border-t pt-3"},y={class:"flex items-center justify-between"},v={class:"flex items-center justify-between"},h={class:"flex items-center justify-between border-t pt-3"},b=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},isPending:{type:Boolean}},setup(n){const a=n,{$t:i}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,n,a,i,r,o;return null==(o=null==(r=null==(i=null==(a=null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.configs)?void 0:a[0])?void 0:i.bands)?void 0:r[0])?void 0:o.fixed_amount};return(a,l)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>{var a;return[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2",class:"mb-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"})),1)]),_:1}),r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Select add-ons to see pricing.",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no add-ons are selected in the order summary"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.selectedPricings,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"flex items-center justify-between"},[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>{var t,a;return[e.createTextVNode(e.toDisplayString(n.name??(null==(a=null==(t=n.products)?void 0:t[0])?void 0:a.name)),1)]}),_:2},1024),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({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})]),o(n)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(o(n))),1)]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),(null==(a=n.invoice)?void 0:a.tax_summary)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total excluding taxes",id:"upgrade_subscription.order_summary.subtotal_label",description:"Subtotal before tax label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.base_amount)),1)]),_:1})]),e.createElementVNode("div",v,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Taxes",id:"upgrade_subscription.order_summary.taxes_label",description:"Tax amount label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.tax_amount)),1)]),_:1})])]),e.createElementVNode("div",h,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total due today",id:"upgrade_subscription.order_summary.total_label",description:"Total amount due today label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.total_amount)),1)]),_:1})])],64)):e.createCommentVNode("",!0)],64))]}),_:1}))}}),k=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean}},emits:["toggle"],setup(a,{emit:i}){const r=a,o=i,{$t:l}=t.useIntl(),c=e.computed(()=>{var e,t;return r.pricing.name??(null==(t=null==(e=r.pricing.products)?void 0:e[0])?void 0:t.name)??"—"}),s=e.computed(()=>{var e,t,n,a,i,o;return null==(o=null==(i=null==(a=null==(n=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:n[0])?void 0:a.bands)?void 0:i[0])?void 0:o.fixed_amount}),d=e.computed(()=>s.value?`${t.formatAmount(s.value)} ${l({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(i,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"content-background":a.selected?"none":"gray",class:e.normalizeClass({"!bg-white":a.selected})},{default:e.withCtx(()=>[e.createVNode(n._sfc_main,{name:c.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,color:"primary",size:"sm","icon-prefix":"add",onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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}))]),_:1},8,["name","description"])]),_:1},8,["content-background","class"]))}}),x={class:"grid grid-cols-1 gap-1"},N=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array}},emits:["toggle"],setup(n,{emit:a}){const i=n,r=a,o=e.computed(()=>[...i.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0)));return(a,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((null==(t=a.product_category)?void 0:t.name)??a.name),1)]}),_:2},1024),e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(k,{key:t.id,pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[0]||(i[0]=e=>r("toggle",e))},null,8,["pricing","selected"]))),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$2),{variant:"body-sm",weight:"semibold",class:"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(k,{key:t.id,pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[1]||(i[1]=e=>r("toggle",e))},null,8,["pricing","selected"]))),128))],64))),128))])]))),128))}}),w={class:"flex flex-col gap-4"},B={key:0,class:"flex flex-col gap-2"},V={class:"flex flex-col gap-1"},C={key:1,class:"flex flex-col gap-2"},E={class:"flex flex-col gap-1"},T={class:"flex items-center gap-3"},S={key:0,class:"flex h-9 w-9 shrink-0 items-center gap-0.5"},A=["src","alt"],I={key:1,class:"flex h-9 w-9 shrink-0 items-center justify-center overflow-clip rounded"},D=["src","alt"],M={key:2,class:"flex flex-col gap-1"},P=e.defineComponent({__name:"PaymentMethodPicker",props:{customerId:{type:String},subscriptionId:{type:String},selectedId:{type:String}},emits:["select"],setup(n,{emit:i}){const r=n,o=i,{$t:l}=t.useIntl(),{getPaymentMethods:c}=a.createPaymentMethodsService(),s=e.ref([]),d=e.ref([]),u=e.ref(!1),p=e.computed(()=>d.value.flatMap(e=>e.options??[])),_=e=>`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/small/${e}.svg`,f=["visa","mc","amex","maestro"],y=e=>{if(!e)return[];return[...f.filter(t=>e.includes(t)),...e.filter(e=>!f.includes(e))].slice(0,4)};return e.onMounted(async()=>{u.value=!0;try{const e=await c({customerId:r.customerId,pagination:{page:1,pageSize:50}});s.value=e.data,d.value=[{payment_acceptor:m,integration:g,options:[{name:"iDeal",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"iDEAL | Wero",type:"ideal"}},{name:"Cards",payment_method_variant:"CARD",payment_gateway_variant:"ADYEN",adyen:{name:"Cards",type:"scheme",brands:["maestro","accel","amex","cup","diners","hipercard","jcb","mc","nyce","pulse","star","visa"]}},{name:"PayPal",payment_method_variant:"DIGITAL_WALLET",payment_gateway_variant:"ADYEN",adyen:{name:"PayPal",type:"paypal",configuration:{intent:"capture"}}},{name:"Trustly",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"Trustly - Instant Bank Payment",type:"trustly"}}]}]}finally{u.value=!1}}),(a,i)=>(e.openBlock(),e.createElementBlock("div",w,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Saved payment methods",id:"upgrade_subscription.payment_picker.saved_title",description:"Heading for the saved payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.id,"content-background":n.selectedId===a.id?"none":"gray",class:e.normalizeClass([{"!bg-white":n.selectedId===a.id},"cursor-pointer"]),onClick:e=>o("select",a.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main),{"payment-method":a},null,8,["payment-method"])]),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),p.value.length>0?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"All payment methods",id:"upgrade_subscription.payment_picker.all_title",description:"Heading for the all payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.adyen.type,"content-background":n.selectedId===a.adyen.type?"none":"gray",class:e.normalizeClass([{"!bg-white":n.selectedId===a.adyen.type},"cursor-pointer"]),onClick:e=>o("select",a.adyen.type)},{default:e.withCtx(()=>{return[e.createElementVNode("div",T,["scheme"===a.adyen.type?(e.openBlock(),e.createElementBlock("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y(a.adyen.brands),t=>(e.openBlock(),e.createElementBlock("img",{key:t,src:_(t),alt:t,class:"h-5 w-auto rounded"},null,8,A))),128))])):(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("img",{src:(n=a.adyen.type,`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/${n}.svg`),alt:a.name,class:"h-9 w-9 object-contain"},null,8,D)])),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024)])];var n}),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",M,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):e.createCommentVNode("",!0)]))}});const $={key:0,class:"flex h-full items-center justify-center p-8"},O={class:"flex flex-col items-center py-10"},j=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(a){const l=a,{$t:c}=t.useIntl(),{dispatchAction:s}=r.useActionDispatchProvider(),{chargeOnDemandPricingItems:m}=function(){const e=t.createRequestService(),n=t.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:t,pricingPlanVersionId:a,pricingItemIds:i,startAt:r,finalizeImmediately:o=!0,paymentMethodId:l}){return e({url:`${n.apiUrls.config}/portal/pricing-plan-schedules/${t}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:i,...r?{start_at:r}:{},finalize_immediately:o,...l?{payment_method_id:l}:{}}})}}}(),g=i.usePortal(),_=e.computed(()=>g.value.customer_id),f=e.ref([]),y=e.ref(void 0),v=e.ref(!1),h=e.ref(!1),k=e.ref(void 0),x=e.ref(!1),w=e.computed(()=>(e=>{var t;const n=Date.now(),a=o.pricing_plan_schedule_infos,i=a.find(e=>{const t=Date.parse(e.start_at);return Number.isFinite(t)&&t<=n})??a[0],r=((null==(t=null==i?void 0:i.pricing_plan_version)?void 0:t.pricing_categories)??[]).map(d).filter(e=>{var t,n;return((null==(t=e.pricings)?void 0:t.length)??0)>0||((null==(n=e.pricing_groups)?void 0:n.length)??0)>0});return{pricing_plan_subscription_id:e||o.id,pricing_plan_schedule_id:(null==i?void 0:i.id)??"",pricing_plan_version_id:(null==i?void 0:i.pricing_plan_version_id)??"",billing_period:{type:"MONTH",value:1},billing_currency:"EUR",pricing_categories:r}})(l.configuration.subscriptionId)),B=e.computed(()=>w.value.pricing_categories),V=e.computed(()=>B.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),C=e.computed(()=>V.value.filter(e=>f.value.includes(e.id)));let E;e.watch(f,e=>{if(clearTimeout(E),0===e.length)return k.value=void 0,void(x.value=!1);x.value=!0,E=setTimeout(()=>{k.value=(e=>{const t=e.reduce((e,t)=>e+(u[t]??0),0),n=Math.round(.21*t*100)/100,a=t+n;return{invoice:{tax_summary:{base_amount:p(t),tax_amount:p(n),total_amount:p(a),country_code:"NL"}},first_invoice:{},invoice_infos:[]}})(e).invoice,x.value=!1},400)});const T=e=>{f.value.includes(e)?f.value=f.value.filter(t=>t!==e):f.value=[...f.value,e]},S=e.computed(()=>f.value.length>0&&!!y.value),A=e.ref(void 0),I=async()=>{if(S.value){v.value=!0,A.value=void 0;try{const e=C.value.map(e=>{var t,n;return null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.id}).filter(e=>!!e),t=y.value&&y.value.startsWith("pmet_")?y.value:void 0,n=await m({scheduleId:w.value.pricing_plan_schedule_id,pricingPlanVersionId:w.value.pricing_plan_version_id,pricingItemIds:e,finalizeImmediately:!0,paymentMethodId:t});t?h.value=!0:s({action:"pay-invoice",data:{invoiceId:n.id}})}catch{A.value=c({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"})}finally{v.value=!1}}};return(r,o)=>h.value?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(e.unref(t._sfc_main$4),{icon:"check_circle",class:"text-green-400",size:"lg"}),e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"span",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful add-on purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter",tag:"span",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Your add-ons have been activated.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful add-on purchase"})),1)]),_:1})])]),_:1})])):(e.openBlock(),e.createBlock(e.unref(i.ContentWithAsideLayout),{key:1},{content:e.withCtx(()=>[B.value.length>0?(e.openBlock(),e.createBlock(N,{key:0,categories:B.value,"selected-pricing-ids":f.value,onToggle:T},null,8,["categories","selected-pricing-ids"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-sm",shade:"lighter",class:"p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"No on-demand add-ons are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no on-demand add-ons available for the subscription"})),1)]),_:1})),e.createVNode(e.unref(t._sfc_main$2p),{spacing:"sm"}),e.createVNode(P,{"customer-id":_.value,"subscription-id":a.configuration.subscriptionId,"selected-id":y.value,onSelect:o[0]||(o[0]=e=>y.value=e)},null,8,["customer-id","subscription-id","selected-id"])]),aside:e.withCtx(()=>[e.createVNode(b,{"selected-pricings":C.value,invoice:k.value,"is-pending":x.value},null,8,["selected-pricings","invoice","is-pending"]),A.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:0,title:A.value},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2H),{size:"lg",class:"full-width",type:"button",disabled:!S.value||v.value,loading:v.value,onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(t._sfc_main$2),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(n._sfc_main$1,{icon:"lock",kpi:e.unref(c)({defaultMessage:"Secure and encrypted payments",id:"upgrade_subscription.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown on the upgrade subscription page"})},null,8,["kpi"])]),_:1})]),_:1}))}}),L=e.defineComponent({__name:"UpgradeSubscription.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:n=>(a,i)=>{var r,o,l,c;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(q),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=n.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(c=null==(l=n.branding)?void 0:l.colors)?void 0:c.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:i[0]||(i[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(j,{configuration:n.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),F=t.defineCustomElement(L),q=t.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=q,exports.SolvimonUpgradeSubscription=F,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(q)||customElements.define(q,F)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-BeqkeC9h.js"),n=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-BOZurit_.js"),a=require("../../paymentMethods-D_rYLg3F.js"),i=require("../../ContentWithAsideLayout-BjJufFeN.js"),r=require("../../useActionDispatchProvider-D4OtXsNA.js"),o={id:"ppsu_hwDeeN0vhvcVCsAIdp1G",pricing_plan_schedule_infos:[{id:"ppsc_IwDeeN0vhvcVCIAQdq1a",pricing_plan_version_id:"ppve_MwDeeN0vhvcEuaADdd1f",start_at:"2026-04-05T22:00:00Z",pricing_plan_version:{pricing_categories:[{product_category:{id:"proc_iwDeeN0vhphn6VAtBD1w",name:"Add ons"},display_order:1,pricings:[{id:"pric_ywDeeN0vhvcPguAadr1V",name:"Integration setup",products:[{name:"Integration setup"}],items:[{id:"prii_NwDeeN0vhvcPguAxds12",product_items:[{name:"Rillet integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{fixed_amount:{quantity:"5000.00",currency:"EUR"}}]}]},{id:"prii_IwDeeN0vhvcPgvAsdS1Q",product_items:[{name:"Attio integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{amount:{quantity:"50000.00",currency:"EUR"}}]}]}]}],pricing_groups:[]}]}}]},l=e=>{var t,n;return((null==(t=e.configs)?void 0:t.some(e=>e.on_demand))??!1)&&((null==(n=e.product_items)?void 0:n.some(e=>"ONE_OFF"===e.model_type))??!1)},c=e=>{var t,n;return{id:e.id,name:null==(n=null==(t=e.product_items)?void 0:t[0])?void 0:n.name,items:[{id:e.id,configs:(e.configs??[]).map(e=>({bands:(e.bands??[]).map(e=>({fixed_amount:e.fixed_amount??e.amount}))}))}]}},s=e=>(e.items??[]).filter(l).map(c),d=e=>({display_order:e.display_order,product_category:e.product_category,pricings:(e.pricings??[]).flatMap(s),pricing_groups:(e.pricing_groups??[]).map(e=>({id:e.id,name:e.name,pricings:(e.pricings??[]).flatMap(s)})).filter(e=>e.pricings.length>0)}),u=Object.fromEntries(o.pricing_plan_schedule_infos.flatMap(e=>e.pricing_plan_version.pricing_categories).flatMap(e=>e.pricings).flatMap(e=>e.items).filter(l).map(e=>{var t,n,a,i,r;const o=null==(a=null==(n=null==(t=e.configs)?void 0:t[0])?void 0:n.bands)?void 0:a[0],l=(null==(i=null==o?void 0:o.fixed_amount)?void 0:i.quantity)??(null==(r=null==o?void 0:o.amount)?void 0:r.quantity)??"0";return[e.id,parseFloat(l)]})),p=e=>({quantity:e.toFixed(2),currency:"EUR"}),m={id:"paya_NwDeeN0vgXgeP1AyNx14",object_type:"PAYMENT_ACCEPTOR",status:"ACTIVE",reference:"mock-payment-acceptor",name:"Mock payment acceptor",type:"PAYMENT_GATEWAY"},g={id:"intg_zwDeeN0vgXgeM6APNW1g",object_type:"INTEGRATION",reference:"mock-payment-integration",name:"Mock payment integration",description:"Mock payment integration",status:"ACTIVE",type:"PAYMENT_GATEWAY"},_={class:"mb-3 flex flex-col gap-2"},f={class:"flex flex-col gap-1 border-t pt-3"},y={class:"flex items-center justify-between"},v={class:"flex items-center justify-between"},h={class:"flex items-center justify-between border-t pt-3"},b=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},isPending:{type:Boolean}},setup(n){const a=n,{$t:i}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,n,a,i,r,o;return null==(o=null==(r=null==(i=null==(a=null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.configs)?void 0:a[0])?void 0:i.bands)?void 0:r[0])?void 0:o.fixed_amount};return(a,l)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>{var a;return[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2",class:"mb-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"})),1)]),_:1}),r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Select add-ons to see pricing.",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no add-ons are selected in the order summary"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.selectedPricings,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"flex items-center justify-between"},[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>{var t,a;return[e.createTextVNode(e.toDisplayString(n.name??(null==(a=null==(t=n.products)?void 0:t[0])?void 0:a.name)),1)]}),_:2},1024),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({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})]),o(n)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(o(n))),1)]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),(null==(a=n.invoice)?void 0:a.tax_summary)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total excluding taxes",id:"upgrade_subscription.order_summary.subtotal_label",description:"Subtotal before tax label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.base_amount)),1)]),_:1})]),e.createElementVNode("div",v,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Taxes",id:"upgrade_subscription.order_summary.taxes_label",description:"Tax amount label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.tax_amount)),1)]),_:1})])]),e.createElementVNode("div",h,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total due today",id:"upgrade_subscription.order_summary.total_label",description:"Total amount due today label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.total_amount)),1)]),_:1})])],64)):e.createCommentVNode("",!0)],64))]}),_:1}))}}),k=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean}},emits:["toggle"],setup(a,{emit:i}){const r=a,o=i,{$t:l}=t.useIntl(),c=e.computed(()=>{var e,t;return r.pricing.name??(null==(t=null==(e=r.pricing.products)?void 0:e[0])?void 0:t.name)??"—"}),s=e.computed(()=>{var e,t,n,a,i,o;return null==(o=null==(i=null==(a=null==(n=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:n[0])?void 0:a.bands)?void 0:i[0])?void 0:o.fixed_amount}),d=e.computed(()=>s.value?`${t.formatAmount(s.value)} ${l({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(i,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"content-background":a.selected?"none":"gray",class:e.normalizeClass({"!bg-white":a.selected})},{default:e.withCtx(()=>[e.createVNode(n._sfc_main,{name:c.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,color:"primary",size:"sm","icon-prefix":"add",onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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}))]),_:1},8,["name","description"])]),_:1},8,["content-background","class"]))}}),x={class:"grid grid-cols-1 gap-1"},N=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array}},emits:["toggle"],setup(n,{emit:a}){const i=n,r=a,o=e.computed(()=>[...i.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0)));return(a,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((null==(t=a.product_category)?void 0:t.name)??a.name),1)]}),_:2},1024),e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(k,{key:t.id,pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[0]||(i[0]=e=>r("toggle",e))},null,8,["pricing","selected"]))),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$2),{variant:"body-sm",weight:"semibold",class:"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(k,{key:t.id,pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[1]||(i[1]=e=>r("toggle",e))},null,8,["pricing","selected"]))),128))],64))),128))])]))),128))}}),w={class:"flex flex-col gap-4"},B={key:0,class:"flex flex-col gap-2"},V={class:"flex flex-col gap-1"},C={key:1,class:"flex flex-col gap-2"},E={class:"flex flex-col gap-1"},T={class:"flex items-center gap-3"},S={key:0,class:"flex h-9 w-9 shrink-0 items-center gap-0.5"},A=["src","alt"],I={key:1,class:"flex h-9 w-9 shrink-0 items-center justify-center overflow-clip rounded"},D=["src","alt"],M={key:2,class:"flex flex-col gap-1"},P=e.defineComponent({__name:"PaymentMethodPicker",props:{customerId:{type:String},subscriptionId:{type:String},selectedId:{type:String}},emits:["select"],setup(n,{emit:i}){const r=n,o=i,{$t:l}=t.useIntl(),{getPaymentMethods:c}=a.createPaymentMethodsService(),s=e.ref([]),d=e.ref([]),u=e.ref(!1),p=e.computed(()=>d.value.flatMap(e=>e.options??[])),_=e=>`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/small/${e}.svg`,f=["visa","mc","amex","maestro"],y=e=>{if(!e)return[];return[...f.filter(t=>e.includes(t)),...e.filter(e=>!f.includes(e))].slice(0,4)};return e.onMounted(async()=>{u.value=!0;try{const e=await c({customerId:r.customerId,pagination:{page:1,pageSize:50}});s.value=e.data,d.value=[{payment_acceptor:m,integration:g,options:[{name:"iDeal",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"iDEAL | Wero",type:"ideal"}},{name:"Cards",payment_method_variant:"CARD",payment_gateway_variant:"ADYEN",adyen:{name:"Cards",type:"scheme",brands:["maestro","accel","amex","cup","diners","hipercard","jcb","mc","nyce","pulse","star","visa"]}},{name:"PayPal",payment_method_variant:"DIGITAL_WALLET",payment_gateway_variant:"ADYEN",adyen:{name:"PayPal",type:"paypal",configuration:{intent:"capture"}}},{name:"Trustly",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"Trustly - Instant Bank Payment",type:"trustly"}}]}]}finally{u.value=!1}}),(a,i)=>(e.openBlock(),e.createElementBlock("div",w,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Saved payment methods",id:"upgrade_subscription.payment_picker.saved_title",description:"Heading for the saved payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.id,"content-background":n.selectedId===a.id?"none":"gray",class:e.normalizeClass([{"!bg-white":n.selectedId===a.id},"cursor-pointer"]),onClick:e=>o("select",a.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main),{"payment-method":a},null,8,["payment-method"])]),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),p.value.length>0?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"All payment methods",id:"upgrade_subscription.payment_picker.all_title",description:"Heading for the all payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.adyen.type,"content-background":n.selectedId===a.adyen.type?"none":"gray",class:e.normalizeClass([{"!bg-white":n.selectedId===a.adyen.type},"cursor-pointer"]),onClick:e=>o("select",a.adyen.type)},{default:e.withCtx(()=>{return[e.createElementVNode("div",T,["scheme"===a.adyen.type?(e.openBlock(),e.createElementBlock("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y(a.adyen.brands),t=>(e.openBlock(),e.createElementBlock("img",{key:t,src:_(t),alt:t,class:"h-5 w-auto rounded"},null,8,A))),128))])):(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("img",{src:(n=a.adyen.type,`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/${n}.svg`),alt:a.name,class:"h-9 w-9 object-contain"},null,8,D)])),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024)])];var n}),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",M,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):e.createCommentVNode("",!0)]))}});const $={key:0,class:"flex h-full items-center justify-center p-8"},O={class:"flex flex-col items-center py-10"},j=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(a){const l=a,{$t:c}=t.useIntl(),{dispatchAction:s}=r.useActionDispatchProvider(),{chargeOnDemandPricingItems:m}=function(){const e=t.createRequestService(),n=t.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:t,pricingPlanVersionId:a,pricingItemIds:i,startAt:r,finalizeImmediately:o=!0,paymentMethodId:l}){return e({url:`${n.apiUrls.config}/portal/pricing-plan-schedules/${t}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:i,...r?{start_at:r}:{},finalize_immediately:o,...l?{payment_method_id:l}:{}}})}}}(),g=i.usePortal(),_=e.computed(()=>g.value.customer_id),f=e.ref([]),y=e.ref(void 0),v=e.ref(!1),h=e.ref(!1),k=e.ref(void 0),x=e.ref(!1),w=e.computed(()=>(e=>{var t;const n=Date.now(),a=o.pricing_plan_schedule_infos,i=a.find(e=>{const t=Date.parse(e.start_at);return Number.isFinite(t)&&t<=n})??a[0],r=((null==(t=null==i?void 0:i.pricing_plan_version)?void 0:t.pricing_categories)??[]).map(d).filter(e=>{var t,n;return((null==(t=e.pricings)?void 0:t.length)??0)>0||((null==(n=e.pricing_groups)?void 0:n.length)??0)>0});return{pricing_plan_subscription_id:e||o.id,pricing_plan_schedule_id:(null==i?void 0:i.id)??"",pricing_plan_version_id:(null==i?void 0:i.pricing_plan_version_id)??"",billing_period:{type:"MONTH",value:1},billing_currency:"EUR",pricing_categories:r}})(l.configuration.subscriptionId)),B=e.computed(()=>w.value.pricing_categories),V=e.computed(()=>B.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),C=e.computed(()=>V.value.filter(e=>f.value.includes(e.id)));let E;e.watch(f,e=>{if(clearTimeout(E),0===e.length)return k.value=void 0,void(x.value=!1);x.value=!0,E=setTimeout(()=>{k.value=(e=>{const t=e.reduce((e,t)=>e+(u[t]??0),0),n=Math.round(.21*t*100)/100,a=t+n;return{invoice:{tax_summary:{base_amount:p(t),tax_amount:p(n),total_amount:p(a),country_code:"NL"}},first_invoice:{},invoice_infos:[]}})(e).invoice,x.value=!1},400)});const T=e=>{f.value.includes(e)?f.value=f.value.filter(t=>t!==e):f.value=[...f.value,e]},S=e.computed(()=>f.value.length>0&&!!y.value),A=e.ref(void 0),I=async()=>{if(S.value){v.value=!0,A.value=void 0;try{const e=C.value.map(e=>{var t,n;return null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.id}).filter(e=>!!e),t=y.value&&y.value.startsWith("pmet_")?y.value:void 0,n=await m({scheduleId:w.value.pricing_plan_schedule_id,pricingPlanVersionId:w.value.pricing_plan_version_id,pricingItemIds:e,finalizeImmediately:!0,paymentMethodId:t});t?h.value=!0:s({action:"pay-invoice",data:{invoiceId:n.id}})}catch{A.value=c({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"})}finally{v.value=!1}}};return(r,o)=>h.value?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(e.unref(t._sfc_main$4),{icon:"check_circle",class:"text-green-400",size:"lg"}),e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"span",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful add-on purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter",tag:"span",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Your add-ons have been activated.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful add-on purchase"})),1)]),_:1})])]),_:1})])):(e.openBlock(),e.createBlock(e.unref(i.ContentWithAsideLayout),{key:1},{content:e.withCtx(()=>[B.value.length>0?(e.openBlock(),e.createBlock(N,{key:0,categories:B.value,"selected-pricing-ids":f.value,onToggle:T},null,8,["categories","selected-pricing-ids"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-sm",shade:"lighter",class:"p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"No on-demand add-ons are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no on-demand add-ons available for the subscription"})),1)]),_:1})),e.createVNode(e.unref(t._sfc_main$2p),{spacing:"sm"}),e.createVNode(P,{"customer-id":_.value,"subscription-id":a.configuration.subscriptionId,"selected-id":y.value,onSelect:o[0]||(o[0]=e=>y.value=e)},null,8,["customer-id","subscription-id","selected-id"])]),aside:e.withCtx(()=>[e.createVNode(b,{"selected-pricings":C.value,invoice:k.value,"is-pending":x.value},null,8,["selected-pricings","invoice","is-pending"]),A.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:0,title:A.value},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2H),{size:"lg",class:"full-width",type:"button",disabled:!S.value||v.value,loading:v.value,onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(t._sfc_main$2),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(n._sfc_main$1,{icon:"lock",kpi:e.unref(c)({defaultMessage:"Secure and encrypted payments",id:"upgrade_subscription.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown on the upgrade subscription page"})},null,8,["kpi"])]),_:1})]),_:1}))}}),L=e.defineComponent({__name:"UpgradeSubscription.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:n=>(a,i)=>{var r,o,l,c;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(q),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=n.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(c=null==(l=n.branding)?void 0:l.colors)?void 0:c.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:i[0]||(i[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(j,{configuration:n.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),F=t.defineCustomElement(L),q=t.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=q,exports.SolvimonUpgradeSubscription=F,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(q)||customElements.define(q,F)};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createVNode, createTextVNode, toDisplayString, createElementBlock, Fragment, createElementVNode, renderList, createCommentVNode, normalizeClass, ref, onMounted, watch } from "vue";
|
|
2
|
-
import { b as useIntl, d as _sfc_main$1g, _ as _sfc_main$2$1, O as formatAmount, m as _sfc_main$2H, g as _sfc_main$7, c as createRequestService, u as useConfig, n as _sfc_main$4$1, D as _sfc_main$16, Q as _sfc_main$2p, p as _sfc_main$9, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
3
|
-
import { _ as _sfc_main$6, a as _sfc_main$8 } from "../../PricingGroupContent.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { c as createPaymentMethodsService } from "../../paymentMethods-
|
|
5
|
-
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
6
|
-
import { u as useActionDispatchProvider } from "../../useActionDispatchProvider-
|
|
2
|
+
import { b as useIntl, d as _sfc_main$1g, _ as _sfc_main$2$1, O as formatAmount, m as _sfc_main$2H, g as _sfc_main$7, c as createRequestService, u as useConfig, n as _sfc_main$4$1, D as _sfc_main$16, Q as _sfc_main$2p, p as _sfc_main$9, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
3
|
+
import { _ as _sfc_main$6, a as _sfc_main$8 } from "../../PricingGroupContent.vue_vue_type_script_setup_true_lang-DAwMy1l8.mjs";
|
|
4
|
+
import { c as createPaymentMethodsService } from "../../paymentMethods-C2gWIbEr.mjs";
|
|
5
|
+
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-CKbnuXMU.mjs";
|
|
6
|
+
import { u as useActionDispatchProvider } from "../../useActionDispatchProvider-B_SkyymZ.mjs";
|
|
7
7
|
const mockSubscriptionGetResponse = {
|
|
8
8
|
id: "ppsu_hwDeeN0vhvcVCsAIdp1G",
|
|
9
9
|
pricing_plan_schedule_infos: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as useConfig, c as createRequestService, w as withExpand, s as serializeQueryParams, a as withPagination } from "./component-
|
|
1
|
+
import { u as useConfig, c as createRequestService, w as withExpand, s as serializeQueryParams, a as withPagination } from "./component-B0RYS5uK.mjs";
|
|
2
2
|
const ENDPOINT = "/portal/pricing-plan-subscriptions";
|
|
3
3
|
function createSubscriptionsService() {
|
|
4
4
|
const config = useConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const i=require("./component-
|
|
1
|
+
const i=require("./component-BeqkeC9h.js"),e="/portal/pricing-plan-subscriptions";exports.createSubscriptionsService=function(){const n=i.useConfig(),r=i.createRequestService();return{getSubscription:function({id:_,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 r({url:`${n.apiUrls.config}${e}/${_}${i.serializeQueryParams(i.withExpand({expandParams:s}))}`})},getActiveSubscriptions:function({customerId:_,pagination:c}){const s=c??{},p=i.withExpand({initialParams:{customer_id:_,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 r({url:`${n.apiUrls.config}${e}${t}`,isCollection:!0})}}};
|
package/dist/{useActionDispatchProvider-J1S-vXqg.mjs → useActionDispatchProvider-B_SkyymZ.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject } from "vue";
|
|
2
|
-
import { A as ACTION_DISPATCHER_PROVIDER_INJECTION_KEY } from "./component-
|
|
2
|
+
import { A as ACTION_DISPATCHER_PROVIDER_INJECTION_KEY } from "./component-B0RYS5uK.mjs";
|
|
3
3
|
function useActionDispatchProvider() {
|
|
4
4
|
const dispatchAction = inject(ACTION_DISPATCHER_PROVIDER_INJECTION_KEY);
|
|
5
5
|
if (!dispatchAction) {
|
package/dist/{useActionDispatchProvider-C-uVJcgJ.js → useActionDispatchProvider-D4OtXsNA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=require("vue"),i=require("./component-
|
|
1
|
+
const t=require("vue"),i=require("./component-BeqkeC9h.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 { ref } from "vue";
|
|
2
|
-
import { c as createRequestService, u as useConfig } from "./component-
|
|
2
|
+
import { c as createRequestService, u as useConfig } from "./component-B0RYS5uK.mjs";
|
|
3
3
|
import { u as useService } from "./useService-B4qv5N2D.mjs";
|
|
4
4
|
function createCustomerService() {
|
|
5
5
|
const request = createRequestService();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),t=require("./component-
|
|
1
|
+
const e=require("vue"),t=require("./component-BeqkeC9h.js"),r=require("./useService-D-CUtlp3.js");exports.useCustomer=function({customerId:u}){const{getCustomer:s,updateCustomer:o}=function(){const e=t.createRequestService(),r=t.useConfig();return{getCustomer:function(t){return e({url:`${r.apiUrls.config}/portal/customers/${t}`})},updateCustomer:function(t,u){return e({url:`${r.apiUrls.config}/portal/customers/${t}`,options:{method:"PATCH"},data:u})}}}(),n=e.ref(),{data:c,...a}=r.useService({service:async()=>{const e=await s(u);return n.value=e,e}}),{data:i,...m}=r.useService({service:async e=>{const t=await o(u,e);return n.value=t,t}});return{customer:n,get:a,update:m}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),t=require("./component-
|
|
1
|
+
const e=require("vue"),t=require("./component-BeqkeC9h.js"),o=require("./Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),n=require("./useActionDispatchProvider-D4OtXsNA.js"),a=require("./paymentMethods-D_rYLg3F.js"),i=require("./useService-D-CUtlp3.js"),s={key:0,class:"flex flex-col gap-2"},r=e.defineComponent({__name:"CustomerPaymentMethodsBlock",props:{paymentMethods:{type:Array},limit:{default:2,type:Number},isLoading:{type:Boolean},showViewAllButton:{type:Boolean},showAddButton:{type:Boolean}},emits:["view-all-payment-methods","add-payment-method"],setup(o){const n=o,{$t:a}=t.useIntl(),i=e.computed(()=>n.paymentMethods.length>0);return(n,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":"","no-border":"",title:e.unref(a)({defaultMessage:"{count, plural, one {Payment method} other {Payment methods}}",description:"Title for the payment methods block on the customer overview page",id:"customer_overview.payment_methods.title"},{count:String(o.paymentMethods.length)})},e.createSlots({default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.paymentMethods,o=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:o.id},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main),{"payment-method":o},null,8,["payment-method"])]),_:2},1024))),128))])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add a payment method for recurring invoice payments.",description:"Helper text for adding a payment method when no payment methods are configured",id:"customer_overview.payment_methods_block.add_payment_method_helper_text"})),1)]),_:1}),o.showAddButton?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,class:"mt-4 w-full",variant:"outline",color:"gray","icon-prefix":"add",type:"button",onClick:r[1]||(r[1]=e=>n.$emit("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add payment method",description:"Text for the add payment method button that is shown when no payment methods have been configured",id:"customer_overview.payment_methods_block.add_payment_method_button_label"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}))]),_:2},[o.showViewAllButton?{name:"right",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2H),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",type:"button",onClick:r[0]||(r[0]=e=>n.$emit("view-all-payment-methods"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"View all",id:"customer_overview.payment_methods_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer invoices"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),d=e.defineComponent({__name:"CustomerPaymentMethods",props:{isLoading:{type:Boolean},paymentMethods:{type:Array},paymentMethodsOptions:{type:Array},maxPaymentMethods:{type:Number},configuration:{default:()=>({showViewAllButton:!0,showAddButton:!0}),type:Object}},setup(t){const{dispatchAction:a}=n.useActionDispatchProvider();return(n,i)=>{var s,d;return t.isLoading?(e.openBlock(),e.createBlock(o._sfc_main,{key:0,variant:"section",class:"h-72","data-testid":"customer-payment-methods-skeleton"})):(e.openBlock(),e.createBlock(r,{key:1,"is-loading":t.isLoading,"payment-methods":t.paymentMethods,"payment-methods-options":t.paymentMethodsOptions,"show-view-all-button":null==(s=t.configuration)?void 0:s.showViewAllButton,"show-add-button":null==(d=t.configuration)?void 0:d.showAddButton,onViewAllPaymentMethods:i[0]||(i[0]=t=>e.unref(a)({action:"view-all-payment-methods"})),onAddPaymentMethod:i[1]||(i[1]=t=>e.unref(a)({action:"add-payment-method"}))},null,8,["is-loading","payment-methods","payment-methods-options","show-view-all-button","show-add-button"]))}}});exports._sfc_main=d,exports.useCustomerPaymentMethodOptions=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=a.createPaymentMethodsService(),{data:n,execute:s,error:r,apiStatus:d,isPending:m}=i.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:r,apiStatus:d,items:n,fetch:s,isPending:m}};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, createSlots, withCtx, createElementBlock, Fragment, renderList, createVNode, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
-
import { b as useIntl, d as _sfc_main$1g, g as _sfc_main$2, _ as _sfc_main$2$1, m as _sfc_main$2H } from "./component-
|
|
2
|
+
import { b as useIntl, d as _sfc_main$1g, g as _sfc_main$2, _ as _sfc_main$2$1, m as _sfc_main$2H } from "./component-B0RYS5uK.mjs";
|
|
3
3
|
import { _ as _sfc_main$3 } from "./Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs";
|
|
4
|
-
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-
|
|
5
|
-
import { c as createPaymentMethodsService } from "./paymentMethods-
|
|
4
|
+
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-B_SkyymZ.mjs";
|
|
5
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-C2gWIbEr.mjs";
|
|
6
6
|
import { u as useService } from "./useService-B4qv5N2D.mjs";
|
|
7
7
|
const _hoisted_1 = {
|
|
8
8
|
key: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ApiStatus } from "./_Uint8Array-DHE03FZr.mjs";
|
|
2
|
-
import { i as getPaginatedFullList, j as isApiSuccessCollectionResponse } from "./component-
|
|
2
|
+
import { i as getPaginatedFullList, j as isApiSuccessCollectionResponse } from "./component-B0RYS5uK.mjs";
|
|
3
3
|
import { shallowRef, ref, computed } from "vue";
|
|
4
4
|
import { c as cloneDeep } from "./cloneDeep-sm9cY-u2.mjs";
|
|
5
5
|
function toError(error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./_Uint8Array-DxISR7XF.js"),a=require("./component-
|
|
1
|
+
const e=require("./_Uint8Array-DxISR7XF.js"),a=require("./component-BeqkeC9h.js"),t=require("vue"),i=require("./cloneDeep-DranHQkY.js");exports.useIncrementalLoading=function({initialData:n=[],service:u}){const l=t.shallowRef(n),s=t.ref(e.ApiStatus.Initial),r=t.ref(null),o=t.ref(1),c=t.ref(!1),v=t.computed(()=>s.value===e.ApiStatus.Loading),p=async t=>{var i;if(!v.value)try{r.value=null,s.value=e.ApiStatus.Loading;const n=await u(t);if(!a.isApiSuccessCollectionResponse(n))return void(s.value=e.ApiStatus.Done);c.value=!!(null==(i=n.links)?void 0:i.next),l.value=[...l.value,...n.data],s.value=e.ApiStatus.Done,o.value=t}catch(n){r.value=function(e){return e instanceof Error?e:new Error("Something went wrong while fetching data.")}(n),s.value=e.ApiStatus.Failed}};return{items:t.computed(()=>i.cloneDeep(l.value)),error:r,fetchInitial:async()=>await p(1),fetchMore:async()=>await p(o.value+1),fetchAll:async()=>{r.value=null,s.value=e.ApiStatus.Loading;const t=await a.getPaginatedFullList(async t=>{const i=await u(t);if(!a.isApiSuccessCollectionResponse(i))throw s.value=e.ApiStatus.Failed,new Error("message"in i?i.message:"Request failed");return i});l.value=t.data,s.value=e.ApiStatus.Done},isPending:v,hasNextBatch:c}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createInvoicesService } from "./invoices-
|
|
2
|
-
import { c as createPaymentsService } from "./payments-
|
|
1
|
+
import { c as createInvoicesService } from "./invoices-CoEBP5UT.mjs";
|
|
2
|
+
import { c as createPaymentsService } from "./payments-DLjkq_hN.mjs";
|
|
3
3
|
import { ref, onMounted } from "vue";
|
|
4
4
|
import { w as watchDebounced } from "./index-BFZ0dPh9.mjs";
|
|
5
5
|
const useData = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./invoices-
|
|
1
|
+
const e=require("./invoices-CUrXmVXe.js"),t=require("./payments-ClJySb0d.js"),n=require("vue"),a=require("./index-2jo9BSPM.js");exports.useInvoiceData=function(r){const{getInvoice:c}=e.createInvoicesService(),{getPayments:i}=t.createPaymentsService();return(({getData:e,onError:t,watchValue:r,debounce:c=200})=>{const i=n.ref(),s=n.ref(!0),o=async()=>{try{i.value=await e(r)}catch(n){null==t||t(n)}finally{s.value=!1}};return n.onMounted(async()=>{o(),r&&a.watchDebounced(r,()=>{o()},{debounce:c})}),{data:i,isPending:s}})({getData:async()=>{const[e,t]=await Promise.all([c(r),i(r)]);return{invoice:e,paymentAttempts: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
|
-
import { b as useIntl, r as _sfc_main$1y, T as TableHead, t as TableHeadRow, v as _sfc_main$1r, x as TableBody, y as _sfc_main$1q, z as _sfc_main$1p, _ as _sfc_main$2, B as _sfc_main$2L, e as _sfc_main$3, m as _sfc_main$2H, d as _sfc_main$1g } from "./component-
|
|
3
|
-
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-
|
|
4
|
-
import { u as useIncrementalLoading } from "./useIncrementalLoading-
|
|
5
|
-
import { c as createInvoicesService } from "./invoices-
|
|
2
|
+
import { b as useIntl, r as _sfc_main$1y, T as TableHead, t as TableHeadRow, v as _sfc_main$1r, x as TableBody, y as _sfc_main$1q, z as _sfc_main$1p, _ as _sfc_main$2, B as _sfc_main$2L, e as _sfc_main$3, m as _sfc_main$2H, d as _sfc_main$1g } from "./component-B0RYS5uK.mjs";
|
|
3
|
+
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-B_SkyymZ.mjs";
|
|
4
|
+
import { u as useIncrementalLoading } from "./useIncrementalLoading-BqD4k_-r.mjs";
|
|
5
|
+
import { c as createInvoicesService } from "./invoices-CoEBP5UT.mjs";
|
|
6
6
|
const _hoisted_1 = { class: "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"),t=require("./component-
|
|
1
|
+
const e=require("vue"),t=require("./component-BeqkeC9h.js"),i=require("./useActionDispatchProvider-D4OtXsNA.js"),o=require("./useIncrementalLoading-CDpeHhKs.js"),n=require("./invoices-CUrXmVXe.js"),a={class:"grid-cols-1 gap-4"},c=["onClick"],r={class:"flex flex-col"},s={class:"mt-2 flex items-center justify-center"},l=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:n,$t:l}=t.useIntl(),d=e.computed(()=>o.configuration.showPayButton),u=e.computed(()=>o.configuration.showViewButton),f=e.computed(()=>o.hasMoreItems);return(o,m)=>(e.openBlock(),e.createElementBlock("div",a,[e.createVNode(e.unref(t._sfc_main$1y),{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),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1r),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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$1r),{class:"hidden md:table-cell"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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$1r),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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$1r),{class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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$1q),{key:i.id},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1p),{"has-padding":"",class:"h-14"},{default:e.withCtx(()=>[e.createElementVNode("div",r,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",class:"md:hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({date:i.invoice_date,format:"date",offsetType:"offsetted",timezone:i.customer.timezone})),1)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$2),{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$1p),{class:"hidden h-14 md:table-cell"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({date:i.invoice_date,format:"date",offsetType:"offsetted",timezone:i.customer.timezone})),1)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$1p),{class:"h-14"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",weight:"semibold"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2L),{value:i.invoice_amount_including_tax},null,8,["value"])]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(t._sfc_main$1p),{class:"h-14 text-right"},{default:e.withCtx(()=>[i.paid?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,color:"green"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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$2H),{key:1,variant:"outline",color:"gray",size:"sm",type:"button",onClick:e.withModifiers(e=>o.$emit("pay-invoice",{invoiceId:i.id}),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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:"absolute inset-0 h-full w-full",onClick:e=>o.$emit("view-invoice",{invoiceId:i.id})},null,8,c)]),key:"0"}:void 0]),1024))),128))]),_:1})]),_:1}),e.createElementVNode("div",s,[f.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,variant:"outline",color:"gray",size:"sm",class:"w-full",loading:i.isLoading,onClick:m[0]||(m[0]=e=>o.$emit("load-more"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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:n}=t.useIntl(),{dispatchAction:a}=i.useActionDispatchProvider();return(i,c)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-border":"",spacing:"none","content-background":"none",title:e.unref(n)({defaultMessage:"Invoices",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(l,{configuration:o.configuration,"has-more-items":o.hasMoreItems,invoices:o.invoices,"is-loading":o.isLoading,onLoadMore:c[0]||(c[0]=e=>i.$emit("load-more")),onViewInvoice:c[1]||(c[1]=t=>e.unref(a)({action:"view-invoice",data:{invoiceId:t.invoiceId}})),onPayInvoice:c[2]||(c[2]=t=>e.unref(a)({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=n.createInvoicesService();return o.useIncrementalLoading({service:async o=>i.getInvoices({customerId:e,pagination:{page:o,pageSize:t}})})};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as useIncrementalLoading } from "./useIncrementalLoading-
|
|
2
|
-
import { c as createPaymentMethodsService } from "./paymentMethods-
|
|
1
|
+
import { u as useIncrementalLoading } from "./useIncrementalLoading-BqD4k_-r.mjs";
|
|
2
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-C2gWIbEr.mjs";
|
|
3
3
|
function usePaymentMethods({
|
|
4
4
|
customerId,
|
|
5
5
|
pageSize = 15
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./useIncrementalLoading-
|
|
1
|
+
const e=require("./useIncrementalLoading-CDpeHhKs.js"),t=require("./paymentMethods-D_rYLg3F.js");exports.usePaymentMethods=function({customerId:n,pageSize:s=15}){const{getPaymentMethods:a}=t.createPaymentMethodsService();return e.useIncrementalLoading({service:async e=>a({customerId:n,pagination:{page:e,pageSize:s}})})};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, defineComponent, openBlock, createBlock, unref, createCommentVNode } from "vue";
|
|
2
|
-
import { c as createRequestService, u as useConfig, b as useIntl, C as _sfc_main$1f, D as _sfc_main$16 } from "./component-
|
|
2
|
+
import { c as createRequestService, u as useConfig, b as useIntl, C as _sfc_main$1f, D as _sfc_main$16 } from "./component-B0RYS5uK.mjs";
|
|
3
3
|
import { u as useService } from "./useService-B4qv5N2D.mjs";
|
|
4
4
|
import { _ as _sfc_main$2 } from "./Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs";
|
|
5
5
|
function createWalletsService() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),l=require("./component-
|
|
1
|
+
const e=require("vue"),l=require("./component-BeqkeC9h.js"),a=require("./useService-D-CUtlp3.js"),t=require("./Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js");const n=e.defineComponent({__name:"CustomerWalletBalancesBlock",props:{walletBalances:{type:Array}},setup(a){const{$t:t}=l.useIntl();return(n,o)=>(e.openBlock(),e.createBlock(e.unref(l._sfc_main$1f),{items:a.walletBalances,title:e.unref(t)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(a.walletBalances.length)})},null,8,["items","title"]))}}),o=e.defineComponent({__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array}},setup(a){const{$t:o}=l.useIntl();return(s,r)=>a.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"min-h-48","data-testid":"customer-wallet-balances-skeleton"})):a.hasError?(e.openBlock(),e.createBlock(e.unref(l._sfc_main$16),{key:1,title:e.unref(o)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})},null,8,["title"])):a.walletBalances.length>0?(e.openBlock(),e.createBlock(n,{key:2,"wallet-balances":a.walletBalances},null,8,["wallet-balances"])):e.createCommentVNode("",!0)}});exports._sfc_main=o,exports.useCustomerWalletBalances=function({customerId:t}){const{getCustomerWalletBalances:n}=function(){const e=l.createRequestService(),a=l.useConfig();return{getCustomerWalletBalances:function(l){return e({url:`${a.apiUrls.config}/portal/customers/${l}/wallets/balance`,options:{method:"POST"},data:{}})}}}(),{data:o,execute:s,apiStatus:r,error:c,isPending:u}=a.useService({service:()=>n(t)});return{walletBalances:e.computed(()=>o.value??null),apiStatus:r,error:c,fetch:s,isPending:u}},exports.useWalletBalanceItems=function(a){const{$t:t}=l.useIntl();return e.computed(()=>{var e;return((null==(e=a.value)?void 0:e.wallet_balances)??[]).map(e=>{var l;return{walletId:e.wallet_id,title:t({defaultMessage:"Balance",description:"Fallback wallet title in wallet balance components",id:"H5+NAX"}),balance:e.wallet_balance.open_balance,balanceAt:e.wallet_balance.balance_at??(null==(l=a.value)?void 0:l.balance_at)??null}})})};
|
package/package.json
CHANGED