@wix/cli-app 1.1.58 → 1.1.60

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.
Files changed (97) hide show
  1. package/build/{CreateVersionCommand-NNN5WEDG.js → CreateVersionCommand-Z6F5IKH5.js} +16 -16
  2. package/build/{DevCommand-DTV4QLZX.js → DevCommand-YFEZ4QV5.js} +15 -15
  3. package/build/DevCommand-YFEZ4QV5.js.map +1 -0
  4. package/build/{GenerateCommand-3EILY6GU.js → GenerateCommand-KCV4YDNN.js} +303 -183
  5. package/build/GenerateCommand-KCV4YDNN.js.map +1 -0
  6. package/build/{LogsCommand-GBLWWXA4.js → LogsCommand-VBMGVYNU.js} +4 -4
  7. package/build/PreviewCommand-3OMHWDW6.js +23 -0
  8. package/build/ReleaseCommand-5F3FPBXT.js +91 -0
  9. package/build/ReleaseCommand-5F3FPBXT.js.map +1 -0
  10. package/build/{ServeCommand-HBKGVBCD.js → ServeCommand-G4FF4PT3.js} +13 -13
  11. package/build/{build-NYCCEFPM.js → build-XZI3USNB.js} +10 -9
  12. package/build/build-XZI3USNB.js.map +1 -0
  13. package/build/{chunk-RFDDKVTR.js → chunk-2PTCXTKF.js} +5 -5
  14. package/build/{chunk-2ROHQF53.js → chunk-36W5H7IG.js} +484 -486
  15. package/build/chunk-36W5H7IG.js.map +1 -0
  16. package/build/{chunk-CDB46GX7.js → chunk-4VTDNX5T.js} +2 -2
  17. package/build/{chunk-FQ554CIC.js → chunk-5QZS3HT7.js} +3 -3
  18. package/build/{chunk-DKKXEKW7.js → chunk-7CGRTCDC.js} +3 -3
  19. package/build/{chunk-MVNY3M6D.js → chunk-CNZ3Q5PF.js} +5 -5
  20. package/build/{chunk-P5P6YINI.js → chunk-DGTJGIY2.js} +2466 -1175
  21. package/build/chunk-DGTJGIY2.js.map +1 -0
  22. package/build/{chunk-XIKZ45R2.js → chunk-FTC5AK3Y.js} +56 -12
  23. package/build/chunk-FTC5AK3Y.js.map +1 -0
  24. package/build/{chunk-UGZFZOEU.js → chunk-HUWYF2ET.js} +8 -8
  25. package/build/{chunk-ZDKKDXHS.js → chunk-IG6IV6VM.js} +3 -3
  26. package/build/{chunk-XRPBC4UX.js → chunk-O42QDBJU.js} +3 -3
  27. package/build/{chunk-PUIMS4NQ.js → chunk-PKSGXFYA.js} +3 -3
  28. package/build/{chunk-SE6QML7T.js → chunk-QVGYU6D4.js} +17 -7
  29. package/build/chunk-QVGYU6D4.js.map +1 -0
  30. package/build/{chunk-QVLKHYBX.js → chunk-USAOCISL.js} +3 -3
  31. package/build/{chunk-JSDDG7MC.js → chunk-VXE3IWKR.js} +2 -2
  32. package/build/{chunk-NTTJJSCK.js → chunk-VZJZSWRE.js} +3 -3
  33. package/build/{chunk-IWJPJJEU.js → chunk-WRPV7SLY.js} +2067 -370
  34. package/build/chunk-WRPV7SLY.js.map +1 -0
  35. package/build/{chunk-TQB6XTPS.js → chunk-WRWNJYKZ.js} +6 -3
  36. package/build/chunk-WRWNJYKZ.js.map +1 -0
  37. package/build/cloudflare-runtime/entry.js +314 -253
  38. package/build/cloudflare-runtime/getRegisteredExtensions.js +21 -273
  39. package/build/index.js +444 -134
  40. package/build/index.js.map +1 -1
  41. package/build/platform-sdk/chunk-42XIZ4MH.js +2 -0
  42. package/build/platform-sdk/chunk-42XIZ4MH.js.map +1 -0
  43. package/build/platform-sdk/chunk-7EYXEF6M.js +2 -0
  44. package/build/platform-sdk/chunk-7EYXEF6M.js.map +1 -0
  45. package/build/platform-sdk/chunk-EERHWVVD.js +2 -0
  46. package/build/platform-sdk/chunk-EERHWVVD.js.map +1 -0
  47. package/build/platform-sdk/chunk-QV4VBCJB.js +2 -0
  48. package/build/platform-sdk/chunk-QV4VBCJB.js.map +1 -0
  49. package/build/platform-sdk/dashboard.js +1 -1
  50. package/build/platform-sdk/dashboard.js.map +1 -1
  51. package/build/platform-sdk/editor.js +4 -4
  52. package/build/platform-sdk/editor.js.map +1 -1
  53. package/build/platform-sdk/sdk-context.js +2 -0
  54. package/build/platform-sdk/sdk-context.js.map +1 -0
  55. package/build/platform-sdk/site.js +1 -1
  56. package/build/platform-sdk/site.js.map +1 -1
  57. package/build/platform-sdk/web-methods.js +2 -0
  58. package/build/platform-sdk/web-methods.js.map +1 -0
  59. package/build/{preview-CCEFGOHW.js → preview-VAHHFTRZ.js} +13 -13
  60. package/build/preview-VAHHFTRZ.js.map +1 -0
  61. package/build/{render-command-T2HCJX3F.js → render-command-3AYSQXHN.js} +6 -6
  62. package/package.json +14 -11
  63. package/schemas/site-plugin.json +1 -1
  64. package/schemas/wix-config.json +1 -1
  65. package/templates/web-method/files/placeholder.ts.ejs +17 -0
  66. package/build/DevCommand-DTV4QLZX.js.map +0 -1
  67. package/build/GenerateCommand-3EILY6GU.js.map +0 -1
  68. package/build/PreviewCommand-A2C52TVM.js +0 -23
  69. package/build/build-NYCCEFPM.js.map +0 -1
  70. package/build/chunk-2ROHQF53.js.map +0 -1
  71. package/build/chunk-IWJPJJEU.js.map +0 -1
  72. package/build/chunk-P5P6YINI.js.map +0 -1
  73. package/build/chunk-SE6QML7T.js.map +0 -1
  74. package/build/chunk-TQB6XTPS.js.map +0 -1
  75. package/build/chunk-XIKZ45R2.js.map +0 -1
  76. package/build/platform-sdk/chunk-DGX4CFXG.js +0 -2
  77. package/build/platform-sdk/chunk-DGX4CFXG.js.map +0 -1
  78. package/build/platform-sdk/chunk-TN6HYRXL.js +0 -2
  79. package/build/platform-sdk/chunk-TN6HYRXL.js.map +0 -1
  80. package/build/preview-CCEFGOHW.js.map +0 -1
  81. /package/build/{CreateVersionCommand-NNN5WEDG.js.map → CreateVersionCommand-Z6F5IKH5.js.map} +0 -0
  82. /package/build/{LogsCommand-GBLWWXA4.js.map → LogsCommand-VBMGVYNU.js.map} +0 -0
  83. /package/build/{PreviewCommand-A2C52TVM.js.map → PreviewCommand-3OMHWDW6.js.map} +0 -0
  84. /package/build/{ServeCommand-HBKGVBCD.js.map → ServeCommand-G4FF4PT3.js.map} +0 -0
  85. /package/build/{chunk-RFDDKVTR.js.map → chunk-2PTCXTKF.js.map} +0 -0
  86. /package/build/{chunk-CDB46GX7.js.map → chunk-4VTDNX5T.js.map} +0 -0
  87. /package/build/{chunk-FQ554CIC.js.map → chunk-5QZS3HT7.js.map} +0 -0
  88. /package/build/{chunk-DKKXEKW7.js.map → chunk-7CGRTCDC.js.map} +0 -0
  89. /package/build/{chunk-MVNY3M6D.js.map → chunk-CNZ3Q5PF.js.map} +0 -0
  90. /package/build/{chunk-UGZFZOEU.js.map → chunk-HUWYF2ET.js.map} +0 -0
  91. /package/build/{chunk-ZDKKDXHS.js.map → chunk-IG6IV6VM.js.map} +0 -0
  92. /package/build/{chunk-XRPBC4UX.js.map → chunk-O42QDBJU.js.map} +0 -0
  93. /package/build/{chunk-PUIMS4NQ.js.map → chunk-PKSGXFYA.js.map} +0 -0
  94. /package/build/{chunk-QVLKHYBX.js.map → chunk-USAOCISL.js.map} +0 -0
  95. /package/build/{chunk-JSDDG7MC.js.map → chunk-VXE3IWKR.js.map} +0 -0
  96. /package/build/{chunk-NTTJJSCK.js.map → chunk-VZJZSWRE.js.map} +0 -0
  97. /package/build/{render-command-T2HCJX3F.js.map → render-command-3AYSQXHN.js.map} +0 -0
@@ -11518,7 +11518,7 @@ var init_tslib_es6 = __esm({
11518
11518
  });
11519
11519
 
11520
11520
  // package.json
11521
- var version = "1.1.58";
11521
+ var version = "1.1.60";
11522
11522
 
11523
11523
  // ../cli-error/src/cli-error.ts
11524
11524
  init_esm_shims();
