@solvimon/solvimon-web 0.1.0-alpha.29 → 0.1.0-alpha.30
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 +12 -2
- package/dist/{Alert.vue.es-CNrEaLvh.mjs → Alert.vue.es-ZPG49yR_.mjs} +1 -1
- package/dist/{AuthProvider.handle-DKfNs8rr.mjs → AuthProvider.handle-SRR_04XS.mjs} +1 -1
- package/dist/{Avatar.vue.es-r0NbcIib.mjs → Avatar.vue.es-geDQsZwu.mjs} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-Cp4yGqaw.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-nqKbgY7G.mjs} +4 -4
- package/dist/{Button.vue.es-Zw--kuaU.mjs → Button.vue.es-j7iYlqtJ.mjs} +1 -1
- package/dist/{ChargeOnDemandModal-B8FDkS9U.mjs → ChargeOnDemandModal-CR01PkP_.mjs} +14 -14
- package/dist/{Checkout.entry.ce-DsGl-5aR.mjs → Checkout.entry.ce-CopWuLJC.mjs} +1784 -1817
- package/dist/{CheckoutAddressFields.vue_vue_type_script_setup_true_lang-2D8VM_7W.mjs → CheckoutAddressFields.vue_vue_type_script_setup_true_lang-CEnM1uxK.mjs} +7 -7
- package/dist/{Chip.vue.es-D3UDSyXC.mjs → Chip.vue.es-Dxx_0dte.mjs} +2 -2
- package/dist/{ContextMenu.vue.es-B9mFpUQK.mjs → ContextMenu.vue.es-BJO4U47Q.mjs} +5 -5
- package/dist/{CustomerBillingInformation.vue.es-B8NiQaJs.mjs → CustomerBillingInformation.vue.es-CmNpqcBw.mjs} +2 -2
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DBivC5Eb.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Jyb5ZN3s.mjs} +5 -5
- package/dist/{CustomerShippingAddresses-Bj8Y17O8.mjs → CustomerShippingAddresses-BRPukhRI.mjs} +8 -8
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BmPKfIjT.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DJnr5D56.mjs} +434 -425
- package/dist/{DividerText.vue.es-CNbgif-3.mjs → DividerText.vue.es-BusbyeAI.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CVP-7ne3.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-wPma8Os-.mjs} +3 -3
- package/dist/{ErrorNotification.vue.es-DNd65mQq.mjs → ErrorNotification.vue.es-F068p7PY.mjs} +2 -2
- package/dist/{FormMessage.vue.es-Cjv358Ab.mjs → FormMessage.vue.es-CwMQpIAW.mjs} +1 -1
- package/dist/{IconButton.vue.es-C8lYFx5_.mjs → IconButton.vue.es-D8DtBW9i.mjs} +2 -2
- package/dist/{IconTitle.vue.es-O2kcqgKm.mjs → IconTitle.vue.es-6VJtjJX2.mjs} +3 -3
- package/dist/{Input.vue.es-D8Oj8MWv.mjs → Input.vue.es-BLyHcmu4.mjs} +4 -4
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-rhqYVdfV.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dl1vTzQD.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-06R-M8Q3.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DYskT3r7.mjs} +4 -4
- package/dist/{InvoicePreview.vue.es-4Q2hzaFS.mjs → InvoicePreview.vue.es-Cpf66_xV.mjs} +4 -4
- package/dist/{InvoicePricingClauseChip.vue.es-DKU0xu0t.mjs → InvoicePricingClauseChip.vue.es-CDrAE901.mjs} +3 -3
- package/dist/{Label.vue.es-DtpLM1KH.mjs → Label.vue.es-es7ZUBSP.mjs} +3 -3
- package/dist/{Modal.vue.es-C8ZcO117.mjs → Modal.vue.es-eeR9FmvQ.mjs} +6 -6
- package/dist/{OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-3DQLCR3U.mjs → OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-B_FpibLA.mjs} +5 -5
- package/dist/{PaymentCompletedCard.vue_vue_type_script_setup_true_lang-DfTb9psX.mjs → PaymentCompletedCard.vue_vue_type_script_setup_true_lang-CrjVPks0.mjs} +2 -2
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-BoGTtg5G.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-DyjzaTK1.mjs} +4 -4
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BIAm22Kq.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BHQrWy6r.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-BvY2nXGV.mjs → PaymentHistoryBlock-CN42ewCn.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-bQKhUonq.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3Y5fHvA.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-CcfQSzKM.mjs → PaymentIntegrationForm-D3Ye7LZ5.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvzcLJVq.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D07SEP8a.mjs} +5 -5
- package/dist/{PaymentIntegrationFormAdyen-DqgDfO6K.mjs → PaymentIntegrationFormAdyen-Fm-diCCO.mjs} +39 -38
- package/dist/{PaymentIntegrationFormStripe-BYdAkvLt.mjs → PaymentIntegrationFormStripe-BANBL6za.mjs} +14 -13
- package/dist/{PaymentMethod.vue.es-b0p3a0L-.mjs → PaymentMethod.vue.es-t3-VyoE8.mjs} +4 -4
- package/dist/{PaymentMethodForm-BsTrTwCg.mjs → PaymentMethodForm-CqP3GoNj.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-sUOmLORl.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-CMRMbL3d.mjs} +6 -6
- package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DsnAhR79.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-D5wmRuCf.mjs} +6 -6
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CSW4LfmH.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DhkkiJaQ.mjs} +7 -7
- package/dist/PlanCustomizationEditor-B76UNEMm.mjs +791 -0
- package/dist/{PortalLinkUnverified-B_EE2wTJ.mjs → PortalLinkUnverified-Cp60_kRJ.mjs} +3 -3
- package/dist/{PortalNotAvailable-DPE9y37H.mjs → PortalNotAvailable-DzSQnfzw.mjs} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-tIMXIhpZ.mjs → PricingGroupRangeInput.vue.es-Srq_3cga.mjs} +156 -206
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs +177 -0
- package/dist/{RadioGroupExtended.vue.es-3nDXqIGi.mjs → RadioGroupExtended.vue.es-BbBMDf6l.mjs} +5 -5
- package/dist/{Section.vue.es-CvX9tg2f.mjs → Section.vue.es-Oqn1wGPZ.mjs} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cl7I1Apo.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-OM19NPBh.mjs} +2 -2
- package/dist/{ShippingAddressesModal-C4p1IXXk.mjs → ShippingAddressesModal-c7nqf4Ny.mjs} +10 -10
- package/dist/StepInput.vue.es-ieh4EuJ7.mjs +213 -0
- package/dist/{SubscriptionDetails.entry.ce-D5SwM0YS.mjs → SubscriptionDetails.entry.ce-uYv45FGH.mjs} +91 -92
- package/dist/{SubscriptionSchedules-BZqlpAtk.mjs → SubscriptionSchedules-DMxX3GpK.mjs} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BH7DdOWK.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DXro_64f.mjs} +1736 -1721
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-BZNsqN4G.mjs} +4 -4
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BbjdBHSQ.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-CHlXP_2x.mjs} +9 -9
- package/dist/{TooltipParagraph.vue.es-Dw0ndjle.mjs → TooltipParagraph.vue.es-BES3zsYN.mjs} +1 -1
- package/dist/{TranslationOverride.vue_vue_type_script_setup_true_lang-BhjZVMSx.mjs → TranslationOverride.vue_vue_type_script_setup_true_lang-BJmlNrXT.mjs} +1 -1
- package/dist/{TrialChip.vue.es-DOopmaXA.mjs → TrialChip.vue.es-C51z1ZiA.mjs} +2 -2
- package/dist/addonQuantity-CCVaA3e-.mjs +758 -0
- package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +8 -8
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
- package/dist/components/Invoice/Invoice.mjs +14 -14
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
- package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.mjs +4 -4
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
- package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
- package/dist/core/index.mjs +1 -1
- package/dist/{customElements-BTj4ii4f.mjs → customElements-DK4GKNJG.mjs} +10 -10
- package/dist/{customer-BIjC0CWJ.mjs → customer-lf6S5DBR.mjs} +1 -1
- package/dist/{de-DE-DBbERiFr.mjs → de-DE-Cyj_NtiI.mjs} +4 -0
- package/dist/{fr-FR-IWJE-urI.mjs → fr-FR-CRFoWQ7J.mjs} +4 -0
- package/dist/{index.es-C7J3WGGo.mjs → index.es-BrVTOW5D.mjs} +4 -4
- package/dist/index.mjs +2 -2
- package/dist/{invoices-e1sKLgxg.mjs → invoices-DdREPDXV.mjs} +1 -1
- package/dist/{it-IT-B7ui2oxO.mjs → it-IT-DObZEc-U.mjs} +4 -0
- package/dist/{nl-NL-Bafh2xoT.mjs → nl-NL-C02xHilF.mjs} +4 -0
- package/dist/paymentFailure-QZdZHBhf.mjs +47 -0
- package/dist/{paymentMethods-B_82JGk_.mjs → paymentMethods-8w-ccfY_.mjs} +1 -1
- package/dist/{paymentMethods-Nfv9HdkS.mjs → paymentMethods-Goa25rTs.mjs} +2 -2
- package/dist/paymentOutcome-B6sW1eCV.mjs +22 -0
- package/dist/{payments-BnxbzQUC.mjs → payments-CKpU1K3t.mjs} +1 -1
- package/dist/{pricing-BOhvWWMj.mjs → pricing-CEaZGgKe.mjs} +1 -1
- package/dist/pricingItem.es-bCPArbTa.mjs +55 -0
- package/dist/{pricingPlanScheduleOverrides-Dxv5FOBd.mjs → pricingPlanScheduleOverrides-BBp-DmpV.mjs} +2 -2
- package/dist/{pricingPlanSchedules-Dv7ZCgNp.mjs → pricingPlanSchedules-DSMptcAh.mjs} +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +13 -13
- package/dist/screens/PayInvoice/PayInvoice.mjs +33 -32
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +10 -10
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +172 -163
- package/dist/{sorting.es-CVyKw23D.mjs → sorting.es-C0pdMgX0.mjs} +1 -1
- package/dist/subscription-BwzkagDI.mjs +212 -0
- package/dist/{subscriptions-BWXZGK0E.mjs → subscriptions-B5bH8hsI.mjs} +1 -1
- package/dist/{taxId.es-DkD3Ltr8.mjs → taxId.es-e6NEvprh.mjs} +2 -2
- package/dist/types/public/core/configuration.d.ts +0 -1
- package/dist/types/public/core/types.d.ts +10 -5
- package/dist/{useActionDispatchProvider-3W2vEyIg.mjs → useActionDispatchProvider-ChAHdwR8.mjs} +1 -1
- package/dist/{useCustomer-cObBvDOu.mjs → useCustomer-CTMhg1nd.mjs} +2 -2
- package/dist/{useCustomerFormLabels-DJWf2O17.mjs → useCustomerFormLabels-D4oDnfxA.mjs} +9 -9
- package/dist/{useIncrementalLoading-CATuO36d.mjs → useIncrementalLoading-CBVutPH8.mjs} +1 -1
- package/dist/{useInvoiceData-DD44HTl7.mjs → useInvoiceData-qUGbBAQK.mjs} +2 -2
- package/dist/{useInvoicesList-CpB-41MQ.mjs → useInvoicesList-wJvZAJpW.mjs} +9 -9
- package/dist/{useLoadInitialData-qzdnBoui.mjs → useLoadInitialData-UvfYXgbi.mjs} +1 -1
- package/dist/{usePaymentFormHold-ByUZi3A-.mjs → usePaymentFormHold-Cwdr-vyc.mjs} +2 -2
- package/dist/{usePaymentMethodAvailability-DUdrs0Ji.mjs → usePaymentMethodAvailability-35l4pWdH.mjs} +4 -4
- package/dist/{usePaymentMethods-ByaKF7mf.mjs → usePaymentMethods-De7hlLHo.mjs} +2 -2
- package/dist/{usePayments-BXABv-lF.mjs → usePayments-hWS7fnOx.mjs} +9 -9
- package/dist/{usePortal-CwR_FxTb.mjs → usePortal-DUfD6hrA.mjs} +1 -1
- package/dist/{useService-BZcbUZHI.mjs → useService-BwzIBIRp.mjs} +1 -1
- package/dist/{useTimePeriod.es-BpdiVwg8.mjs → useTimePeriod.es-BUorDLVK.mjs} +1 -1
- package/package.json +4 -4
- package/dist/PlanCustomizationEditor-D29N4HUM.mjs +0 -711
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DqxWxSQe.mjs +0 -141
- package/dist/StepInput.vue.es-DweyzpkL.mjs +0 -200
- package/dist/index.es-CpmQmvOg.mjs +0 -633
- package/dist/paymentOutcome-BXEU5-84.mjs +0 -67
- package/dist/pricingPlanSchedule-BPrS2WRd.mjs +0 -132
- package/dist/subscription-BhxoqwcT.mjs +0 -83
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
import { defineComponent as E, computed as y, openBlock as l, createElementBlock as k, createVNode as V, unref as t, withCtx as v, Fragment as N, createTextVNode as P, toDisplayString as M, renderList as F, createBlock as _, useModel as w, ref as ne, createElementVNode as T, normalizeClass as j, createCommentVNode as S, mergeModels as q, toRef as D, watch as se, isRef as K } from "vue";
|
|
2
|
+
import { _ as O } from "./Section.vue.es-Oqn1wGPZ.mjs";
|
|
3
|
+
import { a as C, d as I } from "./customElements-DK4GKNJG.mjs";
|
|
4
|
+
import { u as Z } from "./useTimePeriod.es-BUorDLVK.mjs";
|
|
5
|
+
import { f as R } from "./formatting.es-RclXHhKo.mjs";
|
|
6
|
+
import { _ as le } from "./Expand.vue.es-BleuAfDz.mjs";
|
|
7
|
+
import { a as oe, _ as X } from "./Button.vue.es-j7iYlqtJ.mjs";
|
|
8
|
+
import { _ as Q } from "./StepInput.vue.es-ieh4EuJ7.mjs";
|
|
9
|
+
import { a as re, F as G, b as ue, c as H, s as J, d as de, e as ce } from "./addonQuantity-CCVaA3e-.mjs";
|
|
10
|
+
import { a as Y, u as ee, _ as me } from "./PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs";
|
|
11
|
+
import { _ as pe } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-BZNsqN4G.mjs";
|
|
12
|
+
import { _ as te } from "./Checkout.entry.ce-CopWuLJC.mjs";
|
|
13
|
+
import { g as ie, a as ge } from "./pricing-CEaZGgKe.mjs";
|
|
14
|
+
import { a as L } from "./useService-BwzIBIRp.mjs";
|
|
15
|
+
import { i as fe, h as ve } from "./subscription-BwzkagDI.mjs";
|
|
16
|
+
const be = { class: "grid grid-cols-2 gap-2" }, _e = /* @__PURE__ */ E({
|
|
17
|
+
__name: "TieredTableRow",
|
|
18
|
+
props: {
|
|
19
|
+
band: { type: Object },
|
|
20
|
+
previousBand: { type: Object },
|
|
21
|
+
isFirst: { type: Boolean },
|
|
22
|
+
period: { type: Object }
|
|
23
|
+
},
|
|
24
|
+
setup(e) {
|
|
25
|
+
const o = e, { $t: i } = C(), { formatTimePeriod: r } = Z(), u = y(() => {
|
|
26
|
+
var d;
|
|
27
|
+
if (o.isFirst)
|
|
28
|
+
return "0";
|
|
29
|
+
if ((d = o.previousBand) != null && d.tier_top_bound && "number" in o.previousBand.tier_top_bound)
|
|
30
|
+
return o.previousBand.tier_top_bound.number;
|
|
31
|
+
}), c = y(() => {
|
|
32
|
+
if (!(!o.band.tier_top_bound || !("number" in o.band.tier_top_bound)))
|
|
33
|
+
return o.band.tier_top_bound.number;
|
|
34
|
+
});
|
|
35
|
+
return (d, n) => (l(), k("div", be, [
|
|
36
|
+
V(t(I), {
|
|
37
|
+
variant: "body-xs",
|
|
38
|
+
color: "subtle",
|
|
39
|
+
tag: "div"
|
|
40
|
+
}, {
|
|
41
|
+
default: v(() => [
|
|
42
|
+
c.value ? (l(), k(N, { key: 0 }, [
|
|
43
|
+
P(M(t(i)(
|
|
44
|
+
{
|
|
45
|
+
defaultMessage: "{lower_bound} - {upper_bound} seats",
|
|
46
|
+
id: "seats.tiered_range_label",
|
|
47
|
+
description: "The label showing the seat count range for a tiered pricing tier"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
lower_bound: u.value ?? "0",
|
|
51
|
+
upper_bound: c.value
|
|
52
|
+
}
|
|
53
|
+
)), 1)
|
|
54
|
+
], 64)) : (l(), k(N, { key: 1 }, [
|
|
55
|
+
P(M(t(i)(
|
|
56
|
+
{
|
|
57
|
+
defaultMessage: "> {lower_bound} seats",
|
|
58
|
+
id: "seats.tiered_unbounded_range_label",
|
|
59
|
+
description: "The label showing the unbounded seat count range (greater than) for a tiered pricing tier"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
lower_bound: u.value ?? "0"
|
|
63
|
+
}
|
|
64
|
+
)), 1)
|
|
65
|
+
], 64))
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
}),
|
|
69
|
+
V(t(I), {
|
|
70
|
+
variant: "body-xs",
|
|
71
|
+
color: "subtle",
|
|
72
|
+
tag: "div",
|
|
73
|
+
class: "text-right"
|
|
74
|
+
}, {
|
|
75
|
+
default: v(() => [
|
|
76
|
+
P(M(e.band.amount && t(i)(
|
|
77
|
+
{
|
|
78
|
+
defaultMessage: "{amount} per seat/{period}",
|
|
79
|
+
id: "seats.tiered_price_per_seat_period",
|
|
80
|
+
description: "The price per seat and billing period label for a tiered pricing tier"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
amount: t(R)(e.band.amount),
|
|
84
|
+
period: e.period ? t(r)(e.period, {
|
|
85
|
+
short: !0,
|
|
86
|
+
hideValueForExactPeriods: !0
|
|
87
|
+
}) : ""
|
|
88
|
+
}
|
|
89
|
+
)), 1)
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
})
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
}), ye = { class: "grid grid-cols-1 gap-0.5 pt-1.5" }, Ve = /* @__PURE__ */ E({
|
|
96
|
+
__name: "TieredTable",
|
|
97
|
+
props: {
|
|
98
|
+
bands: { type: Array },
|
|
99
|
+
period: { type: Object }
|
|
100
|
+
},
|
|
101
|
+
setup(e) {
|
|
102
|
+
return (o, i) => (l(), k("div", ye, [
|
|
103
|
+
(l(!0), k(N, null, F(e.bands, (r, u) => (l(), _(_e, {
|
|
104
|
+
key: u,
|
|
105
|
+
band: r,
|
|
106
|
+
"is-first": u === 0,
|
|
107
|
+
"previous-band": u > 0 ? e.bands[u - 1] : void 0,
|
|
108
|
+
period: e.period
|
|
109
|
+
}, null, 8, ["band", "is-first", "previous-band", "period"]))), 128))
|
|
110
|
+
]));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
function ae({
|
|
114
|
+
pricings: e,
|
|
115
|
+
pricingItemConfigId: o
|
|
116
|
+
}) {
|
|
117
|
+
return y(() => {
|
|
118
|
+
var u, c, d, n, s, m, g, $;
|
|
119
|
+
const { config: i, productItem: r } = re({
|
|
120
|
+
pricings: e,
|
|
121
|
+
pricingItemConfigId: o
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
billing: {
|
|
125
|
+
period: (c = (u = i == null ? void 0 : i.billing_period_configs) == null ? void 0 : u[0]) == null ? void 0 : c.billing_period,
|
|
126
|
+
billedInAdvance: i == null ? void 0 : i.billing_in_advance
|
|
127
|
+
},
|
|
128
|
+
product: {
|
|
129
|
+
name: r == null ? void 0 : r.name,
|
|
130
|
+
description: r == null ? void 0 : r.description
|
|
131
|
+
},
|
|
132
|
+
pricing: {
|
|
133
|
+
...((d = i == null ? void 0 : i.details) == null ? void 0 : d.pricing_type) === "FLAT" && {
|
|
134
|
+
amount: (m = (s = (n = i.details) == null ? void 0 : n.bands) == null ? void 0 : s[0]) == null ? void 0 : m.amount
|
|
135
|
+
},
|
|
136
|
+
...((g = i == null ? void 0 : i.details) == null ? void 0 : g.pricing_type) === "TIERED" && {
|
|
137
|
+
tiered: { bands: ($ = i.details) == null ? void 0 : $.bands }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const he = { class: "flex flex-row-reverse gap-4 md:flex-row" }, ke = { class: "w-24 shrink-0 justify-start md:w-32" }, Pe = ["tabindex"], Me = { key: 0 }, $e = { key: 0 }, Ae = /* @__PURE__ */ E({
|
|
144
|
+
__name: "SeatsEditorItem",
|
|
145
|
+
props: /* @__PURE__ */ q({
|
|
146
|
+
modelValue: { type: Object },
|
|
147
|
+
defaultValue: { type: Object },
|
|
148
|
+
pricings: { type: Array }
|
|
149
|
+
}, {
|
|
150
|
+
modelValue: { required: !0 },
|
|
151
|
+
modelModifiers: {}
|
|
152
|
+
}),
|
|
153
|
+
emits: ["update:modelValue"],
|
|
154
|
+
setup(e) {
|
|
155
|
+
const o = e, i = w(e, "modelValue"), { $t: r } = C(), { formatTimePeriod: u } = Z(), c = ne(!1), d = y({
|
|
156
|
+
get: () => +(i.value.number || G),
|
|
157
|
+
set(m) {
|
|
158
|
+
i.value = {
|
|
159
|
+
...i.value,
|
|
160
|
+
number: m !== void 0 ? m.toString() : void 0
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}), n = ae({
|
|
164
|
+
pricings: o.pricings,
|
|
165
|
+
pricingItemConfigId: i.value.pricing_item_config_id
|
|
166
|
+
}), s = y(() => {
|
|
167
|
+
var m, g;
|
|
168
|
+
return !!((g = (m = n.value.pricing) == null ? void 0 : m.tiered) != null && g.bands);
|
|
169
|
+
});
|
|
170
|
+
return (m, g) => {
|
|
171
|
+
var $, U, z;
|
|
172
|
+
return l(), k("div", null, [
|
|
173
|
+
T("div", he, [
|
|
174
|
+
T("div", ke, [
|
|
175
|
+
V(t(Q), {
|
|
176
|
+
modelValue: d.value,
|
|
177
|
+
"onUpdate:modelValue": g[0] || (g[0] = (x) => d.value = x),
|
|
178
|
+
size: "sm",
|
|
179
|
+
min: ($ = e.defaultValue) != null && $.number ? +e.defaultValue.number : void 0
|
|
180
|
+
}, null, 8, ["modelValue", "min"])
|
|
181
|
+
]),
|
|
182
|
+
T("div", {
|
|
183
|
+
class: j(["flex grow flex-col", { "hover:cursor-pointer": s.value }]),
|
|
184
|
+
tabindex: s.value ? 0 : void 0,
|
|
185
|
+
onClick: g[1] || (g[1] = (x) => s.value ? c.value = !c.value : void 0)
|
|
186
|
+
}, [
|
|
187
|
+
V(t(I), {
|
|
188
|
+
tag: "span",
|
|
189
|
+
variant: "body-sm",
|
|
190
|
+
weight: "semibold"
|
|
191
|
+
}, {
|
|
192
|
+
default: v(() => [
|
|
193
|
+
P(M(t(n).product.name || t(r)({
|
|
194
|
+
defaultMessage: "Seats",
|
|
195
|
+
id: "seats.label",
|
|
196
|
+
description: "The label for the seats input field"
|
|
197
|
+
})), 1)
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
}),
|
|
201
|
+
t(n).pricing.amount ? (l(), _(t(I), {
|
|
202
|
+
key: 0,
|
|
203
|
+
tag: "span",
|
|
204
|
+
variant: "body-xs",
|
|
205
|
+
color: "subtle"
|
|
206
|
+
}, {
|
|
207
|
+
default: v(() => [
|
|
208
|
+
P(M(t(r)(
|
|
209
|
+
{
|
|
210
|
+
defaultMessage: "{amount} per seat/{period}",
|
|
211
|
+
id: "seats.price_per_seat_period",
|
|
212
|
+
description: "The price per seat and billing period label for seat-based pricing"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
amount: t(R)(t(n).pricing.amount),
|
|
216
|
+
period: t(n).billing.period ? t(u)(t(n).billing.period, {
|
|
217
|
+
short: !0,
|
|
218
|
+
hideValueForExactPeriods: !0
|
|
219
|
+
}) : ""
|
|
220
|
+
}
|
|
221
|
+
)), 1)
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
})) : t(n).pricing.tiered ? (l(), _(t(I), {
|
|
225
|
+
key: 1,
|
|
226
|
+
tag: "span",
|
|
227
|
+
variant: "body-xs",
|
|
228
|
+
color: "subtle"
|
|
229
|
+
}, {
|
|
230
|
+
default: v(() => [
|
|
231
|
+
P(M(t(r)({
|
|
232
|
+
defaultMessage: "Tiered pricing",
|
|
233
|
+
id: "seats.tiered_pricing_label",
|
|
234
|
+
description: "The label indicating tiered pricing structure for seats"
|
|
235
|
+
})) + " ", 1),
|
|
236
|
+
V(t(oe), {
|
|
237
|
+
icon: "keyboard_arrow_down",
|
|
238
|
+
size: "xs",
|
|
239
|
+
class: j(["absolute text-gray-400 transition ease-in-out", { "rotate-0": !c.value, "rotate-180": c.value }])
|
|
240
|
+
}, null, 8, ["class"])
|
|
241
|
+
]),
|
|
242
|
+
_: 1
|
|
243
|
+
})) : S("", !0)
|
|
244
|
+
], 10, Pe)
|
|
245
|
+
]),
|
|
246
|
+
(z = (U = t(n).pricing) == null ? void 0 : U.tiered) != null && z.bands ? (l(), k("div", Me, [
|
|
247
|
+
V(t(le), { "is-open": c.value }, {
|
|
248
|
+
default: v(() => [
|
|
249
|
+
c.value ? (l(), k("div", $e, [
|
|
250
|
+
V(Ve, {
|
|
251
|
+
bands: t(n).pricing.tiered.bands,
|
|
252
|
+
period: t(n).billing.period
|
|
253
|
+
}, null, 8, ["bands", "period"])
|
|
254
|
+
])) : S("", !0)
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 8, ["is-open"])
|
|
258
|
+
])) : S("", !0)
|
|
259
|
+
]);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}), Te = {
|
|
263
|
+
key: 0,
|
|
264
|
+
class: "grid grid-cols-1 gap-1"
|
|
265
|
+
}, Ue = /* @__PURE__ */ E({
|
|
266
|
+
__name: "SeatsEditor",
|
|
267
|
+
props: /* @__PURE__ */ q({
|
|
268
|
+
modelValue: { type: Array },
|
|
269
|
+
initialSeatsValues: { type: Array },
|
|
270
|
+
pricings: { type: Array }
|
|
271
|
+
}, {
|
|
272
|
+
modelValue: { required: !0 },
|
|
273
|
+
modelModifiers: {}
|
|
274
|
+
}),
|
|
275
|
+
emits: ["update:modelValue"],
|
|
276
|
+
setup(e) {
|
|
277
|
+
const o = e, i = w(e, "modelValue"), r = (c) => y({
|
|
278
|
+
get: () => i.value[c],
|
|
279
|
+
set: (d) => {
|
|
280
|
+
const n = i.value.slice();
|
|
281
|
+
n[c] = d, i.value = n;
|
|
282
|
+
}
|
|
283
|
+
}), u = (c) => {
|
|
284
|
+
var d;
|
|
285
|
+
return (d = o.initialSeatsValues) == null ? void 0 : d.find(
|
|
286
|
+
(n) => n.pricing_item_config_id === c.pricing_item_config_id
|
|
287
|
+
);
|
|
288
|
+
};
|
|
289
|
+
return (c, d) => e.modelValue.length > 0 ? (l(), k("div", Te, [
|
|
290
|
+
(l(!0), k(N, null, F(e.modelValue, (n, s) => (l(), _(t(O), { key: s }, {
|
|
291
|
+
default: v(() => [
|
|
292
|
+
n.pricing_item_config_id ? (l(), _(Ae, {
|
|
293
|
+
key: n.pricing_item_config_id,
|
|
294
|
+
modelValue: r(s).value,
|
|
295
|
+
"onUpdate:modelValue": (m) => r(s).value = m,
|
|
296
|
+
"default-value": u(n),
|
|
297
|
+
pricings: e.pricings
|
|
298
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "default-value", "pricings"])) : S("", !0)
|
|
299
|
+
]),
|
|
300
|
+
_: 2
|
|
301
|
+
}, 1024))), 128))
|
|
302
|
+
])) : S("", !0);
|
|
303
|
+
}
|
|
304
|
+
}), we = { class: "flex flex-row-reverse gap-4 md:flex-row" }, Se = { class: "w-24 shrink-0 justify-start md:w-32" }, xe = { class: "flex grow flex-col" }, Ne = /* @__PURE__ */ E({
|
|
305
|
+
__name: "UnitsEditorItem",
|
|
306
|
+
props: /* @__PURE__ */ q({
|
|
307
|
+
modelValue: { type: Object },
|
|
308
|
+
defaultValue: { type: Object },
|
|
309
|
+
pricings: { type: Array }
|
|
310
|
+
}, {
|
|
311
|
+
modelValue: { required: !0 },
|
|
312
|
+
modelModifiers: {}
|
|
313
|
+
}),
|
|
314
|
+
emits: ["update:modelValue"],
|
|
315
|
+
setup(e) {
|
|
316
|
+
const o = e, i = w(e, "modelValue"), { $t: r } = C(), u = y({
|
|
317
|
+
get: () => +(i.value.number || G),
|
|
318
|
+
set(d) {
|
|
319
|
+
i.value = {
|
|
320
|
+
...i.value,
|
|
321
|
+
number: d !== void 0 ? d.toString() : void 0
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}), c = ae({
|
|
325
|
+
pricings: o.pricings,
|
|
326
|
+
pricingItemConfigId: i.value.pricing_item_config_id
|
|
327
|
+
});
|
|
328
|
+
return (d, n) => {
|
|
329
|
+
var s;
|
|
330
|
+
return l(), k("div", we, [
|
|
331
|
+
T("div", Se, [
|
|
332
|
+
V(t(Q), {
|
|
333
|
+
modelValue: u.value,
|
|
334
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => u.value = m),
|
|
335
|
+
size: "sm",
|
|
336
|
+
min: (s = e.defaultValue) != null && s.number ? +e.defaultValue.number : void 0
|
|
337
|
+
}, null, 8, ["modelValue", "min"])
|
|
338
|
+
]),
|
|
339
|
+
T("div", xe, [
|
|
340
|
+
V(t(I), {
|
|
341
|
+
tag: "span",
|
|
342
|
+
variant: "body-sm",
|
|
343
|
+
weight: "semibold"
|
|
344
|
+
}, {
|
|
345
|
+
default: v(() => [
|
|
346
|
+
P(M(t(c).product.name || t(r)({
|
|
347
|
+
defaultMessage: "Units",
|
|
348
|
+
id: "units.label",
|
|
349
|
+
description: "The label for the one-off flat item units input field"
|
|
350
|
+
})), 1)
|
|
351
|
+
]),
|
|
352
|
+
_: 1
|
|
353
|
+
}),
|
|
354
|
+
t(c).pricing.amount ? (l(), _(t(I), {
|
|
355
|
+
key: 0,
|
|
356
|
+
tag: "span",
|
|
357
|
+
variant: "body-xs",
|
|
358
|
+
color: "subtle"
|
|
359
|
+
}, {
|
|
360
|
+
default: v(() => [
|
|
361
|
+
P(M(t(r)(
|
|
362
|
+
{
|
|
363
|
+
defaultMessage: "{amount} per unit, one-time",
|
|
364
|
+
id: "units.price_per_unit_one_time",
|
|
365
|
+
description: "The price per unit label for a one-off flat item, which is charged once rather than every period"
|
|
366
|
+
},
|
|
367
|
+
{ amount: t(R)(t(c).pricing.amount) }
|
|
368
|
+
)), 1)
|
|
369
|
+
]),
|
|
370
|
+
_: 1
|
|
371
|
+
})) : S("", !0)
|
|
372
|
+
])
|
|
373
|
+
]);
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}), Ee = { class: "grid grid-cols-1 gap-1 p-1" }, ze = { class: "grid grid-cols-1 gap-1" }, Oe = /* @__PURE__ */ E({
|
|
377
|
+
__name: "UnitsEditor",
|
|
378
|
+
props: /* @__PURE__ */ q({
|
|
379
|
+
modelValue: { type: Array },
|
|
380
|
+
initialUnitsValues: { type: Array },
|
|
381
|
+
pricings: { type: Array }
|
|
382
|
+
}, {
|
|
383
|
+
modelValue: { required: !0 },
|
|
384
|
+
modelModifiers: {}
|
|
385
|
+
}),
|
|
386
|
+
emits: ["update:modelValue"],
|
|
387
|
+
setup(e) {
|
|
388
|
+
const o = e, { $t: i } = C(), r = w(e, "modelValue"), u = (d) => y({
|
|
389
|
+
get: () => r.value[d],
|
|
390
|
+
set: (n) => {
|
|
391
|
+
const s = r.value.slice();
|
|
392
|
+
s[d] = n, r.value = s;
|
|
393
|
+
}
|
|
394
|
+
}), c = (d) => {
|
|
395
|
+
var n;
|
|
396
|
+
return (n = o.initialUnitsValues) == null ? void 0 : n.find(
|
|
397
|
+
(s) => s.pricing_item_config_id === d.pricing_item_config_id
|
|
398
|
+
);
|
|
399
|
+
};
|
|
400
|
+
return (d, n) => e.modelValue.length > 0 ? (l(), _(t(O), {
|
|
401
|
+
key: 0,
|
|
402
|
+
"no-spacing": "",
|
|
403
|
+
"content-background": "gray"
|
|
404
|
+
}, {
|
|
405
|
+
default: v(() => [
|
|
406
|
+
T("div", Ee, [
|
|
407
|
+
V(Y, null, {
|
|
408
|
+
title: v(() => [
|
|
409
|
+
P(M(t(i)({
|
|
410
|
+
defaultMessage: "One-time items",
|
|
411
|
+
id: "units_editor.title",
|
|
412
|
+
description: "The heading above the one-off items in the plan customization form"
|
|
413
|
+
})), 1)
|
|
414
|
+
]),
|
|
415
|
+
description: v(() => [
|
|
416
|
+
P(M(t(i)({
|
|
417
|
+
defaultMessage: "Charged once",
|
|
418
|
+
id: "units_editor.description",
|
|
419
|
+
description: "The description of the one-off items in the plan customization form"
|
|
420
|
+
})), 1)
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}),
|
|
424
|
+
T("div", ze, [
|
|
425
|
+
(l(!0), k(N, null, F(e.modelValue, (s, m) => (l(), _(t(O), {
|
|
426
|
+
key: m,
|
|
427
|
+
"content-background": "none"
|
|
428
|
+
}, {
|
|
429
|
+
default: v(() => [
|
|
430
|
+
s.pricing_item_config_id ? (l(), _(Ne, {
|
|
431
|
+
key: s.pricing_item_config_id,
|
|
432
|
+
modelValue: u(m).value,
|
|
433
|
+
"onUpdate:modelValue": (g) => u(m).value = g,
|
|
434
|
+
"default-value": c(s),
|
|
435
|
+
pricings: e.pricings
|
|
436
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "default-value", "pricings"])) : S("", !0)
|
|
437
|
+
]),
|
|
438
|
+
_: 2
|
|
439
|
+
}, 1024))), 128))
|
|
440
|
+
])
|
|
441
|
+
])
|
|
442
|
+
]),
|
|
443
|
+
_: 1
|
|
444
|
+
})) : S("", !0);
|
|
445
|
+
}
|
|
446
|
+
}), Ie = { class: "p-1" }, qe = { class: "grid grid-cols-1 gap-1 pt-1" }, Ce = /* @__PURE__ */ E({
|
|
447
|
+
__name: "AddonSingleEditor",
|
|
448
|
+
props: /* @__PURE__ */ q({
|
|
449
|
+
modelValue: { type: Array },
|
|
450
|
+
pricings: { type: Array },
|
|
451
|
+
billingPeriod: { type: Object },
|
|
452
|
+
currency: { type: String },
|
|
453
|
+
groupName: { type: String }
|
|
454
|
+
}, {
|
|
455
|
+
modelValue: { required: !0 },
|
|
456
|
+
modelModifiers: {}
|
|
457
|
+
}),
|
|
458
|
+
emits: ["update:modelValue"],
|
|
459
|
+
setup(e) {
|
|
460
|
+
const o = e, i = w(e, "modelValue"), { $t: r } = C(), { describePricing: u } = ee({
|
|
461
|
+
currency: D(o, "currency"),
|
|
462
|
+
billingPeriod: D(o, "billingPeriod")
|
|
463
|
+
}), c = o.pricings.map((s) => s.id), d = (s) => o.modelValue.includes(s), n = (s) => {
|
|
464
|
+
if (d(s))
|
|
465
|
+
i.value = i.value.filter((m) => m !== s);
|
|
466
|
+
else {
|
|
467
|
+
const m = i.value.filter((g) => !c.includes(g));
|
|
468
|
+
i.value = [...m, s];
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
return (s, m) => (l(), _(t(O), { "no-spacing": "" }, {
|
|
472
|
+
default: v(() => [
|
|
473
|
+
T("div", Ie, [
|
|
474
|
+
V(Y, null, {
|
|
475
|
+
title: v(() => [
|
|
476
|
+
P(M(e.groupName), 1)
|
|
477
|
+
]),
|
|
478
|
+
description: v(() => [
|
|
479
|
+
P(M(t(r)({
|
|
480
|
+
defaultMessage: "Select up to one product",
|
|
481
|
+
id: "addon_single_editor.description.at_most_one",
|
|
482
|
+
description: "The description of the addon single editor for at most one product"
|
|
483
|
+
})), 1)
|
|
484
|
+
]),
|
|
485
|
+
_: 1
|
|
486
|
+
}),
|
|
487
|
+
T("div", qe, [
|
|
488
|
+
(l(!0), k(N, null, F(e.pricings, (g) => (l(), _(t(O), {
|
|
489
|
+
key: g.id,
|
|
490
|
+
"content-background": "none",
|
|
491
|
+
class: j({ "!bg-white": d(g.id) })
|
|
492
|
+
}, {
|
|
493
|
+
default: v(() => [
|
|
494
|
+
V(te, {
|
|
495
|
+
name: t(ie)(g) ?? "",
|
|
496
|
+
description: t(u)(g)
|
|
497
|
+
}, {
|
|
498
|
+
default: v(() => [
|
|
499
|
+
V(t(pe), {
|
|
500
|
+
"model-value": d(g.id),
|
|
501
|
+
size: "sm",
|
|
502
|
+
"onUpdate:modelValue": ($) => n(g.id)
|
|
503
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
504
|
+
]),
|
|
505
|
+
_: 2
|
|
506
|
+
}, 1032, ["name", "description"])
|
|
507
|
+
]),
|
|
508
|
+
_: 2
|
|
509
|
+
}, 1032, ["class"]))), 128))
|
|
510
|
+
])
|
|
511
|
+
])
|
|
512
|
+
]),
|
|
513
|
+
_: 1
|
|
514
|
+
}));
|
|
515
|
+
}
|
|
516
|
+
}), Fe = { class: "grid grid-cols-1 gap-1" }, je = {
|
|
517
|
+
key: 0,
|
|
518
|
+
class: "w-24 shrink-0 md:w-32"
|
|
519
|
+
}, W = /* @__PURE__ */ E({
|
|
520
|
+
__name: "AddonMultipleEditor",
|
|
521
|
+
props: /* @__PURE__ */ q({
|
|
522
|
+
modelValue: { type: Array },
|
|
523
|
+
pricings: { type: Array },
|
|
524
|
+
billingPeriod: { type: Object },
|
|
525
|
+
currency: { type: String },
|
|
526
|
+
groupName: { type: String },
|
|
527
|
+
quantityPricingIds: { type: Array }
|
|
528
|
+
}, {
|
|
529
|
+
modelValue: { required: !0 },
|
|
530
|
+
modelModifiers: {},
|
|
531
|
+
seatsValues: { default: () => [] },
|
|
532
|
+
seatsValuesModifiers: {},
|
|
533
|
+
unitsValues: { default: () => [] },
|
|
534
|
+
unitsValuesModifiers: {}
|
|
535
|
+
}),
|
|
536
|
+
emits: ["update:modelValue", "update:seatsValues", "update:unitsValues"],
|
|
537
|
+
setup(e) {
|
|
538
|
+
const o = e, i = w(e, "modelValue"), r = w(e, "seatsValues"), u = w(e, "unitsValues"), { $t: c } = C(), { describePricing: d } = ee({
|
|
539
|
+
currency: D(o, "currency"),
|
|
540
|
+
billingPeriod: D(o, "billingPeriod")
|
|
541
|
+
}), n = (a) => i.value.includes(a), s = () => ({
|
|
542
|
+
enabledPricingIds: i.value,
|
|
543
|
+
seatsValues: r.value,
|
|
544
|
+
unitsValues: u.value
|
|
545
|
+
}), m = y(() => ({ currency: o.currency, billingPeriod: o.billingPeriod })), g = y(
|
|
546
|
+
() => o.pricings.filter((a) => {
|
|
547
|
+
var A;
|
|
548
|
+
return (A = o.quantityPricingIds) == null ? void 0 : A.includes(a.id);
|
|
549
|
+
})
|
|
550
|
+
), $ = y(
|
|
551
|
+
() => new Map(
|
|
552
|
+
g.value.map((a) => [
|
|
553
|
+
a.id,
|
|
554
|
+
ue(a, m.value)
|
|
555
|
+
])
|
|
556
|
+
)
|
|
557
|
+
), U = (a) => $.value.get(a.id) ?? 1, z = (a) => H(a, s()) ?? U(a), x = (a) => {
|
|
558
|
+
L(i.value, a.enabledPricingIds) || (i.value = a.enabledPricingIds), L(r.value, a.seatsValues) || (r.value = a.seatsValues), L(u.value, a.unitsValues) || (u.value = a.unitsValues);
|
|
559
|
+
}, h = (a, A) => x(J(a, A, s(), m.value)), f = (a, A) => {
|
|
560
|
+
A >= U(a) && h(a, A);
|
|
561
|
+
};
|
|
562
|
+
se(
|
|
563
|
+
() => g.value.filter(
|
|
564
|
+
(a) => H(a, s()) === void 0
|
|
565
|
+
),
|
|
566
|
+
(a) => {
|
|
567
|
+
a.length && x(
|
|
568
|
+
a.reduce(
|
|
569
|
+
(A, b) => J(b, U(b), A, m.value),
|
|
570
|
+
s()
|
|
571
|
+
)
|
|
572
|
+
);
|
|
573
|
+
},
|
|
574
|
+
{ immediate: !0 }
|
|
575
|
+
);
|
|
576
|
+
const p = (a) => {
|
|
577
|
+
n(a) ? i.value = i.value.filter((A) => A !== a) : i.value = [...i.value, a];
|
|
578
|
+
};
|
|
579
|
+
return (a, A) => (l(), _(t(O), {
|
|
580
|
+
"no-spacing": "",
|
|
581
|
+
"no-border": !e.groupName,
|
|
582
|
+
"content-background": e.groupName ? "gray" : "none"
|
|
583
|
+
}, {
|
|
584
|
+
default: v(() => [
|
|
585
|
+
T("div", {
|
|
586
|
+
class: j(["grid grid-cols-1 gap-1", { "p-1": e.groupName }])
|
|
587
|
+
}, [
|
|
588
|
+
e.groupName ? (l(), _(Y, { key: 0 }, {
|
|
589
|
+
title: v(() => [
|
|
590
|
+
P(M(e.groupName), 1)
|
|
591
|
+
]),
|
|
592
|
+
description: v(() => [
|
|
593
|
+
P(M(t(c)({
|
|
594
|
+
defaultMessage: "Select any number of products",
|
|
595
|
+
id: "addon_multiple_editor.description",
|
|
596
|
+
description: "The description of the addon multiple editor"
|
|
597
|
+
})), 1)
|
|
598
|
+
]),
|
|
599
|
+
_: 1
|
|
600
|
+
})) : S("", !0),
|
|
601
|
+
T("div", Fe, [
|
|
602
|
+
(l(!0), k(N, null, F(e.pricings, (b) => (l(), _(t(O), {
|
|
603
|
+
key: b.id,
|
|
604
|
+
"content-background": e.groupName || n(b.id) ? "none" : "gray",
|
|
605
|
+
class: j({ "!bg-white": n(b.id) })
|
|
606
|
+
}, {
|
|
607
|
+
default: v(() => [
|
|
608
|
+
V(te, {
|
|
609
|
+
name: t(ie)(b) ?? "",
|
|
610
|
+
description: t(d)(b)
|
|
611
|
+
}, {
|
|
612
|
+
default: v(() => [
|
|
613
|
+
$.value.has(b.id) && n(b.id) ? (l(), k("div", je, [
|
|
614
|
+
V(t(Q), {
|
|
615
|
+
"model-value": z(b),
|
|
616
|
+
size: "sm",
|
|
617
|
+
min: U(b),
|
|
618
|
+
removable: "",
|
|
619
|
+
"onUpdate:modelValue": (B) => f(b, B),
|
|
620
|
+
onRemove: (B) => h(b, 0)
|
|
621
|
+
}, null, 8, ["model-value", "min", "onUpdate:modelValue", "onRemove"])
|
|
622
|
+
])) : n(b.id) ? (l(), _(t(X), {
|
|
623
|
+
key: 1,
|
|
624
|
+
intent: "secondary",
|
|
625
|
+
square: "",
|
|
626
|
+
size: "sm",
|
|
627
|
+
"icon-prefix": "remove_shopping_cart",
|
|
628
|
+
onClick: (B) => p(b.id)
|
|
629
|
+
}, null, 8, ["onClick"])) : (l(), _(t(X), {
|
|
630
|
+
key: 2,
|
|
631
|
+
intent: "primary",
|
|
632
|
+
"icon-prefix": "add",
|
|
633
|
+
size: "sm",
|
|
634
|
+
onClick: (B) => $.value.has(b.id) ? h(b, U(b)) : p(b.id)
|
|
635
|
+
}, {
|
|
636
|
+
default: v(() => [
|
|
637
|
+
P(M(t(c)({
|
|
638
|
+
defaultMessage: "Add to subscription",
|
|
639
|
+
id: "addon_multiple_editor.add_to_subscription_button",
|
|
640
|
+
description: "The button to add a pricing to the subscription"
|
|
641
|
+
})), 1)
|
|
642
|
+
]),
|
|
643
|
+
_: 1
|
|
644
|
+
}, 8, ["onClick"]))
|
|
645
|
+
]),
|
|
646
|
+
_: 2
|
|
647
|
+
}, 1032, ["name", "description"])
|
|
648
|
+
]),
|
|
649
|
+
_: 2
|
|
650
|
+
}, 1032, ["content-background", "class"]))), 128))
|
|
651
|
+
])
|
|
652
|
+
], 2)
|
|
653
|
+
]),
|
|
654
|
+
_: 1
|
|
655
|
+
}, 8, ["no-border", "content-background"]));
|
|
656
|
+
}
|
|
657
|
+
}), Be = { class: "sv-plan-customization__body grid grid-cols-1 gap-1" }, at = /* @__PURE__ */ E({
|
|
658
|
+
__name: "PlanCustomizationEditor",
|
|
659
|
+
props: /* @__PURE__ */ q({
|
|
660
|
+
subscription: { type: Object },
|
|
661
|
+
enabledPricingIds: { type: Array },
|
|
662
|
+
initialSeatsValues: { type: Array },
|
|
663
|
+
initialUnitsValues: { type: Array },
|
|
664
|
+
billingPeriod: { type: Object },
|
|
665
|
+
currency: { type: String }
|
|
666
|
+
}, {
|
|
667
|
+
seatsValues: { required: !0 },
|
|
668
|
+
seatsValuesModifiers: {},
|
|
669
|
+
unitsValues: { required: !0 },
|
|
670
|
+
unitsValuesModifiers: {},
|
|
671
|
+
enabledPricingIds: {
|
|
672
|
+
required: !0
|
|
673
|
+
},
|
|
674
|
+
enabledPricingIdsModifiers: {}
|
|
675
|
+
}),
|
|
676
|
+
emits: ["update:seatsValues", "update:unitsValues", "update:enabledPricingIds"],
|
|
677
|
+
setup(e) {
|
|
678
|
+
const o = e, i = w(e, "seatsValues"), r = w(e, "unitsValues"), u = w(e, "enabledPricingIds"), { $t: c } = C(), d = y(() => {
|
|
679
|
+
const h = fe({
|
|
680
|
+
pricingPlanScheduleInfos: o.subscription.pricing_plan_schedule_infos,
|
|
681
|
+
type: "DEFAULT"
|
|
682
|
+
});
|
|
683
|
+
return h != null && h.pricing_plan_version ? ge(h) : [];
|
|
684
|
+
}), n = y(
|
|
685
|
+
() => d.value.filter((h) => h.product_type === "ADDON")
|
|
686
|
+
), s = y(
|
|
687
|
+
() => ve(o.subscription)
|
|
688
|
+
), m = y(
|
|
689
|
+
() => de(o.subscription, [
|
|
690
|
+
...o.initialSeatsValues ?? [],
|
|
691
|
+
...o.initialUnitsValues ?? []
|
|
692
|
+
])
|
|
693
|
+
), g = y(() => m.value.map(({ id: h }) => h)), $ = y(() => ce(m.value)), U = (h) => y({
|
|
694
|
+
get: () => h.value.filter(
|
|
695
|
+
({ pricing_item_config_id: f }) => !$.value.has(f)
|
|
696
|
+
),
|
|
697
|
+
set: (f) => {
|
|
698
|
+
h.value = [
|
|
699
|
+
...f,
|
|
700
|
+
...h.value.filter(
|
|
701
|
+
({ pricing_item_config_id: p }) => $.value.has(p)
|
|
702
|
+
)
|
|
703
|
+
];
|
|
704
|
+
}
|
|
705
|
+
}), z = U(i), x = U(r);
|
|
706
|
+
return (h, f) => (l(), _(t(O), {
|
|
707
|
+
class: "sv-plan-customization",
|
|
708
|
+
title: t(c)({
|
|
709
|
+
defaultMessage: "Customize plan",
|
|
710
|
+
id: "checkout.customize_plan_block.title",
|
|
711
|
+
description: "The title of the customize plan block in the checkout form"
|
|
712
|
+
}),
|
|
713
|
+
"no-spacing": "",
|
|
714
|
+
"no-border": "",
|
|
715
|
+
"content-background": "none"
|
|
716
|
+
}, {
|
|
717
|
+
default: v(() => [
|
|
718
|
+
T("div", Be, [
|
|
719
|
+
V(Ue, {
|
|
720
|
+
modelValue: t(z),
|
|
721
|
+
"onUpdate:modelValue": f[0] || (f[0] = (p) => K(z) ? z.value = p : null),
|
|
722
|
+
class: "sv-plan-customization__seats",
|
|
723
|
+
"initial-seats-values": e.initialSeatsValues,
|
|
724
|
+
pricings: d.value
|
|
725
|
+
}, null, 8, ["modelValue", "initial-seats-values", "pricings"]),
|
|
726
|
+
V(Oe, {
|
|
727
|
+
modelValue: t(x),
|
|
728
|
+
"onUpdate:modelValue": f[1] || (f[1] = (p) => K(x) ? x.value = p : null),
|
|
729
|
+
class: "sv-plan-customization__units",
|
|
730
|
+
"initial-units-values": e.initialUnitsValues,
|
|
731
|
+
pricings: d.value
|
|
732
|
+
}, null, 8, ["modelValue", "initial-units-values", "pricings"]),
|
|
733
|
+
(l(!0), k(N, null, F(s.value, (p) => (l(), k(N, {
|
|
734
|
+
key: p.id
|
|
735
|
+
}, [
|
|
736
|
+
p.product_type === "DEFAULT" && p.selection_constraint === "EXACTLY_ONE" ? (l(), _(me, {
|
|
737
|
+
key: 0,
|
|
738
|
+
modelValue: u.value,
|
|
739
|
+
"onUpdate:modelValue": f[2] || (f[2] = (a) => u.value = a),
|
|
740
|
+
class: "sv-plan-customization__group",
|
|
741
|
+
"group-name": p.name,
|
|
742
|
+
pricings: p.pricings,
|
|
743
|
+
"billing-period": e.billingPeriod,
|
|
744
|
+
currency: e.currency
|
|
745
|
+
}, null, 8, ["modelValue", "group-name", "pricings", "billing-period", "currency"])) : p.product_type === "ADDON" && p.selection_constraint === "AT_MOST_ONE" ? (l(), _(Ce, {
|
|
746
|
+
key: 1,
|
|
747
|
+
modelValue: u.value,
|
|
748
|
+
"onUpdate:modelValue": f[3] || (f[3] = (a) => u.value = a),
|
|
749
|
+
class: "sv-plan-customization__group",
|
|
750
|
+
"group-name": p.name,
|
|
751
|
+
pricings: p.pricings,
|
|
752
|
+
"billing-period": e.billingPeriod,
|
|
753
|
+
currency: e.currency
|
|
754
|
+
}, null, 8, ["modelValue", "group-name", "pricings", "billing-period", "currency"])) : p.product_type === "ADDON" && p.selection_constraint === "ANY" ? (l(), _(W, {
|
|
755
|
+
key: 2,
|
|
756
|
+
modelValue: u.value,
|
|
757
|
+
"onUpdate:modelValue": f[4] || (f[4] = (a) => u.value = a),
|
|
758
|
+
"seats-values": i.value,
|
|
759
|
+
"onUpdate:seatsValues": f[5] || (f[5] = (a) => i.value = a),
|
|
760
|
+
"units-values": r.value,
|
|
761
|
+
"onUpdate:unitsValues": f[6] || (f[6] = (a) => r.value = a),
|
|
762
|
+
"quantity-pricing-ids": g.value,
|
|
763
|
+
class: "sv-plan-customization__group",
|
|
764
|
+
pricings: p.pricings,
|
|
765
|
+
"group-name": p.name,
|
|
766
|
+
"billing-period": e.billingPeriod,
|
|
767
|
+
currency: e.currency
|
|
768
|
+
}, null, 8, ["modelValue", "seats-values", "units-values", "quantity-pricing-ids", "pricings", "group-name", "billing-period", "currency"])) : S("", !0)
|
|
769
|
+
], 64))), 128)),
|
|
770
|
+
V(W, {
|
|
771
|
+
modelValue: u.value,
|
|
772
|
+
"onUpdate:modelValue": f[7] || (f[7] = (p) => u.value = p),
|
|
773
|
+
"seats-values": i.value,
|
|
774
|
+
"onUpdate:seatsValues": f[8] || (f[8] = (p) => i.value = p),
|
|
775
|
+
"units-values": r.value,
|
|
776
|
+
"onUpdate:unitsValues": f[9] || (f[9] = (p) => r.value = p),
|
|
777
|
+
"quantity-pricing-ids": g.value,
|
|
778
|
+
class: "sv-plan-customization__group",
|
|
779
|
+
pricings: n.value,
|
|
780
|
+
"billing-period": e.billingPeriod,
|
|
781
|
+
currency: e.currency
|
|
782
|
+
}, null, 8, ["modelValue", "seats-values", "units-values", "quantity-pricing-ids", "pricings", "billing-period", "currency"])
|
|
783
|
+
])
|
|
784
|
+
]),
|
|
785
|
+
_: 1
|
|
786
|
+
}, 8, ["title"]));
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
export {
|
|
790
|
+
at as default
|
|
791
|
+
};
|