lingo.dev 0.111.4 → 0.111.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/cli/index.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6;// src/cli/index.ts
2
2
  var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);
3
3
  var _interactivecommander = require('interactive-commander');
4
4
  var _figlet = require('figlet'); var _figlet2 = _interopRequireDefault(_figlet);
@@ -214,15 +214,147 @@ var docLinks = {
214
214
  invalidBucketType: "https://lingo.dev/cli",
215
215
  invalidStringDict: "https://lingo.dev/cli"
216
216
  };
217
- var CLIError = class extends Error {
217
+ var CLIError = (_class = class extends Error {
218
218
 
219
+ __init() {this.errorType = "cli_error"}
219
220
  constructor({ message, docUrl }) {
220
- super(message);
221
+ super(message);_class.prototype.__init.call(this);;
221
222
  this.docUrl = docLinks[docUrl];
222
223
  this.message = `${this.message}
223
224
  visit: ${this.docUrl}`;
224
225
  }
225
- };
226
+ }, _class);
227
+ var ConfigError = (_class2 = class extends CLIError {
228
+ __init2() {this.errorType = "config_error"}
229
+ constructor({ message, docUrl }) {
230
+ super({ message, docUrl });_class2.prototype.__init2.call(this);;
231
+ this.name = "ConfigError";
232
+ }
233
+ }, _class2);
234
+ var AuthenticationError = (_class3 = class extends CLIError {
235
+ __init3() {this.errorType = "auth_error"}
236
+ constructor({ message, docUrl }) {
237
+ super({ message, docUrl });_class3.prototype.__init3.call(this);;
238
+ this.name = "AuthenticationError";
239
+ }
240
+ }, _class3);
241
+ var ValidationError = (_class4 = class extends CLIError {
242
+ __init4() {this.errorType = "validation_error"}
243
+ constructor({ message, docUrl }) {
244
+ super({ message, docUrl });_class4.prototype.__init4.call(this);;
245
+ this.name = "ValidationError";
246
+ }
247
+ }, _class4);
248
+ var LocalizationError = (_class5 = class extends Error {
249
+ __init5() {this.errorType = "locale_error"}
250
+
251
+
252
+
253
+
254
+ constructor(message, context) {
255
+ super(message);_class5.prototype.__init5.call(this);;
256
+ this.name = "LocalizationError";
257
+ this.bucket = _optionalChain([context, 'optionalAccess', _68 => _68.bucket]);
258
+ this.sourceLocale = _optionalChain([context, 'optionalAccess', _69 => _69.sourceLocale]);
259
+ this.targetLocale = _optionalChain([context, 'optionalAccess', _70 => _70.targetLocale]);
260
+ this.pathPattern = _optionalChain([context, 'optionalAccess', _71 => _71.pathPattern]);
261
+ }
262
+ }, _class5);
263
+ var BucketProcessingError = (_class6 = class extends Error {
264
+ __init6() {this.errorType = "bucket_error"}
265
+
266
+ constructor(message, bucket) {
267
+ super(message);_class6.prototype.__init6.call(this);;
268
+ this.name = "BucketProcessingError";
269
+ this.bucket = bucket;
270
+ }
271
+ }, _class6);
272
+ function isConfigError(error) {
273
+ return error instanceof ConfigError || error.errorType === "config_error";
274
+ }
275
+ function isAuthenticationError(error) {
276
+ return error instanceof AuthenticationError || error.errorType === "auth_error";
277
+ }
278
+ function isValidationError(error) {
279
+ return error instanceof ValidationError || error.errorType === "validation_error";
280
+ }
281
+ function isLocalizationError(error) {
282
+ return error instanceof LocalizationError || error.errorType === "locale_error";
283
+ }
284
+ function isBucketProcessingError(error) {
285
+ return error instanceof BucketProcessingError || error.errorType === "bucket_error";
286
+ }
287
+ function getCLIErrorType(error) {
288
+ if (isConfigError(error)) return "config_error";
289
+ if (isAuthenticationError(error)) return "auth_error";
290
+ if (isValidationError(error)) return "validation_error";
291
+ if (isLocalizationError(error)) return "locale_error";
292
+ if (isBucketProcessingError(error)) return "bucket_error";
293
+ if (error instanceof CLIError) return "cli_error";
294
+ return "unknown_error";
295
+ }
296
+ function createPreviousErrorContext(errorDetails) {
297
+ if (errorDetails.length === 0) return void 0;
298
+ return {
299
+ count: errorDetails.length,
300
+ types: [...new Set(errorDetails.map((e) => e.type))],
301
+ buckets: [...new Set(errorDetails.map((e) => e.bucket).filter(Boolean))]
302
+ };
303
+ }
304
+ function aggregateErrorAnalytics(errorDetails, buckets, targetLocales, i18nConfig) {
305
+ if (errorDetails.length === 0) {
306
+ return {
307
+ errorCount: 0,
308
+ errorTypes: [],
309
+ errorsByBucket: {},
310
+ errorsByType: {},
311
+ firstError: void 0,
312
+ bucketCount: buckets.length,
313
+ localeCount: targetLocales.length,
314
+ i18nConfig: {
315
+ sourceLocale: i18nConfig.locale.source,
316
+ targetLocales: i18nConfig.locale.targets,
317
+ bucketTypes: Object.keys(i18nConfig.buckets)
318
+ }
319
+ };
320
+ }
321
+ const errorsByBucket = errorDetails.reduce(
322
+ (acc, error) => {
323
+ if (error.bucket) {
324
+ acc[error.bucket] = (acc[error.bucket] || 0) + 1;
325
+ }
326
+ return acc;
327
+ },
328
+ {}
329
+ );
330
+ const errorsByType = errorDetails.reduce(
331
+ (acc, error) => {
332
+ acc[error.type] = (acc[error.type] || 0) + 1;
333
+ return acc;
334
+ },
335
+ {}
336
+ );
337
+ return {
338
+ errorCount: errorDetails.length,
339
+ errorTypes: [...new Set(errorDetails.map((e) => e.type))],
340
+ errorsByBucket,
341
+ errorsByType,
342
+ firstError: {
343
+ type: errorDetails[0].type,
344
+ bucket: errorDetails[0].bucket,
345
+ locale: errorDetails[0].locale,
346
+ pathPattern: errorDetails[0].pathPattern,
347
+ message: errorDetails[0].message
348
+ },
349
+ bucketCount: buckets.length,
350
+ localeCount: targetLocales.length,
351
+ i18nConfig: {
352
+ sourceLocale: i18nConfig.locale.source,
353
+ targetLocales: i18nConfig.locale.targets,
354
+ bucketTypes: Object.keys(i18nConfig.buckets)
355
+ }
356
+ };
357
+ }
226
358
 
227
359
  // src/cli/utils/cloudflare-status.ts
228
360
  async function checkCloudflareStatus() {
@@ -261,7 +393,7 @@ function createAuthenticator(params) {
261
393
  });
262
394
  if (res.ok) {
263
395
  const payload = await res.json();
264
- if (!_optionalChain([payload, 'optionalAccess', _68 => _68.email])) {
396
+ if (!_optionalChain([payload, 'optionalAccess', _72 => _72.email])) {
265
397
  return null;
266
398
  }
267
399
  return {
@@ -1088,7 +1220,7 @@ var init_default = new (0, _interactivecommander.InteractiveCommand)().command("
1088
1220
  });
1089
1221
  const auth2 = await newAuthenticator.whoami();
1090
1222
  if (auth2) {
1091
- _ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _69 => _69.email])}`);
1223
+ _ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _73 => _73.email])}`);
1092
1224
  } else {
1093
1225
  _ora2.default.call(void 0, ).fail("Authentication failed.");
1094
1226
  }
