@schematichq/schematic-components 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schematic-components.cjs.js +707 -573
- package/dist/schematic-components.esm.js +623 -489
- package/package.json +1 -1
|
@@ -1919,7 +1919,7 @@ var HOURS_IN_MS = MINUTES_IN_MS * 60;
|
|
|
1919
1919
|
var DAYS_IN_MS = HOURS_IN_MS * 24;
|
|
1920
1920
|
|
|
1921
1921
|
// src/const/debounce.ts
|
|
1922
|
-
var
|
|
1922
|
+
var LEADING_DEBOUNCE_SETTINGS = {
|
|
1923
1923
|
leading: true,
|
|
1924
1924
|
trailing: false
|
|
1925
1925
|
};
|
|
@@ -2159,6 +2159,8 @@ function getUsageDetails(entitlement, period) {
|
|
|
2159
2159
|
limit = entitlement.allocation;
|
|
2160
2160
|
} else if (entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlement.softLimit === "number") {
|
|
2161
2161
|
limit = entitlement.softLimit;
|
|
2162
|
+
} else if (entitlement.priceBehavior === "credit_burndown" /* Credit */ && typeof entitlement.creditTotal === "number" && typeof entitlement.creditConsumptionRate === "number") {
|
|
2163
|
+
limit = entitlement.creditTotal / entitlement.creditConsumptionRate;
|
|
2162
2164
|
}
|
|
2163
2165
|
let amount;
|
|
2164
2166
|
if (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ && typeof entitlement.allocation === "number") {
|
|
@@ -2167,6 +2169,8 @@ function getUsageDetails(entitlement, period) {
|
|
|
2167
2169
|
amount = entitlement.usage;
|
|
2168
2170
|
} else if (entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlement.usage === "number" && typeof entitlement.softLimit === "number") {
|
|
2169
2171
|
amount = Math.max(0, entitlement.usage - entitlement.softLimit);
|
|
2172
|
+
} else if (entitlement.priceBehavior === "credit_burndown" /* Credit */ && typeof entitlement.creditUsed === "number" && typeof entitlement.creditConsumptionRate === "number") {
|
|
2173
|
+
amount = entitlement.creditUsed / entitlement.creditConsumptionRate;
|
|
2170
2174
|
}
|
|
2171
2175
|
const cost = getEntitlementCost(entitlement, period);
|
|
2172
2176
|
const tiers = billingPrice?.priceTier || [];
|
|
@@ -2198,6 +2202,17 @@ function getUsageDetails(entitlement, period) {
|
|
|
2198
2202
|
}
|
|
2199
2203
|
return { billingPrice, limit, amount, cost, currentTier };
|
|
2200
2204
|
}
|
|
2205
|
+
function getCreditBasedEntitlementLimit(entitlement, credits) {
|
|
2206
|
+
const matchedCredit = credits.find(
|
|
2207
|
+
(credit) => credit.id === entitlement.valueCredit?.id
|
|
2208
|
+
);
|
|
2209
|
+
if (matchedCredit && entitlement.consumptionRate) {
|
|
2210
|
+
return {
|
|
2211
|
+
limit: Math.floor(matchedCredit.quantity / entitlement.consumptionRate),
|
|
2212
|
+
period: matchedCredit.period
|
|
2213
|
+
};
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2201
2216
|
|
|
2202
2217
|
// src/utils/pluralize.ts
|
|
2203
2218
|
var pluralRules = [];
|
|
@@ -6787,6 +6802,7 @@ var en_default = {
|
|
|
6787
6802
|
"An unknown error occurred.": "An unknown error occurred.",
|
|
6788
6803
|
Billed: "Billed {{period}}",
|
|
6789
6804
|
"Cancel subscription": "Cancel subscription",
|
|
6805
|
+
"Cannot change to this plan.": "{{reason, list(style: 'long'; type: 'disjunction';)}} usage is over the limit.",
|
|
6790
6806
|
"Cannot downgrade entitlement": "Cannot downgrade to a quantity lower than current usage.",
|
|
6791
6807
|
"Card ending in": "\u{1F4B3} Card ending in {{value}}",
|
|
6792
6808
|
"Change add-on": "Change add-on",
|
|
@@ -6840,7 +6856,7 @@ var en_default = {
|
|
|
6840
6856
|
"One time ": "One time",
|
|
6841
6857
|
"Optionally add features to your subscription": "Optionally add features to your subscription",
|
|
6842
6858
|
"Other existing payment method": "Other existing payment method",
|
|
6843
|
-
"Over
|
|
6859
|
+
"Over plan limit": "Over plan limit",
|
|
6844
6860
|
"Pay-in-advance features require a quantity.": "Pay-in-advance features require a quantity.",
|
|
6845
6861
|
"Pay now": "Pay now",
|
|
6846
6862
|
"Payment Method": "Payment Method",
|
|
@@ -6895,6 +6911,8 @@ var en_default = {
|
|
|
6895
6911
|
"Unsubscribe failed": "Unsubscribe failed",
|
|
6896
6912
|
Unsubscribe: "Unsubscribe",
|
|
6897
6913
|
"Unused time": "Unused time",
|
|
6914
|
+
"Up to X units": "Up to {{amount}} {{units}}",
|
|
6915
|
+
"Up to X units per period": "Up to {{amount}} {{units}} per {{period}}",
|
|
6898
6916
|
"Up to a limit of": "Up to a limit of {{amount}} {{units}}",
|
|
6899
6917
|
"Up to X units at $Y/unit": "Up to {{X}} {{units}} at {{Y}} per {{unit}}",
|
|
6900
6918
|
"Up to X units at $Y/unit + $Z/period": "Up to {{X}} {{units}} at {{Y}} per {{unit}} plus {{Z}} per {{period}}",
|
|
@@ -10648,7 +10666,7 @@ var EmbedProvider = ({
|
|
|
10648
10666
|
});
|
|
10649
10667
|
const customHeaders = (0, import_react12.useMemo)(
|
|
10650
10668
|
() => ({
|
|
10651
|
-
"X-Schematic-Components-Version": "1.
|
|
10669
|
+
"X-Schematic-Components-Version": "1.8.0",
|
|
10652
10670
|
"X-Schematic-Session-ID": sessionIdRef.current
|
|
10653
10671
|
}),
|
|
10654
10672
|
[]
|
|
@@ -10690,7 +10708,11 @@ var EmbedProvider = ({
|
|
|
10690
10708
|
}
|
|
10691
10709
|
}, [api.public]);
|
|
10692
10710
|
const debouncedHydratePublic = (0, import_react12.useMemo)(
|
|
10693
|
-
() => (0, import_debounce.default)(
|
|
10711
|
+
() => (0, import_debounce.default)(
|
|
10712
|
+
hydratePublic,
|
|
10713
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10714
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10715
|
+
),
|
|
10694
10716
|
[hydratePublic]
|
|
10695
10717
|
);
|
|
10696
10718
|
const hydrate = (0, import_react12.useCallback)(async () => {
|
|
@@ -10712,7 +10734,7 @@ var EmbedProvider = ({
|
|
|
10712
10734
|
}
|
|
10713
10735
|
}, [api.checkout]);
|
|
10714
10736
|
const debouncedHydrate = (0, import_react12.useMemo)(
|
|
10715
|
-
() => (0, import_debounce.default)(hydrate, FETCH_DEBOUNCE_TIMEOUT,
|
|
10737
|
+
() => (0, import_debounce.default)(hydrate, FETCH_DEBOUNCE_TIMEOUT, LEADING_DEBOUNCE_SETTINGS),
|
|
10716
10738
|
[hydrate]
|
|
10717
10739
|
);
|
|
10718
10740
|
const hydrateComponent = (0, import_react12.useCallback)(
|
|
@@ -10739,7 +10761,11 @@ var EmbedProvider = ({
|
|
|
10739
10761
|
[api.checkout]
|
|
10740
10762
|
);
|
|
10741
10763
|
const debouncedHydrateComponent = (0, import_react12.useMemo)(
|
|
10742
|
-
() => (0, import_debounce.default)(
|
|
10764
|
+
() => (0, import_debounce.default)(
|
|
10765
|
+
hydrateComponent,
|
|
10766
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10767
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10768
|
+
),
|
|
10743
10769
|
[hydrateComponent]
|
|
10744
10770
|
);
|
|
10745
10771
|
const hydrateExternal = (0, import_react12.useCallback)(async function(fn) {
|
|
@@ -10759,14 +10785,22 @@ var EmbedProvider = ({
|
|
|
10759
10785
|
}
|
|
10760
10786
|
}, []);
|
|
10761
10787
|
const debouncedHydrateExternal = (0, import_react12.useMemo)(
|
|
10762
|
-
() => (0, import_debounce.default)(
|
|
10788
|
+
() => (0, import_debounce.default)(
|
|
10789
|
+
hydrateExternal,
|
|
10790
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10791
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10792
|
+
),
|
|
10763
10793
|
[hydrateExternal]
|
|
10764
10794
|
);
|
|
10765
10795
|
const createSetupIntent = (0, import_react12.useCallback)(async () => {
|
|
10766
10796
|
return api.checkout?.createSetupIntent();
|
|
10767
10797
|
}, [api.checkout]);
|
|
10768
10798
|
const debouncedCreateSetupIntent = (0, import_react12.useMemo)(
|
|
10769
|
-
() => (0, import_debounce.default)(
|
|
10799
|
+
() => (0, import_debounce.default)(
|
|
10800
|
+
createSetupIntent,
|
|
10801
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10802
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10803
|
+
),
|
|
10770
10804
|
[createSetupIntent]
|
|
10771
10805
|
);
|
|
10772
10806
|
const updatePaymentMethod = (0, import_react12.useCallback)(
|
|
@@ -10785,7 +10819,11 @@ var EmbedProvider = ({
|
|
|
10785
10819
|
[api.checkout]
|
|
10786
10820
|
);
|
|
10787
10821
|
const debouncedUpdatePaymentMethod = (0, import_react12.useMemo)(
|
|
10788
|
-
() => (0, import_debounce.default)(
|
|
10822
|
+
() => (0, import_debounce.default)(
|
|
10823
|
+
updatePaymentMethod,
|
|
10824
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10825
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10826
|
+
),
|
|
10789
10827
|
[updatePaymentMethod]
|
|
10790
10828
|
);
|
|
10791
10829
|
const deletePaymentMethod = (0, import_react12.useCallback)(
|
|
@@ -10804,7 +10842,11 @@ var EmbedProvider = ({
|
|
|
10804
10842
|
[api.checkout]
|
|
10805
10843
|
);
|
|
10806
10844
|
const debouncedDeletePaymentMethod = (0, import_react12.useMemo)(
|
|
10807
|
-
() => (0, import_debounce.default)(
|
|
10845
|
+
() => (0, import_debounce.default)(
|
|
10846
|
+
deletePaymentMethod,
|
|
10847
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10848
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10849
|
+
),
|
|
10808
10850
|
[deletePaymentMethod]
|
|
10809
10851
|
);
|
|
10810
10852
|
const checkout = (0, import_react12.useCallback)(
|
|
@@ -10823,7 +10865,7 @@ var EmbedProvider = ({
|
|
|
10823
10865
|
[api.checkout]
|
|
10824
10866
|
);
|
|
10825
10867
|
const debouncedCheckout = (0, import_react12.useMemo)(
|
|
10826
|
-
() => (0, import_debounce.default)(checkout, FETCH_DEBOUNCE_TIMEOUT,
|
|
10868
|
+
() => (0, import_debounce.default)(checkout, FETCH_DEBOUNCE_TIMEOUT, LEADING_DEBOUNCE_SETTINGS),
|
|
10827
10869
|
[checkout]
|
|
10828
10870
|
);
|
|
10829
10871
|
const previewCheckout = (0, import_react12.useCallback)(
|
|
@@ -10832,15 +10874,6 @@ var EmbedProvider = ({
|
|
|
10832
10874
|
},
|
|
10833
10875
|
[api.checkout]
|
|
10834
10876
|
);
|
|
10835
|
-
const debouncedPreviewCheckout = (0, import_react12.useMemo)(
|
|
10836
|
-
() => (0, import_debounce.default)(previewCheckout, FETCH_DEBOUNCE_TIMEOUT, {
|
|
10837
|
-
// invoke immediately for minimal latency
|
|
10838
|
-
leading: true,
|
|
10839
|
-
// but also ensure latest data is fetched
|
|
10840
|
-
trailing: true
|
|
10841
|
-
}),
|
|
10842
|
-
[previewCheckout]
|
|
10843
|
-
);
|
|
10844
10877
|
const unsubscribe = (0, import_react12.useCallback)(async () => {
|
|
10845
10878
|
const response = await api.checkout?.checkoutUnsubscribe();
|
|
10846
10879
|
if (response) {
|
|
@@ -10852,7 +10885,7 @@ var EmbedProvider = ({
|
|
|
10852
10885
|
return response;
|
|
10853
10886
|
}, [api.checkout]);
|
|
10854
10887
|
const debouncedUnsubscribe = (0, import_react12.useMemo)(
|
|
10855
|
-
() => (0, import_debounce.default)(unsubscribe, FETCH_DEBOUNCE_TIMEOUT,
|
|
10888
|
+
() => (0, import_debounce.default)(unsubscribe, FETCH_DEBOUNCE_TIMEOUT, LEADING_DEBOUNCE_SETTINGS),
|
|
10856
10889
|
[unsubscribe]
|
|
10857
10890
|
);
|
|
10858
10891
|
const getUpcomingInvoice = (0, import_react12.useCallback)(
|
|
@@ -10864,21 +10897,29 @@ var EmbedProvider = ({
|
|
|
10864
10897
|
[api.checkout]
|
|
10865
10898
|
);
|
|
10866
10899
|
const debouncedGetUpcomingInvoice = (0, import_react12.useMemo)(
|
|
10867
|
-
() => (0, import_debounce.default)(
|
|
10900
|
+
() => (0, import_debounce.default)(
|
|
10901
|
+
getUpcomingInvoice,
|
|
10902
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10903
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10904
|
+
),
|
|
10868
10905
|
[getUpcomingInvoice]
|
|
10869
10906
|
);
|
|
10870
10907
|
const getCustomerBalance = (0, import_react12.useCallback)(async () => {
|
|
10871
10908
|
return api.checkout?.fetchCustomerBalance();
|
|
10872
10909
|
}, [api.checkout]);
|
|
10873
10910
|
const debouncedGetCustomerBalance = (0, import_react12.useMemo)(
|
|
10874
|
-
() => (0, import_debounce.default)(
|
|
10911
|
+
() => (0, import_debounce.default)(
|
|
10912
|
+
getCustomerBalance,
|
|
10913
|
+
FETCH_DEBOUNCE_TIMEOUT,
|
|
10914
|
+
LEADING_DEBOUNCE_SETTINGS
|
|
10915
|
+
),
|
|
10875
10916
|
[getCustomerBalance]
|
|
10876
10917
|
);
|
|
10877
10918
|
const listInvoices = (0, import_react12.useCallback)(async () => {
|
|
10878
10919
|
return api.checkout?.listInvoices();
|
|
10879
10920
|
}, [api.checkout]);
|
|
10880
10921
|
const debouncedListInvoices = (0, import_react12.useMemo)(
|
|
10881
|
-
() => (0, import_debounce.default)(listInvoices, FETCH_DEBOUNCE_TIMEOUT,
|
|
10922
|
+
() => (0, import_debounce.default)(listInvoices, FETCH_DEBOUNCE_TIMEOUT, LEADING_DEBOUNCE_SETTINGS),
|
|
10882
10923
|
[listInvoices]
|
|
10883
10924
|
);
|
|
10884
10925
|
const setError = (0, import_react12.useCallback)(
|
|
@@ -11018,7 +11059,7 @@ var EmbedProvider = ({
|
|
|
11018
11059
|
updatePaymentMethod: debouncedUpdatePaymentMethod,
|
|
11019
11060
|
deletePaymentMethod: debouncedDeletePaymentMethod,
|
|
11020
11061
|
checkout: debouncedCheckout,
|
|
11021
|
-
previewCheckout
|
|
11062
|
+
previewCheckout,
|
|
11022
11063
|
unsubscribe: debouncedUnsubscribe,
|
|
11023
11064
|
getUpcomingInvoice: debouncedGetUpcomingInvoice,
|
|
11024
11065
|
getCustomerBalance: debouncedGetCustomerBalance,
|
|
@@ -14052,6 +14093,13 @@ var Navigation = ({
|
|
|
14052
14093
|
|
|
14053
14094
|
// src/components/shared/checkout-dialog/Plan.tsx
|
|
14054
14095
|
var import_react30 = require("react");
|
|
14096
|
+
|
|
14097
|
+
// src/components/shared/checkout-dialog/styles.ts
|
|
14098
|
+
var FlexWithAlignEnd = dt(Flex)`
|
|
14099
|
+
align-items: end;
|
|
14100
|
+
`;
|
|
14101
|
+
|
|
14102
|
+
// src/components/shared/checkout-dialog/Plan.tsx
|
|
14055
14103
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14056
14104
|
var Selected = ({ isCurrent = false, isTrial = false }) => {
|
|
14057
14105
|
const { t: t2 } = useTranslation();
|
|
@@ -14092,104 +14140,96 @@ var PlanButtonGroup = ({
|
|
|
14092
14140
|
}) => {
|
|
14093
14141
|
const { t: t2 } = useTranslation();
|
|
14094
14142
|
const { data } = useEmbed();
|
|
14095
|
-
const
|
|
14143
|
+
const isTrialing = (0, import_react30.useMemo)(() => {
|
|
14144
|
+
return isCheckoutData(data) && data.subscription?.status === "trialing" || false;
|
|
14145
|
+
}, [data]);
|
|
14146
|
+
const { isCurrentPlan, isValidPlan } = (0, import_react30.useMemo)(() => {
|
|
14096
14147
|
if (isCheckoutData(data)) {
|
|
14097
14148
|
return {
|
|
14098
14149
|
isCurrentPlan: data.company?.plan?.id === plan.id,
|
|
14099
|
-
isValidPlan: isHydratedPlan(plan) && plan.valid
|
|
14100
|
-
isTrialing: data.subscription?.status === "trialing"
|
|
14150
|
+
isValidPlan: isHydratedPlan(plan) && plan.valid
|
|
14101
14151
|
};
|
|
14102
14152
|
}
|
|
14103
14153
|
return {
|
|
14104
14154
|
isCurrentPlan: false,
|
|
14105
|
-
isValidPlan: true
|
|
14106
|
-
isTrialing: false
|
|
14155
|
+
isValidPlan: true
|
|
14107
14156
|
};
|
|
14108
14157
|
}, [data, plan]);
|
|
14109
14158
|
if (isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable) {
|
|
14110
14159
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Flex, { $flexDirection: "column", $gap: "1.5rem", children: [
|
|
14111
|
-
!isTrialing && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: isSelected && shouldTrial ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Selected, { isCurrent: isCurrentPlan, isTrial: shouldTrial }) : /* @__PURE__ */ (0, import_jsx_runtime20.
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14160
|
+
!isTrialing && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: isSelected && shouldTrial ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Selected, { isCurrent: isCurrentPlan, isTrial: shouldTrial }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
14161
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14162
|
+
Button,
|
|
14163
|
+
{
|
|
14164
|
+
type: "button",
|
|
14165
|
+
disabled: (isLoading || !isValidPlan) && !plan.custom,
|
|
14166
|
+
...plan.custom ? {
|
|
14167
|
+
as: "a",
|
|
14168
|
+
href: plan.customPlanConfig?.ctaWebSite ?? "#",
|
|
14169
|
+
target: "_blank",
|
|
14170
|
+
rel: "noreferrer"
|
|
14171
|
+
} : {
|
|
14172
|
+
onClick: () => {
|
|
14173
|
+
onSelect({
|
|
14174
|
+
plan,
|
|
14175
|
+
shouldTrial: true
|
|
14176
|
+
});
|
|
14177
|
+
}
|
|
14178
|
+
},
|
|
14179
|
+
$size: "sm",
|
|
14180
|
+
$color: "primary",
|
|
14181
|
+
$variant: "filled",
|
|
14182
|
+
$fullWidth: true,
|
|
14183
|
+
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { as: Box, $align: "center", children: t2("Over plan limit") }) : t2("Start X day trial", { days: plan.trialDays })
|
|
14184
|
+
}
|
|
14185
|
+
),
|
|
14186
|
+
isHydratedPlan(plan) && !plan.valid && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(UsageViolationText, { violations: plan.usageViolations })
|
|
14187
|
+
] }) }),
|
|
14188
|
+
!plan.custom && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: isSelected && (!shouldTrial || isTrialing) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
14189
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14190
|
+
Button,
|
|
14191
|
+
{
|
|
14192
|
+
type: "button",
|
|
14193
|
+
disabled: isLoading || !isValidPlan,
|
|
14122
14194
|
onClick: () => {
|
|
14123
|
-
onSelect({
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
Tooltip,
|
|
14135
|
-
{
|
|
14136
|
-
trigger: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
|
|
14137
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
14138
|
-
}
|
|
14139
|
-
) : t2("Start X day trial", { days: plan.trialDays })
|
|
14140
|
-
}
|
|
14141
|
-
) }),
|
|
14142
|
-
!plan.custom && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: isSelected && (!shouldTrial || isTrialing) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14143
|
-
Button,
|
|
14144
|
-
{
|
|
14145
|
-
type: "button",
|
|
14146
|
-
disabled: isLoading || !isValidPlan,
|
|
14147
|
-
onClick: () => {
|
|
14148
|
-
onSelect({ plan, shouldTrial: false });
|
|
14149
|
-
},
|
|
14150
|
-
$size: "sm",
|
|
14151
|
-
$color: "primary",
|
|
14152
|
-
$variant: isTrialing ? "filled" : "text",
|
|
14153
|
-
$fullWidth: true,
|
|
14154
|
-
children: !isValidPlan ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14155
|
-
Tooltip,
|
|
14156
|
-
{
|
|
14157
|
-
trigger: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
|
|
14158
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
14159
|
-
}
|
|
14160
|
-
) : t2("Choose plan")
|
|
14161
|
-
}
|
|
14162
|
-
) })
|
|
14195
|
+
onSelect({ plan, shouldTrial: false });
|
|
14196
|
+
},
|
|
14197
|
+
$size: "sm",
|
|
14198
|
+
$color: "primary",
|
|
14199
|
+
$variant: isTrialing ? "filled" : "text",
|
|
14200
|
+
$fullWidth: true,
|
|
14201
|
+
children: !isValidPlan ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box, { $textAlign: "center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { as: Box, $align: "center", children: t2("Over plan limit") }) }) : t2("Choose plan")
|
|
14202
|
+
}
|
|
14203
|
+
),
|
|
14204
|
+
isHydratedPlan(plan) && !plan.valid && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(UsageViolationText, { violations: plan.usageViolations })
|
|
14205
|
+
] }) })
|
|
14163
14206
|
] });
|
|
14164
14207
|
}
|
|
14165
|
-
return isSelected ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ (0, import_jsx_runtime20.
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
) : t2("Choose plan")
|
|
14191
|
-
}
|
|
14192
|
-
);
|
|
14208
|
+
return isSelected ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
14209
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14210
|
+
Button,
|
|
14211
|
+
{
|
|
14212
|
+
type: "button",
|
|
14213
|
+
disabled: (isLoading || !isValidPlan) && !plan.custom,
|
|
14214
|
+
...plan.custom ? {
|
|
14215
|
+
as: "a",
|
|
14216
|
+
href: plan.customPlanConfig?.ctaWebSite ?? "#",
|
|
14217
|
+
target: "_blank",
|
|
14218
|
+
rel: "noreferrer"
|
|
14219
|
+
} : {
|
|
14220
|
+
onClick: () => {
|
|
14221
|
+
onSelect({ plan });
|
|
14222
|
+
}
|
|
14223
|
+
},
|
|
14224
|
+
$size: "sm",
|
|
14225
|
+
$color: "primary",
|
|
14226
|
+
$variant: "filled",
|
|
14227
|
+
$fullWidth: true,
|
|
14228
|
+
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { as: Box, $align: "center", children: t2("Over plan limit") }) : t2("Choose plan")
|
|
14229
|
+
}
|
|
14230
|
+
),
|
|
14231
|
+
isHydratedPlan(plan) && !plan.valid && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(UsageViolationText, { violations: plan.usageViolations })
|
|
14232
|
+
] });
|
|
14193
14233
|
};
|
|
14194
14234
|
var Plan = ({
|
|
14195
14235
|
isLoading,
|
|
@@ -14197,8 +14237,7 @@ var Plan = ({
|
|
|
14197
14237
|
selectedPlan,
|
|
14198
14238
|
period,
|
|
14199
14239
|
selectPlan,
|
|
14200
|
-
shouldTrial
|
|
14201
|
-
showPeriodToggle
|
|
14240
|
+
shouldTrial
|
|
14202
14241
|
}) => {
|
|
14203
14242
|
const { t: t2 } = useTranslation();
|
|
14204
14243
|
const { data, settings } = useEmbed();
|
|
@@ -14206,16 +14245,23 @@ var Plan = ({
|
|
|
14206
14245
|
const [entitlementCounts, setEntitlementCounts] = (0, import_react30.useState)(
|
|
14207
14246
|
() => plans.reduce(entitlementCountsReducer, {})
|
|
14208
14247
|
);
|
|
14209
|
-
const { isTrialing, showZeroPriceAsFree } = (0, import_react30.useMemo)(() => {
|
|
14248
|
+
const { isTrialing, showCredits, showPeriodToggle, showZeroPriceAsFree } = (0, import_react30.useMemo)(() => {
|
|
14249
|
+
const showCredits2 = data?.showCredits ?? true;
|
|
14250
|
+
const showPeriodToggle2 = data?.showPeriodToggle ?? true;
|
|
14251
|
+
const showZeroPriceAsFree2 = data?.showZeroPriceAsFree ?? false;
|
|
14210
14252
|
if (isCheckoutData(data)) {
|
|
14211
14253
|
return {
|
|
14212
14254
|
isTrialing: data.subscription?.status === "trialing",
|
|
14213
|
-
|
|
14255
|
+
showCredits: showCredits2,
|
|
14256
|
+
showPeriodToggle: showPeriodToggle2,
|
|
14257
|
+
showZeroPriceAsFree: showZeroPriceAsFree2
|
|
14214
14258
|
};
|
|
14215
14259
|
}
|
|
14216
14260
|
return {
|
|
14217
14261
|
isTrialing: false,
|
|
14218
|
-
|
|
14262
|
+
showCredits: showCredits2,
|
|
14263
|
+
showPeriodToggle: showPeriodToggle2,
|
|
14264
|
+
showZeroPriceAsFree: showZeroPriceAsFree2
|
|
14219
14265
|
};
|
|
14220
14266
|
}, [data]);
|
|
14221
14267
|
const handleToggleShowAll = (id) => {
|
|
@@ -14312,7 +14358,7 @@ var Plan = ({
|
|
|
14312
14358
|
}
|
|
14313
14359
|
)
|
|
14314
14360
|
] }),
|
|
14315
|
-
credits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14361
|
+
showCredits && credits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14316
14362
|
Flex,
|
|
14317
14363
|
{
|
|
14318
14364
|
$flexDirection: "column",
|
|
@@ -14398,6 +14444,7 @@ var Plan = ({
|
|
|
14398
14444
|
plan.entitlements.map((entitlement, entitlementIndex) => {
|
|
14399
14445
|
const hasNumericValue = entitlement.valueType === "numeric" /* Numeric */ || entitlement.valueType === "unlimited" /* Unlimited */ || entitlement.valueType === "trait" /* Trait */;
|
|
14400
14446
|
const limit = entitlement.softLimit ?? entitlement.valueNumeric;
|
|
14447
|
+
const creditBasedEntitlementLimit = getCreditBasedEntitlementLimit(entitlement, credits);
|
|
14401
14448
|
const {
|
|
14402
14449
|
price: entitlementPrice,
|
|
14403
14450
|
priceTier: entitlementPriceTiers,
|
|
@@ -14405,6 +14452,7 @@ var Plan = ({
|
|
|
14405
14452
|
packageSize: entitlementPackageSize = 1
|
|
14406
14453
|
} = getEntitlementPrice(entitlement, planPeriod) || {};
|
|
14407
14454
|
const metricPeriodName = getMetricPeriodName(entitlement);
|
|
14455
|
+
const UsageDetailsContainer = entitlement.billingThreshold ? FlexWithAlignEnd : import_react30.Fragment;
|
|
14408
14456
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14409
14457
|
Flex,
|
|
14410
14458
|
{
|
|
@@ -14457,7 +14505,7 @@ var Plan = ({
|
|
|
14457
14505
|
entitlement,
|
|
14458
14506
|
period: planPeriod
|
|
14459
14507
|
}
|
|
14460
|
-
) : entitlement.priceBehavior === "credit_burndown" /* Credit */ && entitlement.valueCredit ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
14508
|
+
) : showCredits && entitlement.priceBehavior === "credit_burndown" /* Credit */ && entitlement.valueCredit ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
14461
14509
|
entitlement.consumptionRate,
|
|
14462
14510
|
" ",
|
|
14463
14511
|
getFeatureName(
|
|
@@ -14468,7 +14516,20 @@ var Plan = ({
|
|
|
14468
14516
|
t2("per"),
|
|
14469
14517
|
" ",
|
|
14470
14518
|
getFeatureName(entitlement.feature, 1)
|
|
14471
|
-
] }) :
|
|
14519
|
+
] }) : entitlement.priceBehavior === "credit_burndown" /* Credit */ && creditBasedEntitlementLimit ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: creditBasedEntitlementLimit?.period ? t2("Up to X units per period", {
|
|
14520
|
+
amount: creditBasedEntitlementLimit.limit,
|
|
14521
|
+
units: getFeatureName(
|
|
14522
|
+
entitlement.feature,
|
|
14523
|
+
creditBasedEntitlementLimit.limit
|
|
14524
|
+
),
|
|
14525
|
+
period: creditBasedEntitlementLimit.period
|
|
14526
|
+
}) : t2("Up to X units", {
|
|
14527
|
+
amount: creditBasedEntitlementLimit.limit,
|
|
14528
|
+
units: getFeatureName(
|
|
14529
|
+
entitlement.feature,
|
|
14530
|
+
creditBasedEntitlementLimit.limit
|
|
14531
|
+
)
|
|
14532
|
+
}) }) : hasNumericValue ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
14472
14533
|
entitlement.valueType === "unlimited" /* Unlimited */ && !entitlement.priceBehavior ? t2("Unlimited", {
|
|
14473
14534
|
item: getFeatureName(
|
|
14474
14535
|
entitlement.feature
|
|
@@ -14488,7 +14549,7 @@ var Plan = ({
|
|
|
14488
14549
|
t2(metricPeriodName)
|
|
14489
14550
|
] })
|
|
14490
14551
|
] }) : entitlement.feature.name }),
|
|
14491
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(UsageDetailsContainer, { children: [
|
|
14492
14553
|
entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14493
14554
|
Text,
|
|
14494
14555
|
{
|
|
@@ -14783,18 +14844,19 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14783
14844
|
showPeriodToggle,
|
|
14784
14845
|
trialPaymentMethodRequired
|
|
14785
14846
|
} = (0, import_react31.useMemo)(() => {
|
|
14847
|
+
const showPeriodToggle2 = data?.showPeriodToggle ?? true;
|
|
14786
14848
|
if (isCheckoutData(data)) {
|
|
14787
14849
|
return {
|
|
14788
14850
|
currentPlanId: data.company?.plan?.id,
|
|
14789
14851
|
currentEntitlements: data.featureUsage ? data.featureUsage.features : [],
|
|
14790
|
-
showPeriodToggle:
|
|
14852
|
+
showPeriodToggle: showPeriodToggle2,
|
|
14791
14853
|
trialPaymentMethodRequired: data.trialPaymentMethodRequired === true
|
|
14792
14854
|
};
|
|
14793
14855
|
}
|
|
14794
14856
|
return {
|
|
14795
14857
|
currentPlanId: void 0,
|
|
14796
14858
|
currentEntitlements: [],
|
|
14797
|
-
showPeriodToggle:
|
|
14859
|
+
showPeriodToggle: showPeriodToggle2,
|
|
14798
14860
|
trialPaymentMethodRequired: false
|
|
14799
14861
|
};
|
|
14800
14862
|
}, [data]);
|
|
@@ -15397,8 +15459,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
15397
15459
|
plans: availablePlans,
|
|
15398
15460
|
selectedPlan,
|
|
15399
15461
|
selectPlan,
|
|
15400
|
-
shouldTrial
|
|
15401
|
-
showPeriodToggle
|
|
15462
|
+
shouldTrial
|
|
15402
15463
|
}
|
|
15403
15464
|
) : checkoutStage === "usage" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15404
15465
|
Usage,
|
|
@@ -16095,12 +16156,35 @@ var UnsubscribeDialog = ({ top = 0 }) => {
|
|
|
16095
16156
|
] });
|
|
16096
16157
|
};
|
|
16097
16158
|
|
|
16098
|
-
// src/components/
|
|
16159
|
+
// src/components/shared/usage-violation-text/UsageViolationText.tsx
|
|
16099
16160
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
16161
|
+
var UsageViolationText = ({ violations }) => {
|
|
16162
|
+
const { t: t2 } = useTranslation();
|
|
16163
|
+
const { settings } = useEmbed();
|
|
16164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16165
|
+
Text,
|
|
16166
|
+
{
|
|
16167
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
16168
|
+
$leading: 1.35,
|
|
16169
|
+
style: { opacity: 0.625 },
|
|
16170
|
+
children: t2("Cannot change to this plan.", {
|
|
16171
|
+
reason: violations.reduce((acc, violation) => {
|
|
16172
|
+
if (violation.feature) {
|
|
16173
|
+
acc.push(violation.feature.name);
|
|
16174
|
+
}
|
|
16175
|
+
return acc;
|
|
16176
|
+
}, [])
|
|
16177
|
+
})
|
|
16178
|
+
}
|
|
16179
|
+
);
|
|
16180
|
+
};
|
|
16181
|
+
|
|
16182
|
+
// src/components/ui/badge/Badge.tsx
|
|
16183
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
16100
16184
|
var Badge = () => {
|
|
16101
16185
|
const { t: t2 } = useTranslation();
|
|
16102
16186
|
const { settings } = useEmbed();
|
|
16103
|
-
return /* @__PURE__ */ (0,
|
|
16187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16104
16188
|
Flex,
|
|
16105
16189
|
{
|
|
16106
16190
|
as: "a",
|
|
@@ -16113,82 +16197,82 @@ var Badge = () => {
|
|
|
16113
16197
|
$gridColumn: "1 / -1",
|
|
16114
16198
|
$color: settings.theme.typography.text.color,
|
|
16115
16199
|
children: [
|
|
16116
|
-
/* @__PURE__ */ (0,
|
|
16200
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { $size: 12, children: [
|
|
16117
16201
|
t2("Powered by"),
|
|
16118
16202
|
" "
|
|
16119
16203
|
] }),
|
|
16120
|
-
/* @__PURE__ */ (0,
|
|
16121
|
-
/* @__PURE__ */ (0,
|
|
16204
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("svg", { viewBox: "0 0 86 16", width: 86, height: 16, children: [
|
|
16205
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16122
16206
|
"path",
|
|
16123
16207
|
{
|
|
16124
16208
|
d: "M21.2354 6.16227C21.1796 5.95015 21.0494 5.76779 20.8261 5.61893C20.6028 5.46635 20.3423 5.39564 20.0408 5.39564C19.3151 5.39564 18.7941 5.69708 18.7941 6.2367C18.7941 6.49721 18.9095 6.69073 19.1402 6.81726C19.3635 6.94379 19.732 7.07033 20.2344 7.18569C21.0084 7.37177 21.4922 7.51691 21.9686 7.7402C22.203 7.85557 22.3928 7.97465 22.5305 8.10863C22.7948 8.3803 22.9548 8.74501 22.9362 9.20276C22.9176 9.86147 22.6571 10.375 22.1547 10.7397C21.6523 11.1082 20.9563 11.2905 20.0818 11.2905C19.2072 11.2905 18.5597 11.1268 18.0312 10.8067C17.5065 10.4867 17.2013 10.0215 17.1194 9.41116L18.6192 9.27719C18.6974 9.57491 18.8723 9.7982 19.1514 9.94706C19.4305 10.0959 19.7394 10.1778 20.0818 10.1778C20.4614 10.1778 20.7777 10.0996 21.0308 9.9359C21.2838 9.77959 21.4104 9.56002 21.4104 9.28835C21.4104 8.90876 21.0531 8.61104 20.5991 8.43613C20.3683 8.35053 20.0855 8.27238 19.7468 8.19423C19.2705 8.07886 18.8946 7.97094 18.6155 7.87418C18.3364 7.78486 18.0908 7.66205 17.8712 7.51319C17.4358 7.21547 17.2832 6.8247 17.2832 6.2367C17.2832 5.61521 17.5325 5.13141 18.0312 4.79648C18.5262 4.46526 19.2035 4.29407 20.0669 4.29407C21.5853 4.29407 22.5752 4.9044 22.7389 6.05807L21.228 6.16227H21.2354Z",
|
|
16125
16209
|
fill: "currentColor"
|
|
16126
16210
|
}
|
|
16127
16211
|
),
|
|
16128
|
-
/* @__PURE__ */ (0,
|
|
16212
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16129
16213
|
"path",
|
|
16130
16214
|
{
|
|
16131
16215
|
d: "M29.4145 8.9796L30.7803 9.55271C30.49 10.0923 30.0621 10.5129 29.5001 10.8217C28.9382 11.1344 28.3167 11.2944 27.6319 11.2944C26.9472 11.2944 26.3629 11.1567 25.8121 10.8701C25.2613 10.5873 24.8147 10.1742 24.4835 9.6383C24.1523 9.09868 23.9811 8.48835 23.9811 7.79987C23.9811 7.11138 24.1486 6.49361 24.4835 5.95771C24.8147 5.41809 25.2613 5.00873 25.8121 4.72589C26.3629 4.44305 26.9732 4.30164 27.6319 4.30164C28.2906 4.30164 28.9382 4.45794 29.5038 4.77427C30.0658 5.08688 30.4938 5.51113 30.7803 6.05075L29.4145 6.62015C29.0535 5.93539 28.3985 5.56323 27.6319 5.56323C27.0327 5.56323 26.5303 5.77536 26.1135 6.19961C25.6967 6.62387 25.492 7.15977 25.492 7.80731C25.492 8.45486 25.6967 8.99076 26.1135 9.40757C26.5303 9.83182 27.0327 10.0439 27.6319 10.0439C28.3985 10.0439 29.0535 9.66807 29.4145 8.98703V8.9796Z",
|
|
16132
16216
|
fill: "currentColor"
|
|
16133
16217
|
}
|
|
16134
16218
|
),
|
|
16135
|
-
/* @__PURE__ */ (0,
|
|
16219
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16136
16220
|
"path",
|
|
16137
16221
|
{
|
|
16138
16222
|
d: "M37.4386 11.2049V7.80341C37.4386 6.35945 36.9139 5.59282 35.697 5.59282C35.0978 5.59282 34.614 5.7975 34.2419 6.21059C33.8623 6.61996 33.6725 7.15214 33.6725 7.80713V11.2086H32.1615V1.9234H33.6725V5.47745C34.1004 4.73315 35.001 4.29773 36.1919 4.29773C37.167 4.29773 37.8666 4.59917 38.302 5.19834C38.7375 5.7975 38.9533 6.66834 38.9533 7.80341V11.2049H37.4349H37.4386Z",
|
|
16139
16223
|
fill: "currentColor"
|
|
16140
16224
|
}
|
|
16141
16225
|
),
|
|
16142
|
-
/* @__PURE__ */ (0,
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16143
16227
|
"path",
|
|
16144
16228
|
{
|
|
16145
16229
|
d: "M46.5692 5.38819C47.2167 6.07295 47.5777 7.1187 47.5107 8.30587H41.8242C41.9284 8.83805 42.1741 9.26602 42.5611 9.59352C42.9481 9.92473 43.4022 10.0885 43.9157 10.0885C44.8052 10.0885 45.5234 9.59724 45.8844 8.78222L47.1795 9.40372C46.8818 9.99172 46.4352 10.4495 45.8509 10.7881C45.2629 11.1268 44.6191 11.2943 43.9157 11.2943C42.9295 11.2943 42.0178 10.9444 41.3516 10.3453C40.6855 9.7461 40.2649 8.83432 40.2649 7.79602C40.2649 6.75771 40.6892 5.84222 41.3516 5.23933C42.0178 4.64017 42.9295 4.29034 43.9157 4.29034C44.9801 4.29034 45.9216 4.69971 46.5692 5.38447V5.38819ZM42.5388 6.00224C42.1592 6.32974 41.921 6.75772 41.8205 7.29734H46.0221C45.9179 6.75772 45.6835 6.3223 45.3039 5.99852C44.9243 5.67847 44.4628 5.51473 43.9195 5.51473C43.3761 5.51473 42.9221 5.67847 42.5425 6.00597L42.5388 6.00224Z",
|
|
16146
16230
|
fill: "currentColor"
|
|
16147
16231
|
}
|
|
16148
16232
|
),
|
|
16149
|
-
/* @__PURE__ */ (0,
|
|
16233
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16150
16234
|
"path",
|
|
16151
16235
|
{
|
|
16152
16236
|
d: "M59.7699 5.23933C60.1495 5.86827 60.3132 6.68329 60.3132 7.80347V11.2049H58.8023V7.80347C58.8023 6.35952 58.3371 5.59288 57.2318 5.59288C56.6438 5.59288 56.1861 5.79384 55.8586 6.19577C55.5311 6.60141 55.3673 7.13731 55.3673 7.80347V11.2049H53.8489V7.80347C53.8489 6.35952 53.3838 5.59288 52.2785 5.59288C51.6905 5.59288 51.2327 5.79384 50.9052 6.19577C50.574 6.60141 50.4102 7.13731 50.4102 7.80347V11.2049H48.8993V4.39827H50.3433L50.4102 5.47379C50.8196 4.65878 51.5825 4.29407 52.8106 4.29407C53.9606 4.29407 54.7161 4.78531 55.077 5.76407C55.5199 4.81508 56.4428 4.29407 57.7677 4.29407C58.7093 4.29407 59.3829 4.61412 59.7699 5.23562V5.23933Z",
|
|
16153
16237
|
fill: "currentColor"
|
|
16154
16238
|
}
|
|
16155
16239
|
),
|
|
16156
|
-
/* @__PURE__ */ (0,
|
|
16240
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16157
16241
|
"path",
|
|
16158
16242
|
{
|
|
16159
16243
|
d: "M67.4264 5.47382L67.4934 4.3983H68.9373V11.205H67.4934L67.4264 10.1294C67.0282 10.9147 66.1797 11.3092 64.8809 11.3017C63.102 11.3427 61.591 9.79823 61.6283 7.8035C61.591 5.8162 63.102 4.2606 64.8809 4.29782C66.0643 4.29782 67.0096 4.7444 67.4264 5.47754V5.47382ZM66.8049 9.37398C67.2217 8.95717 67.4264 8.43243 67.4264 7.79605C67.4264 7.15967 67.2217 6.64238 66.8049 6.21813C66.3881 5.80132 65.8782 5.58919 65.2828 5.58919C64.6874 5.58919 64.1887 5.80132 63.7719 6.21813C63.355 6.64238 63.1504 7.16711 63.1504 7.79605C63.1504 8.42499 63.355 8.95717 63.7719 9.37398C64.1887 9.79823 64.6911 10.0104 65.2828 10.0104C65.8745 10.0104 66.3881 9.79823 66.8049 9.37398Z",
|
|
16160
16244
|
fill: "currentColor"
|
|
16161
16245
|
}
|
|
16162
16246
|
),
|
|
16163
|
-
/* @__PURE__ */ (0,
|
|
16247
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16164
16248
|
"path",
|
|
16165
16249
|
{
|
|
16166
16250
|
d: "M71.3891 2.85757H72.8926V4.39828H74.6455V5.58172H72.8926V8.9683C72.8926 9.5898 73.1048 9.90985 73.5923 9.96568C73.89 10.0252 74.2398 10.0141 74.6455 9.9359V11.1863C74.1989 11.257 73.7858 11.2943 73.4062 11.2943C72.6731 11.2943 72.1595 11.1082 71.8543 10.7323C71.5454 10.3639 71.3891 9.79076 71.3891 9.02041V5.58172H70.4215V4.39828H71.3891V2.85757Z",
|
|
16167
16251
|
fill: "currentColor"
|
|
16168
16252
|
}
|
|
16169
16253
|
),
|
|
16170
|
-
/* @__PURE__ */ (0,
|
|
16254
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16171
16255
|
"path",
|
|
16172
16256
|
{
|
|
16173
16257
|
d: "M76.1747 3.15526C75.9923 2.98035 75.903 2.76078 75.903 2.50772C75.903 2.25466 75.9923 2.04997 76.1747 1.86762C76.3496 1.69271 76.5691 1.60339 76.8222 1.60339C77.0753 1.60339 77.2874 1.69271 77.4623 1.86762C77.6372 2.04997 77.7265 2.2621 77.7265 2.50772C77.7265 2.75334 77.6372 2.97291 77.4623 3.15526C77.2874 3.33762 77.0678 3.42694 76.8222 3.42694C76.5766 3.42694 76.3496 3.33762 76.1747 3.15526ZM76.0593 4.39826H77.5777V11.2049H76.0593V4.39826Z",
|
|
16174
16258
|
fill: "currentColor"
|
|
16175
16259
|
}
|
|
16176
16260
|
),
|
|
16177
|
-
/* @__PURE__ */ (0,
|
|
16261
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16178
16262
|
"path",
|
|
16179
16263
|
{
|
|
16180
16264
|
d: "M84.3023 8.9796L85.6681 9.55271C85.3778 10.0923 84.9498 10.5129 84.3879 10.8217C83.8259 11.1344 83.2044 11.2944 82.5197 11.2944C81.8349 11.2944 81.2506 11.1567 80.6998 10.8701C80.1491 10.5873 79.7025 10.1742 79.3713 9.6383C79.04 9.09868 78.8689 8.48835 78.8689 7.79987C78.8689 7.11138 79.0363 6.49361 79.3713 5.95771C79.7025 5.41809 80.1528 5.00873 80.6998 4.72589C81.2469 4.44305 81.8609 4.30164 82.5197 4.30164C83.1784 4.30164 83.8259 4.45794 84.3916 4.77427C84.9535 5.08688 85.3815 5.51113 85.6681 6.05075L84.3023 6.62015C83.9413 5.93539 83.2863 5.56323 82.5197 5.56323C81.9205 5.56323 81.4181 5.77536 81.0013 6.19961C80.5845 6.62387 80.3798 7.15977 80.3798 7.80731C80.3798 8.45486 80.5845 8.99076 81.0013 9.40757C81.4181 9.83182 81.9205 10.0439 82.5197 10.0439C83.2863 10.0439 83.9413 9.66807 84.3023 8.98703V8.9796Z",
|
|
16181
16265
|
fill: "currentColor"
|
|
16182
16266
|
}
|
|
16183
16267
|
),
|
|
16184
|
-
/* @__PURE__ */ (0,
|
|
16268
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16185
16269
|
"path",
|
|
16186
16270
|
{
|
|
16187
16271
|
d: "M5.93091 10.8141L7.2758 9.41753L3.83719 5.84667C2.98568 4.9624 2.98568 3.52157 3.83719 2.63731C4.68871 1.75305 6.07617 1.75305 6.92769 2.63731L10.3663 6.20817L11.7112 4.81156L8.27258 1.24069C6.67975 -0.413401 4.08513 -0.413401 2.4923 1.24069C0.899472 2.89479 0.899472 5.58919 2.4923 7.24328L5.93091 10.8141Z",
|
|
16188
16272
|
fill: "currentColor"
|
|
16189
16273
|
}
|
|
16190
16274
|
),
|
|
16191
|
-
/* @__PURE__ */ (0,
|
|
16275
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16192
16276
|
"path",
|
|
16193
16277
|
{
|
|
16194
16278
|
d: "M6.05827 3.54751C5.68761 3.1626 5.08404 3.1626 4.71338 3.54751C4.34272 3.93243 4.34272 4.55921 4.71338 4.94413L9.02103 9.41746L5.93054 12.6268L1.62288 8.15349C1.25223 7.76857 0.648653 7.76857 0.277994 8.15349C-0.0926647 8.5384 -0.0926647 9.16519 0.277994 9.5501L5.93054 15.4201L11.7108 9.41746L6.05827 3.54751Z",
|
|
@@ -16202,9 +16286,9 @@ var Badge = () => {
|
|
|
16202
16286
|
};
|
|
16203
16287
|
|
|
16204
16288
|
// src/components/layout/RenderLayout.tsx
|
|
16205
|
-
var
|
|
16289
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
16206
16290
|
var Disabled = () => {
|
|
16207
|
-
return /* @__PURE__ */ (0,
|
|
16291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box, { $width: "max-content", $height: "max-content", $margin: "0 auto", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
16208
16292
|
Element,
|
|
16209
16293
|
{
|
|
16210
16294
|
as: Flex,
|
|
@@ -16213,8 +16297,8 @@ var Disabled = () => {
|
|
|
16213
16297
|
$alignItems: "center",
|
|
16214
16298
|
$whiteSpace: "nowrap",
|
|
16215
16299
|
children: [
|
|
16216
|
-
/* @__PURE__ */ (0,
|
|
16217
|
-
/* @__PURE__ */ (0,
|
|
16300
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
|
|
16301
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { as: "p", children: "Please try again later." })
|
|
16218
16302
|
]
|
|
16219
16303
|
}
|
|
16220
16304
|
) }) });
|
|
@@ -16223,7 +16307,7 @@ var RenderLayout = ({ children }) => {
|
|
|
16223
16307
|
const { layout } = useEmbed();
|
|
16224
16308
|
switch (layout) {
|
|
16225
16309
|
case "disabled":
|
|
16226
|
-
return /* @__PURE__ */ (0,
|
|
16310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Disabled, {});
|
|
16227
16311
|
default:
|
|
16228
16312
|
return children;
|
|
16229
16313
|
}
|
|
@@ -16248,7 +16332,7 @@ var StyledViewport = dt.div.withConfig({
|
|
|
16248
16332
|
`;
|
|
16249
16333
|
|
|
16250
16334
|
// src/components/layout/viewport/Viewport.tsx
|
|
16251
|
-
var
|
|
16335
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
16252
16336
|
var Viewport = (0, import_react39.forwardRef)(
|
|
16253
16337
|
({ children, portal, ...props }, ref) => {
|
|
16254
16338
|
const { data, layout, settings } = useEmbed();
|
|
@@ -16274,24 +16358,24 @@ var Viewport = (0, import_react39.forwardRef)(
|
|
|
16274
16358
|
parent.style.overflow = "";
|
|
16275
16359
|
};
|
|
16276
16360
|
}, [portal, layout]);
|
|
16277
|
-
return /* @__PURE__ */ (0,
|
|
16278
|
-
/* @__PURE__ */ (0,
|
|
16279
|
-
/* @__PURE__ */ (0,
|
|
16280
|
-
isBadgeVisible && /* @__PURE__ */ (0,
|
|
16361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
16362
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(StyledViewport, { ref, ...props, children: [
|
|
16363
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RenderLayout, { children }),
|
|
16364
|
+
isBadgeVisible && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Badge, {})
|
|
16281
16365
|
] }),
|
|
16282
|
-
canCheckout && layout === "checkout" && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0,
|
|
16366
|
+
canCheckout && layout === "checkout" && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CheckoutDialog, { top }), portal || document.body),
|
|
16283
16367
|
layout === "unsubscribe" && (0, import_react_dom2.createPortal)(
|
|
16284
|
-
/* @__PURE__ */ (0,
|
|
16368
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UnsubscribeDialog, { top }),
|
|
16285
16369
|
portal || document.body
|
|
16286
16370
|
),
|
|
16287
|
-
layout === "payment" && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0,
|
|
16371
|
+
layout === "payment" && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentDialog, { top }), portal || document.body)
|
|
16288
16372
|
] });
|
|
16289
16373
|
}
|
|
16290
16374
|
);
|
|
16291
16375
|
Viewport.displayName = "Viewport";
|
|
16292
16376
|
|
|
16293
16377
|
// src/components/elements/button/Button.tsx
|
|
16294
|
-
var
|
|
16378
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
16295
16379
|
var resolveDesignProps = (props) => {
|
|
16296
16380
|
return {
|
|
16297
16381
|
button: {
|
|
@@ -16322,7 +16406,7 @@ var ButtonElement = (0, import_react40.forwardRef)(({ children, className, ...re
|
|
|
16322
16406
|
variant: "text"
|
|
16323
16407
|
}
|
|
16324
16408
|
};
|
|
16325
|
-
return /* @__PURE__ */ (0,
|
|
16409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16326
16410
|
Element,
|
|
16327
16411
|
{
|
|
16328
16412
|
as: Flex,
|
|
@@ -16330,7 +16414,7 @@ var ButtonElement = (0, import_react40.forwardRef)(({ children, className, ...re
|
|
|
16330
16414
|
className,
|
|
16331
16415
|
$flexDirection: "column",
|
|
16332
16416
|
$gap: "2rem",
|
|
16333
|
-
children: /* @__PURE__ */ (0,
|
|
16417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16334
16418
|
Button,
|
|
16335
16419
|
{
|
|
16336
16420
|
as: "a",
|
|
@@ -16355,7 +16439,7 @@ var import_react42 = require("react");
|
|
|
16355
16439
|
|
|
16356
16440
|
// src/components/elements/included-features/UsageDetails.tsx
|
|
16357
16441
|
var import_react41 = require("react");
|
|
16358
|
-
var
|
|
16442
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
16359
16443
|
var UsageDetails = ({
|
|
16360
16444
|
entitlement,
|
|
16361
16445
|
shouldWrapChildren,
|
|
@@ -16373,8 +16457,18 @@ var UsageDetails = ({
|
|
|
16373
16457
|
} = entitlement;
|
|
16374
16458
|
const { t: t2 } = useTranslation();
|
|
16375
16459
|
const { data } = useEmbed();
|
|
16376
|
-
const period = (0, import_react41.useMemo)(() => {
|
|
16377
|
-
|
|
16460
|
+
const { period, showCredits } = (0, import_react41.useMemo)(() => {
|
|
16461
|
+
const showCredits2 = data?.showCredits ?? true;
|
|
16462
|
+
if (isCheckoutData(data)) {
|
|
16463
|
+
return {
|
|
16464
|
+
period: data.company?.plan?.planPeriod || void 0,
|
|
16465
|
+
showCredits: showCredits2
|
|
16466
|
+
};
|
|
16467
|
+
}
|
|
16468
|
+
return {
|
|
16469
|
+
period: void 0,
|
|
16470
|
+
showCredits: showCredits2
|
|
16471
|
+
};
|
|
16378
16472
|
}, [data]);
|
|
16379
16473
|
const { billingPrice, cost, currentTier } = (0, import_react41.useMemo)(
|
|
16380
16474
|
() => getUsageDetails(entitlement, period),
|
|
@@ -16386,19 +16480,19 @@ var UsageDetails = ({
|
|
|
16386
16480
|
}
|
|
16387
16481
|
const { price, currency, packageSize = 1 } = billingPrice || {};
|
|
16388
16482
|
if (priceBehavior === "pay_in_advance" /* PayInAdvance */ && typeof allocation === "number") {
|
|
16389
|
-
return /* @__PURE__ */ (0,
|
|
16483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16390
16484
|
formatNumber(allocation),
|
|
16391
16485
|
" ",
|
|
16392
16486
|
getFeatureName(feature, allocation)
|
|
16393
16487
|
] });
|
|
16394
16488
|
}
|
|
16395
16489
|
if (priceBehavior === "pay_as_you_go" /* PayAsYouGo */ && typeof price === "number") {
|
|
16396
|
-
return /* @__PURE__ */ (0,
|
|
16490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16397
16491
|
formatCurrency(price, currency),
|
|
16398
16492
|
" ",
|
|
16399
16493
|
t2("per"),
|
|
16400
16494
|
" ",
|
|
16401
|
-
packageSize > 1 && /* @__PURE__ */ (0,
|
|
16495
|
+
packageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16402
16496
|
packageSize,
|
|
16403
16497
|
" "
|
|
16404
16498
|
] }),
|
|
@@ -16406,22 +16500,22 @@ var UsageDetails = ({
|
|
|
16406
16500
|
] });
|
|
16407
16501
|
}
|
|
16408
16502
|
if (priceBehavior === "overage" /* Overage */ && typeof softLimit === "number") {
|
|
16409
|
-
return /* @__PURE__ */ (0,
|
|
16503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16410
16504
|
formatNumber(softLimit),
|
|
16411
16505
|
" ",
|
|
16412
16506
|
getFeatureName(feature, softLimit)
|
|
16413
16507
|
] });
|
|
16414
16508
|
}
|
|
16415
16509
|
if (priceBehavior === "tier" /* Tiered */) {
|
|
16416
|
-
return /* @__PURE__ */ (0,
|
|
16510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: typeof currentTier?.to === "number" && (currentTier?.to === Infinity ? t2("Unlimited in this tier", {
|
|
16417
16511
|
feature: getFeatureName(feature)
|
|
16418
16512
|
}) : t2("Up to X units in this tier", {
|
|
16419
16513
|
amount: formatNumber(currentTier.to),
|
|
16420
16514
|
feature: getFeatureName(feature, currentTier?.to)
|
|
16421
16515
|
})) });
|
|
16422
16516
|
}
|
|
16423
|
-
if (priceBehavior === "credit_burndown" /* Credit */ && planEntitlement?.valueCredit && typeof planEntitlement?.consumptionRate === "number") {
|
|
16424
|
-
return /* @__PURE__ */ (0,
|
|
16517
|
+
if (showCredits && priceBehavior === "credit_burndown" /* Credit */ && planEntitlement?.valueCredit && typeof planEntitlement?.consumptionRate === "number") {
|
|
16518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16425
16519
|
planEntitlement.consumptionRate,
|
|
16426
16520
|
" ",
|
|
16427
16521
|
getFeatureName(
|
|
@@ -16435,7 +16529,7 @@ var UsageDetails = ({
|
|
|
16435
16529
|
] });
|
|
16436
16530
|
}
|
|
16437
16531
|
if (!priceBehavior && typeof allocation === "number") {
|
|
16438
|
-
return /* @__PURE__ */ (0,
|
|
16532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16439
16533
|
formatNumber(allocation),
|
|
16440
16534
|
" ",
|
|
16441
16535
|
getFeatureName(feature, allocation)
|
|
@@ -16453,7 +16547,8 @@ var UsageDetails = ({
|
|
|
16453
16547
|
priceBehavior,
|
|
16454
16548
|
softLimit,
|
|
16455
16549
|
billingPrice,
|
|
16456
|
-
currentTier?.to
|
|
16550
|
+
currentTier?.to,
|
|
16551
|
+
showCredits
|
|
16457
16552
|
]);
|
|
16458
16553
|
const usageText = (0, import_react41.useMemo)(() => {
|
|
16459
16554
|
if (!feature) {
|
|
@@ -16464,10 +16559,10 @@ var UsageDetails = ({
|
|
|
16464
16559
|
let index = 0;
|
|
16465
16560
|
if (priceBehavior === "pay_in_advance" /* PayInAdvance */ && typeof period === "string" && typeof price === "number") {
|
|
16466
16561
|
acc.push(
|
|
16467
|
-
/* @__PURE__ */ (0,
|
|
16562
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react41.Fragment, { children: [
|
|
16468
16563
|
formatCurrency(price, currency),
|
|
16469
16564
|
"/",
|
|
16470
|
-
packageSize > 1 && /* @__PURE__ */ (0,
|
|
16565
|
+
packageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16471
16566
|
packageSize,
|
|
16472
16567
|
" "
|
|
16473
16568
|
] }),
|
|
@@ -16479,7 +16574,7 @@ var UsageDetails = ({
|
|
|
16479
16574
|
index += 1;
|
|
16480
16575
|
} else if ((priceBehavior === "pay_as_you_go" /* PayAsYouGo */ || priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */ || priceBehavior === "credit_burndown" /* Credit */) && typeof usage === "number") {
|
|
16481
16576
|
acc.push(
|
|
16482
|
-
/* @__PURE__ */ (0,
|
|
16577
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react41.Fragment, { children: [
|
|
16483
16578
|
usage,
|
|
16484
16579
|
" ",
|
|
16485
16580
|
getFeatureName(feature, usage),
|
|
@@ -16491,14 +16586,14 @@ var UsageDetails = ({
|
|
|
16491
16586
|
}
|
|
16492
16587
|
if (typeof cost === "number" && cost > 0) {
|
|
16493
16588
|
acc.push(
|
|
16494
|
-
/* @__PURE__ */ (0,
|
|
16495
|
-
acc.length > 0 && /* @__PURE__ */ (0,
|
|
16589
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react41.Fragment, { children: [
|
|
16590
|
+
acc.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: " \u2022 " }),
|
|
16496
16591
|
formatCurrency(cost, currency)
|
|
16497
16592
|
] }, index)
|
|
16498
16593
|
);
|
|
16499
16594
|
index += 1;
|
|
16500
16595
|
if (feature.featureType === "trait" /* Trait */ && typeof period === "string") {
|
|
16501
|
-
acc.push(/* @__PURE__ */ (0,
|
|
16596
|
+
acc.push(/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react41.Fragment, { children: [
|
|
16502
16597
|
"/",
|
|
16503
16598
|
shortenPeriod(period)
|
|
16504
16599
|
] }, index));
|
|
@@ -16507,8 +16602,8 @@ var UsageDetails = ({
|
|
|
16507
16602
|
}
|
|
16508
16603
|
if (metricResetAt) {
|
|
16509
16604
|
acc.push(
|
|
16510
|
-
/* @__PURE__ */ (0,
|
|
16511
|
-
acc.length > 0 && /* @__PURE__ */ (0,
|
|
16605
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react41.Fragment, { children: [
|
|
16606
|
+
acc.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: " \u2022 " }),
|
|
16512
16607
|
t2("Resets", {
|
|
16513
16608
|
date: toPrettyDate(metricResetAt, {
|
|
16514
16609
|
month: "numeric",
|
|
@@ -16542,20 +16637,20 @@ var UsageDetails = ({
|
|
|
16542
16637
|
billingPrice,
|
|
16543
16638
|
cost
|
|
16544
16639
|
]);
|
|
16545
|
-
if (!text || !feature
|
|
16640
|
+
if (!text && !usageText || !feature) {
|
|
16546
16641
|
return null;
|
|
16547
16642
|
}
|
|
16548
|
-
return /* @__PURE__ */ (0,
|
|
16643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
16549
16644
|
Box,
|
|
16550
16645
|
{
|
|
16551
16646
|
$flexBasis: "min-content",
|
|
16552
16647
|
$flexGrow: "1",
|
|
16553
16648
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
16554
16649
|
children: [
|
|
16555
|
-
layout.entitlement.isVisible && /* @__PURE__ */ (0,
|
|
16556
|
-
layout.usage.isVisible && usageText && /* @__PURE__ */ (0,
|
|
16557
|
-
/* @__PURE__ */ (0,
|
|
16558
|
-
priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0,
|
|
16650
|
+
layout.entitlement.isVisible && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { display: layout.entitlement.fontStyle, $leading: 1, children: text }) }),
|
|
16651
|
+
layout.usage.isVisible && usageText && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { $justifyContent: "end", $alignItems: "end", $whiteSpace: "nowrap", children: [
|
|
16652
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { display: layout.usage.fontStyle, $leading: 1, children: usageText }),
|
|
16653
|
+
priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16559
16654
|
PricingTiersTooltip,
|
|
16560
16655
|
{
|
|
16561
16656
|
feature,
|
|
@@ -16571,7 +16666,7 @@ var UsageDetails = ({
|
|
|
16571
16666
|
};
|
|
16572
16667
|
|
|
16573
16668
|
// src/components/elements/included-features/IncludedFeatures.tsx
|
|
16574
|
-
var
|
|
16669
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
16575
16670
|
function resolveDesignProps2(props) {
|
|
16576
16671
|
return {
|
|
16577
16672
|
header: {
|
|
@@ -16646,7 +16741,7 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16646
16741
|
}
|
|
16647
16742
|
const shouldShowExpand = featureListSize > VISIBLE_ENTITLEMENT_COUNT;
|
|
16648
16743
|
const isExpanded = showCount > VISIBLE_ENTITLEMENT_COUNT;
|
|
16649
|
-
return /* @__PURE__ */ (0,
|
|
16744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16650
16745
|
Element,
|
|
16651
16746
|
{
|
|
16652
16747
|
as: Flex,
|
|
@@ -16655,10 +16750,10 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16655
16750
|
$flexDirection: "column",
|
|
16656
16751
|
$gap: "1rem",
|
|
16657
16752
|
children: [
|
|
16658
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
16753
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { display: props.header.fontStyle, children: props.header.text }) }),
|
|
16659
16754
|
featureUsage.slice(0, showCount).map((entitlement, index) => {
|
|
16660
16755
|
const shouldShowDetails = entitlement.feature?.name && (entitlement.feature?.featureType === "event" /* Event */ || entitlement.feature?.featureType === "trait" /* Trait */);
|
|
16661
|
-
return /* @__PURE__ */ (0,
|
|
16756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16662
16757
|
Flex,
|
|
16663
16758
|
{
|
|
16664
16759
|
ref: (el) => {
|
|
@@ -16671,7 +16766,7 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16671
16766
|
$alignItems: "center",
|
|
16672
16767
|
$gap: "1rem",
|
|
16673
16768
|
children: [
|
|
16674
|
-
/* @__PURE__ */ (0,
|
|
16769
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16675
16770
|
Flex,
|
|
16676
16771
|
{
|
|
16677
16772
|
$alignItems: "center",
|
|
@@ -16679,7 +16774,7 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16679
16774
|
$flexBasis: "min-content",
|
|
16680
16775
|
$gap: "1rem",
|
|
16681
16776
|
children: [
|
|
16682
|
-
props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ (0,
|
|
16777
|
+
props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16683
16778
|
Icon3,
|
|
16684
16779
|
{
|
|
16685
16780
|
name: entitlement.feature.icon,
|
|
@@ -16688,8 +16783,8 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16688
16783
|
rounded: true
|
|
16689
16784
|
}
|
|
16690
16785
|
),
|
|
16691
|
-
entitlement.feature?.name && /* @__PURE__ */ (0,
|
|
16692
|
-
props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ (0,
|
|
16786
|
+
entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { display: props.icons.fontStyle, children: entitlement.feature.name }),
|
|
16787
|
+
props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16693
16788
|
Text,
|
|
16694
16789
|
{
|
|
16695
16790
|
display: props.entitlementExpiration.fontStyle,
|
|
@@ -16706,7 +16801,7 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16706
16801
|
]
|
|
16707
16802
|
}
|
|
16708
16803
|
),
|
|
16709
|
-
shouldShowDetails && /* @__PURE__ */ (0,
|
|
16804
|
+
shouldShowDetails && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16710
16805
|
UsageDetails,
|
|
16711
16806
|
{
|
|
16712
16807
|
entitlement,
|
|
@@ -16719,15 +16814,15 @@ var IncludedFeatures = (0, import_react42.forwardRef)(({ className, ...rest }, r
|
|
|
16719
16814
|
index
|
|
16720
16815
|
);
|
|
16721
16816
|
}),
|
|
16722
|
-
shouldShowExpand && /* @__PURE__ */ (0,
|
|
16723
|
-
/* @__PURE__ */ (0,
|
|
16817
|
+
shouldShowExpand && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Flex, { $alignItems: "center", $justifyContent: "start", $marginTop: "1rem", children: [
|
|
16818
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16724
16819
|
Icon3,
|
|
16725
16820
|
{
|
|
16726
16821
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
16727
16822
|
color: "#D0D0D0"
|
|
16728
16823
|
}
|
|
16729
16824
|
),
|
|
16730
|
-
/* @__PURE__ */ (0,
|
|
16825
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16731
16826
|
Text,
|
|
16732
16827
|
{
|
|
16733
16828
|
onClick: handleToggleShowAll,
|
|
@@ -16745,7 +16840,7 @@ IncludedFeatures.displayName = "IncludedFeatures";
|
|
|
16745
16840
|
|
|
16746
16841
|
// src/components/elements/invoices/Invoices.tsx
|
|
16747
16842
|
var import_react43 = require("react");
|
|
16748
|
-
var
|
|
16843
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
16749
16844
|
function resolveDesignProps3(props) {
|
|
16750
16845
|
return {
|
|
16751
16846
|
header: {
|
|
@@ -16815,9 +16910,9 @@ var Invoices = (0, import_react43.forwardRef)(({ className, data, ...rest }, ref
|
|
|
16815
16910
|
if (invoices.length === 0) {
|
|
16816
16911
|
return null;
|
|
16817
16912
|
}
|
|
16818
|
-
return /* @__PURE__ */ (0,
|
|
16819
|
-
/* @__PURE__ */ (0,
|
|
16820
|
-
error ? /* @__PURE__ */ (0,
|
|
16913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Element, { ref, className, children: [
|
|
16914
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
|
|
16915
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
16821
16916
|
Flex,
|
|
16822
16917
|
{
|
|
16823
16918
|
as: TransitionBox,
|
|
@@ -16826,8 +16921,8 @@ var Invoices = (0, import_react43.forwardRef)(({ className, data, ...rest }, ref
|
|
|
16826
16921
|
$alignItems: "center",
|
|
16827
16922
|
$gap: "1rem",
|
|
16828
16923
|
children: [
|
|
16829
|
-
/* @__PURE__ */ (0,
|
|
16830
|
-
/* @__PURE__ */ (0,
|
|
16924
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your invoices.") }),
|
|
16925
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
16831
16926
|
Button,
|
|
16832
16927
|
{
|
|
16833
16928
|
type: "button",
|
|
@@ -16840,12 +16935,12 @@ var Invoices = (0, import_react43.forwardRef)(({ className, data, ...rest }, ref
|
|
|
16840
16935
|
)
|
|
16841
16936
|
]
|
|
16842
16937
|
}
|
|
16843
|
-
) : !isLoading && /* @__PURE__ */ (0,
|
|
16844
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
16845
|
-
invoices.length > 0 ? /* @__PURE__ */ (0,
|
|
16846
|
-
/* @__PURE__ */ (0,
|
|
16847
|
-
return /* @__PURE__ */ (0,
|
|
16848
|
-
props.date.isVisible && /* @__PURE__ */ (0,
|
|
16938
|
+
) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TransitionBox, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
16939
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { display: props.header.fontStyle, children: t2("Invoices") }) }),
|
|
16940
|
+
invoices.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
16941
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, url }, index) => {
|
|
16942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $justifyContent: "space-between", children: [
|
|
16943
|
+
props.date.isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
16849
16944
|
Text,
|
|
16850
16945
|
{
|
|
16851
16946
|
display: props.date.fontStyle,
|
|
@@ -16859,18 +16954,18 @@ var Invoices = (0, import_react43.forwardRef)(({ className, data, ...rest }, ref
|
|
|
16859
16954
|
children: date
|
|
16860
16955
|
}
|
|
16861
16956
|
),
|
|
16862
|
-
props.amount.isVisible && /* @__PURE__ */ (0,
|
|
16957
|
+
props.amount.isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { display: props.amount.fontStyle, children: amount })
|
|
16863
16958
|
] }, index);
|
|
16864
16959
|
}) }),
|
|
16865
|
-
props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ (0,
|
|
16866
|
-
/* @__PURE__ */ (0,
|
|
16960
|
+
props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
16961
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
16867
16962
|
Icon3,
|
|
16868
16963
|
{
|
|
16869
16964
|
name: `chevron-${listSize === props.limit.number ? "down" : "up"}`,
|
|
16870
16965
|
color: "#D0D0D0"
|
|
16871
16966
|
}
|
|
16872
16967
|
),
|
|
16873
|
-
/* @__PURE__ */ (0,
|
|
16968
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
16874
16969
|
Text,
|
|
16875
16970
|
{
|
|
16876
16971
|
onClick: toggleListSize,
|
|
@@ -16882,7 +16977,7 @@ var Invoices = (0, import_react43.forwardRef)(({ className, data, ...rest }, ref
|
|
|
16882
16977
|
}
|
|
16883
16978
|
)
|
|
16884
16979
|
] })
|
|
16885
|
-
] }) : /* @__PURE__ */ (0,
|
|
16980
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { display: "heading2", children: t2("No invoices created yet") })
|
|
16886
16981
|
] }) })
|
|
16887
16982
|
] });
|
|
16888
16983
|
});
|
|
@@ -16892,14 +16987,14 @@ Invoices.displayName = "Invoices";
|
|
|
16892
16987
|
var import_react44 = require("react");
|
|
16893
16988
|
|
|
16894
16989
|
// src/components/elements/metered-features/Meter.tsx
|
|
16895
|
-
var
|
|
16990
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
16896
16991
|
var Meter = ({ entitlement, usageDetails }) => {
|
|
16897
16992
|
const { priceBehavior, usage } = entitlement;
|
|
16898
16993
|
const limit = usageDetails.limit ?? usageDetails.currentTier?.to;
|
|
16899
16994
|
if (typeof usage !== "number" || !limit || limit === Infinity) {
|
|
16900
16995
|
return null;
|
|
16901
16996
|
}
|
|
16902
|
-
const meter = /* @__PURE__ */ (0,
|
|
16997
|
+
const meter = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
16903
16998
|
ProgressBar,
|
|
16904
16999
|
{
|
|
16905
17000
|
progress: Math.min(usage, limit) / Math.max(usage, limit) * 100,
|
|
@@ -16916,7 +17011,7 @@ var Meter = ({ entitlement, usageDetails }) => {
|
|
|
16916
17011
|
};
|
|
16917
17012
|
|
|
16918
17013
|
// src/components/elements/metered-features/PriceDetails.tsx
|
|
16919
|
-
var
|
|
17014
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
16920
17015
|
var PriceDetails = ({
|
|
16921
17016
|
entitlement,
|
|
16922
17017
|
usageDetails,
|
|
@@ -16943,7 +17038,7 @@ var PriceDetails = ({
|
|
|
16943
17038
|
if (!feature || typeof currentTierPerUnitPrice !== "number") {
|
|
16944
17039
|
return null;
|
|
16945
17040
|
}
|
|
16946
|
-
return /* @__PURE__ */ (0,
|
|
17041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
16947
17042
|
Flex,
|
|
16948
17043
|
{
|
|
16949
17044
|
$justifyContent: "space-between",
|
|
@@ -16957,30 +17052,30 @@ var PriceDetails = ({
|
|
|
16957
17052
|
$borderBottomRightRadius: `${settings.theme.card.borderRadius / TEXT_BASE_SIZE}rem`
|
|
16958
17053
|
},
|
|
16959
17054
|
children: [
|
|
16960
|
-
priceBehavior === "overage" /* Overage */ ? /* @__PURE__ */ (0,
|
|
17055
|
+
priceBehavior === "overage" /* Overage */ ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
|
|
16961
17056
|
t2("Additional"),
|
|
16962
17057
|
": ",
|
|
16963
17058
|
formatCurrency(currentTierPerUnitPrice, currency),
|
|
16964
|
-
/* @__PURE__ */ (0,
|
|
17059
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box, { as: "sub", $whiteSpace: "nowrap", children: [
|
|
16965
17060
|
"/",
|
|
16966
|
-
packageSize > 1 && /* @__PURE__ */ (0,
|
|
17061
|
+
packageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
16967
17062
|
packageSize,
|
|
16968
17063
|
" "
|
|
16969
17064
|
] }),
|
|
16970
17065
|
getFeatureName(feature, packageSize),
|
|
16971
|
-
feature.featureType === "trait" /* Trait */ && period && /* @__PURE__ */ (0,
|
|
17066
|
+
feature.featureType === "trait" /* Trait */ && period && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
16972
17067
|
"/",
|
|
16973
17068
|
shortenPeriod(period)
|
|
16974
17069
|
] })
|
|
16975
17070
|
] })
|
|
16976
|
-
] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0,
|
|
16977
|
-
/* @__PURE__ */ (0,
|
|
17071
|
+
] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Flex, { $alignItems: "end", children: [
|
|
17072
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
|
|
16978
17073
|
t2("Tier"),
|
|
16979
17074
|
": ",
|
|
16980
17075
|
currentTier?.from || 1,
|
|
16981
|
-
typeof currentTier?.to === "number" && (currentTier?.from || 1) !== currentTier?.to && /* @__PURE__ */ (0,
|
|
17076
|
+
typeof currentTier?.to === "number" && (currentTier?.from || 1) !== currentTier?.to && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: currentTier.to === Infinity ? "+" : `\u2013${currentTier.to}` })
|
|
16982
17077
|
] }),
|
|
16983
|
-
/* @__PURE__ */ (0,
|
|
17078
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
16984
17079
|
PricingTiersTooltip,
|
|
16985
17080
|
{
|
|
16986
17081
|
period,
|
|
@@ -16991,19 +17086,19 @@ var PriceDetails = ({
|
|
|
16991
17086
|
}
|
|
16992
17087
|
)
|
|
16993
17088
|
] }),
|
|
16994
|
-
typeof amount === "number" && /* @__PURE__ */ (0,
|
|
17089
|
+
typeof amount === "number" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: priceBehavior === "overage" /* Overage */ ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
|
|
16995
17090
|
formatNumber(amount),
|
|
16996
17091
|
" ",
|
|
16997
17092
|
getFeatureName(feature, amount),
|
|
16998
17093
|
" \xB7 ",
|
|
16999
17094
|
formatCurrency(currentTierPerUnitPrice * amount, currency),
|
|
17000
|
-
feature.featureType === "trait" /* Trait */ && typeof period === "string" && /* @__PURE__ */ (0,
|
|
17095
|
+
feature.featureType === "trait" /* Trait */ && typeof period === "string" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box, { as: "sub", $whiteSpace: "nowrap", children: [
|
|
17001
17096
|
"/",
|
|
17002
17097
|
shortenPeriod(period)
|
|
17003
17098
|
] })
|
|
17004
|
-
] }) : priceBehavior === "tier" /* Tiered */ && typeof cost === "number" && /* @__PURE__ */ (0,
|
|
17099
|
+
] }) : priceBehavior === "tier" /* Tiered */ && typeof cost === "number" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { children: [
|
|
17005
17100
|
formatCurrency(cost, currency),
|
|
17006
|
-
feature.featureType === "trait" /* Trait */ && typeof period === "string" && /* @__PURE__ */ (0,
|
|
17101
|
+
feature.featureType === "trait" /* Trait */ && typeof period === "string" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box, { as: "sub", $whiteSpace: "nowrap", children: [
|
|
17007
17102
|
"/",
|
|
17008
17103
|
shortenPeriod(period)
|
|
17009
17104
|
] })
|
|
@@ -17031,7 +17126,7 @@ var Container2 = dt.div`
|
|
|
17031
17126
|
`;
|
|
17032
17127
|
|
|
17033
17128
|
// src/components/elements/metered-features/MeteredFeatures.tsx
|
|
17034
|
-
var
|
|
17129
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
17035
17130
|
var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
17036
17131
|
const { t: t2 } = useTranslation();
|
|
17037
17132
|
const { feature, priceBehavior, allocation, usage, metricResetAt } = entitlement;
|
|
@@ -17045,7 +17140,9 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
|
17045
17140
|
feature: getFeatureName(feature)
|
|
17046
17141
|
}) : priceBehavior === "overage" /* Overage */ && typeof limit === "number" ? t2("X included", {
|
|
17047
17142
|
amount: formatNumber(limit)
|
|
17048
|
-
}) : priceBehavior === "pay_in_advance" /* PayInAdvance */ && typeof usage === "number" ? `${formatNumber(usage)} ${t2("used")}` : priceBehavior === "pay_as_you_go" /* PayAsYouGo */ && typeof cost === "number" ? formatCurrency(cost, billingPrice?.currency) : typeof
|
|
17143
|
+
}) : priceBehavior === "pay_in_advance" /* PayInAdvance */ && typeof usage === "number" ? `${formatNumber(usage)} ${t2("used")}` : priceBehavior === "pay_as_you_go" /* PayAsYouGo */ && typeof cost === "number" ? formatCurrency(cost, billingPrice?.currency) : priceBehavior === "credit_burndown" /* Credit */ && typeof limit === "number" ? t2("Limit of", {
|
|
17144
|
+
amount: formatNumber(limit)
|
|
17145
|
+
}) : typeof allocation === "number" ? t2("Limit of", {
|
|
17049
17146
|
amount: formatNumber(allocation)
|
|
17050
17147
|
}) : t2("No limit")
|
|
17051
17148
|
);
|
|
@@ -17060,7 +17157,7 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
|
17060
17157
|
})
|
|
17061
17158
|
);
|
|
17062
17159
|
}
|
|
17063
|
-
return /* @__PURE__ */ (0,
|
|
17160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { display: fontStyle, children: acc.join(" \u2022 ") }) });
|
|
17064
17161
|
};
|
|
17065
17162
|
function resolveDesignProps4(props) {
|
|
17066
17163
|
return {
|
|
@@ -17094,7 +17191,8 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17094
17191
|
const { t: t2 } = useTranslation();
|
|
17095
17192
|
const { data, settings, setCheckoutState } = useEmbed();
|
|
17096
17193
|
const isLightBackground = useIsLightBackground();
|
|
17097
|
-
const { period, meteredFeatures, creditGroups } = (0, import_react44.useMemo)(() => {
|
|
17194
|
+
const { period, meteredFeatures, creditGroups, showCredits } = (0, import_react44.useMemo)(() => {
|
|
17195
|
+
const showCredits2 = data?.showCredits ?? true;
|
|
17098
17196
|
if (isCheckoutData(data)) {
|
|
17099
17197
|
const period2 = typeof data.company?.plan?.planPeriod === "string" ? data.company?.plan?.planPeriod : void 0;
|
|
17100
17198
|
const orderedFeatureUsage = props.visibleFeatures?.reduce(
|
|
@@ -17112,20 +17210,19 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17112
17210
|
return {
|
|
17113
17211
|
period: period2,
|
|
17114
17212
|
meteredFeatures: (orderedFeatureUsage || data.featureUsage?.features || []).filter(
|
|
17115
|
-
({
|
|
17116
|
-
// credit-based entitlements behave differently and should not be shown as a metered feature
|
|
17117
|
-
priceBehavior !== "credit_burndown" /* Credit */ && (feature?.featureType === "event" /* Event */ || feature?.featureType === "trait" /* Trait */)
|
|
17118
|
-
)
|
|
17213
|
+
({ feature }) => feature?.featureType === "event" /* Event */ || feature?.featureType === "trait" /* Trait */
|
|
17119
17214
|
),
|
|
17120
17215
|
creditGroups: groupCreditGrants(data.creditGrants, {
|
|
17121
17216
|
groupBy: "credit"
|
|
17122
|
-
})
|
|
17217
|
+
}),
|
|
17218
|
+
showCredits: showCredits2
|
|
17123
17219
|
};
|
|
17124
17220
|
}
|
|
17125
17221
|
return {
|
|
17126
17222
|
period: void 0,
|
|
17127
17223
|
meteredFeatures: [],
|
|
17128
|
-
creditGroups: []
|
|
17224
|
+
creditGroups: [],
|
|
17225
|
+
showCredits: showCredits2
|
|
17129
17226
|
};
|
|
17130
17227
|
}, [props.visibleFeatures, data]);
|
|
17131
17228
|
const [creditVisibility, setCreditVisibility] = (0, import_react44.useState)(
|
|
@@ -17142,7 +17239,7 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17142
17239
|
if (!shouldShowFeatures) {
|
|
17143
17240
|
return null;
|
|
17144
17241
|
}
|
|
17145
|
-
return /* @__PURE__ */ (0,
|
|
17242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Container2, { ref, className, children: [
|
|
17146
17243
|
meteredFeatures.reduce((acc, entitlement, index) => {
|
|
17147
17244
|
if (!entitlement.feature) {
|
|
17148
17245
|
return acc;
|
|
@@ -17151,9 +17248,9 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17151
17248
|
const usageDetails = getUsageDetails(entitlement, period);
|
|
17152
17249
|
const { limit } = usageDetails;
|
|
17153
17250
|
acc.push(
|
|
17154
|
-
/* @__PURE__ */ (0,
|
|
17155
|
-
/* @__PURE__ */ (0,
|
|
17156
|
-
props.icon.isVisible && /* @__PURE__ */ (0,
|
|
17251
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Element, { as: Flex, $flexDirection: "column", $gap: "1.5rem", children: [
|
|
17252
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $gap: "1.5rem", children: [
|
|
17253
|
+
props.icon.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17157
17254
|
Icon3,
|
|
17158
17255
|
{
|
|
17159
17256
|
name: feature.icon,
|
|
@@ -17162,8 +17259,8 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17162
17259
|
rounded: true
|
|
17163
17260
|
}
|
|
17164
17261
|
),
|
|
17165
|
-
/* @__PURE__ */ (0,
|
|
17166
|
-
/* @__PURE__ */ (0,
|
|
17262
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
|
|
17263
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
17167
17264
|
Flex,
|
|
17168
17265
|
{
|
|
17169
17266
|
ref: (el) => {
|
|
@@ -17174,31 +17271,31 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17174
17271
|
$flexWrap: "wrap",
|
|
17175
17272
|
$gap: "1rem",
|
|
17176
17273
|
children: [
|
|
17177
|
-
/* @__PURE__ */ (0,
|
|
17178
|
-
/* @__PURE__ */ (0,
|
|
17179
|
-
props.description.isVisible && /* @__PURE__ */ (0,
|
|
17274
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
|
|
17275
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { display: props.header.fontStyle, children: feature.name }) }),
|
|
17276
|
+
props.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { display: props.description.fontStyle, children: feature.description }) })
|
|
17180
17277
|
] }),
|
|
17181
|
-
/* @__PURE__ */ (0,
|
|
17278
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
17182
17279
|
Box,
|
|
17183
17280
|
{
|
|
17184
17281
|
$flexBasis: "min-content",
|
|
17185
17282
|
$flexGrow: 1,
|
|
17186
17283
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
17187
17284
|
children: [
|
|
17188
|
-
props.usage.isVisible && /* @__PURE__ */ (0,
|
|
17189
|
-
typeof limit === "number" && /* @__PURE__ */ (0,
|
|
17285
|
+
props.usage.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { display: props.usage.fontStyle, children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
17286
|
+
typeof limit === "number" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
17190
17287
|
formatNumber(limit),
|
|
17191
17288
|
" "
|
|
17192
17289
|
] }),
|
|
17193
17290
|
getFeatureName(feature, limit)
|
|
17194
|
-
] }) : typeof usage === "number" && /* @__PURE__ */ (0,
|
|
17291
|
+
] }) : typeof usage === "number" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
17195
17292
|
formatNumber(usage),
|
|
17196
17293
|
" ",
|
|
17197
17294
|
getFeatureName(feature, usage),
|
|
17198
17295
|
" ",
|
|
17199
17296
|
t2("used")
|
|
17200
17297
|
] }) }) }),
|
|
17201
|
-
props.allocation.isVisible && /* @__PURE__ */ (0,
|
|
17298
|
+
props.allocation.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17202
17299
|
Limit,
|
|
17203
17300
|
{
|
|
17204
17301
|
entitlement,
|
|
@@ -17212,14 +17309,14 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17212
17309
|
]
|
|
17213
17310
|
}
|
|
17214
17311
|
),
|
|
17215
|
-
props.isVisible && priceBehavior !== "pay_as_you_go" /* PayAsYouGo */ && /* @__PURE__ */ (0,
|
|
17312
|
+
props.isVisible && priceBehavior !== "pay_as_you_go" /* PayAsYouGo */ && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17216
17313
|
Meter,
|
|
17217
17314
|
{
|
|
17218
17315
|
entitlement,
|
|
17219
17316
|
usageDetails
|
|
17220
17317
|
}
|
|
17221
17318
|
),
|
|
17222
|
-
priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ (0,
|
|
17319
|
+
priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17223
17320
|
Button,
|
|
17224
17321
|
{
|
|
17225
17322
|
type: "button",
|
|
@@ -17232,7 +17329,7 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17232
17329
|
)
|
|
17233
17330
|
] })
|
|
17234
17331
|
] }),
|
|
17235
|
-
(priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ (0,
|
|
17332
|
+
(priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17236
17333
|
PriceDetails,
|
|
17237
17334
|
{
|
|
17238
17335
|
entitlement,
|
|
@@ -17244,11 +17341,11 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17244
17341
|
);
|
|
17245
17342
|
return acc;
|
|
17246
17343
|
}, []),
|
|
17247
|
-
creditGroups.map((credit, index) => {
|
|
17344
|
+
showCredits && creditGroups.map((credit, index) => {
|
|
17248
17345
|
const isExpanded = creditVisibility.find(({ id }) => credit.id === id)?.isExpanded ?? false;
|
|
17249
|
-
return /* @__PURE__ */ (0,
|
|
17250
|
-
/* @__PURE__ */ (0,
|
|
17251
|
-
props.icon.isVisible && /* @__PURE__ */ (0,
|
|
17346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Element, { as: Flex, $flexDirection: "column", $gap: "1rem", children: [
|
|
17347
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $gap: "1.5rem", children: [
|
|
17348
|
+
props.icon.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17252
17349
|
Icon3,
|
|
17253
17350
|
{
|
|
17254
17351
|
name: credit.icon,
|
|
@@ -17257,13 +17354,13 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17257
17354
|
rounded: true
|
|
17258
17355
|
}
|
|
17259
17356
|
),
|
|
17260
|
-
/* @__PURE__ */ (0,
|
|
17261
|
-
/* @__PURE__ */ (0,
|
|
17262
|
-
/* @__PURE__ */ (0,
|
|
17263
|
-
props.description.isVisible && /* @__PURE__ */ (0,
|
|
17357
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
|
|
17358
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Flex, { $flexWrap: "wrap", $gap: "1rem", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
|
|
17359
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { display: props.header.fontStyle, children: credit.name }) }),
|
|
17360
|
+
props.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { display: props.description.fontStyle, children: credit.description }) })
|
|
17264
17361
|
] }) }),
|
|
17265
|
-
/* @__PURE__ */ (0,
|
|
17266
|
-
/* @__PURE__ */ (0,
|
|
17362
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $gap: "1rem", children: [
|
|
17363
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17267
17364
|
ProgressBar,
|
|
17268
17365
|
{
|
|
17269
17366
|
progress: credit.total.used / credit.total.value * 100,
|
|
@@ -17274,7 +17371,7 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17274
17371
|
)]
|
|
17275
17372
|
}
|
|
17276
17373
|
),
|
|
17277
|
-
/* @__PURE__ */ (0,
|
|
17374
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17278
17375
|
Button,
|
|
17279
17376
|
{
|
|
17280
17377
|
type: "button",
|
|
@@ -17289,12 +17386,12 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17289
17386
|
] })
|
|
17290
17387
|
] })
|
|
17291
17388
|
] }),
|
|
17292
|
-
/* @__PURE__ */ (0,
|
|
17389
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17293
17390
|
Box,
|
|
17294
17391
|
{
|
|
17295
17392
|
$width: `calc(100% + ${2 * settings.theme.card.padding / TEXT_BASE_SIZE}rem)`,
|
|
17296
17393
|
$margin: `0 0 0 -${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
17297
|
-
children: /* @__PURE__ */ (0,
|
|
17394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17298
17395
|
TransitionBox,
|
|
17299
17396
|
{
|
|
17300
17397
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.0375)" : "hsla(0, 0%, 100%, 0.075)",
|
|
@@ -17302,19 +17399,19 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17302
17399
|
children: credit.grants.map((grant, index2) => {
|
|
17303
17400
|
const paddingX = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
17304
17401
|
const padding = index2 > 0 ? `0 ${paddingX}rem 1rem` : `1rem ${paddingX}rem`;
|
|
17305
|
-
return /* @__PURE__ */ (0,
|
|
17306
|
-
/* @__PURE__ */ (0,
|
|
17402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { $display: "table-row", children: grant.grantReason === "plan" /* Plan */ ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
17403
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { children: t2("X items included in plan", {
|
|
17307
17404
|
amount: grant.quantity,
|
|
17308
17405
|
item: getFeatureName(credit, grant.quantity)
|
|
17309
17406
|
}) }) }),
|
|
17310
|
-
/* @__PURE__ */ (0,
|
|
17407
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17311
17408
|
Box,
|
|
17312
17409
|
{
|
|
17313
17410
|
$display: "table-cell",
|
|
17314
17411
|
$padding: padding,
|
|
17315
17412
|
$textAlign: "right",
|
|
17316
17413
|
$whiteSpace: "nowrap",
|
|
17317
|
-
children: grant.expiresAt && /* @__PURE__ */ (0,
|
|
17414
|
+
children: grant.expiresAt && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { children: t2("Resets", {
|
|
17318
17415
|
date: toPrettyDate(
|
|
17319
17416
|
modifyDate(grant.expiresAt, 1),
|
|
17320
17417
|
{
|
|
@@ -17326,8 +17423,8 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17326
17423
|
}) })
|
|
17327
17424
|
}
|
|
17328
17425
|
)
|
|
17329
|
-
] }) : /* @__PURE__ */ (0,
|
|
17330
|
-
/* @__PURE__ */ (0,
|
|
17426
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
17427
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { children: grant.grantReason === "purchased" /* Purchased */ ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: t2("X item bundle", {
|
|
17331
17428
|
amount: grant.quantity,
|
|
17332
17429
|
item: getFeatureName(credit, 1),
|
|
17333
17430
|
createdAt: toPrettyDate(grant.createdAt, {
|
|
@@ -17335,7 +17432,7 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17335
17432
|
month: "2-digit",
|
|
17336
17433
|
year: "2-digit"
|
|
17337
17434
|
})
|
|
17338
|
-
}) }) : /* @__PURE__ */ (0,
|
|
17435
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: t2("X item grant", {
|
|
17339
17436
|
amount: grant.quantity,
|
|
17340
17437
|
item: getFeatureName(
|
|
17341
17438
|
credit,
|
|
@@ -17347,14 +17444,14 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17347
17444
|
year: "2-digit"
|
|
17348
17445
|
})
|
|
17349
17446
|
}) }) }) }),
|
|
17350
|
-
/* @__PURE__ */ (0,
|
|
17447
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17351
17448
|
Box,
|
|
17352
17449
|
{
|
|
17353
17450
|
$display: "table-cell",
|
|
17354
17451
|
$padding: padding,
|
|
17355
17452
|
$textAlign: "right",
|
|
17356
17453
|
$whiteSpace: "nowrap",
|
|
17357
|
-
children: grant.expiresAt && /* @__PURE__ */ (0,
|
|
17454
|
+
children: grant.expiresAt && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { children: t2("Expires", {
|
|
17358
17455
|
date: toPrettyDate(
|
|
17359
17456
|
modifyDate(grant.expiresAt, 1),
|
|
17360
17457
|
{
|
|
@@ -17372,8 +17469,8 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17372
17469
|
)
|
|
17373
17470
|
}
|
|
17374
17471
|
),
|
|
17375
|
-
/* @__PURE__ */ (0,
|
|
17376
|
-
/* @__PURE__ */ (0,
|
|
17472
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $gap: "0.25rem", children: [
|
|
17473
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17377
17474
|
Icon3,
|
|
17378
17475
|
{
|
|
17379
17476
|
name: "chevron-down",
|
|
@@ -17384,7 +17481,7 @@ var MeteredFeatures = (0, import_react44.forwardRef)(({ className, ...rest }, re
|
|
|
17384
17481
|
}
|
|
17385
17482
|
}
|
|
17386
17483
|
),
|
|
17387
|
-
/* @__PURE__ */ (0,
|
|
17484
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
17388
17485
|
Text,
|
|
17389
17486
|
{
|
|
17390
17487
|
onClick: () => toggleBalanceDetails(credit.id),
|
|
@@ -17404,24 +17501,24 @@ var import_react46 = require("react");
|
|
|
17404
17501
|
|
|
17405
17502
|
// src/components/elements/payment-method/PaymentMethodElement.tsx
|
|
17406
17503
|
var import_react45 = require("react");
|
|
17407
|
-
var
|
|
17504
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
17408
17505
|
var PaymentElement2 = ({
|
|
17409
17506
|
iconName,
|
|
17410
17507
|
iconTitle,
|
|
17411
17508
|
label,
|
|
17412
17509
|
paymentLast4
|
|
17413
17510
|
}) => {
|
|
17414
|
-
return /* @__PURE__ */ (0,
|
|
17415
|
-
iconName && /* @__PURE__ */ (0,
|
|
17416
|
-
(label || paymentLast4) && /* @__PURE__ */ (0,
|
|
17417
|
-
label && /* @__PURE__ */ (0,
|
|
17511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
|
|
17512
|
+
iconName && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon3, { name: iconName, title: iconTitle }),
|
|
17513
|
+
(label || paymentLast4) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box, { $flexGrow: 1, children: [
|
|
17514
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: label }),
|
|
17418
17515
|
" ",
|
|
17419
|
-
paymentLast4 && /* @__PURE__ */ (0,
|
|
17516
|
+
paymentLast4 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: paymentLast4 })
|
|
17420
17517
|
] })
|
|
17421
17518
|
] }) });
|
|
17422
17519
|
};
|
|
17423
17520
|
var EmptyPaymentElement = () => {
|
|
17424
|
-
return /* @__PURE__ */ (0,
|
|
17521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Box, { $lineHeight: 1, children: t("No payment method added yet") }) }) }) });
|
|
17425
17522
|
};
|
|
17426
17523
|
var getPaymentMethodData = ({
|
|
17427
17524
|
accountLast4,
|
|
@@ -17486,12 +17583,12 @@ var PaymentMethodElement = ({
|
|
|
17486
17583
|
const { t: t2 } = useTranslation();
|
|
17487
17584
|
const isLightBackground = useIsLightBackground();
|
|
17488
17585
|
const sizeFactor = size === "lg" ? 1.5 : size === "md" ? 1 : 0.5;
|
|
17489
|
-
return /* @__PURE__ */ (0,
|
|
17490
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
17491
|
-
/* @__PURE__ */ (0,
|
|
17492
|
-
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ (0,
|
|
17586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
|
|
17587
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
|
|
17588
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { display: props.header.fontStyle, children: t2("Payment Method") }),
|
|
17589
|
+
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { $size: 14, $color: "#DB6769", children: monthsToExpiration > 0 ? t2("Expires in X months", { months: monthsToExpiration }) : t2("Expired") })
|
|
17493
17590
|
] }),
|
|
17494
|
-
/* @__PURE__ */ (0,
|
|
17591
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
17495
17592
|
Flex,
|
|
17496
17593
|
{
|
|
17497
17594
|
$justifyContent: "space-between",
|
|
@@ -17500,8 +17597,8 @@ var PaymentMethodElement = ({
|
|
|
17500
17597
|
$padding: `${sizeFactor / 2.25}rem ${sizeFactor}rem`,
|
|
17501
17598
|
$borderRadius: "9999px",
|
|
17502
17599
|
children: [
|
|
17503
|
-
paymentMethod ? /* @__PURE__ */ (0,
|
|
17504
|
-
props.functions.allowEdit && onEdit && /* @__PURE__ */ (0,
|
|
17600
|
+
paymentMethod ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PaymentElement2, { ...getPaymentMethodData(paymentMethod) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(EmptyPaymentElement, {}),
|
|
17601
|
+
props.functions.allowEdit && onEdit && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
17505
17602
|
Text,
|
|
17506
17603
|
{
|
|
17507
17604
|
onClick: onEdit,
|
|
@@ -17534,7 +17631,7 @@ var PaymentListElement = ({
|
|
|
17534
17631
|
}
|
|
17535
17632
|
return `${cardExpMonth}/${formatedYear}`;
|
|
17536
17633
|
}, [paymentMethod]);
|
|
17537
|
-
return /* @__PURE__ */ (0,
|
|
17634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
17538
17635
|
Flex,
|
|
17539
17636
|
{
|
|
17540
17637
|
$flexDirection: "row",
|
|
@@ -17546,21 +17643,21 @@ var PaymentListElement = ({
|
|
|
17546
17643
|
$borderStyle: "solid",
|
|
17547
17644
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
|
|
17548
17645
|
children: [
|
|
17549
|
-
iconName && /* @__PURE__ */ (0,
|
|
17550
|
-
(label || paymentLast4) && /* @__PURE__ */ (0,
|
|
17551
|
-
label && /* @__PURE__ */ (0,
|
|
17646
|
+
iconName && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon3, { name: iconName, title: iconTitle }),
|
|
17647
|
+
(label || paymentLast4) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box, { $flexGrow: 1, children: [
|
|
17648
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: label }),
|
|
17552
17649
|
" ",
|
|
17553
|
-
paymentLast4 && /* @__PURE__ */ (0,
|
|
17650
|
+
paymentLast4 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: paymentLast4 })
|
|
17554
17651
|
] }),
|
|
17555
|
-
expirationDate && /* @__PURE__ */ (0,
|
|
17652
|
+
expirationDate && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
17556
17653
|
Box,
|
|
17557
17654
|
{
|
|
17558
17655
|
$flexGrow: 1,
|
|
17559
17656
|
$color: isLightBackground ? "hsla(0, 0%, 0%, 0.375)" : "hsla(0, 0%, 100%, 0.375)",
|
|
17560
|
-
children: /* @__PURE__ */ (0,
|
|
17657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: t("Expires", { date: expirationDate }) })
|
|
17561
17658
|
}
|
|
17562
17659
|
),
|
|
17563
|
-
/* @__PURE__ */ (0,
|
|
17660
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
17564
17661
|
Text,
|
|
17565
17662
|
{
|
|
17566
17663
|
onClick: () => {
|
|
@@ -17573,7 +17670,7 @@ var PaymentListElement = ({
|
|
|
17573
17670
|
children: t("Set default")
|
|
17574
17671
|
}
|
|
17575
17672
|
) }),
|
|
17576
|
-
/* @__PURE__ */ (0,
|
|
17673
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
17577
17674
|
Icon3,
|
|
17578
17675
|
{
|
|
17579
17676
|
tabIndex: 0,
|
|
@@ -17595,7 +17692,7 @@ var PaymentListElement = ({
|
|
|
17595
17692
|
};
|
|
17596
17693
|
|
|
17597
17694
|
// src/components/elements/payment-method/PaymentMethod.tsx
|
|
17598
|
-
var
|
|
17695
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
17599
17696
|
var resolveDesignProps5 = (props) => {
|
|
17600
17697
|
return {
|
|
17601
17698
|
header: {
|
|
@@ -17636,7 +17733,7 @@ var PaymentMethod = (0, import_react46.forwardRef)(({ children, className, porta
|
|
|
17636
17733
|
monthsToExpiration: void 0
|
|
17637
17734
|
};
|
|
17638
17735
|
}, [data]);
|
|
17639
|
-
return /* @__PURE__ */ (0,
|
|
17736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Element, { ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
17640
17737
|
PaymentMethodElement,
|
|
17641
17738
|
{
|
|
17642
17739
|
paymentMethod,
|
|
@@ -17805,7 +17902,7 @@ var loadStripe = function loadStripe2() {
|
|
|
17805
17902
|
|
|
17806
17903
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
17807
17904
|
var import_react47 = require("react");
|
|
17808
|
-
var
|
|
17905
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
17809
17906
|
var resolveDesignProps6 = () => {
|
|
17810
17907
|
return {
|
|
17811
17908
|
header: {
|
|
@@ -17963,8 +18060,8 @@ var PaymentMethodDetails = ({
|
|
|
17963
18060
|
showPaymentForm,
|
|
17964
18061
|
initializePaymentMethod
|
|
17965
18062
|
]);
|
|
17966
|
-
return /* @__PURE__ */ (0,
|
|
17967
|
-
/* @__PURE__ */ (0,
|
|
18063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Flex, { $position: "relative", children: [
|
|
18064
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
17968
18065
|
Flex,
|
|
17969
18066
|
{
|
|
17970
18067
|
$position: "absolute",
|
|
@@ -17973,7 +18070,7 @@ var PaymentMethodDetails = ({
|
|
|
17973
18070
|
$alignItems: "center",
|
|
17974
18071
|
$width: "100%",
|
|
17975
18072
|
$height: "100%",
|
|
17976
|
-
children: /* @__PURE__ */ (0,
|
|
18073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
17977
18074
|
Loader,
|
|
17978
18075
|
{
|
|
17979
18076
|
$color: settings.theme.primary,
|
|
@@ -17983,7 +18080,7 @@ var PaymentMethodDetails = ({
|
|
|
17983
18080
|
)
|
|
17984
18081
|
}
|
|
17985
18082
|
),
|
|
17986
|
-
/* @__PURE__ */ (0,
|
|
18083
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
17987
18084
|
Flex,
|
|
17988
18085
|
{
|
|
17989
18086
|
$position: "relative",
|
|
@@ -17996,7 +18093,7 @@ var PaymentMethodDetails = ({
|
|
|
17996
18093
|
$visibility: isLoading || isConfirmingPayment ? "hidden" : "visible",
|
|
17997
18094
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.025)" : "hsla(0, 0%, 100%, 0.025)",
|
|
17998
18095
|
children: [
|
|
17999
|
-
setupIntent && showPaymentForm && stripe ? /* @__PURE__ */ (0,
|
|
18096
|
+
setupIntent && showPaymentForm && stripe ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
18000
18097
|
import_react_stripe_js2.Elements,
|
|
18001
18098
|
{
|
|
18002
18099
|
stripe,
|
|
@@ -18026,7 +18123,7 @@ var PaymentMethodDetails = ({
|
|
|
18026
18123
|
clientSecret: setupIntent?.setupIntentClientSecret
|
|
18027
18124
|
},
|
|
18028
18125
|
children: [
|
|
18029
|
-
/* @__PURE__ */ (0,
|
|
18126
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18030
18127
|
PaymentForm,
|
|
18031
18128
|
{
|
|
18032
18129
|
financeData,
|
|
@@ -18037,7 +18134,7 @@ var PaymentMethodDetails = ({
|
|
|
18037
18134
|
}
|
|
18038
18135
|
}
|
|
18039
18136
|
),
|
|
18040
|
-
currentPaymentMethod && /* @__PURE__ */ (0,
|
|
18137
|
+
currentPaymentMethod && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18041
18138
|
Text,
|
|
18042
18139
|
{
|
|
18043
18140
|
onClick: focusExistingPaymentMethods,
|
|
@@ -18050,8 +18147,8 @@ var PaymentMethodDetails = ({
|
|
|
18050
18147
|
) })
|
|
18051
18148
|
]
|
|
18052
18149
|
}
|
|
18053
|
-
) : /* @__PURE__ */ (0,
|
|
18054
|
-
/* @__PURE__ */ (0,
|
|
18150
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", children: [
|
|
18151
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18055
18152
|
PaymentMethodElement,
|
|
18056
18153
|
{
|
|
18057
18154
|
paymentMethod: currentPaymentMethod,
|
|
@@ -18059,8 +18156,8 @@ var PaymentMethodDetails = ({
|
|
|
18059
18156
|
...props
|
|
18060
18157
|
}
|
|
18061
18158
|
),
|
|
18062
|
-
paymentMethods.length > 0 && /* @__PURE__ */ (0,
|
|
18063
|
-
/* @__PURE__ */ (0,
|
|
18159
|
+
paymentMethods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
18160
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18064
18161
|
Text,
|
|
18065
18162
|
{
|
|
18066
18163
|
onClick: toggleShowPaymentMethods,
|
|
@@ -18071,17 +18168,17 @@ var PaymentMethodDetails = ({
|
|
|
18071
18168
|
children: t2("Choose different payment method")
|
|
18072
18169
|
}
|
|
18073
18170
|
),
|
|
18074
|
-
/* @__PURE__ */ (0,
|
|
18171
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18075
18172
|
Icon3,
|
|
18076
18173
|
{
|
|
18077
18174
|
name: showDifferentPaymentMethods ? "chevron-up" : "chevron-down"
|
|
18078
18175
|
}
|
|
18079
18176
|
)
|
|
18080
18177
|
] }),
|
|
18081
|
-
showDifferentPaymentMethods && /* @__PURE__ */ (0,
|
|
18082
|
-
/* @__PURE__ */ (0,
|
|
18178
|
+
showDifferentPaymentMethods && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", $marginTop: "-1rem", children: [
|
|
18179
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Flex, { $flexDirection: "column", $overflow: "auto", children: (paymentMethods.filter(
|
|
18083
18180
|
(paymentMethod) => paymentMethod.id !== currentPaymentMethod?.id
|
|
18084
|
-
) || []).map((paymentMethod) => /* @__PURE__ */ (0,
|
|
18181
|
+
) || []).map((paymentMethod) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18085
18182
|
PaymentListElement,
|
|
18086
18183
|
{
|
|
18087
18184
|
paymentMethod,
|
|
@@ -18090,7 +18187,7 @@ var PaymentMethodDetails = ({
|
|
|
18090
18187
|
},
|
|
18091
18188
|
paymentMethod.id
|
|
18092
18189
|
)) }),
|
|
18093
|
-
(!setupIntent || !currentPaymentMethod) && /* @__PURE__ */ (0,
|
|
18190
|
+
(!setupIntent || !currentPaymentMethod) && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
18094
18191
|
Button,
|
|
18095
18192
|
{
|
|
18096
18193
|
type: "button",
|
|
@@ -18102,7 +18199,7 @@ var PaymentMethodDetails = ({
|
|
|
18102
18199
|
)
|
|
18103
18200
|
] })
|
|
18104
18201
|
] }),
|
|
18105
|
-
!isLoading && error && /* @__PURE__ */ (0,
|
|
18202
|
+
!isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { $weight: 500, $color: "#DB6669", children: error }) })
|
|
18106
18203
|
]
|
|
18107
18204
|
}
|
|
18108
18205
|
)
|
|
@@ -18113,9 +18210,9 @@ var PaymentMethodDetails = ({
|
|
|
18113
18210
|
var import_react49 = require("react");
|
|
18114
18211
|
|
|
18115
18212
|
// src/components/elements/plan-manager/AddOn.tsx
|
|
18116
|
-
var
|
|
18213
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
18117
18214
|
var AddOn = ({ addOn, currency, layout }) => {
|
|
18118
|
-
return /* @__PURE__ */ (0,
|
|
18215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
18119
18216
|
Flex,
|
|
18120
18217
|
{
|
|
18121
18218
|
$justifyContent: "space-between",
|
|
@@ -18123,10 +18220,10 @@ var AddOn = ({ addOn, currency, layout }) => {
|
|
|
18123
18220
|
$flexWrap: "wrap",
|
|
18124
18221
|
$gap: "1rem",
|
|
18125
18222
|
children: [
|
|
18126
|
-
/* @__PURE__ */ (0,
|
|
18127
|
-
typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ (0,
|
|
18223
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { display: layout.addOns.fontStyle, children: addOn.name }),
|
|
18224
|
+
typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Text, { children: [
|
|
18128
18225
|
formatCurrency(addOn.planPrice, currency),
|
|
18129
|
-
/* @__PURE__ */ (0,
|
|
18226
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("sub", { children: addOn.planPeriod == "one-time" ? shortenPeriod(addOn.planPeriod) : `/${shortenPeriod(addOn.planPeriod)}` })
|
|
18130
18227
|
] })
|
|
18131
18228
|
]
|
|
18132
18229
|
}
|
|
@@ -18135,10 +18232,11 @@ var AddOn = ({ addOn, currency, layout }) => {
|
|
|
18135
18232
|
|
|
18136
18233
|
// src/components/elements/plan-manager/UsageDetails.tsx
|
|
18137
18234
|
var import_react48 = require("react");
|
|
18138
|
-
var
|
|
18235
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
18139
18236
|
var UsageDetails2 = ({
|
|
18140
18237
|
entitlement,
|
|
18141
18238
|
period,
|
|
18239
|
+
showCredits,
|
|
18142
18240
|
layout
|
|
18143
18241
|
}) => {
|
|
18144
18242
|
const { t: t2 } = useTranslation();
|
|
@@ -18157,9 +18255,9 @@ var UsageDetails2 = ({
|
|
|
18157
18255
|
let index = 0;
|
|
18158
18256
|
if (entitlement.priceBehavior === "overage" /* Overage */) {
|
|
18159
18257
|
acc.push(
|
|
18160
|
-
amount > 0 ? /* @__PURE__ */ (0,
|
|
18258
|
+
amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react48.Fragment, { children: t2("X additional", {
|
|
18161
18259
|
amount
|
|
18162
|
-
}) }, index) : /* @__PURE__ */ (0,
|
|
18260
|
+
}) }, index) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react48.Fragment, { children: [
|
|
18163
18261
|
t2("Additional"),
|
|
18164
18262
|
": "
|
|
18165
18263
|
] }, index)
|
|
@@ -18170,16 +18268,16 @@ var UsageDetails2 = ({
|
|
|
18170
18268
|
if (entitlement.priceBehavior !== "tier" /* Tiered */ && entitlement.feature && typeof price === "number" && !amount) {
|
|
18171
18269
|
const packageSize = billingPrice?.packageSize ?? 1;
|
|
18172
18270
|
acc.push(
|
|
18173
|
-
/* @__PURE__ */ (0,
|
|
18271
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react48.Fragment, { children: [
|
|
18174
18272
|
formatCurrency(price, billingPrice?.currency),
|
|
18175
|
-
/* @__PURE__ */ (0,
|
|
18273
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("sub", { children: [
|
|
18176
18274
|
"/",
|
|
18177
|
-
packageSize > 1 && /* @__PURE__ */ (0,
|
|
18275
|
+
packageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
18178
18276
|
packageSize,
|
|
18179
18277
|
" "
|
|
18180
18278
|
] }),
|
|
18181
18279
|
getFeatureName(entitlement.feature, packageSize),
|
|
18182
|
-
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ (0,
|
|
18280
|
+
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
18183
18281
|
"/",
|
|
18184
18282
|
shortenPeriod(period)
|
|
18185
18283
|
] })
|
|
@@ -18188,10 +18286,10 @@ var UsageDetails2 = ({
|
|
|
18188
18286
|
);
|
|
18189
18287
|
index += 1;
|
|
18190
18288
|
}
|
|
18191
|
-
if (entitlement.priceBehavior === "credit_burndown" /* Credit */ && entitlement.planEntitlement?.consumptionRate && entitlement.planEntitlement?.valueCredit) {
|
|
18289
|
+
if (showCredits && entitlement.priceBehavior === "credit_burndown" /* Credit */ && entitlement.planEntitlement?.consumptionRate && entitlement.planEntitlement?.valueCredit) {
|
|
18192
18290
|
const creditAmount = entitlement.planEntitlement.consumptionRate * amount;
|
|
18193
18291
|
acc.push(
|
|
18194
|
-
creditAmount > 0 ? /* @__PURE__ */ (0,
|
|
18292
|
+
creditAmount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react48.Fragment, { children: [
|
|
18195
18293
|
creditAmount,
|
|
18196
18294
|
" ",
|
|
18197
18295
|
getFeatureName(
|
|
@@ -18200,7 +18298,7 @@ var UsageDetails2 = ({
|
|
|
18200
18298
|
),
|
|
18201
18299
|
" ",
|
|
18202
18300
|
t2("used")
|
|
18203
|
-
] }, index) : /* @__PURE__ */ (0,
|
|
18301
|
+
] }, index) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react48.Fragment, { children: [
|
|
18204
18302
|
entitlement.planEntitlement.consumptionRate,
|
|
18205
18303
|
" ",
|
|
18206
18304
|
getFeatureName(
|
|
@@ -18216,12 +18314,12 @@ var UsageDetails2 = ({
|
|
|
18216
18314
|
index += 1;
|
|
18217
18315
|
}
|
|
18218
18316
|
return acc;
|
|
18219
|
-
}, [t2, period, entitlement, billingPrice, amount]);
|
|
18220
|
-
if (!entitlement.feature?.name) {
|
|
18317
|
+
}, [t2, period, showCredits, entitlement, billingPrice, amount]);
|
|
18318
|
+
if (entitlement.priceBehavior === "credit_burndown" /* Credit */ && !showCredits || !entitlement.feature?.name) {
|
|
18221
18319
|
return null;
|
|
18222
18320
|
}
|
|
18223
|
-
const quantity = limit || amount;
|
|
18224
|
-
return /* @__PURE__ */ (0,
|
|
18321
|
+
const quantity = entitlement.priceBehavior !== "credit_burndown" /* Credit */ ? limit || amount : void 0;
|
|
18322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
18225
18323
|
Flex,
|
|
18226
18324
|
{
|
|
18227
18325
|
$justifyContent: "space-between",
|
|
@@ -18229,13 +18327,13 @@ var UsageDetails2 = ({
|
|
|
18229
18327
|
$flexWrap: "wrap",
|
|
18230
18328
|
$gap: "0.5rem",
|
|
18231
18329
|
children: [
|
|
18232
|
-
/* @__PURE__ */ (0,
|
|
18330
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" && quantity > 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
18233
18331
|
quantity,
|
|
18234
18332
|
" ",
|
|
18235
18333
|
entitlement.feature.name
|
|
18236
18334
|
] }) : entitlement.feature.name }),
|
|
18237
|
-
/* @__PURE__ */ (0,
|
|
18238
|
-
description.length > 0 && /* @__PURE__ */ (0,
|
|
18335
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
18336
|
+
description.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
18239
18337
|
Text,
|
|
18240
18338
|
{
|
|
18241
18339
|
style: { opacity: 0.54 },
|
|
@@ -18244,15 +18342,15 @@ var UsageDetails2 = ({
|
|
|
18244
18342
|
children: description
|
|
18245
18343
|
}
|
|
18246
18344
|
),
|
|
18247
|
-
(cost > 0 || entitlement.priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ (0,
|
|
18248
|
-
/* @__PURE__ */ (0,
|
|
18345
|
+
(cost > 0 || entitlement.priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Flex, { $alignItems: "end", children: [
|
|
18346
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Text, { children: [
|
|
18249
18347
|
formatCurrency(cost, billingPrice?.currency),
|
|
18250
|
-
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ (0,
|
|
18348
|
+
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("sub", { children: [
|
|
18251
18349
|
"/",
|
|
18252
18350
|
shortenPeriod(period)
|
|
18253
18351
|
] })
|
|
18254
18352
|
] }),
|
|
18255
|
-
entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0,
|
|
18353
|
+
entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
18256
18354
|
PricingTiersTooltip,
|
|
18257
18355
|
{
|
|
18258
18356
|
feature: entitlement.feature,
|
|
@@ -18269,7 +18367,7 @@ var UsageDetails2 = ({
|
|
|
18269
18367
|
};
|
|
18270
18368
|
|
|
18271
18369
|
// src/components/elements/plan-manager/PlanManager.tsx
|
|
18272
|
-
var
|
|
18370
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
18273
18371
|
var resolveDesignProps7 = (props) => {
|
|
18274
18372
|
return {
|
|
18275
18373
|
header: {
|
|
@@ -18313,9 +18411,12 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18313
18411
|
canCheckout,
|
|
18314
18412
|
postTrialPlan,
|
|
18315
18413
|
featureUsage,
|
|
18414
|
+
showCredits,
|
|
18316
18415
|
showZeroPriceAsFree,
|
|
18317
18416
|
trialPaymentMethodRequired
|
|
18318
18417
|
} = (0, import_react49.useMemo)(() => {
|
|
18418
|
+
const showCredits2 = data?.showCredits ?? true;
|
|
18419
|
+
const showZeroPriceAsFree2 = data?.showZeroPriceAsFree ?? false;
|
|
18319
18420
|
if (isCheckoutData(data)) {
|
|
18320
18421
|
const {
|
|
18321
18422
|
company,
|
|
@@ -18324,7 +18425,6 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18324
18425
|
capabilities,
|
|
18325
18426
|
postTrialPlan: postTrialPlan2,
|
|
18326
18427
|
featureUsage: featureUsage2,
|
|
18327
|
-
showZeroPriceAsFree: showZeroPriceAsFree2,
|
|
18328
18428
|
trialPaymentMethodRequired: trialPaymentMethodRequired2
|
|
18329
18429
|
} = data;
|
|
18330
18430
|
const creditGroups2 = groupCreditGrants(creditGrants, {
|
|
@@ -18354,8 +18454,9 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18354
18454
|
canCheckout: capabilities?.checkout ?? true,
|
|
18355
18455
|
postTrialPlan: postTrialPlan2,
|
|
18356
18456
|
featureUsage: featureUsage2?.features || [],
|
|
18357
|
-
|
|
18358
|
-
|
|
18457
|
+
trialPaymentMethodRequired: trialPaymentMethodRequired2,
|
|
18458
|
+
showCredits: showCredits2,
|
|
18459
|
+
showZeroPriceAsFree: showZeroPriceAsFree2
|
|
18359
18460
|
};
|
|
18360
18461
|
}
|
|
18361
18462
|
return {
|
|
@@ -18367,8 +18468,9 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18367
18468
|
canCheckout: false,
|
|
18368
18469
|
postTrialPlan: void 0,
|
|
18369
18470
|
featureUsage: [],
|
|
18370
|
-
|
|
18371
|
-
|
|
18471
|
+
trialPaymentMethodRequired: false,
|
|
18472
|
+
showCredits: showCredits2,
|
|
18473
|
+
showZeroPriceAsFree: showZeroPriceAsFree2
|
|
18372
18474
|
};
|
|
18373
18475
|
}, [data]);
|
|
18374
18476
|
const usageBasedEntitlements = (0, import_react49.useMemo)(
|
|
@@ -18394,8 +18496,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18394
18496
|
}, [billingSubscription]);
|
|
18395
18497
|
const isFreePlan = currentPlan?.planPrice === 0;
|
|
18396
18498
|
const isUsageBasedPlan = isFreePlan && usageBasedEntitlements.length > 0;
|
|
18397
|
-
return /* @__PURE__ */ (0,
|
|
18398
|
-
isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ (0,
|
|
18499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
18500
|
+
isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18399
18501
|
Notice,
|
|
18400
18502
|
{
|
|
18401
18503
|
as: Flex,
|
|
@@ -18405,15 +18507,15 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18405
18507
|
$textAlign: "center",
|
|
18406
18508
|
$backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
|
|
18407
18509
|
children: [
|
|
18408
|
-
typeof trialEnd.formatted !== "undefined" && /* @__PURE__ */ (0,
|
|
18409
|
-
/* @__PURE__ */ (0,
|
|
18510
|
+
typeof trialEnd.formatted !== "undefined" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { as: "h3", display: "heading3", children: trialEnd.formatted }),
|
|
18511
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { as: "p", $size: 0.8125 * settings.theme.typography.text.fontSize, children: trialPaymentMethodRequired ? t2("After the trial, subscribe") : postTrialPlan ? t2("After the trial, cancel", {
|
|
18410
18512
|
postTrialPlanName: postTrialPlan?.name
|
|
18411
18513
|
}) : t2("After the trial, cancel no default", {
|
|
18412
18514
|
planName: currentPlan?.name
|
|
18413
18515
|
}) })
|
|
18414
18516
|
]
|
|
18415
18517
|
}
|
|
18416
|
-
) : willSubscriptionCancel && /* @__PURE__ */ (0,
|
|
18518
|
+
) : willSubscriptionCancel && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18417
18519
|
Notice,
|
|
18418
18520
|
{
|
|
18419
18521
|
as: Flex,
|
|
@@ -18423,8 +18525,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18423
18525
|
$textAlign: "center",
|
|
18424
18526
|
$backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
|
|
18425
18527
|
children: [
|
|
18426
|
-
/* @__PURE__ */ (0,
|
|
18427
|
-
typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ (0,
|
|
18528
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { as: "h3", display: "heading3", children: t2("Subscription canceled") }),
|
|
18529
|
+
typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18428
18530
|
Text,
|
|
18429
18531
|
{
|
|
18430
18532
|
as: "p",
|
|
@@ -18442,7 +18544,7 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18442
18544
|
]
|
|
18443
18545
|
}
|
|
18444
18546
|
),
|
|
18445
|
-
/* @__PURE__ */ (0,
|
|
18547
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18446
18548
|
Element,
|
|
18447
18549
|
{
|
|
18448
18550
|
as: Flex,
|
|
@@ -18451,19 +18553,19 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18451
18553
|
$flexDirection: "column",
|
|
18452
18554
|
$gap: "2rem",
|
|
18453
18555
|
children: [
|
|
18454
|
-
props.header.isVisible && currentPlan && /* @__PURE__ */ (0,
|
|
18556
|
+
props.header.isVisible && currentPlan && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18455
18557
|
Flex,
|
|
18456
18558
|
{
|
|
18457
18559
|
$justifyContent: "space-between",
|
|
18458
18560
|
$alignItems: "center",
|
|
18459
18561
|
$gap: "1rem",
|
|
18460
18562
|
children: [
|
|
18461
|
-
/* @__PURE__ */ (0,
|
|
18462
|
-
/* @__PURE__ */ (0,
|
|
18463
|
-
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ (0,
|
|
18563
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
18564
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { display: props.header.title.fontStyle, $leading: 1, children: currentPlan.name }),
|
|
18565
|
+
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { display: props.header.description.fontStyle, children: currentPlan.description })
|
|
18464
18566
|
] }),
|
|
18465
|
-
props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ (0,
|
|
18466
|
-
/* @__PURE__ */ (0,
|
|
18567
|
+
props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box, { children: [
|
|
18568
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18467
18569
|
Text,
|
|
18468
18570
|
{
|
|
18469
18571
|
display: isUsageBasedPlan ? "heading3" : props.header.price.fontStyle,
|
|
@@ -18473,7 +18575,7 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18473
18575
|
)
|
|
18474
18576
|
}
|
|
18475
18577
|
),
|
|
18476
|
-
!isFreePlan && /* @__PURE__ */ (0,
|
|
18578
|
+
!isFreePlan && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("sub", { children: [
|
|
18477
18579
|
"/",
|
|
18478
18580
|
shortenPeriod(currentPlan.planPeriod)
|
|
18479
18581
|
] }) })
|
|
@@ -18481,8 +18583,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18481
18583
|
]
|
|
18482
18584
|
}
|
|
18483
18585
|
),
|
|
18484
|
-
props.addOns.isVisible && currentAddOns.length > 0 && /* @__PURE__ */ (0,
|
|
18485
|
-
props.addOns.showLabel && /* @__PURE__ */ (0,
|
|
18586
|
+
props.addOns.isVisible && currentAddOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18587
|
+
props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18486
18588
|
Text,
|
|
18487
18589
|
{
|
|
18488
18590
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -18490,7 +18592,7 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18490
18592
|
children: t2("Add-ons")
|
|
18491
18593
|
}
|
|
18492
18594
|
),
|
|
18493
|
-
/* @__PURE__ */ (0,
|
|
18595
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", children: currentAddOns.map((addOn, addOnIndex) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18494
18596
|
AddOn,
|
|
18495
18597
|
{
|
|
18496
18598
|
addOn,
|
|
@@ -18500,8 +18602,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18500
18602
|
addOnIndex
|
|
18501
18603
|
)) })
|
|
18502
18604
|
] }),
|
|
18503
|
-
props.addOns.isVisible && usageBasedEntitlements.length > 0 && /* @__PURE__ */ (0,
|
|
18504
|
-
props.addOns.showLabel && /* @__PURE__ */ (0,
|
|
18605
|
+
props.addOns.isVisible && usageBasedEntitlements.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18606
|
+
props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18505
18607
|
Text,
|
|
18506
18608
|
{
|
|
18507
18609
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -18509,20 +18611,21 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18509
18611
|
children: t2("Usage-based")
|
|
18510
18612
|
}
|
|
18511
18613
|
),
|
|
18512
|
-
/* @__PURE__ */ (0,
|
|
18513
|
-
return /* @__PURE__ */ (0,
|
|
18614
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", children: usageBasedEntitlements.map((entitlement, entitlementIndex) => {
|
|
18615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18514
18616
|
UsageDetails2,
|
|
18515
18617
|
{
|
|
18516
18618
|
entitlement,
|
|
18517
18619
|
period: currentPlan?.planPeriod || "month",
|
|
18620
|
+
showCredits,
|
|
18518
18621
|
layout: props
|
|
18519
18622
|
},
|
|
18520
18623
|
entitlementIndex
|
|
18521
18624
|
);
|
|
18522
18625
|
}) })
|
|
18523
18626
|
] }),
|
|
18524
|
-
props.addOns.isVisible && creditGroups.plan.length > 0 && /* @__PURE__ */ (0,
|
|
18525
|
-
props.addOns.showLabel && /* @__PURE__ */ (0,
|
|
18627
|
+
props.addOns.isVisible && showCredits && creditGroups.plan.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18628
|
+
props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18526
18629
|
Text,
|
|
18527
18630
|
{
|
|
18528
18631
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -18530,8 +18633,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18530
18633
|
children: t2("Credits in plan")
|
|
18531
18634
|
}
|
|
18532
18635
|
),
|
|
18533
|
-
/* @__PURE__ */ (0,
|
|
18534
|
-
return /* @__PURE__ */ (0,
|
|
18636
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.plan.map((group, groupIndex) => {
|
|
18637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18535
18638
|
Flex,
|
|
18536
18639
|
{
|
|
18537
18640
|
$justifyContent: "space-between",
|
|
@@ -18539,18 +18642,18 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18539
18642
|
$flexWrap: "wrap",
|
|
18540
18643
|
$gap: "0.5rem",
|
|
18541
18644
|
children: [
|
|
18542
|
-
/* @__PURE__ */ (0,
|
|
18645
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { display: props.addOns.fontStyle, children: [
|
|
18543
18646
|
group.quantity,
|
|
18544
18647
|
" ",
|
|
18545
18648
|
getFeatureName(group, group.quantity),
|
|
18546
18649
|
" ",
|
|
18547
|
-
subscriptionInterval && /* @__PURE__ */ (0,
|
|
18650
|
+
subscriptionInterval && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
18548
18651
|
t2("per"),
|
|
18549
18652
|
" ",
|
|
18550
18653
|
t2(subscriptionInterval)
|
|
18551
18654
|
] })
|
|
18552
18655
|
] }),
|
|
18553
|
-
group.total.used > 0 && /* @__PURE__ */ (0,
|
|
18656
|
+
group.total.used > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18554
18657
|
Text,
|
|
18555
18658
|
{
|
|
18556
18659
|
style: { opacity: 0.54 },
|
|
@@ -18569,8 +18672,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18569
18672
|
);
|
|
18570
18673
|
}) })
|
|
18571
18674
|
] }),
|
|
18572
|
-
props.addOns.isVisible && creditGroups.bundles.length > 0 && /* @__PURE__ */ (0,
|
|
18573
|
-
props.addOns.showLabel && /* @__PURE__ */ (0,
|
|
18675
|
+
props.addOns.isVisible && creditGroups.bundles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18676
|
+
props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18574
18677
|
Text,
|
|
18575
18678
|
{
|
|
18576
18679
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -18578,9 +18681,9 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18578
18681
|
children: t2("Credit bundles")
|
|
18579
18682
|
}
|
|
18580
18683
|
),
|
|
18581
|
-
/* @__PURE__ */ (0,
|
|
18684
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.bundles.map((group, groupIndex) => {
|
|
18582
18685
|
const bundle = group?.bundleId ? creditBundles.find((b2) => b2.id === group.bundleId) : void 0;
|
|
18583
|
-
return /* @__PURE__ */ (0,
|
|
18686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18584
18687
|
Flex,
|
|
18585
18688
|
{
|
|
18586
18689
|
$justifyContent: "space-between",
|
|
@@ -18588,8 +18691,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18588
18691
|
$flexWrap: "wrap",
|
|
18589
18692
|
$gap: "0.5rem",
|
|
18590
18693
|
children: [
|
|
18591
|
-
bundle ? /* @__PURE__ */ (0,
|
|
18592
|
-
group.grants.length > 1 && /* @__PURE__ */ (0,
|
|
18694
|
+
bundle ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { display: props.addOns.fontStyle, children: [
|
|
18695
|
+
group.grants.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { style: { opacity: 0.5 }, children: [
|
|
18593
18696
|
"(",
|
|
18594
18697
|
group.grants.length,
|
|
18595
18698
|
")",
|
|
@@ -18601,12 +18704,12 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18601
18704
|
" ",
|
|
18602
18705
|
getFeatureName(group, group.quantity),
|
|
18603
18706
|
")"
|
|
18604
|
-
] }) : /* @__PURE__ */ (0,
|
|
18707
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { display: props.addOns.fontStyle, children: [
|
|
18605
18708
|
group.quantity,
|
|
18606
18709
|
" ",
|
|
18607
18710
|
getFeatureName(group, group.quantity)
|
|
18608
18711
|
] }),
|
|
18609
|
-
group.total.used > 0 && /* @__PURE__ */ (0,
|
|
18712
|
+
group.total.used > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18610
18713
|
Text,
|
|
18611
18714
|
{
|
|
18612
18715
|
style: { opacity: 0.54 },
|
|
@@ -18625,8 +18728,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18625
18728
|
);
|
|
18626
18729
|
}) })
|
|
18627
18730
|
] }),
|
|
18628
|
-
props.addOns.isVisible && creditGroups.promotional.length > 0 && /* @__PURE__ */ (0,
|
|
18629
|
-
props.addOns.showLabel && /* @__PURE__ */ (0,
|
|
18731
|
+
props.addOns.isVisible && creditGroups.promotional.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18732
|
+
props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18630
18733
|
Text,
|
|
18631
18734
|
{
|
|
18632
18735
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -18634,8 +18737,8 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18634
18737
|
children: t2("Promotional credits")
|
|
18635
18738
|
}
|
|
18636
18739
|
),
|
|
18637
|
-
/* @__PURE__ */ (0,
|
|
18638
|
-
return /* @__PURE__ */ (0,
|
|
18740
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.promotional.map((group, groupIndex) => {
|
|
18741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18639
18742
|
Flex,
|
|
18640
18743
|
{
|
|
18641
18744
|
$justifyContent: "space-between",
|
|
@@ -18643,12 +18746,12 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18643
18746
|
$flexWrap: "wrap",
|
|
18644
18747
|
$gap: "0.5rem",
|
|
18645
18748
|
children: [
|
|
18646
|
-
/* @__PURE__ */ (0,
|
|
18749
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { display: props.addOns.fontStyle, children: [
|
|
18647
18750
|
group.quantity,
|
|
18648
18751
|
" ",
|
|
18649
18752
|
getFeatureName(group, group.quantity)
|
|
18650
18753
|
] }),
|
|
18651
|
-
group.total.used > 0 && /* @__PURE__ */ (0,
|
|
18754
|
+
group.total.used > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
18652
18755
|
Text,
|
|
18653
18756
|
{
|
|
18654
18757
|
style: { opacity: 0.54 },
|
|
@@ -18667,7 +18770,7 @@ var PlanManager = (0, import_react49.forwardRef)(({ children, className, portal,
|
|
|
18667
18770
|
);
|
|
18668
18771
|
}) })
|
|
18669
18772
|
] }),
|
|
18670
|
-
canCheckout && props.callToAction.isVisible && /* @__PURE__ */ (0,
|
|
18773
|
+
canCheckout && props.callToAction.isVisible && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
18671
18774
|
Button,
|
|
18672
18775
|
{
|
|
18673
18776
|
type: "button",
|
|
@@ -18696,7 +18799,7 @@ var import_react52 = require("react");
|
|
|
18696
18799
|
|
|
18697
18800
|
// src/components/elements/pricing-table/AddOn.tsx
|
|
18698
18801
|
var import_react50 = require("react");
|
|
18699
|
-
var
|
|
18802
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
18700
18803
|
var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
18701
18804
|
const { layout } = sharedProps;
|
|
18702
18805
|
const { t: t2 } = useTranslation();
|
|
@@ -18722,7 +18825,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18722
18825
|
const isCurrentAddOn = isHydratedPlan(addOn) && addOn.current;
|
|
18723
18826
|
const isActiveAddOn = isCurrentAddOn && selectedPeriod === currentAddOns.find((currentAddOn) => currentAddOn.id === addOn.id)?.planPeriod;
|
|
18724
18827
|
const { price: addOnPrice, currency: addOnCurrency } = getAddOnPrice(addOn, selectedPeriod) || {};
|
|
18725
|
-
return /* @__PURE__ */ (0,
|
|
18828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
18726
18829
|
Flex,
|
|
18727
18830
|
{
|
|
18728
18831
|
$position: "relative",
|
|
@@ -18738,17 +18841,17 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18738
18841
|
$boxShadow: cardBoxShadow
|
|
18739
18842
|
},
|
|
18740
18843
|
children: [
|
|
18741
|
-
/* @__PURE__ */ (0,
|
|
18742
|
-
/* @__PURE__ */ (0,
|
|
18743
|
-
layout.addOns.showDescription && /* @__PURE__ */ (0,
|
|
18744
|
-
/* @__PURE__ */ (0,
|
|
18844
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
|
|
18845
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.name.fontStyle, children: addOn.name }) }),
|
|
18846
|
+
layout.addOns.showDescription && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
|
|
18847
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { display: layout.plans.name.fontStyle, children: [
|
|
18745
18848
|
formatCurrency(addOnPrice ?? 0, addOnCurrency),
|
|
18746
|
-
/* @__PURE__ */ (0,
|
|
18849
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("sub", { children: [
|
|
18747
18850
|
"/",
|
|
18748
18851
|
selectedPeriod
|
|
18749
18852
|
] })
|
|
18750
18853
|
] }) }),
|
|
18751
|
-
isActiveAddOn && /* @__PURE__ */ (0,
|
|
18854
|
+
isActiveAddOn && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18752
18855
|
Flex,
|
|
18753
18856
|
{
|
|
18754
18857
|
$position: "absolute",
|
|
@@ -18757,7 +18860,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18757
18860
|
$backgroundColor: settings.theme.primary,
|
|
18758
18861
|
$borderRadius: "9999px",
|
|
18759
18862
|
$padding: "0.125rem 0.85rem",
|
|
18760
|
-
children: /* @__PURE__ */ (0,
|
|
18863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18761
18864
|
Text,
|
|
18762
18865
|
{
|
|
18763
18866
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -18768,7 +18871,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18768
18871
|
}
|
|
18769
18872
|
)
|
|
18770
18873
|
] }),
|
|
18771
|
-
/* @__PURE__ */ (0,
|
|
18874
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
18772
18875
|
Flex,
|
|
18773
18876
|
{
|
|
18774
18877
|
$flexDirection: "column",
|
|
@@ -18776,7 +18879,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18776
18879
|
$gap: `${cardPadding}rem`,
|
|
18777
18880
|
$flexGrow: 1,
|
|
18778
18881
|
children: [
|
|
18779
|
-
layout.addOns.showEntitlements && /* @__PURE__ */ (0,
|
|
18882
|
+
layout.addOns.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18780
18883
|
Flex,
|
|
18781
18884
|
{
|
|
18782
18885
|
$flexDirection: "column",
|
|
@@ -18785,15 +18888,15 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18785
18888
|
$flexGrow: 1,
|
|
18786
18889
|
children: addOn.entitlements.map((entitlement, entitlementIndex) => {
|
|
18787
18890
|
const metricPeriodName = getMetricPeriodName(entitlement);
|
|
18788
|
-
return /* @__PURE__ */ (0,
|
|
18891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18789
18892
|
Flex,
|
|
18790
18893
|
{
|
|
18791
18894
|
$flexWrap: "wrap",
|
|
18792
18895
|
$justifyContent: "space-between",
|
|
18793
18896
|
$alignItems: "center",
|
|
18794
18897
|
$gap: "1rem",
|
|
18795
|
-
children: /* @__PURE__ */ (0,
|
|
18796
|
-
layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0,
|
|
18898
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $gap: "1rem", children: [
|
|
18899
|
+
layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18797
18900
|
Icon3,
|
|
18798
18901
|
{
|
|
18799
18902
|
name: entitlement.feature.icon,
|
|
@@ -18802,11 +18905,11 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18802
18905
|
rounded: true
|
|
18803
18906
|
}
|
|
18804
18907
|
),
|
|
18805
|
-
/* @__PURE__ */ (0,
|
|
18806
|
-
entitlement.feature?.name && /* @__PURE__ */ (0,
|
|
18908
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18909
|
+
entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Flex, { $alignItems: "center", $flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { children: entitlement.valueType === "numeric" /* Numeric */ || entitlement.valueType === "unlimited" /* Unlimited */ || entitlement.valueType === "trait" /* Trait */ ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
18807
18910
|
entitlement.valueType === "unlimited" /* Unlimited */ ? t2("Unlimited", {
|
|
18808
18911
|
item: getFeatureName(entitlement.feature)
|
|
18809
|
-
}) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ (0,
|
|
18912
|
+
}) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
18810
18913
|
formatNumber(entitlement.valueNumeric),
|
|
18811
18914
|
" ",
|
|
18812
18915
|
getFeatureName(
|
|
@@ -18814,14 +18917,14 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18814
18917
|
entitlement.valueNumeric
|
|
18815
18918
|
)
|
|
18816
18919
|
] }),
|
|
18817
|
-
metricPeriodName && /* @__PURE__ */ (0,
|
|
18920
|
+
metricPeriodName && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
18818
18921
|
" ",
|
|
18819
18922
|
t2("per"),
|
|
18820
18923
|
" ",
|
|
18821
18924
|
t2(metricPeriodName)
|
|
18822
18925
|
] })
|
|
18823
18926
|
] }) : entitlement.feature.name }) }),
|
|
18824
|
-
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ (0,
|
|
18927
|
+
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18825
18928
|
Text,
|
|
18826
18929
|
{
|
|
18827
18930
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
@@ -18837,7 +18940,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18837
18940
|
})
|
|
18838
18941
|
}
|
|
18839
18942
|
),
|
|
18840
|
-
showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */ (0,
|
|
18943
|
+
showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
18841
18944
|
Button,
|
|
18842
18945
|
{
|
|
18843
18946
|
type: "button",
|
|
@@ -18878,11 +18981,13 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18878
18981
|
var import_react51 = require("react");
|
|
18879
18982
|
|
|
18880
18983
|
// src/components/elements/pricing-table/Entitlement.tsx
|
|
18881
|
-
var
|
|
18984
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
18882
18985
|
var Entitlement = ({
|
|
18883
18986
|
entitlement,
|
|
18884
|
-
|
|
18885
|
-
selectedPeriod
|
|
18987
|
+
credits = [],
|
|
18988
|
+
selectedPeriod,
|
|
18989
|
+
showCredits,
|
|
18990
|
+
sharedProps
|
|
18886
18991
|
}) => {
|
|
18887
18992
|
const { layout } = sharedProps;
|
|
18888
18993
|
const { t: t2 } = useTranslation();
|
|
@@ -18894,13 +18999,14 @@ var Entitlement = ({
|
|
|
18894
18999
|
currency: entitlementCurrency,
|
|
18895
19000
|
packageSize: entitlementPackageSize = 1
|
|
18896
19001
|
} = getEntitlementPrice(entitlement, selectedPeriod) || {};
|
|
18897
|
-
if (entitlement.priceBehavior && typeof entitlementPrice !== "number") {
|
|
18898
|
-
return null;
|
|
18899
|
-
}
|
|
18900
19002
|
const limit = entitlement.softLimit ?? entitlement.valueNumeric;
|
|
18901
19003
|
const metricPeriodName = getMetricPeriodName(entitlement);
|
|
18902
|
-
|
|
18903
|
-
|
|
19004
|
+
const creditBasedEntitlementLimit = getCreditBasedEntitlementLimit(
|
|
19005
|
+
entitlement,
|
|
19006
|
+
credits
|
|
19007
|
+
);
|
|
19008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Flex, { $gap: "1rem", children: [
|
|
19009
|
+
layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
18904
19010
|
Icon3,
|
|
18905
19011
|
{
|
|
18906
19012
|
name: entitlement.feature.icon,
|
|
@@ -18909,47 +19015,71 @@ var Entitlement = ({
|
|
|
18909
19015
|
rounded: true
|
|
18910
19016
|
}
|
|
18911
19017
|
),
|
|
18912
|
-
entitlement.feature?.name && /* @__PURE__ */ (0,
|
|
18913
|
-
/* @__PURE__ */ (0,
|
|
18914
|
-
/* @__PURE__ */ (0,
|
|
19018
|
+
entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
19019
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Flex, { $flexDirection: "column", $justifyContent: "center", $flexGrow: 1, children: [
|
|
19020
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18915
19021
|
formatCurrency(entitlementPrice, entitlementCurrency),
|
|
18916
19022
|
" ",
|
|
18917
19023
|
t2("per"),
|
|
18918
19024
|
" ",
|
|
18919
|
-
entitlementPackageSize > 1 && /* @__PURE__ */ (0,
|
|
19025
|
+
entitlementPackageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18920
19026
|
entitlementPackageSize,
|
|
18921
19027
|
" "
|
|
18922
19028
|
] }),
|
|
18923
19029
|
getFeatureName(entitlement.feature, entitlementPackageSize),
|
|
18924
|
-
entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ (0,
|
|
19030
|
+
entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18925
19031
|
" ",
|
|
18926
19032
|
t2("per"),
|
|
18927
19033
|
" ",
|
|
18928
19034
|
selectedPeriod
|
|
18929
19035
|
] })
|
|
18930
|
-
] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ (0,
|
|
19036
|
+
] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
18931
19037
|
TieredPricingDetails,
|
|
18932
19038
|
{
|
|
18933
19039
|
entitlement,
|
|
18934
19040
|
period: selectedPeriod
|
|
18935
19041
|
}
|
|
18936
|
-
) :
|
|
19042
|
+
) : showCredits && entitlement.priceBehavior === "credit_burndown" /* Credit */ && entitlement.valueCredit ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
19043
|
+
entitlement.consumptionRate,
|
|
19044
|
+
" ",
|
|
19045
|
+
getFeatureName(
|
|
19046
|
+
entitlement.valueCredit,
|
|
19047
|
+
entitlement.consumptionRate || void 0
|
|
19048
|
+
),
|
|
19049
|
+
" ",
|
|
19050
|
+
t2("per"),
|
|
19051
|
+
" ",
|
|
19052
|
+
getFeatureName(entitlement.feature, 1)
|
|
19053
|
+
] }) : entitlement.priceBehavior === "credit_burndown" /* Credit */ && creditBasedEntitlementLimit ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: creditBasedEntitlementLimit?.period ? t2("Up to X units per period", {
|
|
19054
|
+
amount: creditBasedEntitlementLimit.limit,
|
|
19055
|
+
units: getFeatureName(
|
|
19056
|
+
entitlement.feature,
|
|
19057
|
+
creditBasedEntitlementLimit.limit
|
|
19058
|
+
),
|
|
19059
|
+
period: creditBasedEntitlementLimit.period
|
|
19060
|
+
}) : t2("Up to X units", {
|
|
19061
|
+
amount: creditBasedEntitlementLimit.limit,
|
|
19062
|
+
units: getFeatureName(
|
|
19063
|
+
entitlement.feature,
|
|
19064
|
+
creditBasedEntitlementLimit.limit
|
|
19065
|
+
)
|
|
19066
|
+
}) }) : entitlement.valueType === "numeric" /* Numeric */ || entitlement.valueType === "unlimited" /* Unlimited */ || entitlement.valueType === "trait" /* Trait */ ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18937
19067
|
entitlement.valueType === "unlimited" /* Unlimited */ && !entitlement.priceBehavior ? t2("Unlimited", {
|
|
18938
19068
|
item: getFeatureName(entitlement.feature)
|
|
18939
|
-
}) : typeof limit === "number" && /* @__PURE__ */ (0,
|
|
19069
|
+
}) : typeof limit === "number" && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18940
19070
|
formatNumber(limit),
|
|
18941
19071
|
" ",
|
|
18942
19072
|
getFeatureName(entitlement.feature, limit)
|
|
18943
19073
|
] }),
|
|
18944
|
-
metricPeriodName && /* @__PURE__ */ (0,
|
|
19074
|
+
metricPeriodName && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18945
19075
|
" ",
|
|
18946
19076
|
t2("per"),
|
|
18947
19077
|
" ",
|
|
18948
19078
|
t2(metricPeriodName)
|
|
18949
19079
|
] })
|
|
18950
19080
|
] }) : entitlement.feature.name }),
|
|
18951
|
-
/* @__PURE__ */ (0,
|
|
18952
|
-
entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ (0,
|
|
19081
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Flex, { $alignItems: "end", children: [
|
|
19082
|
+
entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
18953
19083
|
Text,
|
|
18954
19084
|
{
|
|
18955
19085
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
@@ -18959,19 +19089,19 @@ var Entitlement = ({
|
|
|
18959
19089
|
" ",
|
|
18960
19090
|
formatCurrency(entitlementPrice, entitlementCurrency),
|
|
18961
19091
|
"/",
|
|
18962
|
-
entitlementPackageSize > 1 && /* @__PURE__ */ (0,
|
|
19092
|
+
entitlementPackageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18963
19093
|
entitlementPackageSize,
|
|
18964
19094
|
" "
|
|
18965
19095
|
] }),
|
|
18966
19096
|
getFeatureName(entitlement.feature, entitlementPackageSize),
|
|
18967
|
-
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ (0,
|
|
19097
|
+
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
18968
19098
|
"/",
|
|
18969
19099
|
shortenPeriod(selectedPeriod)
|
|
18970
19100
|
] })
|
|
18971
19101
|
]
|
|
18972
19102
|
}
|
|
18973
|
-
) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0,
|
|
18974
|
-
/* @__PURE__ */ (0,
|
|
19103
|
+
) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Flex, { $alignItems: "end", children: [
|
|
19104
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
18975
19105
|
Text,
|
|
18976
19106
|
{
|
|
18977
19107
|
style: { opacity: 0.54 },
|
|
@@ -18980,7 +19110,7 @@ var Entitlement = ({
|
|
|
18980
19110
|
children: t2("Tier-based")
|
|
18981
19111
|
}
|
|
18982
19112
|
),
|
|
18983
|
-
/* @__PURE__ */ (0,
|
|
19113
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
18984
19114
|
PricingTiersTooltip,
|
|
18985
19115
|
{
|
|
18986
19116
|
feature: entitlement.feature,
|
|
@@ -18990,7 +19120,7 @@ var Entitlement = ({
|
|
|
18990
19120
|
}
|
|
18991
19121
|
)
|
|
18992
19122
|
] }),
|
|
18993
|
-
entitlement.billingThreshold && /* @__PURE__ */ (0,
|
|
19123
|
+
entitlement.billingThreshold && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
18994
19124
|
BillingThresholdTooltip,
|
|
18995
19125
|
{
|
|
18996
19126
|
billingThreshold: entitlement.billingThreshold
|
|
@@ -18998,7 +19128,7 @@ var Entitlement = ({
|
|
|
18998
19128
|
)
|
|
18999
19129
|
] })
|
|
19000
19130
|
] }),
|
|
19001
|
-
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ (0,
|
|
19131
|
+
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
19002
19132
|
Text,
|
|
19003
19133
|
{
|
|
19004
19134
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
@@ -19011,7 +19141,7 @@ var Entitlement = ({
|
|
|
19011
19141
|
};
|
|
19012
19142
|
|
|
19013
19143
|
// src/components/elements/pricing-table/Plan.tsx
|
|
19014
|
-
var
|
|
19144
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
19015
19145
|
var Plan2 = ({
|
|
19016
19146
|
plan,
|
|
19017
19147
|
index,
|
|
@@ -19026,15 +19156,20 @@ var Plan2 = ({
|
|
|
19026
19156
|
const { data, settings, setCheckoutState } = useEmbed();
|
|
19027
19157
|
const isLightBackground = useIsLightBackground();
|
|
19028
19158
|
const trialEnd = useTrialEnd();
|
|
19159
|
+
const showCallToAction = (0, import_react51.useMemo)(() => {
|
|
19160
|
+
return typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function";
|
|
19161
|
+
}, [sharedProps.callToActionUrl, sharedProps.onCallToAction]);
|
|
19029
19162
|
const {
|
|
19030
19163
|
currentPeriod,
|
|
19031
19164
|
canCheckout,
|
|
19032
19165
|
isTrialSubscription,
|
|
19033
19166
|
willSubscriptionCancel,
|
|
19034
19167
|
isStandalone,
|
|
19035
|
-
|
|
19168
|
+
showCredits,
|
|
19036
19169
|
showZeroPriceAsFree
|
|
19037
19170
|
} = (0, import_react51.useMemo)(() => {
|
|
19171
|
+
const showCredits2 = data?.showCredits ?? true;
|
|
19172
|
+
const showZeroPriceAsFree2 = data?.showZeroPriceAsFree ?? false;
|
|
19038
19173
|
if (isCheckoutData(data)) {
|
|
19039
19174
|
const billingSubscription = data.company?.billingSubscription;
|
|
19040
19175
|
const isTrialSubscription2 = billingSubscription?.status === "trialing";
|
|
@@ -19045,8 +19180,8 @@ var Plan2 = ({
|
|
|
19045
19180
|
isTrialSubscription: isTrialSubscription2,
|
|
19046
19181
|
willSubscriptionCancel: willSubscriptionCancel2,
|
|
19047
19182
|
isStandalone: false,
|
|
19048
|
-
|
|
19049
|
-
showZeroPriceAsFree:
|
|
19183
|
+
showCredits: showCredits2,
|
|
19184
|
+
showZeroPriceAsFree: showZeroPriceAsFree2
|
|
19050
19185
|
};
|
|
19051
19186
|
}
|
|
19052
19187
|
return {
|
|
@@ -19055,10 +19190,10 @@ var Plan2 = ({
|
|
|
19055
19190
|
isTrialSubscription: false,
|
|
19056
19191
|
willSubscriptionCancel: false,
|
|
19057
19192
|
isStandalone: true,
|
|
19058
|
-
|
|
19059
|
-
showZeroPriceAsFree:
|
|
19193
|
+
showCredits: showCredits2,
|
|
19194
|
+
showZeroPriceAsFree: showZeroPriceAsFree2
|
|
19060
19195
|
};
|
|
19061
|
-
}, [data
|
|
19196
|
+
}, [data]);
|
|
19062
19197
|
const callToActionTarget = (0, import_react51.useMemo)(() => {
|
|
19063
19198
|
if (sharedProps.callToActionTarget) {
|
|
19064
19199
|
return sharedProps.callToActionTarget;
|
|
@@ -19089,7 +19224,7 @@ var Plan2 = ({
|
|
|
19089
19224
|
const headerPriceFontStyle = settings.theme.typography[layout.plans.name.fontStyle];
|
|
19090
19225
|
const count = entitlementCounts[plan.id];
|
|
19091
19226
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
19092
|
-
return /* @__PURE__ */ (0,
|
|
19227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
19093
19228
|
Flex,
|
|
19094
19229
|
{
|
|
19095
19230
|
className: "sch-PricingTable_Plan",
|
|
@@ -19106,7 +19241,7 @@ var Plan2 = ({
|
|
|
19106
19241
|
$boxShadow: cardBoxShadow
|
|
19107
19242
|
},
|
|
19108
19243
|
children: [
|
|
19109
|
-
/* @__PURE__ */ (0,
|
|
19244
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
19110
19245
|
Flex,
|
|
19111
19246
|
{
|
|
19112
19247
|
$flexDirection: "column",
|
|
@@ -19117,9 +19252,9 @@ var Plan2 = ({
|
|
|
19117
19252
|
$borderStyle: "solid",
|
|
19118
19253
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
|
|
19119
19254
|
children: [
|
|
19120
|
-
/* @__PURE__ */ (0,
|
|
19121
|
-
layout.plans.description.isVisible && /* @__PURE__ */ (0,
|
|
19122
|
-
/* @__PURE__ */ (0,
|
|
19255
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { display: layout.plans.name.fontStyle, children: plan.name }) }),
|
|
19256
|
+
layout.plans.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { display: layout.plans.description.fontStyle, children: plan.description }) }),
|
|
19257
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
19123
19258
|
Text,
|
|
19124
19259
|
{
|
|
19125
19260
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -19128,14 +19263,14 @@ var Plan2 = ({
|
|
|
19128
19263
|
$color: headerPriceFontStyle.color,
|
|
19129
19264
|
children: [
|
|
19130
19265
|
plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency),
|
|
19131
|
-
!plan.custom && !isFreePlan && /* @__PURE__ */ (0,
|
|
19266
|
+
!plan.custom && !isFreePlan && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("sub", { children: [
|
|
19132
19267
|
"/",
|
|
19133
19268
|
selectedPeriod
|
|
19134
19269
|
] })
|
|
19135
19270
|
]
|
|
19136
19271
|
}
|
|
19137
19272
|
) }),
|
|
19138
|
-
credits.length > 0 && /* @__PURE__ */ (0,
|
|
19273
|
+
showCredits && credits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19139
19274
|
Flex,
|
|
19140
19275
|
{
|
|
19141
19276
|
$flexDirection: "column",
|
|
@@ -19143,8 +19278,8 @@ var Plan2 = ({
|
|
|
19143
19278
|
$flexGrow: 1,
|
|
19144
19279
|
$marginTop: "0.5rem",
|
|
19145
19280
|
children: credits.map((credit, idx) => {
|
|
19146
|
-
return /* @__PURE__ */ (0,
|
|
19147
|
-
layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ (0,
|
|
19281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Flex, { $gap: "1rem", children: [
|
|
19282
|
+
layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19148
19283
|
Icon3,
|
|
19149
19284
|
{
|
|
19150
19285
|
name: credit.icon,
|
|
@@ -19153,17 +19288,17 @@ var Plan2 = ({
|
|
|
19153
19288
|
rounded: true
|
|
19154
19289
|
}
|
|
19155
19290
|
),
|
|
19156
|
-
credit.name && /* @__PURE__ */ (0,
|
|
19291
|
+
credit.name && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19157
19292
|
Flex,
|
|
19158
19293
|
{
|
|
19159
19294
|
$flexDirection: "column",
|
|
19160
19295
|
$justifyContent: "center",
|
|
19161
19296
|
$gap: "0.5rem",
|
|
19162
|
-
children: /* @__PURE__ */ (0,
|
|
19297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
19163
19298
|
credit.quantity,
|
|
19164
19299
|
" ",
|
|
19165
19300
|
getFeatureName(credit, credit.quantity),
|
|
19166
|
-
credit.period && /* @__PURE__ */ (0,
|
|
19301
|
+
credit.period && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
19167
19302
|
" ",
|
|
19168
19303
|
t2("per"),
|
|
19169
19304
|
" ",
|
|
@@ -19176,7 +19311,7 @@ var Plan2 = ({
|
|
|
19176
19311
|
})
|
|
19177
19312
|
}
|
|
19178
19313
|
),
|
|
19179
|
-
isActivePlan && /* @__PURE__ */ (0,
|
|
19314
|
+
isActivePlan && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19180
19315
|
Flex,
|
|
19181
19316
|
{
|
|
19182
19317
|
$position: "absolute",
|
|
@@ -19185,7 +19320,7 @@ var Plan2 = ({
|
|
|
19185
19320
|
$backgroundColor: settings.theme.primary,
|
|
19186
19321
|
$borderRadius: "9999px",
|
|
19187
19322
|
$padding: "0.125rem 0.85rem",
|
|
19188
|
-
children: /* @__PURE__ */ (0,
|
|
19323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19189
19324
|
Text,
|
|
19190
19325
|
{
|
|
19191
19326
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -19198,7 +19333,7 @@ var Plan2 = ({
|
|
|
19198
19333
|
]
|
|
19199
19334
|
}
|
|
19200
19335
|
),
|
|
19201
|
-
/* @__PURE__ */ (0,
|
|
19336
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
19202
19337
|
Flex,
|
|
19203
19338
|
{
|
|
19204
19339
|
$flexDirection: "column",
|
|
@@ -19207,20 +19342,22 @@ var Plan2 = ({
|
|
|
19207
19342
|
$gap: `${cardPadding}rem`,
|
|
19208
19343
|
$padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
|
|
19209
19344
|
children: [
|
|
19210
|
-
layout.plans.showEntitlements && /* @__PURE__ */ (0,
|
|
19211
|
-
layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ (0,
|
|
19345
|
+
layout.plans.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: [
|
|
19346
|
+
layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: t2("Everything in", {
|
|
19212
19347
|
plan: plans[index - 1].name
|
|
19213
19348
|
}) }) }),
|
|
19214
|
-
plan.entitlements.map((entitlement, idx) => /* @__PURE__ */ (0,
|
|
19349
|
+
plan.entitlements.map((entitlement, idx) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19215
19350
|
Entitlement,
|
|
19216
19351
|
{
|
|
19217
19352
|
entitlement,
|
|
19218
|
-
|
|
19219
|
-
selectedPeriod
|
|
19353
|
+
credits,
|
|
19354
|
+
selectedPeriod,
|
|
19355
|
+
showCredits,
|
|
19356
|
+
sharedProps: { layout }
|
|
19220
19357
|
},
|
|
19221
19358
|
idx
|
|
19222
19359
|
)).slice(0, count?.limit ?? VISIBLE_ENTITLEMENT_COUNT),
|
|
19223
|
-
(count?.size || plan.entitlements.length) > VISIBLE_ENTITLEMENT_COUNT && /* @__PURE__ */ (0,
|
|
19360
|
+
(count?.size || plan.entitlements.length) > VISIBLE_ENTITLEMENT_COUNT && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
19224
19361
|
Flex,
|
|
19225
19362
|
{
|
|
19226
19363
|
$justifyContent: "start",
|
|
@@ -19228,14 +19365,14 @@ var Plan2 = ({
|
|
|
19228
19365
|
$gap: "0.5rem",
|
|
19229
19366
|
$marginTop: "1rem",
|
|
19230
19367
|
children: [
|
|
19231
|
-
/* @__PURE__ */ (0,
|
|
19368
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19232
19369
|
Icon3,
|
|
19233
19370
|
{
|
|
19234
19371
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
19235
19372
|
color: "#D0D0D0"
|
|
19236
19373
|
}
|
|
19237
19374
|
),
|
|
19238
|
-
/* @__PURE__ */ (0,
|
|
19375
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19239
19376
|
Text,
|
|
19240
19377
|
{
|
|
19241
19378
|
onClick: () => handleToggleShowAll(plan.id),
|
|
@@ -19255,7 +19392,7 @@ var Plan2 = ({
|
|
|
19255
19392
|
}
|
|
19256
19393
|
)
|
|
19257
19394
|
] }),
|
|
19258
|
-
isActivePlan ? /* @__PURE__ */ (0,
|
|
19395
|
+
isActivePlan ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
19259
19396
|
Flex,
|
|
19260
19397
|
{
|
|
19261
19398
|
$justifyContent: "center",
|
|
@@ -19263,7 +19400,7 @@ var Plan2 = ({
|
|
|
19263
19400
|
$gap: "0.25rem",
|
|
19264
19401
|
$padding: "0.625rem 0",
|
|
19265
19402
|
children: [
|
|
19266
|
-
/* @__PURE__ */ (0,
|
|
19403
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19267
19404
|
Icon3,
|
|
19268
19405
|
{
|
|
19269
19406
|
name: "check-rounded",
|
|
@@ -19271,55 +19408,52 @@ var Plan2 = ({
|
|
|
19271
19408
|
color: settings.theme.primary
|
|
19272
19409
|
}
|
|
19273
19410
|
),
|
|
19274
|
-
/* @__PURE__ */ (0,
|
|
19411
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { $size: 15, $leading: 1, children: t2("Current plan") })
|
|
19275
19412
|
]
|
|
19276
19413
|
}
|
|
19277
|
-
) : showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ (0,
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
|
|
19309
|
-
|
|
19414
|
+
) : showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
19415
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
19416
|
+
Button,
|
|
19417
|
+
{
|
|
19418
|
+
type: "button",
|
|
19419
|
+
disabled: (isHydratedPlan(plan) && !plan.valid || !canCheckout) && !plan.custom,
|
|
19420
|
+
...index > currentPlanIndex ? {
|
|
19421
|
+
$size: layout.upgrade.buttonSize,
|
|
19422
|
+
$color: layout.upgrade.buttonStyle,
|
|
19423
|
+
$variant: "filled"
|
|
19424
|
+
} : {
|
|
19425
|
+
$size: layout.downgrade.buttonSize,
|
|
19426
|
+
$color: layout.downgrade.buttonStyle,
|
|
19427
|
+
$variant: "outline"
|
|
19428
|
+
},
|
|
19429
|
+
...plan.custom ? {
|
|
19430
|
+
as: "a",
|
|
19431
|
+
href: plan.customPlanConfig?.ctaWebSite ?? "#",
|
|
19432
|
+
target: "_blank",
|
|
19433
|
+
rel: "noreferrer"
|
|
19434
|
+
} : sharedProps.callToActionUrl ? {
|
|
19435
|
+
as: "a",
|
|
19436
|
+
href: sharedProps.callToActionUrl,
|
|
19437
|
+
target: callToActionTarget,
|
|
19438
|
+
rel: "noreferrer"
|
|
19439
|
+
} : {
|
|
19440
|
+
onClick: () => {
|
|
19441
|
+
sharedProps.onCallToAction?.(plan);
|
|
19442
|
+
if (!isStandalone && isHydratedPlan(plan) && !plan.custom) {
|
|
19443
|
+
setCheckoutState({
|
|
19444
|
+
period: selectedPeriod,
|
|
19445
|
+
planId: isActivePlan ? null : plan.id,
|
|
19446
|
+
usage: false
|
|
19447
|
+
});
|
|
19448
|
+
}
|
|
19310
19449
|
}
|
|
19311
|
-
}
|
|
19312
|
-
|
|
19313
|
-
|
|
19314
|
-
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19318
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
19319
|
-
}
|
|
19320
|
-
) : isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable ? t2("Start X day trial", { days: plan.trialDays }) : t2("Choose plan")
|
|
19321
|
-
}
|
|
19322
|
-
)
|
|
19450
|
+
},
|
|
19451
|
+
$fullWidth: true,
|
|
19452
|
+
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : isHydratedPlan(plan) && !plan.valid ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { as: Box, $align: "center", children: t2("Over plan limit") }) : isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable ? t2("Start X day trial", { days: plan.trialDays }) : t2("Choose plan")
|
|
19453
|
+
}
|
|
19454
|
+
),
|
|
19455
|
+
isHydratedPlan(plan) && !plan.valid && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(UsageViolationText, { violations: plan.usageViolations })
|
|
19456
|
+
] })
|
|
19323
19457
|
]
|
|
19324
19458
|
}
|
|
19325
19459
|
)
|
|
@@ -19329,7 +19463,7 @@ var Plan2 = ({
|
|
|
19329
19463
|
};
|
|
19330
19464
|
|
|
19331
19465
|
// src/components/elements/pricing-table/PricingTable.tsx
|
|
19332
|
-
var
|
|
19466
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
19333
19467
|
var resolveDesignProps8 = (props) => {
|
|
19334
19468
|
return {
|
|
19335
19469
|
showPeriodToggle: props.showPeriodToggle ?? true,
|
|
@@ -19433,7 +19567,7 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19433
19567
|
setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
|
|
19434
19568
|
}, [plans]);
|
|
19435
19569
|
if (isPending) {
|
|
19436
|
-
return /* @__PURE__ */ (0,
|
|
19570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19437
19571
|
Flex,
|
|
19438
19572
|
{
|
|
19439
19573
|
$width: "100%",
|
|
@@ -19441,12 +19575,12 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19441
19575
|
$alignItems: "center",
|
|
19442
19576
|
$justifyContent: "center",
|
|
19443
19577
|
$padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
19444
|
-
children: /* @__PURE__ */ (0,
|
|
19578
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Loader, { $size: "2xl" })
|
|
19445
19579
|
}
|
|
19446
19580
|
);
|
|
19447
19581
|
}
|
|
19448
19582
|
const Wrapper = isStandalone ? Container : import_react52.Fragment;
|
|
19449
|
-
return /* @__PURE__ */ (0,
|
|
19583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
19450
19584
|
FussyChild,
|
|
19451
19585
|
{
|
|
19452
19586
|
ref,
|
|
@@ -19455,8 +19589,8 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19455
19589
|
$flexDirection: "column",
|
|
19456
19590
|
$gap: "2rem",
|
|
19457
19591
|
children: [
|
|
19458
|
-
/* @__PURE__ */ (0,
|
|
19459
|
-
/* @__PURE__ */ (0,
|
|
19592
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box, { children: [
|
|
19593
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
19460
19594
|
Flex,
|
|
19461
19595
|
{
|
|
19462
19596
|
$flexDirection: "column",
|
|
@@ -19471,8 +19605,8 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19471
19605
|
}
|
|
19472
19606
|
},
|
|
19473
19607
|
children: [
|
|
19474
|
-
/* @__PURE__ */ (0,
|
|
19475
|
-
showPeriodToggle && periods.length > 1 && /* @__PURE__ */ (0,
|
|
19608
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { display: props.header.fontStyle, children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t2("Plans") }),
|
|
19609
|
+
showPeriodToggle && periods.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19476
19610
|
PeriodToggle,
|
|
19477
19611
|
{
|
|
19478
19612
|
options: periods,
|
|
@@ -19487,7 +19621,7 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19487
19621
|
]
|
|
19488
19622
|
}
|
|
19489
19623
|
),
|
|
19490
|
-
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ (0,
|
|
19624
|
+
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19491
19625
|
Box,
|
|
19492
19626
|
{
|
|
19493
19627
|
$display: "grid",
|
|
@@ -19495,7 +19629,7 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19495
19629
|
$gap: "1rem",
|
|
19496
19630
|
children: plans.map((plan, index, self2) => {
|
|
19497
19631
|
const planPeriod = showPeriodToggle ? selectedPeriod : plan.yearlyPrice && !plan.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
|
|
19498
|
-
return /* @__PURE__ */ (0,
|
|
19632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19499
19633
|
Plan2,
|
|
19500
19634
|
{
|
|
19501
19635
|
plan,
|
|
@@ -19517,17 +19651,17 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19517
19651
|
}
|
|
19518
19652
|
)
|
|
19519
19653
|
] }),
|
|
19520
|
-
/* @__PURE__ */ (0,
|
|
19521
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
19654
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
19655
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19522
19656
|
Flex,
|
|
19523
19657
|
{
|
|
19524
19658
|
$justifyContent: "space-between",
|
|
19525
19659
|
$alignItems: "center",
|
|
19526
19660
|
$marginBottom: "1rem",
|
|
19527
|
-
children: /* @__PURE__ */ (0,
|
|
19661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { display: props.header.fontStyle, children: t2("Add-ons") })
|
|
19528
19662
|
}
|
|
19529
19663
|
),
|
|
19530
|
-
/* @__PURE__ */ (0,
|
|
19664
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19531
19665
|
Box,
|
|
19532
19666
|
{
|
|
19533
19667
|
$display: "grid",
|
|
@@ -19535,7 +19669,7 @@ var PricingTable = (0, import_react52.forwardRef)(
|
|
|
19535
19669
|
$gap: "1rem",
|
|
19536
19670
|
children: addOns.map((addOn, index) => {
|
|
19537
19671
|
const addOnPeriod = showPeriodToggle ? selectedPeriod : addOn.yearlyPrice && !addOn.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
|
|
19538
|
-
return /* @__PURE__ */ (0,
|
|
19672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
19539
19673
|
AddOn2,
|
|
19540
19674
|
{
|
|
19541
19675
|
addOn,
|
|
@@ -19562,7 +19696,7 @@ PricingTable.displayName = "PricingTable";
|
|
|
19562
19696
|
|
|
19563
19697
|
// src/components/elements/text/Text.tsx
|
|
19564
19698
|
var import_react53 = require("react");
|
|
19565
|
-
var
|
|
19699
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
19566
19700
|
var resolveDesignProps9 = (props) => {
|
|
19567
19701
|
return {
|
|
19568
19702
|
text: {
|
|
@@ -19574,7 +19708,7 @@ var resolveDesignProps9 = (props) => {
|
|
|
19574
19708
|
};
|
|
19575
19709
|
var TextElement = (0, import_react53.forwardRef)(({ children, className, ...rest }, ref) => {
|
|
19576
19710
|
const props = resolveDesignProps9(rest);
|
|
19577
|
-
return /* @__PURE__ */ (0,
|
|
19711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Element, { as: Flex, ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
19578
19712
|
Text,
|
|
19579
19713
|
{
|
|
19580
19714
|
display: props.text.fontStyle,
|
|
@@ -19588,7 +19722,7 @@ TextElement.displayName = "Text";
|
|
|
19588
19722
|
|
|
19589
19723
|
// src/components/elements/unsubscribe-button/UnsubscribeButton.tsx
|
|
19590
19724
|
var import_react54 = require("react");
|
|
19591
|
-
var
|
|
19725
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
19592
19726
|
var buttonStyles = {
|
|
19593
19727
|
primary: {
|
|
19594
19728
|
color: "primary",
|
|
@@ -19624,7 +19758,7 @@ var UnsubscribeButton = (0, import_react54.forwardRef)(({ children, className, .
|
|
|
19624
19758
|
if (!hasActiveSubscription) {
|
|
19625
19759
|
return null;
|
|
19626
19760
|
}
|
|
19627
|
-
return /* @__PURE__ */ (0,
|
|
19761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
19628
19762
|
Element,
|
|
19629
19763
|
{
|
|
19630
19764
|
as: Flex,
|
|
@@ -19632,7 +19766,7 @@ var UnsubscribeButton = (0, import_react54.forwardRef)(({ children, className, .
|
|
|
19632
19766
|
className,
|
|
19633
19767
|
$flexDirection: "column",
|
|
19634
19768
|
$gap: "2rem",
|
|
19635
|
-
children: /* @__PURE__ */ (0,
|
|
19769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
19636
19770
|
Button,
|
|
19637
19771
|
{
|
|
19638
19772
|
type: "button",
|
|
@@ -19654,7 +19788,7 @@ UnsubscribeButton.displayName = "UnsubscribeButton";
|
|
|
19654
19788
|
|
|
19655
19789
|
// src/components/elements/upcoming-bill/UpcomingBill.tsx
|
|
19656
19790
|
var import_react55 = require("react");
|
|
19657
|
-
var
|
|
19791
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
19658
19792
|
function resolveDesignProps11(props) {
|
|
19659
19793
|
return {
|
|
19660
19794
|
header: {
|
|
@@ -19729,9 +19863,9 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19729
19863
|
if (!isCheckoutData(data) || !data.subscription || data.subscription.cancelAt) {
|
|
19730
19864
|
return null;
|
|
19731
19865
|
}
|
|
19732
|
-
return /* @__PURE__ */ (0,
|
|
19733
|
-
/* @__PURE__ */ (0,
|
|
19734
|
-
error ? /* @__PURE__ */ (0,
|
|
19866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Element, { ref, className, children: [
|
|
19867
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
|
|
19868
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
19735
19869
|
Flex,
|
|
19736
19870
|
{
|
|
19737
19871
|
as: TransitionBox,
|
|
@@ -19740,8 +19874,8 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19740
19874
|
$alignItems: "center",
|
|
19741
19875
|
$gap: "1rem",
|
|
19742
19876
|
children: [
|
|
19743
|
-
/* @__PURE__ */ (0,
|
|
19744
|
-
/* @__PURE__ */ (0,
|
|
19877
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your upcoming invoice.") }),
|
|
19878
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
19745
19879
|
Button,
|
|
19746
19880
|
{
|
|
19747
19881
|
type: "button",
|
|
@@ -19754,28 +19888,28 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19754
19888
|
)
|
|
19755
19889
|
]
|
|
19756
19890
|
}
|
|
19757
|
-
) : !isLoading && /* @__PURE__ */ (0,
|
|
19758
|
-
props.header.isVisible && upcomingInvoice.dueDate && /* @__PURE__ */ (0,
|
|
19891
|
+
) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TransitionBox, { children: upcomingInvoice ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
19892
|
+
props.header.isVisible && upcomingInvoice.dueDate && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Text, { display: props.header.fontStyle, children: [
|
|
19759
19893
|
props.header.prefix,
|
|
19760
19894
|
" ",
|
|
19761
19895
|
toPrettyDate(upcomingInvoice.dueDate)
|
|
19762
19896
|
] }),
|
|
19763
|
-
/* @__PURE__ */ (0,
|
|
19897
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
19764
19898
|
Flex,
|
|
19765
19899
|
{
|
|
19766
19900
|
$justifyContent: "space-between",
|
|
19767
19901
|
$alignItems: "start",
|
|
19768
19902
|
$gap: "1rem",
|
|
19769
19903
|
children: [
|
|
19770
|
-
props.price.isVisible && /* @__PURE__ */ (0,
|
|
19904
|
+
props.price.isVisible && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { display: props.price.fontStyle, $leading: 1, children: formatCurrency(
|
|
19771
19905
|
upcomingInvoice.amountDue,
|
|
19772
19906
|
upcomingInvoice.currency
|
|
19773
19907
|
) }),
|
|
19774
|
-
/* @__PURE__ */ (0,
|
|
19908
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box, { $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { display: props.contractEndDate.fontStyle, children: t2("Estimated bill") }) })
|
|
19775
19909
|
]
|
|
19776
19910
|
}
|
|
19777
19911
|
),
|
|
19778
|
-
balances.length > 0 && /* @__PURE__ */ (0,
|
|
19912
|
+
balances.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
19779
19913
|
Flex,
|
|
19780
19914
|
{
|
|
19781
19915
|
as: TransitionBox,
|
|
@@ -19783,20 +19917,20 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19783
19917
|
$alignItems: "start",
|
|
19784
19918
|
$gap: "1rem",
|
|
19785
19919
|
children: [
|
|
19786
|
-
/* @__PURE__ */ (0,
|
|
19787
|
-
/* @__PURE__ */ (0,
|
|
19920
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { $weight: 600, children: t2("Remaining balance") }),
|
|
19921
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: balances.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { children: formatCurrency(item.balance, item.currency) }, idx)) })
|
|
19788
19922
|
]
|
|
19789
19923
|
}
|
|
19790
19924
|
),
|
|
19791
|
-
discounts.length > 0 && /* @__PURE__ */ (0,
|
|
19925
|
+
discounts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
19792
19926
|
Flex,
|
|
19793
19927
|
{
|
|
19794
19928
|
$justifyContent: "space-between",
|
|
19795
19929
|
$alignItems: "start",
|
|
19796
19930
|
$gap: "1rem",
|
|
19797
19931
|
children: [
|
|
19798
|
-
/* @__PURE__ */ (0,
|
|
19799
|
-
/* @__PURE__ */ (0,
|
|
19932
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { $weight: 600, children: t2("Discount") }),
|
|
19933
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
19800
19934
|
Flex,
|
|
19801
19935
|
{
|
|
19802
19936
|
$flexDirection: "column",
|
|
@@ -19806,13 +19940,13 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19806
19940
|
(acc, discount) => {
|
|
19807
19941
|
if (typeof discount.percentOff === "number" || typeof discount.amountOff === "number") {
|
|
19808
19942
|
acc.push(
|
|
19809
|
-
/* @__PURE__ */ (0,
|
|
19943
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
19810
19944
|
Flex,
|
|
19811
19945
|
{
|
|
19812
19946
|
$alignItems: "center",
|
|
19813
19947
|
$gap: "0.5rem",
|
|
19814
19948
|
children: [
|
|
19815
|
-
discount.customerFacingCode && /* @__PURE__ */ (0,
|
|
19949
|
+
discount.customerFacingCode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
19816
19950
|
Flex,
|
|
19817
19951
|
{
|
|
19818
19952
|
$alignItems: "center",
|
|
@@ -19821,7 +19955,7 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19821
19955
|
$borderStyle: "solid",
|
|
19822
19956
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
|
|
19823
19957
|
$borderRadius: "0.3125rem",
|
|
19824
|
-
children: /* @__PURE__ */ (0,
|
|
19958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
19825
19959
|
Text,
|
|
19826
19960
|
{
|
|
19827
19961
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -19831,7 +19965,7 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19831
19965
|
)
|
|
19832
19966
|
}
|
|
19833
19967
|
),
|
|
19834
|
-
/* @__PURE__ */ (0,
|
|
19968
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { children: typeof discount.percentOff === "number" ? t2("Percent off", {
|
|
19835
19969
|
percent: discount.percentOff
|
|
19836
19970
|
}) : t2("Amount off", {
|
|
19837
19971
|
amount: formatCurrency(
|
|
@@ -19855,7 +19989,7 @@ var UpcomingBill = (0, import_react55.forwardRef)(({ className, ...rest }, ref)
|
|
|
19855
19989
|
]
|
|
19856
19990
|
}
|
|
19857
19991
|
)
|
|
19858
|
-
] }) : /* @__PURE__ */ (0,
|
|
19992
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { display: "heading2", children: t2("No upcoming invoice") }) })
|
|
19859
19993
|
] });
|
|
19860
19994
|
});
|
|
19861
19995
|
UpcomingBill.displayName = "UpcomingBill";
|
|
@@ -24115,10 +24249,10 @@ function createRenderer(options) {
|
|
|
24115
24249
|
}
|
|
24116
24250
|
|
|
24117
24251
|
// src/components/embed/Embed.tsx
|
|
24118
|
-
var
|
|
24252
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
24119
24253
|
var Loading = () => {
|
|
24120
24254
|
const { settings } = useEmbed();
|
|
24121
|
-
return /* @__PURE__ */ (0,
|
|
24255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
24122
24256
|
Flex,
|
|
24123
24257
|
{
|
|
24124
24258
|
$width: "100%",
|
|
@@ -24126,13 +24260,13 @@ var Loading = () => {
|
|
|
24126
24260
|
$alignItems: "center",
|
|
24127
24261
|
$justifyContent: "center",
|
|
24128
24262
|
$padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
24129
|
-
children: /* @__PURE__ */ (0,
|
|
24263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Loader, { $color: "#194BFB", $size: "2xl" })
|
|
24130
24264
|
}
|
|
24131
24265
|
);
|
|
24132
24266
|
};
|
|
24133
24267
|
var Error2 = ({ message }) => {
|
|
24134
24268
|
const { settings } = useEmbed();
|
|
24135
|
-
return /* @__PURE__ */ (0,
|
|
24269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
24136
24270
|
Flex,
|
|
24137
24271
|
{
|
|
24138
24272
|
$flexDirection: "column",
|
|
@@ -24143,14 +24277,14 @@ var Error2 = ({ message }) => {
|
|
|
24143
24277
|
$alignItems: "center",
|
|
24144
24278
|
$justifyContent: "center",
|
|
24145
24279
|
children: [
|
|
24146
|
-
/* @__PURE__ */ (0,
|
|
24147
|
-
/* @__PURE__ */ (0,
|
|
24280
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text, { display: "heading1", children: "Error" }) }),
|
|
24281
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text, { children: message }) })
|
|
24148
24282
|
]
|
|
24149
24283
|
}
|
|
24150
24284
|
);
|
|
24151
24285
|
};
|
|
24152
24286
|
var SchematicEmbed = ({ id, accessToken }) => {
|
|
24153
|
-
const [children, setChildren] = (0, import_react57.useState)(/* @__PURE__ */ (0,
|
|
24287
|
+
const [children, setChildren] = (0, import_react57.useState)(/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Loading, {}));
|
|
24154
24288
|
const theme = (0, import_react57.useContext)(et);
|
|
24155
24289
|
const {
|
|
24156
24290
|
data,
|
|
@@ -24200,13 +24334,13 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
24200
24334
|
return stub();
|
|
24201
24335
|
}
|
|
24202
24336
|
if (error) {
|
|
24203
|
-
return /* @__PURE__ */ (0,
|
|
24337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Error2, { message: error.message });
|
|
24204
24338
|
}
|
|
24205
24339
|
if (accessToken?.length === 0) {
|
|
24206
|
-
return /* @__PURE__ */ (0,
|
|
24340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Error2, { message: "Please provide an access token." });
|
|
24207
24341
|
}
|
|
24208
24342
|
if (!accessToken?.startsWith("token_")) {
|
|
24209
|
-
return /* @__PURE__ */ (0,
|
|
24343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
24210
24344
|
Error2,
|
|
24211
24345
|
{
|
|
24212
24346
|
message: 'Invalid access token; your temporary access token will start with "token_".'
|
|
@@ -24214,9 +24348,9 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
24214
24348
|
);
|
|
24215
24349
|
}
|
|
24216
24350
|
if (isPending) {
|
|
24217
|
-
return /* @__PURE__ */ (0,
|
|
24351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Loading, {});
|
|
24218
24352
|
}
|
|
24219
|
-
return /* @__PURE__ */ (0,
|
|
24353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children });
|
|
24220
24354
|
};
|
|
24221
24355
|
/*! Bundled license information:
|
|
24222
24356
|
|