@schematichq/schematic-components 2.8.2 → 2.8.4

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.
@@ -2191,6 +2191,72 @@ function BillingProductPriceResponseDataFromJSONTyped(json, ignoreDiscriminator)
2191
2191
  };
2192
2192
  }
2193
2193
 
2194
+ // src/api/checkoutexternal/models/BillingProductPriceTierResponseData.ts
2195
+ function BillingProductPriceTierResponseDataFromJSON(json) {
2196
+ return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
2197
+ }
2198
+ function BillingProductPriceTierResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2199
+ if (json == null) {
2200
+ return json;
2201
+ }
2202
+ return {
2203
+ flatAmount: json["flat_amount"] == null ? void 0 : json["flat_amount"],
2204
+ perUnitPrice: json["per_unit_price"] == null ? void 0 : json["per_unit_price"],
2205
+ perUnitPriceDecimal: json["per_unit_price_decimal"] == null ? void 0 : json["per_unit_price_decimal"],
2206
+ upTo: json["up_to"] == null ? void 0 : json["up_to"]
2207
+ };
2208
+ }
2209
+
2210
+ // src/api/checkoutexternal/models/BillingPriceView.ts
2211
+ function BillingPriceViewFromJSON(json) {
2212
+ return BillingPriceViewFromJSONTyped(json, false);
2213
+ }
2214
+ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
2215
+ if (json == null) {
2216
+ return json;
2217
+ }
2218
+ return {
2219
+ billingScheme: BillingPriceSchemeFromJSON(json["billing_scheme"]),
2220
+ createdAt: new Date(json["created_at"]),
2221
+ currency: json["currency"],
2222
+ id: json["id"],
2223
+ interval: BillingProductPriceIntervalFromJSON(json["interval"]),
2224
+ isActive: json["is_active"],
2225
+ meterEventName: json["meter_event_name"] == null ? void 0 : json["meter_event_name"],
2226
+ meterEventPayloadKey: json["meter_event_payload_key"] == null ? void 0 : json["meter_event_payload_key"],
2227
+ meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
2228
+ packageSize: json["package_size"],
2229
+ price: json["price"],
2230
+ priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
2231
+ priceExternalId: json["price_external_id"],
2232
+ priceId: json["price_id"],
2233
+ priceTier: json["price_tier"].map(
2234
+ BillingProductPriceTierResponseDataFromJSON
2235
+ ),
2236
+ productExternalId: json["product_external_id"],
2237
+ productId: json["product_id"],
2238
+ productName: json["product_name"],
2239
+ providerType: BillingProviderTypeFromJSON(json["provider_type"]),
2240
+ tiersMode: json["tiers_mode"] == null ? void 0 : BillingTiersModeFromJSON(json["tiers_mode"]),
2241
+ updatedAt: new Date(json["updated_at"]),
2242
+ usageType: BillingPriceUsageTypeFromJSON(json["usage_type"])
2243
+ };
2244
+ }
2245
+
2246
+ // src/api/checkoutexternal/models/CreditBundleCurrencyPrice.ts
2247
+ function CreditBundleCurrencyPriceFromJSON(json) {
2248
+ return CreditBundleCurrencyPriceFromJSONTyped(json, false);
2249
+ }
2250
+ function CreditBundleCurrencyPriceFromJSONTyped(json, ignoreDiscriminator) {
2251
+ if (json == null) {
2252
+ return json;
2253
+ }
2254
+ return {
2255
+ currency: json["currency"],
2256
+ price: json["price"] == null ? void 0 : BillingPriceViewFromJSON(json["price"])
2257
+ };
2258
+ }
2259
+
2194
2260
  // src/api/checkoutexternal/models/BillingCreditExpiryUnit.ts
2195
2261
  function BillingCreditExpiryUnitFromJSON(json) {
2196
2262
  return BillingCreditExpiryUnitFromJSONTyped(json, false);
@@ -2214,6 +2280,9 @@ function BillingCreditBundleViewFromJSONTyped(json, ignoreDiscriminator) {
2214
2280
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
2215
2281
  creditId: json["credit_id"],
2216
2282
  creditName: json["credit_name"],
2283
+ currencyPrices: json["currency_prices"] == null ? void 0 : json["currency_prices"].map(
2284
+ CreditBundleCurrencyPriceFromJSON
2285
+ ),
2217
2286
  expiryType: BillingCreditExpiryTypeFromJSON(json["expiry_type"]),
2218
2287
  expiryUnit: BillingCreditExpiryUnitFromJSON(json["expiry_unit"]),
2219
2288
  expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
@@ -2260,6 +2329,40 @@ function BillingCreditGrantZeroedOutReasonFromJSONTyped(json, ignoreDiscriminato
2260
2329
  return json;
2261
2330
  }
2262
2331
 
2332
+ // src/api/checkoutexternal/models/BillingPriceResponseData.ts
2333
+ function BillingPriceResponseDataFromJSON(json) {
2334
+ return BillingPriceResponseDataFromJSONTyped(json, false);
2335
+ }
2336
+ function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2337
+ if (json == null) {
2338
+ return json;
2339
+ }
2340
+ return {
2341
+ currency: json["currency"],
2342
+ externalPriceId: json["external_price_id"],
2343
+ id: json["id"],
2344
+ interval: BillingProductPriceIntervalFromJSON(json["interval"]),
2345
+ price: json["price"],
2346
+ priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
2347
+ providerType: BillingProviderTypeFromJSON(json["provider_type"]),
2348
+ scheme: BillingPriceSchemeFromJSON(json["scheme"])
2349
+ };
2350
+ }
2351
+
2352
+ // src/api/checkoutexternal/models/CreditCurrencyPriceResponseData.ts
2353
+ function CreditCurrencyPriceResponseDataFromJSON(json) {
2354
+ return CreditCurrencyPriceResponseDataFromJSONTyped(json, false);
2355
+ }
2356
+ function CreditCurrencyPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2357
+ if (json == null) {
2358
+ return json;
2359
+ }
2360
+ return {
2361
+ currency: json["currency"],
2362
+ price: json["price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["price"])
2363
+ };
2364
+ }
2365
+
2263
2366
  // src/api/checkoutexternal/models/BillingProductResponseData.ts
2264
2367
  function BillingProductResponseDataFromJSON(json) {
2265
2368
  return BillingProductResponseDataFromJSONTyped(json, false);
@@ -2285,26 +2388,6 @@ function BillingProductResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2285
2388
  };
2286
2389
  }
2287
2390
 
2288
- // src/api/checkoutexternal/models/BillingPriceResponseData.ts
2289
- function BillingPriceResponseDataFromJSON(json) {
2290
- return BillingPriceResponseDataFromJSONTyped(json, false);
2291
- }
2292
- function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2293
- if (json == null) {
2294
- return json;
2295
- }
2296
- return {
2297
- currency: json["currency"],
2298
- externalPriceId: json["external_price_id"],
2299
- id: json["id"],
2300
- interval: BillingProductPriceIntervalFromJSON(json["interval"]),
2301
- price: json["price"],
2302
- priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
2303
- providerType: BillingProviderTypeFromJSON(json["provider_type"]),
2304
- scheme: BillingPriceSchemeFromJSON(json["scheme"])
2305
- };
2306
- }
2307
-
2308
2391
  // src/api/checkoutexternal/models/BillingCreditRolloverPolicy.ts
