@schematichq/schematic-components 2.27.1 → 2.29.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.
@@ -1932,6 +1932,7 @@ var initialContext = {
1932
1932
  hydrate: stub,
1933
1933
  hydrateComponent: stub,
1934
1934
  hydrateExternal: stub,
1935
+ rehydrateWithParams: stub,
1935
1936
  getUpcomingInvoice: stub,
1936
1937
  getCustomerBalance: stub,
1937
1938
  listInvoices: stub,
@@ -7596,7 +7597,8 @@ function HydrateComponentParamsFromJSONTyped(json, ignoreDiscriminator) {
7596
7597
  return json;
7597
7598
  }
7598
7599
  return {
7599
- catalogId: json["catalog_id"] == null ? void 0 : json["catalog_id"]
7600
+ catalogId: json["catalog_id"] == null ? void 0 : json["catalog_id"],
7601
+ includeAddOnIds: json["include_add_on_ids"] == null ? void 0 : json["include_add_on_ids"]
7600
7602
  };
7601
7603
  }
7602
7604
 
@@ -8628,6 +8630,9 @@ var CheckoutexternalApi = class extends BaseAPI {
8628
8630
  if (requestParameters["catalogId"] != null) {
8629
8631
  queryParameters["catalog_id"] = requestParameters["catalogId"];
8630
8632
  }
8633
+ if (requestParameters["includeAddOnIds"] != null) {
8634
+ queryParameters["include_add_on_ids"] = requestParameters["includeAddOnIds"];
8635
+ }
8631
8636
  const headerParameters = {};
8632
8637
  if (this.configuration && this.configuration.apiKey) {
8633
8638
  headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
@@ -13254,6 +13259,7 @@ var en = {
13254
13259
  "An invoice is created when charges reach $X; the rest is billed monthly.": "An invoice is created when charges reach {{amount}}; the rest is billed monthly.",
13255
13260
  "An unknown error occurred.": "An unknown error occurred.",
13256
13261
  "Billed": "Billed {{period}}",
13262
+ "Billing threshold": "Billing threshold",
13257
13263
  "Bundle selected": "Bundle selected",
13258
13264
  "Buy credits": "Buy credits",
13259
13265
  "Cancel": "Cancel",
@@ -13288,8 +13294,11 @@ var en = {
13288
13294
  "Due today": "Due today",
13289
13295
  "Edit payment details": "Edit payment details",
13290
13296
  "Edit": "Edit",
13297
+ "Email": "Email",
13291
13298
  "Ends on": "Ends on {{date}}",
13292
13299
  "Enter discount code": "Enter discount code",
13300
+ "Enter email address": "Enter email address",
13301
+ "Error": "Error",
13293
13302
  "Error initializing payment method change. Please try again.": "Error initializing payment method change. Please try again.",
13294
13303
  "Error processing payment. Please try a different payment method.": "Error processing payment. Please try a different payment method.",
13295
13304
  "Error retrieving plan details. Please try again in a moment.": "Error retrieving plan details. Please try again in a moment.",
@@ -13310,6 +13319,7 @@ var en = {
13310
13319
  "Invoice credit tooltip": "Credit \u2014 this amount was returned to your account, typically due to a plan change or proration",
13311
13320
  "Invoice charge tooltip": "Charge \u2014 you were billed this amount",
13312
13321
  "Invoices": "Invoices",
13322
+ "Limit": "Limit",
13313
13323
  "Limit of": "Limit of {{amount}}",
13314
13324
  "Loading": "Loading",
13315
13325
  "Manage plan": "Manage plan",
@@ -13334,6 +13344,8 @@ var en = {
13334
13344
  "Payment Details": "Payment Details",
13335
13345
  "Plan selected": "Plan selected",
13336
13346
  "Please accept the agreement to continue.": "Please accept the agreement to continue.",
13347
+ "Please try again later.": "Please try again later.",
13348
+ "Portal not found": "Portal not found",
13337
13349
  "Plan": "Plan",
13338
13350
  "Plans": "Plans",
13339
13351
  "Please provide an access token.": "Please provide an access token.",
@@ -13385,6 +13397,7 @@ var en = {
13385
13397
  "There was a problem retrieving your upcoming invoice.": "There was a problem retrieving your upcoming invoice.",
13386
13398
  "There was a problem retrieving your invoices.": "There was a problem retrieving your invoices.",
13387
13399
  "Tier-based": "Tier-based",
13400
+ "Tiered pricing": "Tiered pricing",
13388
13401
  "Tiers apply progressively as quantity increases.": "Tiers apply progressively as quantity increases.",
13389
13402
  "Top up balance with:": "Top up balance with:",
13390
13403
  "Top-ups": "Top-ups",
@@ -13458,6 +13471,15 @@ var en = {
13458
13471
  "$X/unit/period": "{{cost}}/{{unit}}/{{period}}",
13459
13472
  "$X/Y units/period": "{{cost}}/{{size}} {{units}}/{{period}}",
13460
13473
  "day": "day",
13474
+ "day_one": "day",
13475
+ "day_other": "days",
13476
+ "hour_one": "hour",
13477
+ "hour_other": "hours",
13478
+ "minute_one": "minute",
13479
+ "minute_other": "minutes",
13480
+ "second_one": "second",
13481
+ "second_other": "seconds",
13482
+ "week": "week",
13461
13483
  "month": "month",
13462
13484
  "quarter": "quarter",
13463
13485
  "year": "year",
@@ -13466,6 +13488,13 @@ var en = {
13466
13488
  "yr": "yr",
13467
13489
  "one time": "one time",
13468
13490
  "billing period": "billing period",
13491
+ "billing period_one": "billing period",
13492
+ "billing period_other": "billing periods",
13493
+ "daily": "daily",
13494
+ "weekly": "weekly",
13495
+ "monthly": "monthly",
13496
+ "quarterly": "quarterly",
13497
+ "yearly": "yearly",
13469
13498
  "expires after purchase": "expires {{amount}} {{unit}} after purchase",
13470
13499
  "expires at the end of the billing period": "expires at the end of the billing period",
13471
13500
  "expires at the end of the next billing period": "expires at the end of the next billing period",
@@ -14155,11 +14184,9 @@ function formatBundleExpiry(bundle, t3) {
14155
14184
  if (typeof bundle.expiryUnitCount !== "number") {
14156
14185
  return void 0;
14157
14186
  }
14158
- const unit = bundle.expiryUnit === BillingCreditExpiryUnit.BillingPeriods ? t3("billing period") : t3("day");
14159
- return t3("expires after purchase", {
14160
- amount: bundle.expiryUnitCount,
14161
- unit: pluralize(unit, bundle.expiryUnitCount)
14162
- });
14187
+ const count = bundle.expiryUnitCount;
14188
+ const unit = bundle.expiryUnit === BillingCreditExpiryUnit.BillingPeriods ? t3("billing period", { count }) : t3("day", { count });
14189
+ return t3("expires after purchase", { amount: count, unit });
14163
14190
  }
14164
14191
  case BillingCreditExpiryType.EndOfBillingPeriod:
14165
14192
  return t3("expires at the end of the billing period");
@@ -14404,16 +14431,33 @@ function entitlementHasHardLimit(entitlement) {
14404
14431
  }
14405
14432
 
14406
14433
  // src/utils/api/feature.ts
14407
- function getFeatureName(feature, count = 0, ignore = false) {
14408
- const shouldBePlural = count === 0 || count > 1;
14434
+ function isEnglish(locale) {
14435
+ try {
14436
+ return new Intl.Locale(locale).language === "en";
14437
+ } catch {
14438
+ return true;
14439
+ }
14440
+ }
14441
+ function isOne(count, locale) {
14442
+ return new Intl.PluralRules(locale).select(count) === "one";
14443
+ }
14444
+ function getFeatureName(feature, locale, count, ignore = false) {
14445
+ if (!isEnglish(locale)) {
14446
+ const named = ignore ? { name: feature.name } : feature;
14447
+ const singularName2 = named.singularName || named.name;
14448
+ const pluralName2 = named.pluralName || singularName2;
14449
+ return count !== void 0 && isOne(count, locale) ? singularName2 : pluralName2;
14450
+ }
14451
+ const resolvedCount = count ?? 0;
14452
+ const shouldBePlural = resolvedCount === 0 || resolvedCount > 1;
14409
14453
  const { name, singularName, pluralName } = feature;
14410
14454
  if (!ignore && pluralName && shouldBePlural) {
14411
14455
  return pluralName;
14412
14456
  }
14413
14457
  if (!ignore && singularName) {
14414
- return shouldBePlural ? pluralize(singularName, count) : singularName;
14458
+ return shouldBePlural ? pluralize(singularName, resolvedCount) : singularName;
14415
14459
  }
14416
- return pluralize(name, count);
14460
+ return pluralize(name, resolvedCount);
14417
14461
  }
14418
14462
 
14419
14463
  // src/utils/color.ts
@@ -14623,8 +14667,21 @@ function formatCurrency(amount, {
14623
14667
  function formatOrdinal(n2, t3) {
14624
14668
  return t3("Ordinal", { count: n2, ordinal: true });
14625
14669
  }
14626
- function adjectify(str) {
14627
- return `${str}ly`;
14670
+ function adjectify(period, t3) {
14671
+ switch (period) {
14672
+ case "day":
14673
+ return t3("daily");
14674
+ case "week":
14675
+ return t3("weekly");
14676
+ case "month":
14677
+ return t3("monthly");
14678
+ case "quarter":
14679
+ return t3("quarterly");
14680
+ case "year":
14681
+ return t3("yearly");
14682
+ default:
14683
+ return period;
14684
+ }
14628
14685
  }
14629
14686
  var CURRENCY_FLAGS = {
14630
14687
  usd: "\u{1F1FA}\u{1F1F8}",
@@ -14740,11 +14797,12 @@ function getBillingPreviewText({
14740
14797
  );
14741
14798
  }
14742
14799
  const schedule = scheduleParts.length > 0 ? `${scheduleParts.join(" ")} ` : "";
14800
+ const period = t3(planPeriod);
14743
14801
  if (!discount) {
14744
14802
  return t3("You will be billed", {
14745
14803
  price: subscriptionPrice,
14746
14804
  usage,
14747
- period: planPeriod,
14805
+ period,
14748
14806
  schedule
14749
14807
  });
14750
14808
  }
@@ -14753,7 +14811,7 @@ function getBillingPreviewText({
14753
14811
  return t3("You will be billed", {
14754
14812
  price: discountedPrice,
14755
14813
  usage,
14756
- period: planPeriod,
14814
+ period,
14757
14815
  schedule
14758
14816
  });
14759
14817
  }
@@ -14761,7 +14819,7 @@ function getBillingPreviewText({
14761
14819
  return t3("You will be billed with discount window", {
14762
14820
  price: discountedPrice,
14763
14821
  usage,
14764
- period: planPeriod,
14822
+ period,
14765
14823
  schedule,
14766
14824
  window: t3("for the next months", { count: durationInMonths }),
14767
14825
  fullPrice: subscriptionPrice
@@ -14770,7 +14828,7 @@ function getBillingPreviewText({
14770
14828
  return t3("You will be billed next bill discount", {
14771
14829
  price: discountedPrice,
14772
14830
  usage,
14773
- period: planPeriod,
14831
+ period,
14774
14832
  schedule,
14775
14833
  fullPrice: subscriptionPrice
14776
14834
  });
@@ -15545,7 +15603,7 @@ var reducer = (state, action) => {
15545
15603
  // src/context/EmbedProvider.tsx
15546
15604
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
15547
15605
  var getCustomHeaders = (sessionId) => ({
15548
- "X-Schematic-Components-Version": "2.27.1",
15606
+ "X-Schematic-Components-Version": "2.29.0",
15549
15607
  "X-Schematic-Session-ID": sessionId
15550
15608
  });
15551
15609
  var normalizeCurrencyFilter = (filter2) => {
@@ -15743,6 +15801,34 @@ var EmbedProvider = ({
15743
15801
  ),
15744
15802
  [hydrateExternal]
15745
15803
  );
15804
+ const rehydrateWithParams = useCallback2(
15805
+ async (params) => {
15806
+ const componentId = state.data?.component?.id;
15807
+ if (!componentId || !checkoutApi) {
15808
+ throw new Error(
15809
+ "[Schematic] `rehydrateWithParams` needs a `SchematicEmbed` that has loaded."
15810
+ );
15811
+ }
15812
+ const response = await checkoutApi.hydrateComponent({
15813
+ componentId,
15814
+ includeAddOnIds: params.includeAddOnIds
15815
+ });
15816
+ const returnedIds = new Set(
15817
+ response.data.activeAddOns.map((addOn) => addOn.id)
15818
+ );
15819
+ const missingIds = (params.includeAddOnIds ?? []).filter(
15820
+ (id) => !returnedIds.has(id)
15821
+ );
15822
+ if (missingIds.length > 0) {
15823
+ console.warn(
15824
+ `[Schematic] These included add-ons were left out because each must be an add-on with a billing product: ${missingIds.join(", ")}`
15825
+ );
15826
+ }
15827
+ dispatch({ type: "HYDRATE_COMPONENT", data: response.data });
15828
+ return response.data;
15829
+ },
15830
+ [checkoutApi, state.data?.component?.id]
15831
+ );
15746
15832
  const createSetupIntent = useCallback2(async () => {
15747
15833
  return checkoutApi?.createSetupIntent();
15748
15834
  }, [checkoutApi]);
@@ -16086,6 +16172,7 @@ var EmbedProvider = ({
16086
16172
  hydrate: debouncedHydrate,
16087
16173
  hydrateComponent: debouncedHydrateComponent,
16088
16174
  hydrateExternal: debouncedHydrateExternal,
16175
+ rehydrateWithParams,
16089
16176
  createSetupIntent: debouncedCreateSetupIntent,
16090
16177
  updatePaymentMethod: debouncedUpdatePaymentMethod,
16091
16178
  deletePaymentMethod: debouncedDeletePaymentMethod,
@@ -16440,6 +16527,7 @@ function useRequest(fn) {
16440
16527
  import { useMemo as useMemo8 } from "react";
16441
16528
  function useTrialEnd() {
16442
16529
  const { data } = useEmbed();
16530
+ const { t: t3 } = useTranslation();
16443
16531
  const { endDate, amount, units } = useMemo8(() => {
16444
16532
  const billingSubscription = data?.company?.billingSubscription;
16445
16533
  const end = typeof billingSubscription?.trialEnd === "number" ? new Date(billingSubscription.trialEnd * 1e3) : void 0;
@@ -16462,10 +16550,10 @@ function useTrialEnd() {
16462
16550
  amount2 = Math.floor(difference / SECONDS_IN_MS);
16463
16551
  unit = "second";
16464
16552
  }
16465
- units2 = pluralize(unit, amount2);
16553
+ units2 = t3(unit, { count: amount2 });
16466
16554
  }
16467
16555
  return { endDate: end, amount: amount2, units: units2 };
16468
- }, [data?.company?.billingSubscription]);
16556
+ }, [data?.company?.billingSubscription, t3]);
16469
16557
  return { endDate, amount, units };
16470
16558
  }
16471
16559
 
@@ -17880,7 +17968,7 @@ var AutoTopupNotice = ({
17880
17968
  trigger: /* @__PURE__ */ jsx14(
17881
17969
  Icon3,
17882
17970
  {
17883
- title: "auto top-up",
17971
+ title: t3("Auto Top-up"),
17884
17972
  name: "info-rounded",
17885
17973
  color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
17886
17974
  style: { lineHeight: 0 }
@@ -17919,7 +18007,7 @@ var BillingThresholdTooltip = ({
17919
18007
  trigger: /* @__PURE__ */ jsx15(
17920
18008
  Icon3,
17921
18009
  {
17922
- title: "billing threshold",
18010
+ title: t3("Billing threshold"),
17923
18011
  name: "info-rounded",
17924
18012
  color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
17925
18013
  style: { lineHeight: 0 }
@@ -18115,7 +18203,7 @@ var Entitlement = ({
18115
18203
  packageSize,
18116
18204
  " "
18117
18205
  ] }),
18118
- getFeatureName(entitlement.feature, packageSize),
18206
+ getFeatureName(entitlement.feature, locale, packageSize),
18119
18207
  entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs8(Fragment4, { children: [
18120
18208
  " ",
18121
18209
  t3("per"),
@@ -18140,12 +18228,13 @@ var Entitlement = ({
18140
18228
  " ",
18141
18229
  getFeatureName(
18142
18230
  entitlement.valueCredit,
18231
+ locale,
18143
18232
  entitlement.consumptionRate || void 0
18144
18233
  ),
18145
18234
  " ",
18146
18235
  t3("per"),
18147
18236
  " ",
18148
- getFeatureName(entitlement.feature, 1)
18237
+ getFeatureName(entitlement.feature, locale, 1)
18149
18238
  ] });
18150
18239
  }
18151
18240
  if (entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && creditBasedEntitlementLimit) {
@@ -18153,13 +18242,17 @@ var Entitlement = ({
18153
18242
  amount: creditBasedEntitlementLimit.limit,
18154
18243
  units: getFeatureName(
18155
18244
  entitlement.feature,
18245
+ locale,
18156
18246
  creditBasedEntitlementLimit.limit
18157
18247
  ),
18158
- period: creditBasedEntitlementLimit.period
18248
+ period: t3(
18249
+ creditBasedEntitlementLimit.period
18250
+ )
18159
18251
  }) : t3("Up to X units", {
18160
18252
  amount: creditBasedEntitlementLimit.limit,
18161
18253
  units: getFeatureName(
18162
18254
  entitlement.feature,
18255
+ locale,
18163
18256
  creditBasedEntitlementLimit.limit
18164
18257
  )
18165
18258
  }) });
@@ -18167,11 +18260,11 @@ var Entitlement = ({
18167
18260
  if (hasNumericValue) {
18168
18261
  return /* @__PURE__ */ jsxs8(Fragment4, { children: [
18169
18262
  entitlement.valueType === EntitlementValueType.Unlimited && !entitlement.priceBehavior ? t3("Unlimited", {
18170
- item: getFeatureName(entitlement.feature)
18263
+ item: getFeatureName(entitlement.feature, locale)
18171
18264
  }) : typeof limit === "number" && /* @__PURE__ */ jsxs8(Fragment4, { children: [
18172
18265
  formatNumber(limit, { locale }),
18173
18266
  " ",
18174
- getFeatureName(entitlement.feature, limit)
18267
+ getFeatureName(entitlement.feature, locale, limit)
18175
18268
  ] }),
18176
18269
  metricPeriodName && /* @__PURE__ */ jsxs8(Fragment4, { children: [
18177
18270
  " ",
@@ -18210,7 +18303,7 @@ var Entitlement = ({
18210
18303
  packageSize,
18211
18304
  " "
18212
18305
  ] }),
18213
- getFeatureName(entitlement.feature, packageSize),
18306
+ getFeatureName(entitlement.feature, locale, packageSize),
18214
18307
  entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs8(Fragment4, { children: [
18215
18308
  "/",
18216
18309
  shortenPeriod(period, t3)
@@ -18550,7 +18643,7 @@ var AutoTopup = ({
18550
18643
  updateAutoTopupConfig
18551
18644
  }) => {
18552
18645
  const { settings } = useEmbed();
18553
- const { t: t3 } = useTranslation();
18646
+ const { t: t3, locale } = useTranslation();
18554
18647
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
18555
18648
  const configurableCreditGrants = useMemo12(() => {
18556
18649
  return planCreditGrants.reduce(
@@ -18597,7 +18690,7 @@ var AutoTopup = ({
18597
18690
  }) }) }),
18598
18691
  /* @__PURE__ */ jsx20(Box, { as: "p", $marginBottom: "2rem", children: /* @__PURE__ */ jsx20(Text, { children: t3(
18599
18692
  "Automatically purchase more credits when your balance is low",
18600
- { units: getFeatureName(grant.credit) }
18693
+ { units: getFeatureName(grant.credit, locale) }
18601
18694
  ) }) })
18602
18695
  ] }),
18603
18696
  /* @__PURE__ */ jsxs10(Flex, { $alignItems: "center", $gap: "0.5rem", $marginBottom: "1rem", children: [
@@ -18794,7 +18887,7 @@ var Quantity = ({
18794
18887
  $color: settings.theme.typography.text.color,
18795
18888
  children: t3("Currently using", {
18796
18889
  quantity: entitlement.usage,
18797
- unit: getFeatureName(entitlement.feature)
18890
+ unit: getFeatureName(entitlement.feature, locale)
18798
18891
  })
18799
18892
  }
18800
18893
  ),
@@ -18859,7 +18952,11 @@ var Quantity = ({
18859
18952
  packageSize,
18860
18953
  " "
18861
18954
  ] }),
18862
- getFeatureName(entitlement.feature, packageSize),
18955
+ getFeatureName(
18956
+ entitlement.feature,
18957
+ locale,
18958
+ packageSize
18959
+ ),
18863
18960
  "/",
18864
18961
  shortenPeriod(period, t3)
18865
18962
  ] })
@@ -18896,12 +18993,14 @@ var Quantity = ({
18896
18993
  quantity: entitlement.quantity,
18897
18994
  licenseName: getFeatureName(
18898
18995
  entitlement.feature,
18996
+ locale,
18899
18997
  entitlement.quantity
18900
18998
  ),
18901
18999
  perUnit: perLicenseGrant.amount,
18902
19000
  total: includedCredits,
18903
19001
  creditName: getFeatureName(
18904
19002
  licenseCredit,
19003
+ locale,
18905
19004
  includedCredits
18906
19005
  ),
18907
19006
  period: shortenPeriod(licenseCredit.period, t3)
@@ -18923,11 +19022,13 @@ var Quantity = ({
18923
19022
  added: addedQuantity,
18924
19023
  licenseName: getFeatureName(
18925
19024
  entitlement.feature,
19025
+ locale,
18926
19026
  addedQuantity
18927
19027
  ),
18928
19028
  credits: addedCredits,
18929
19029
  creditName: getFeatureName(
18930
19030
  licenseCredit,
19031
+ locale,
18931
19032
  addedCredits
18932
19033
  )
18933
19034
  }),
@@ -18937,9 +19038,10 @@ var Quantity = ({
18937
19038
  total: includedCredits,
18938
19039
  creditName: getFeatureName(
18939
19040
  licenseCredit,
19041
+ locale,
18940
19042
  includedCredits
18941
19043
  ),
18942
- cadence: adjectify(licenseCredit.period),
19044
+ cadence: adjectify(licenseCredit.period, t3),
18943
19045
  day: formatOrdinal(renewalDate.getDate(), t3)
18944
19046
  })
18945
19047
  ] })
@@ -18978,6 +19080,7 @@ function renderMeteredEntitlementPricing({
18978
19080
  "/",
18979
19081
  feature ? getFeatureName(
18980
19082
  feature,
19083
+ locale,
18981
19084
  packageSize
18982
19085
  ) : featureName || "unit"
18983
19086
  ] });
@@ -18995,6 +19098,7 @@ function renderMeteredEntitlementPricing({
18995
19098
  ] }),
18996
19099
  feature ? getFeatureName(
18997
19100
  feature,
19101
+ locale,
18998
19102
  packageSize
18999
19103
  ) : featureName || "unit"
19000
19104
  ] });
@@ -19312,7 +19416,7 @@ var Credits = ({
19312
19416
  /* @__PURE__ */ jsx23(Box, { children: /* @__PURE__ */ jsxs13(Text, { display: "heading6", children: [
19313
19417
  formatNumber(bundle.quantity ?? 0, { locale }),
19314
19418
  " ",
19315
- getFeatureName(bundle)
19419
+ getFeatureName(bundle, locale)
19316
19420
  ] }) })
19317
19421
  ] }),
19318
19422
  typeof price === "number" && /* @__PURE__ */ jsx23(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx23(Text, { children: formatCurrency(price, {
@@ -21271,7 +21375,7 @@ var CurrencyPeriodMismatchNotice = ({
21271
21375
  style: { opacity: 0.85, textAlign: "center" },
21272
21376
  children: t3("No {{currency}} price for the {{period}} billing period.", {
21273
21377
  currency: currency.toUpperCase(),
21274
- period
21378
+ period: adjectify(period, t3)
21275
21379
  })
21276
21380
  }
21277
21381
  )
@@ -21433,7 +21537,7 @@ var HardLimitTooltip = ({
21433
21537
  feature,
21434
21538
  limit
21435
21539
  }) => {
21436
- const { t: t3 } = useTranslation();
21540
+ const { t: t3, locale } = useTranslation();
21437
21541
  const { data } = useEmbed();
21438
21542
  const isLightBackground = useIsLightBackground();
21439
21543
  const showHardLimit = data?.displaySettings?.showHardLimit ?? false;
@@ -21447,7 +21551,7 @@ var HardLimitTooltip = ({
21447
21551
  trigger: /* @__PURE__ */ jsx32(
21448
21552
  Icon3,
21449
21553
  {
21450
- title: "limit",
21554
+ title: t3("Limit"),
21451
21555
  name: "info-rounded",
21452
21556
  color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
21453
21557
  style: { lineHeight: 0 }
@@ -21455,7 +21559,7 @@ var HardLimitTooltip = ({
21455
21559
  ),
21456
21560
  content: /* @__PURE__ */ jsx32(Text, { children: t3("Up to a limit of", {
21457
21561
  amount: limit,
21458
- units: getFeatureName(feature, limit)
21562
+ units: getFeatureName(feature, locale, limit)
21459
21563
  }) })
21460
21564
  }
21461
21565
  );
@@ -21824,7 +21928,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
21824
21928
  )
21825
21929
  ] }),
21826
21930
  stripe && collectEmail && /* @__PURE__ */ jsxs25(Box, { "data-field": "name", $marginBottom: "1.5rem", $verticalAlign: "top", children: [
21827
- /* @__PURE__ */ jsx36(Label, { htmlFor: "email", children: "Email" }),
21931
+ /* @__PURE__ */ jsx36(Label, { htmlFor: "email", children: t3("Email") }),
21828
21932
  /* @__PURE__ */ jsx36(
21829
21933
  Input2,
21830
21934
  {
@@ -21833,7 +21937,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
21833
21937
  type: "email",
21834
21938
  value: email,
21835
21939
  autoComplete: "email",
21836
- placeholder: "Enter email address",
21940
+ placeholder: t3("Enter email address"),
21837
21941
  required: true,
21838
21942
  onChange: (e) => {
21839
21943
  userEditedEmailRef.current = true;
@@ -21960,7 +22064,7 @@ var PeriodToggle = ({
21960
22064
  },
21961
22065
  $size: 15,
21962
22066
  $weight: option === selectedOption ? 600 : 400,
21963
- children: t3("Billed", { period: adjectify(option) })
22067
+ children: t3("Billed", { period: adjectify(option, t3) })
21964
22068
  }
21965
22069
  )
21966
22070
  },
@@ -22000,7 +22104,7 @@ var PlanCreditText = ({
22000
22104
  entitlements,
22001
22105
  children
22002
22106
  }) => {
22003
- const { t: t3 } = useTranslation();
22107
+ const { t: t3, locale } = useTranslation();
22004
22108
  const { settings } = useEmbed();
22005
22109
  const sources = entitlements ?? [];
22006
22110
  const { perLicenseGrants } = credit;
@@ -22008,7 +22112,7 @@ var PlanCreditText = ({
22008
22112
  return /* @__PURE__ */ jsxs26(Text, { children: [
22009
22113
  credit.quantity,
22010
22114
  " ",
22011
- getFeatureName(credit, credit.quantity),
22115
+ getFeatureName(credit, locale, credit.quantity),
22012
22116
  credit.period && /* @__PURE__ */ jsxs26(Fragment11, { children: [
22013
22117
  " ",
22014
22118
  t3("per"),
@@ -22020,18 +22124,18 @@ var PlanCreditText = ({
22020
22124
  }
22021
22125
  const resolveLicenseName = (grant) => {
22022
22126
  const licenseFeature = (findLicenseSource(sources, grant.licenseId) ?? (grant.licenseId ? void 0 : findSoleLicenseSource(sources)))?.feature;
22023
- return licenseFeature ? getFeatureName(licenseFeature, 1) : t3("license");
22127
+ return licenseFeature ? getFeatureName(licenseFeature, locale, 1) : t3("license");
22024
22128
  };
22025
22129
  return /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
22026
22130
  perLicenseGrants.map((grant, grantIndex) => /* @__PURE__ */ jsxs26(Text, { children: [
22027
22131
  credit.period ? t3("X credits per license per period", {
22028
22132
  amount: grant.amount,
22029
- creditName: getFeatureName(credit, grant.amount),
22133
+ creditName: getFeatureName(credit, locale, grant.amount),
22030
22134
  licenseName: resolveLicenseName(grant),
22031
22135
  period: t3(credit.period)
22032
22136
  }) : t3("X credits per license", {
22033
22137
  amount: grant.amount,
22034
- creditName: getFeatureName(credit, grant.amount),
22138
+ creditName: getFeatureName(credit, locale, grant.amount),
22035
22139
  licenseName: resolveLicenseName(grant)
22036
22140
  }),
22037
22141
  grantIndex === 0 && children
@@ -22044,7 +22148,7 @@ var PlanCreditText = ({
22044
22148
  $color: settings.theme.typography.text.color,
22045
22149
  children: t3("Plus X credits per period for your company", {
22046
22150
  amount: credit.fixedQuantity,
22047
- creditName: getFeatureName(credit, credit.fixedQuantity),
22151
+ creditName: getFeatureName(credit, locale, credit.fixedQuantity),
22048
22152
  period: t3(credit.period)
22049
22153
  })
22050
22154
  }
@@ -22073,7 +22177,7 @@ var PriceText = ({
22073
22177
  formatCurrency(perUnitPrice, { locale, currency }),
22074
22178
  /* @__PURE__ */ jsxs27("sub", { children: [
22075
22179
  "/",
22076
- getFeatureName(feature, 1)
22180
+ getFeatureName(feature, locale, 1)
22077
22181
  ] })
22078
22182
  ] });
22079
22183
  }
@@ -22090,7 +22194,7 @@ var PriceText = ({
22090
22194
  formatCurrency(perUnitPrice, { locale, currency }),
22091
22195
  /* @__PURE__ */ jsxs27("sub", { children: [
22092
22196
  "/",
22093
- getFeatureName(feature, 1)
22197
+ getFeatureName(feature, locale, 1)
22094
22198
  ] }),
22095
22199
  " + ",
22096
22200
  formatCurrency(flatAmount, { locale, currency }),
@@ -22151,7 +22255,7 @@ var PricingTiersTooltip = ({
22151
22255
  trigger: /* @__PURE__ */ jsx40(
22152
22256
  Icon3,
22153
22257
  {
22154
- title: "tiered pricing",
22258
+ title: t3("Tiered pricing"),
22155
22259
  name: "info-rounded",
22156
22260
  color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
22157
22261
  style: { lineHeight: 0 }
@@ -22660,11 +22764,11 @@ var EntitlementRow = (props) => {
22660
22764
  /* @__PURE__ */ jsx42(Box, { children: /* @__PURE__ */ jsx42(Text, { display: "heading4", children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? /* @__PURE__ */ jsxs30(Fragment14, { children: [
22661
22765
  quantity,
22662
22766
  " ",
22663
- getFeatureName(feature, quantity)
22767
+ getFeatureName(feature, locale, quantity)
22664
22768
  ] }) : priceBehavior === EntitlementPriceBehavior.Overage && typeof softLimit === "number" ? /* @__PURE__ */ jsxs30(Fragment14, { children: [
22665
22769
  softLimit,
22666
22770
  " ",
22667
- getFeatureName(feature, softLimit)
22771
+ getFeatureName(feature, locale, softLimit)
22668
22772
  ] }) : feature.name }) }),
22669
22773
  /* @__PURE__ */ jsx42(Box, { $whiteSpace: "nowrap", $lineHeight: 1, children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? (
22670
22774
  // A tiered scheme still resolves to a fixed amount at the chosen
@@ -22695,7 +22799,7 @@ var EntitlementRow = (props) => {
22695
22799
  packageSize,
22696
22800
  " "
22697
22801
  ] }),
22698
- getFeatureName(feature, packageSize),
22802
+ getFeatureName(feature, locale, packageSize),
22699
22803
  feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs30(Fragment14, { children: [
22700
22804
  "/",
22701
22805
  shortenPeriod(planPeriod, t3)
@@ -22992,7 +23096,7 @@ var SubscriptionSidebar = forwardRef7(
22992
23096
  $color: settings.theme.typography.text.color,
22993
23097
  children: t3("Includes X credits per period", {
22994
23098
  total: includedCredits,
22995
- creditName: getFeatureName(credit, includedCredits),
23099
+ creditName: getFeatureName(credit, locale, includedCredits),
22996
23100
  period: shortenPeriod(credit.period, t3)
22997
23101
  })
22998
23102
  }
@@ -23730,7 +23834,7 @@ var SubscriptionSidebar = forwardRef7(
23730
23834
  /* @__PURE__ */ jsx44(Box, { children: /* @__PURE__ */ jsxs32(Text, { children: [
23731
23835
  formatNumber(amount, { locale }),
23732
23836
  " ",
23733
- getFeatureName(bundle, amount),
23837
+ getFeatureName(bundle, locale, amount),
23734
23838
  expiry && ` \xB7 ${expiry}`
23735
23839
  ] }) })
23736
23840
  ] }),
@@ -24024,21 +24128,21 @@ var TieredPricingDetails = ({
24024
24128
  if (flatAmount === 0 && perUnitPrice === 0) {
24025
24129
  return t3("Up to X units for free", {
24026
24130
  X: upTo,
24027
- units: getFeatureName(entitlement.feature, upTo)
24131
+ units: getFeatureName(entitlement.feature, locale, upTo)
24028
24132
  });
24029
24133
  }
24030
24134
  if (flatAmount === 0 && perUnitPrice > 0) {
24031
24135
  return t3("Up to X units at $Y/unit", {
24032
24136
  X: upTo,
24033
- units: getFeatureName(entitlement.feature, upTo),
24137
+ units: getFeatureName(entitlement.feature, locale, upTo),
24034
24138
  Y: formatCurrency(perUnitPrice, { locale, currency }),
24035
- unit: getFeatureName(entitlement.feature, 1)
24139
+ unit: getFeatureName(entitlement.feature, locale, 1)
24036
24140
  });
24037
24141
  }
24038
24142
  if (flatAmount > 0 && perUnitPrice === 0) {
24039
24143
  return t3("Up to X units for $Y/period", {
24040
24144
  X: upTo,
24041
- units: getFeatureName(entitlement.feature, upTo),
24145
+ units: getFeatureName(entitlement.feature, locale, upTo),
24042
24146
  Y: formatCurrency(flatAmount, { locale, currency }),
24043
24147
  period
24044
24148
  });
@@ -24046,9 +24150,9 @@ var TieredPricingDetails = ({
24046
24150
  if (flatAmount > 0 && perUnitPrice > 0) {
24047
24151
  return t3("Up to X units at $Y/unit + $Z/period", {
24048
24152
  X: upTo,
24049
- units: getFeatureName(entitlement.feature, upTo),
24153
+ units: getFeatureName(entitlement.feature, locale, upTo),
24050
24154
  Y: formatCurrency(perUnitPrice, { locale, currency }),
24051
- unit: getFeatureName(entitlement.feature, 1),
24155
+ unit: getFeatureName(entitlement.feature, locale, 1),
24052
24156
  Z: formatCurrency(flatAmount, { locale, currency }),
24053
24157
  period
24054
24158
  });
@@ -24351,6 +24455,7 @@ var Badge = () => {
24351
24455
  // src/components/layout/RenderLayout.tsx
24352
24456
  import { jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
24353
24457
  var Disabled = () => {
24458
+ const { t: t3 } = useTranslation();
24354
24459
  return /* @__PURE__ */ jsx48(Box, { $width: "max-content", $height: "max-content", children: /* @__PURE__ */ jsx48(Card, { children: /* @__PURE__ */ jsxs35(
24355
24460
  Element,
24356
24461
  {
@@ -24360,8 +24465,8 @@ var Disabled = () => {
24360
24465
  $alignItems: "center",
24361
24466
  $whiteSpace: "nowrap",
24362
24467
  children: [
24363
- /* @__PURE__ */ jsx48(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx48(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
24364
- /* @__PURE__ */ jsx48(Text, { as: "p", children: "Please try again later." })
24468
+ /* @__PURE__ */ jsx48(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx48(Text, { as: "h1", display: "heading1", children: t3("Portal not found") }) }),
24469
+ /* @__PURE__ */ jsx48(Text, { as: "p", children: t3("Please try again later.") })
24365
24470
  ]
24366
24471
  }
24367
24472
  ) }) });
@@ -24555,12 +24660,12 @@ var UsageDetails = ({ entitlement, layout }) => {
24555
24660
  if (priceBehavior === EntitlementPriceBehavior.PayInAdvance && typeof allocation === "number") {
24556
24661
  return t3("X units", {
24557
24662
  amount: formatNumber(allocation, { locale }),
24558
- units: getFeatureName(feature, allocation)
24663
+ units: getFeatureName(feature, locale, allocation)
24559
24664
  });
24560
24665
  }
24561
24666
  if (priceBehavior === EntitlementPriceBehavior.PayAsYouGo && typeof price === "number") {
24562
24667
  const formattedCost = formatCurrency(price, { locale, currency });
24563
- const featureName = getFeatureName(feature, packageSize);
24668
+ const featureName = getFeatureName(feature, locale, packageSize);
24564
24669
  return packageSize > 1 ? t3("$X per Y units", {
24565
24670
  cost: formattedCost,
24566
24671
  size: packageSize,
@@ -24570,15 +24675,15 @@ var UsageDetails = ({ entitlement, layout }) => {
24570
24675
  if (priceBehavior === EntitlementPriceBehavior.Overage && typeof softLimit === "number") {
24571
24676
  return t3("X units", {
24572
24677
  amount: formatNumber(softLimit, { locale }),
24573
- units: getFeatureName(feature, softLimit)
24678
+ units: getFeatureName(feature, locale, softLimit)
24574
24679
  });
24575
24680
  }
24576
24681
  if (priceBehavior === EntitlementPriceBehavior.Tier) {
24577
24682
  return typeof currentTier?.to === "number" && (currentTier?.to === Infinity ? t3("Unlimited in this tier", {
24578
- feature: getFeatureName(feature)
24683
+ feature: getFeatureName(feature, locale)
24579
24684
  }) : t3("Up to X units in this tier", {
24580
24685
  amount: formatNumber(currentTier.to, { locale }),
24581
- feature: getFeatureName(feature, currentTier.to)
24686
+ feature: getFeatureName(feature, locale, currentTier.to)
24582
24687
  }));
24583
24688
  }
24584
24689
  if (showCredits && priceBehavior === EntitlementPriceBehavior.CreditBurndown && planEntitlement?.valueCredit && typeof planEntitlement?.consumptionRate === "number") {
@@ -24586,6 +24691,7 @@ var UsageDetails = ({ entitlement, layout }) => {
24586
24691
  amount: formatConsumptionRate(planEntitlement.consumptionRate, locale),
24587
24692
  units: getFeatureName(
24588
24693
  planEntitlement.valueCredit,
24694
+ locale,
24589
24695
  planEntitlement.consumptionRate
24590
24696
  )
24591
24697
  });
@@ -24593,18 +24699,18 @@ var UsageDetails = ({ entitlement, layout }) => {
24593
24699
  if (priceBehavior === EntitlementPriceBehavior.CreditBurndown && typeof limit === "number") {
24594
24700
  return t3("X units remaining", {
24595
24701
  amount: formatNumber(limit, { locale }),
24596
- units: getFeatureName(feature, limit)
24702
+ units: getFeatureName(feature, locale, limit)
24597
24703
  });
24598
24704
  }
24599
24705
  if (!priceBehavior && typeof allocation === "number") {
24600
24706
  const numericLimit = limit ?? allocation;
24601
24707
  return t3("X units", {
24602
24708
  amount: formatNumber(numericLimit, { locale }),
24603
- units: getFeatureName(feature, numericLimit)
24709
+ units: getFeatureName(feature, locale, numericLimit)
24604
24710
  });
24605
24711
  }
24606
24712
  if (!priceBehavior && allocationType === "unlimited") {
24607
- return t3("Unlimited", { item: getFeatureName(feature) });
24713
+ return t3("Unlimited", { item: getFeatureName(feature, locale) });
24608
24714
  }
24609
24715
  }, [
24610
24716
  t3,
@@ -24633,11 +24739,11 @@ var UsageDetails = ({ entitlement, layout }) => {
24633
24739
  /* @__PURE__ */ jsx51(Fragment17, { children: packageSize > 1 ? t3("$X/Y units/period", {
24634
24740
  cost: formatCurrency(price, { locale, currency }),
24635
24741
  size: packageSize,
24636
- units: getFeatureName(feature, packageSize),
24742
+ units: getFeatureName(feature, locale, packageSize),
24637
24743
  period: shortenPeriod(period, t3)
24638
24744
  }) : t3("$X/unit/period", {
24639
24745
  cost: formatCurrency(price, { locale, currency }),
24640
- unit: getFeatureName(feature, packageSize),
24746
+ unit: getFeatureName(feature, locale, packageSize),
24641
24747
  period: shortenPeriod(period, t3)
24642
24748
  }) }, index)
24643
24749
  );
@@ -24646,7 +24752,7 @@ var UsageDetails = ({ entitlement, layout }) => {
24646
24752
  acc.push(
24647
24753
  /* @__PURE__ */ jsx51(Fragment17, { children: t3("X units used", {
24648
24754
  amount: usage,
24649
- units: getFeatureName(feature, usage)
24755
+ units: getFeatureName(feature, locale, usage)
24650
24756
  }) }, index)
24651
24757
  );
24652
24758
  index += 1;
@@ -24876,9 +24982,10 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
24876
24982
  singularName: grant.singularName,
24877
24983
  pluralName: grant.pluralName
24878
24984
  },
24985
+ locale,
24879
24986
  grant.creditAmount
24880
24987
  ),
24881
- licenseName: entitlement.feature ? getFeatureName(entitlement.feature, 1) : ""
24988
+ licenseName: entitlement.feature ? getFeatureName(entitlement.feature, locale, 1) : ""
24882
24989
  }) }, grantIndex)),
24883
24990
  props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ jsx52(
24884
24991
  Text,
@@ -25212,7 +25319,7 @@ var PriceDetails = ({
25212
25319
  packageSize,
25213
25320
  " "
25214
25321
  ] }),
25215
- getFeatureName(feature, packageSize),
25322
+ getFeatureName(feature, locale, packageSize),
25216
25323
  feature.featureType === FeatureType.Trait && period && /* @__PURE__ */ jsxs40(Fragment21, { children: [
25217
25324
  "/",
25218
25325
  shortenPeriod(period, t3)
@@ -25237,7 +25344,7 @@ var PriceDetails = ({
25237
25344
  typeof amount === "number" && /* @__PURE__ */ jsx55(Fragment21, { children: priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs40(Text, { children: [
25238
25345
  formatNumber(amount, { locale }),
25239
25346
  " ",
25240
- getFeatureName(feature, amount),
25347
+ getFeatureName(feature, locale, amount),
25241
25348
  " \xB7 ",
25242
25349
  formatCurrency(currentTierPerUnitPrice * amount, {
25243
25350
  locale,
@@ -25365,7 +25472,7 @@ var UsageByUser = ({ source, unit }) => {
25365
25472
  const total = current?.section?.total ?? 0;
25366
25473
  const totalUsers = current?.section?.totalUsers ?? 0;
25367
25474
  const unattributed = current?.section?.unattributed;
25368
- const formatAmount = (amount) => `${formatNumber(amount, { locale })} ${getFeatureName(unit, amount)}`;
25475
+ const formatAmount = (amount) => `${formatNumber(amount, { locale })} ${getFeatureName(unit, locale, amount)}`;
25369
25476
  if (error) {
25370
25477
  return /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", $alignItems: "flex-start", children: [
25371
25478
  /* @__PURE__ */ jsx56(Text, { display: "heading4", children: t3("Usage by user") }),
@@ -25470,10 +25577,10 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
25470
25577
  const acc = [];
25471
25578
  acc.push(
25472
25579
  priceBehavior === EntitlementPriceBehavior.Tier && typeof currentTier?.to === "number" && typeof feature !== "undefined" ? currentTier?.to === Infinity ? t3("Unlimited in this tier", {
25473
- feature: getFeatureName(feature)
25580
+ feature: getFeatureName(feature, locale)
25474
25581
  }) : t3("Up to X units in this tier", {
25475
25582
  amount: currentTier.to,
25476
- feature: getFeatureName(feature)
25583
+ feature: getFeatureName(feature, locale)
25477
25584
  }) : priceBehavior === EntitlementPriceBehavior.Overage && typeof limit === "number" ? t3("X included", {
25478
25585
  amount: formatNumber(limit, { locale })
25479
25586
  }) : priceBehavior === EntitlementPriceBehavior.PayInAdvance && typeof usage === "number" ? `${formatNumber(usage, { locale })} ${t3("used")}` : priceBehavior === EntitlementPriceBehavior.PayAsYouGo && typeof cost === "number" ? formatCurrency(cost, { locale, currency: billingPrice?.currency }) : data?.displaySettings?.showCredits && priceBehavior === EntitlementPriceBehavior.CreditBurndown && typeof planEntitlement?.valueCredit !== "undefined" && typeof planEntitlement?.consumptionRate === "number" ? t3("X units per use", {
@@ -25483,11 +25590,12 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
25483
25590
  ),
25484
25591
  units: getFeatureName(
25485
25592
  planEntitlement.valueCredit,
25593
+ locale,
25486
25594
  planEntitlement.consumptionRate
25487
25595
  )
25488
25596
  }) : priceBehavior === EntitlementPriceBehavior.CreditBurndown && typeof feature !== "undefined" && typeof limit === "number" ? t3("X units remaining", {
25489
25597
  amount: formatNumber(limit, { locale }),
25490
- units: getFeatureName(feature, limit)
25598
+ units: getFeatureName(feature, locale, limit)
25491
25599
  }) : typeof limit === "number" ? t3("Limit of", {
25492
25600
  amount: formatNumber(limit, { locale })
25493
25601
  }) : t3("No limit")
@@ -25689,11 +25797,11 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25689
25797
  formatNumber(limit, { locale }),
25690
25798
  " "
25691
25799
  ] }),
25692
- getFeatureName(feature, limit)
25800
+ getFeatureName(feature, locale, limit)
25693
25801
  ] }) : typeof usage === "number" && /* @__PURE__ */ jsxs42(Fragment22, { children: [
25694
25802
  formatNumber(usage, { locale }),
25695
25803
  " ",
25696
- getFeatureName(feature, usage),
25804
+ getFeatureName(feature, locale, usage),
25697
25805
  " ",
25698
25806
  t3("used")
25699
25807
  ] }) }) }),
@@ -25782,6 +25890,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25782
25890
  }),
25783
25891
  units: getFeatureName(
25784
25892
  credit,
25893
+ locale,
25785
25894
  credit.total.remaining
25786
25895
  )
25787
25896
  }) }) }),
@@ -25823,6 +25932,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25823
25932
  quantity: licenseQuantity,
25824
25933
  licenseName: getFeatureName(
25825
25934
  licenseFeature,
25935
+ locale,
25826
25936
  licenseQuantity
25827
25937
  ),
25828
25938
  perUnit: perLicenseGrant.amount
@@ -25847,7 +25957,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25847
25957
  children: [
25848
25958
  t3("Your plan includes credits", {
25849
25959
  total,
25850
- creditName: getFeatureName(credit, total),
25960
+ creditName: getFeatureName(credit, locale, total),
25851
25961
  period: shortenPeriod(composition.period, t3),
25852
25962
  composition: ` \u2014 ${parts.join(" + ")}`
25853
25963
  }),
@@ -25882,6 +25992,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25882
25992
  amount: grant.quantity,
25883
25993
  item: getFeatureName(
25884
25994
  credit,
25995
+ locale,
25885
25996
  grant.quantity
25886
25997
  )
25887
25998
  }) }) }),
@@ -25903,7 +26014,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25903
26014
  ] }) : /* @__PURE__ */ jsxs42(Fragment22, { children: [
25904
26015
  /* @__PURE__ */ jsx57(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx57(Text, { children: grant.grantReason === BillingCreditGrantReason.Purchased ? /* @__PURE__ */ jsx57(Fragment22, { children: t3("X item bundle", {
25905
26016
  amount: grant.quantity,
25906
- item: getFeatureName(credit, 1),
26017
+ item: getFeatureName(credit, locale, 1),
25907
26018
  createdAt: toPrettyDate(
25908
26019
  grant.createdAt,
25909
26020
  { locale, month: "short" }
@@ -25912,6 +26023,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25912
26023
  amount: grant.quantity,
25913
26024
  item: getFeatureName(
25914
26025
  credit,
26026
+ locale,
25915
26027
  grant.quantity
25916
26028
  ),
25917
26029
  createdAt: toPrettyDate(
@@ -25922,6 +26034,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
25922
26034
  amount: grant.quantity,
25923
26035
  item: getFeatureName(
25924
26036
  credit,
26037
+ locale,
25925
26038
  grant.quantity
25926
26039
  ),
25927
26040
  createdAt: toPrettyDate(
@@ -26302,7 +26415,7 @@ PaymentMethod.displayName = "PaymentMethod";
26302
26415
  // src/components/elements/payment-method/PaymentMethodDetails.tsx
26303
26416
  import { Elements } from "@stripe/react-stripe-js";
26304
26417
 
26305
- // node_modules/.pnpm/@stripe+stripe-js@9.16.0/node_modules/@stripe/stripe-js/dist/index.mjs
26418
+ // node_modules/.pnpm/@stripe+stripe-js@9.17.0/node_modules/@stripe/stripe-js/dist/index.mjs
26306
26419
  function _typeof(obj) {
26307
26420
  "@babel/helpers - typeof";
26308
26421
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
@@ -26356,7 +26469,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
26356
26469
  }
26357
26470
  stripe._registerWrapper({
26358
26471
  name: "stripe-js",
26359
- version: "9.16.0",
26472
+ version: "9.17.0",
26360
26473
  startTime
26361
26474
  });
26362
26475
  };
@@ -26434,7 +26547,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
26434
26547
  var version = runtimeVersionToUrlVersion(maybeStripe.version);
26435
26548
  var expectedVersion = RELEASE_TRAIN;
26436
26549
  if (isTestKey && version !== expectedVersion) {
26437
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.16.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
26550
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.17.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
26438
26551
  }
26439
26552
  var stripe = maybeStripe.apply(void 0, args);
26440
26553
  registerWrapper(stripe, startTime);
@@ -26889,7 +27002,7 @@ var UsageDetails2 = ({
26889
27002
  packageSize,
26890
27003
  " "
26891
27004
  ] }),
26892
- getFeatureName(entitlement.feature, packageSize),
27005
+ getFeatureName(entitlement.feature, locale, packageSize),
26893
27006
  entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs46(Fragment24, { children: [
26894
27007
  "/",
26895
27008
  shortenPeriod(period, t3)
@@ -26909,6 +27022,7 @@ var UsageDetails2 = ({
26909
27022
  " ",
26910
27023
  getFeatureName(
26911
27024
  entitlement.planEntitlement.valueCredit,
27025
+ locale,
26912
27026
  entitlement.planEntitlement.consumptionRate
26913
27027
  ),
26914
27028
  " ",
@@ -26944,7 +27058,7 @@ var UsageDetails2 = ({
26944
27058
  /* @__PURE__ */ jsx62(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" ? /* @__PURE__ */ jsxs46(Fragment24, { children: [
26945
27059
  quantity,
26946
27060
  " ",
26947
- getFeatureName(entitlement.feature, quantity, true)
27061
+ getFeatureName(entitlement.feature, locale, quantity, true)
26948
27062
  ] }) : entitlement.feature.name }),
26949
27063
  /* @__PURE__ */ jsxs46(Text, { children: [
26950
27064
  description.length > 0 && /* @__PURE__ */ jsx62(
@@ -27405,9 +27519,14 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27405
27519
  amount: perLicenseGrant.amount,
27406
27520
  creditName: getFeatureName(
27407
27521
  group,
27522
+ locale,
27408
27523
  perLicenseGrant.amount
27409
27524
  ),
27410
- licenseName: getFeatureName(licenseFeature, 1)
27525
+ licenseName: getFeatureName(
27526
+ licenseFeature,
27527
+ locale,
27528
+ 1
27529
+ )
27411
27530
  }),
27412
27531
  composition.fixedQuantity > 0 && creditPeriod && /* @__PURE__ */ jsxs47(Fragment25, { children: [
27413
27532
  " ",
@@ -27415,6 +27534,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27415
27534
  amount: composition.fixedQuantity,
27416
27535
  creditName: getFeatureName(
27417
27536
  group,
27537
+ locale,
27418
27538
  composition.fixedQuantity
27419
27539
  ),
27420
27540
  period: t3(
@@ -27425,7 +27545,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27425
27545
  ] }) : /* @__PURE__ */ jsxs47(Fragment25, { children: [
27426
27546
  group.total.value,
27427
27547
  " ",
27428
- getFeatureName(group, group.total.value),
27548
+ getFeatureName(group, locale, group.total.value),
27429
27549
  " ",
27430
27550
  subscriptionInterval && /* @__PURE__ */ jsxs47(Fragment25, { children: [
27431
27551
  t3("per"),
@@ -27468,6 +27588,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27468
27588
  quantity: licenseQuantity,
27469
27589
  licenseName: getFeatureName(
27470
27590
  licenseFeature,
27591
+ locale,
27471
27592
  licenseQuantity
27472
27593
  ),
27473
27594
  perUnit: perLicenseGrant.amount,
@@ -27475,6 +27596,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27475
27596
  total: resolvedTotal,
27476
27597
  creditName: getFeatureName(
27477
27598
  group,
27599
+ locale,
27478
27600
  resolvedTotal
27479
27601
  ),
27480
27602
  period: shortenPeriod(creditPeriod, t3)
@@ -27482,12 +27604,14 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27482
27604
  quantity: licenseQuantity,
27483
27605
  licenseName: getFeatureName(
27484
27606
  licenseFeature,
27607
+ locale,
27485
27608
  licenseQuantity
27486
27609
  ),
27487
27610
  perUnit: perLicenseGrant.amount,
27488
27611
  total: resolvedTotal,
27489
27612
  creditName: getFeatureName(
27490
27613
  group,
27614
+ locale,
27491
27615
  resolvedTotal
27492
27616
  ),
27493
27617
  period: shortenPeriod(creditPeriod, t3)
@@ -27529,7 +27653,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27529
27653
  if (!autoTopupEnabled) {
27530
27654
  acc.push(
27531
27655
  /* @__PURE__ */ jsx63(Text, { $leading: "tight", children: t3("Auto top-up disabled for token", {
27532
- unit: getFeatureName(grant.credit, 1)
27656
+ unit: getFeatureName(grant.credit, locale, 1)
27533
27657
  }) }, grant.id)
27534
27658
  );
27535
27659
  return acc;
@@ -27541,6 +27665,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27541
27665
  /* @__PURE__ */ jsx63(Text, { $leading: "tight", children: t3("Adds X tokens when Y remaining in balance", {
27542
27666
  unit: getFeatureName(
27543
27667
  grant.credit,
27668
+ locale,
27544
27669
  autoTopupAmount
27545
27670
  ),
27546
27671
  amount: autoTopupAmount,
@@ -27600,7 +27725,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27600
27725
  " (",
27601
27726
  group.quantity,
27602
27727
  " ",
27603
- getFeatureName(group, group.quantity),
27728
+ getFeatureName(group, locale, group.quantity),
27604
27729
  ")"
27605
27730
  ] }) : /* @__PURE__ */ jsxs47(Text, { display: props.addOns.fontStyle, children: [
27606
27731
  group.grants.length > 1 && /* @__PURE__ */ jsxs47(Text, { style: { opacity: 0.5 }, children: [
@@ -27611,7 +27736,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27611
27736
  ] }),
27612
27737
  group.quantity,
27613
27738
  " ",
27614
- getFeatureName(group, group.quantity)
27739
+ getFeatureName(group, locale, group.quantity)
27615
27740
  ] }),
27616
27741
  group.total.used > 0 && /* @__PURE__ */ jsxs47(
27617
27742
  Text,
@@ -27671,12 +27796,12 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27671
27796
  " (",
27672
27797
  group.quantity,
27673
27798
  " ",
27674
- getFeatureName(group, group.quantity),
27799
+ getFeatureName(group, locale, group.quantity),
27675
27800
  ")"
27676
27801
  ] }) : /* @__PURE__ */ jsxs47(Text, { display: props.addOns.fontStyle, children: [
27677
27802
  group.quantity,
27678
27803
  " ",
27679
- getFeatureName(group, group.quantity)
27804
+ getFeatureName(group, locale, group.quantity)
27680
27805
  ] }),
27681
27806
  group.total.used > 0 && /* @__PURE__ */ jsxs47(
27682
27807
  Text,
@@ -27727,7 +27852,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
27727
27852
  /* @__PURE__ */ jsxs47(Text, { display: props.addOns.fontStyle, children: [
27728
27853
  group.quantity,
27729
27854
  " ",
27730
- getFeatureName(group, group.quantity)
27855
+ getFeatureName(group, locale, group.quantity)
27731
27856
  ] }),
27732
27857
  group.total.used > 0 && /* @__PURE__ */ jsxs47(
27733
27858
  Text,
@@ -27807,6 +27932,7 @@ function renderMeteredEntitlementPricing2({
27807
27932
  "/",
27808
27933
  feature ? getFeatureName(
27809
27934
  feature,
27935
+ locale,
27810
27936
  packageSize
27811
27937
  ) : featureName || "unit"
27812
27938
  ] });
@@ -27824,6 +27950,7 @@ function renderMeteredEntitlementPricing2({
27824
27950
  ] }),
27825
27951
  feature ? getFeatureName(
27826
27952
  feature,
27953
+ locale,
27827
27954
  packageSize
27828
27955
  ) : featureName || "unit"
27829
27956
  ] });
@@ -28013,7 +28140,7 @@ var AddOn2 = ({
28013
28140
  {
28014
28141
  $flexDirection: "column",
28015
28142
  $justifyContent: "center",
28016
- children: /* @__PURE__ */ jsx64(Text, { children: getFeatureName(entitlement.feature) })
28143
+ children: /* @__PURE__ */ jsx64(Text, { children: getFeatureName(entitlement.feature, locale) })
28017
28144
  }
28018
28145
  )
28019
28146
  ] }),
@@ -28175,7 +28302,11 @@ var Entitlement2 = ({
28175
28302
  formatNumber(entitlementPackageSize, { locale }),
28176
28303
  " "
28177
28304
  ] }),
28178
- getFeatureName(entitlement.feature, entitlementPackageSize),
28305
+ getFeatureName(
28306
+ entitlement.feature,
28307
+ locale,
28308
+ entitlementPackageSize
28309
+ ),
28179
28310
  entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs49(Fragment27, { children: [
28180
28311
  " ",
28181
28312
  t3("per"),
@@ -28193,12 +28324,13 @@ var Entitlement2 = ({
28193
28324
  " ",
28194
28325
  getFeatureName(
28195
28326
  entitlement.valueCredit,
28327
+ locale,
28196
28328
  entitlement.consumptionRate
28197
28329
  ),
28198
28330
  " ",
28199
28331
  t3("per"),
28200
28332
  " ",
28201
- getFeatureName(entitlement.feature, 1)
28333
+ getFeatureName(entitlement.feature, locale, 1)
28202
28334
  ] }) : entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && creditBasedEntitlementLimit ? /* @__PURE__ */ jsx65(Fragment27, { children: creditBasedEntitlementLimit?.period ? t3("Up to X units per period", {
28203
28335
  amount: formatNumber(
28204
28336
  creditBasedEntitlementLimit.limit,
@@ -28206,9 +28338,12 @@ var Entitlement2 = ({
28206
28338
  ),
28207
28339
  units: getFeatureName(
28208
28340
  entitlement.feature,
28341
+ locale,
28209
28342
  creditBasedEntitlementLimit.limit
28210
28343
  ),
28211
- period: creditBasedEntitlementLimit.period
28344
+ period: t3(
28345
+ creditBasedEntitlementLimit.period
28346
+ )
28212
28347
  }) : t3("Up to X units", {
28213
28348
  amount: formatNumber(
28214
28349
  creditBasedEntitlementLimit.limit,
@@ -28216,17 +28351,18 @@ var Entitlement2 = ({
28216
28351
  ),
28217
28352
  units: getFeatureName(
28218
28353
  entitlement.feature,
28354
+ locale,
28219
28355
  creditBasedEntitlementLimit.limit
28220
28356
  )
28221
28357
  }) }) : entitlement.valueType === EntitlementValueType.Numeric || entitlement.valueType === EntitlementValueType.Unlimited || entitlement.valueType === EntitlementValueType.Trait ? /* @__PURE__ */ jsxs49(Fragment27, { children: [
28222
28358
  entitlement.valueType === EntitlementValueType.Unlimited && !entitlement.priceBehavior ? t3("Unlimited", {
28223
- item: getFeatureName(entitlement.feature)
28359
+ item: getFeatureName(entitlement.feature, locale)
28224
28360
  }) : /* @__PURE__ */ jsxs49(Fragment27, { children: [
28225
28361
  typeof limit === "number" && /* @__PURE__ */ jsxs49(Fragment27, { children: [
28226
28362
  formatNumber(limit, { locale }),
28227
28363
  " "
28228
28364
  ] }),
28229
- getFeatureName(entitlement.feature, limit)
28365
+ getFeatureName(entitlement.feature, locale, limit)
28230
28366
  ] }),
28231
28367
  metricPeriodName && /* @__PURE__ */ jsxs49(Fragment27, { children: [
28232
28368
  " ",
@@ -28255,6 +28391,7 @@ var Entitlement2 = ({
28255
28391
  ] }),
28256
28392
  getFeatureName(
28257
28393
  entitlement.feature,
28394
+ locale,
28258
28395
  entitlementPackageSize
28259
28396
  ),
28260
28397
  entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs49(Fragment27, { children: [
@@ -28734,7 +28871,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
28734
28871
  $alignItems: "center",
28735
28872
  $justifyContent: "center",
28736
28873
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
28737
- children: /* @__PURE__ */ jsx67(Loader, { "aria-label": "loading", $size: "2xl" })
28874
+ children: /* @__PURE__ */ jsx67(Loader, { "aria-label": t3("Loading"), $size: "2xl" })
28738
28875
  }
28739
28876
  );
28740
28877
  }
@@ -31951,6 +32088,7 @@ var Loading = () => {
31951
32088
  };
31952
32089
  var Error2 = ({ message }) => {
31953
32090
  const { settings } = useEmbed();
32091
+ const { t: t3 } = useTranslation();
31954
32092
  return /* @__PURE__ */ jsxs53(
31955
32093
  Flex,
31956
32094
  {
@@ -31962,7 +32100,7 @@ var Error2 = ({ message }) => {
31962
32100
  $alignItems: "center",
31963
32101
  $justifyContent: "center",
31964
32102
  children: [
31965
- /* @__PURE__ */ jsx71(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx71(Text, { display: "heading1", children: "Error" }) }),
32103
+ /* @__PURE__ */ jsx71(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx71(Text, { display: "heading1", children: t3("Error") }) }),
31966
32104
  /* @__PURE__ */ jsx71(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx71(Text, { children: message }) })
31967
32105
  ]
31968
32106
  }
@@ -31970,6 +32108,7 @@ var Error2 = ({ message }) => {
31970
32108
  };
31971
32109
  var SchematicEmbed = ({ id, accessToken }) => {
31972
32110
  const theme = useContext3(yt);
32111
+ const { t: t3 } = useTranslation();
31973
32112
  const {
31974
32113
  data,
31975
32114
  error,
@@ -32040,13 +32179,15 @@ var SchematicEmbed = ({ id, accessToken }) => {
32040
32179
  return /* @__PURE__ */ jsx71(Error2, { message: error.message });
32041
32180
  }
32042
32181
  if (accessToken?.length === 0) {
32043
- return /* @__PURE__ */ jsx71(Error2, { message: "Please provide an access token." });
32182
+ return /* @__PURE__ */ jsx71(Error2, { message: t3("Please provide an access token.") });
32044
32183
  }
32045
32184
  if (!accessToken?.startsWith("token_")) {
32046
32185
  return /* @__PURE__ */ jsx71(
32047
32186
  Error2,
32048
32187
  {
32049
- message: 'Invalid access token; your temporary access token will start with "token_".'
32188
+ message: t3(
32189
+ "Invalid access token; your temporary access token will start with `token_`."
32190
+ )
32050
32191
  }
32051
32192
  );
32052
32193
  }