@@ -1175,7 +1307,7 @@ function getBuckets(i18nConfig) {
1175
1307
  const includeItems = bucketEntry.include.map(
1176
1308
  (item) => resolveBucketItem(item)
1177
1309
  );
1178
- const excludeItems = _optionalChain([bucketEntry, 'access', _70 => _70.exclude, 'optionalAccess', _71 => _71.map, 'call', _72 => _72(
1310
+ const excludeItems = _optionalChain([bucketEntry, 'access', _74 => _74.exclude, 'optionalAccess', _75 => _75.map, 'call', _76 => _76(
1179
1311
  (item) => resolveBucketItem(item)
1180
1312
  )]);
1181
1313
  const config = {
@@ -1213,7 +1345,7 @@ function extractPathPatterns(sourceLocale, include, exclude) {
1213
1345
  delimiter: pattern.delimiter
1214
1346
  }))
1215
1347
  );
1216
- const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _73 => _73.flatMap, 'call', _74 => _74(
1348
+ const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _77 => _77.flatMap, 'call', _78 => _78(
1217
1349
  (pattern) => expandPlaceholderedGlob(
1218
1350
  pattern.path,
1219
1351
  __spec.resolveOverriddenLocale.call(void 0, sourceLocale, pattern.delimiter)
@@ -1503,12 +1635,12 @@ function composeLoaders(...loaders) {
1503
1635
  return {
1504
1636
  init: async () => {
1505
1637
  for (const loader of loaders) {
1506
- await _optionalChain([loader, 'access', _75 => _75.init, 'optionalCall', _76 => _76()]);
1638
+ await _optionalChain([loader, 'access', _79 => _79.init, 'optionalCall', _80 => _80()]);
1507
1639
  }
1508
1640
  },
1509
1641
  setDefaultLocale(locale) {
1510
1642
  for (const loader of loaders) {
1511
- _optionalChain([loader, 'access', _77 => _77.setDefaultLocale, 'optionalCall', _78 => _78(locale)]);
1643
+ _optionalChain([loader, 'access', _81 => _81.setDefaultLocale, 'optionalCall', _82 => _82(locale)]);
1512
1644
  }
1513
1645
  return this;
1514
1646
  },
@@ -1529,7 +1661,7 @@ function composeLoaders(...loaders) {
1529
1661
  pullHints: async (originalInput) => {
1530
1662
  let result = originalInput;
1531
1663
  for (let i = 0; i < loaders.length; i++) {
1532
- const subResult = await _optionalChain([loaders, 'access', _79 => _79[i], 'access', _80 => _80.pullHints, 'optionalCall', _81 => _81(result)]);
1664
+ const subResult = await _optionalChain([loaders, 'access', _83 => _83[i], 'access', _84 => _84.pullHints, 'optionalCall', _85 => _85(result)]);
1533
1665
  if (subResult) {
1534
1666
  result = subResult;
1535
1667
  }
@@ -1551,7 +1683,7 @@ function createLoader(lDefinition) {
1551
1683
  if (state.initCtx) {
1552
1684
  return state.initCtx;
1553
1685
  }
1554
- state.initCtx = await _optionalChain([lDefinition, 'access', _82 => _82.init, 'optionalCall', _83 => _83()]);
1686
+ state.initCtx = await _optionalChain([lDefinition, 'access', _86 => _86.init, 'optionalCall', _87 => _87()]);
1555
1687
  return state.initCtx;
1556
1688
  },
1557
1689
  setDefaultLocale(locale) {
@@ -1562,7 +1694,7 @@ function createLoader(lDefinition) {
1562
1694
  return this;
1563
1695
  },
1564
1696
  async pullHints() {
1565
- return _optionalChain([lDefinition, 'access', _84 => _84.pullHints, 'optionalCall', _85 => _85(state.originalInput)]);
1697
+ return _optionalChain([lDefinition, 'access', _88 => _88.pullHints, 'optionalCall', _89 => _89(state.originalInput)]);
1566
1698
  },
1567
1699
  async pull(locale, input2) {
1568
1700
  if (!state.defaultLocale) {
@@ -1867,7 +1999,7 @@ function createNormalizeLoader() {
1867
1999
  return normalized;
1868
2000
  },
1869
2001
  push: async (locale, data, originalInput) => {
1870
- const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _86 => _86.keysMap]), () => ( {}));
2002
+ const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _90 => _90.keysMap]), () => ( {}));
1871
2003
  const input2 = mapDenormalizedKeys(data, keysMap);
1872
2004
  const denormalized = _flat.unflatten.call(void 0, input2, {
1873
2005
  delimiter: "/",
@@ -2001,8 +2133,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
2001
2133
  if (!templateData) {
2002
2134
  templateData = await readFileForLocale(pathPattern, originalLocale);
2003
2135
  }
2004
- if (_optionalChain([templateData, 'optionalAccess', _87 => _87.match, 'call', _88 => _88(/[\r\n]$/)])) {
2005
- const ending = _optionalChain([templateData, 'optionalAccess', _89 => _89.includes, 'call', _90 => _90("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _91 => _91.includes, 'call', _92 => _92("\r")]) ? "\r" : "\n";
2136
+ if (_optionalChain([templateData, 'optionalAccess', _91 => _91.match, 'call', _92 => _92(/[\r\n]$/)])) {
2137
+ const ending = _optionalChain([templateData, 'optionalAccess', _93 => _93.includes, 'call', _94 => _94("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _95 => _95.includes, 'call', _96 => _96("\r")]) ? "\r" : "\n";
2006
2138
  return ending;
2007
2139
  }
2008
2140
  return "";
@@ -2273,7 +2405,7 @@ var _sync3 = require('csv-stringify/sync');
2273
2405
 
2274
2406
  function detectKeyColumnName(csvString) {
2275
2407
  const row = _sync.parse.call(void 0, csvString)[0];
2276
- const firstColumn = _optionalChain([row, 'optionalAccess', _93 => _93[0], 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]);
2408
+ const firstColumn = _optionalChain([row, 'optionalAccess', _97 => _97[0], 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
2277
2409
  return firstColumn || "KEY";
2278
2410
  }
2279
2411
  function createCsvLoader() {
@@ -2375,7 +2507,7 @@ function createHtmlLoader() {
2375
2507
  break;
2376
2508
  }
2377
2509
  const siblings = Array.from(parent.childNodes).filter(
2378
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _96 => _96.textContent, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()])
2510
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _100 => _100.textContent, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()])
2379
2511
  );
2380
2512
  const index = siblings.indexOf(current);
2381
2513
  if (index !== -1) {
@@ -2411,15 +2543,15 @@ function createHtmlLoader() {
2411
2543
  }
2412
2544
  });
2413
2545
  Array.from(element.childNodes).filter(
2414
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _99 => _99.textContent, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()])
2546
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _103 => _103.textContent, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()])
2415
2547
  ).forEach(processNode);
2416
2548
  }
2417
2549
  };
2418
2550
  Array.from(document.head.childNodes).filter(
2419
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _102 => _102.textContent, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()])
2551
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _106 => _106.textContent, 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()])
2420
2552
  ).forEach(processNode);
2421
2553
  Array.from(document.body.childNodes).filter(
2422
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _105 => _105.textContent, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()])
2554
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _109 => _109.textContent, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()])
2423
2555
  ).forEach(processNode);
2424
2556
  return result;
2425
2557
  },
@@ -2444,7 +2576,7 @@ function createHtmlLoader() {
2444
2576
  for (let i = 0; i < indices.length; i++) {
2445
2577
  const index = parseInt(indices[i]);
2446
2578
  const siblings = Array.from(parent.childNodes).filter(
2447
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _108 => _108.textContent, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()])
2579
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _112 => _112.textContent, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()])
2448
2580
  );
2449
2581
  if (index >= siblings.length) {
2450
2582
  if (i === indices.length - 1) {
@@ -2495,7 +2627,7 @@ function createMarkdownLoader() {
2495
2627
  yaml: yamlEngine
2496
2628
  }
2497
2629
  });