2309
2392
  function BillingCreditRolloverPolicyFromJSON(json) {
2310
2393
  return BillingCreditRolloverPolicyFromJSONTyped(json, false);
@@ -2325,6 +2408,9 @@ function BillingCreditResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2325
2408
  burnStrategy: BillingCreditBurnStrategyFromJSON(json["burn_strategy"]),
2326
2409
  costEditable: json["cost_editable"],
2327
2410
  createdAt: new Date(json["created_at"]),
2411
+ currencyPrices: json["currency_prices"].map(
2412
+ CreditCurrencyPriceResponseDataFromJSON
2413
+ ),
2328
2414
  defaultExpiryUnit: BillingCreditExpiryUnitFromJSON(
2329
2415
  json["default_expiry_unit"]
2330
2416
  ),
@@ -2344,58 +2430,6 @@ function BillingCreditResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2344
2430
  };
2345
2431
  }
2346
2432
 
2347
- // src/api/checkoutexternal/models/BillingProductPriceTierResponseData.ts
2348
- function BillingProductPriceTierResponseDataFromJSON(json) {
2349
- return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
2350
- }
2351
- function BillingProductPriceTierResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2352
- if (json == null) {
2353
- return json;
2354
- }
2355
- return {
2356
- flatAmount: json["flat_amount"] == null ? void 0 : json["flat_amount"],
2357
- perUnitPrice: json["per_unit_price"] == null ? void 0 : json["per_unit_price"],
2358
- perUnitPriceDecimal: json["per_unit_price_decimal"] == null ? void 0 : json["per_unit_price_decimal"],
2359
- upTo: json["up_to"] == null ? void 0 : json["up_to"]
2360
- };
2361
- }
2362
-
2363
- // src/api/checkoutexternal/models/BillingPriceView.ts
2364
- function BillingPriceViewFromJSON(json) {
2365
- return BillingPriceViewFromJSONTyped(json, false);
2366
- }
2367
- function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
2368
- if (json == null) {
2369
- return json;
2370
- }
2371
- return {
2372
- billingScheme: BillingPriceSchemeFromJSON(json["billing_scheme"]),
2373
- createdAt: new Date(json["created_at"]),
2374
- currency: json["currency"],
2375
- id: json["id"],
2376
- interval: BillingProductPriceIntervalFromJSON(json["interval"]),
2377
- isActive: json["is_active"],
2378
- meterEventName: json["meter_event_name"] == null ? void 0 : json["meter_event_name"],
2379
- meterEventPayloadKey: json["meter_event_payload_key"] == null ? void 0 : json["meter_event_payload_key"],
2380
- meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
2381
- packageSize: json["package_size"],
2382
- price: json["price"],
2383
- priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
2384
- priceExternalId: json["price_external_id"],
2385
- priceId: json["price_id"],
2386
- priceTier: json["price_tier"].map(
2387
- BillingProductPriceTierResponseDataFromJSON
2388
- ),
2389
- productExternalId: json["product_external_id"],
2390
- productId: json["product_id"],
2391
- productName: json["product_name"],
2392
- providerType: BillingProviderTypeFromJSON(json["provider_type"]),
2393
- tiersMode: json["tiers_mode"] == null ? void 0 : BillingTiersModeFromJSON(json["tiers_mode"]),
2394
- updatedAt: new Date(json["updated_at"]),
2395
- usageType: BillingPriceUsageTypeFromJSON(json["usage_type"])
2396
- };
2397
- }
2398
-
2399
2433
  // src/api/checkoutexternal/models/BillingCreditView.ts
2400
2434
  function BillingCreditViewFromJSON(json) {
2401
2435
  return BillingCreditViewFromJSONTyped(json, false);
@@ -3609,6 +3643,21 @@ function PlanControlledByTypeFromJSONTyped(json, ignoreDiscriminator) {
3609
3643
  return json;
3610
3644
  }
3611
3645
 
3646
+ // src/api/checkoutexternal/models/EntitlementCurrencyPricesResponseData.ts
3647
+ function EntitlementCurrencyPricesResponseDataFromJSON(json) {
3648
+ return EntitlementCurrencyPricesResponseDataFromJSONTyped(json, false);
3649
+ }
3650
+ function EntitlementCurrencyPricesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3651
+ if (json == null) {
3652
+ return json;
3653
+ }
3654
+ return {
3655
+ currency: json["currency"],
3656
+ monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_price"]),
3657
+ yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_price"])
3658
+ };
3659
+ }
3660
+
3612
3661
  // src/api/checkoutexternal/models/EntitlementPriceBehavior.ts
3613
3662
  var EntitlementPriceBehavior = {
3614
3663
  CreditBurndown: "credit_burndown",
@@ -3664,6 +3713,9 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3664
3713
  billingThreshold: json["billing_threshold"] == null ? void 0 : json["billing_threshold"],
3665
3714
  consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
3666
3715
  createdAt: new Date(json["created_at"]),
3716
+ currencyPrices: json["currency_prices"].map(
3717
+ EntitlementCurrencyPricesResponseDataFromJSON
3718
+ ),
3667
3719
  environmentId: json["environment_id"],
3668
3720
  feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON(json["feature"]),
3669
3721
  featureId: json["feature_id"],
@@ -3689,6 +3741,37 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3689
3741
  };
3690
3742
  }
3691
3743
 
3744
+ // src/api/checkoutexternal/models/CustomPlanConfig.ts
3745
+ function CustomPlanConfigFromJSON(json) {
3746
+ return CustomPlanConfigFromJSONTyped(json, false);
3747
+ }
3748
+ function CustomPlanConfigFromJSONTyped(json, ignoreDiscriminator) {
3749
+ if (json == null) {
3750
+ return json;
3751
+ }
3752
+ return {
3753
+ ctaText: json["cta_text"],
3754
+ ctaWebSite: json["cta_web_site"],
3755
+ priceText: json["price_text"]
3756
+ };
3757
+ }
3758
+
3759
+ // src/api/checkoutexternal/models/PlanCurrencyPricesResponseData.ts
3760
+ function PlanCurrencyPricesResponseDataFromJSON(json) {
3761
+ return PlanCurrencyPricesResponseDataFromJSONTyped(json, false);
3762
+ }
3763
+ function PlanCurrencyPricesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3764
+ if (json == null) {
3765
+ return json;
3766
+ }
3767
+ return {
3768
+ currency: json["currency"],
3769
+ monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["monthly_price"]),
3770
+ oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["one_time_price"]),
3771
+ yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["yearly_price"])
3772
+ };
3773
+ }
3774
+
3692
3775
  // src/api/checkoutexternal/models/PlanVersionStatus.ts
3693
3776
  function PlanVersionStatusFromJSON(json) {
3694
3777
  return PlanVersionStatusFromJSONTyped(json, false);
@@ -3720,21 +3803,6 @@ function PlanVersionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3720
3803
  };
3721
3804
  }
3722
3805
 
3723
- // src/api/checkoutexternal/models/CustomPlanConfig.ts
3724
- function CustomPlanConfigFromJSON(json) {
3725
- return CustomPlanConfigFromJSONTyped(json, false);
3726
- }
3727
- function CustomPlanConfigFromJSONTyped(json, ignoreDiscriminator) {
3728
- if (json == null) {
3729
- return json;
3730
- }
3731
- return {
3732
- ctaText: json["cta_text"],
3733
- ctaWebSite: json["cta_web_site"],
3734
- priceText: json["price_text"]
3735
- };
3736
- }
3737
-
3738
3806
  // src/api/checkoutexternal/models/CreditUsageAggregation.ts
