@solvimon/solvimon-web 0.1.0-alpha.16 → 0.1.0-alpha.17
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/README.md +5 -5
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BYBAO4Au.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BrPsTuoW.mjs} +2 -2
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js → BillingInformation.vue_vue_type_script_setup_true_lang-BuQ8bzar.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-1Op9GjGZ.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CuWrBcoK.mjs} +3 -3
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js +1 -0
- package/dist/{useWalletBalanceItems-COQDLfoZ.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D2BhuXsh.mjs} +24 -56
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js +1 -0
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3cqlbGY.mjs +147 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-dwIv_xxf.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-wxP5IaGt.mjs} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js → InvoiceHeader.vue_vue_type_script_setup_true_lang-05NKI2A0.js} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs → InvoiceHeader.vue_vue_type_script_setup_true_lang-17v07F58.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BKMttUyk.mjs → PaymentHistoryBlock-BitwS9Re.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BGbTy4Se.js → PaymentHistoryBlock-ZtmPXXwI.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3ZUDUdw.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CMGK71zZ.js} +1 -1
- package/dist/{PaymentIntegrationForm-CypW6fZY.mjs → PaymentIntegrationForm-BK2aLPCo.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-D4QupHWl.js → PaymentIntegrationForm-BZTzCUiu.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B_yDNGK8.mjs} +5 -5
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-GN3WAr10.js +1 -0
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-B8eNptZp.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs} +25 -14
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-zRr8iihy.js +1 -0
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-BQIN3zuf.mjs +156 -0
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DyL2-vV0.js +1 -0
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs} +5 -5
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-OvGGejpX.js} +1 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BxqIfmkK.js +1 -0
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D1TcP9PR.mjs} +115 -68
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js +1 -0
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BMXr26gF.mjs +37 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BDqX6OaE.mjs} +22 -119
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CyAFjCh7.js +1 -0
- package/dist/component-CUJ_G2Nw.mjs +962 -0
- package/dist/component-CiKxWtdx.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +7 -7
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.es.js +4 -4
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
- 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 +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +7 -58
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +8 -6
- package/dist/core/action-request.types.d.ts +3 -3
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +4 -2
- package/dist/{customer-_W8gIX5m.js → customer-AfRcAZ5P.js} +1 -1
- package/dist/{customer-Bv_fqXzO.mjs → customer-DAgdegIW.mjs} +1 -1
- package/dist/{en-US-DAgOSlgv.mjs → en-US-DSzSbgL5.mjs} +68 -36
- package/dist/en-US-QzQnGXP1.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +7 -4
- package/dist/invoices-BHgajZHq.js +1 -0
- package/dist/{invoices-BGb0AwVF.mjs → invoices-BXDgW8ch.mjs} +32 -16
- package/dist/nl-NL-C4rr-1tr.js +1 -0
- package/dist/{nl-NL-DCsmrA8A.mjs → nl-NL-Li7RW89R.mjs} +72 -40
- package/dist/{paymentMethods-DIbB759g.js → paymentMethods-BMcc-eTl.js} +1 -1
- package/dist/{paymentMethods-DvqlWe96.mjs → paymentMethods-xzFD2L30.mjs} +2 -2
- package/dist/{payments-DMDDI3MK.js → payments-DMvmB5vg.js} +1 -1
- package/dist/{payments-CpzTVrQM.mjs → payments-DV6csRej.mjs} +1 -1
- package/dist/pricing-B1uImUm4.mjs +19 -0
- package/dist/pricing-BEjY_5wb.js +1 -0
- package/dist/pricingPlanSchedule-B9HFiXy-.js +1 -0
- package/dist/pricingPlanSchedule-C_cqUyTk.mjs +144 -0
- package/dist/registry-CeMxLjwU.js +1 -0
- package/dist/{registry-B-If1W_u.mjs → registry-CyENvS6l.mjs} +7 -4
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +414 -675
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +65 -19
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
- package/dist/screens/PayInvoice/PayInvoice.es.js +10 -9
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +8 -8
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.ce.d.ts +3 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs.js +1 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.es.js +542 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.ce.d.ts +3 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs.js +1 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.es.js +725 -0
- package/dist/solvimon-web.css +1 -1
- package/dist/subscription-B4dBAY9C.mjs +89 -0
- package/dist/subscription-b0OPx8Du.js +1 -0
- package/dist/{subscriptions-BPYyv09M.mjs → subscriptions-CrNDM9qa.mjs} +6 -2
- package/dist/{subscriptions-CC61I6Nj.js → subscriptions-DC-mxa17.js} +1 -1
- package/dist/{url-1Lbg5Yni.mjs → url-BjZ1Pg0l.mjs} +1 -1
- package/dist/url-D8GJi5rF.js +1 -0
- package/dist/{useActionDispatchProvider-BHTknMoH.js → useActionDispatchProvider-bqR_FeM4.js} +1 -1
- package/dist/{useActionDispatchProvider-Dz8-e4gZ.mjs → useActionDispatchProvider-zB_GKeUR.mjs} +1 -1
- package/dist/{useCustomer-VVJi8z2w.mjs → useCustomer-VfeQ6rG2.mjs} +2 -2
- package/dist/{useCustomer-Z24KchWC.js → useCustomer-bO4D6e4Z.js} +1 -1
- package/dist/{useIncrementalLoading-CuSndpP2.js → useIncrementalLoading-BgWuwoMo.js} +1 -1
- package/dist/{useIncrementalLoading-DmOT2MXH.mjs → useIncrementalLoading-C59FXHzp.mjs} +1 -1
- package/dist/{useInvoiceData-Bl87gzIS.js → useInvoiceData-CxxkBTGY.js} +1 -1
- package/dist/{useInvoiceData-Di5pLPM0.mjs → useInvoiceData-Dhg-hx8C.mjs} +2 -2
- package/dist/useInvoicesList-BXZ9uV9i.js +1 -0
- package/dist/{useInvoicesList-z19cteaD.mjs → useInvoicesList-DBz7T7sM.mjs} +4 -4
- package/dist/{useLoadInitialData-CkpryfjF.mjs → useLoadInitialData-BhpIg7OF.mjs} +1 -1
- package/dist/{useLoadInitialData-CTqfiMTN.js → useLoadInitialData-BqiAFNFi.js} +1 -1
- package/dist/{usePaymentMethodOptions-BsCZnCQW.js → usePaymentMethodOptions-DszFvgKX.js} +1 -1
- package/dist/{usePaymentMethodOptions-BoGHJjng.mjs → usePaymentMethodOptions-PcMjtMSF.mjs} +2 -2
- package/dist/{usePaymentMethods-ocHmNoP7.mjs → usePaymentMethods-B5AbGWsn.mjs} +2 -2
- package/dist/{usePaymentMethods-AC-4rrR9.js → usePaymentMethods-Bb1Xbads.js} +1 -1
- package/dist/{usePayments-D85eB5l4.mjs → usePayments-DgoZoBZh.mjs} +3 -3
- package/dist/{usePayments-CgXZeWrU.js → usePayments-is5c66Z6.js} +1 -1
- package/dist/{usePortal-DVD7PcWI.js → usePortal-C4qWsJeq.js} +1 -1
- package/dist/{usePortal-B1O1zgdV.mjs → usePortal-DWLtNqBB.mjs} +1 -1
- package/dist/{useService-DF57xuDd.mjs → useService-BZqFkz7p.mjs} +1 -1
- package/dist/{useService-CHrkefKd.js → useService-DKm3QtT4.js} +1 -1
- package/dist/useSubscription-CEZJw6wZ.mjs +23 -0
- package/dist/useSubscription-DuUNc1_l.js +1 -0
- package/dist/useTopUpModal-DNyWrHDv.mjs +1012 -0
- package/dist/useTopUpModal-DeF-cfCK.js +1 -0
- package/dist/{vendor-ui-B8IlviSs.mjs → vendor-ui-BoGKOJ36.mjs} +8642 -7077
- package/dist/vendor-ui-BuRqLx74.js +1 -0
- package/package.json +14 -7
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js +0 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-eWmC5GOT.js +0 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js +0 -1
- package/dist/component-Bg2JVC_O.mjs +0 -933
- package/dist/component-Bs8oszfD.js +0 -1
- package/dist/en-US-C0gIE4Q1.js +0 -1
- package/dist/invoices-D-OKipCg.js +0 -1
- package/dist/nl-NL-Br7muSHK.js +0 -1
- package/dist/registry-uG2isab0.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +0 -3
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +0 -1102
- package/dist/url-B6-3PkW2.js +0 -1
- package/dist/useInvoicesList-CFk-_oVK.js +0 -1
- package/dist/useWalletBalanceItems-BL-R5foK.js +0 -1
- package/dist/vendor-ui-C3Tq-qY_.js +0 -1
|
@@ -1,1102 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createElementBlock, Fragment, createCommentVNode, renderList, ref, onMounted, watch, onUnmounted, normalizeClass } from "vue";
|
|
2
|
-
import { u as useIntl, _ as _sfc_main$5, A as _sfc_main$6, e as _sfc_main$7, x as _sfc_main$8, F as _sfc_main$9, B as formatAmount, c as _sfc_main$b, E as _sfc_main$e, g as getCustomerCountry } from "../../vendor-ui-B8IlviSs.mjs";
|
|
3
|
-
import { _ as _sfc_main$a, a as _sfc_main$f, b as _sfc_main$g } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs";
|
|
4
|
-
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
5
|
-
import { c as createRequestService, u as useConfig, a as useLogger, _ as _sfc_main$i, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
|
|
6
|
-
import { u as useActionDispatchProvider } from "../../useActionDispatchProvider-Dz8-e4gZ.mjs";
|
|
7
|
-
import { u as usePortal } from "../../usePortal-B1O1zgdV.mjs";
|
|
8
|
-
import { c as createSubscriptionsService } from "../../subscriptions-BPYyv09M.mjs";
|
|
9
|
-
import { c as createCustomerService } from "../../customer-Bv_fqXzO.mjs";
|
|
10
|
-
import { c as createPaymentMethodsService } from "../../paymentMethods-DvqlWe96.mjs";
|
|
11
|
-
import { c as createInvoicesService } from "../../invoices-BGb0AwVF.mjs";
|
|
12
|
-
import { _ as _sfc_main$h } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs";
|
|
13
|
-
import { _ as _sfc_main$d } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
14
|
-
import { _ as _sfc_main$c } from "../../url-1Lbg5Yni.mjs";
|
|
15
|
-
import { u as useViewport } from "../../useViewport-Bu0cyeSi.mjs";
|
|
16
|
-
const _hoisted_1$2 = { class: "sv-order-summary__body grid grid-cols-1 gap-1" };
|
|
17
|
-
const _hoisted_2$1 = { class: "flex items-center justify-center gap-2 px-3 py-5" };
|
|
18
|
-
const _hoisted_3$1 = { class: "flex flex-row gap-3 px-3 py-2" };
|
|
19
|
-
const _hoisted_4$1 = { class: "grow" };
|
|
20
|
-
const _hoisted_5$1 = { class: "sv-order-summary__items grid grid-cols-1 gap-1" };
|
|
21
|
-
const _hoisted_6$1 = { class: "flex flex-row gap-2 px-3 py-2" };
|
|
22
|
-
const _hoisted_7$1 = { class: "flex flex-row gap-3 px-3 py-2" };
|
|
23
|
-
const _hoisted_8$1 = { class: "grow" };
|
|
24
|
-
const _hoisted_9$1 = { class: "flex flex-row gap-2 px-3 py-2" };
|
|
25
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
26
|
-
__name: "UpgradeOrderSummary",
|
|
27
|
-
props: {
|
|
28
|
-
selectedPricings: { type: Array },
|
|
29
|
-
invoice: { type: Object },
|
|
30
|
-
loading: { type: Boolean }
|
|
31
|
-
},
|
|
32
|
-
setup(__props) {
|
|
33
|
-
const props = __props;
|
|
34
|
-
const { $t } = useIntl();
|
|
35
|
-
const isEmpty = computed(() => props.selectedPricings.length === 0);
|
|
36
|
-
const getPrice = (pricing) => {
|
|
37
|
-
var _a, _b, _c, _d, _e;
|
|
38
|
-
const band = (_e = (_d = (_c = (_b = (_a = pricing.items) == null ? void 0 : _a[0]) == null ? void 0 : _b.configs) == null ? void 0 : _c[0]) == null ? void 0 : _d.bands) == null ? void 0 : _e[0];
|
|
39
|
-
return (band == null ? void 0 : band.fixed_amount) ?? (band == null ? void 0 : band.amount);
|
|
40
|
-
};
|
|
41
|
-
const invoiceHeader = computed(() => {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
43
|
-
const group = (_d = (_c = (_b = (_a = props.invoice) == null ? void 0 : _a.periods) == null ? void 0 : _b[0]) == null ? void 0 : _c.groups) == null ? void 0 : _d[0];
|
|
44
|
-
const product = (_e = group == null ? void 0 : group.products) == null ? void 0 : _e[0];
|
|
45
|
-
const lineCount = invoiceLineRows.value.length;
|
|
46
|
-
return {
|
|
47
|
-
title: (product == null ? void 0 : product.name) ?? ((_f = group == null ? void 0 : group.product_category) == null ? void 0 : _f.name) ?? ((_g = invoiceLineRows.value[0]) == null ? void 0 : _g.description),
|
|
48
|
-
subtitle: lineCount > 1 ? $t(
|
|
49
|
-
{
|
|
50
|
-
defaultMessage: "{count} items",
|
|
51
|
-
id: "upgrade_subscription.order_summary.item_count",
|
|
52
|
-
description: "Subtitle shown below the product name when multiple one-off items are selected"
|
|
53
|
-
},
|
|
54
|
-
{ count: String(lineCount) }
|
|
55
|
-
) : (_h = invoiceLineRows.value[0]) == null ? void 0 : _h.description
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
const invoiceLineRows = computed(
|
|
59
|
-
() => {
|
|
60
|
-
var _a;
|
|
61
|
-
return (((_a = props.invoice) == null ? void 0 : _a.periods) ?? []).flatMap(
|
|
62
|
-
(period, periodIndex) => period.groups.flatMap(
|
|
63
|
-
(group, groupIndex) => (group.lines ?? []).map((line, lineIndex) => {
|
|
64
|
-
var _a2, _b, _c, _d, _e;
|
|
65
|
-
return {
|
|
66
|
-
key: `${periodIndex}-${groupIndex}-${lineIndex}`,
|
|
67
|
-
description: line.description ?? ((_b = (_a2 = line.product_items) == null ? void 0 : _a2[0]) == null ? void 0 : _b.name) ?? ((_d = (_c = group.products) == null ? void 0 : _c[0]) == null ? void 0 : _d.name) ?? ((_e = group.product_category) == null ? void 0 : _e.name) ?? "—",
|
|
68
|
-
amount: line.amount_excluding_tax
|
|
69
|
-
};
|
|
70
|
-
})
|
|
71
|
-
)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
const selectedPricingRows = computed(
|
|
76
|
-
() => props.selectedPricings.map((pricing) => {
|
|
77
|
-
var _a, _b;
|
|
78
|
-
return {
|
|
79
|
-
key: pricing.id,
|
|
80
|
-
description: pricing.name ?? ((_b = (_a = pricing.products) == null ? void 0 : _a[0]) == null ? void 0 : _b.name) ?? "—",
|
|
81
|
-
amount: getPrice(pricing)
|
|
82
|
-
};
|
|
83
|
-
})
|
|
84
|
-
);
|
|
85
|
-
const title = computed(
|
|
86
|
-
() => $t({
|
|
87
|
-
defaultMessage: "Order summary",
|
|
88
|
-
id: "upgrade_subscription.order_summary.title",
|
|
89
|
-
description: "Title for the order summary section on the upgrade subscription page"
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
return (_ctx, _cache) => {
|
|
93
|
-
return openBlock(), createBlock(unref(_sfc_main$5), {
|
|
94
|
-
class: "sv-order-summary sv-upgrade-subscription__order-summary",
|
|
95
|
-
"no-border": "",
|
|
96
|
-
"no-spacing": "",
|
|
97
|
-
"content-background": "none",
|
|
98
|
-
title: title.value
|
|
99
|
-
}, {
|
|
100
|
-
default: withCtx(() => [
|
|
101
|
-
createElementVNode("div", _hoisted_1$2, [
|
|
102
|
-
isEmpty.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
103
|
-
key: 0,
|
|
104
|
-
"no-spacing": "",
|
|
105
|
-
class: "sv-order-summary__empty-state"
|
|
106
|
-
}, {
|
|
107
|
-
default: withCtx(() => [
|
|
108
|
-
createElementVNode("div", _hoisted_2$1, [
|
|
109
|
-
createVNode(unref(_sfc_main$6), {
|
|
110
|
-
icon: "shopping_cart",
|
|
111
|
-
class: "text-gray-500"
|
|
112
|
-
}),
|
|
113
|
-
createVNode(unref(_sfc_main$7), {
|
|
114
|
-
variant: "body-sm",
|
|
115
|
-
weight: "semibold",
|
|
116
|
-
shade: "lighter",
|
|
117
|
-
"no-spacing": ""
|
|
118
|
-
}, {
|
|
119
|
-
default: withCtx(() => [
|
|
120
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
121
|
-
defaultMessage: "Select your items",
|
|
122
|
-
id: "upgrade_subscription.order_summary.empty_state",
|
|
123
|
-
description: "Placeholder shown when no items are selected in the order summary"
|
|
124
|
-
})), 1)
|
|
125
|
-
]),
|
|
126
|
-
_: 1
|
|
127
|
-
})
|
|
128
|
-
])
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
})) : __props.invoice ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
132
|
-
invoiceHeader.value.title ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
133
|
-
key: 0,
|
|
134
|
-
"no-spacing": "",
|
|
135
|
-
class: "sv-order-summary__subscription"
|
|
136
|
-
}, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createElementVNode("div", _hoisted_3$1, [
|
|
139
|
-
createElementVNode("div", _hoisted_4$1, [
|
|
140
|
-
createVNode(unref(_sfc_main$7), {
|
|
141
|
-
variant: "body-sm",
|
|
142
|
-
weight: "semibold",
|
|
143
|
-
"no-spacing": ""
|
|
144
|
-
}, {
|
|
145
|
-
default: withCtx(() => [
|
|
146
|
-
createTextVNode(toDisplayString(invoiceHeader.value.title), 1)
|
|
147
|
-
]),
|
|
148
|
-
_: 1
|
|
149
|
-
}),
|
|
150
|
-
invoiceHeader.value.subtitle ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
151
|
-
key: 0,
|
|
152
|
-
variant: "body-xs",
|
|
153
|
-
shade: "lighter",
|
|
154
|
-
"no-spacing": ""
|
|
155
|
-
}, {
|
|
156
|
-
default: withCtx(() => [
|
|
157
|
-
createTextVNode(toDisplayString(invoiceHeader.value.subtitle), 1)
|
|
158
|
-
]),
|
|
159
|
-
_: 1
|
|
160
|
-
})) : createCommentVNode("", true)
|
|
161
|
-
])
|
|
162
|
-
])
|
|
163
|
-
]),
|
|
164
|
-
_: 1
|
|
165
|
-
})) : createCommentVNode("", true),
|
|
166
|
-
createElementVNode("div", _hoisted_5$1, [
|
|
167
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(invoiceLineRows.value, (line) => {
|
|
168
|
-
return openBlock(), createBlock(unref(_sfc_main$5), {
|
|
169
|
-
key: line.key,
|
|
170
|
-
"no-spacing": "",
|
|
171
|
-
class: "sv-order-summary__item"
|
|
172
|
-
}, {
|
|
173
|
-
default: withCtx(() => [
|
|
174
|
-
createElementVNode("div", _hoisted_6$1, [
|
|
175
|
-
createVNode(unref(_sfc_main$7), {
|
|
176
|
-
tag: "span",
|
|
177
|
-
variant: "body-xs",
|
|
178
|
-
class: "grow"
|
|
179
|
-
}, {
|
|
180
|
-
default: withCtx(() => [
|
|
181
|
-
createTextVNode(toDisplayString(line.description), 1)
|
|
182
|
-
]),
|
|
183
|
-
_: 2
|
|
184
|
-
}, 1024),
|
|
185
|
-
line.amount ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
186
|
-
key: 0,
|
|
187
|
-
tag: "span",
|
|
188
|
-
variant: "body-xs",
|
|
189
|
-
"no-spacing": ""
|
|
190
|
-
}, {
|
|
191
|
-
default: withCtx(() => [
|
|
192
|
-
createVNode(unref(_sfc_main$8), {
|
|
193
|
-
value: line.amount
|
|
194
|
-
}, null, 8, ["value"])
|
|
195
|
-
]),
|
|
196
|
-
_: 2
|
|
197
|
-
}, 1024)) : createCommentVNode("", true)
|
|
198
|
-
])
|
|
199
|
-
]),
|
|
200
|
-
_: 2
|
|
201
|
-
}, 1024);
|
|
202
|
-
}), 128))
|
|
203
|
-
]),
|
|
204
|
-
createVNode(unref(_sfc_main$5), { class: "sv-order-summary__totals" }, {
|
|
205
|
-
default: withCtx(() => [
|
|
206
|
-
createVNode(unref(_sfc_main$9), {
|
|
207
|
-
class: "sv-order-summary__invoice-preview",
|
|
208
|
-
variant: "without-products",
|
|
209
|
-
invoice: __props.invoice,
|
|
210
|
-
"is-customer-facing": ""
|
|
211
|
-
}, null, 8, ["invoice"])
|
|
212
|
-
]),
|
|
213
|
-
_: 1
|
|
214
|
-
})
|
|
215
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
216
|
-
__props.loading ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
217
|
-
key: 0,
|
|
218
|
-
"no-spacing": "",
|
|
219
|
-
class: "sv-order-summary__subscription"
|
|
220
|
-
}, {
|
|
221
|
-
default: withCtx(() => [
|
|
222
|
-
createElementVNode("div", _hoisted_7$1, [
|
|
223
|
-
createElementVNode("div", _hoisted_8$1, [
|
|
224
|
-
createVNode(unref(_sfc_main$7), {
|
|
225
|
-
variant: "body-sm",
|
|
226
|
-
weight: "semibold",
|
|
227
|
-
"no-spacing": ""
|
|
228
|
-
}, {
|
|
229
|
-
default: withCtx(() => {
|
|
230
|
-
var _a;
|
|
231
|
-
return [
|
|
232
|
-
createTextVNode(toDisplayString(selectedPricingRows.value.length > 1 ? unref($t)({
|
|
233
|
-
defaultMessage: "Selected items",
|
|
234
|
-
id: "upgrade_subscription.order_summary.selected_items_title",
|
|
235
|
-
description: "Temporary order summary title shown while the invoice preview is loading"
|
|
236
|
-
}) : (_a = selectedPricingRows.value[0]) == null ? void 0 : _a.description), 1)
|
|
237
|
-
];
|
|
238
|
-
}),
|
|
239
|
-
_: 1
|
|
240
|
-
}),
|
|
241
|
-
createVNode(unref(_sfc_main$7), {
|
|
242
|
-
variant: "body-xs",
|
|
243
|
-
shade: "lighter",
|
|
244
|
-
"no-spacing": ""
|
|
245
|
-
}, {
|
|
246
|
-
default: withCtx(() => [
|
|
247
|
-
createTextVNode(toDisplayString(selectedPricingRows.value.length > 1 ? unref($t)(
|
|
248
|
-
{
|
|
249
|
-
defaultMessage: "{count} items",
|
|
250
|
-
id: "upgrade_subscription.order_summary.selected_item_count",
|
|
251
|
-
description: "Temporary order summary subtitle shown while the invoice preview is loading"
|
|
252
|
-
},
|
|
253
|
-
{ count: String(selectedPricingRows.value.length) }
|
|
254
|
-
) : unref($t)({
|
|
255
|
-
defaultMessage: "one-off",
|
|
256
|
-
id: "upgrade_subscription.order_summary.one_off_label",
|
|
257
|
-
description: "One-off payment label next to a line item in order summary"
|
|
258
|
-
})), 1)
|
|
259
|
-
]),
|
|
260
|
-
_: 1
|
|
261
|
-
})
|
|
262
|
-
])
|
|
263
|
-
])
|
|
264
|
-
]),
|
|
265
|
-
_: 1
|
|
266
|
-
})) : createCommentVNode("", true),
|
|
267
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(selectedPricingRows.value, (pricing) => {
|
|
268
|
-
return openBlock(), createBlock(unref(_sfc_main$5), {
|
|
269
|
-
key: pricing.key,
|
|
270
|
-
"no-spacing": "",
|
|
271
|
-
class: "sv-order-summary__item"
|
|
272
|
-
}, {
|
|
273
|
-
default: withCtx(() => [
|
|
274
|
-
createElementVNode("div", _hoisted_9$1, [
|
|
275
|
-
createVNode(unref(_sfc_main$7), {
|
|
276
|
-
tag: "span",
|
|
277
|
-
variant: "body-xs",
|
|
278
|
-
class: "grow"
|
|
279
|
-
}, {
|
|
280
|
-
default: withCtx(() => [
|
|
281
|
-
createTextVNode(toDisplayString(pricing.description), 1)
|
|
282
|
-
]),
|
|
283
|
-
_: 2
|
|
284
|
-
}, 1024),
|
|
285
|
-
pricing.amount ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
286
|
-
key: 0,
|
|
287
|
-
tag: "span",
|
|
288
|
-
variant: "body-xs",
|
|
289
|
-
"no-spacing": ""
|
|
290
|
-
}, {
|
|
291
|
-
default: withCtx(() => [
|
|
292
|
-
createVNode(unref(_sfc_main$8), {
|
|
293
|
-
value: pricing.amount
|
|
294
|
-
}, null, 8, ["value"])
|
|
295
|
-
]),
|
|
296
|
-
_: 2
|
|
297
|
-
}, 1024)) : createCommentVNode("", true)
|
|
298
|
-
])
|
|
299
|
-
]),
|
|
300
|
-
_: 2
|
|
301
|
-
}, 1024);
|
|
302
|
-
}), 128)),
|
|
303
|
-
__props.loading ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
304
|
-
key: 1,
|
|
305
|
-
class: "sv-order-summary__totals"
|
|
306
|
-
}, {
|
|
307
|
-
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
308
|
-
createElementVNode("div", { class: "grid grid-cols-1 gap-2" }, [
|
|
309
|
-
createElementVNode("div", { class: "flex items-center justify-between gap-4" }, [
|
|
310
|
-
createElementVNode("div", { class: "h-4 w-40 animate-pulse rounded bg-gray-100" }),
|
|
311
|
-
createElementVNode("div", { class: "h-4 w-20 animate-pulse rounded bg-gray-100" })
|
|
312
|
-
]),
|
|
313
|
-
createElementVNode("div", { class: "flex items-center justify-between gap-4" }, [
|
|
314
|
-
createElementVNode("div", { class: "h-4 w-16 animate-pulse rounded bg-gray-100" }),
|
|
315
|
-
createElementVNode("div", { class: "h-4 w-20 animate-pulse rounded bg-gray-100" })
|
|
316
|
-
]),
|
|
317
|
-
createElementVNode("div", { class: "border-t border-gray-200 pt-2" }, [
|
|
318
|
-
createElementVNode("div", { class: "flex items-center justify-between gap-4" }, [
|
|
319
|
-
createElementVNode("div", { class: "h-5 w-36 animate-pulse rounded bg-gray-100" }),
|
|
320
|
-
createElementVNode("div", { class: "h-5 w-24 animate-pulse rounded bg-gray-100" })
|
|
321
|
-
])
|
|
322
|
-
])
|
|
323
|
-
], -1)
|
|
324
|
-
])]),
|
|
325
|
-
_: 1
|
|
326
|
-
})) : createCommentVNode("", true)
|
|
327
|
-
], 64))
|
|
328
|
-
])
|
|
329
|
-
]),
|
|
330
|
-
_: 1
|
|
331
|
-
}, 8, ["title"]);
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
336
|
-
__name: "OnDemandPricingRow",
|
|
337
|
-
props: {
|
|
338
|
-
pricing: { type: Object },
|
|
339
|
-
selected: { type: Boolean },
|
|
340
|
-
loading: { type: Boolean }
|
|
341
|
-
},
|
|
342
|
-
emits: ["toggle"],
|
|
343
|
-
setup(__props, { emit: __emit }) {
|
|
344
|
-
const props = __props;
|
|
345
|
-
const emit = __emit;
|
|
346
|
-
const { $t } = useIntl();
|
|
347
|
-
const title = computed(
|
|
348
|
-
() => {
|
|
349
|
-
var _a, _b, _c, _d, _e, _f;
|
|
350
|
-
return props.pricing.name ?? ((_d = (_c = (_b = (_a = props.pricing.items) == null ? void 0 : _a[0]) == null ? void 0 : _b.product_items) == null ? void 0 : _c[0]) == null ? void 0 : _d.name) ?? ((_f = (_e = props.pricing.products) == null ? void 0 : _e[0]) == null ? void 0 : _f.name) ?? "—";
|
|
351
|
-
}
|
|
352
|
-
);
|
|
353
|
-
const price = computed(() => {
|
|
354
|
-
var _a, _b, _c, _d, _e;
|
|
355
|
-
const band = (_e = (_d = (_c = (_b = (_a = props.pricing.items) == null ? void 0 : _a[0]) == null ? void 0 : _b.configs) == null ? void 0 : _c[0]) == null ? void 0 : _d.bands) == null ? void 0 : _e[0];
|
|
356
|
-
return (band == null ? void 0 : band.fixed_amount) ?? (band == null ? void 0 : band.amount);
|
|
357
|
-
});
|
|
358
|
-
const description = computed(
|
|
359
|
-
() => price.value ? `${formatAmount(price.value)} ${$t({
|
|
360
|
-
defaultMessage: "one-off",
|
|
361
|
-
id: "on_demand_pricing_row.one_off_label",
|
|
362
|
-
description: "One-off label shown next to the price in an on-demand pricing row"
|
|
363
|
-
})}` : ""
|
|
364
|
-
);
|
|
365
|
-
return (_ctx, _cache) => {
|
|
366
|
-
return openBlock(), createBlock(unref(_sfc_main$5), {
|
|
367
|
-
"content-background": __props.selected ? "none" : "gray",
|
|
368
|
-
"content-classes": __props.selected ? "!border-primary-600 ring-1 ring-primary-600" : void 0
|
|
369
|
-
}, {
|
|
370
|
-
default: withCtx(() => [
|
|
371
|
-
createVNode(_sfc_main$a, {
|
|
372
|
-
name: title.value,
|
|
373
|
-
description: description.value
|
|
374
|
-
}, {
|
|
375
|
-
default: withCtx(() => [
|
|
376
|
-
__props.selected ? (openBlock(), createBlock(unref(_sfc_main$b), {
|
|
377
|
-
key: 0,
|
|
378
|
-
color: "gray",
|
|
379
|
-
variant: "outline",
|
|
380
|
-
size: "sm",
|
|
381
|
-
"icon-prefix": "remove_shopping_cart",
|
|
382
|
-
loading: __props.loading,
|
|
383
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("toggle", __props.pricing.id))
|
|
384
|
-
}, {
|
|
385
|
-
default: withCtx(() => [
|
|
386
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
387
|
-
defaultMessage: "Remove",
|
|
388
|
-
id: "on_demand_pricing_row.remove_button_label",
|
|
389
|
-
description: "Label for the remove button in an on-demand pricing row"
|
|
390
|
-
})), 1)
|
|
391
|
-
]),
|
|
392
|
-
_: 1
|
|
393
|
-
}, 8, ["loading"])) : (openBlock(), createBlock(unref(_sfc_main$b), {
|
|
394
|
-
key: 1,
|
|
395
|
-
color: "primary",
|
|
396
|
-
size: "sm",
|
|
397
|
-
"icon-prefix": "add",
|
|
398
|
-
loading: __props.loading,
|
|
399
|
-
onClick: _cache[1] || (_cache[1] = ($event) => emit("toggle", __props.pricing.id))
|
|
400
|
-
}, {
|
|
401
|
-
default: withCtx(() => [
|
|
402
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
403
|
-
defaultMessage: "Add to cart",
|
|
404
|
-
id: "on_demand_pricing_row.add_to_cart_button_label",
|
|
405
|
-
description: "Label for the add to cart button in an on-demand pricing row"
|
|
406
|
-
})), 1)
|
|
407
|
-
]),
|
|
408
|
-
_: 1
|
|
409
|
-
}, 8, ["loading"]))
|
|
410
|
-
]),
|
|
411
|
-
_: 1
|
|
412
|
-
}, 8, ["name", "description"])
|
|
413
|
-
]),
|
|
414
|
-
_: 1
|
|
415
|
-
}, 8, ["content-background", "content-classes"]);
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
const _hoisted_1$1 = { class: "sv-pricing-list__items grid grid-cols-1 gap-1" };
|
|
420
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
421
|
-
__name: "OnDemandPricingList",
|
|
422
|
-
props: {
|
|
423
|
-
categories: { type: Array },
|
|
424
|
-
selectedPricingIds: { type: Array },
|
|
425
|
-
loadingPricingId: { type: String }
|
|
426
|
-
},
|
|
427
|
-
emits: ["toggle"],
|
|
428
|
-
setup(__props, { emit: __emit }) {
|
|
429
|
-
const props = __props;
|
|
430
|
-
const emit = __emit;
|
|
431
|
-
const { $t } = useIntl();
|
|
432
|
-
const sortedCategories = computed(
|
|
433
|
-
() => [...props.categories].sort((a, b) => (a.display_order ?? 0) - (b.display_order ?? 0))
|
|
434
|
-
);
|
|
435
|
-
const getCategoryTitle = (category) => {
|
|
436
|
-
var _a;
|
|
437
|
-
return ((_a = category.product_category) == null ? void 0 : _a.name) ?? category.name ?? $t({
|
|
438
|
-
defaultMessage: "Items",
|
|
439
|
-
id: "on_demand_pricing_list.category_fallback_title",
|
|
440
|
-
description: "Fallback title for the selectable pricing items when no product category name is available"
|
|
441
|
-
});
|
|
442
|
-
};
|
|
443
|
-
return (_ctx, _cache) => {
|
|
444
|
-
return openBlock(true), createElementBlock(Fragment, null, renderList(sortedCategories.value, (category) => {
|
|
445
|
-
return openBlock(), createElementBlock("div", {
|
|
446
|
-
key: category.id ?? category.display_order,
|
|
447
|
-
class: "sv-pricing-list__category flex flex-col gap-2"
|
|
448
|
-
}, [
|
|
449
|
-
createVNode(unref(_sfc_main$7), {
|
|
450
|
-
variant: "heading-3",
|
|
451
|
-
tag: "h2",
|
|
452
|
-
class: "sv-pricing-list__category-title"
|
|
453
|
-
}, {
|
|
454
|
-
default: withCtx(() => [
|
|
455
|
-
createTextVNode(toDisplayString(getCategoryTitle(category)), 1)
|
|
456
|
-
]),
|
|
457
|
-
_: 2
|
|
458
|
-
}, 1024),
|
|
459
|
-
createElementVNode("div", _hoisted_1$1, [
|
|
460
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(category.pricings, (pricing) => {
|
|
461
|
-
return openBlock(), createBlock(_sfc_main$3, {
|
|
462
|
-
key: pricing.id,
|
|
463
|
-
class: "sv-pricing-list__row",
|
|
464
|
-
pricing,
|
|
465
|
-
selected: __props.selectedPricingIds.includes(pricing.id),
|
|
466
|
-
loading: __props.loadingPricingId === pricing.id,
|
|
467
|
-
onToggle: _cache[0] || (_cache[0] = ($event) => emit("toggle", $event))
|
|
468
|
-
}, null, 8, ["pricing", "selected", "loading"]);
|
|
469
|
-
}), 128)),
|
|
470
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(category.pricing_groups, (group) => {
|
|
471
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
472
|
-
key: group.id
|
|
473
|
-
}, [
|
|
474
|
-
createVNode(unref(_sfc_main$7), {
|
|
475
|
-
variant: "body-sm",
|
|
476
|
-
weight: "semibold",
|
|
477
|
-
class: "sv-pricing-list__group-title mt-2"
|
|
478
|
-
}, {
|
|
479
|
-
default: withCtx(() => [
|
|
480
|
-
createTextVNode(toDisplayString(group.name), 1)
|
|
481
|
-
]),
|
|
482
|
-
_: 2
|
|
483
|
-
}, 1024),
|
|
484
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(group.pricings, (pricing) => {
|
|
485
|
-
return openBlock(), createBlock(_sfc_main$3, {
|
|
486
|
-
key: pricing.id,
|
|
487
|
-
class: "sv-pricing-list__row",
|
|
488
|
-
pricing,
|
|
489
|
-
selected: __props.selectedPricingIds.includes(pricing.id),
|
|
490
|
-
loading: __props.loadingPricingId === pricing.id,
|
|
491
|
-
onToggle: _cache[1] || (_cache[1] = ($event) => emit("toggle", $event))
|
|
492
|
-
}, null, 8, ["pricing", "selected", "loading"]);
|
|
493
|
-
}), 128))
|
|
494
|
-
], 64);
|
|
495
|
-
}), 128))
|
|
496
|
-
])
|
|
497
|
-
]);
|
|
498
|
-
}), 128);
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
});
|
|
502
|
-
function createPricingPlanSchedulesService() {
|
|
503
|
-
const request = createRequestService();
|
|
504
|
-
const config = useConfig();
|
|
505
|
-
function getOnDemandPricingItems({
|
|
506
|
-
scheduleId
|
|
507
|
-
}) {
|
|
508
|
-
return request({
|
|
509
|
-
url: `${config.apiUrls.config}/portal/pricing-plan-schedules/${scheduleId}/on-demand-pricing-items`
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
function chargeOnDemandPricingItems({
|
|
513
|
-
scheduleId,
|
|
514
|
-
pricingPlanVersionId,
|
|
515
|
-
pricingItemIds,
|
|
516
|
-
startAt,
|
|
517
|
-
finalizeImmediately = true,
|
|
518
|
-
paymentMethodId
|
|
519
|
-
}) {
|
|
520
|
-
return request({
|
|
521
|
-
url: `${config.apiUrls.config}/portal/pricing-plan-schedules/${scheduleId}/charge-on-demand-pricing-items`,
|
|
522
|
-
options: { method: "POST" },
|
|
523
|
-
data: {
|
|
524
|
-
...pricingPlanVersionId ? { pricing_plan_version_id: pricingPlanVersionId } : {},
|
|
525
|
-
pricing_item_ids: pricingItemIds,
|
|
526
|
-
...startAt ? { start_at: startAt } : {},
|
|
527
|
-
finalize_immediately: finalizeImmediately,
|
|
528
|
-
...paymentMethodId ? { payment_method_id: paymentMethodId } : {}
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
return {
|
|
533
|
-
chargeOnDemandPricingItems,
|
|
534
|
-
getOnDemandPricingItems
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
const _hoisted_1 = {
|
|
538
|
-
key: 0,
|
|
539
|
-
class: "sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"
|
|
540
|
-
};
|
|
541
|
-
const _hoisted_2 = { class: "flex flex-col items-center text-center" };
|
|
542
|
-
const _hoisted_3 = { class: "sv-upgrade-subscription__header" };
|
|
543
|
-
const _hoisted_4 = {
|
|
544
|
-
key: 1,
|
|
545
|
-
class: "sv-upgrade-subscription__pricing-list"
|
|
546
|
-
};
|
|
547
|
-
const _hoisted_5 = {
|
|
548
|
-
key: 2,
|
|
549
|
-
class: "sv-upgrade-subscription__loading p-4"
|
|
550
|
-
};
|
|
551
|
-
const _hoisted_6 = { class: "sv-upgrade-subscription__payment-methods" };
|
|
552
|
-
const _hoisted_7 = {
|
|
553
|
-
key: 0,
|
|
554
|
-
class: "sv-upgrade-subscription__payment-methods-body"
|
|
555
|
-
};
|
|
556
|
-
const _hoisted_8 = {
|
|
557
|
-
key: 1,
|
|
558
|
-
class: "sv-upgrade-subscription__payment-form"
|
|
559
|
-
};
|
|
560
|
-
const _hoisted_9 = { class: "sv-upgrade-subscription__order-summary" };
|
|
561
|
-
const _hoisted_10 = { class: "flex flex-col gap-2" };
|
|
562
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
563
|
-
__name: "UpgradeSubscription",
|
|
564
|
-
props: {
|
|
565
|
-
configuration: { type: Object }
|
|
566
|
-
},
|
|
567
|
-
setup(__props) {
|
|
568
|
-
const props = __props;
|
|
569
|
-
const { $t } = useIntl();
|
|
570
|
-
const { getSubscription } = createSubscriptionsService();
|
|
571
|
-
const { getCustomer } = createCustomerService();
|
|
572
|
-
const { getOnDemandPricingItems } = createPricingPlanSchedulesService();
|
|
573
|
-
const { getPaymentMethodOptions } = createPaymentMethodsService();
|
|
574
|
-
const { previewChargeOnDemandPricingItems } = createInvoicesService();
|
|
575
|
-
const portal = usePortal();
|
|
576
|
-
const logger = useLogger();
|
|
577
|
-
const { dispatchAction } = useActionDispatchProvider();
|
|
578
|
-
const { isMobileViewport } = useViewport();
|
|
579
|
-
const customerId = computed(() => portal.value.customer_id);
|
|
580
|
-
const DEFAULT_PAYMENT_FORM_AMOUNT = {
|
|
581
|
-
currency: "EUR",
|
|
582
|
-
quantity: "0"
|
|
583
|
-
};
|
|
584
|
-
const selectedPricingIds = ref([]);
|
|
585
|
-
const isPurchased = ref(false);
|
|
586
|
-
const categories = ref([]);
|
|
587
|
-
const paymentMethodOptions = ref([]);
|
|
588
|
-
const isLoadingItems = ref(false);
|
|
589
|
-
const isPreviewPending = ref(false);
|
|
590
|
-
const isPurchasePending = ref(false);
|
|
591
|
-
const previewPendingPricingId = ref(void 0);
|
|
592
|
-
const loadError = ref(void 0);
|
|
593
|
-
const paymentIntegrationFormRef = ref();
|
|
594
|
-
const activeScheduleId = ref(void 0);
|
|
595
|
-
const previewInvoice = ref(void 0);
|
|
596
|
-
const countryCode = ref(void 0);
|
|
597
|
-
const getActiveSchedule = async () => {
|
|
598
|
-
const subscription = await getSubscription({
|
|
599
|
-
id: props.configuration.subscriptionId,
|
|
600
|
-
expanded: true
|
|
601
|
-
});
|
|
602
|
-
const schedules = subscription.pricing_plan_schedule_infos ?? [];
|
|
603
|
-
const sortedSchedules = [...schedules].sort(
|
|
604
|
-
(a, b) => Date.parse(b.start_at) - Date.parse(a.start_at)
|
|
605
|
-
);
|
|
606
|
-
const now = Date.now();
|
|
607
|
-
const activeSchedule = sortedSchedules.find((schedule) => {
|
|
608
|
-
var _a;
|
|
609
|
-
const scheduleType = ((_a = schedule.pricing_plan_schedule) == null ? void 0 : _a.type) ?? schedule.type;
|
|
610
|
-
const startAt = Date.parse(schedule.start_at);
|
|
611
|
-
const endAt = schedule.end_at ? Date.parse(schedule.end_at) : void 0;
|
|
612
|
-
const hasStarted = Number.isFinite(startAt) && startAt <= now;
|
|
613
|
-
const hasNotEnded = endAt === void 0 || !Number.isFinite(endAt) || endAt > now;
|
|
614
|
-
return scheduleType === "DEFAULT" && hasStarted && hasNotEnded;
|
|
615
|
-
});
|
|
616
|
-
if (!(activeSchedule == null ? void 0 : activeSchedule.id)) {
|
|
617
|
-
throw new Error("No pricing plan schedule found for subscription");
|
|
618
|
-
}
|
|
619
|
-
return activeSchedule;
|
|
620
|
-
};
|
|
621
|
-
const findSourceCategory = (category, sourceCategories) => sourceCategories.find(
|
|
622
|
-
(sourceCategory) => sourceCategory.product_category_id === category.product_category_id
|
|
623
|
-
);
|
|
624
|
-
const findSourcePricing = (pricing, sourcePricings = []) => sourcePricings.find((sourcePricing) => sourcePricing.id === pricing.id);
|
|
625
|
-
const normalizePricingRows = (pricing, sourcePricing) => (pricing.items ?? []).map((item) => {
|
|
626
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
627
|
-
const sourceItem = (_a = sourcePricing == null ? void 0 : sourcePricing.items) == null ? void 0 : _a.find((candidate) => candidate.id === item.id);
|
|
628
|
-
const productItems = item.product_items ?? (sourceItem == null ? void 0 : sourceItem.product_items);
|
|
629
|
-
return {
|
|
630
|
-
...pricing,
|
|
631
|
-
id: item.id,
|
|
632
|
-
name: ((_c = (_b = item.product_items) == null ? void 0 : _b[0]) == null ? void 0 : _c.name) ?? ((_e = (_d = sourceItem == null ? void 0 : sourceItem.product_items) == null ? void 0 : _d[0]) == null ? void 0 : _e.name) ?? pricing.name ?? (sourcePricing == null ? void 0 : sourcePricing.name) ?? ((_g = (_f = sourcePricing == null ? void 0 : sourcePricing.products) == null ? void 0 : _f[0]) == null ? void 0 : _g.name),
|
|
633
|
-
products: pricing.products ?? (sourcePricing == null ? void 0 : sourcePricing.products),
|
|
634
|
-
items: [
|
|
635
|
-
{
|
|
636
|
-
...item,
|
|
637
|
-
product_items: productItems
|
|
638
|
-
}
|
|
639
|
-
]
|
|
640
|
-
};
|
|
641
|
-
});
|
|
642
|
-
const normalizeOnDemandCategories = (categories2, sourceCategories) => categories2.map((category) => {
|
|
643
|
-
var _a;
|
|
644
|
-
const sourceCategory = findSourceCategory(category, sourceCategories);
|
|
645
|
-
return {
|
|
646
|
-
...category,
|
|
647
|
-
name: category.name ?? ((_a = sourceCategory == null ? void 0 : sourceCategory.product_category) == null ? void 0 : _a.name),
|
|
648
|
-
product_category: category.product_category ?? (sourceCategory == null ? void 0 : sourceCategory.product_category),
|
|
649
|
-
pricings: (category.pricings ?? []).flatMap(
|
|
650
|
-
(pricing) => normalizePricingRows(pricing, findSourcePricing(pricing, sourceCategory == null ? void 0 : sourceCategory.pricings))
|
|
651
|
-
),
|
|
652
|
-
pricing_groups: (category.pricing_groups ?? []).map((group) => {
|
|
653
|
-
var _a2;
|
|
654
|
-
const sourceGroup = (_a2 = sourceCategory == null ? void 0 : sourceCategory.pricing_groups) == null ? void 0 : _a2.find(
|
|
655
|
-
(candidate) => candidate.id === group.id
|
|
656
|
-
);
|
|
657
|
-
return {
|
|
658
|
-
...group,
|
|
659
|
-
name: group.name ?? (sourceGroup == null ? void 0 : sourceGroup.name),
|
|
660
|
-
pricings: (group.pricings ?? []).flatMap(
|
|
661
|
-
(pricing) => normalizePricingRows(
|
|
662
|
-
pricing,
|
|
663
|
-
findSourcePricing(pricing, sourceGroup == null ? void 0 : sourceGroup.pricings)
|
|
664
|
-
)
|
|
665
|
-
)
|
|
666
|
-
};
|
|
667
|
-
})
|
|
668
|
-
};
|
|
669
|
-
});
|
|
670
|
-
const loadOnDemandPricingItems = async () => {
|
|
671
|
-
var _a;
|
|
672
|
-
isLoadingItems.value = true;
|
|
673
|
-
loadError.value = void 0;
|
|
674
|
-
try {
|
|
675
|
-
const activeSchedule = await getActiveSchedule();
|
|
676
|
-
activeScheduleId.value = activeSchedule.id;
|
|
677
|
-
const [itemsResponse, optionsResponse, customer] = await Promise.all([
|
|
678
|
-
getOnDemandPricingItems({ scheduleId: activeScheduleId.value }),
|
|
679
|
-
getPaymentMethodOptions({ customerId: customerId.value }),
|
|
680
|
-
getCustomer(customerId.value)
|
|
681
|
-
]);
|
|
682
|
-
categories.value = normalizeOnDemandCategories(
|
|
683
|
-
itemsResponse.pricing_categories ?? [],
|
|
684
|
-
((_a = activeSchedule.pricing_plan_version) == null ? void 0 : _a.pricing_categories) ?? []
|
|
685
|
-
);
|
|
686
|
-
paymentMethodOptions.value = optionsResponse;
|
|
687
|
-
countryCode.value = getCustomerCountry(customer);
|
|
688
|
-
} catch (error) {
|
|
689
|
-
logger.error(
|
|
690
|
-
"INITIAL_DATA_LOAD_FAILED",
|
|
691
|
-
"Failed to load on-demand pricing items",
|
|
692
|
-
{},
|
|
693
|
-
error
|
|
694
|
-
);
|
|
695
|
-
loadError.value = $t({
|
|
696
|
-
defaultMessage: "Unable to load items. Please try again later.",
|
|
697
|
-
id: "upgrade_subscription.load_error",
|
|
698
|
-
description: "Error message shown when the one-off items cannot be loaded on the upgrade subscription page"
|
|
699
|
-
});
|
|
700
|
-
} finally {
|
|
701
|
-
isLoadingItems.value = false;
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
onMounted(() => {
|
|
705
|
-
void loadOnDemandPricingItems();
|
|
706
|
-
});
|
|
707
|
-
const allOnDemandPricings = computed(
|
|
708
|
-
() => categories.value.flatMap((cat) => [
|
|
709
|
-
...cat.pricings ?? [],
|
|
710
|
-
...(cat.pricing_groups ?? []).flatMap((g) => g.pricings ?? [])
|
|
711
|
-
])
|
|
712
|
-
);
|
|
713
|
-
const selectedPricings = computed(
|
|
714
|
-
() => allOnDemandPricings.value.filter((p) => selectedPricingIds.value.includes(p.id))
|
|
715
|
-
);
|
|
716
|
-
const selectedPricingItemIds = computed(
|
|
717
|
-
() => selectedPricings.value.flatMap((pricing) => pricing.items ?? []).map((item) => item.id).filter((id) => !!id)
|
|
718
|
-
);
|
|
719
|
-
const amount = computed(() => {
|
|
720
|
-
var _a, _b;
|
|
721
|
-
return (_b = (_a = previewInvoice.value) == null ? void 0 : _a.tax_summary) == null ? void 0 : _b.total_amount;
|
|
722
|
-
});
|
|
723
|
-
const paymentFormAmount = computed(() => amount.value ?? DEFAULT_PAYMENT_FORM_AMOUNT);
|
|
724
|
-
let previewTimer;
|
|
725
|
-
let previewRequestId = 0;
|
|
726
|
-
watch([selectedPricingItemIds, activeScheduleId], ([pricingItemIds, scheduleId]) => {
|
|
727
|
-
clearTimeout(previewTimer);
|
|
728
|
-
const requestId = ++previewRequestId;
|
|
729
|
-
purchaseError.value = void 0;
|
|
730
|
-
if (!scheduleId || pricingItemIds.length === 0) {
|
|
731
|
-
previewInvoice.value = void 0;
|
|
732
|
-
isPreviewPending.value = false;
|
|
733
|
-
previewPendingPricingId.value = void 0;
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
isPreviewPending.value = true;
|
|
737
|
-
previewTimer = setTimeout(() => {
|
|
738
|
-
previewChargeOnDemandPricingItems({
|
|
739
|
-
pricingPlanScheduleId: scheduleId,
|
|
740
|
-
pricingItemIds
|
|
741
|
-
}).then((invoice) => {
|
|
742
|
-
if (requestId === previewRequestId) {
|
|
743
|
-
previewInvoice.value = invoice;
|
|
744
|
-
}
|
|
745
|
-
}).catch((error) => {
|
|
746
|
-
if (requestId !== previewRequestId) return;
|
|
747
|
-
logger.error(
|
|
748
|
-
"INVOICE_PREVIEW_FAILED",
|
|
749
|
-
"Failed to load charge-on-demand invoice preview",
|
|
750
|
-
{},
|
|
751
|
-
error
|
|
752
|
-
);
|
|
753
|
-
purchaseError.value = $t({
|
|
754
|
-
defaultMessage: "Unable to calculate the total. Please try again.",
|
|
755
|
-
id: "upgrade_subscription.preview_error",
|
|
756
|
-
description: "Error message shown when the upgrade subscription invoice preview cannot be loaded"
|
|
757
|
-
});
|
|
758
|
-
previewInvoice.value = void 0;
|
|
759
|
-
}).finally(() => {
|
|
760
|
-
if (requestId === previewRequestId) {
|
|
761
|
-
isPreviewPending.value = false;
|
|
762
|
-
previewPendingPricingId.value = void 0;
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
}, 400);
|
|
766
|
-
});
|
|
767
|
-
const authorizationContext = computed(() => {
|
|
768
|
-
if (!activeScheduleId.value) {
|
|
769
|
-
throw new Error("Cannot create charge-on-demand authorization context without a schedule.");
|
|
770
|
-
}
|
|
771
|
-
return {
|
|
772
|
-
type: "CHARGE_ON_DEMAND",
|
|
773
|
-
charge_on_demand: {
|
|
774
|
-
pricing_plan_schedule_id: activeScheduleId.value,
|
|
775
|
-
pricing_items: selectedPricingItemIds.value.map((pricingItemId) => ({
|
|
776
|
-
pricing_item_id: pricingItemId
|
|
777
|
-
}))
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
});
|
|
781
|
-
const handleToggle = (pricingId) => {
|
|
782
|
-
previewPendingPricingId.value = pricingId;
|
|
783
|
-
if (selectedPricingIds.value.includes(pricingId)) {
|
|
784
|
-
selectedPricingIds.value = selectedPricingIds.value.filter((id) => id !== pricingId);
|
|
785
|
-
} else {
|
|
786
|
-
selectedPricingIds.value = [...selectedPricingIds.value, pricingId];
|
|
787
|
-
}
|
|
788
|
-
};
|
|
789
|
-
const canPurchase = computed(
|
|
790
|
-
() => selectedPricingItemIds.value.length > 0 && !!activeScheduleId.value && !!amount.value && !isPreviewPending.value && paymentMethodOptions.value.length > 0
|
|
791
|
-
);
|
|
792
|
-
const purchaseError = ref(void 0);
|
|
793
|
-
const handlePurchase = async () => {
|
|
794
|
-
var _a;
|
|
795
|
-
if (!canPurchase.value || isPurchasePending.value) return;
|
|
796
|
-
purchaseError.value = void 0;
|
|
797
|
-
isPurchasePending.value = true;
|
|
798
|
-
(_a = paymentIntegrationFormRef.value) == null ? void 0 : _a.submit();
|
|
799
|
-
};
|
|
800
|
-
const handleValidatePaymentSubmit = async () => canPurchase.value;
|
|
801
|
-
let redirectTimer;
|
|
802
|
-
const handlePaymentSuccess = () => {
|
|
803
|
-
isPurchasePending.value = false;
|
|
804
|
-
isPurchased.value = true;
|
|
805
|
-
redirectTimer = setTimeout(() => {
|
|
806
|
-
dispatchAction({ action: "navigate-to-customer-overview" });
|
|
807
|
-
}, 3e3);
|
|
808
|
-
};
|
|
809
|
-
const handlePaymentFailed = (error) => {
|
|
810
|
-
isPurchasePending.value = false;
|
|
811
|
-
purchaseError.value = error.message || $t({
|
|
812
|
-
defaultMessage: "Something went wrong. Please try again.",
|
|
813
|
-
id: "upgrade_subscription.purchase_error",
|
|
814
|
-
description: "Error message shown when the purchase call fails on the upgrade subscription page"
|
|
815
|
-
});
|
|
816
|
-
};
|
|
817
|
-
onUnmounted(() => {
|
|
818
|
-
clearTimeout(previewTimer);
|
|
819
|
-
clearTimeout(redirectTimer);
|
|
820
|
-
});
|
|
821
|
-
return (_ctx, _cache) => {
|
|
822
|
-
return isPurchased.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
823
|
-
createVNode(_sfc_main$c, {
|
|
824
|
-
class: "sv-upgrade-subscription__success",
|
|
825
|
-
status: "success",
|
|
826
|
-
title: unref($t)({
|
|
827
|
-
defaultMessage: "Payment successful",
|
|
828
|
-
id: "upgrade_subscription.success.title",
|
|
829
|
-
description: "Title shown after a successful upgrade purchase"
|
|
830
|
-
})
|
|
831
|
-
}, {
|
|
832
|
-
default: withCtx(() => [
|
|
833
|
-
createElementVNode("div", _hoisted_2, [
|
|
834
|
-
createVNode(unref(_sfc_main$7), {
|
|
835
|
-
variant: "body-sm",
|
|
836
|
-
shade: "lighter",
|
|
837
|
-
tag: "div",
|
|
838
|
-
class: "sv-upgrade-subscription__success-message mt-1"
|
|
839
|
-
}, {
|
|
840
|
-
default: withCtx(() => [
|
|
841
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
842
|
-
defaultMessage: "Your purchase has been completed.",
|
|
843
|
-
id: "upgrade_subscription.success.subtitle",
|
|
844
|
-
description: "Subtitle shown after a successful upgrade purchase"
|
|
845
|
-
})), 1)
|
|
846
|
-
]),
|
|
847
|
-
_: 1
|
|
848
|
-
}),
|
|
849
|
-
createVNode(unref(_sfc_main$7), {
|
|
850
|
-
variant: "body-sm",
|
|
851
|
-
shade: "lighter",
|
|
852
|
-
tag: "div",
|
|
853
|
-
class: "sv-upgrade-subscription__success-redirect mt-1"
|
|
854
|
-
}, {
|
|
855
|
-
default: withCtx(() => [
|
|
856
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
857
|
-
defaultMessage: "You will be redirected shortly…",
|
|
858
|
-
id: "upgrade_subscription.success.redirect",
|
|
859
|
-
description: "Shown below the success message while the redirect timer is running"
|
|
860
|
-
})), 1)
|
|
861
|
-
]),
|
|
862
|
-
_: 1
|
|
863
|
-
})
|
|
864
|
-
])
|
|
865
|
-
]),
|
|
866
|
-
_: 1
|
|
867
|
-
}, 8, ["title"])
|
|
868
|
-
])) : (openBlock(), createBlock(unref(ContentWithAsideLayout), {
|
|
869
|
-
key: 1,
|
|
870
|
-
class: "sv-upgrade-subscription sv-root sv-screen"
|
|
871
|
-
}, {
|
|
872
|
-
header: withCtx(() => [
|
|
873
|
-
createElementVNode("div", _hoisted_3, [
|
|
874
|
-
createVNode(unref(_sfc_main$7), {
|
|
875
|
-
variant: "heading-2",
|
|
876
|
-
tag: "h1",
|
|
877
|
-
class: "sv-upgrade-subscription__title"
|
|
878
|
-
}, {
|
|
879
|
-
default: withCtx(() => [
|
|
880
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
881
|
-
defaultMessage: "Upgrade subscription",
|
|
882
|
-
id: "upgrade_subscription.title",
|
|
883
|
-
description: "Title for the upgrade subscription page"
|
|
884
|
-
})), 1)
|
|
885
|
-
]),
|
|
886
|
-
_: 1
|
|
887
|
-
})
|
|
888
|
-
])
|
|
889
|
-
]),
|
|
890
|
-
content: withCtx(() => [
|
|
891
|
-
unref(isMobileViewport) ? (openBlock(), createBlock(_sfc_main$4, {
|
|
892
|
-
key: 0,
|
|
893
|
-
class: "sv-upgrade-subscription__mobile-order-summary",
|
|
894
|
-
"selected-pricings": selectedPricings.value,
|
|
895
|
-
invoice: previewInvoice.value,
|
|
896
|
-
loading: isPreviewPending.value
|
|
897
|
-
}, null, 8, ["selected-pricings", "invoice", "loading"])) : createCommentVNode("", true),
|
|
898
|
-
!isLoadingItems.value && !loadError.value && categories.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
899
|
-
createVNode(_sfc_main$2, {
|
|
900
|
-
categories: categories.value,
|
|
901
|
-
"selected-pricing-ids": selectedPricingIds.value,
|
|
902
|
-
"loading-pricing-id": previewPendingPricingId.value,
|
|
903
|
-
onToggle: handleToggle
|
|
904
|
-
}, null, 8, ["categories", "selected-pricing-ids", "loading-pricing-id"])
|
|
905
|
-
])) : isLoadingItems.value ? (openBlock(), createElementBlock("div", _hoisted_5, [..._cache[0] || (_cache[0] = [
|
|
906
|
-
createElementVNode("div", { class: "sv-skeleton h-[72px] animate-pulse rounded-md bg-gray-100" }, null, -1),
|
|
907
|
-
createElementVNode("div", { class: "sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100" }, null, -1),
|
|
908
|
-
createElementVNode("div", { class: "sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100" }, null, -1)
|
|
909
|
-
])])) : loadError.value ? (openBlock(), createBlock(unref(_sfc_main$e), {
|
|
910
|
-
key: 3,
|
|
911
|
-
class: "sv-upgrade-subscription__load-error sv-error m-4",
|
|
912
|
-
title: loadError.value
|
|
913
|
-
}, null, 8, ["title"])) : (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
914
|
-
key: 4,
|
|
915
|
-
variant: "body-sm",
|
|
916
|
-
shade: "lighter",
|
|
917
|
-
class: "sv-upgrade-subscription__empty-state p-4"
|
|
918
|
-
}, {
|
|
919
|
-
default: withCtx(() => [
|
|
920
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
921
|
-
defaultMessage: "No one-off items are available for this subscription.",
|
|
922
|
-
id: "upgrade_subscription.empty_state",
|
|
923
|
-
description: "Shown when there are no one-off items available for the subscription"
|
|
924
|
-
})), 1)
|
|
925
|
-
]),
|
|
926
|
-
_: 1
|
|
927
|
-
})),
|
|
928
|
-
createElementVNode("div", _hoisted_6, [
|
|
929
|
-
createVNode(_sfc_main$d, {
|
|
930
|
-
variant: "section",
|
|
931
|
-
class: "min-h-[130px]"
|
|
932
|
-
}, {
|
|
933
|
-
default: withCtx(() => [
|
|
934
|
-
!isLoadingItems.value || isLoadingItems.value && paymentMethodOptions.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
935
|
-
createVNode(unref(_sfc_main$7), {
|
|
936
|
-
variant: "heading-3",
|
|
937
|
-
tag: "h2",
|
|
938
|
-
class: "sv-upgrade-subscription__payment-methods-title mb-2"
|
|
939
|
-
}, {
|
|
940
|
-
default: withCtx(() => [
|
|
941
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
942
|
-
defaultMessage: "Payment method",
|
|
943
|
-
id: "upgrade_subscription.payment_method_block.title",
|
|
944
|
-
description: "The title of the payment method block in the upgrade subscription flow"
|
|
945
|
-
})), 1)
|
|
946
|
-
]),
|
|
947
|
-
_: 1
|
|
948
|
-
}),
|
|
949
|
-
paymentMethodOptions.value.length === 0 ? (openBlock(), createBlock(_sfc_main$g, {
|
|
950
|
-
key: 0,
|
|
951
|
-
class: "sv-upgrade-subscription__payment-methods-empty",
|
|
952
|
-
icon: "credit_card_off"
|
|
953
|
-
}, {
|
|
954
|
-
title: withCtx(() => [
|
|
955
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
956
|
-
defaultMessage: "No payment methods available",
|
|
957
|
-
id: "upgrade_subscription.payment_method_block.no_payment_methods_available_title",
|
|
958
|
-
description: "The title shown when there are no available payment methods"
|
|
959
|
-
})), 1)
|
|
960
|
-
]),
|
|
961
|
-
message: withCtx(() => [
|
|
962
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
963
|
-
defaultMessage: "There are no available payment methods. Please contact support for more information.",
|
|
964
|
-
id: "upgrade_subscription.payment_method_block.no_payment_methods_available_message",
|
|
965
|
-
description: "The message shown when there are no available payment methods"
|
|
966
|
-
})), 1)
|
|
967
|
-
]),
|
|
968
|
-
_: 1
|
|
969
|
-
})) : countryCode.value && activeScheduleId.value ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
970
|
-
createElementVNode("div", {
|
|
971
|
-
class: normalizeClass(["sv-upgrade-subscription__payment-method-picker", { "pointer-events-none opacity-60": isPurchasePending.value }])
|
|
972
|
-
}, [
|
|
973
|
-
createVNode(_sfc_main$h, {
|
|
974
|
-
ref_key: "paymentIntegrationFormRef",
|
|
975
|
-
ref: paymentIntegrationFormRef,
|
|
976
|
-
"customer-id": customerId.value,
|
|
977
|
-
"country-code": countryCode.value,
|
|
978
|
-
context: authorizationContext.value,
|
|
979
|
-
amount: paymentFormAmount.value,
|
|
980
|
-
variant: "AUTHORIZE",
|
|
981
|
-
"payment-method-options": paymentMethodOptions.value,
|
|
982
|
-
"validate-on-submit": handleValidatePaymentSubmit,
|
|
983
|
-
"force-store-payment-method": "",
|
|
984
|
-
onPaymentSuccess: handlePaymentSuccess,
|
|
985
|
-
onPaymentFailed: handlePaymentFailed
|
|
986
|
-
}, null, 8, ["customer-id", "country-code", "context", "amount", "payment-method-options"])
|
|
987
|
-
], 2)
|
|
988
|
-
])) : createCommentVNode("", true)
|
|
989
|
-
])) : createCommentVNode("", true)
|
|
990
|
-
]),
|
|
991
|
-
_: 1
|
|
992
|
-
})
|
|
993
|
-
])
|
|
994
|
-
]),
|
|
995
|
-
aside: withCtx(() => [
|
|
996
|
-
createElementVNode("div", _hoisted_9, [
|
|
997
|
-
createVNode(_sfc_main$d, {
|
|
998
|
-
variant: "section",
|
|
999
|
-
class: "min-h-[220px]"
|
|
1000
|
-
}, {
|
|
1001
|
-
default: withCtx(() => [
|
|
1002
|
-
createVNode(_sfc_main$4, {
|
|
1003
|
-
"selected-pricings": selectedPricings.value,
|
|
1004
|
-
invoice: previewInvoice.value,
|
|
1005
|
-
loading: isPreviewPending.value
|
|
1006
|
-
}, null, 8, ["selected-pricings", "invoice", "loading"])
|
|
1007
|
-
]),
|
|
1008
|
-
_: 1
|
|
1009
|
-
})
|
|
1010
|
-
]),
|
|
1011
|
-
purchaseError.value ? (openBlock(), createBlock(unref(_sfc_main$e), {
|
|
1012
|
-
key: 0,
|
|
1013
|
-
class: "sv-upgrade-subscription__error sv-error",
|
|
1014
|
-
title: purchaseError.value
|
|
1015
|
-
}, null, 8, ["title"])) : createCommentVNode("", true),
|
|
1016
|
-
createElementVNode("div", _hoisted_10, [
|
|
1017
|
-
createVNode(_sfc_main$d, { class: "sv-upgrade-subscription__submit-skeleton min-h-[44px]" }, {
|
|
1018
|
-
default: withCtx(() => [
|
|
1019
|
-
createVNode(unref(_sfc_main$b), {
|
|
1020
|
-
size: "lg",
|
|
1021
|
-
class: "sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase w-full",
|
|
1022
|
-
type: "button",
|
|
1023
|
-
disabled: !canPurchase.value || isPurchasePending.value,
|
|
1024
|
-
loading: isPurchasePending.value,
|
|
1025
|
-
onClick: handlePurchase
|
|
1026
|
-
}, {
|
|
1027
|
-
default: withCtx(() => [
|
|
1028
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
1029
|
-
defaultMessage: "Purchase",
|
|
1030
|
-
id: "upgrade_subscription.purchase_button.label",
|
|
1031
|
-
description: "Label for the purchase button on the upgrade subscription page"
|
|
1032
|
-
})), 1)
|
|
1033
|
-
]),
|
|
1034
|
-
_: 1
|
|
1035
|
-
}, 8, ["disabled", "loading"])
|
|
1036
|
-
]),
|
|
1037
|
-
_: 1
|
|
1038
|
-
}),
|
|
1039
|
-
createVNode(_sfc_main$f, { "payment-method-options": paymentMethodOptions.value }, null, 8, ["payment-method-options"])
|
|
1040
|
-
])
|
|
1041
|
-
]),
|
|
1042
|
-
_: 1
|
|
1043
|
-
}));
|
|
1044
|
-
};
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1048
|
-
__name: "UpgradeSubscription.entry",
|
|
1049
|
-
props: {
|
|
1050
|
-
environment: { type: String },
|
|
1051
|
-
locale: { type: String },
|
|
1052
|
-
dateLocale: { type: String },
|
|
1053
|
-
messages: { type: Object },
|
|
1054
|
-
primaryColor: { type: String },
|
|
1055
|
-
secondaryColor: { type: String },
|
|
1056
|
-
isShadowRoot: { type: Boolean },
|
|
1057
|
-
experimentalFeatures: { type: Array },
|
|
1058
|
-
logLevel: { type: String },
|
|
1059
|
-
onLog: { type: Function },
|
|
1060
|
-
allowedPortalTypes: { type: Array },
|
|
1061
|
-
portalObject: { type: Object },
|
|
1062
|
-
cssOverrides: { type: [String, Array] },
|
|
1063
|
-
branding: { type: Object },
|
|
1064
|
-
configuration: { type: Object }
|
|
1065
|
-
},
|
|
1066
|
-
setup(__props) {
|
|
1067
|
-
return (_ctx, _cache) => {
|
|
1068
|
-
var _a, _b, _c, _d;
|
|
1069
|
-
return openBlock(), createBlock(_sfc_main$i, {
|
|
1070
|
-
"custom-element-name": unref(COMPONENT_NAME),
|
|
1071
|
-
environment: __props.environment,
|
|
1072
|
-
locale: __props.locale,
|
|
1073
|
-
"portal-object": __props.portalObject,
|
|
1074
|
-
"allowed-portal-types": ["CUSTOMER"],
|
|
1075
|
-
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
1076
|
-
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
1077
|
-
"experimental-features": __props.experimentalFeatures,
|
|
1078
|
-
"log-level": __props.logLevel,
|
|
1079
|
-
"on-log": __props.onLog,
|
|
1080
|
-
"css-overrides": __props.cssOverrides,
|
|
1081
|
-
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
1082
|
-
}, {
|
|
1083
|
-
default: withCtx(() => [
|
|
1084
|
-
createVNode(_sfc_main$1, { configuration: __props.configuration }, null, 8, ["configuration"])
|
|
1085
|
-
]),
|
|
1086
|
-
_: 1
|
|
1087
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
const SolvimonUpgradeSubscription = defineCustomElement(_sfc_main);
|
|
1092
|
-
const COMPONENT_NAME = getComponentName("upgrade-subscription");
|
|
1093
|
-
const defineSolvimonUpgradeSubscription = () => {
|
|
1094
|
-
if (!customElements.get(COMPONENT_NAME)) {
|
|
1095
|
-
customElements.define(COMPONENT_NAME, SolvimonUpgradeSubscription);
|
|
1096
|
-
}
|
|
1097
|
-
};
|
|
1098
|
-
export {
|
|
1099
|
-
COMPONENT_NAME,
|
|
1100
|
-
SolvimonUpgradeSubscription,
|
|
1101
|
-
defineSolvimonUpgradeSubscription
|
|
1102
|
-
};
|