@@ -11608,6 +11608,7 @@ var CliSystemErrorCode = (0, import_variant.variant)({
11608
11608
  TypeErrorInvalidUrl: {},
11609
11609
  FailedToGenerateSelfsignedCertificate: {},
11610
11610
  FailedToResolveViteOrigin: {},
11611
+ AppReleaseConfigViolations: (0, import_variant.fields)(),
11611
11612
  FailedToCreateAppRelease: {},
11612
11613
  FailedToUpdateAppRelease: {},
11613
11614
  FailedToCreateComponents: {},
@@ -11651,6 +11652,7 @@ var CliUserErrorCode = (0, import_variant.variant)({
11651
11652
  BuiltProjectNeeded: {},
11652
11653
  WixUninstallMissingPackageName: {},
11653
11654
  FailedToReadJson: (0, import_variant.fields)(),
11655
+ FailedToReadFile: (0, import_variant.fields)(),
11654
11656
  FailedToWriteJson: (0, import_variant.fields)(),
11655
11657
  FailedToWriteFile: (0, import_variant.fields)(),
11656
11658
  FailedToCreateDir: (0, import_variant.fields)(),
@@ -11722,7 +11724,13 @@ var CliUserErrorCode = (0, import_variant.variant)({
11722
11724
  FailedToGetSiteFsManagerCode: {},
11723
11725
  FailedToGetSiteFsManagerDocument: {},
11724
11726
  FailedToApplySiteFsManagerFsUpdates: {},
11725
- FailedToApplySiteFsManagerExternalUpdates: {}
11727
+ FailedToApplySiteFsManagerExternalUpdates: {},
11728
+ CannotFindConfigReferencedAsset: (0, import_variant.fields)(),
11729
+ CannotReleaseApplicationInReview: {},
11730
+ FailedToCreateIntellisenseAdapter: {},
11731
+ FailedToInitIntellisenseAdapterTypes: {},
11732
+ FailedToUpdateIntellisenseAdapterTypes: {},
11733
+ WebMethodOutsideOfProjectDirectory: (0, import_variant.fields)()
11726
11734
  });
11727
11735
  var CliErrorCode = (0, import_variant.variant)({
11728
11736
  ...CliSystemErrorCode,
@@ -14512,10 +14520,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
14512
14520
  return 1;
14513
14521
  }
14514
14522
  if ("CI" in env) {
14515
- if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
14523
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
14516
14524
  return 3;
14517
14525
  }
14518
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
14526
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
14519
14527
  return 1;
14520
14528
  }
14521
14529
  return min;
@@ -16739,6 +16747,9 @@ var quotelessJson = (obj) => {
16739
16747
  return json.replace(/"([^"]+)":/g, "$1:");
16740
16748
  };
16741
16749
  var ZodError = class _ZodError extends Error {
16750
+ get errors() {
16751
+ return this.issues;
16752
+ }
16742
16753
  constructor(issues) {
16743
16754
  super();
16744
16755
  this.issues = [];
@@ -16757,9 +16768,6 @@ var ZodError = class _ZodError extends Error {
16757
16768
  this.name = "ZodError";
16758
16769
  this.issues = issues;
16759
16770
  }
16760
- get errors() {
16761
- return this.issues;
16762
- }
16763
16771
  format(_mapper) {
16764
16772
  const mapper = _mapper || function(issue) {
16765
16773
  return issue.message;
@@ -16970,8 +16978,11 @@ function addIssueToContext(ctx, issueData) {
16970
16978
  path: ctx.path,
16971
16979
  errorMaps: [
16972
16980
  ctx.common.contextualErrorMap,
16981
+ // contextual error map is first priority
16973
16982
  ctx.schemaErrorMap,
16983
+ // then schema-bound map if available
16974
16984
  overrideMap,
16985
+ // then global override map
16975
16986
  overrideMap === errorMap ? void 0 : errorMap
16976
16987
  // then global default map
16977
16988
  ].filter((x) => !!x)
@@ -17122,34 +17133,6 @@ function processCreateParams(params) {
17122
17133
  return { errorMap: customMap, description };
17123
17134
  }
17124
17135
  var ZodType = class {
17125
- constructor(def) {
17126
- this.spa = this.safeParseAsync;
17127
- this._def = def;
17128
- this.parse = this.parse.bind(this);
17129
- this.safeParse = this.safeParse.bind(this);
17130
- this.parseAsync = this.parseAsync.bind(this);
17131
- this.safeParseAsync = this.safeParseAsync.bind(this);
17132
- this.spa = this.spa.bind(this);
17133
- this.refine = this.refine.bind(this);
17134
- this.refinement = this.refinement.bind(this);
17135
- this.superRefine = this.superRefine.bind(this);
17136
- this.optional = this.optional.bind(this);
17137
- this.nullable = this.nullable.bind(this);
17138
- this.nullish = this.nullish.bind(this);
17139
- this.array = this.array.bind(this);
17140
- this.promise = this.promise.bind(this);
17141
- this.or = this.or.bind(this);
17142
- this.and = this.and.bind(this);
17143
- this.transform = this.transform.bind(this);
17144
- this.brand = this.brand.bind(this);
17145
- this.default = this.default.bind(this);
17146
- this.catch = this.catch.bind(this);
17147
- this.describe = this.describe.bind(this);
17148
- this.pipe = this.pipe.bind(this);
17149
- this.readonly = this.readonly.bind(this);
17150
- this.isNullable = this.isNullable.bind(this);
17151
- this.isOptional = this.isOptional.bind(this);
17152
- }
17153
17136
  get description() {
17154
17137
  return this._def.description;
17155
17138
  }
@@ -17213,6 +17196,43 @@ var ZodType = class {
17213
17196
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
17214
17197
  return handleResult(ctx, result);
17215
17198
  }
17199
+ "~validate"(data) {
17200
+ var _a2, _b;
17201
+ const ctx = {
17202
+ common: {
17203
+ issues: [],
17204
+ async: !!this["~standard"].async
17205
+ },
17206
+ path: [],
17207
+ schemaErrorMap: this._def.errorMap,
17208
+ parent: null,
17209
+ data,
17210
+ parsedType: getParsedType(data)
17211
+ };
17212
+ if (!this["~standard"].async) {
17213
+ try {
17214
+ const result = this._parseSync({ data, path: [], parent: ctx });
17215
+ return isValid(result) ? {
17216
+ value: result.value
17217
+ } : {
17218
+ issues: ctx.common.issues
17219
+ };
17220
+ } catch (err) {
17221
+ if ((_b = (_a2 = err === null || err === void 0 ? void 0 : err.message) === null || _a2 === void 0 ? void 0 : _a2.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
17222
+ this["~standard"].async = true;
17223
+ }
17224
+ ctx.common = {
17225
+ issues: [],
17226
+ async: true
17227
+ };
17228
+ }
17229
+ }
17230
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
17231
+ value: result.value
17232
+ } : {
17233
+ issues: ctx.common.issues
17234
+ });
17235
+ }
17216
17236
  async parseAsync(data, params) {
17217
17237
  const result = await this.safeParseAsync(data, params);
17218
17238
  if (result.success)
@@ -17290,6 +17310,39 @@ var ZodType = class {
17290
17310
  superRefine(refinement) {
17291
17311
  return this._refinement(refinement);
17292
17312
  }
17313
+ constructor(def) {
17314
+ this.spa = this.safeParseAsync;
17315
+ this._def = def;
17316
+ this.parse = this.parse.bind(this);
17317
+ this.safeParse = this.safeParse.bind(this);
17318
+ this.parseAsync = this.parseAsync.bind(this);
17319
+ this.safeParseAsync = this.safeParseAsync.bind(this);
17320
+ this.spa = this.spa.bind(this);
17321
+ this.refine = this.refine.bind(this);
17322
+ this.refinement = this.refinement.bind(this);
17323
+ this.superRefine = this.superRefine.bind(this);
17324
+ this.optional = this.optional.bind(this);
17325
+ this.nullable = this.nullable.bind(this);
17326
+ this.nullish = this.nullish.bind(this);
17327
+ this.array = this.array.bind(this);
17328
+ this.promise = this.promise.bind(this);
17329
+ this.or = this.or.bind(this);
17330
+ this.and = this.and.bind(this);
17331
+ this.transform = this.transform.bind(this);
17332
+ this.brand = this.brand.bind(this);
17333
+ this.default = this.default.bind(this);
17334
+ this.catch = this.catch.bind(this);
17335
+ this.describe = this.describe.bind(this);
17336
+ this.pipe = this.pipe.bind(this);
17337
+ this.readonly = this.readonly.bind(this);
17338
+ this.isNullable = this.isNullable.bind(this);
17339
+ this.isOptional = this.isOptional.bind(this);
17340
+ this["~standard"] = {
17341
+ version: 1,
17342
+ vendor: "zod",
17343
+ validate: (data) => this["~validate"](data)
17344
+ };
17345
+ }
17293
17346
  optional() {
17294
17347
  return ZodOptional.create(this, this._def);
17295
17348
  }
@@ -17300,7 +17353,7 @@ var ZodType = class {
17300
17353
  return this.nullable().optional();
17301
17354
  }
17302
17355
  array() {
17303
- return ZodArray.create(this, this._def);
17356
+ return ZodArray.create(this);
17304
17357
  }
17305
17358
  promise() {
17306
17359
  return ZodPromise.create(this, this._def);
@@ -17366,16 +17419,20 @@ var ZodType = class {
17366
17419
  };
17367
17420
  var cuidRegex = /^c[^\s-]{8,}$/i;
17368
17421
  var cuid2Regex = /^[0-9a-z]+$/;
17369
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
17422
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
17370
17423
  var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
17371
17424
  var nanoidRegex = /^[a-z0-9_-]{21}$/i;
17425
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
17372
17426
  var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
17373
17427
  var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
17374
17428
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
17375
17429
  var emojiRegex3;
17376
17430
  var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
17377
- var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
17431
+ var ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
17432
+ var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
17433
+ var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
17378
17434
  var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
17435
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
17379
17436
  var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
17380
17437
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
17381
17438
  function timeRegexSource(args) {
@@ -17408,6 +17465,33 @@ function isValidIP(ip, version2) {
17408
17465
  }
17409
17466
  return false;
17410
17467
  }
17468
+ function isValidJWT(jwt, alg) {
17469
+ if (!jwtRegex.test(jwt))
17470
+ return false;
17471
+ try {
17472
+ const [header] = jwt.split(".");
17473
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
17474
+ const decoded = JSON.parse(atob(base64));
17475
+ if (typeof decoded !== "object" || decoded === null)
17476
+ return false;
17477
+ if (!decoded.typ || !decoded.alg)
17478
+ return false;
17479
+ if (alg && decoded.alg !== alg)
17480
+ return false;
17481
+ return true;
17482
+ } catch (_a2) {
17483
+ return false;
17484
+ }
17485
+ }
17486
+ function isValidCidr(ip, version2) {
17487
+ if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
17488
+ return true;
17489
+ }
17490
+ if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
17491
+ return true;
17492
+ }
17493
+ return false;
17494
+ }
17411
17495
  var ZodString = class _ZodString extends ZodType {
17412
17496
  _parse(input) {
17413
17497
  if (this._def.coerce) {
@@ -17664,6 +17748,26 @@ var ZodString = class _ZodString extends ZodType {
17664
17748
  });
17665
17749
  status.dirty();
17666
17750
  }
17751
+ } else if (check.kind === "jwt") {
17752
+ if (!isValidJWT(input.data, check.alg)) {
17753
+ ctx = this._getOrReturnCtx(input, ctx);
17754
+ addIssueToContext(ctx, {
17755
+ validation: "jwt",
17756
+ code: ZodIssueCode.invalid_string,
17757
+ message: check.message
17758
+ });
17759
+ status.dirty();
17760
+ }
17761
+ } else if (check.kind === "cidr") {
17762
+ if (!isValidCidr(input.data, check.version)) {
17763
+ ctx = this._getOrReturnCtx(input, ctx);
17764
+ addIssueToContext(ctx, {
17765
+ validation: "cidr",
17766
+ code: ZodIssueCode.invalid_string,
17767
+ message: check.message
17768
+ });
17769
+ status.dirty();
17770
+ }
17667
17771
  } else if (check.kind === "base64") {
17668
17772
  if (!base64Regex.test(input.data)) {
17669
17773
  ctx = this._getOrReturnCtx(input, ctx);
@@ -17674,6 +17778,16 @@ var ZodString = class _ZodString extends ZodType {
17674
17778
  });
17675
17779
  status.dirty();
17676
17780
  }
17781
+ } else if (check.kind === "base64url") {
17782
+ if (!base64urlRegex.test(input.data)) {
17783
+ ctx = this._getOrReturnCtx(input, ctx);
17784
+ addIssueToContext(ctx, {
17785
+ validation: "base64url",
17786
+ code: ZodIssueCode.invalid_string,
17787
+ message: check.message
17788
+ });
17789
+ status.dirty();
17790
+ }
17677
17791
  } else {
17678
17792
  util.assertNever(check);
17679
17793
  }
@@ -17720,9 +17834,21 @@ var ZodString = class _ZodString extends ZodType {
17720
17834
  base64(message) {
17721
17835
  return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
17722
17836
  }
17837
+ base64url(message) {
17838
+ return this._addCheck({
17839
+ kind: "base64url",
17840
+ ...errorUtil.errToObj(message)
17841
+ });
17842
+ }
17843
+ jwt(options) {
17844
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
17845
+ }
17723
17846
  ip(options) {
17724
17847
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
17725
17848
  }
17849
+ cidr(options) {
17850
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
17851
+ }
17726
17852
  datetime(options) {
17727
17853
  var _a2, _b;
17728
17854
  if (typeof options === "string") {
@@ -17813,8 +17939,7 @@ var ZodString = class _ZodString extends ZodType {
17813
17939
  });
17814
17940
  }
17815
17941
  /**
17816
- * @deprecated Use z.string().min(1) instead.
17817
- * @see {@link ZodString.min}
17942
+ * Equivalent to `.min(1)`
17818
17943
  */
17819
17944
  nonempty(message) {
17820
17945
  return this.min(1, errorUtil.errToObj(message));
@@ -17876,9 +18001,15 @@ var ZodString = class _ZodString extends ZodType {
17876
18001
  get isIP() {
17877
18002
  return !!this._def.checks.find((ch) => ch.kind === "ip");
17878
18003
  }
18004
+ get isCIDR() {
18005
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
18006
+ }
17879
18007
  get isBase64() {
17880
18008
  return !!this._def.checks.find((ch) => ch.kind === "base64");
17881
18009
  }
18010
+ get isBase64url() {
18011
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
18012
+ }
17882
18013
  get minLength() {
17883
18014
  let min = null;
17884
18015
  for (const ch of this._def.checks) {
@@ -18156,17 +18287,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
18156
18287
  }
18157
18288
  _parse(input) {
18158
18289
  if (this._def.coerce) {
18159
- input.data = BigInt(input.data);
18290
+ try {
18291
+ input.data = BigInt(input.data);
18292
+ } catch (_a2) {
18293
+ return this._getInvalidInput(input);
18294
+ }
18160
18295
  }
18161
18296
  const parsedType = this._getType(input);
18162
18297
  if (parsedType !== ZodParsedType.bigint) {
18163
- const ctx2 = this._getOrReturnCtx(input);
18164
- addIssueToContext(ctx2, {
18165
- code: ZodIssueCode.invalid_type,
18166
- expected: ZodParsedType.bigint,
18167
- received: ctx2.parsedType
18168
- });
18169
- return INVALID;
18298
+ return this._getInvalidInput(input);
18170
18299
  }
18171
18300
  let ctx = void 0;
18172
18301
  const status = new ParseStatus();
@@ -18213,6 +18342,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
18213
18342
  }
18214
18343
  return { status: status.value, value: input.data };
18215
18344
  }
18345
+ _getInvalidInput(input) {
18346
+ const ctx = this._getOrReturnCtx(input);
18347
+ addIssueToContext(ctx, {
18348
+ code: ZodIssueCode.invalid_type,
18349
+ expected: ZodParsedType.bigint,
18350
+ received: ctx.parsedType
18351
+ });
18352
+ return INVALID;
18353
+ }
18216
18354
  gte(value2, message) {
18217
18355
  return this.setLimit("min", value2, true, errorUtil.toString(message));
18218
18356
  }
@@ -22147,20 +22285,18 @@ terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, { tar
22147
22285
  terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
22148
22286
 
22149
22287
  // ../cli-ui-kit/src/components/Link.tsx
22150
- var Link = ({
22151
- skin,
22152
- children,
22153
- url,
22154
- transform = (v) => v
22155
- }) => {
22288
+ var Link = ({ skin, children, url }) => {
22156
22289
  if (children) {
22157
- return /* @__PURE__ */ import_react55.default.createElement(
22158
- Transform,
22159
- {
22160
- transform: (children2) => transform(terminalLink(children2, url, { fallback: true }))
22161
- },
22162
- /* @__PURE__ */ import_react55.default.createElement(Text2, { skin }, children)
22163
- );
22290
+ if (terminalLink.isSupported) {
22291
+ return /* @__PURE__ */ import_react55.default.createElement(
22292
+ Transform,
22293
+ {
22294
+ transform: (childrenAsString) => terminalLink(childrenAsString, url, { fallback: false })
22295
+ },
22296
+ /* @__PURE__ */ import_react55.default.createElement(Text2, { skin }, children)
22297
+ );
22298
+ }
22299
+ return /* @__PURE__ */ import_react55.default.createElement(Text2, null, /* @__PURE__ */ import_react55.default.createElement(Text2, { skin }, children), " (", url, ")");
22164
22300
  }
22165
22301
  return /* @__PURE__ */ import_react55.default.createElement(Text2, { skin: "info" }, url);
22166
22302
  };
@@ -22608,24 +22744,27 @@ var html_parse_stringify_module_default = c;
22608
22744
 
22609
22745
  // ../../node_modules/react-i18next/dist/es/utils.js
22610
22746
  init_esm_shims();
22611
- function warn() {
22612
- if (console && console.warn) {
22613
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22614
- args[_key] = arguments[_key];
22615
- }
22616
- if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
22747
+ var warn = (i18n, code, msg, rest) => {
22748
+ const args = [msg, {
22749
+ code,
22750
+ ...rest || {}
22751
+ }];
22752
+ if (i18n?.services?.logger?.forward) {
22753
+ return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
22754
+ }
22755
+ if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
22756
+ if (i18n?.services?.logger?.warn) {
22757
+ i18n.services.logger.warn(...args);
22758
+ } else if (console?.warn) {
22617
22759
  console.warn(...args);
22618
22760
  }
22619
- }
22761
+ };
22620
22762
  var alreadyWarned = {};
22621
- function warnOnce() {
22622
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
22623
- args[_key2] = arguments[_key2];
22624
- }
22625
- if (isString(args[0]) && alreadyWarned[args[0]]) return;
22626
- if (isString(args[0])) alreadyWarned[args[0]] = /* @__PURE__ */ new Date();
22627
- warn(...args);
22628
- }
22763
+ var warnOnce = (i18n, code, msg, rest) => {
22764
+ if (isString(msg) && alreadyWarned[msg]) return;
22765
+ if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
22766
+ warn(i18n, code, msg, rest);
22767
+ };
22629
22768
  var loadedClb = (i18n, cb) => () => {
22630
22769
  if (i18n.isInitialized) {
22631
22770
  cb();
@@ -22644,41 +22783,23 @@ var loadNamespaces = (i18n, ns, cb) => {
22644
22783
  };
22645
22784
  var loadLanguages = (i18n, lng, ns, cb) => {
22646
22785
  if (isString(ns)) ns = [ns];
22786
+ if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
22647
22787
  ns.forEach((n2) => {
22648
22788
  if (i18n.options.ns.indexOf(n2) < 0) i18n.options.ns.push(n2);
22649
22789
  });
22650
22790
  i18n.loadLanguages(lng, loadedClb(i18n, cb));
22651
22791
  };
22652
- var oldI18nextHasLoadedNamespace = function(ns, i18n) {
22653
- let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
22654
- const lng = i18n.languages[0];
22655
- const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
22656
- const lastLng = i18n.languages[i18n.languages.length - 1];
22657
- if (lng.toLowerCase() === "cimode") return true;
22658
- const loadNotPending = (l, n2) => {
22659
- const loadState = i18n.services.backendConnector.state[`${l}|${n2}`];
22660
- return loadState === -1 || loadState === 2;
22661
- };
22662
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
22663
- if (i18n.hasResourceBundle(lng, ns)) return true;
22664
- if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
22665
- if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
22666
- return false;
22667
- };
22668
- var hasLoadedNamespace = function(ns, i18n) {
22669
- let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
22792
+ var hasLoadedNamespace = (ns, i18n, options = {}) => {
22670
22793
  if (!i18n.languages || !i18n.languages.length) {
22671
- warnOnce("i18n.languages were undefined or empty", i18n.languages);
22794
+ warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
22795
+ languages: i18n.languages
22796
+ });
22672
22797
  return true;
22673
22798
  }
22674
- const isNewerI18next = i18n.options.ignoreJSONStructure !== void 0;
22675
- if (!isNewerI18next) {
22676
- return oldI18nextHasLoadedNamespace(ns, i18n, options);
22677
- }
22678
22799
  return i18n.hasLoadedNamespace(ns, {
22679
22800
  lng: options.lng,
22680
22801
  precheck: (i18nInstance2, loadNotPending) => {
22681
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
22802
+ if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
22682
22803
  }
22683
22804
  });
22684
22805
  };
@@ -22727,8 +22848,7 @@ var defaultOptions = {
22727
22848
  useSuspense: true,
22728
22849
  unescape
22729
22850
  };
22730
- var setDefaults = function() {
22731
- let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
22851
+ var setDefaults = (options = {}) => {
22732
22852
  defaultOptions = {
22733
22853
  ...defaultOptions,
22734
22854
  ...options
@@ -22747,14 +22867,14 @@ var getI18n = () => i18nInstance;
22747
22867
  // ../../node_modules/react-i18next/dist/es/TransWithoutContext.js
22748
22868
  var hasChildren = (node, checkLength) => {
22749
22869
  if (!node) return false;
22750
- const base = node.props ? node.props.children : node.children;
22870
+ const base = node.props?.children ?? node.children;
22751
22871
  if (checkLength) return base.length > 0;
22752
22872
  return !!base;
22753
22873
  };
22754
22874
  var getChildren = (node) => {
22755
22875
  if (!node) return [];
22756
- const children = node.props ? node.props.children : node.children;
22757
- return node.props && node.props.i18nIsDynamicList ? getAsArray(children) : children;
22876
+ const children = node.props?.children ?? node.children;
22877
+ return node.props?.i18nIsDynamicList ? getAsArray(children) : children;
22758
22878
  };
22759
22879
  var hasValidReactChildren = (children) => Array.isArray(children) && children.every(import_react62.isValidElement);
22760
22880
  var getAsArray = (data) => Array.isArray(data) ? data : [data];
@@ -22765,15 +22885,17 @@ var mergeProps = (source, target) => {
22765
22885
  newTarget.props = Object.assign(source.props, target.props);
22766
22886
  return newTarget;
22767
22887
  };
22768
- var nodesToString = (children, i18nOptions) => {
22888
+ var nodesToString = (children, i18nOptions, i18n, i18nKey) => {
22769
22889
  if (!children) return "";
22770
22890
  let stringNode = "";
22771
22891
  const childrenArray = getAsArray(children);
22772
- const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
22892
+ const keepArray = i18nOptions?.transSupportBasicHtmlNodes ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : [];
22773
22893
  childrenArray.forEach((child, childIndex) => {
22774
22894
  if (isString(child)) {
22775
22895
  stringNode += `${child}`;
22776
- } else if ((0, import_react62.isValidElement)(child)) {
22896
+ return;
22897
+ }
22898
+ if ((0, import_react62.isValidElement)(child)) {
22777
22899
  const {
22778
22900
  props,
22779
22901
  type
@@ -22783,17 +22905,27 @@ var nodesToString = (children, i18nOptions) => {
22783
22905
  const childChildren = props.children;
22784
22906
  if (!childChildren && shouldKeepChild && !childPropsCount) {
22785
22907
  stringNode += `<${type}/>`;
22786
- } else if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {
22908
+ return;
22909
+ }
22910
+ if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {
22787
22911
  stringNode += `<${childIndex}></${childIndex}>`;
22788
- } else if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {
22912
+ return;
22913
+ }
22914
+ if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {
22789
22915
  stringNode += `<${type}>${childChildren}</${type}>`;
22790
- } else {
22791
- const content = nodesToString(childChildren, i18nOptions);
22792
- stringNode += `<${childIndex}>${content}</${childIndex}>`;
22916
+ return;
22793
22917
  }
22794
- } else if (child === null) {
22795
- warn(`Trans: the passed in value is invalid - seems you passed in a null child.`);
22796
- } else if (isObject(child)) {
22918
+ const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);
22919
+ stringNode += `<${childIndex}>${content}</${childIndex}>`;
22920
+ return;
22921
+ }
22922
+ if (child === null) {
22923
+ warn(i18n, "TRANS_NULL_VALUE", `Passed in a null value as child`, {
22924
+ i18nKey
22925
+ });
22926
+ return;
22927
+ }
22928
+ if (isObject(child)) {
22797
22929
  const {
22798
22930
  format,
22799
22931
  ...clone
@@ -22802,12 +22934,18 @@ var nodesToString = (children, i18nOptions) => {
22802
22934
  if (keys.length === 1) {
22803
22935
  const value2 = format ? `${keys[0]}, ${format}` : keys[0];
22804
22936
  stringNode += `{{${value2}}}`;
22805
- } else {
22806
- warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child);
22937
+ return;
22807
22938
  }
22808
- } else {
22809
- warn(`Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.`, child);
22939
+ warn(i18n, "TRANS_INVALID_OBJ", `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, {
22940
+ i18nKey,
22941
+ child
22942
+ });
22943
+ return;
22810
22944
  }
22945
+ warn(i18n, "TRANS_INVALID_VAR", `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, {
22946
+ i18nKey,
22947
+ child
22948
+ });
22811
22949
  });
22812
22950
  return stringNode;
22813
22951
  };
@@ -22834,7 +22972,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
22834
22972
  const renderInner = (child, node, rootReactNode) => {
22835
22973
  const childs = getChildren(child);
22836
22974
  const mappedChildren = mapAST(childs, node.children, rootReactNode);
22837
- return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props && child.props.i18nIsDynamicList ? childs : mappedChildren;
22975
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props?.i18nIsDynamicList ? childs : mappedChildren;
22838
22976
  };
22839
22977
  const pushTranslatedJSX = (child, inner, mem, i2, isVoid) => {
22840
22978
  if (child.dummy) {
@@ -22860,7 +22998,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
22860
22998
  const reactNodes = getAsArray(reactNode);
22861
22999
  const astNodes = getAsArray(astNode);
22862
23000
  return astNodes.reduce((mem, node, i2) => {
22863
- const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
23001
+ const translationContent = node.children?.[0]?.content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
22864
23002
  if (node.type === "tag") {
22865
23003
  let tmp = reactNodes[parseInt(node.name, 10)];
22866
23004
  if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];
@@ -22928,42 +23066,79 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
22928
23066
  }], ast, getAsArray(children || []));
22929
23067
  return getChildren(result[0]);
22930
23068
  };
22931
- function Trans(_ref) {
22932
- let {
22933
- children,
22934
- count,
22935
- parent,
22936
- i18nKey,
22937
- context,
22938
- tOptions = {},
22939
- values,
22940
- defaults: defaults2,
22941
- components,
22942
- ns,
22943
- i18n: i18nFromProps,
22944
- t: tFromProps,
22945
- shouldUnescape,
22946
- ...additionalProps
22947
- } = _ref;
23069
+ var fixComponentProps = (component, index, translation) => {
23070
+ const componentKey = component.key || index;
23071
+ const comp = (0, import_react62.cloneElement)(component, {
23072
+ key: componentKey
23073
+ });
23074
+ if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {
23075
+ return comp;
23076
+ }
23077
+ function Componentized() {
23078
+ return (0, import_react62.createElement)(import_react62.Fragment, null, comp);
23079
+ }
23080
+ return (0, import_react62.createElement)(Componentized);
23081
+ };
23082
+ var generateArrayComponents = (components, translation) => components.map((c2, index) => fixComponentProps(c2, index, translation));
23083
+ var generateObjectComponents = (components, translation) => {
23084
+ const componentMap = {};
23085
+ Object.keys(components).forEach((c2) => {
23086
+ Object.assign(componentMap, {
23087
+ [c2]: fixComponentProps(components[c2], c2, translation)
23088
+ });
23089
+ });
23090
+ return componentMap;
23091
+ };
23092
+ var generateComponents = (components, translation, i18n, i18nKey) => {
23093
+ if (!components) return null;
23094
+ if (Array.isArray(components)) {
23095
+ return generateArrayComponents(components, translation);
23096
+ }
23097
+ if (isObject(components)) {
23098
+ return generateObjectComponents(components, translation);
23099
+ }
23100
+ warnOnce(i18n, "TRANS_INVALID_COMPONENTS", `<Trans /> "components" prop expects an object or array`, {
23101
+ i18nKey
23102
+ });
23103
+ return null;
23104
+ };
23105
+ function Trans({
23106
+ children,
23107
+ count,
23108
+ parent,
23109
+ i18nKey,
23110
+ context,
23111
+ tOptions = {},
23112
+ values,
23113
+ defaults: defaults2,
23114
+ components,
23115
+ ns,
23116
+ i18n: i18nFromProps,
23117
+ t: tFromProps,
23118
+ shouldUnescape,
23119
+ ...additionalProps
23120
+ }) {
22948
23121
  const i18n = i18nFromProps || getI18n();
22949
23122
  if (!i18n) {
22950
- warnOnce("You will need to pass in an i18next instance by using i18nextReactModule");
23123
+ warnOnce(i18n, "NO_I18NEXT_INSTANCE", `Trans: You need to pass in an i18next instance using i18nextReactModule`, {
23124
+ i18nKey
23125
+ });
22951
23126
  return children;
22952
23127
  }
22953
23128
  const t3 = tFromProps || i18n.t.bind(i18n) || ((k) => k);
22954
23129
  const reactI18nextOptions = {
22955
23130
  ...getDefaults(),
22956
- ...i18n.options && i18n.options.react
23131
+ ...i18n.options?.react
22957
23132
  };
22958
- let namespaces = ns || t3.ns || i18n.options && i18n.options.defaultNS;
23133
+ let namespaces = ns || t3.ns || i18n.options?.defaultNS;
22959
23134
  namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
22960
- const nodeAsString = nodesToString(children, reactI18nextOptions);
23135
+ const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);
22961
23136
  const defaultValue = defaults2 || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;
22962
23137
  const {
22963
23138
  hashTransKey
22964
23139
  } = reactI18nextOptions;
22965
23140
  const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);
22966
- if (i18n.options && i18n.options.interpolation && i18n.options.interpolation.defaultVariables) {
23141
+ if (i18n.options?.interpolation?.defaultVariables) {
22967
23142
  values = values && Object.keys(values).length > 0 ? {
22968
23143
  ...values,
22969
23144
  ...i18n.options.interpolation.defaultVariables
@@ -22971,7 +23146,7 @@ function Trans(_ref) {
22971
23146
  ...i18n.options.interpolation.defaultVariables
22972
23147
  };
22973
23148
  }
22974
- const interpolationOverride = values || count !== void 0 || !children ? tOptions.interpolation : {
23149
+ const interpolationOverride = values || count !== void 0 && !i18n.options?.interpolation?.alwaysFormat || !children ? tOptions.interpolation : {
22975
23150
  interpolation: {
22976
23151
  ...tOptions.interpolation,
22977
23152
  prefix: "#$?",
@@ -22988,18 +23163,9 @@ function Trans(_ref) {
22988
23163
  ns: namespaces
22989
23164
  };
22990
23165
  const translation = key ? t3(key, combinedTOpts) : defaultValue;
22991
- if (components) {
22992
- Object.keys(components).forEach((c2) => {
22993
- const comp = components[c2];
22994
- if (typeof comp.type === "function" || !comp.props || !comp.props.children || translation.indexOf(`${c2}/>`) < 0 && translation.indexOf(`${c2} />`) < 0) return;
22995
- function Componentized() {
22996
- return (0, import_react62.createElement)(import_react62.Fragment, null, comp);
22997
- }
22998
- components[c2] = (0, import_react62.createElement)(Componentized);
22999
- });
23000
- }
23001
- const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
23002
- const useAsParent = parent !== void 0 ? parent : reactI18nextOptions.defaultTransParent;
23166
+ const generatedComponents = generateComponents(components, translation, i18n, i18nKey);
23167
+ const content = renderNodes(generatedComponents || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
23168
+ const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;
23003
23169
  return useAsParent ? (0, import_react62.createElement)(useAsParent, additionalProps, content) : content;
23004
23170
  }
23005
23171
 
@@ -23028,33 +23194,34 @@ var ReportNamespaces = class {
23028
23194
  if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
23029
23195
  });
23030
23196
  }
23031
- getUsedNamespaces = () => Object.keys(this.usedNamespaces);
23197
+ getUsedNamespaces() {
23198
+ return Object.keys(this.usedNamespaces);
23199
+ }
23032
23200
  };
23033
23201
 
23034
23202
  // ../../node_modules/react-i18next/dist/es/Trans.js
23035
- function Trans2(_ref) {
23036
- let {
23037
- children,
23038
- count,
23039
- parent,
23040
- i18nKey,
23041
- context,
23042
- tOptions = {},
23043
- values,
23044
- defaults: defaults2,
23045
- components,
23046
- ns,
23047
- i18n: i18nFromProps,
23048
- t: tFromProps,
23049
- shouldUnescape,
23050
- ...additionalProps
23051
- } = _ref;
23203
+ function Trans2({
23204
+ children,
23205
+ count,
23206
+ parent,
23207
+ i18nKey,
23208
+ context,
23209
+ tOptions = {},
23210
+ values,
23211
+ defaults: defaults2,
23212
+ components,
23213
+ ns,
23214
+ i18n: i18nFromProps,
23215
+ t: tFromProps,
23216
+ shouldUnescape,
23217
+ ...additionalProps
23218
+ }) {
23052
23219
  const {
23053
23220
  i18n: i18nFromContext,
23054
23221
  defaultNS: defaultNSFromContext
23055
23222
  } = (0, import_react64.useContext)(I18nContext) || {};
23056
23223
  const i18n = i18nFromProps || i18nFromContext || getI18n();
23057
- const t3 = tFromProps || i18n && i18n.t.bind(i18n);
23224
+ const t3 = tFromProps || i18n?.t.bind(i18n);
23058
23225
  return Trans({
23059
23226
  children,
23060
23227
  count,
@@ -23065,7 +23232,7 @@ function Trans2(_ref) {
23065
23232
  values,
23066
23233
  defaults: defaults2,
23067
23234
  components,
23068
- ns: ns || t3 && t3.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
23235
+ ns: ns || t3?.ns || defaultNSFromContext || i18n?.options?.defaultNS,
23069
23236
  i18n,
23070
23237
  t: tFromProps,
23071
23238
  shouldUnescape,
@@ -23085,8 +23252,7 @@ var usePrevious = (value2, ignore) => {
23085
23252
  };
23086
23253
  var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
23087
23254
  var useMemoizedT = (i18n, language, namespace, keyPrefix) => (0, import_react65.useCallback)(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
23088
- var useTranslation = function(ns) {
23089
- let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23255
+ var useTranslation = (ns, props = {}) => {
23090
23256
  const {
23091
23257
  i18n: i18nFromProps
23092
23258
  } = props;
@@ -23097,7 +23263,7 @@ var useTranslation = function(ns) {
23097
23263
  const i18n = i18nFromProps || i18nFromContext || getI18n();
23098
23264
  if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
23099
23265
  if (!i18n) {
23100
- warnOnce("You will need to pass in an i18next instance by using initReactI18next");
23266
+ warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
23101
23267
  const notReadyT = (k, optsOrDefaultValue) => {
23102
23268
  if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
23103
23269
  if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
@@ -23109,7 +23275,7 @@ var useTranslation = function(ns) {
23109
23275
  retNotReady.ready = false;
23110
23276
  return retNotReady;
23111
23277
  }
23112
- if (i18n.options.react && i18n.options.react.wait !== void 0) warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
23278
+ if (i18n.options.react?.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
23113
23279
  const i18nOptions = {
23114
23280
  ...getDefaults(),
23115
23281
  ...i18n.options.react,
@@ -23119,9 +23285,9 @@ var useTranslation = function(ns) {
23119
23285
  useSuspense,
23120
23286
  keyPrefix
23121
23287
  } = i18nOptions;
23122
- let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
23288
+ let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;
23123
23289
  namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
23124
- if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
23290
+ i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
23125
23291
  const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions));
23126
23292
  const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
23127
23293
  const getT = () => memoGetT;
@@ -23154,11 +23320,11 @@ var useTranslation = function(ns) {
23154
23320
  const boundReset = () => {
23155
23321
  if (isMounted.current) setT(getNewT);
23156
23322
  };
23157
- if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
23158
- if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
23323
+ if (bindI18n) i18n?.on(bindI18n, boundReset);
23324
+ if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
23159
23325
  return () => {
23160
23326
  isMounted.current = false;
23161
- if (bindI18n && i18n) bindI18n.split(" ").forEach((e2) => i18n.off(e2, boundReset));
23327
+ if (i18n) bindI18n?.split(" ").forEach((e2) => i18n.off(e2, boundReset));
23162
23328
  if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
23163
23329
  };
23164
23330
  }, [i18n, joinedNS]);
@@ -23192,12 +23358,11 @@ init_esm_shims();
23192
23358
  // ../../node_modules/react-i18next/dist/es/I18nextProvider.js
23193
23359
  init_esm_shims();
23194
23360
  var import_react67 = __toESM(require_react(), 1);
23195
- function I18nextProvider(_ref) {
23196
- let {
23197
- i18n,
23198
- defaultNS,
23199
- children
23200
- } = _ref;
23361
+ function I18nextProvider({
23362
+ i18n,
23363
+ defaultNS,
23364
+ children
23365
+ }) {
23201
23366
  const value2 = (0, import_react67.useMemo)(() => ({
23202
23367
  i18n,
23203
23368
  defaultNS
@@ -26132,6 +26297,9 @@ function _isPatternSyntax(c2) {
26132
26297
  return c2 >= 33 && c2 <= 35 || c2 === 36 || c2 >= 37 && c2 <= 39 || c2 === 40 || c2 === 41 || c2 === 42 || c2 === 43 || c2 === 44 || c2 === 45 || c2 >= 46 && c2 <= 47 || c2 >= 58 && c2 <= 59 || c2 >= 60 && c2 <= 62 || c2 >= 63 && c2 <= 64 || c2 === 91 || c2 === 92 || c2 === 93 || c2 === 94 || c2 === 96 || c2 === 123 || c2 === 124 || c2 === 125 || c2 === 126 || c2 === 161 || c2 >= 162 && c2 <= 165 || c2 === 166 || c2 === 167 || c2 === 169 || c2 === 171 || c2 === 172 || c2 === 174 || c2 === 176 || c2 === 177 || c2 === 182 || c2 === 187 || c2 === 191 || c2 === 215 || c2 === 247 || c2 >= 8208 && c2 <= 8213 || c2 >= 8214 && c2 <= 8215 || c2 === 8216 || c2 === 8217 || c2 === 8218 || c2 >= 8219 && c2 <= 8220 || c2 === 8221 || c2 === 8222 || c2 === 8223 || c2 >= 8224 && c2 <= 8231 || c2 >= 8240 && c2 <= 8248 || c2 === 8249 || c2 === 8250 || c2 >= 8251 && c2 <= 8254 || c2 >= 8257 && c2 <= 8259 || c2 === 8260 || c2 === 8261 || c2 === 8262 || c2 >= 8263 && c2 <= 8273 || c2 === 8274 || c2 === 8275 || c2 >= 8277 && c2 <= 8286 || c2 >= 8592 && c2 <= 8596 || c2 >= 8597 && c2 <= 8601 || c2 >= 8602 && c2 <= 8603 || c2 >= 8604 && c2 <= 8607 || c2 === 8608 || c2 >= 8609 && c2 <= 8610 || c2 === 8611 || c2 >= 8612 && c2 <= 8613 || c2 === 8614 || c2 >= 8615 && c2 <= 8621 || c2 === 8622 || c2 >= 8623 && c2 <= 8653 || c2 >= 8654 && c2 <= 8655 || c2 >= 8656 && c2 <= 8657 || c2 === 8658 || c2 === 8659 || c2 === 8660 || c2 >= 8661 && c2 <= 8691 || c2 >= 8692 && c2 <= 8959 || c2 >= 8960 && c2 <= 8967 || c2 === 8968 || c2 === 8969 || c2 === 8970 || c2 === 8971 || c2 >= 8972 && c2 <= 8991 || c2 >= 8992 && c2 <= 8993 || c2 >= 8994 && c2 <= 9e3 || c2 === 9001 || c2 === 9002 || c2 >= 9003 && c2 <= 9083 || c2 === 9084 || c2 >= 9085 && c2 <= 9114 || c2 >= 9115 && c2 <= 9139 || c2 >= 9140 && c2 <= 9179 || c2 >= 9180 && c2 <= 9185 || c2 >= 9186 && c2 <= 9254 || c2 >= 9255 && c2 <= 9279 || c2 >= 9280 && c2 <= 9290 || c2 >= 9291 && c2 <= 9311 || c2 >= 9472 && c2 <= 9654 || c2 === 9655 || c2 >= 9656 && c2 <= 9664 || c2 === 9665 || c2 >= 9666 && c2 <= 9719 || c2 >= 9720 && c2 <= 9727 || c2 >= 9728 && c2 <= 9838 || c2 === 9839 || c2 >= 9840 && c2 <= 10087 || c2 === 10088 || c2 === 10089 || c2 === 10090 || c2 === 10091 || c2 === 10092 || c2 === 10093 || c2 === 10094 || c2 === 10095 || c2 === 10096 || c2 === 10097 || c2 === 10098 || c2 === 10099 || c2 === 10100 || c2 === 10101 || c2 >= 10132 && c2 <= 10175 || c2 >= 10176 && c2 <= 10180 || c2 === 10181 || c2 === 10182 || c2 >= 10183 && c2 <= 10213 || c2 === 10214 || c2 === 10215 || c2 === 10216 || c2 === 10217 || c2 === 10218 || c2 === 10219 || c2 === 10220 || c2 === 10221 || c2 === 10222 || c2 === 10223 || c2 >= 10224 && c2 <= 10239 || c2 >= 10240 && c2 <= 10495 || c2 >= 10496 && c2 <= 10626 || c2 === 10627 || c2 === 10628 || c2 === 10629 || c2 === 10630 || c2 === 10631 || c2 === 10632 || c2 === 10633 || c2 === 10634 || c2 === 10635 || c2 === 10636 || c2 === 10637 || c2 === 10638 || c2 === 10639 || c2 === 10640 || c2 === 10641 || c2 === 10642 || c2 === 10643 || c2 === 10644 || c2 === 10645 || c2 === 10646 || c2 === 10647 || c2 === 10648 || c2 >= 10649 && c2 <= 10711 || c2 === 10712 || c2 === 10713 || c2 === 10714 || c2 === 10715 || c2 >= 10716 && c2 <= 10747 || c2 === 10748 || c2 === 10749 || c2 >= 10750 && c2 <= 11007 || c2 >= 11008 && c2 <= 11055 || c2 >= 11056 && c2 <= 11076 || c2 >= 11077 && c2 <= 11078 || c2 >= 11079 && c2 <= 11084 || c2 >= 11085 && c2 <= 11123 || c2 >= 11124 && c2 <= 11125 || c2 >= 11126 && c2 <= 11157 || c2 === 11158 || c2 >= 11159 && c2 <= 11263 || c2 >= 11776 && c2 <= 11777 || c2 === 11778 || c2 === 11779 || c2 === 11780 || c2 === 11781 || c2 >= 11782 && c2 <= 11784 || c2 === 11785 || c2 === 11786 || c2 === 11787 || c2 === 11788 || c2 === 11789 || c2 >= 11790 && c2 <= 11798 || c2 === 11799 || c2 >= 11800 && c2 <= 11801 || c2 === 11802 || c2 === 11803 || c2 === 11804 || c2 === 11805 || c2 >= 11806 && c2 <= 11807 || c2 === 11808 || c2 === 11809 || c2 === 11810 || c2 === 11811 || c2 === 11812 || c2 === 11813 || c2 === 11814 || c2 === 11815 || c2 === 11816 || c2 === 11817 || c2 >= 11818 && c2 <= 11822 || c2 === 11823 || c2 >= 11824 && c2 <= 11833 || c2 >= 11834 && c2 <= 11835 || c2 >= 11836 && c2 <= 11839 || c2 === 11840 || c2 === 11841 || c2 === 11842 || c2 >= 11843 && c2 <= 11855 || c2 >= 11856 && c2 <= 11857 || c2 === 11858 || c2 >= 11859 && c2 <= 11903 || c2 >= 12289 && c2 <= 12291 || c2 === 12296 || c2 === 12297 || c2 === 12298 || c2 === 12299 || c2 === 12300 || c2 === 12301 || c2 === 12302 || c2 === 12303 || c2 === 12304 || c2 === 12305 || c2 >= 12306 && c2 <= 12307 || c2 === 12308 || c2 === 12309 || c2 === 12310 || c2 === 12311 || c2 === 12312 || c2 === 12313 || c2 === 12314 || c2 === 12315 || c2 === 12316 || c2 === 12317 || c2 >= 12318 && c2 <= 12319 || c2 === 12320 || c2 === 12336 || c2 === 64830 || c2 === 64831 || c2 >= 65093 && c2 <= 65094;
26133
26298
  }
26134
26299
 
26300
+ // ../../node_modules/@formatjs/icu-messageformat-parser/lib/manipulator.js
26301
+ init_esm_shims();
26302
+
26135
26303
  // ../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js
26136
26304
  function pruneLocation(els) {
26137
26305
  els.forEach(function(el) {
@@ -26800,7 +26968,7 @@ var setPath2 = (object, path, newValue) => {
26800
26968
  e2 = `${p[p.length - 1]}.${e2}`;
26801
26969
  p = p.slice(0, p.length - 1);
26802
26970
  last = getLastOfPath2(object, p, Object);
26803
- if (last && last.obj && typeof last.obj[`${last.k}.${e2}`] !== "undefined") {
26971
+ if (last?.obj && typeof last.obj[`${last.k}.${e2}`] !== "undefined") {
26804
26972
  last.obj = void 0;
26805
26973
  }
26806
26974
  }
@@ -26820,6 +26988,7 @@ var getPath2 = (object, path) => {
26820
26988
  k
26821
26989
  } = getLastOfPath2(object, path);
26822
26990
  if (!obj) return void 0;
26991
+ if (!Object.prototype.hasOwnProperty.call(obj, k)) return void 0;
26823
26992
  return obj[k];
26824
26993
  };
26825
26994
  var getPathWithDefaults = (data, defaultData, key) => {
@@ -26900,7 +27069,10 @@ var looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
26900
27069
  var deepFind = function(obj, path) {
26901
27070
  let keySeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
26902
27071
  if (!obj) return void 0;
26903
- if (obj[path]) return obj[path];
27072
+ if (obj[path]) {
27073
+ if (!Object.prototype.hasOwnProperty.call(obj, path)) return void 0;
27074
+ return obj[path];
27075
+ }
26904
27076
  const tokens = path.split(keySeparator);
26905
27077
  let current = obj;
26906
27078
  for (let i2 = 0; i2 < tokens.length; ) {
@@ -26927,7 +27099,7 @@ var deepFind = function(obj, path) {
26927
27099
  }
26928
27100
  return current;
26929
27101
  };
26930
- var getCleanedCode = (code) => code && code.replace("_", "-");
27102
+ var getCleanedCode = (code) => code?.replace("_", "-");
26931
27103
  var consoleLogger = {
26932
27104
  type: "logger",
26933
27105
  log(args) {
@@ -26940,7 +27112,7 @@ var consoleLogger = {
26940
27112
  this.output("error", args);
26941
27113
  },
26942
27114
  output(type, args) {
26943
- if (console && console[type]) console[type].apply(console, args);
27115
+ console?.[type]?.apply?.(console, args);
26944
27116
  }
26945
27117
  };
26946
27118
  var Logger = class _Logger {
@@ -27096,7 +27268,7 @@ var ResourceStore = class extends EventEmitter2 {
27096
27268
  key = path.slice(2).join(".");
27097
27269
  }
27098
27270
  if (result || !ignoreJSONStructure || !isString2(key)) return result;
27099
- return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
27271
+ return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
27100
27272
  }
27101
27273
  addResource(lng, ns, key, value2) {
27102
27274
  let options = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
@@ -27163,10 +27335,6 @@ var ResourceStore = class extends EventEmitter2 {
27163
27335
  }
27164
27336
  getResourceBundle(lng, ns) {
27165
27337
  if (!ns) ns = this.options.defaultNS;
27166
- if (this.options.compatibilityAPI === "v1") return {
27167
- ...{},
27168
- ...this.getResource(lng, ns)
27169
- };
27170
27338
  return this.getResource(lng, ns);
27171
27339
  }
27172
27340
  getDataByLanguage(lng) {
@@ -27188,7 +27356,7 @@ var postProcessor = {
27188
27356
  },
27189
27357
  handle(processors, value2, key, options, translator) {
27190
27358
  processors.forEach((processor) => {
27191
- if (this.processors[processor]) value2 = this.processors[processor].process(value2, key, options, translator);
27359
+ value2 = this.processors[processor]?.process(value2, key, options, translator) ?? value2;
27192
27360
  });
27193
27361
  return value2;
27194
27362
  }
@@ -27212,11 +27380,11 @@ var Translator = class _Translator extends EventEmitter2 {
27212
27380
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
27213
27381
  interpolation: {}
27214
27382
  };
27215
- if (key === void 0 || key === null) {
27383
+ if (key == null) {
27216
27384
  return false;
27217
27385
  }
27218
27386
  const resolved = this.resolve(key, options);
27219
- return resolved && resolved.res !== void 0;
27387
+ return resolved?.res !== void 0;
27220
27388
  }
27221
27389
  extractFromKey(key, options) {
27222
27390
  let nsSeparator = options.nsSeparator !== void 0 ? options.nsSeparator : this.options.nsSeparator;
@@ -27250,7 +27418,7 @@ var Translator = class _Translator extends EventEmitter2 {
27250
27418
  ...options
27251
27419
  };
27252
27420
  if (!options) options = {};
27253
- if (keys === void 0 || keys === null) return "";
27421
+ if (keys == null) return "";
27254
27422
  if (!Array.isArray(keys)) keys = [String(keys)];
27255
27423
  const returnDetails = options.returnDetails !== void 0 ? options.returnDetails : this.options.returnDetails;
27256
27424
  const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
@@ -27261,7 +27429,7 @@ var Translator = class _Translator extends EventEmitter2 {
27261
27429
  const namespace = namespaces[namespaces.length - 1];
27262
27430
  const lng = options.lng || this.language;
27263
27431
  const appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
27264
- if (lng && lng.toLowerCase() === "cimode") {
27432
+ if (lng?.toLowerCase() === "cimode") {
27265
27433
  if (appendNamespaceToCIMode) {
27266
27434
  const nsSeparator = options.nsSeparator || this.options.nsSeparator;
27267
27435
  if (returnDetails) {
@@ -27289,9 +27457,9 @@ var Translator = class _Translator extends EventEmitter2 {
27289
27457
  return key;
27290
27458
  }
27291
27459
  const resolved = this.resolve(keys, options);
27292
- let res = resolved && resolved.res;
27293
- const resUsedKey = resolved && resolved.usedKey || key;
27294
- const resExactUsedKey = resolved && resolved.exactUsedKey || key;
27460
+ let res = resolved?.res;
27461
+ const resUsedKey = resolved?.usedKey || key;
27462
+ const resExactUsedKey = resolved?.exactUsedKey || key;
27295
27463
  const resType = Object.prototype.toString.apply(res);
27296
27464
  const noObject = ["[object Number]", "[object Function]", "[object RegExp]"];
27297
27465
  const joinArrays = options.joinArrays !== void 0 ? options.joinArrays : this.options.joinArrays;
@@ -27344,7 +27512,7 @@ var Translator = class _Translator extends EventEmitter2 {
27344
27512
  const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
27345
27513
  ordinal: false
27346
27514
  }) : "";
27347
- const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();
27515
+ const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
27348
27516
  const defaultValue = needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] || options[`defaultValue${defaultValueSuffix}`] || options[`defaultValue${defaultValueSuffixOrdinalFallback}`] || options.defaultValue;
27349
27517
  if (!this.isValidLookup(res) && hasDefaultValue) {
27350
27518
  usedDefault = true;
@@ -27381,7 +27549,7 @@ var Translator = class _Translator extends EventEmitter2 {
27381
27549
  const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
27382
27550
  if (this.options.missingKeyHandler) {
27383
27551
  this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
27384
- } else if (this.backendConnector && this.backendConnector.saveMissing) {
27552
+ } else if (this.backendConnector?.saveMissing) {
27385
27553
  this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
27386
27554
  }
27387
27555
  this.emit("missingKey", l, namespace, k, res);
@@ -27405,11 +27573,7 @@ var Translator = class _Translator extends EventEmitter2 {
27405
27573
  res = this.extendTranslation(res, keys, options, resolved, lastKey);
27406
27574
  if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;
27407
27575
  if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
27408
- if (this.options.compatibilityAPI !== "v1") {
27409
- res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : void 0);
27410
- } else {
27411
- res = this.options.parseMissingKeyHandler(res);
27412
- }
27576
+ res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : void 0);
27413
27577
  }
27414
27578
  }
27415
27579
  if (returnDetails) {
@@ -27421,7 +27585,7 @@ var Translator = class _Translator extends EventEmitter2 {
27421
27585
  }
27422
27586
  extendTranslation(res, key, options, resolved, lastKey) {
27423
27587
  var _this = this;
27424
- if (this.i18nFormat && this.i18nFormat.parse) {
27588
+ if (this.i18nFormat?.parse) {
27425
27589
  res = this.i18nFormat.parse(res, {
27426
27590
  ...this.options.interpolation.defaultVariables,
27427
27591
  ...options
@@ -27438,7 +27602,7 @@ var Translator = class _Translator extends EventEmitter2 {
27438
27602
  }
27439
27603
  }
27440
27604
  });
27441
- const skipOnVariables = isString2(res) && (options && options.interpolation && options.interpolation.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
27605
+ const skipOnVariables = isString2(res) && (options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
27442
27606
  let nestBef;
27443
27607
  if (skipOnVariables) {
27444
27608
  const nb = res.match(this.interpolator.nestingRegexp);
@@ -27455,12 +27619,12 @@ var Translator = class _Translator extends EventEmitter2 {
27455
27619
  const nestAft = na && na.length;
27456
27620
  if (nestBef < nestAft) options.nest = false;
27457
27621
  }
27458
- if (!options.lng && this.options.compatibilityAPI !== "v1" && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
27622
+ if (!options.lng && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
27459
27623
  if (options.nest !== false) res = this.interpolator.nest(res, function() {
27460
27624
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27461
27625
  args[_key] = arguments[_key];
27462
27626
  }
27463
- if (lastKey && lastKey[0] === args[0] && !options.context) {
27627
+ if (lastKey?.[0] === args[0] && !options.context) {
27464
27628
  _this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
27465
27629
  return null;
27466
27630
  }
@@ -27470,7 +27634,7 @@ var Translator = class _Translator extends EventEmitter2 {
27470
27634
  }
27471
27635
  const postProcess = options.postProcess || this.options.postProcess;
27472
27636
  const postProcessorNames = isString2(postProcess) ? [postProcess] : postProcess;
27473
- if (res !== void 0 && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
27637
+ if (res != null && postProcessorNames?.length && options.applyPostProcessor !== false) {
27474
27638
  res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
27475
27639
  i18nResolved: {
27476
27640
  ...resolved,
@@ -27497,13 +27661,13 @@ var Translator = class _Translator extends EventEmitter2 {
27497
27661
  let namespaces = extracted.namespaces;
27498
27662
  if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
27499
27663
  const needsPluralHandling = options.count !== void 0 && !isString2(options.count);
27500
- const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();
27664
+ const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
27501
27665
  const needsContextHandling = options.context !== void 0 && (isString2(options.context) || typeof options.context === "number") && options.context !== "";
27502
27666
  const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
27503
27667
  namespaces.forEach((ns) => {
27504
27668
  if (this.isValidLookup(found)) return;
27505
27669
  usedNS = ns;
27506
- if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(usedNS)) {
27670
+ if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
27507
27671
  checkedLoadedFor[`${codes[0]}-${ns}`] = true;
27508
27672
  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!!!");
27509
27673
  }
@@ -27511,7 +27675,7 @@ var Translator = class _Translator extends EventEmitter2 {
27511
27675
  if (this.isValidLookup(found)) return;
27512
27676
  usedLng = code;
27513
27677
  const finalKeys = [key];
27514
- if (this.i18nFormat && this.i18nFormat.addLookupKeys) {
27678
+ if (this.i18nFormat?.addLookupKeys) {
27515
27679
  this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
27516
27680
  } else {
27517
27681
  let pluralSuffix;
@@ -27564,7 +27728,7 @@ var Translator = class _Translator extends EventEmitter2 {
27564
27728
  }
27565
27729
  getResource(code, ns, key) {
27566
27730
  let options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
27567
- if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);
27731
+ if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
27568
27732
  return this.resourceStore.getResource(code, ns, key, options);
27569
27733
  }
27570
27734
  getUsedParamsDetails() {
@@ -27601,7 +27765,6 @@ var Translator = class _Translator extends EventEmitter2 {
27601
27765
  return false;
27602
27766
  }
27603
27767
  };
27604
- var capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
27605
27768
  var LanguageUtil = class {
27606
27769
  constructor(options) {
27607
27770
  this.options = options;
@@ -27625,32 +27788,19 @@ var LanguageUtil = class {
27625
27788
  }
27626
27789
  formatLanguageCode(code) {
27627
27790
  if (isString2(code) && code.indexOf("-") > -1) {
27628
- if (typeof Intl !== "undefined" && typeof Intl.getCanonicalLocales !== "undefined") {
27629
- try {
27630
- let formattedCode = Intl.getCanonicalLocales(code)[0];
27631
- if (formattedCode && this.options.lowerCaseLng) {
27632
- formattedCode = formattedCode.toLowerCase();
27633
- }
27634
- if (formattedCode) return formattedCode;
27635
- } catch (e2) {
27636
- }
27791
+ let formattedCode;
27792
+ try {
27793
+ formattedCode = Intl.getCanonicalLocales(code)[0];
27794
+ } catch (e2) {
27795
+ }
27796
+ if (formattedCode && this.options.lowerCaseLng) {
27797
+ formattedCode = formattedCode.toLowerCase();
27637
27798
  }
27638
- const specialCases = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
27639
- let p = code.split("-");
27799
+ if (formattedCode) return formattedCode;
27640
27800
  if (this.options.lowerCaseLng) {
27641
- p = p.map((part) => part.toLowerCase());
27642
- } else if (p.length === 2) {
27643
- p[0] = p[0].toLowerCase();
27644
- p[1] = p[1].toUpperCase();
27645
- if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
27646
- } else if (p.length === 3) {
27647
- p[0] = p[0].toLowerCase();
27648
- if (p[1].length === 2) p[1] = p[1].toUpperCase();
27649
- if (p[0] !== "sgn" && p[2].length === 2) p[2] = p[2].toUpperCase();
27650
- if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
27651
- if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
27652
- }
27653
- return p.join("-");
27801
+ return code.toLowerCase();
27802
+ }
27803
+ return code;
27654
27804
  }
27655
27805
  return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
27656
27806
  }
@@ -27721,125 +27871,6 @@ var LanguageUtil = class {
27721
27871
  return codes;
27722
27872
  }
27723
27873
  };
27724
- var sets = [{
27725
- lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
27726
- nr: [1, 2],
27727
- fc: 1
27728
- }, {
27729
- lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
27730
- nr: [1, 2],
27731
- fc: 2
27732
- }, {
27733
- lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
27734
- nr: [1],
27735
- fc: 3
27736
- }, {
27737
- lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
27738
- nr: [1, 2, 5],
27739
- fc: 4
27740
- }, {
27741
- lngs: ["ar"],
27742
- nr: [0, 1, 2, 3, 11, 100],
27743
- fc: 5
27744
- }, {
27745
- lngs: ["cs", "sk"],
27746
- nr: [1, 2, 5],
27747
- fc: 6
27748
- }, {
27749
- lngs: ["csb", "pl"],
27750
- nr: [1, 2, 5],
27751
- fc: 7
27752
- }, {
27753
- lngs: ["cy"],
27754
- nr: [1, 2, 3, 8],
27755
- fc: 8
27756
- }, {
27757
- lngs: ["fr"],
27758
- nr: [1, 2],
27759
- fc: 9
27760
- }, {
27761
- lngs: ["ga"],
27762
- nr: [1, 2, 3, 7, 11],
27763
- fc: 10
27764
- }, {
27765
- lngs: ["gd"],
27766
- nr: [1, 2, 3, 20],
27767
- fc: 11
27768
- }, {
27769
- lngs: ["is"],
27770
- nr: [1, 2],
27771
- fc: 12
27772
- }, {
27773
- lngs: ["jv"],
27774
- nr: [0, 1],
27775
- fc: 13
27776
- }, {
27777
- lngs: ["kw"],
27778
- nr: [1, 2, 3, 4],
27779
- fc: 14
27780
- }, {
27781
- lngs: ["lt"],
27782
- nr: [1, 2, 10],
27783
- fc: 15
27784
- }, {
27785
- lngs: ["lv"],
27786
- nr: [1, 2, 0],
27787
- fc: 16
27788
- }, {
27789
- lngs: ["mk"],
27790
- nr: [1, 2],
27791
- fc: 17
27792
- }, {
27793
- lngs: ["mnk"],
27794
- nr: [0, 1, 2],
27795
- fc: 18
27796
- }, {
27797
- lngs: ["mt"],
27798
- nr: [1, 2, 11, 20],
27799
- fc: 19
27800
- }, {
27801
- lngs: ["or"],
27802
- nr: [2, 1],
27803
- fc: 2
27804
- }, {
27805
- lngs: ["ro"],
27806
- nr: [1, 2, 20],
27807
- fc: 20
27808
- }, {
27809
- lngs: ["sl"],
27810
- nr: [5, 1, 2, 3],
27811
- fc: 21
27812
- }, {
27813
- lngs: ["he", "iw"],
27814
- nr: [1, 2, 20, 21],
27815
- fc: 22
27816
- }];
27817
- var _rulesPluralsTypes = {
27818
- 1: (n2) => Number(n2 > 1),
27819
- 2: (n2) => Number(n2 != 1),
27820
- 3: (n2) => 0,
27821
- 4: (n2) => Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2),
27822
- 5: (n2) => Number(n2 == 0 ? 0 : n2 == 1 ? 1 : n2 == 2 ? 2 : n2 % 100 >= 3 && n2 % 100 <= 10 ? 3 : n2 % 100 >= 11 ? 4 : 5),
27823
- 6: (n2) => Number(n2 == 1 ? 0 : n2 >= 2 && n2 <= 4 ? 1 : 2),
27824
- 7: (n2) => Number(n2 == 1 ? 0 : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2),
27825
- 8: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 != 8 && n2 != 11 ? 2 : 3),
27826
- 9: (n2) => Number(n2 >= 2),
27827
- 10: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 < 7 ? 2 : n2 < 11 ? 3 : 4),
27828
- 11: (n2) => Number(n2 == 1 || n2 == 11 ? 0 : n2 == 2 || n2 == 12 ? 1 : n2 > 2 && n2 < 20 ? 2 : 3),
27829
- 12: (n2) => Number(n2 % 10 != 1 || n2 % 100 == 11),
27830
- 13: (n2) => Number(n2 !== 0),
27831
- 14: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 == 3 ? 2 : 3),
27832
- 15: (n2) => Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 % 10 >= 2 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2),
27833
- 16: (n2) => Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 !== 0 ? 1 : 2),
27834
- 17: (n2) => Number(n2 == 1 || n2 % 10 == 1 && n2 % 100 != 11 ? 0 : 1),
27835
- 18: (n2) => Number(n2 == 0 ? 0 : n2 == 1 ? 1 : 2),
27836
- 19: (n2) => Number(n2 == 1 ? 0 : n2 == 0 || n2 % 100 > 1 && n2 % 100 < 11 ? 1 : n2 % 100 > 10 && n2 % 100 < 20 ? 2 : 3),
27837
- 20: (n2) => Number(n2 == 1 ? 0 : n2 == 0 || n2 % 100 > 0 && n2 % 100 < 20 ? 1 : 2),
27838
- 21: (n2) => Number(n2 % 100 == 1 ? 1 : n2 % 100 == 2 ? 2 : n2 % 100 == 3 || n2 % 100 == 4 ? 3 : 0),
27839
- 22: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : (n2 < 0 || n2 > 10) && n2 % 10 == 0 ? 2 : 3)
27840
- };
27841
- var nonIntlVersions = ["v1", "v2", "v3"];
27842
- var intlVersions = ["v4"];
27843
27874
  var suffixesOrder = {
27844
27875
  zero: 0,
27845
27876
  one: 1,
@@ -27848,17 +27879,11 @@ var suffixesOrder = {
27848
27879
  many: 4,
27849
27880
  other: 5
27850
27881
  };
27851
- var createRules = () => {
27852
- const rules = {};
27853
- sets.forEach((set) => {
27854
- set.lngs.forEach((l) => {
27855
- rules[l] = {
27856
- numbers: set.nr,
27857
- plurals: _rulesPluralsTypes[set.fc]
27858
- };
27859
- });
27860
- });
27861
- return rules;
27882
+ var dummyRule = {
27883
+ select: (count) => count === 1 ? "one" : "other",
27884
+ resolvedOptions: () => ({
27885
+ pluralCategories: ["one", "other"]
27886
+ })
27862
27887
  };
27863
27888
  var PluralResolver = class {
27864
27889
  constructor(languageUtils) {
@@ -27866,11 +27891,6 @@ var PluralResolver = class {
27866
27891
  this.languageUtils = languageUtils;
27867
27892
  this.options = options;
27868
27893
  this.logger = baseLogger.create("pluralResolver");
27869
- if ((!this.options.compatibilityJSON || intlVersions.includes(this.options.compatibilityJSON)) && (typeof Intl === "undefined" || !Intl.PluralRules)) {
27870
- this.options.compatibilityJSON = "v3";
27871
- this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.");
27872
- }
27873
- this.rules = createRules();
27874
27894
  this.pluralRulesCache = {};
27875
27895
  }
27876
27896
  addRule(lng, obj) {
@@ -27881,38 +27901,37 @@ var PluralResolver = class {
27881
27901
  }
27882
27902
  getRule(code) {
27883
27903
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27884
- if (this.shouldUseIntlApi()) {
27885
- const cleanedCode = getCleanedCode(code === "dev" ? "en" : code);
27886
- const type = options.ordinal ? "ordinal" : "cardinal";
27887
- const cacheKey = JSON.stringify({
27888
- cleanedCode,
27904
+ const cleanedCode = getCleanedCode(code === "dev" ? "en" : code);
27905
+ const type = options.ordinal ? "ordinal" : "cardinal";
27906
+ const cacheKey = JSON.stringify({
27907
+ cleanedCode,
27908
+ type
27909
+ });
27910
+ if (cacheKey in this.pluralRulesCache) {
27911
+ return this.pluralRulesCache[cacheKey];
27912
+ }
27913
+ let rule;
27914
+ try {
27915
+ rule = new Intl.PluralRules(cleanedCode, {
27889
27916
  type
27890
27917
  });
27891
- if (cacheKey in this.pluralRulesCache) {
27892
- return this.pluralRulesCache[cacheKey];
27893
- }
27894
- let rule;
27895
- try {
27896
- rule = new Intl.PluralRules(cleanedCode, {
27897
- type
27898
- });
27899
- } catch (err) {
27900
- if (!code.match(/-|_/)) return;
27901
- const lngPart = this.languageUtils.getLanguagePartFromCode(code);
27902
- rule = this.getRule(lngPart, options);
27918
+ } catch (err) {
27919
+ if (!Intl) {
27920
+ this.logger.error("No Intl support, please use an Intl polyfill!");
27921
+ return dummyRule;
27903
27922
  }
27904
- this.pluralRulesCache[cacheKey] = rule;
27905
- return rule;
27923
+ if (!code.match(/-|_/)) return dummyRule;
27924
+ const lngPart = this.languageUtils.getLanguagePartFromCode(code);
27925
+ rule = this.getRule(lngPart, options);
27906
27926
  }
27907
- return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
27927
+ this.pluralRulesCache[cacheKey] = rule;
27928
+ return rule;
27908
27929
  }
27909
27930
  needsPlural(code) {
27910
27931
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27911
- const rule = this.getRule(code, options);
27912
- if (this.shouldUseIntlApi()) {
27913
- return rule && rule.resolvedOptions().pluralCategories.length > 1;
27914
- }
27915
- return rule && rule.numbers.length > 1;
27932
+ let rule = this.getRule(code, options);
27933
+ if (!rule) rule = this.getRule("dev", options);
27934
+ return rule?.resolvedOptions().pluralCategories.length > 1;
27916
27935
  }
27917
27936
  getPluralFormsOfKey(code, key) {
27918
27937
  let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
@@ -27920,51 +27939,19 @@ var PluralResolver = class {
27920
27939
  }
27921
27940
  getSuffixes(code) {
27922
27941
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27923
- const rule = this.getRule(code, options);
27924
- if (!rule) {
27925
- return [];
27926
- }
27927
- if (this.shouldUseIntlApi()) {
27928
- return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`);
27929
- }
27930
- return rule.numbers.map((number) => this.getSuffix(code, number, options));
27942
+ let rule = this.getRule(code, options);
27943
+ if (!rule) rule = this.getRule("dev", options);
27944
+ if (!rule) return [];
27945
+ return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`);
27931
27946
  }
27932
27947
  getSuffix(code, count) {
27933
27948
  let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
27934
27949
  const rule = this.getRule(code, options);
27935
27950
  if (rule) {
27936
- if (this.shouldUseIntlApi()) {
27937
- return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count)}`;
27938
- }
27939
- return this.getSuffixRetroCompatible(rule, count);
27951
+ return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count)}`;
27940
27952
  }
27941
27953
  this.logger.warn(`no plural rule found for: ${code}`);
27942
- return "";
27943
- }
27944
- getSuffixRetroCompatible(rule, count) {
27945
- const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
27946
- let suffix = rule.numbers[idx];
27947
- if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
27948
- if (suffix === 2) {
27949
- suffix = "plural";
27950
- } else if (suffix === 1) {
27951
- suffix = "";
27952
- }
27953
- }
27954
- const returnSuffix = () => this.options.prepend && suffix.toString() ? this.options.prepend + suffix.toString() : suffix.toString();
27955
- if (this.options.compatibilityJSON === "v1") {
27956
- if (suffix === 1) return "";
27957
- if (typeof suffix === "number") return `_plural_${suffix.toString()}`;
27958
- return returnSuffix();
27959
- } else if (this.options.compatibilityJSON === "v2") {
27960
- return returnSuffix();
27961
- } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
27962
- return returnSuffix();
27963
- }
27964
- return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
27965
- }
27966
- shouldUseIntlApi() {
27967
- return !nonIntlVersions.includes(this.options.compatibilityJSON);
27954
+ return this.getSuffix("dev", count, options);
27968
27955
  }
27969
27956
  };
27970
27957
  var deepFindWithDefaults = function(data, defaultData, key) {
@@ -27983,7 +27970,7 @@ var Interpolator = class {
27983
27970
  let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
27984
27971
  this.logger = baseLogger.create("interpolator");
27985
27972
  this.options = options;
27986
- this.format = options.interpolation && options.interpolation.format || ((value2) => value2);
27973
+ this.format = options?.interpolation?.format || ((value2) => value2);
27987
27974
  this.init(options);
27988
27975
  }
27989
27976
  init() {
@@ -28030,7 +28017,7 @@ var Interpolator = class {
28030
28017
  }
28031
28018
  resetRegExp() {
28032
28019
  const getOrResetRegExp = (existingRegExp, pattern) => {
28033
- if (existingRegExp && existingRegExp.source === pattern) {
28020
+ if (existingRegExp?.source === pattern) {
28034
28021
  existingRegExp.lastIndex = 0;
28035
28022
  return existingRegExp;
28036
28023
  }
@@ -28064,8 +28051,8 @@ var Interpolator = class {
28064
28051
  });
28065
28052
  };
28066
28053
  this.resetRegExp();
28067
- const missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
28068
- const skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
28054
+ const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
28055
+ const skipOnVariables = options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
28069
28056
  const todos = [{
28070
28057
  regex: this.regexpUnescape,
28071
28058
  safeValue: (val) => regexSafe(val)
@@ -28124,7 +28111,7 @@ var Interpolator = class {
28124
28111
  optionsString = this.interpolate(optionsString, clonedOptions);
28125
28112
  const matchedSingleQuotes = optionsString.match(/'/g);
28126
28113
  const matchedDoubleQuotes = optionsString.match(/"/g);
28127
- if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
28114
+ if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
28128
28115
  optionsString = optionsString.replace(/'/g, '"');
28129
28116
  }
28130
28117
  try {
@@ -28291,7 +28278,7 @@ var Formatter = class {
28291
28278
  if (this.formats[formatName]) {
28292
28279
  let formatted = mem;
28293
28280
  try {
28294
- const valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
28281
+ const valOptions = options?.formatParams?.[options.interpolationkey] || {};
28295
28282
  const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
28296
28283
  formatted = this.formats[formatName](mem, l, {
28297
28284
  ...formatOptions,
@@ -28333,9 +28320,7 @@ var Connector = class extends EventEmitter2 {
28333
28320
  this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
28334
28321
  this.state = {};
28335
28322
  this.queue = [];
28336
- if (this.backend && this.backend.init) {
28337
- this.backend.init(services, options.backend, options);
28338
- }
28323
+ this.backend?.init?.(services, options.backend, options);
28339
28324
  }
28340
28325
  queueLoad(languages, namespaces, options, callback) {
28341
28326
  const toLoad = {};
@@ -28503,12 +28488,12 @@ var Connector = class extends EventEmitter2 {
28503
28488
  let options = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
28504
28489
  let clb = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
28505
28490
  };
28506
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
28491
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
28507
28492
  this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" 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!!!");
28508
28493
  return;
28509
28494
  }
28510
28495
  if (key === void 0 || key === null || key === "") return;
28511
- if (this.backend && this.backend.create) {
28496
+ if (this.backend?.create) {
28512
28497
  const opts = {
28513
28498
  ...options,
28514
28499
  isUpdate
@@ -28540,7 +28525,7 @@ var Connector = class extends EventEmitter2 {
28540
28525
  };
28541
28526
  var get = () => ({
28542
28527
  debug: false,
28543
- initImmediate: true,
28528
+ initAsync: true,
28544
28529
  ns: ["translation"],
28545
28530
  defaultNS: ["translation"],
28546
28531
  fallbackLng: ["dev"],
@@ -28602,9 +28587,10 @@ var transformOptions = (options) => {
28602
28587
  if (isString2(options.ns)) options.ns = [options.ns];
28603
28588
  if (isString2(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
28604
28589
  if (isString2(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
28605
- if (options.supportedLngs && options.supportedLngs.indexOf("cimode") < 0) {
28590
+ if (options.supportedLngs?.indexOf?.("cimode") < 0) {
28606
28591
  options.supportedLngs = options.supportedLngs.concat(["cimode"]);
28607
28592
  }
28593
+ if (typeof options.initImmediate === "boolean") options.initAsync = options.initImmediate;
28608
28594
  return options;
28609
28595
  };
28610
28596
  var noop4 = () => {
@@ -28630,7 +28616,7 @@ var I18n = class _I18n extends EventEmitter2 {
28630
28616
  };
28631
28617
  bindMemberFunctions(this);
28632
28618
  if (callback && !this.isInitialized && !options.isClone) {
28633
- if (!this.options.initImmediate) {
28619
+ if (!this.options.initAsync) {
28634
28620
  this.init(options, callback);
28635
28621
  return this;
28636
28622
  }
@@ -28648,7 +28634,7 @@ var I18n = class _I18n extends EventEmitter2 {
28648
28634
  callback = options;
28649
28635
  options = {};
28650
28636
  }
28651
- if (!options.defaultNS && options.defaultNS !== false && options.ns) {
28637
+ if (options.defaultNS == null && options.ns) {
28652
28638
  if (isString2(options.ns)) {
28653
28639
  options.defaultNS = options.ns;
28654
28640
  } else if (options.ns.indexOf("translation") < 0) {
@@ -28661,12 +28647,10 @@ var I18n = class _I18n extends EventEmitter2 {
28661
28647
  ...this.options,
28662
28648
  ...transformOptions(options)
28663
28649
  };
28664
- if (this.options.compatibilityAPI !== "v1") {
28665
- this.options.interpolation = {
28666
- ...defOpts.interpolation,
28667
- ...this.options.interpolation
28668
- };
28669
- }
28650
+ this.options.interpolation = {
28651
+ ...defOpts.interpolation,
28652
+ ...this.options.interpolation
28653
+ };
28670
28654
  if (options.keySeparator !== void 0) {
28671
28655
  this.options.userDefinedKeySeparator = options.keySeparator;
28672
28656
  }
@@ -28687,7 +28671,7 @@ var I18n = class _I18n extends EventEmitter2 {
28687
28671
  let formatter;
28688
28672
  if (this.modules.formatter) {
28689
28673
  formatter = this.modules.formatter;
28690
- } else if (typeof Intl !== "undefined") {
28674
+ } else {
28691
28675
  formatter = Formatter;
28692
28676
  }
28693
28677
  const lu = new LanguageUtil(this.options);
@@ -28698,7 +28682,6 @@ var I18n = class _I18n extends EventEmitter2 {
28698
28682
  s2.languageUtils = lu;
28699
28683
  s2.pluralResolver = new PluralResolver(lu, {
28700
28684
  prepend: this.options.pluralSeparator,
28701
- compatibilityJSON: this.options.compatibilityJSON,
28702
28685
  simplifyPluralSuffix: this.options.simplifyPluralSuffix
28703
28686
  });
28704
28687
  if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
@@ -28769,10 +28752,10 @@ var I18n = class _I18n extends EventEmitter2 {
28769
28752
  deferred.resolve(t3);
28770
28753
  callback(err, t3);
28771
28754
  };
28772
- if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return finish(null, this.t.bind(this));
28755
+ if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
28773
28756
  this.changeLanguage(this.options.lng, finish);
28774
28757
  };
28775
- if (this.options.resources || !this.options.initImmediate) {
28758
+ if (this.options.resources || !this.options.initAsync) {
28776
28759
  load();
28777
28760
  } else {
28778
28761
  setTimeout(load, 0);
@@ -28785,7 +28768,7 @@ var I18n = class _I18n extends EventEmitter2 {
28785
28768
  const usedLng = isString2(language) ? language : this.language;
28786
28769
  if (typeof language === "function") usedCallback = language;
28787
28770
  if (!this.options.resources || this.options.partialBundledLanguages) {
28788
- if (usedLng && usedLng.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
28771
+ if (usedLng?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
28789
28772
  const toLoad = [];
28790
28773
  const append = (lng) => {
28791
28774
  if (!lng) return;
@@ -28802,9 +28785,7 @@ var I18n = class _I18n extends EventEmitter2 {
28802
28785
  } else {
28803
28786
  append(usedLng);
28804
28787
  }
28805
- if (this.options.preload) {
28806
- this.options.preload.forEach((l) => append(l));
28807
- }
28788
+ this.options.preload?.forEach?.((l) => append(l));
28808
28789
  this.services.backendConnector.load(toLoad, this.options.ns, (e2) => {
28809
28790
  if (!e2 && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
28810
28791
  usedCallback(e2);
@@ -28906,7 +28887,7 @@ var I18n = class _I18n extends EventEmitter2 {
28906
28887
  setLngProps(l);
28907
28888
  }
28908
28889
  if (!this.translator.language) this.translator.changeLanguage(l);
28909
- if (this.services.languageDetector && this.services.languageDetector.cacheUserLanguage) this.services.languageDetector.cacheUserLanguage(l);
28890
+ this.services.languageDetector?.cacheUserLanguage?.(l);
28910
28891
  }
28911
28892
  this.loadResources(l, (err) => {
28912
28893
  done(err, l);
@@ -28962,10 +28943,16 @@ var I18n = class _I18n extends EventEmitter2 {
28962
28943
  return fixedT;
28963
28944
  }
28964
28945
  t() {
28965
- return this.translator && this.translator.translate(...arguments);
28946
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
28947
+ args[_key4] = arguments[_key4];
28948
+ }
28949
+ return this.translator?.translate(...args);
28966
28950
  }
28967
28951
  exists() {
28968
- return this.translator && this.translator.exists(...arguments);
28952
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
28953
+ args[_key5] = arguments[_key5];
28954
+ }
28955
+ return this.translator?.exists(...args);
28969
28956
  }
28970
28957
  setDefaultNamespace(ns) {
28971
28958
  this.options.defaultNS = ns;
@@ -29030,10 +29017,10 @@ var I18n = class _I18n extends EventEmitter2 {
29030
29017
  return deferred;
29031
29018
  }
29032
29019
  dir(lng) {
29033
- if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
29020
+ if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
29034
29021
  if (!lng) return "rtl";
29035
29022
  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"];
29036
- const languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());
29023
+ const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
29037
29024
  return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
29038
29025
  }
29039
29026
  static createInstance() {
@@ -29068,13 +29055,24 @@ var I18n = class _I18n extends EventEmitter2 {
29068
29055
  hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
29069
29056
  };
29070
29057
  if (forkResourceStore) {
29071
- clone.store = new ResourceStore(this.store.data, mergedOptions);
29058
+ const clonedData = Object.keys(this.store.data).reduce((prev, l) => {
29059
+ prev[l] = {
29060
+ ...this.store.data[l]
29061
+ };
29062
+ return Object.keys(prev[l]).reduce((acc, n2) => {
29063
+ acc[n2] = {
29064
+ ...prev[l][n2]
29065
+ };
29066
+ return acc;
29067
+ }, {});
29068
+ }, {});
29069
+ clone.store = new ResourceStore(clonedData, mergedOptions);
29072
29070
  clone.services.resourceStore = clone.store;
29073
29071
  }
29074
29072
  clone.translator = new Translator(clone.services, mergedOptions);
29075
29073
  clone.translator.on("*", function(event) {
29076
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
29077
- args[_key4 - 1] = arguments[_key4];
29074
+ for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
29075
+ args[_key6 - 1] = arguments[_key6];
29078
29076
  }
29079
29077
  clone.emit(event, ...args);
29080
29078
  });
@@ -29246,4 +29244,4 @@ react-reconciler/cjs/react-reconciler-constants.production.min.js:
29246
29244
  * LICENSE file in the root directory of this source tree.
29247
29245
  *)
29248
29246
  */
29249
- //# sourceMappingURL=chunk-2ROHQF53.js.map
29247
+ //# sourceMappingURL=chunk-36W5H7IG.js.map