3739
3807
  function CreditUsageAggregationFromJSON(json) {
3740
3808
  return CreditUsageAggregationFromJSONTyped(json, false);
@@ -3841,6 +3909,9 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3841
3909
  compatiblePlanIds: json["compatible_plan_ids"],
3842
3910
  controlledBy: PlanControlledByTypeFromJSON(json["controlled_by"]),
3843
3911
  createdAt: new Date(json["created_at"]),
3912
+ currencyPrices: json["currency_prices"].map(
3913
+ PlanCurrencyPricesResponseDataFromJSON
3914
+ ),
3844
3915
  current: json["current"],
3845
3916
  custom: json["custom"],
3846
3917
  customPlanConfig: json["custom_plan_config"] == null ? void 0 : CustomPlanConfigFromJSON(json["custom_plan_config"]),
@@ -3995,6 +4066,9 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
3995
4066
  companyCount: json["company_count"],
3996
4067
  controlledBy: PlanControlledByTypeFromJSON(json["controlled_by"]),
3997
4068
  createdAt: new Date(json["created_at"]),
4069
+ currencyPrices: json["currency_prices"].map(
4070
+ PlanCurrencyPricesResponseDataFromJSON
4071
+ ),
3998
4072
  description: json["description"],
3999
4073
  draftVersion: json["draft_version"] == null ? void 0 : PlanVersionResponseDataFromJSON(json["draft_version"]),
4000
4074
  features: json["features"].map(
@@ -4072,6 +4146,7 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
4072
4146
  creditDescription: json["credit_description"],
4073
4147
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
4074
4148
  creditName: json["credit_name"],
4149
+ currency: json["currency"] == null ? void 0 : json["currency"],
4075
4150
  exhaustedAt: json["exhausted_at"] == null ? void 0 : new Date(json["exhausted_at"]),
4076
4151
  expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
4077
4152
  expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON(json["expiry_type"]),
@@ -5099,14 +5174,12 @@ function buildPayInAdvanceRequestBody(entitlements, period) {
5099
5174
  []
5100
5175
  );
5101
5176
  }
5102
- function buildAddOnRequestBody(addOns, period, shouldTrial, addOnPayInAdvanceEntitlements) {
5177
+ function buildAddOnRequestBody(addOns, period, shouldTrial) {
5103
5178
  return addOns.reduce((acc, addOn) => {
5104
5179
  if (addOn.isSelected && !shouldTrial) {
5105
5180
  const addOnPrice = getAddOnPrice(addOn, period);
5106
5181
  const addOnPriceId = addOnPrice?.id;
5107
- if (addOnPriceId && (addOnPrice?.price || addOnPayInAdvanceEntitlements.some(
5108
- (e2) => e2.priceBehavior === EntitlementPriceBehavior.PayInAdvance
5109
- ))) {
5182
+ if (addOnPriceId) {
5110
5183
  acc.push({
5111
5184
  addOnId: addOn.id,
5112
5185
  priceId: addOnPriceId
@@ -7552,7 +7625,7 @@ var defer = () => {
7552
7625
  };
7553
7626
  var makeString = (object) => {
7554
7627
  if (object == null) return "";
7555
- return "" + object;
7628
+ return String(object);
7556
7629
  };
7557
7630
  var copy2 = (a2, s, t2) => {
7558
7631
  a2.forEach((m2) => {
@@ -7560,7 +7633,7 @@ var copy2 = (a2, s, t2) => {
7560
7633
  });
7561
7634
  };
7562
7635
  var lastOfPathSeparatorRegExp = /###/g;
7563
- var cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
7636
+ var cleanKey = (key) => key && key.includes("###") ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
7564
7637
  var canNotTraverseDeeper = (object) => !object || isString(object);
7565
7638
  var getLastOfPath = (object, path, Empty) => {
7566
7639
  const stack = !isString(path) ? path : path.split(".");
@@ -7684,7 +7757,7 @@ var looksLikeObjectPathRegExpCache = new RegExpCache(20);
7684
7757
  var looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
7685
7758
  nsSeparator = nsSeparator || "";
7686
7759
  keySeparator = keySeparator || "";
7687
- const possibleChars = chars.filter((c2) => nsSeparator.indexOf(c2) < 0 && keySeparator.indexOf(c2) < 0);
7760
+ const possibleChars = chars.filter((c2) => !nsSeparator.includes(c2) && !keySeparator.includes(c2));
7688
7761
  if (possibleChars.length === 0) return true;
7689
7762
  const r2 = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c2) => c2 === "?" ? "\\?" : c2).join("|")})`);
7690
7763
  let matched = !r2.test(key);
@@ -7717,7 +7790,7 @@ var deepFind = (obj, path, keySeparator = ".") => {
7717
7790
  nextPath += tokens[j2];
7718
7791
  next2 = current[nextPath];
7719
7792
  if (next2 !== void 0) {
7720
- if (["string", "number", "boolean"].indexOf(typeof next2) > -1 && j2 < tokens.length - 1) {
7793
+ if (["string", "number", "boolean"].includes(typeof next2) && j2 < tokens.length - 1) {
7721
7794
  continue;
7722
7795
  }
7723
7796
  i += j2 - i + 1;
@@ -7806,6 +7879,14 @@ var EventEmitter = class {
7806
7879
  }
7807
7880
  this.observers[event].delete(listener);
7808
7881
  }
7882
+ once(event, listener) {
7883
+ const wrapper = (...args) => {
7884
+ listener(...args);
7885
+ this.off(event, wrapper);
7886
+ };
7887
+ this.on(event, wrapper);
7888
+ return this;
7889
+ }
7809
7890
  emit(event, ...args) {
7810
7891
  if (this.observers[event]) {
7811
7892
  const cloned = Array.from(this.observers[event].entries());
@@ -7819,7 +7900,7 @@ var EventEmitter = class {
7819
7900
  const cloned = Array.from(this.observers["*"].entries());
7820
7901
  cloned.forEach(([observer, numTimesAdded]) => {
7821
7902
  for (let i = 0; i < numTimesAdded; i++) {
7822
- observer.apply(observer, [event, ...args]);
7903
+ observer(event, ...args);
7823
7904
  }
7824
7905
  });
7825
7906
  }
@@ -7841,7 +7922,7 @@ var ResourceStore = class extends EventEmitter {
7841
7922
  }
7842
7923
  }
7843
7924
  addNamespaces(ns) {
7844
- if (this.options.ns.indexOf(ns) < 0) {
7925
+ if (!this.options.ns.includes(ns)) {
7845
7926
  this.options.ns.push(ns);
7846
7927
  }
7847
7928
  }
@@ -7855,7 +7936,7 @@ var ResourceStore = class extends EventEmitter {
7855
7936
  const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
7856
7937
  const ignoreJSONStructure = options.ignoreJSONStructure !== void 0 ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
7857
7938
  let path;
7858
- if (lng.indexOf(".") > -1) {
7939
+ if (lng.includes(".")) {
7859
7940
  path = lng.split(".");
7860
7941
  } else {
7861
7942
  path = [lng, ns];
@@ -7870,7 +7951,7 @@ var ResourceStore = class extends EventEmitter {
7870
7951
  }
7871
7952
  }
7872
7953
  const result = getPath(this.data, path);
7873
- if (!result && !ns && !key && lng.indexOf(".") > -1) {
7954
+ if (!result && !ns && !key && lng.includes(".")) {
7874
7955
  lng = path[0];
7875
7956
  ns = path[1];
7876
7957
  key = path.slice(2).join(".");
@@ -7884,7 +7965,7 @@ var ResourceStore = class extends EventEmitter {
7884
7965
  const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
7885
7966
  let path = [lng, ns];
7886
7967
  if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
7887
- if (lng.indexOf(".") > -1) {
7968
+ if (lng.includes(".")) {
7888
7969
  path = lng.split(".");
7889
7970
  value = ns;
7890
7971
  ns = path[1];
@@ -7908,7 +7989,7 @@ var ResourceStore = class extends EventEmitter {
7908
7989
  skipCopy: false
7909
7990
  }) {
7910
7991
  let path = [lng, ns];
7911
- if (lng.indexOf(".") > -1) {
7992
+ if (lng.includes(".")) {
7912
7993
  path = lng.split(".");
7913
7994
  deep = resources;
7914
7995
  resources = ns;
@@ -7995,7 +8076,6 @@ function keysFromSelector(selector, opts) {
7995
8076
  }
7996
8077
  return path.join(keySeparator);
7997
8078
  }
7998
- var checkedLoadedFor = {};
7999
8079
  var shouldHandleAsObject = (res) => !isString(res) && typeof res !== "boolean" && typeof res !== "number";
8000
8080
  var Translator = class _Translator extends EventEmitter {
8001
8081
  constructor(services, options = {}) {
@@ -8006,6 +8086,7 @@ var Translator = class _Translator extends EventEmitter {
8006
8086
  this.options.keySeparator = ".";
8007
8087
  }
8008
8088
  this.logger = baseLogger.create("translator");
8089
+ this.checkedLoadedFor = {};
8009
8090
  }
8010
8091
  changeLanguage(lng) {
8011
8092
  if (lng) this.language = lng;
@@ -8030,7 +8111,7 @@ var Translator = class _Translator extends EventEmitter {
8030
8111
  if (nsSeparator === void 0) nsSeparator = ":";
8031
8112
  const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator;
8032
8113
  let namespaces = opt.ns || this.options.defaultNS || [];
8033
- const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
8114
+ const wouldCheckForNsInKey = nsSeparator && key.includes(nsSeparator);
8034
8115
  const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
8035
8116
  if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
8036
8117
  const m2 = key.match(this.interpolator.nestingRegexp);
@@ -8041,7 +8122,7 @@ var Translator = class _Translator extends EventEmitter {
8041
8122
  };
8042
8123
  }
8043
8124
  const parts = key.split(nsSeparator);
8044
- if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
8125
+ if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.includes(parts[0])) namespaces = parts.shift();
8045
8126
  key = parts.join(keySeparator);
8046
8127
  }
8047
8128
  return {
@@ -8128,7 +8209,7 @@ var Translator = class _Translator extends EventEmitter {
8128
8209
  }
8129
8210
  const handleAsObject = shouldHandleAsObject(resForObjHndl);
8130
8211
  const resType = Object.prototype.toString.apply(resForObjHndl);
8131
- if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
8212
+ if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && !noObject.includes(resType) && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
8132
8213
  if (!opt.returnObjects && !this.options.returnObjects) {
8133
8214
  if (!this.options.returnedObjectHandler) {
8134
8215
  this.logger.warn("accessing an object - but returnObjects options is not enabled!");
@@ -8224,7 +8305,7 @@ var Translator = class _Translator extends EventEmitter {
8224
8305
  if (this.options.saveMissingPlurals && needsPluralHandling) {
8225
8306
  lngs.forEach((language) => {
8226
8307
  const suffixes = this.pluralResolver.getSuffixes(language, opt);
8227
- if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
8308
+ if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && !suffixes.includes(`${this.options.pluralSeparator}zero`)) {
8228
8309
  suffixes.push(`${this.options.pluralSeparator}zero`);
8229
8310
  }
8230
8311
  suffixes.forEach((suffix) => {
@@ -8334,8 +8415,8 @@ var Translator = class _Translator extends EventEmitter {
8334
8415
  namespaces.forEach((ns) => {
8335
8416
  if (this.isValidLookup(found)) return;
8336
8417
  usedNS = ns;
8337
- if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
8338
- checkedLoadedFor[`${codes[0]}-${ns}`] = true;
8418
+ if (!this.checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
8419
+ this.checkedLoadedFor[`${codes[0]}-${ns}`] = true;
8339
8420
  this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
8340
8421
  }
8341
8422
  codes.forEach((code) => {
@@ -8350,7 +8431,7 @@ var Translator = class _Translator extends EventEmitter {
8350
8431
  const zeroSuffix = `${this.options.pluralSeparator}zero`;
8351
8432
  const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
8352
8433
  if (needsPluralHandling) {
8353
- if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
8434
+ if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) {
8354
8435
  finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
8355
8436
  }
8356
8437
  finalKeys.push(key + pluralSuffix);
@@ -8362,7 +8443,7 @@ var Translator = class _Translator extends EventEmitter {
8362
8443
  const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`;
8363
8444
  finalKeys.push(contextKey);
8364
8445
  if (needsPluralHandling) {
8365
- if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
8446
+ if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) {
8366
8447
  finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
8367
8448
  }
8368
8449
  finalKeys.push(contextKey + pluralSuffix);
@@ -8423,7 +8504,7 @@ var Translator = class _Translator extends EventEmitter {
8423
8504
  static hasDefaultValue(options) {
8424
8505
  const prefix2 = "defaultValue";
8425
8506
  for (const option in options) {
8426
- if (Object.prototype.hasOwnProperty.call(options, option) && prefix2 === option.substring(0, prefix2.length) && void 0 !== options[option]) {
8507
+ if (Object.prototype.hasOwnProperty.call(options, option) && option.startsWith(prefix2) && void 0 !== options[option]) {
8427
8508
  return true;
8428
8509
  }
8429
8510
  }
@@ -8438,7 +8519,7 @@ var LanguageUtil = class {
8438
8519
  }
8439
8520
  getScriptPartFromCode(code) {
8440
8521
  code = getCleanedCode(code);
8441
- if (!code || code.indexOf("-") < 0) return null;
8522
+ if (!code || !code.includes("-")) return null;
8442
8523
  const p2 = code.split("-");
8443
8524
  if (p2.length === 2) return null;
8444
8525
  p2.pop();
@@ -8447,12 +8528,12 @@ var LanguageUtil = class {
8447
8528
  }
8448
8529
  getLanguagePartFromCode(code) {
8449
8530
  code = getCleanedCode(code);
8450
- if (!code || code.indexOf("-") < 0) return code;
8531
+ if (!code || !code.includes("-")) return code;
8451
8532
  const p2 = code.split("-");
8452
8533
  return this.formatLanguageCode(p2[0]);
8453
8534
  }
8454
8535
  formatLanguageCode(code) {
8455
- if (isString(code) && code.indexOf("-") > -1) {
8536
+ if (isString(code) && code.includes("-")) {
8456
8537
  let formattedCode;
8457
8538
  try {
8458
8539
  formattedCode = Intl.getCanonicalLocales(code)[0];
@@ -8473,7 +8554,7 @@ var LanguageUtil = class {
8473
8554
  if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) {
8474
8555
  code = this.getLanguagePartFromCode(code);
8475
8556
  }
8476
- return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
8557
+ return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(code);
8477
8558
  }
8478
8559
  getBestMatchFromCodes(codes) {
8479
8560
  if (!codes) return null;
@@ -8491,10 +8572,11 @@ var LanguageUtil = class {
8491
8572
  const lngOnly = this.getLanguagePartFromCode(code);
8492
8573
  if (this.isSupportedCode(lngOnly)) return found = lngOnly;
8493
8574
  found = this.options.supportedLngs.find((supportedLng) => {
8494
- if (supportedLng === lngOnly) return supportedLng;
8495
- if (supportedLng.indexOf("-") < 0 && lngOnly.indexOf("-") < 0) return;
8496
- if (supportedLng.indexOf("-") > 0 && lngOnly.indexOf("-") < 0 && supportedLng.substring(0, supportedLng.indexOf("-")) === lngOnly) return supportedLng;
8497
- if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
8575
+ if (supportedLng === lngOnly) return true;
8576
+ if (!supportedLng.includes("-") && !lngOnly.includes("-")) return false;
8577
+ if (supportedLng.includes("-") && !lngOnly.includes("-") && supportedLng.slice(0, supportedLng.indexOf("-")) === lngOnly) return true;
8578
+ if (supportedLng.startsWith(lngOnly) && lngOnly.length > 1) return true;
8579
+ return false;
8498
8580
  });
8499
8581
  });
8500
8582
  }
@@ -8525,7 +8607,7 @@ var LanguageUtil = class {
8525
8607
  this.logger.warn(`rejecting language code not found in supportedLngs: ${c2}`);
8526
8608
  }
8527
8609
  };
8528
- if (isString(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) {
8610
+ if (isString(code) && (code.includes("-") || code.includes("_"))) {
8529
8611
  if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code));
8530
8612
  if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code));
8531
8613
  if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code));
@@ -8533,7 +8615,7 @@ var LanguageUtil = class {
8533
8615
  addCode(this.formatLanguageCode(code));
8534
8616
  }
8535
8617
  fallbackCodes.forEach((fc) => {
8536
- if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
8618
+ if (!codes.includes(fc)) addCode(this.formatLanguageCode(fc));
8537
8619
  });
8538
8620
  return codes;
8539
8621
  }
@@ -8687,7 +8769,7 @@ var Interpolator = class {
8687
8769
  let replaces;
8688
8770
  const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
8689
8771
  const handleFormat = (key) => {
8690
- if (key.indexOf(this.formatSeparator) < 0) {
8772
+ if (!key.includes(this.formatSeparator)) {
8691
8773
  const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
8692
8774
  return this.alwaysFormat ? this.format(path, void 0, lng, {
8693
8775
  ...options,
@@ -8757,7 +8839,7 @@ var Interpolator = class {
8757
8839
  let clonedOptions;
8758
8840
  const handleHasOptions = (key, inheritedOptions) => {
8759
8841
  const sep = this.nestingOptionsSeparator;
8760
- if (key.indexOf(sep) < 0) return key;
8842
+ if (!key.includes(sep)) return key;
8761
8843
  const c2 = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`));
8762
8844
  let optionsString = `{${c2[1]}`;
8763
8845
  key = c2[0];
@@ -8777,7 +8859,7 @@ var Interpolator = class {
8777
8859
  this.logger.warn(`failed parsing options string in nesting for key ${key}`, e2);
8778
8860
  return `${key}${sep}${optionsString}`;
8779
8861
  }
8780
- if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
8862
+ if (clonedOptions.defaultValue && clonedOptions.defaultValue.includes(this.prefix)) delete clonedOptions.defaultValue;
8781
8863
  return key;
8782
8864
  };
8783
8865
  while (match2 = this.nestingRegexp.exec(str)) {
@@ -8815,13 +8897,13 @@ var Interpolator = class {
8815
8897
  var parseFormatStr = (formatStr) => {
8816
8898
  let formatName = formatStr.toLowerCase().trim();
8817
8899
  const formatOptions = {};
8818
- if (formatStr.indexOf("(") > -1) {
8900
+ if (formatStr.includes("(")) {
8819
8901
  const p2 = formatStr.split("(");
8820
8902
  formatName = p2[0].toLowerCase().trim();
8821
- const optStr = p2[1].substring(0, p2[1].length - 1);
8822
- if (formatName === "currency" && optStr.indexOf(":") < 0) {
8903
+ const optStr = p2[1].slice(0, -1);
8904
+ if (formatName === "currency" && !optStr.includes(":")) {
8823
8905
  if (!formatOptions.currency) formatOptions.currency = optStr.trim();
8824
- } else if (formatName === "relativetime" && optStr.indexOf(":") < 0) {
8906
+ } else if (formatName === "relativetime" && !optStr.includes(":")) {
8825
8907
  if (!formatOptions.range) formatOptions.range = optStr.trim();
8826
8908
  } else {
8827
8909
  const opts = optStr.split(";");
@@ -8915,9 +8997,11 @@ var Formatter = class {
8915
8997
  this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
8916
8998
  }
8917
8999
  format(value, format, lng, options = {}) {
9000
+ if (!format) return value;
9001
+ if (value == null) return value;
8918
9002
  const formats = format.split(this.formatSeparator);
8919
- if (formats.length > 1 && formats[0].indexOf("(") > 1 && formats[0].indexOf(")") < 0 && formats.find((f2) => f2.indexOf(")") > -1)) {
8920
- const lastIndex = formats.findIndex((f2) => f2.indexOf(")") > -1);
9003
+ if (formats.length > 1 && formats[0].indexOf("(") > 1 && !formats[0].includes(")") && formats.find((f2) => f2.includes(")"))) {
9004
+ const lastIndex = formats.findIndex((f2) => f2.includes(")"));
8921
9005
  formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
8922
9006
  }
8923
9007
  const result = formats.reduce((mem, f2) => {
@@ -9071,7 +9155,7 @@ var Connector = class extends EventEmitter {
9071
9155
  }
9072
9156
  if (err2 && data && tried < this.maxRetries) {
9073
9157
  setTimeout(() => {
9074
- this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
9158
+ this.read(lng, ns, fcName, tried + 1, wait * 2, callback);
9075
9159
  }, wait);
9076
9160
  return;
9077
9161
  }
@@ -9175,7 +9259,6 @@ var get = () => ({
9175
9259
  nonExplicitSupportedLngs: false,
9176
9260
  load: "all",
9177
9261
  preload: false,
9178
- simplifyPluralSuffix: true,
9179
9262
  keySeparator: ".",
9180
9263
  nsSeparator: ":",
9181
9264
  pluralSeparator: "_",
@@ -9212,7 +9295,6 @@ var get = () => ({
9212
9295
  },
9213
9296
  interpolation: {
9214
9297
  escapeValue: true,
9215
- format: (value) => value,
9216
9298
  prefix: "{{",
9217
9299
  suffix: "}}",
9218
9300
  formatSeparator: ",",
@@ -9229,10 +9311,9 @@ var transformOptions = (options) => {
9229
9311
  if (isString(options.ns)) options.ns = [options.ns];
9230
9312
  if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
9231
9313
  if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
9232
- if (options.supportedLngs?.indexOf?.("cimode") < 0) {
9314
+ if (options.supportedLngs && !options.supportedLngs.includes("cimode")) {
9233
9315
  options.supportedLngs = options.supportedLngs.concat(["cimode"]);
9234
9316
  }
9235
- if (typeof options.initImmediate === "boolean") options.initAsync = options.initImmediate;
9236
9317
  return options;
9237
9318
  };
9238
9319
  var noop = () => {
@@ -9245,27 +9326,6 @@ var bindMemberFunctions = (inst) => {
9245
9326
  }
9246
9327
  });
9247
9328
  };
9248
- var SUPPORT_NOTICE_KEY = "__i18next_supportNoticeShown";
9249
- var getSupportNoticeShown = () => {
9250
- if (typeof globalThis !== "undefined" && !!globalThis[SUPPORT_NOTICE_KEY]) return true;
9251
- if (typeof process !== "undefined" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE) return true;
9252
- return false;
9253
- };
9254
- var setSupportNoticeShown = () => {
9255
- if (typeof globalThis !== "undefined") globalThis[SUPPORT_NOTICE_KEY] = true;
9256
- };
9257
- var usesLocize = (inst) => {
9258
- if (inst?.modules?.backend?.name?.indexOf("Locize") > 0) return true;
9259
- if (inst?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0) return true;
9260
- if (inst?.options?.backend?.backends) {
9261
- if (inst.options.backend.backends.some((b2) => b2?.name?.indexOf("Locize") > 0 || b2?.constructor?.name?.indexOf("Locize") > 0)) return true;
9262
- }
9263
- if (inst?.options?.backend?.projectId) return true;
9264
- if (inst?.options?.backend?.backendOptions) {
9265
- if (inst.options.backend.backendOptions.some((b2) => b2?.projectId)) return true;
9266
- }
9267
- return false;
9268
- };
9269
9329
  var I18n = class _I18n extends EventEmitter {
9270
9330
  constructor(options = {}, callback) {
9271
9331
  super();
@@ -9295,7 +9355,7 @@ var I18n = class _I18n extends EventEmitter {
9295
9355
  if (options.defaultNS == null && options.ns) {
9296
9356
  if (isString(options.ns)) {
9297
9357
  options.defaultNS = options.ns;
9298
- } else if (options.ns.indexOf("translation") < 0) {
9358
+ } else if (!options.ns.includes("translation")) {
9299
9359
  options.defaultNS = options.ns[0];
9300
9360
  }
9301
9361
  }
@@ -9318,10 +9378,6 @@ var I18n = class _I18n extends EventEmitter {
9318
9378
  if (typeof this.options.overloadTranslationOptionHandler !== "function") {
9319
9379
  this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
9320
9380
  }
9321
- if (this.options.showSupportNotice !== false && !usesLocize(this) && !getSupportNoticeShown()) {
9322
- if (typeof console !== "undefined" && typeof console.info !== "undefined") console.info("\u{1F310} i18next is made possible by our own product, Locize \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}");
9323
- setSupportNoticeShown();
9324
- }
9325
9381
  const createClassOnDemand = (ClassOrObject) => {
9326
9382
  if (!ClassOrObject) return null;
9327
9383
  if (typeof ClassOrObject === "function") return new ClassOrObject();
@@ -9346,14 +9402,9 @@ var I18n = class _I18n extends EventEmitter {
9346
9402
  s.resourceStore = this.store;
9347
9403
  s.languageUtils = lu;
9348
9404
  s.pluralResolver = new PluralResolver(lu, {
9349
- prepend: this.options.pluralSeparator,
9350
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
9405
+ prepend: this.options.pluralSeparator
9351
9406
  });
9352
- const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
9353
- if (usingLegacyFormatFunction) {
9354
- this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
9355
- }
9356
- if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
9407
+ if (formatter) {
9357
9408
  s.formatter = createClassOnDemand(formatter);
9358
9409
  if (s.formatter.init) s.formatter.init(s, this.options);
9359
9410
  this.options.interpolation.format = s.formatter.format.bind(s.formatter);
@@ -9436,7 +9487,7 @@ var I18n = class _I18n extends EventEmitter {
9436
9487
  const lngs = this.services.languageUtils.toResolveHierarchy(lng);
9437
9488
  lngs.forEach((l2) => {
9438
9489
  if (l2 === "cimode") return;
9439
- if (toLoad.indexOf(l2) < 0) toLoad.push(l2);
9490
+ if (!toLoad.includes(l2)) toLoad.push(l2);
9440
9491
  });
9441
9492
  };
9442
9493
  if (!usedLng) {
@@ -9501,16 +9552,16 @@ var I18n = class _I18n extends EventEmitter {
9501
9552
  }
9502
9553
  setResolvedLanguage(l2) {
9503
9554
  if (!l2 || !this.languages) return;
9504
- if (["cimode", "dev"].indexOf(l2) > -1) return;
9555
+ if (["cimode", "dev"].includes(l2)) return;
9505
9556
  for (let li = 0; li < this.languages.length; li++) {
9506
9557
  const lngInLngs = this.languages[li];
9507
- if (["cimode", "dev"].indexOf(lngInLngs) > -1) continue;
9558
+ if (["cimode", "dev"].includes(lngInLngs)) continue;
9508
9559
  if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
9509
9560
  this.resolvedLanguage = lngInLngs;
9510
9561
  break;
9511
9562
  }
9512
9563
  }
9513
- if (!this.resolvedLanguage && this.languages.indexOf(l2) < 0 && this.store.hasLanguageSomeTranslations(l2)) {
9564
+ if (!this.resolvedLanguage && !this.languages.includes(l2) && this.store.hasLanguageSomeTranslations(l2)) {
9514
9565
  this.resolvedLanguage = l2;
9515
9566
  this.languages.unshift(l2);
9516
9567
  }
@@ -9652,7 +9703,7 @@ var I18n = class _I18n extends EventEmitter {
9652
9703
  }
9653
9704
  if (isString(ns)) ns = [ns];
9654
9705
  ns.forEach((n) => {
9655
- if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
9706
+ if (!this.options.ns.includes(n)) this.options.ns.push(n);
9656
9707
  });
9657
9708
  this.loadResources((err2) => {
9658
9709
  deferred.resolve();
@@ -9664,7 +9715,7 @@ var I18n = class _I18n extends EventEmitter {
9664
9715
  const deferred = defer();
9665
9716
  if (isString(lngs)) lngs = [lngs];
9666
9717
  const preloaded = this.options.preload || [];
9667
- const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
9718
+ const newLngs = lngs.filter((lng) => !preloaded.includes(lng) && this.services.languageUtils.isSupportedCode(lng));
9668
9719
  if (!newLngs.length) {
9669
9720
  if (callback) callback();
9670
9721
  return Promise.resolve();
@@ -9690,7 +9741,7 @@ var I18n = class _I18n extends EventEmitter {
9690
9741
  const rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"];
9691
9742
  const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
9692
9743
  if (lng.toLowerCase().indexOf("-latn") > 1) return "ltr";
9693
- return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
9744
+ return rtlLngs.includes(languageUtils.getLanguagePartFromCode(lng)) || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
9694
9745
  }
9695
9746
  static createInstance(options = {}, callback) {
9696
9747
  const instance2 = new _I18n(options, callback);
@@ -11223,39 +11274,6 @@ function BillingCreditExpiryUnitFromJSONTyped8(json, ignoreDiscriminator) {
11223
11274
  return json;
11224
11275
  }
11225
11276
 
11226
- // src/api/componentspublic/models/BillingProviderType.ts
11227
- function BillingProviderTypeFromJSON2(json) {
11228
- return BillingProviderTypeFromJSONTyped13(json, false);
11229
- }
11230
- function BillingProviderTypeFromJSONTyped13(json, ignoreDiscriminator) {
11231
- return json;
11232
- }
11233
-
11234
- // src/api/componentspublic/models/BillingProductResponseData.ts
11235
- function BillingProductResponseDataFromJSON2(json) {
11236
- return BillingProductResponseDataFromJSONTyped5(json, false);
11237
- }
11238
- function BillingProductResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11239
- if (json == null) {
11240
- return json;
11241
- }
11242
- return {
11243
- accountId: json["account_id"],
11244
- createdAt: new Date(json["created_at"]),
11245
- currency: json["currency"] == null ? void 0 : json["currency"],
11246
- environmentId: json["environment_id"],
11247
- externalId: json["external_id"],
11248
- isActive: json["is_active"],
11249
- name: json["name"],
11250
- price: json["price"],
11251
- priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
11252
- productId: json["product_id"],
11253
- providerType: BillingProviderTypeFromJSON2(json["provider_type"]),
11254
- quantity: json["quantity"],
11255
- updatedAt: new Date(json["updated_at"])
11256
- };
11257
- }
11258
-
11259
11277
  // src/api/componentspublic/models/BillingProductPriceInterval.ts
11260
11278
  function BillingProductPriceIntervalFromJSON2(json) {
11261
11279
  return BillingProductPriceIntervalFromJSONTyped5(json, false);
@@ -11264,6 +11282,14 @@ function BillingProductPriceIntervalFromJSONTyped5(json, ignoreDiscriminator) {
11264
11282
  return json;
11265
11283
  }
11266
11284
 
11285
+ // src/api/componentspublic/models/BillingProviderType.ts
11286
+ function BillingProviderTypeFromJSON2(json) {
11287
+ return BillingProviderTypeFromJSONTyped13(json, false);
11288
+ }
11289
+ function BillingProviderTypeFromJSONTyped13(json, ignoreDiscriminator) {
11290
+ return json;
11291
+ }
11292
+
11267
11293
  // src/api/componentspublic/models/BillingPriceScheme.ts
11268
11294
  function BillingPriceSchemeFromJSON2(json) {
11269
11295
  return BillingPriceSchemeFromJSONTyped6(json, false);
@@ -11274,9 +11300,9 @@ function BillingPriceSchemeFromJSONTyped6(json, ignoreDiscriminator) {
11274
11300
 
11275
11301
  // src/api/componentspublic/models/BillingPriceResponseData.ts
11276
11302
  function BillingPriceResponseDataFromJSON2(json) {
11277
- return BillingPriceResponseDataFromJSONTyped7(json, false);
11303
+ return BillingPriceResponseDataFromJSONTyped9(json, false);
11278
11304
  }
11279
- function BillingPriceResponseDataFromJSONTyped7(json, ignoreDiscriminator) {
11305
+ function BillingPriceResponseDataFromJSONTyped9(json, ignoreDiscriminator) {
11280
11306
  if (json == null) {
11281
11307
  return json;
11282
11308
  }
@@ -11292,6 +11318,45 @@ function BillingPriceResponseDataFromJSONTyped7(json, ignoreDiscriminator) {
11292
11318
  };
11293
11319
  }
11294
11320
 
11321
+ // src/api/componentspublic/models/CreditCurrencyPriceResponseData.ts
11322
+ function CreditCurrencyPriceResponseDataFromJSON2(json) {
11323
+ return CreditCurrencyPriceResponseDataFromJSONTyped3(json, false);
11324
+ }
11325
+ function CreditCurrencyPriceResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
11326
+ if (json == null) {
11327
+ return json;
11328
+ }
11329
+ return {
11330
+ currency: json["currency"],
11331
+ price: json["price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["price"])
11332
+ };
11333
+ }
11334
+
11335
+ // src/api/componentspublic/models/BillingProductResponseData.ts
11336
+ function BillingProductResponseDataFromJSON2(json) {
11337
+ return BillingProductResponseDataFromJSONTyped5(json, false);
11338
+ }
11339
+ function BillingProductResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11340
+ if (json == null) {
11341
+ return json;
11342
+ }
11343
+ return {
11344
+ accountId: json["account_id"],
11345
+ createdAt: new Date(json["created_at"]),
11346
+ currency: json["currency"] == null ? void 0 : json["currency"],
11347
+ environmentId: json["environment_id"],
11348
+ externalId: json["external_id"],
11349
+ isActive: json["is_active"],
11350
+ name: json["name"],
11351
+ price: json["price"],
11352
+ priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
11353
+ productId: json["product_id"],
11354
+ providerType: BillingProviderTypeFromJSON2(json["provider_type"]),
11355
+ quantity: json["quantity"],
11356
+ updatedAt: new Date(json["updated_at"])
11357
+ };
11358
+ }
11359
+
11295
11360
  // src/api/componentspublic/models/BillingCreditRolloverPolicy.ts
11296
11361
  function BillingCreditRolloverPolicyFromJSON2(json) {
11297
11362
  return BillingCreditRolloverPolicyFromJSONTyped4(json, false);
@@ -11312,6 +11377,9 @@ function BillingCreditResponseDataFromJSONTyped4(json, ignoreDiscriminator) {
11312
11377
  burnStrategy: BillingCreditBurnStrategyFromJSON2(json["burn_strategy"]),
11313
11378
  costEditable: json["cost_editable"],
11314
11379
  createdAt: new Date(json["created_at"]),
11380
+ currencyPrices: json["currency_prices"].map(
11381
+ CreditCurrencyPriceResponseDataFromJSON2
11382
+ ),
11315
11383
  defaultExpiryUnit: BillingCreditExpiryUnitFromJSON2(
11316
11384
  json["default_expiry_unit"]
11317
11385
  ),
@@ -11365,9 +11433,9 @@ function BillingTiersModeFromJSONTyped4(json, ignoreDiscriminator) {
11365
11433
 
11366
11434
  // src/api/componentspublic/models/BillingPriceView.ts
11367
11435
  function BillingPriceViewFromJSON2(json) {
11368
- return BillingPriceViewFromJSONTyped6(json, false);
11436
+ return BillingPriceViewFromJSONTyped8(json, false);
11369
11437
  }
11370
- function BillingPriceViewFromJSONTyped6(json, ignoreDiscriminator) {
11438
+ function BillingPriceViewFromJSONTyped8(json, ignoreDiscriminator) {
11371
11439
  if (json == null) {
11372
11440
  return json;
11373
11441
  }
@@ -11580,6 +11648,21 @@ function CustomPlanConfigFromJSONTyped3(json, ignoreDiscriminator) {
11580
11648
  };
11581
11649
  }
11582
11650
 
11651
+ // src/api/componentspublic/models/EntitlementCurrencyPricesResponseData.ts
11652
+ function EntitlementCurrencyPricesResponseDataFromJSON2(json) {
11653
+ return EntitlementCurrencyPricesResponseDataFromJSONTyped3(json, false);
11654
+ }
11655
+ function EntitlementCurrencyPricesResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
11656
+ if (json == null) {
11657
+ return json;
11658
+ }
11659
+ return {
11660
+ currency: json["currency"],
11661
+ monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceViewFromJSON2(json["monthly_price"]),
11662
+ yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceViewFromJSON2(json["yearly_price"])
11663
+ };
11664
+ }
11665
+
11583
11666
  // src/api/componentspublic/models/EntitlementPriceBehavior.ts
11584
11667
  function EntitlementPriceBehaviorFromJSON2(json) {
11585
11668
  return EntitlementPriceBehaviorFromJSONTyped5(json, false);
@@ -11910,6 +11993,22 @@ function PlanCreditGrantViewFromJSONTyped4(json, ignoreDiscriminator) {
11910
11993
  };
11911
11994
  }
11912
11995
 
11996
+ // src/api/componentspublic/models/PlanCurrencyPricesResponseData.ts
11997
+ function PlanCurrencyPricesResponseDataFromJSON2(json) {
11998
+ return PlanCurrencyPricesResponseDataFromJSONTyped5(json, false);
11999
+ }
12000
+ function PlanCurrencyPricesResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
12001
+ if (json == null) {
12002
+ return json;
12003
+ }
12004
+ return {
12005
+ currency: json["currency"],
12006
+ monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["monthly_price"]),
12007
+ oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["one_time_price"]),
12008
+ yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["yearly_price"])
12009
+ };
12010
+ }
12011
+
11913
12012
  // src/api/componentspublic/models/PlanType.ts
11914
12013
  function PlanTypeFromJSON2(json) {
11915
12014
  return PlanTypeFromJSONTyped7(json, false);
@@ -11950,6 +12049,9 @@ function PlanEntitlementResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11950
12049
  billingThreshold: json["billing_threshold"] == null ? void 0 : json["billing_threshold"],
11951
12050
  consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
11952
12051
  createdAt: new Date(json["created_at"]),
12052
+ currencyPrices: json["currency_prices"].map(
12053
+ EntitlementCurrencyPricesResponseDataFromJSON2
12054
+ ),
11953
12055
  environmentId: json["environment_id"],
11954
12056
  feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON2(json["feature"]),
11955
12057
  featureId: json["feature_id"],
@@ -12023,6 +12125,9 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
12023
12125
  compatiblePlanIds: json["compatible_plan_ids"],
12024
12126
  controlledBy: PlanControlledByTypeFromJSON2(json["controlled_by"]),
12025
12127
  createdAt: new Date(json["created_at"]),
12128
+ currencyPrices: json["currency_prices"].map(
12129
+ PlanCurrencyPricesResponseDataFromJSON2
12130
+ ),
12026
12131
  custom: json["custom"],
12027
12132
  customPlanConfig: json["custom_plan_config"] == null ? void 0 : CustomPlanConfigFromJSON2(json["custom_plan_config"]),
12028
12133
  description: json["description"],
@@ -12334,7 +12439,7 @@ var reducer = (state, action) => {
12334
12439
  // src/context/EmbedProvider.tsx
12335
12440
  import { jsx, jsxs } from "react/jsx-runtime";
12336
12441
  var getCustomHeaders = (sessionId) => ({
12337
- "X-Schematic-Components-Version": "2.8.2",
12442
+ "X-Schematic-Components-Version": "2.8.4",
12338
12443
  "X-Schematic-Session-ID": sessionId
12339
12444
  });
12340
12445
  var EmbedProvider = ({
@@ -12722,6 +12827,7 @@ var EmbedProvider = ({
12722
12827
  value: {
12723
12828
  isPending: state.isPending,
12724
12829
  stale: state.stale,
12830
+ accessToken: state.accessToken,
12725
12831
  data: state.data,
12726
12832
  error: state.error,
12727
12833
  settings: state.settings,
@@ -15677,9 +15783,7 @@ var CheckoutDialog = ({ top }) => {
15677
15783
  (available) => available.id === addOnId
15678
15784
  );
15679
15785
  if (!availableAddOn) return [];
15680
- return availableAddOn.entitlements.filter(
15681
- (entitlement) => entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance
15682
- ).map((entitlement) => ({
15786
+ return availableAddOn.entitlements.filter((entitlement) => !!entitlement.priceBehavior).map((entitlement) => ({
15683
15787
  ...entitlement,
15684
15788
  allocation: entitlement.valueNumeric || 0,
15685
15789
  usage: 0,
@@ -15874,8 +15978,7 @@ var CheckoutDialog = ({ top }) => {
15874
15978
  const addOnRequestBody = buildAddOnRequestBody(
15875
15979
  resolvedAddOns,
15876
15980
  period,
15877
- shouldTrial,
15878
- resolvedAddOnPayInAdvanceEntitlements
15981
+ shouldTrial
15879
15982
  );
15880
15983
  const creditBundlesRequestBody = buildCreditBundlesRequestBody(
15881
15984
  resolvedCreditBundles
@@ -17648,18 +17751,18 @@ var SubscriptionSidebar = forwardRef7(
17648
17751
  usageBasedEntitlements,
17649
17752
  addOnUsageBasedEntitlements
17650
17753
  ]);
17651
- const selectedAddOnsWithCost = useMemo13(
17754
+ const selectedAddOnsWithPrice = useMemo13(
17652
17755
  () => addOns.filter(
17653
- (addOn) => addOn.isSelected && getPlanPrice(addOn)?.price
17756
+ (addOn) => addOn.isSelected && typeof getPlanPrice(addOn)?.price === "number"
17654
17757
  ),
17655
17758
  [addOns]
17656
17759
  );
17657
17760
  const { removedAddOns, willAddOnsChange } = useMemo13(() => {
17658
- const addedAddOns = selectedAddOnsWithCost.filter(
17659
- (selected) => getPlanPrice(selected)?.price && !currentAddOns.some((current) => selected.id === current.id)
17761
+ const addedAddOns = selectedAddOnsWithPrice.filter(
17762
+ (selected) => !currentAddOns.some((current) => selected.id === current.id)
17660
17763
  );
17661
17764
  const removedAddOns2 = currentAddOns.filter(
17662
- (current) => current.planPrice && current.planPeriod !== "one-time" && !selectedAddOnsWithCost.some(
17765
+ (current) => current.planPrice && current.planPeriod !== "one-time" && !selectedAddOnsWithPrice.some(
17663
17766
  (selected) => current.id === selected.id
17664
17767
  )
17665
17768
  );
@@ -17669,7 +17772,7 @@ var SubscriptionSidebar = forwardRef7(
17669
17772
  removedAddOns: removedAddOns2,
17670
17773
  willAddOnsChange: willAddOnsChange2
17671
17774
  };
17672
- }, [currentAddOns, selectedAddOnsWithCost]);
17775
+ }, [currentAddOns, selectedAddOnsWithPrice]);
17673
17776
  const addedCreditBundles = useMemo13(
17674
17777
  () => creditBundles.filter((bundle) => bundle.count > 0),
17675
17778
  [creditBundles]
@@ -17698,8 +17801,7 @@ var SubscriptionSidebar = forwardRef7(
17698
17801
  const addOnRequestBody = buildAddOnRequestBody(
17699
17802
  addOns,
17700
17803
  planPeriod,
17701
- shouldTrial,
17702
- addOnPayInAdvanceEntitlements
17804
+ shouldTrial
17703
17805
  );
17704
17806
  const creditBundlesRequestBody = buildCreditBundlesRequestBody(creditBundles);
17705
17807
  const checkoutResponseFromBackend = await checkout({
@@ -18113,7 +18215,7 @@ var SubscriptionSidebar = forwardRef7(
18113
18215
  }
18114
18216
  )
18115
18217
  ] }),
18116
- (willAddOnsChange || selectedAddOnsWithCost.length > 0) && /* @__PURE__ */ jsxs23(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
18218
+ (willAddOnsChange || selectedAddOnsWithPrice.length > 0) && /* @__PURE__ */ jsxs23(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
18117
18219
  /* @__PURE__ */ jsx32(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx32(Text, { $size: 14, children: t2("Add-ons") }) }),
18118
18220
  removedAddOns.map((addOn, index) => {
18119
18221
  return /* @__PURE__ */ jsxs23(
@@ -18142,7 +18244,7 @@ var SubscriptionSidebar = forwardRef7(
18142
18244
  index
18143
18245
  );
18144
18246
  }),
18145
- selectedAddOnsWithCost.map((addOn, index) => {
18247
+ selectedAddOnsWithPrice.map((addOn, index) => {
18146
18248
  const { price: addOnPrice, currency: addOnCurrency } = getAddOnPrice(addOn, planPeriod) || {};
18147
18249
  return /* @__PURE__ */ jsxs23(
18148
18250
  Flex,