2498
- const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _111 => _111.trim, 'call', _112 => _112()]), () => ( ""))).filter(Boolean);
2630
+ const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()]), () => ( ""))).filter(Boolean);
2499
2631
  return {
2500
2632
  ...Object.fromEntries(
2501
2633
  sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
@@ -2514,7 +2646,7 @@ function createMarkdownLoader() {
2514
2646
  );
2515
2647
  let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(
2516
2648
  ([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())
2517
- ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]), () => ( ""))).filter(Boolean).join("\n\n");
2649
+ ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _117 => _117.trim, 'call', _118 => _118()]), () => ( ""))).filter(Boolean).join("\n\n");
2518
2650
  if (Object.keys(frontmatter).length > 0) {
2519
2651
  content = `
2520
2652
  ${content}`;
@@ -2558,7 +2690,7 @@ function isSkippableLine(line) {
2558
2690
  function parsePropertyLine(line) {
2559
2691
  const [key, ...valueParts] = line.split("=");
2560
2692
  return {
2561
- key: _optionalChain([key, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()]) || "",
2693
+ key: _optionalChain([key, 'optionalAccess', _119 => _119.trim, 'call', _120 => _120()]) || "",
2562
2694
  value: valueParts.join("=").trim()
2563
2695
  };
2564
2696
  }
@@ -2646,7 +2778,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
2646
2778
  if (rootTranslationEntity.shouldTranslate === false) {
2647
2779
  continue;
2648
2780
  }
2649
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _117 => _117.localizations, 'optionalAccess', _118 => _118[locale]]);
2781
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _121 => _121.localizations, 'optionalAccess', _122 => _122[locale]]);
2650
2782
  if (langTranslationEntity) {
2651
2783
  if ("stringUnit" in langTranslationEntity) {
2652
2784
  resultData[translationKey] = langTranslationEntity.stringUnit.value;
@@ -2655,7 +2787,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
2655
2787
  resultData[translationKey] = {};
2656
2788
  const pluralForms = langTranslationEntity.variations.plural;
2657
2789
  for (const form in pluralForms) {
2658
- if (_optionalChain([pluralForms, 'access', _119 => _119[form], 'optionalAccess', _120 => _120.stringUnit, 'optionalAccess', _121 => _121.value])) {
2790
+ if (_optionalChain([pluralForms, 'access', _123 => _123[form], 'optionalAccess', _124 => _124.stringUnit, 'optionalAccess', _125 => _125.value])) {
2659
2791
  resultData[translationKey][form] = pluralForms[form].stringUnit.value;
2660
2792
  }
2661
2793
  }
@@ -2681,7 +2813,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
2681
2813
  const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
2682
2814
  if (typeof value === "string") {
2683
2815
  langDataToMerge.strings[key] = {
2684
- extractionState: _optionalChain([originalInput, 'optionalAccess', _122 => _122.strings, 'optionalAccess', _123 => _123[key], 'optionalAccess', _124 => _124.extractionState]),
2816
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _126 => _126.strings, 'optionalAccess', _127 => _127[key], 'optionalAccess', _128 => _128.extractionState]),
2685
2817
  localizations: {
2686
2818
  [locale]: {
2687
2819
  stringUnit: {
@@ -2739,7 +2871,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
2739
2871
  for (const [locale, localization] of Object.entries(
2740
2872
  entity.localizations
2741
2873
  )) {
2742
- if (_optionalChain([localization, 'access', _125 => _125.variations, 'optionalAccess', _126 => _126.plural])) {
2874
+ if (_optionalChain([localization, 'access', _129 => _129.variations, 'optionalAccess', _130 => _130.plural])) {
2743
2875
  const pluralForms = localization.variations.plural;
2744
2876
  for (const form in pluralForms) {
2745
2877
  const pluralKey = `${translationKey}/${form}`;
@@ -2759,7 +2891,7 @@ function _removeLocale(input2, locale) {
2759
2891
  const { strings } = input2;
2760
2892
  const newStrings = _lodash2.default.cloneDeep(strings);
2761
2893
  for (const [key, value] of Object.entries(newStrings)) {
2762
- if (_optionalChain([value, 'access', _127 => _127.localizations, 'optionalAccess', _128 => _128[locale]])) {
2894
+ if (_optionalChain([value, 'access', _131 => _131.localizations, 'optionalAccess', _132 => _132[locale]])) {
2763
2895
  delete value.localizations[locale];
2764
2896
  }
2765
2897
  }
@@ -2919,7 +3051,7 @@ function createPoDataLoader(params) {
2919
3051
  Object.entries(entries).forEach(([msgid, entry]) => {
2920
3052
  if (msgid && entry.msgid) {
2921
3053
  const context = entry.msgctxt || "";
2922
- const fullEntry = _optionalChain([parsedPo, 'access', _129 => _129.translations, 'access', _130 => _130[context], 'optionalAccess', _131 => _131[msgid]]);
3054
+ const fullEntry = _optionalChain([parsedPo, 'access', _133 => _133.translations, 'access', _134 => _134[context], 'optionalAccess', _135 => _135[msgid]]);
2923
3055
  if (fullEntry) {
2924
3056
  result[msgid] = fullEntry;
2925
3057
  }
@@ -2929,8 +3061,8 @@ function createPoDataLoader(params) {
2929
3061
  return result;
2930
3062
  },
2931
3063
  async push(locale, data, originalInput, originalLocale, pullInput) {
2932
- const currentSections = _optionalChain([pullInput, 'optionalAccess', _132 => _132.split, 'call', _133 => _133("\n\n"), 'access', _134 => _134.filter, 'call', _135 => _135(Boolean)]) || [];
2933
- const originalSections = _optionalChain([originalInput, 'optionalAccess', _136 => _136.split, 'call', _137 => _137("\n\n"), 'access', _138 => _138.filter, 'call', _139 => _139(Boolean)]) || [];
3064
+ const currentSections = _optionalChain([pullInput, 'optionalAccess', _136 => _136.split, 'call', _137 => _137("\n\n"), 'access', _138 => _138.filter, 'call', _139 => _139(Boolean)]) || [];
3065
+ const originalSections = _optionalChain([originalInput, 'optionalAccess', _140 => _140.split, 'call', _141 => _141("\n\n"), 'access', _142 => _142.filter, 'call', _143 => _143(Boolean)]) || [];
2934
3066
  const result = originalSections.map((section) => {
2935
3067
  const sectionPo = _gettextparser2.default.po.parse(section);
2936
3068
  if (Object.keys(sectionPo.translations).length === 0) {
@@ -2999,8 +3131,8 @@ function createPoContentLoader() {
2999
3131
  {
3000
3132
  ...entry,
3001
3133
  msgstr: [
3002
- _optionalChain([data, 'access', _140 => _140[entry.msgid], 'optionalAccess', _141 => _141.singular]),
3003
- _optionalChain([data, 'access', _142 => _142[entry.msgid], 'optionalAccess', _143 => _143.plural]) || null
3134
+ _optionalChain([data, 'access', _144 => _144[entry.msgid], 'optionalAccess', _145 => _145.singular]),
3135
+ _optionalChain([data, 'access', _146 => _146[entry.msgid], 'optionalAccess', _147 => _147.plural]) || null
3004
3136
  ].filter(Boolean)
3005
3137
  }
3006
3138
  ]).fromPairs().value();
@@ -3122,7 +3254,7 @@ function pullV1(xliffElement, locale, originalLocale) {
3122
3254
  let key = getTransUnitKey(unit);
3123
3255
  if (!key) return;
3124
3256
  if (seenKeys.has(key)) {
3125
- const id = _optionalChain([unit, 'access', _144 => _144.getAttribute, 'call', _145 => _145("id"), 'optionalAccess', _146 => _146.trim, 'call', _147 => _147()]);
3257
+ const id = _optionalChain([unit, 'access', _148 => _148.getAttribute, 'call', _149 => _149("id"), 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()]);
3126
3258
  if (id) {
3127
3259
  key = `${key}#${id}`;
3128
3260
  } else {
@@ -3170,7 +3302,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
3170
3302
  let key = getTransUnitKey(unit);
3171
3303
  if (!key) return;
3172
3304
  if (seenKeys.has(key)) {
3173
- const id = _optionalChain([unit, 'access', _148 => _148.getAttribute, 'call', _149 => _149("id"), 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()]);
3305
+ const id = _optionalChain([unit, 'access', _152 => _152.getAttribute, 'call', _153 => _153("id"), 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()]);
3174
3306
  if (id) {
3175
3307
  key = `${key}#${id}`;
3176
3308
  } else {
@@ -3212,7 +3344,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
3212
3344
  const translationKeys = new Set(Object.keys(translations));
3213
3345
  existingUnits.forEach((unit, key) => {
3214
3346
  if (!translationKeys.has(key)) {
3215
- _optionalChain([unit, 'access', _152 => _152.parentNode, 'optionalAccess', _153 => _153.removeChild, 'call', _154 => _154(unit)]);
3347
+ _optionalChain([unit, 'access', _156 => _156.parentNode, 'optionalAccess', _157 => _157.removeChild, 'call', _158 => _158(unit)]);
3216
3348
  }
3217
3349
  });
3218
3350
  return serializeWithDeclaration(
@@ -3255,18 +3387,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
3255
3387
  Array.from(container.children).forEach((child) => {
3256
3388
  const tagName = child.tagName;
3257
3389
  if (tagName === "unit") {
3258
- const unitId = _optionalChain([child, 'access', _155 => _155.getAttribute, 'call', _156 => _156("id"), 'optionalAccess', _157 => _157.trim, 'call', _158 => _158()]);
3390
+ const unitId = _optionalChain([child, 'access', _159 => _159.getAttribute, 'call', _160 => _160("id"), 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()]);
3259
3391
  if (!unitId) return;
3260
3392
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
3261
3393
  const segment = child.querySelector("segment");
3262
- const source = _optionalChain([segment, 'optionalAccess', _159 => _159.querySelector, 'call', _160 => _160("source")]);
3394
+ const source = _optionalChain([segment, 'optionalAccess', _163 => _163.querySelector, 'call', _164 => _164("source")]);
3263
3395
  if (source) {
3264
3396
  result[key] = extractTextContent(source);
3265
3397
  } else {
3266
3398
  result[key] = unitId;
3267
3399
  }
3268
3400
  } else if (tagName === "group") {
3269
- const groupId = _optionalChain([child, 'access', _161 => _161.getAttribute, 'call', _162 => _162("id"), 'optionalAccess', _163 => _163.trim, 'call', _164 => _164()]);
3401
+ const groupId = _optionalChain([child, 'access', _165 => _165.getAttribute, 'call', _166 => _166("id"), 'optionalAccess', _167 => _167.trim, 'call', _168 => _168()]);
3270
3402
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
3271
3403
  traverseUnitsV2(child, fileId, newPath, result);
3272
3404
  }
@@ -3302,12 +3434,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
3302
3434
  Array.from(container.children).forEach((child) => {
3303
3435
  const tagName = child.tagName;
3304
3436
  if (tagName === "unit") {
3305
- const unitId = _optionalChain([child, 'access', _165 => _165.getAttribute, 'call', _166 => _166("id"), 'optionalAccess', _167 => _167.trim, 'call', _168 => _168()]);
3437
+ const unitId = _optionalChain([child, 'access', _169 => _169.getAttribute, 'call', _170 => _170("id"), 'optionalAccess', _171 => _171.trim, 'call', _172 => _172()]);
3306
3438
  if (!unitId) return;
3307
3439
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
3308
3440
  index.set(key, child);
3309
3441
  } else if (tagName === "group") {
3310
- const groupId = _optionalChain([child, 'access', _169 => _169.getAttribute, 'call', _170 => _170("id"), 'optionalAccess', _171 => _171.trim, 'call', _172 => _172()]);
3442
+ const groupId = _optionalChain([child, 'access', _173 => _173.getAttribute, 'call', _174 => _174("id"), 'optionalAccess', _175 => _175.trim, 'call', _176 => _176()]);
3311
3443
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
3312
3444
  indexUnitsV2(child, fileId, newPath, index);
3313
3445
  }
@@ -3328,9 +3460,9 @@ function updateUnitV2(unit, value) {
3328
3460
  setTextContent(source, value);
3329
3461
  }
3330
3462
  function getTransUnitKey(transUnit) {
3331
- const resname = _optionalChain([transUnit, 'access', _173 => _173.getAttribute, 'call', _174 => _174("resname"), 'optionalAccess', _175 => _175.trim, 'call', _176 => _176()]);
3463
+ const resname = _optionalChain([transUnit, 'access', _177 => _177.getAttribute, 'call', _178 => _178("resname"), 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()]);
3332
3464
  if (resname) return resname;
3333
- const id = _optionalChain([transUnit, 'access', _177 => _177.getAttribute, 'call', _178 => _178("id"), 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()]);
3465
+ const id = _optionalChain([transUnit, 'access', _181 => _181.getAttribute, 'call', _182 => _182("id"), 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()]);
3334
3466
  if (id) return id;
3335
3467
  const sourceElement = transUnit.querySelector("source");
3336
3468
  if (sourceElement) {
@@ -3387,7 +3519,7 @@ function formatXml(xml) {
3387
3519
  if (cdataNode) {
3388
3520
  return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
3389
3521
  }
3390
- const textContent = _optionalChain([element, 'access', _181 => _181.textContent, 'optionalAccess', _182 => _182.trim, 'call', _183 => _183()]) || "";
3522
+ const textContent = _optionalChain([element, 'access', _185 => _185.textContent, 'optionalAccess', _186 => _186.trim, 'call', _187 => _187()]) || "";
3391
3523
  const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
3392
3524
  if (hasOnlyText && textContent) {
3393
3525
  return `${indent2}${openTag}${textContent}</${tagName}>`;
@@ -3680,7 +3812,7 @@ function createDatoClient(params) {
3680
3812
  ids: !records.length ? void 0 : records.join(",")
3681
3813
  }
3682
3814
  }).catch(
3683
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _184 => _184.response, 'optionalAccess', _185 => _185.body, 'optionalAccess', _186 => _186.data, 'optionalAccess', _187 => _187[0]]) || error)
3815
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _188 => _188.response, 'optionalAccess', _189 => _189.body, 'optionalAccess', _190 => _190.data, 'optionalAccess', _191 => _191[0]]) || error)
3684
3816
  );
3685
3817
  },
3686
3818
  findRecordsForModel: async (modelId, records) => {
@@ -3691,10 +3823,10 @@ function createDatoClient(params) {
3691
3823
  filter: {
3692
3824
  type: modelId,
3693
3825
  only_valid: "true",
3694
- ids: !_optionalChain([records, 'optionalAccess', _188 => _188.length]) ? void 0 : records.join(",")
3826
+ ids: !_optionalChain([records, 'optionalAccess', _192 => _192.length]) ? void 0 : records.join(",")
3695
3827
  }
3696
3828
  }).catch(
3697
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _189 => _189.response, 'optionalAccess', _190 => _190.body, 'optionalAccess', _191 => _191.data, 'optionalAccess', _192 => _192[0]]) || error)
3829
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _193 => _193.response, 'optionalAccess', _194 => _194.body, 'optionalAccess', _195 => _195.data, 'optionalAccess', _196 => _196[0]]) || error)
3698
3830
  );
3699
3831
  return result;
3700
3832
  } catch (_error) {
@@ -3710,10 +3842,10 @@ function createDatoClient(params) {
3710
3842
  updateRecord: async (id, payload) => {
3711
3843
  try {
3712
3844
  await dato.items.update(id, payload).catch(
3713
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _193 => _193.response, 'optionalAccess', _194 => _194.body, 'optionalAccess', _195 => _195.data, 'optionalAccess', _196 => _196[0]]) || error)
3845
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _197 => _197.response, 'optionalAccess', _198 => _198.body, 'optionalAccess', _199 => _199.data, 'optionalAccess', _200 => _200[0]]) || error)
3714
3846
  );
3715
3847
  } catch (_error) {
3716
- if (_optionalChain([_error, 'optionalAccess', _197 => _197.attributes, 'optionalAccess', _198 => _198.details, 'optionalAccess', _199 => _199.message])) {
3848
+ if (_optionalChain([_error, 'optionalAccess', _201 => _201.attributes, 'optionalAccess', _202 => _202.details, 'optionalAccess', _203 => _203.message])) {
3717
3849
  throw new Error(
3718
3850
  [
3719
3851
  `${_error.attributes.details.message}`,
@@ -3735,10 +3867,10 @@ function createDatoClient(params) {
3735
3867
  enableFieldLocalization: async (args) => {
3736
3868
  try {
3737
3869
  await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
3738
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _200 => _200.response, 'optionalAccess', _201 => _201.body, 'optionalAccess', _202 => _202.data, 'optionalAccess', _203 => _203[0]]) || error)
3870
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _204 => _204.response, 'optionalAccess', _205 => _205.body, 'optionalAccess', _206 => _206.data, 'optionalAccess', _207 => _207[0]]) || error)
3739
3871
  );
3740
3872
  } catch (_error) {
3741
- if (_optionalChain([_error, 'optionalAccess', _204 => _204.attributes, 'optionalAccess', _205 => _205.code]) === "NOT_FOUND") {
3873
+ if (_optionalChain([_error, 'optionalAccess', _208 => _208.attributes, 'optionalAccess', _209 => _209.code]) === "NOT_FOUND") {
3742
3874
  throw new Error(
3743
3875
  [
3744
3876
  `Field "${args.fieldId}" not found in model "${args.modelId}".`,
@@ -3746,7 +3878,7 @@ function createDatoClient(params) {
3746
3878
  ].join("\n\n")
3747
3879
  );
3748
3880
  }
3749
- if (_optionalChain([_error, 'optionalAccess', _206 => _206.attributes, 'optionalAccess', _207 => _207.details, 'optionalAccess', _208 => _208.message])) {
3881
+ if (_optionalChain([_error, 'optionalAccess', _210 => _210.attributes, 'optionalAccess', _211 => _211.details, 'optionalAccess', _212 => _212.message])) {
3750
3882
  throw new Error(
3751
3883
  [
3752
3884
  `${_error.attributes.details.message}`,
@@ -3824,7 +3956,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
3824
3956
  const records = await dato.findRecordsForModel(modelId);
3825
3957
  const recordChoices = createRecordChoices(
3826
3958
  records,
3827
- _optionalChain([config, 'access', _209 => _209.models, 'access', _210 => _210[modelId], 'optionalAccess', _211 => _211.records]) || [],
3959
+ _optionalChain([config, 'access', _213 => _213.models, 'access', _214 => _214[modelId], 'optionalAccess', _215 => _215.records]) || [],
3828
3960
  project
3829
3961
  );
3830
3962
  const selectedRecords = await promptRecordSelection(
@@ -3843,14 +3975,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
3843
3975
  },
3844
3976
  async pull(locale, input2, initCtx) {
3845
3977
  const result = {};
3846
- for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _212 => _212.models]) || {})) {
3847
- let records = _optionalChain([initCtx, 'optionalAccess', _213 => _213.models, 'access', _214 => _214[modelId], 'access', _215 => _215.records]) || [];
3978
+ for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _216 => _216.models]) || {})) {
3979
+ let records = _optionalChain([initCtx, 'optionalAccess', _217 => _217.models, 'access', _218 => _218[modelId], 'access', _219 => _219.records]) || [];
3848
3980
  const recordIds = records.map((record) => record.id);
3849
3981
  records = await dato.findRecords(recordIds);
3850
3982
  console.log(`Fetched ${records.length} records for model ${modelId}`);
3851
3983
  if (records.length > 0) {
3852
3984
  result[modelId] = {
3853
- fields: _optionalChain([initCtx, 'optionalAccess', _216 => _216.models, 'optionalAccess', _217 => _217[modelId], 'optionalAccess', _218 => _218.fields]) || [],
3985
+ fields: _optionalChain([initCtx, 'optionalAccess', _220 => _220.models, 'optionalAccess', _221 => _221[modelId], 'optionalAccess', _222 => _222.fields]) || [],
3854
3986
  records
3855
3987
  };
3856
3988
  }
@@ -3913,7 +4045,7 @@ function createRecordChoices(records, selectedIds = [], project) {
3913
4045
  return records.map((record) => ({
3914
4046
  name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
3915
4047
  value: record.id,
3916
- checked: _optionalChain([selectedIds, 'optionalAccess', _219 => _219.includes, 'call', _220 => _220(record.id)])
4048
+ checked: _optionalChain([selectedIds, 'optionalAccess', _223 => _223.includes, 'call', _224 => _224(record.id)])
3917
4049
  }));
3918
4050
  }
3919
4051
  async function promptRecordSelection(modelName, choices) {
@@ -4232,7 +4364,7 @@ function createVttLoader() {
4232
4364
  if (!input2) {
4233
4365
  return "";
4234
4366
  }
4235
- const vtt = _optionalChain([_nodewebvtt2.default, 'access', _221 => _221.parse, 'call', _222 => _222(input2), 'optionalAccess', _223 => _223.cues]);
4367
+ const vtt = _optionalChain([_nodewebvtt2.default, 'access', _225 => _225.parse, 'call', _226 => _226(input2), 'optionalAccess', _227 => _227.cues]);
4236
4368
  if (Object.keys(vtt).length === 0) {
4237
4369
  return {};
4238
4370
  } else {
@@ -4286,7 +4418,7 @@ function variableExtractLoader(params) {
4286
4418
  for (let i = 0; i < matches.length; i++) {
4287
4419
  const match2 = matches[i];
4288
4420
  const currentValue = result[key].value;
4289
- const newValue = _optionalChain([currentValue, 'optionalAccess', _224 => _224.replace, 'call', _225 => _225(match2, `{variable:${i}}`)]);
4421
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _228 => _228.replace, 'call', _229 => _229(match2, `{variable:${i}}`)]);
4290
4422
  result[key].value = newValue;
4291
4423
  result[key].variables[i] = match2;
4292
4424
  }
@@ -4300,7 +4432,7 @@ function variableExtractLoader(params) {
4300
4432
  for (let i = 0; i < valueObj.variables.length; i++) {
4301
4433
  const variable = valueObj.variables[i];
4302
4434
  const currentValue = result[key];
4303
- const newValue = _optionalChain([currentValue, 'optionalAccess', _226 => _226.replace, 'call', _227 => _227(`{variable:${i}}`, variable)]);
4435
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _230 => _230.replace, 'call', _231 => _231(`{variable:${i}}`, variable)]);
4304
4436
  result[key] = newValue;
4305
4437
  }
4306
4438
  }
@@ -4500,7 +4632,7 @@ function createVueJsonLoader() {
4500
4632
  return createLoader({
4501
4633
  pull: async (locale, input2, ctx) => {
4502
4634
  const parsed = parseVueFile(input2);
4503
- return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _228 => _228.i18n, 'optionalAccess', _229 => _229[locale]]), () => ( {}));
4635
+ return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _232 => _232.i18n, 'optionalAccess', _233 => _233[locale]]), () => ( {}));
4504
4636
  },
4505
4637
  push: async (locale, data, originalInput) => {
4506
4638
  const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
@@ -4685,7 +4817,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
4685
4817
  objectExpression.properties.forEach((prop) => {
4686
4818
  if (!t.isObjectProperty(prop)) return;
4687
4819
  const key = getPropertyKey(prop);
4688
- const incomingVal = _optionalChain([data, 'optionalAccess', _230 => _230[key]]);
4820
+ const incomingVal = _optionalChain([data, 'optionalAccess', _234 => _234[key]]);
4689
4821
  if (incomingVal === void 0) {
4690
4822
  return;
4691
4823
  }
@@ -4721,7 +4853,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
4721
4853
  let modified = false;
4722
4854
  arrayExpression.elements.forEach((element, index) => {
4723
4855
  if (!element) return;
4724
- const incomingVal = _optionalChain([incoming, 'optionalAccess', _231 => _231[index]]);
4856
+ const incomingVal = _optionalChain([incoming, 'optionalAccess', _235 => _235[index]]);
4725
4857
  if (incomingVal === void 0) return;
4726
4858
  if (t.isStringLiteral(element) && typeof incomingVal === "string") {
4727
4859
  if (element.value !== incomingVal) {
@@ -5212,7 +5344,7 @@ var AST = class _AST {
5212
5344
  const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
5213
5345
  if (this.isStart() && !this.type)
5214
5346
  ret.unshift([]);
5215
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _232 => _232.#parent, 'optionalAccess', _233 => _233.type]) === "!")) {
5347
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _236 => _236.#parent, 'optionalAccess', _237 => _237.type]) === "!")) {
5216
5348
  ret.push({});
5217
5349
  }
5218
5350
  return ret;
@@ -5220,7 +5352,7 @@ var AST = class _AST {
5220
5352
  isStart() {
5221
5353
  if (this.#root === this)
5222
5354
  return true;
5223
- if (!_optionalChain([this, 'access', _234 => _234.#parent, 'optionalAccess', _235 => _235.isStart, 'call', _236 => _236()]))
5355
+ if (!_optionalChain([this, 'access', _238 => _238.#parent, 'optionalAccess', _239 => _239.isStart, 'call', _240 => _240()]))
5224
5356
  return false;
5225
5357
  if (this.#parentIndex === 0)
5226
5358
  return true;
@@ -5236,12 +5368,12 @@ var AST = class _AST {
5236
5368
  isEnd() {
5237
5369
  if (this.#root === this)
5238
5370
  return true;
5239
- if (_optionalChain([this, 'access', _237 => _237.#parent, 'optionalAccess', _238 => _238.type]) === "!")
5371
+ if (_optionalChain([this, 'access', _241 => _241.#parent, 'optionalAccess', _242 => _242.type]) === "!")
5240
5372
  return true;
5241
- if (!_optionalChain([this, 'access', _239 => _239.#parent, 'optionalAccess', _240 => _240.isEnd, 'call', _241 => _241()]))
5373
+ if (!_optionalChain([this, 'access', _243 => _243.#parent, 'optionalAccess', _244 => _244.isEnd, 'call', _245 => _245()]))
5242
5374
  return false;
5243
5375
  if (!this.type)
5244
- return _optionalChain([this, 'access', _242 => _242.#parent, 'optionalAccess', _243 => _243.isEnd, 'call', _244 => _244()]);
5376
+ return _optionalChain([this, 'access', _246 => _246.#parent, 'optionalAccess', _247 => _247.isEnd, 'call', _248 => _248()]);
5245
5377
  const pl = this.#parent ? this.#parent.#parts.length : 0;
5246
5378
  return this.#parentIndex === pl - 1;
5247
5379
  }
@@ -5486,7 +5618,7 @@ var AST = class _AST {
5486
5618
  }
5487
5619
  }
5488
5620
  let end = "";
5489
- if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _245 => _245.#parent, 'optionalAccess', _246 => _246.type]) === "!") {
5621
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _249 => _249.#parent, 'optionalAccess', _250 => _250.type]) === "!") {
5490
5622
  end = "(?:$|\\/)";
5491
5623
  }
5492
5624
  const final2 = start2 + src + end;
@@ -6563,7 +6695,7 @@ function createMdxSectionsSplit2Loader() {
6563
6695
  const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
6564
6696
  const result = {
6565
6697
  frontmatter: data.frontmatter,
6566
- codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _247 => _247.codePlaceholders]) || {},
6698
+ codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _251 => _251.codePlaceholders]) || {},
6567
6699
  content
6568
6700
  };
6569
6701
  return result;
@@ -7300,7 +7432,7 @@ function createBasicTranslator(model, systemPrompt) {
7300
7432
  ]
7301
7433
  });
7302
7434
  const result = JSON.parse(response.text);
7303
- return _optionalChain([result, 'optionalAccess', _248 => _248.data]) || {};
7435
+ return _optionalChain([result, 'optionalAccess', _252 => _252.data]) || {};
7304
7436
  }
7305
7437
  }
7306
7438
  function extractPayloadChunks(payload) {
@@ -7382,7 +7514,7 @@ function getPureModelProvider(provider) {
7382
7514
 
7383
7515
  ${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
7384
7516
  `;
7385
- switch (_optionalChain([provider, 'optionalAccess', _249 => _249.id])) {
7517
+ switch (_optionalChain([provider, 'optionalAccess', _253 => _253.id])) {
7386
7518
  case "openai": {
7387
7519
  if (!process.env.OPENAI_API_KEY) {
7388
7520
  throw new Error(
@@ -7440,7 +7572,7 @@ function getPureModelProvider(provider) {
7440
7572
  })(provider.model);
7441
7573
  }
7442
7574
  default: {
7443
- throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _250 => _250.id])));
7575
+ throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _254 => _254.id])));
7444
7576
  }
7445
7577
  }
7446
7578
  }
@@ -7483,7 +7615,11 @@ function trackEvent(distinctId, event, properties) {
7483
7615
  properties: {
7484
7616
  ...properties,
7485
7617
  $lib: "lingo.dev-cli",
7486
- $lib_version: process.env.npm_package_version || "unknown"
7618
+ $lib_version: process.env.npm_package_version || "unknown",
7619
+ // Essential debugging context only
7620
+ node_version: process.version,
7621
+ is_ci: !!process.env.CI,
7622
+ debug_enabled: process.env.DEBUG === "true"
7487
7623
  },
7488
7624
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
7489
7625
  };
@@ -7683,7 +7819,21 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
7683
7819
  ).action(async function(options) {
7684
7820
  updateGitignore();
7685
7821
  const ora = _ora2.default.call(void 0, );
7686
- const flags = parseFlags(options);
7822
+ let flags;
7823
+ try {
7824
+ flags = parseFlags(options);
7825
+ } catch (parseError) {
7826
+ await trackEvent("unknown", "cmd.i18n.error", {
7827
+ errorType: "validation_error",
7828
+ errorName: parseError.name || "ValidationError",
7829
+ errorMessage: parseError.message || "Invalid command line options",
7830
+ errorStack: parseError.stack,
7831
+ fatal: true,
7832
+ errorCount: 1,
7833
+ stage: "flag_validation"
7834
+ });
7835
+ throw parseError;
7836
+ }
7687
7837
  if (flags.debug) {
7688
7838
  const { debug } = await _inquirer2.default.prompt([
7689
7839
  {
@@ -7695,6 +7845,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
7695
7845
  }
7696
7846
  let hasErrors = false;
7697
7847
  let authId = null;
7848
+ const errorDetails = [];
7698
7849
  try {
7699
7850
  ora.start("Loading configuration...");
7700
7851
  const i18nConfig = getConfig();
@@ -7704,7 +7855,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
7704
7855
  validateParams(i18nConfig, flags);
7705
7856
  ora.succeed("Localization configuration is valid");
7706
7857
  ora.start("Connecting to Lingo.dev Localization Engine...");
7707
- const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _251 => _251.provider]);
7858
+ const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _255 => _255.provider]);
7708
7859
  if (isByokMode) {
7709
7860
  authId = null;
7710
7861
  ora.succeed("Using external provider (BYOK mode)");
@@ -7718,16 +7869,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
7718
7869
  flags
7719
7870
  });
7720
7871
  let buckets = getBuckets(i18nConfig);
7721
- if (_optionalChain([flags, 'access', _252 => _252.bucket, 'optionalAccess', _253 => _253.length])) {
7872
+ if (_optionalChain([flags, 'access', _256 => _256.bucket, 'optionalAccess', _257 => _257.length])) {
7722
7873
  buckets = buckets.filter(
7723
7874
  (bucket) => flags.bucket.includes(bucket.type)
7724
7875
  );
7725
7876
  }
7726
7877
  ora.succeed("Buckets retrieved");
7727
- if (_optionalChain([flags, 'access', _254 => _254.file, 'optionalAccess', _255 => _255.length])) {
7878
+ if (_optionalChain([flags, 'access', _258 => _258.file, 'optionalAccess', _259 => _259.length])) {
7728
7879
  buckets = buckets.map((bucket) => {
7729
7880
  const paths = bucket.paths.filter(
7730
- (path18) => flags.file.find((file) => _optionalChain([path18, 'access', _256 => _256.pathPattern, 'optionalAccess', _257 => _257.includes, 'call', _258 => _258(file)]))
7881
+ (path18) => flags.file.find((file) => _optionalChain([path18, 'access', _260 => _260.pathPattern, 'optionalAccess', _261 => _261.includes, 'call', _262 => _262(file)]))
7731
7882
  );
7732
7883
  return { ...bucket, paths };
7733
7884
  }).filter((bucket) => bucket.paths.length > 0);
@@ -7748,7 +7899,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
7748
7899
  });
7749
7900
  }
7750
7901
  }
7751
- const targetLocales = _optionalChain([flags, 'access', _259 => _259.locale, 'optionalAccess', _260 => _260.length]) ? flags.locale : i18nConfig.locale.targets;
7902
+ const targetLocales = _optionalChain([flags, 'access', _263 => _263.locale, 'optionalAccess', _264 => _264.length]) ? flags.locale : i18nConfig.locale.targets;
7752
7903
  ora.start("Setting up localization cache...");
7753
7904
  const checkLockfileProcessor = createDeltaProcessor("");
7754
7905
  const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
@@ -7996,9 +8147,23 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
7996
8147
  );
7997
8148
  }
7998
8149
  } catch (_error) {
7999
- const error = new Error(
8000
- `[${sourceLocale} -> ${targetLocale}] Localization failed: ${_error.message}`
8150
+ const error = new LocalizationError(
8151
+ `[${sourceLocale} -> ${targetLocale}] Localization failed: ${_error.message}`,
8152
+ {
8153
+ bucket: bucket.type,
8154
+ sourceLocale,
8155
+ targetLocale,
8156
+ pathPattern: bucketPath.pathPattern
8157
+ }
8001
8158
  );
8159
+ errorDetails.push({
8160
+ type: "locale_error",
8161
+ bucket: bucket.type,
8162
+ locale: `${sourceLocale} -> ${targetLocale}`,
8163
+ pathPattern: bucketPath.pathPattern,
8164
+ message: _error.message,
8165
+ stack: _error.stack
8166
+ });
8002
8167
  if (flags.strict) {
8003
8168
  throw error;
8004
8169
  } else {
@@ -8009,14 +8174,21 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
8009
8174
  }
8010
8175
  const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
8011
8176
  const checksums = await deltaProcessor.createChecksums(sourceData);
8012
- if (!_optionalChain([flags, 'access', _261 => _261.locale, 'optionalAccess', _262 => _262.length])) {
8177
+ if (!_optionalChain([flags, 'access', _265 => _265.locale, 'optionalAccess', _266 => _266.length])) {
8013
8178
  await deltaProcessor.saveChecksums(checksums);
8014
8179
  }
8015
8180
  }
8016
8181
  } catch (_error) {
8017
- const error = new Error(
8018
- `Failed to process bucket ${bucket.type}: ${_error.message}`
8182
+ const error = new BucketProcessingError(
8183
+ `Failed to process bucket ${bucket.type}: ${_error.message}`,
8184
+ bucket.type
8019
8185
  );
8186
+ errorDetails.push({
8187
+ type: "bucket_error",
8188
+ bucket: bucket.type,
8189
+ message: _error.message,
8190
+ stack: _error.stack
8191
+ });
8020
8192
  if (flags.strict) {
8021
8193
  throw error;
8022
8194
  } else {
@@ -8029,20 +8201,54 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
8029
8201
  if (!hasErrors) {
8030
8202
  ora.succeed("Localization completed.");
8031
8203
  await trackEvent(authId, "cmd.i18n.success", {
8032
- i18nConfig,
8033
- flags
8204
+ i18nConfig: {
8205
+ sourceLocale: i18nConfig.locale.source,
8206
+ targetLocales: i18nConfig.locale.targets,
8207
+ bucketTypes: Object.keys(i18nConfig.buckets)
8208
+ },
8209
+ flags,
8210
+ bucketCount: buckets.length,
8211
+ localeCount: targetLocales.length,
8212
+ processedSuccessfully: true
8034
8213
  });
8035
8214
  } else {
8036
8215
  ora.warn("Localization completed with errors.");
8037
8216
  await trackEvent(authId || "unknown", "cmd.i18n.error", {
8038
- flags
8217
+ flags,
8218
+ ...aggregateErrorAnalytics(
8219
+ errorDetails,
8220
+ buckets,
8221
+ targetLocales,
8222
+ i18nConfig
8223
+ )
8039
8224
  });
8040
8225
  }
8041
8226
  } catch (error) {
8042
8227
  ora.fail(error.message);
8228
+ const errorType = getCLIErrorType(error);
8229
+ let errorContext = {};
8230
+ if (isLocalizationError(error)) {
8231
+ errorContext = {
8232
+ bucket: error.bucket,
8233
+ sourceLocale: error.sourceLocale,
8234
+ targetLocale: error.targetLocale,
8235
+ pathPattern: error.pathPattern
8236
+ };
8237
+ } else if (isBucketProcessingError(error)) {
8238
+ errorContext = {
8239
+ bucket: error.bucket
8240
+ };
8241
+ }
8043
8242
  await trackEvent(authId || "unknown", "cmd.i18n.error", {
8044
8243
  flags,
8045
- error
8244
+ errorType,
8245
+ errorName: error.name || "Error",
8246
+ errorMessage: error.message,
8247
+ errorStack: error.stack,
8248
+ errorContext,
8249
+ fatal: true,
8250
+ errorCount: errorDetails.length + 1,
8251
+ previousErrors: createPreviousErrorContext(errorDetails)
8046
8252
  });
8047
8253
  }
8048
8254
  });
@@ -8063,7 +8269,7 @@ function parseFlags(options) {
8063
8269
  }
8064
8270
  async function validateAuth(settings) {
8065
8271
  if (!settings.auth.apiKey) {
8066
- throw new CLIError({
8272
+ throw new AuthenticationError({
8067
8273
  message: "Not authenticated. Please run `lingo.dev login` to authenticate.",
8068
8274
  docUrl: "authError"
8069
8275
  });
@@ -8074,7 +8280,7 @@ async function validateAuth(settings) {
8074
8280
  });
8075
8281
  const user = await authenticator.whoami();
8076
8282
  if (!user) {
8077
- throw new CLIError({
8283
+ throw new AuthenticationError({
8078
8284
  message: "Invalid API key. Please run `lingo.dev login` to authenticate.",
8079
8285
  docUrl: "authError"
8080
8286
  });
@@ -8083,24 +8289,24 @@ async function validateAuth(settings) {
8083
8289
  }
8084
8290
  function validateParams(i18nConfig, flags) {
8085
8291
  if (!i18nConfig) {
8086
- throw new CLIError({
8292
+ throw new ConfigError({
8087
8293
  message: "i18n.json not found. Please run `lingo.dev init` to initialize the project.",
8088
8294
  docUrl: "i18nNotFound"
8089
8295
  });
8090
8296
  } else if (!i18nConfig.buckets || !Object.keys(i18nConfig.buckets).length) {
8091
- throw new CLIError({
8297
+ throw new ConfigError({
8092
8298
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
8093
8299
  docUrl: "bucketNotFound"
8094
8300
  });
8095
- } else if (_optionalChain([flags, 'access', _263 => _263.locale, 'optionalAccess', _264 => _264.some, 'call', _265 => _265((locale) => !i18nConfig.locale.targets.includes(locale))])) {
8096
- throw new CLIError({
8301
+ } else if (_optionalChain([flags, 'access', _267 => _267.locale, 'optionalAccess', _268 => _268.some, 'call', _269 => _269((locale) => !i18nConfig.locale.targets.includes(locale))])) {
8302
+ throw new ValidationError({
8097
8303
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
8098
8304
  docUrl: "localeTargetNotFound"
8099
8305
  });
8100
- } else if (_optionalChain([flags, 'access', _266 => _266.bucket, 'optionalAccess', _267 => _267.some, 'call', _268 => _268(
8306
+ } else if (_optionalChain([flags, 'access', _270 => _270.bucket, 'optionalAccess', _271 => _271.some, 'call', _272 => _272(
8101
8307
  (bucket) => !i18nConfig.buckets[bucket]
8102
8308
  )])) {
8103
- throw new CLIError({
8309
+ throw new ValidationError({
8104
8310
  message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
8105
8311
  docUrl: "bucketNotFound"
8106
8312
  });
@@ -8605,7 +8811,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
8605
8811
  const response = await engine.whoami();
8606
8812
  return {
8607
8813
  authenticated: !!response,
8608
- username: _optionalChain([response, 'optionalAccess', _269 => _269.email])
8814
+ username: _optionalChain([response, 'optionalAccess', _273 => _273.email])
8609
8815
  };
8610
8816
  } catch (e2) {
8611
8817
  return { authenticated: false };
@@ -8713,7 +8919,7 @@ function createExplicitLocalizer(provider) {
8713
8919
  }
8714
8920
  function createAiSdkLocalizer(params) {
8715
8921
  const skipAuth = params.skipAuth === true;
8716
- const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _270 => _270.apiKeyName]), () => ( ""))];
8922
+ const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _274 => _274.apiKeyName]), () => ( ""))];
8717
8923
  if (!skipAuth && !apiKey || !params.apiKeyName) {
8718
8924
  throw new Error(
8719
8925
  _dedent2.default`
@@ -8838,8 +9044,8 @@ async function setup(input2) {
8838
9044
  throw new Error(
8839
9045
  "No buckets found in i18n.json. Please add at least one bucket containing i18n content."
8840
9046
  );
8841
- } else if (_optionalChain([ctx, 'access', _271 => _271.flags, 'access', _272 => _272.bucket, 'optionalAccess', _273 => _273.some, 'call', _274 => _274(
8842
- (bucket) => !_optionalChain([ctx, 'access', _275 => _275.config, 'optionalAccess', _276 => _276.buckets, 'access', _277 => _277[bucket]])
9047
+ } else if (_optionalChain([ctx, 'access', _275 => _275.flags, 'access', _276 => _276.bucket, 'optionalAccess', _277 => _277.some, 'call', _278 => _278(
9048
+ (bucket) => !_optionalChain([ctx, 'access', _279 => _279.config, 'optionalAccess', _280 => _280.buckets, 'access', _281 => _281[bucket]])
8843
9049
  )])) {
8844
9050
  throw new Error(
8845
9051
  `One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
@@ -8852,7 +9058,7 @@ async function setup(input2) {
8852
9058
  title: "Selecting localization provider",
8853
9059
  task: async (ctx, task) => {
8854
9060
  ctx.localizer = createLocalizer(
8855
- _optionalChain([ctx, 'access', _278 => _278.config, 'optionalAccess', _279 => _279.provider]),
9061
+ _optionalChain([ctx, 'access', _282 => _282.config, 'optionalAccess', _283 => _283.provider]),
8856
9062
  ctx.flags.apiKey
8857
9063
  );
8858
9064
  if (!ctx.localizer) {
@@ -9171,7 +9377,7 @@ function createWorkerTask(args) {
9171
9377
  const processableData = _lodash2.default.chain(sourceData).entries().filter(
9172
9378
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
9173
9379
  ).filter(
9174
- ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _280 => _280.onlyKeys, 'optionalAccess', _281 => _281.some, 'call', _282 => _282(
9380
+ ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _284 => _284.onlyKeys, 'optionalAccess', _285 => _285.some, 'call', _286 => _286(
9175
9381
  (pattern) => minimatch(key, pattern)
9176
9382
  )])
9177
9383
  ).fromPairs().value();
@@ -9234,7 +9440,7 @@ function createWorkerTask(args) {
9234
9440
  finalRenamedTargetData
9235
9441
  );
9236
9442
  const checksums2 = await deltaProcessor.createChecksums(sourceData);
9237
- if (!_optionalChain([args, 'access', _283 => _283.ctx, 'access', _284 => _284.flags, 'access', _285 => _285.targetLocale, 'optionalAccess', _286 => _286.length])) {
9443
+ if (!_optionalChain([args, 'access', _287 => _287.ctx, 'access', _288 => _288.flags, 'access', _289 => _289.targetLocale, 'optionalAccess', _290 => _290.length])) {
9238
9444
  await deltaProcessor.saveChecksums(checksums2);
9239
9445
  }
9240
9446
  });
@@ -9425,13 +9631,13 @@ var flagsSchema2 = _zod.z.object({
9425
9631
 
9426
9632
  // src/cli/cmd/run/_utils.ts
9427
9633
  async function determineAuthId(ctx) {
9428
- const isByokMode = !!_optionalChain([ctx, 'access', _287 => _287.config, 'optionalAccess', _288 => _288.provider]);
9634
+ const isByokMode = !!_optionalChain([ctx, 'access', _291 => _291.config, 'optionalAccess', _292 => _292.provider]);
9429
9635
  if (isByokMode) {
9430
9636
  return null;
9431
9637
  } else {
9432
9638
  try {
9433
- const authStatus = await _optionalChain([ctx, 'access', _289 => _289.localizer, 'optionalAccess', _290 => _290.checkAuth, 'call', _291 => _291()]);
9434
- return _optionalChain([authStatus, 'optionalAccess', _292 => _292.username]) || null;
9639
+ const authStatus = await _optionalChain([ctx, 'access', _293 => _293.localizer, 'optionalAccess', _294 => _294.checkAuth, 'call', _295 => _295()]);
9640
+ return _optionalChain([authStatus, 'optionalAccess', _296 => _296.username]) || null;
9435
9641
  } catch (e3) {
9436
9642
  return null;
9437
9643
  }
@@ -9626,7 +9832,7 @@ var InBranchFlow = class extends IntegrationFlow {
9626
9832
  _child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
9627
9833
  _child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
9628
9834
  _child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
9629
- _optionalChain([this, 'access', _293 => _293.platformKit, 'optionalAccess', _294 => _294.gitConfig, 'call', _295 => _295()]);
9835
+ _optionalChain([this, 'access', _297 => _297.platformKit, 'optionalAccess', _298 => _298.gitConfig, 'call', _299 => _299()]);
9630
9836
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
9631
9837
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
9632
9838
  if (!processOwnCommits) {
@@ -9658,7 +9864,7 @@ var InBranchFlow = class extends IntegrationFlow {
9658
9864
  // src/cli/cmd/ci/flows/pull-request.ts
9659
9865
  var PullRequestFlow = class extends InBranchFlow {
9660
9866
  async preRun() {
9661
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _296 => _296()]);
9867
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _300 => _300()]);
9662
9868
  if (!canContinue) {
9663
9869
  return false;
9664
9870
  }
@@ -9921,10 +10127,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
9921
10127
  repo_slug: this.platformConfig.repositoryName,
9922
10128
  state: "OPEN"
9923
10129
  }).then(({ data: { values } }) => {
9924
- return _optionalChain([values, 'optionalAccess', _297 => _297.find, 'call', _298 => _298(
9925
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _299 => _299.branch, 'optionalAccess', _300 => _300.name]) === branch && _optionalChain([destination, 'optionalAccess', _301 => _301.branch, 'optionalAccess', _302 => _302.name]) === this.platformConfig.baseBranchName
10130
+ return _optionalChain([values, 'optionalAccess', _301 => _301.find, 'call', _302 => _302(
10131
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _303 => _303.branch, 'optionalAccess', _304 => _304.name]) === branch && _optionalChain([destination, 'optionalAccess', _305 => _305.branch, 'optionalAccess', _306 => _306.name]) === this.platformConfig.baseBranchName
9926
10132
  )]);
9927
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _303 => _303.id]));
10133
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _307 => _307.id]));
9928
10134
  }
9929
10135
  async closePullRequest({ pullRequestNumber }) {
9930
10136
  await this.bb.repositories.declinePullRequest({
@@ -10020,7 +10226,7 @@ var GitHubPlatformKit = class extends PlatformKit {
10020
10226
  repo: this.platformConfig.repositoryName,
10021
10227
  base: this.platformConfig.baseBranchName,
10022
10228
  state: "open"
10023
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _304 => _304.number]));
10229
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _308 => _308.number]));
10024
10230
  }
10025
10231
  async closePullRequest({ pullRequestNumber }) {
10026
10232
  await this.octokit.rest.pulls.update({
@@ -10147,7 +10353,7 @@ var GitlabPlatformKit = class extends PlatformKit {
10147
10353
  sourceBranch: branch,
10148
10354
  state: "opened"
10149
10355
  });
10150
- return _optionalChain([mergeRequests, 'access', _305 => _305[0], 'optionalAccess', _306 => _306.iid]);
10356
+ return _optionalChain([mergeRequests, 'access', _309 => _309[0], 'optionalAccess', _310 => _310.iid]);
10151
10357
  }
10152
10358
  async closePullRequest({
10153
10359
  pullRequestNumber
@@ -10237,7 +10443,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
10237
10443
  }
10238
10444
  const env = {
10239
10445
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
10240
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _307 => _307.pullRequest, 'optionalAccess', _308 => _308.toString, 'call', _309 => _309()]) || "false",
10446
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _311 => _311.pullRequest, 'optionalAccess', _312 => _312.toString, 'call', _313 => _313()]) || "false",
10241
10447
  ...options.commitMessage && {
10242
10448
  LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
10243
10449
  },
@@ -10257,7 +10463,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
10257
10463
  const { isPullRequestMode } = platformKit.config;
10258
10464
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
10259
10465
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
10260
- const canRun = await _optionalChain([flow, 'access', _310 => _310.preRun, 'optionalCall', _311 => _311()]);
10466
+ const canRun = await _optionalChain([flow, 'access', _314 => _314.preRun, 'optionalCall', _315 => _315()]);
10261
10467
  if (canRun === false) {
10262
10468
  return;
10263
10469
  }
@@ -10267,7 +10473,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
10267
10473
  if (!hasChanges) {
10268
10474
  return;
10269
10475
  }
10270
- await _optionalChain([flow, 'access', _312 => _312.postRun, 'optionalCall', _313 => _313()]);
10476
+ await _optionalChain([flow, 'access', _316 => _316.postRun, 'optionalCall', _317 => _317()]);
10271
10477
  });
10272
10478
  function parseBooleanArg(val) {
10273
10479
  if (val === true) return true;
@@ -10304,8 +10510,8 @@ function exitGracefully(elapsedMs = 0) {
10304
10510
  }
10305
10511
  }
10306
10512
  function checkForPendingOperations() {
10307
- const activeHandles = _optionalChain([process, 'access', _314 => _314._getActiveHandles, 'optionalCall', _315 => _315()]) || [];
10308
- const activeRequests = _optionalChain([process, 'access', _316 => _316._getActiveRequests, 'optionalCall', _317 => _317()]) || [];
10513
+ const activeHandles = _optionalChain([process, 'access', _318 => _318._getActiveHandles, 'optionalCall', _319 => _319()]) || [];
10514
+ const activeRequests = _optionalChain([process, 'access', _320 => _320._getActiveRequests, 'optionalCall', _321 => _321()]) || [];
10309
10515
  const nonStandardHandles = activeHandles.filter((handle) => {
10310
10516
  if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
10311
10517
  return false;
@@ -10371,17 +10577,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
10371
10577
  flags
10372
10578
  });
10373
10579
  let buckets = getBuckets(i18nConfig);
10374
- if (_optionalChain([flags, 'access', _318 => _318.bucket, 'optionalAccess', _319 => _319.length])) {
10580
+ if (_optionalChain([flags, 'access', _322 => _322.bucket, 'optionalAccess', _323 => _323.length])) {
10375
10581
  buckets = buckets.filter(
10376
10582
  (bucket) => flags.bucket.includes(bucket.type)
10377
10583
  );
10378
10584
  }
10379
10585
  ora.succeed("Buckets retrieved");
10380
- if (_optionalChain([flags, 'access', _320 => _320.file, 'optionalAccess', _321 => _321.length])) {
10586
+ if (_optionalChain([flags, 'access', _324 => _324.file, 'optionalAccess', _325 => _325.length])) {
10381
10587
  buckets = buckets.map((bucket) => {
10382
10588
  const paths = bucket.paths.filter(
10383
10589
  (path18) => flags.file.find(
10384
- (file) => _optionalChain([path18, 'access', _322 => _322.pathPattern, 'optionalAccess', _323 => _323.includes, 'call', _324 => _324(file)]) || _optionalChain([path18, 'access', _325 => _325.pathPattern, 'optionalAccess', _326 => _326.match, 'call', _327 => _327(file)]) || minimatch(path18.pathPattern, file)
10590
+ (file) => _optionalChain([path18, 'access', _326 => _326.pathPattern, 'optionalAccess', _327 => _327.includes, 'call', _328 => _328(file)]) || _optionalChain([path18, 'access', _329 => _329.pathPattern, 'optionalAccess', _330 => _330.match, 'call', _331 => _331(file)]) || minimatch(path18.pathPattern, file)
10385
10591
  )
10386
10592
  );
10387
10593
  return { ...bucket, paths };
@@ -10401,7 +10607,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
10401
10607
  });
10402
10608
  }
10403
10609
  }
10404
- const targetLocales = _optionalChain([flags, 'access', _328 => _328.locale, 'optionalAccess', _329 => _329.length]) ? flags.locale : i18nConfig.locale.targets;
10610
+ const targetLocales = _optionalChain([flags, 'access', _332 => _332.locale, 'optionalAccess', _333 => _333.length]) ? flags.locale : i18nConfig.locale.targets;
10405
10611
  let totalSourceKeyCount = 0;
10406
10612
  let uniqueKeysToTranslate = 0;
10407
10613
  let totalExistingTranslations = 0;
@@ -10806,12 +11012,12 @@ function validateParams2(i18nConfig, flags) {
10806
11012
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
10807
11013
  docUrl: "bucketNotFound"
10808
11014
  });
10809
- } else if (_optionalChain([flags, 'access', _330 => _330.locale, 'optionalAccess', _331 => _331.some, 'call', _332 => _332((locale) => !i18nConfig.locale.targets.includes(locale))])) {
11015
+ } else if (_optionalChain([flags, 'access', _334 => _334.locale, 'optionalAccess', _335 => _335.some, 'call', _336 => _336((locale) => !i18nConfig.locale.targets.includes(locale))])) {
10810
11016
  throw new CLIError({
10811
11017
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
10812
11018
  docUrl: "localeTargetNotFound"
10813
11019
  });
10814
- } else if (_optionalChain([flags, 'access', _333 => _333.bucket, 'optionalAccess', _334 => _334.some, 'call', _335 => _335(
11020
+ } else if (_optionalChain([flags, 'access', _337 => _337.bucket, 'optionalAccess', _338 => _338.some, 'call', _339 => _339(
10815
11021
  (bucket) => !i18nConfig.buckets[bucket]
10816
11022
  )])) {
10817
11023
  throw new CLIError({
@@ -10903,7 +11109,7 @@ async function renderHero2() {
10903
11109
  // package.json
10904
11110
  var package_default = {
10905
11111
  name: "lingo.dev",
10906
- version: "0.111.4",
11112
+ version: "0.111.5",
10907
11113
  description: "Lingo.dev CLI",
10908
11114
  private: false,
10909
11115
  publishConfig: {
@@ -11181,7 +11387,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
11181
11387
  if (options.file && options.file.length) {
11182
11388
  buckets = buckets.map((bucket) => {
11183
11389
  const paths = bucket.paths.filter(
11184
- (bucketPath) => _optionalChain([options, 'access', _336 => _336.file, 'optionalAccess', _337 => _337.some, 'call', _338 => _338((f) => bucketPath.pathPattern.includes(f))])
11390
+ (bucketPath) => _optionalChain([options, 'access', _340 => _340.file, 'optionalAccess', _341 => _341.some, 'call', _342 => _342((f) => bucketPath.pathPattern.includes(f))])
11185
11391
  );
11186
11392
  return { ...bucket, paths };
11187
11393
  }).filter((bucket) => bucket.paths.length > 0);