lingo.dev 0.99.3 → 0.99.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
@@ -17,14 +17,14 @@ var _ini = require('ini'); var _ini2 = _interopRequireDefault(_ini);
17
17
  function getSettings(explicitApiKey) {
18
18
  const env = _loadEnv();
19
19
  const systemFile = _loadSystemFile();
20
- const defaults = _loadDefaults();
20
+ const defaults2 = _loadDefaults();
21
21
  _legacyEnvVarWarning();
22
22
  _envVarsInfo();
23
23
  return {
24
24
  auth: {
25
- apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access', _34 => _34.auth, 'optionalAccess', _35 => _35.apiKey]) || defaults.auth.apiKey,
26
- apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access', _36 => _36.auth, 'optionalAccess', _37 => _37.apiUrl]) || defaults.auth.apiUrl,
27
- webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access', _38 => _38.auth, 'optionalAccess', _39 => _39.webUrl]) || defaults.auth.webUrl
25
+ apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access', _34 => _34.auth, 'optionalAccess', _35 => _35.apiKey]) || defaults2.auth.apiKey,
26
+ apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access', _36 => _36.auth, 'optionalAccess', _37 => _37.apiUrl]) || defaults2.auth.apiUrl,
27
+ webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access', _38 => _38.auth, 'optionalAccess', _39 => _39.webUrl]) || defaults2.auth.webUrl
28
28
  },
29
29
  llm: {
30
30
  openaiApiKey: env.OPENAI_API_KEY || _optionalChain([systemFile, 'access', _40 => _40.llm, 'optionalAccess', _41 => _41.openaiApiKey]),
@@ -189,20 +189,20 @@ function _envVarsInfo() {
189
189
 
190
190
  // src/cli/utils/errors.ts
191
191
  var docLinks = {
192
- i18nNotFound: "https://docs.lingo.dev/quickstart#initialization",
193
- bucketNotFound: "https://docs.lingo.dev/config#buckets",
194
- authError: "https://docs.lingo.dev/auth",
195
- localeTargetNotFound: "https://docs.lingo.dev/config#locale",
196
- lockFiletNotFound: "https://docs.lingo.dev/config#i18n-lock",
197
- failedReplexicaEngine: "https://docs.lingo.dev/",
198
- placeHolderFailed: "https://docs.lingo.dev/formats/json",
199
- translationFailed: "https://docs.lingo.dev/setup/cli#core-command-i18n",
200
- connectionFailed: "https://docs.lingo.dev/",
201
- invalidType: "https://docs.lingo.dev/setup/cli#configuration-commands",
202
- invalidPathPattern: "https://docs.lingo.dev/config#buckets",
203
- androidResouceError: "https://docs.lingo.dev/formats/android",
204
- invalidBucketType: "https://docs.lingo.dev/config#buckets",
205
- invalidStringDict: "https://docs.lingo.dev/formats/xcode-stringsdict"
192
+ i18nNotFound: "https://lingo.dev/cli",
193
+ bucketNotFound: "https://lingo.dev/cli",
194
+ authError: "https://lingo.dev/cli",
195
+ localeTargetNotFound: "https://lingo.dev/cli",
196
+ lockFiletNotFound: "https://lingo.dev/cli",
197
+ failedReplexicaEngine: "https://lingo.dev/cli",
198
+ placeHolderFailed: "https://lingo.dev/cli",
199
+ translationFailed: "https://lingo.dev/cli",
200
+ connectionFailed: "https://lingo.dev/cli",
201
+ invalidType: "https://lingo.dev/cli",
202
+ invalidPathPattern: "https://lingo.dev/cli",
203
+ androidResouceError: "https://lingo.dev/cli",
204
+ invalidBucketType: "https://lingo.dev/cli",
205
+ invalidStringDict: "https://lingo.dev/cli"
206
206
  };
207
207
  var CLIError = class extends Error {
208
208
 
@@ -549,7 +549,7 @@ var _prompts = require('@inquirer/prompts');
549
549
 
550
550
  // src/cli/utils/find-locale-paths.ts
551
551
 
552
- var _glob = require('glob');
552
+ var _glob2 = require('glob');
553
553
 
554
554
 
555
555
  function findLocaleFiles(bucket) {
@@ -578,20 +578,20 @@ function findLocaleFiles(bucket) {
578
578
  return null;
579
579
  }
580
580
  }
581
- function findLocaleFilesWithExtension(ext) {
582
- const files = _glob.glob.sync(`**/*${ext}`, {
581
+ function findLocaleFilesWithExtension(ext2) {
582
+ const files = _glob2.glob.sync(`**/*${ext2}`, {
583
583
  ignore: ["node_modules/**", "package*.json", "i18n.json", "lingo.json"]
584
584
  });
585
- const localeFilePattern = new RegExp(`/([a-z]{2}(-[A-Z]{2})?)${ext}$`);
586
- const localeDirectoryPattern = new RegExp(`/([a-z]{2}(-[A-Z]{2})?)/[^/]+${ext}$`);
585
+ const localeFilePattern = new RegExp(`/([a-z]{2}(-[A-Z]{2})?)${ext2}$`);
586
+ const localeDirectoryPattern = new RegExp(`/([a-z]{2}(-[A-Z]{2})?)/[^/]+${ext2}$`);
587
587
  const potentialLocaleFiles = files.filter(
588
588
  (file) => localeFilePattern.test(file) || localeDirectoryPattern.test(file)
589
589
  );
590
590
  const potantialLocaleFilesAndPatterns = potentialLocaleFiles.map((file) => {
591
591
  const matchPotentialLocales = Array.from(
592
- file.matchAll(new RegExp(`/([a-z]{2}(-[A-Z]{2})?|[^/]+)(?=/|${ext})`, "g"))
592
+ file.matchAll(new RegExp(`/([a-z]{2}(-[A-Z]{2})?|[^/]+)(?=/|${ext2})`, "g"))
593
593
  );
594
- const potantialLocales = matchPotentialLocales.map((match) => match[1]);
594
+ const potantialLocales = matchPotentialLocales.map((match2) => match2[1]);
595
595
  return { file, potantialLocales };
596
596
  }).map(({ file, potantialLocales }) => {
597
597
  for (const locale of potantialLocales) {
@@ -604,12 +604,12 @@ function findLocaleFilesWithExtension(ext) {
604
604
  return { file, locale: null };
605
605
  }).filter(({ locale }) => locale !== null);
606
606
  const localeFilesAndPatterns = potantialLocaleFilesAndPatterns.map(({ file, locale }) => {
607
- const pattern = file.replaceAll(new RegExp(`/${locale}${ext}`, "g"), `/[locale]${ext}`).replaceAll(new RegExp(`/${locale}/`, "g"), `/[locale]/`).replaceAll(new RegExp(`/${locale}/`, "g"), `/[locale]/`);
607
+ const pattern = file.replaceAll(new RegExp(`/${locale}${ext2}`, "g"), `/[locale]${ext2}`).replaceAll(new RegExp(`/${locale}/`, "g"), `/[locale]/`).replaceAll(new RegExp(`/${locale}/`, "g"), `/[locale]/`);
608
608
  return { pattern, file };
609
609
  });
610
610
  const grouppedFilesAndPatterns = _lodash2.default.groupBy(localeFilesAndPatterns, "pattern");
611
611
  const patterns = Object.keys(grouppedFilesAndPatterns);
612
- const defaultPatterns = [`i18n/[locale]${ext}`];
612
+ const defaultPatterns = [`i18n/[locale]${ext2}`];
613
613
  if (patterns.length > 0) {
614
614
  return { patterns, defaultPatterns };
615
615
  }
@@ -617,7 +617,7 @@ function findLocaleFilesWithExtension(ext) {
617
617
  }
618
618
  function findLocaleFilesForFilename(fileName) {
619
619
  const pattern = fileName;
620
- const localeFiles = _glob.glob.sync(`**/${fileName}`, {
620
+ const localeFiles = _glob2.glob.sync(`**/${fileName}`, {
621
621
  ignore: ["node_modules/**", "package*.json", "i18n.json", "lingo.json"]
622
622
  });
623
623
  const localeFilesAndPatterns = localeFiles.map((file) => ({
@@ -649,9 +649,9 @@ function ensurePatterns(patterns, source) {
649
649
  }
650
650
  });
651
651
  }
652
- function getDefaultContent(ext, source) {
652
+ function getDefaultContent(ext2, source) {
653
653
  const defaultGreeting = "Hello from Lingo.dev";
654
- switch (ext) {
654
+ switch (ext2) {
655
655
  case ".json":
656
656
  case ".arb":
657
657
  return `{
@@ -711,7 +711,7 @@ function getDefaultContent(ext, source) {
711
711
  </dict>
712
712
  </plist>`;
713
713
  default:
714
- throw new Error(`Unsupported file extension: ${ext}`);
714
+ throw new Error(`Unsupported file extension: ${ext2}`);
715
715
  }
716
716
  }
717
717
 
@@ -764,7 +764,7 @@ async function initCICD(spinner) {
764
764
  message: "Would you like to use Lingo.dev in your CI/CD?"
765
765
  });
766
766
  if (!init) {
767
- spinner.warn("CI/CD not initialized. To set it up later, see docs: https://docs.lingo.dev/ci-action/overview");
767
+ spinner.warn("CI/CD not initialized. To set it up later, see docs: https://lingo.dev/ci");
768
768
  return;
769
769
  }
770
770
  const selectedPlatforms = await _prompts.checkbox.call(void 0, {
@@ -881,9 +881,9 @@ function makeGitlabInitializer(spinner) {
881
881
 
882
882
  // src/cli/cmd/init.ts
883
883
 
884
- var openUrl = (path16) => {
884
+ var openUrl = (path17) => {
885
885
  const settings = getSettings(void 0);
886
- _open2.default.call(void 0, `${settings.auth.webUrl}${path16}`, { wait: false });
886
+ _open2.default.call(void 0, `${settings.auth.webUrl}${path17}`, { wait: false });
887
887
  };
888
888
  var throwHelpError = (option, value) => {
889
889
  if (value === "help") {
@@ -1047,7 +1047,7 @@ var init_default = new (0, _interactivecommander.InteractiveCommand)().command("
1047
1047
  }
1048
1048
  updateGitignore();
1049
1049
  if (!isInteractive) {
1050
- _ora2.default.call(void 0, ).info("Please see https://docs.lingo.dev/");
1050
+ _ora2.default.call(void 0, ).info("Please see https://lingo.dev/cli");
1051
1051
  }
1052
1052
  });
1053
1053
 
@@ -1199,7 +1199,7 @@ function expandPlaceholderedGlob(_pathPattern, sourceLocale) {
1199
1199
  []
1200
1200
  );
1201
1201
  const sourcePathPattern = pathPattern.replaceAll(/\[locale\]/g, sourceLocale);
1202
- const sourcePaths = _glob.glob.sync(sourcePathPattern, { follow: true, withFileTypes: true }).filter((file) => file.isFile() || file.isSymbolicLink()).map((file) => file.fullpath()).map((fullpath) => path12.default.relative(process.cwd(), fullpath));
1202
+ const sourcePaths = _glob2.glob.sync(sourcePathPattern, { follow: true, withFileTypes: true }).filter((file) => file.isFile() || file.isSymbolicLink()).map((file) => file.fullpath()).map((fullpath) => path12.default.relative(process.cwd(), fullpath));
1203
1203
  const placeholderedPaths = sourcePaths.map((sourcePath) => {
1204
1204
  const sourcePathChunks = sourcePath.split(path12.default.sep);
1205
1205
  localeSegmentIndexes.forEach((localeSegmentIndex) => {
@@ -1208,9 +1208,9 @@ function expandPlaceholderedGlob(_pathPattern, sourceLocale) {
1208
1208
  const regexp = new RegExp(
1209
1209
  "(" + pathPatternChunk.replaceAll(".", "\\.").replaceAll("*", ".*").replace("[locale]", `)${sourceLocale}(`) + ")"
1210
1210
  );
1211
- const match = sourcePathChunk.match(regexp);
1212
- if (match) {
1213
- const [, prefix, suffix] = match;
1211
+ const match2 = sourcePathChunk.match(regexp);
1212
+ if (match2) {
1213
+ const [, prefix, suffix] = match2;
1214
1214
  const placeholderedSegment = prefix + "[locale]" + suffix;
1215
1215
  sourcePathChunks[localeSegmentIndex] = placeholderedSegment;
1216
1216
  }
@@ -1257,8 +1257,8 @@ var files_default = new (0, _interactivecommander.Command)().command("files").de
1257
1257
  } else if (type.target) {
1258
1258
  result.push(...targetPaths);
1259
1259
  }
1260
- result.forEach((path16) => {
1261
- console.log(path16);
1260
+ result.forEach((path17) => {
1261
+ console.log(path17);
1262
1262
  });
1263
1263
  }
1264
1264
  }
@@ -1757,7 +1757,7 @@ function createAndroidLoader() {
1757
1757
  continue;
1758
1758
  }
1759
1759
  const cdataRegex = /<!\[CDATA\[([\s\S]*?)\]\]>/g;
1760
- value = value.replace(cdataRegex, (match, content) => content);
1760
+ value = value.replace(cdataRegex, (match2, content) => content);
1761
1761
  value = value.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/\\'/g, "'");
1762
1762
  result[name] = value;
1763
1763
  }
@@ -2071,9 +2071,9 @@ function createHtmlLoader() {
2071
2071
  const bDepth = b.split("/").length;
2072
2072
  return aDepth - bDepth;
2073
2073
  });
2074
- paths.forEach((path16) => {
2075
- const value = data[path16];
2076
- const [nodePath, attribute] = path16.split("#");
2074
+ paths.forEach((path17) => {
2075
+ const value = data[path17];
2076
+ const [nodePath, attribute] = path17.split("#");
2077
2077
  const [rootTag, ...indices] = nodePath.split("/");
2078
2078
  let parent = rootTag === "head" ? document.head : document.body;
2079
2079
  let current = parent;
@@ -2201,9 +2201,9 @@ function createXcodeStringsLoader() {
2201
2201
  for (const line of lines) {
2202
2202
  const trimmedLine = line.trim();
2203
2203
  if (trimmedLine && !trimmedLine.startsWith("//")) {
2204
- const match = trimmedLine.match(/^"(.+)"\s*=\s*"(.+)";$/);
2205
- if (match) {
2206
- const [, key, value] = match;
2204
+ const match2 = trimmedLine.match(/^"(.+)"\s*=\s*"(.+)";$/);
2205
+ if (match2) {
2206
+ const [, key, value] = match2;
2207
2207
  result[key] = unescapeXcodeString(value);
2208
2208
  }
2209
2209
  }
@@ -3199,18 +3199,18 @@ function createRawDatoValue(parsedDatoValue, originalRawDatoValue, isClean = fal
3199
3199
  }
3200
3200
  function serializeStructuredText(rawStructuredText) {
3201
3201
  return serializeStructuredTextNode(rawStructuredText);
3202
- function serializeStructuredTextNode(node, path16 = [], acc = {}) {
3202
+ function serializeStructuredTextNode(node, path17 = [], acc = {}) {
3203
3203
  if ("document" in node) {
3204
- return serializeStructuredTextNode(node.document, [...path16, "document"], acc);
3204
+ return serializeStructuredTextNode(node.document, [...path17, "document"], acc);
3205
3205
  }
3206
3206
  if (!_lodash2.default.isNil(node.value)) {
3207
- acc[[...path16, "value"].join(".")] = node.value;
3207
+ acc[[...path17, "value"].join(".")] = node.value;
3208
3208
  } else if (_lodash2.default.get(node, "type") === "block") {
3209
- acc[[...path16, "item"].join(".")] = serializeBlock(node.item);
3209
+ acc[[...path17, "item"].join(".")] = serializeBlock(node.item);
3210
3210
  }
3211
3211
  if (node.children) {
3212
3212
  for (let i = 0; i < node.children.length; i++) {
3213
- serializeStructuredTextNode(node.children[i], [...path16, i.toString()], acc);
3213
+ serializeStructuredTextNode(node.children[i], [...path17, i.toString()], acc);
3214
3214
  }
3215
3215
  }
3216
3216
  return acc;
@@ -3269,8 +3269,8 @@ function deserializeBlockList(parsedBlockList, originalRawBlockList, isClean = f
3269
3269
  }
3270
3270
  function deserializeStructuredText(parsedStructuredText, originalRawStructuredText) {
3271
3271
  const result = _lodash2.default.cloneDeep(originalRawStructuredText);
3272
- for (const [path16, value] of _lodash2.default.entries(parsedStructuredText)) {
3273
- const realPath = _lodash2.default.chain(path16.split(".")).flatMap((s) => !_lodash2.default.isNaN(_lodash2.default.toNumber(s)) ? ["children", s] : s).value();
3272
+ for (const [path17, value] of _lodash2.default.entries(parsedStructuredText)) {
3273
+ const realPath = _lodash2.default.chain(path17.split(".")).flatMap((s) => !_lodash2.default.isNaN(_lodash2.default.toNumber(s)) ? ["children", s] : s).value();
3274
3274
  const deserializedValue = createRawDatoValue(value, _lodash2.default.get(originalRawStructuredText, realPath), true);
3275
3275
  _lodash2.default.set(result, realPath, deserializedValue);
3276
3276
  }
@@ -3370,11 +3370,11 @@ function variableExtractLoader(params) {
3370
3370
  variables: []
3371
3371
  };
3372
3372
  for (let i = 0; i < matches.length; i++) {
3373
- const match = matches[i];
3373
+ const match2 = matches[i];
3374
3374
  const currentValue = result[key].value;
3375
- const newValue = _optionalChain([currentValue, 'optionalAccess', _169 => _169.replace, 'call', _170 => _170(match, `{variable:${i}}`)]);
3375
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _169 => _169.replace, 'call', _170 => _170(match2, `{variable:${i}}`)]);
3376
3376
  result[key].value = newValue;
3377
- result[key].variables[i] = match;
3377
+ result[key].variables[i] = match2;
3378
3378
  }
3379
3379
  }
3380
3380
  return result;
@@ -3485,8 +3485,8 @@ ${currentIndent}}`;
3485
3485
  return result;
3486
3486
  }
3487
3487
  function detectIndentation(jsonStr) {
3488
- const match = jsonStr.match(/\n(\s+)/);
3489
- return match ? match[1] : " ";
3488
+ const match2 = jsonStr.match(/\n(\s+)/);
3489
+ return match2 ? match2[1] : " ";
3490
3490
  }
3491
3491
 
3492
3492
  // src/cli/loaders/plutil-json-loader.ts
@@ -3584,11 +3584,11 @@ ${JSON.stringify(parsed.i18n, null, 2)}
3584
3584
  });
3585
3585
  }
3586
3586
  function parseVueFile(input2) {
3587
- const match = input2.match(/^([\s\S]*)<i18n>([\s\S]*)<\/i18n>([\s\S]*)$/);
3588
- if (!match) {
3587
+ const match2 = input2.match(/^([\s\S]*)<i18n>([\s\S]*)<\/i18n>([\s\S]*)$/);
3588
+ if (!match2) {
3589
3589
  return null;
3590
3590
  }
3591
- const [, before, jsonString = "{}", after] = match;
3591
+ const [, before, jsonString = "{}", after] = match2;
3592
3592
  let i18n;
3593
3593
  try {
3594
3594
  i18n = JSON.parse(jsonString);
@@ -3656,15 +3656,15 @@ function parseTypeScript(input2) {
3656
3656
  function extractStringsFromDefaultExport(ast) {
3657
3657
  let extracted = {};
3658
3658
  traverse(ast, {
3659
- ExportDefaultDeclaration(path16) {
3660
- const { declaration } = path16.node;
3659
+ ExportDefaultDeclaration(path17) {
3660
+ const { declaration } = path17.node;
3661
3661
  const decl = unwrapTSAsExpression(declaration);
3662
3662
  if (t.isObjectExpression(decl)) {
3663
3663
  extracted = objectExpressionToObject(decl);
3664
3664
  } else if (t.isArrayExpression(decl)) {
3665
3665
  extracted = arrayExpressionToArray(decl);
3666
3666
  } else if (t.isIdentifier(decl)) {
3667
- const binding = path16.scope.bindings[decl.name];
3667
+ const binding = path17.scope.bindings[decl.name];
3668
3668
  if (binding && t.isVariableDeclarator(binding.path.node) && binding.path.node.init) {
3669
3669
  const initRaw = binding.path.node.init;
3670
3670
  const init = initRaw ? unwrapTSAsExpression(initRaw) : initRaw;
@@ -3729,8 +3729,8 @@ function arrayExpressionToArray(arrayExpression) {
3729
3729
  function updateStringsInDefaultExport(ast, data) {
3730
3730
  let modified = false;
3731
3731
  traverse(ast, {
3732
- ExportDefaultDeclaration(path16) {
3733
- const { declaration } = path16.node;
3732
+ ExportDefaultDeclaration(path17) {
3733
+ const { declaration } = path17.node;
3734
3734
  const decl = unwrapTSAsExpression(declaration);
3735
3735
  if (t.isObjectExpression(decl)) {
3736
3736
  modified = updateStringsInObjectExpression(decl, data) || modified;
@@ -3739,7 +3739,7 @@ function updateStringsInDefaultExport(ast, data) {
3739
3739
  modified = updateStringsInArrayExpression(decl, data) || modified;
3740
3740
  }
3741
3741
  } else if (t.isIdentifier(decl)) {
3742
- modified = updateStringsInExportedIdentifier(path16, data) || modified;
3742
+ modified = updateStringsInExportedIdentifier(path17, data) || modified;
3743
3743
  }
3744
3744
  }
3745
3745
  });
@@ -3810,9 +3810,9 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
3810
3810
  });
3811
3811
  return modified;
3812
3812
  }
3813
- function updateStringsInExportedIdentifier(path16, data) {
3814
- const exportName = path16.node.declaration.name;
3815
- const binding = path16.scope.bindings[exportName];
3813
+ function updateStringsInExportedIdentifier(path17, data) {
3814
+ const exportName = path17.node.declaration.name;
3815
+ const binding = path17.scope.bindings[exportName];
3816
3816
  if (!binding || !binding.path.node) return false;
3817
3817
  if (t.isVariableDeclarator(binding.path.node) && binding.path.node.init) {
3818
3818
  const initRaw = binding.path.node.init;
@@ -3940,14 +3940,14 @@ function ensureSurroundingImageNewlines(_content) {
3940
3940
  found = false;
3941
3941
  const matches = workingContent.match(imageRegex);
3942
3942
  if (matches) {
3943
- const match = matches[0];
3944
- const replacement = match.trim().startsWith(">") ? match : `
3943
+ const match2 = matches[0];
3944
+ const replacement = match2.trim().startsWith(">") ? match2 : `
3945
3945
 
3946
- ${match}
3946
+ ${match2}
3947
3947
 
3948
3948
  `;
3949
- content = content.replaceAll(match, replacement);
3950
- workingContent = workingContent.replaceAll(match, "");
3949
+ content = content.replaceAll(match2, replacement);
3950
+ workingContent = workingContent.replaceAll(match2, "");
3951
3951
  found = true;
3952
3952
  }
3953
3953
  } while (found);
@@ -3962,14 +3962,14 @@ function ensureTrailingFenceNewline(_content) {
3962
3962
  found = false;
3963
3963
  const matches = workingContent.match(fenceRegex);
3964
3964
  if (matches) {
3965
- const match = matches[0];
3966
- const replacement = match.trim().startsWith(">") ? match : `
3965
+ const match2 = matches[0];
3966
+ const replacement = match2.trim().startsWith(">") ? match2 : `
3967
3967
 
3968
- ${match}
3968
+ ${match2}
3969
3969
 
3970
3970
  `;
3971
- content = content.replaceAll(match, replacement);
3972
- workingContent = workingContent.replaceAll(match, "");
3971
+ content = content.replaceAll(match2, replacement);
3972
+ workingContent = workingContent.replaceAll(match2, "");
3973
3973
  found = true;
3974
3974
  }
3975
3975
  } while (found);
@@ -3982,8 +3982,8 @@ function extractCodePlaceholders(content) {
3982
3982
  finalContent = ensureSurroundingImageNewlines(finalContent);
3983
3983
  const codePlaceholders = {};
3984
3984
  const codeBlockMatches = finalContent.matchAll(fenceRegex);
3985
- for (const match of codeBlockMatches) {
3986
- const codeBlock = match[0];
3985
+ for (const match2 of codeBlockMatches) {
3986
+ const codeBlock = match2[0];
3987
3987
  const codeBlockHash = md5(codeBlock);
3988
3988
  const placeholder = `---CODE-PLACEHOLDER-${codeBlockHash}---`;
3989
3989
  codePlaceholders[placeholder] = codeBlock;
@@ -3991,8 +3991,8 @@ function extractCodePlaceholders(content) {
3991
3991
  finalContent = finalContent.replace(codeBlock, replacement);
3992
3992
  }
3993
3993
  const inlineCodeMatches = finalContent.matchAll(inlineCodeRegex);
3994
- for (const match of inlineCodeMatches) {
3995
- const inlineCode = match[0];
3994
+ for (const match2 of inlineCodeMatches) {
3995
+ const inlineCode = match2[0];
3996
3996
  const inlineCodeHash = md5(inlineCode);
3997
3997
  const placeholder = `---INLINE-CODE-PLACEHOLDER-${inlineCodeHash}---`;
3998
3998
  codePlaceholders[placeholder] = inlineCode;
@@ -4081,8 +4081,8 @@ function extractLockedPatterns(content, patterns = []) {
4081
4081
  try {
4082
4082
  const pattern = new RegExp(patternStr, "gm");
4083
4083
  const matches = Array.from(finalContent.matchAll(pattern));
4084
- for (const match of matches) {
4085
- const matchedText = match[0];
4084
+ for (const match2 of matches) {
4085
+ const matchedText = match2[0];
4086
4086
  const matchHash = md5(matchedText);
4087
4087
  const placeholder = `---LOCKED-PATTERN-${matchHash}---`;
4088
4088
  lockedPlaceholders[placeholder] = matchedText;
@@ -4873,7 +4873,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
4873
4873
  if (_optionalChain([flags, 'access', _184 => _184.file, 'optionalAccess', _185 => _185.length])) {
4874
4874
  buckets = buckets.map((bucket) => {
4875
4875
  const paths = bucket.paths.filter(
4876
- (path16) => flags.file.find((file) => _optionalChain([path16, 'access', _186 => _186.pathPattern, 'optionalAccess', _187 => _187.includes, 'call', _188 => _188(file)]))
4876
+ (path17) => flags.file.find((file) => _optionalChain([path17, 'access', _186 => _186.pathPattern, 'optionalAccess', _187 => _187.includes, 'call', _188 => _188(file)]))
4877
4877
  );
4878
4878
  return { ...bucket, paths };
4879
4879
  }).filter((bucket) => bucket.paths.length > 0);
@@ -4886,8 +4886,8 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
4886
4886
  ora.info(`\x1B[36mProcessing only filtered buckets:\x1B[0m`);
4887
4887
  buckets.map((bucket) => {
4888
4888
  ora.info(` ${bucket.type}:`);
4889
- bucket.paths.forEach((path16) => {
4890
- ora.info(` - ${path16.pathPattern}`);
4889
+ bucket.paths.forEach((path17) => {
4890
+ ora.info(` - ${path17.pathPattern}`);
4891
4891
  });
4892
4892
  });
4893
4893
  }
@@ -6077,6 +6077,1546 @@ async function plan(input2) {
6077
6077
 
6078
6078
  var _plimit = require('p-limit'); var _plimit2 = _interopRequireDefault(_plimit);
6079
6079
 
6080
+
6081
+ // ../../node_modules/.pnpm/@isaacs+balanced-match@4.0.1/node_modules/@isaacs/balanced-match/dist/esm/index.js
6082
+ var balanced = (a, b, str) => {
6083
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
6084
+ const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
6085
+ const r = ma !== null && mb != null && range(ma, mb, str);
6086
+ return r && {
6087
+ start: r[0],
6088
+ end: r[1],
6089
+ pre: str.slice(0, r[0]),
6090
+ body: str.slice(r[0] + ma.length, r[1]),
6091
+ post: str.slice(r[1] + mb.length)
6092
+ };
6093
+ };
6094
+ var maybeMatch = (reg, str) => {
6095
+ const m = str.match(reg);
6096
+ return m ? m[0] : null;
6097
+ };
6098
+ var range = (a, b, str) => {
6099
+ let begs, beg, left, right = void 0, result;
6100
+ let ai = str.indexOf(a);
6101
+ let bi = str.indexOf(b, ai + 1);
6102
+ let i = ai;
6103
+ if (ai >= 0 && bi > 0) {
6104
+ if (a === b) {
6105
+ return [ai, bi];
6106
+ }
6107
+ begs = [];
6108
+ left = str.length;
6109
+ while (i >= 0 && !result) {
6110
+ if (i === ai) {
6111
+ begs.push(i);
6112
+ ai = str.indexOf(a, i + 1);
6113
+ } else if (begs.length === 1) {
6114
+ const r = begs.pop();
6115
+ if (r !== void 0)
6116
+ result = [r, bi];
6117
+ } else {
6118
+ beg = begs.pop();
6119
+ if (beg !== void 0 && beg < left) {
6120
+ left = beg;
6121
+ right = bi;
6122
+ }
6123
+ bi = str.indexOf(b, i + 1);
6124
+ }
6125
+ i = ai < bi && ai >= 0 ? ai : bi;
6126
+ }
6127
+ if (begs.length && right !== void 0) {
6128
+ result = [left, right];
6129
+ }
6130
+ }
6131
+ return result;
6132
+ };
6133
+
6134
+ // ../../node_modules/.pnpm/@isaacs+brace-expansion@5.0.0/node_modules/@isaacs/brace-expansion/dist/esm/index.js
6135
+ var escSlash = "\0SLASH" + Math.random() + "\0";
6136
+ var escOpen = "\0OPEN" + Math.random() + "\0";
6137
+ var escClose = "\0CLOSE" + Math.random() + "\0";
6138
+ var escComma = "\0COMMA" + Math.random() + "\0";
6139
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
6140
+ var escSlashPattern = new RegExp(escSlash, "g");
6141
+ var escOpenPattern = new RegExp(escOpen, "g");
6142
+ var escClosePattern = new RegExp(escClose, "g");
6143
+ var escCommaPattern = new RegExp(escComma, "g");
6144
+ var escPeriodPattern = new RegExp(escPeriod, "g");
6145
+ var slashPattern = /\\\\/g;
6146
+ var openPattern = /\\{/g;
6147
+ var closePattern = /\\}/g;
6148
+ var commaPattern = /\\,/g;
6149
+ var periodPattern = /\\./g;
6150
+ function numeric(str) {
6151
+ return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
6152
+ }
6153
+ function escapeBraces(str) {
6154
+ return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
6155
+ }
6156
+ function unescapeBraces(str) {
6157
+ return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
6158
+ }
6159
+ function parseCommaParts(str) {
6160
+ if (!str) {
6161
+ return [""];
6162
+ }
6163
+ const parts = [];
6164
+ const m = balanced("{", "}", str);
6165
+ if (!m) {
6166
+ return str.split(",");
6167
+ }
6168
+ const { pre, body, post } = m;
6169
+ const p = pre.split(",");
6170
+ p[p.length - 1] += "{" + body + "}";
6171
+ const postParts = parseCommaParts(post);
6172
+ if (post.length) {
6173
+ ;
6174
+ p[p.length - 1] += postParts.shift();
6175
+ p.push.apply(p, postParts);
6176
+ }
6177
+ parts.push.apply(parts, p);
6178
+ return parts;
6179
+ }
6180
+ function expand(str) {
6181
+ if (!str) {
6182
+ return [];
6183
+ }
6184
+ if (str.slice(0, 2) === "{}") {
6185
+ str = "\\{\\}" + str.slice(2);
6186
+ }
6187
+ return expand_(escapeBraces(str), true).map(unescapeBraces);
6188
+ }
6189
+ function embrace(str) {
6190
+ return "{" + str + "}";
6191
+ }
6192
+ function isPadded(el) {
6193
+ return /^-?0\d/.test(el);
6194
+ }
6195
+ function lte(i, y) {
6196
+ return i <= y;
6197
+ }
6198
+ function gte(i, y) {
6199
+ return i >= y;
6200
+ }
6201
+ function expand_(str, isTop) {
6202
+ const expansions = [];
6203
+ const m = balanced("{", "}", str);
6204
+ if (!m)
6205
+ return [str];
6206
+ const pre = m.pre;
6207
+ const post = m.post.length ? expand_(m.post, false) : [""];
6208
+ if (/\$$/.test(m.pre)) {
6209
+ for (let k = 0; k < post.length; k++) {
6210
+ const expansion = pre + "{" + m.body + "}" + post[k];
6211
+ expansions.push(expansion);
6212
+ }
6213
+ } else {
6214
+ const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
6215
+ const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
6216
+ const isSequence = isNumericSequence || isAlphaSequence;
6217
+ const isOptions = m.body.indexOf(",") >= 0;
6218
+ if (!isSequence && !isOptions) {
6219
+ if (m.post.match(/,(?!,).*\}/)) {
6220
+ str = m.pre + "{" + m.body + escClose + m.post;
6221
+ return expand_(str);
6222
+ }
6223
+ return [str];
6224
+ }
6225
+ let n;
6226
+ if (isSequence) {
6227
+ n = m.body.split(/\.\./);
6228
+ } else {
6229
+ n = parseCommaParts(m.body);
6230
+ if (n.length === 1 && n[0] !== void 0) {
6231
+ n = expand_(n[0], false).map(embrace);
6232
+ if (n.length === 1) {
6233
+ return post.map((p) => m.pre + n[0] + p);
6234
+ }
6235
+ }
6236
+ }
6237
+ let N;
6238
+ if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
6239
+ const x = numeric(n[0]);
6240
+ const y = numeric(n[1]);
6241
+ const width = Math.max(n[0].length, n[1].length);
6242
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
6243
+ let test = lte;
6244
+ const reverse = y < x;
6245
+ if (reverse) {
6246
+ incr *= -1;
6247
+ test = gte;
6248
+ }
6249
+ const pad = n.some(isPadded);
6250
+ N = [];
6251
+ for (let i = x; test(i, y); i += incr) {
6252
+ let c;
6253
+ if (isAlphaSequence) {
6254
+ c = String.fromCharCode(i);
6255
+ if (c === "\\") {
6256
+ c = "";
6257
+ }
6258
+ } else {
6259
+ c = String(i);
6260
+ if (pad) {
6261
+ const need = width - c.length;
6262
+ if (need > 0) {
6263
+ const z3 = new Array(need + 1).join("0");
6264
+ if (i < 0) {
6265
+ c = "-" + z3 + c.slice(1);
6266
+ } else {
6267
+ c = z3 + c;
6268
+ }
6269
+ }
6270
+ }
6271
+ }
6272
+ N.push(c);
6273
+ }
6274
+ } else {
6275
+ N = [];
6276
+ for (let j = 0; j < n.length; j++) {
6277
+ N.push.apply(N, expand_(n[j], false));
6278
+ }
6279
+ }
6280
+ for (let j = 0; j < N.length; j++) {
6281
+ for (let k = 0; k < post.length; k++) {
6282
+ const expansion = pre + N[j] + post[k];
6283
+ if (!isTop || isSequence || expansion) {
6284
+ expansions.push(expansion);
6285
+ }
6286
+ }
6287
+ }
6288
+ }
6289
+ return expansions;
6290
+ }
6291
+
6292
+ // ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/assert-valid-pattern.js
6293
+ var MAX_PATTERN_LENGTH = 1024 * 64;
6294
+ var assertValidPattern = (pattern) => {
6295
+ if (typeof pattern !== "string") {
6296
+ throw new TypeError("invalid pattern");
6297
+ }
6298
+ if (pattern.length > MAX_PATTERN_LENGTH) {
6299
+ throw new TypeError("pattern is too long");
6300
+ }
6301
+ };
6302
+
6303
+ // ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/brace-expressions.js
6304
+ var posixClasses = {
6305
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
6306
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
6307
+ "[:ascii:]": ["\\x00-\\x7f", false],
6308
+ "[:blank:]": ["\\p{Zs}\\t", true],
6309
+ "[:cntrl:]": ["\\p{Cc}", true],
6310
+ "[:digit:]": ["\\p{Nd}", true],
6311
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
6312
+ "[:lower:]": ["\\p{Ll}", true],
6313
+ "[:print:]": ["\\p{C}", true],
6314
+ "[:punct:]": ["\\p{P}", true],
6315
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
6316
+ "[:upper:]": ["\\p{Lu}", true],
6317
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
6318
+ "[:xdigit:]": ["A-Fa-f0-9", false]
6319
+ };
6320
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
6321
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
6322
+ var rangesToString = (ranges) => ranges.join("");
6323
+ var parseClass = (glob3, position) => {
6324
+ const pos = position;
6325
+ if (glob3.charAt(pos) !== "[") {
6326
+ throw new Error("not in a brace expression");
6327
+ }
6328
+ const ranges = [];
6329
+ const negs = [];
6330
+ let i = pos + 1;
6331
+ let sawStart = false;
6332
+ let uflag = false;
6333
+ let escaping = false;
6334
+ let negate = false;
6335
+ let endPos = pos;
6336
+ let rangeStart = "";
6337
+ WHILE: while (i < glob3.length) {
6338
+ const c = glob3.charAt(i);
6339
+ if ((c === "!" || c === "^") && i === pos + 1) {
6340
+ negate = true;
6341
+ i++;
6342
+ continue;
6343
+ }
6344
+ if (c === "]" && sawStart && !escaping) {
6345
+ endPos = i + 1;
6346
+ break;
6347
+ }
6348
+ sawStart = true;
6349
+ if (c === "\\") {
6350
+ if (!escaping) {
6351
+ escaping = true;
6352
+ i++;
6353
+ continue;
6354
+ }
6355
+ }
6356
+ if (c === "[" && !escaping) {
6357
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
6358
+ if (glob3.startsWith(cls, i)) {
6359
+ if (rangeStart) {
6360
+ return ["$.", false, glob3.length - pos, true];
6361
+ }
6362
+ i += cls.length;
6363
+ if (neg)
6364
+ negs.push(unip);
6365
+ else
6366
+ ranges.push(unip);
6367
+ uflag = uflag || u;
6368
+ continue WHILE;
6369
+ }
6370
+ }
6371
+ }
6372
+ escaping = false;
6373
+ if (rangeStart) {
6374
+ if (c > rangeStart) {
6375
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
6376
+ } else if (c === rangeStart) {
6377
+ ranges.push(braceEscape(c));
6378
+ }
6379
+ rangeStart = "";
6380
+ i++;
6381
+ continue;
6382
+ }
6383
+ if (glob3.startsWith("-]", i + 1)) {
6384
+ ranges.push(braceEscape(c + "-"));
6385
+ i += 2;
6386
+ continue;
6387
+ }
6388
+ if (glob3.startsWith("-", i + 1)) {
6389
+ rangeStart = c;
6390
+ i += 2;
6391
+ continue;
6392
+ }
6393
+ ranges.push(braceEscape(c));
6394
+ i++;
6395
+ }
6396
+ if (endPos < i) {
6397
+ return ["", false, 0, false];
6398
+ }
6399
+ if (!ranges.length && !negs.length) {
6400
+ return ["$.", false, glob3.length - pos, true];
6401
+ }
6402
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
6403
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
6404
+ return [regexpEscape(r), false, endPos - pos, false];
6405
+ }
6406
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
6407
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
6408
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
6409
+ return [comb, uflag, endPos - pos, true];
6410
+ };
6411
+
6412
+ // ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/unescape.js
6413
+ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
6414
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
6415
+ };
6416
+
6417
+ // ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/ast.js
6418
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
6419
+ var isExtglobType = (c) => types.has(c);
6420
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
6421
+ var startNoDot = "(?!\\.)";
6422
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
6423
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
6424
+ var reSpecials = new Set("().*{}+?[]^$\\!");
6425
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
6426
+ var qmark = "[^/]";
6427
+ var star = qmark + "*?";
6428
+ var starNoEmpty = qmark + "+?";
6429
+ var AST = class _AST {
6430
+
6431
+ #root;
6432
+ #hasMagic;
6433
+ #uflag = false;
6434
+ #parts = [];
6435
+ #parent;
6436
+ #parentIndex;
6437
+ #negs;
6438
+ #filledNegs = false;
6439
+ #options;
6440
+ #toString;
6441
+ // set to true if it's an extglob with no children
6442
+ // (which really means one child of '')
6443
+ #emptyExt = false;
6444
+ constructor(type, parent, options = {}) {
6445
+ this.type = type;
6446
+ if (type)
6447
+ this.#hasMagic = true;
6448
+ this.#parent = parent;
6449
+ this.#root = this.#parent ? this.#parent.#root : this;
6450
+ this.#options = this.#root === this ? options : this.#root.#options;
6451
+ this.#negs = this.#root === this ? [] : this.#root.#negs;
6452
+ if (type === "!" && !this.#root.#filledNegs)
6453
+ this.#negs.push(this);
6454
+ this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
6455
+ }
6456
+ get hasMagic() {
6457
+ if (this.#hasMagic !== void 0)
6458
+ return this.#hasMagic;
6459
+ for (const p of this.#parts) {
6460
+ if (typeof p === "string")
6461
+ continue;
6462
+ if (p.type || p.hasMagic)
6463
+ return this.#hasMagic = true;
6464
+ }
6465
+ return this.#hasMagic;
6466
+ }
6467
+ // reconstructs the pattern
6468
+ toString() {
6469
+ if (this.#toString !== void 0)
6470
+ return this.#toString;
6471
+ if (!this.type) {
6472
+ return this.#toString = this.#parts.map((p) => String(p)).join("");
6473
+ } else {
6474
+ return this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
6475
+ }
6476
+ }
6477
+ #fillNegs() {
6478
+ if (this !== this.#root)
6479
+ throw new Error("should only call on root");
6480
+ if (this.#filledNegs)
6481
+ return this;
6482
+ this.toString();
6483
+ this.#filledNegs = true;
6484
+ let n;
6485
+ while (n = this.#negs.pop()) {
6486
+ if (n.type !== "!")
6487
+ continue;
6488
+ let p = n;
6489
+ let pp = p.#parent;
6490
+ while (pp) {
6491
+ for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
6492
+ for (const part of n.#parts) {
6493
+ if (typeof part === "string") {
6494
+ throw new Error("string part in extglob AST??");
6495
+ }
6496
+ part.copyIn(pp.#parts[i]);
6497
+ }
6498
+ }
6499
+ p = pp;
6500
+ pp = p.#parent;
6501
+ }
6502
+ }
6503
+ return this;
6504
+ }
6505
+ push(...parts) {
6506
+ for (const p of parts) {
6507
+ if (p === "")
6508
+ continue;
6509
+ if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
6510
+ throw new Error("invalid part: " + p);
6511
+ }
6512
+ this.#parts.push(p);
6513
+ }
6514
+ }
6515
+ toJSON() {
6516
+ const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
6517
+ if (this.isStart() && !this.type)
6518
+ ret.unshift([]);
6519
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _208 => _208.#parent, 'optionalAccess', _209 => _209.type]) === "!")) {
6520
+ ret.push({});
6521
+ }
6522
+ return ret;
6523
+ }
6524
+ isStart() {
6525
+ if (this.#root === this)
6526
+ return true;
6527
+ if (!_optionalChain([this, 'access', _210 => _210.#parent, 'optionalAccess', _211 => _211.isStart, 'call', _212 => _212()]))
6528
+ return false;
6529
+ if (this.#parentIndex === 0)
6530
+ return true;
6531
+ const p = this.#parent;
6532
+ for (let i = 0; i < this.#parentIndex; i++) {
6533
+ const pp = p.#parts[i];
6534
+ if (!(pp instanceof _AST && pp.type === "!")) {
6535
+ return false;
6536
+ }
6537
+ }
6538
+ return true;
6539
+ }
6540
+ isEnd() {
6541
+ if (this.#root === this)
6542
+ return true;
6543
+ if (_optionalChain([this, 'access', _213 => _213.#parent, 'optionalAccess', _214 => _214.type]) === "!")
6544
+ return true;
6545
+ if (!_optionalChain([this, 'access', _215 => _215.#parent, 'optionalAccess', _216 => _216.isEnd, 'call', _217 => _217()]))
6546
+ return false;
6547
+ if (!this.type)
6548
+ return _optionalChain([this, 'access', _218 => _218.#parent, 'optionalAccess', _219 => _219.isEnd, 'call', _220 => _220()]);
6549
+ const pl = this.#parent ? this.#parent.#parts.length : 0;
6550
+ return this.#parentIndex === pl - 1;
6551
+ }
6552
+ copyIn(part) {
6553
+ if (typeof part === "string")
6554
+ this.push(part);
6555
+ else
6556
+ this.push(part.clone(this));
6557
+ }
6558
+ clone(parent) {
6559
+ const c = new _AST(this.type, parent);
6560
+ for (const p of this.#parts) {
6561
+ c.copyIn(p);
6562
+ }
6563
+ return c;
6564
+ }
6565
+ static #parseAST(str, ast, pos, opt) {
6566
+ let escaping = false;
6567
+ let inBrace = false;
6568
+ let braceStart = -1;
6569
+ let braceNeg = false;
6570
+ if (ast.type === null) {
6571
+ let i2 = pos;
6572
+ let acc2 = "";
6573
+ while (i2 < str.length) {
6574
+ const c = str.charAt(i2++);
6575
+ if (escaping || c === "\\") {
6576
+ escaping = !escaping;
6577
+ acc2 += c;
6578
+ continue;
6579
+ }
6580
+ if (inBrace) {
6581
+ if (i2 === braceStart + 1) {
6582
+ if (c === "^" || c === "!") {
6583
+ braceNeg = true;
6584
+ }
6585
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
6586
+ inBrace = false;
6587
+ }
6588
+ acc2 += c;
6589
+ continue;
6590
+ } else if (c === "[") {
6591
+ inBrace = true;
6592
+ braceStart = i2;
6593
+ braceNeg = false;
6594
+ acc2 += c;
6595
+ continue;
6596
+ }
6597
+ if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
6598
+ ast.push(acc2);
6599
+ acc2 = "";
6600
+ const ext2 = new _AST(c, ast);
6601
+ i2 = _AST.#parseAST(str, ext2, i2, opt);
6602
+ ast.push(ext2);
6603
+ continue;
6604
+ }
6605
+ acc2 += c;
6606
+ }
6607
+ ast.push(acc2);
6608
+ return i2;
6609
+ }
6610
+ let i = pos + 1;
6611
+ let part = new _AST(null, ast);
6612
+ const parts = [];
6613
+ let acc = "";
6614
+ while (i < str.length) {
6615
+ const c = str.charAt(i++);
6616
+ if (escaping || c === "\\") {
6617
+ escaping = !escaping;
6618
+ acc += c;
6619
+ continue;
6620
+ }
6621
+ if (inBrace) {
6622
+ if (i === braceStart + 1) {
6623
+ if (c === "^" || c === "!") {
6624
+ braceNeg = true;
6625
+ }
6626
+ } else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
6627
+ inBrace = false;
6628
+ }
6629
+ acc += c;
6630
+ continue;
6631
+ } else if (c === "[") {
6632
+ inBrace = true;
6633
+ braceStart = i;
6634
+ braceNeg = false;
6635
+ acc += c;
6636
+ continue;
6637
+ }
6638
+ if (isExtglobType(c) && str.charAt(i) === "(") {
6639
+ part.push(acc);
6640
+ acc = "";
6641
+ const ext2 = new _AST(c, part);
6642
+ part.push(ext2);
6643
+ i = _AST.#parseAST(str, ext2, i, opt);
6644
+ continue;
6645
+ }
6646
+ if (c === "|") {
6647
+ part.push(acc);
6648
+ acc = "";
6649
+ parts.push(part);
6650
+ part = new _AST(null, ast);
6651
+ continue;
6652
+ }
6653
+ if (c === ")") {
6654
+ if (acc === "" && ast.#parts.length === 0) {
6655
+ ast.#emptyExt = true;
6656
+ }
6657
+ part.push(acc);
6658
+ acc = "";
6659
+ ast.push(...parts, part);
6660
+ return i;
6661
+ }
6662
+ acc += c;
6663
+ }
6664
+ ast.type = null;
6665
+ ast.#hasMagic = void 0;
6666
+ ast.#parts = [str.substring(pos - 1)];
6667
+ return i;
6668
+ }
6669
+ static fromGlob(pattern, options = {}) {
6670
+ const ast = new _AST(null, void 0, options);
6671
+ _AST.#parseAST(pattern, ast, 0, options);
6672
+ return ast;
6673
+ }
6674
+ // returns the regular expression if there's magic, or the unescaped
6675
+ // string if not.
6676
+ toMMPattern() {
6677
+ if (this !== this.#root)
6678
+ return this.#root.toMMPattern();
6679
+ const glob3 = this.toString();
6680
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
6681
+ const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob3.toUpperCase() !== glob3.toLowerCase();
6682
+ if (!anyMagic) {
6683
+ return body;
6684
+ }
6685
+ const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
6686
+ return Object.assign(new RegExp(`^${re}$`, flags), {
6687
+ _src: re,
6688
+ _glob: glob3
6689
+ });
6690
+ }
6691
+ get options() {
6692
+ return this.#options;
6693
+ }
6694
+ // returns the string match, the regexp source, whether there's magic
6695
+ // in the regexp (so a regular expression is required) and whether or
6696
+ // not the uflag is needed for the regular expression (for posix classes)
6697
+ // TODO: instead of injecting the start/end at this point, just return
6698
+ // the BODY of the regexp, along with the start/end portions suitable
6699
+ // for binding the start/end in either a joined full-path makeRe context
6700
+ // (where we bind to (^|/), or a standalone matchPart context (where
6701
+ // we bind to ^, and not /). Otherwise slashes get duped!
6702
+ //
6703
+ // In part-matching mode, the start is:
6704
+ // - if not isStart: nothing
6705
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
6706
+ // - if dots allowed or not possible: ^
6707
+ // - if dots possible and not allowed: ^(?!\.)
6708
+ // end is:
6709
+ // - if not isEnd(): nothing
6710
+ // - else: $
6711
+ //
6712
+ // In full-path matching mode, we put the slash at the START of the
6713
+ // pattern, so start is:
6714
+ // - if first pattern: same as part-matching mode
6715
+ // - if not isStart(): nothing
6716
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
6717
+ // - if dots allowed or not possible: /
6718
+ // - if dots possible and not allowed: /(?!\.)
6719
+ // end is:
6720
+ // - if last pattern, same as part-matching mode
6721
+ // - else nothing
6722
+ //
6723
+ // Always put the (?:$|/) on negated tails, though, because that has to be
6724
+ // there to bind the end of the negated pattern portion, and it's easier to
6725
+ // just stick it in now rather than try to inject it later in the middle of
6726
+ // the pattern.
6727
+ //
6728
+ // We can just always return the same end, and leave it up to the caller
6729
+ // to know whether it's going to be used joined or in parts.
6730
+ // And, if the start is adjusted slightly, can do the same there:
6731
+ // - if not isStart: nothing
6732
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
6733
+ // - if dots allowed or not possible: (?:/|^)
6734
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
6735
+ //
6736
+ // But it's better to have a simpler binding without a conditional, for
6737
+ // performance, so probably better to return both start options.
6738
+ //
6739
+ // Then the caller just ignores the end if it's not the first pattern,
6740
+ // and the start always gets applied.
6741
+ //
6742
+ // But that's always going to be $ if it's the ending pattern, or nothing,
6743
+ // so the caller can just attach $ at the end of the pattern when building.
6744
+ //
6745
+ // So the todo is:
6746
+ // - better detect what kind of start is needed
6747
+ // - return both flavors of starting pattern
6748
+ // - attach $ at the end of the pattern when creating the actual RegExp
6749
+ //
6750
+ // Ah, but wait, no, that all only applies to the root when the first pattern
6751
+ // is not an extglob. If the first pattern IS an extglob, then we need all
6752
+ // that dot prevention biz to live in the extglob portions, because eg
6753
+ // +(*|.x*) can match .xy but not .yx.
6754
+ //
6755
+ // So, return the two flavors if it's #root and the first child is not an
6756
+ // AST, otherwise leave it to the child AST to handle it, and there,
6757
+ // use the (?:^|/) style of start binding.
6758
+ //
6759
+ // Even simplified further:
6760
+ // - Since the start for a join is eg /(?!\.) and the start for a part
6761
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
6762
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
6763
+ toRegExpSource(allowDot) {
6764
+ const dot = _nullishCoalesce(allowDot, () => ( !!this.#options.dot));
6765
+ if (this.#root === this)
6766
+ this.#fillNegs();
6767
+ if (!this.type) {
6768
+ const noEmpty = this.isStart() && this.isEnd();
6769
+ const src = this.#parts.map((p) => {
6770
+ const [re, _33, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
6771
+ this.#hasMagic = this.#hasMagic || hasMagic;
6772
+ this.#uflag = this.#uflag || uflag;
6773
+ return re;
6774
+ }).join("");
6775
+ let start2 = "";
6776
+ if (this.isStart()) {
6777
+ if (typeof this.#parts[0] === "string") {
6778
+ const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
6779
+ if (!dotTravAllowed) {
6780
+ const aps = addPatternStart;
6781
+ const needNoTrav = (
6782
+ // dots are allowed, and the pattern starts with [ or .
6783
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
6784
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
6785
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
6786
+ );
6787
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
6788
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
6789
+ }
6790
+ }
6791
+ }
6792
+ let end = "";
6793
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _221 => _221.#parent, 'optionalAccess', _222 => _222.type]) === "!") {
6794
+ end = "(?:$|\\/)";
6795
+ }
6796
+ const final2 = start2 + src + end;
6797
+ return [
6798
+ final2,
6799
+ unescape(src),
6800
+ this.#hasMagic = !!this.#hasMagic,
6801
+ this.#uflag
6802
+ ];
6803
+ }
6804
+ const repeated = this.type === "*" || this.type === "+";
6805
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
6806
+ let body = this.#partsToRegExp(dot);
6807
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
6808
+ const s = this.toString();
6809
+ this.#parts = [s];
6810
+ this.type = null;
6811
+ this.#hasMagic = void 0;
6812
+ return [s, unescape(this.toString()), false, false];
6813
+ }
6814
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
6815
+ if (bodyDotAllowed === body) {
6816
+ bodyDotAllowed = "";
6817
+ }
6818
+ if (bodyDotAllowed) {
6819
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
6820
+ }
6821
+ let final = "";
6822
+ if (this.type === "!" && this.#emptyExt) {
6823
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
6824
+ } else {
6825
+ const close = this.type === "!" ? (
6826
+ // !() must match something,but !(x) can match ''
6827
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
6828
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
6829
+ final = start + body + close;
6830
+ }
6831
+ return [
6832
+ final,
6833
+ unescape(body),
6834
+ this.#hasMagic = !!this.#hasMagic,
6835
+ this.#uflag
6836
+ ];
6837
+ }
6838
+ #partsToRegExp(dot) {
6839
+ return this.#parts.map((p) => {
6840
+ if (typeof p === "string") {
6841
+ throw new Error("string type in extglob ast??");
6842
+ }
6843
+ const [re, _33, _hasMagic, uflag] = p.toRegExpSource(dot);
6844
+ this.#uflag = this.#uflag || uflag;
6845
+ return re;
6846
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
6847
+ }
6848
+ static #parseGlob(glob3, hasMagic, noEmpty = false) {
6849
+ let escaping = false;
6850
+ let re = "";
6851
+ let uflag = false;
6852
+ for (let i = 0; i < glob3.length; i++) {
6853
+ const c = glob3.charAt(i);
6854
+ if (escaping) {
6855
+ escaping = false;
6856
+ re += (reSpecials.has(c) ? "\\" : "") + c;
6857
+ continue;
6858
+ }
6859
+ if (c === "\\") {
6860
+ if (i === glob3.length - 1) {
6861
+ re += "\\\\";
6862
+ } else {
6863
+ escaping = true;
6864
+ }
6865
+ continue;
6866
+ }
6867
+ if (c === "[") {
6868
+ const [src, needUflag, consumed, magic] = parseClass(glob3, i);
6869
+ if (consumed) {
6870
+ re += src;
6871
+ uflag = uflag || needUflag;
6872
+ i += consumed - 1;
6873
+ hasMagic = hasMagic || magic;
6874
+ continue;
6875
+ }
6876
+ }
6877
+ if (c === "*") {
6878
+ if (noEmpty && glob3 === "*")
6879
+ re += starNoEmpty;
6880
+ else
6881
+ re += star;
6882
+ hasMagic = true;
6883
+ continue;
6884
+ }
6885
+ if (c === "?") {
6886
+ re += qmark;
6887
+ hasMagic = true;
6888
+ continue;
6889
+ }
6890
+ re += regExpEscape(c);
6891
+ }
6892
+ return [re, unescape(glob3), !!hasMagic, uflag];
6893
+ }
6894
+ };
6895
+
6896
+ // ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/escape.js
6897
+ var escape = (s, { windowsPathsNoEscape = false } = {}) => {
6898
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
6899
+ };
6900
+
6901
+ // ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/index.js
6902
+ var minimatch = (p, pattern, options = {}) => {
6903
+ assertValidPattern(pattern);
6904
+ if (!options.nocomment && pattern.charAt(0) === "#") {
6905
+ return false;
6906
+ }
6907
+ return new Minimatch(pattern, options).match(p);
6908
+ };
6909
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
6910
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
6911
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
6912
+ var starDotExtTestNocase = (ext2) => {
6913
+ ext2 = ext2.toLowerCase();
6914
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
6915
+ };
6916
+ var starDotExtTestNocaseDot = (ext2) => {
6917
+ ext2 = ext2.toLowerCase();
6918
+ return (f) => f.toLowerCase().endsWith(ext2);
6919
+ };
6920
+ var starDotStarRE = /^\*+\.\*+$/;
6921
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
6922
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
6923
+ var dotStarRE = /^\.\*+$/;
6924
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
6925
+ var starRE = /^\*+$/;
6926
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
6927
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
6928
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
6929
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
6930
+ const noext = qmarksTestNoExt([$0]);
6931
+ if (!ext2)
6932
+ return noext;
6933
+ ext2 = ext2.toLowerCase();
6934
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
6935
+ };
6936
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
6937
+ const noext = qmarksTestNoExtDot([$0]);
6938
+ if (!ext2)
6939
+ return noext;
6940
+ ext2 = ext2.toLowerCase();
6941
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
6942
+ };
6943
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
6944
+ const noext = qmarksTestNoExtDot([$0]);
6945
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
6946
+ };
6947
+ var qmarksTest = ([$0, ext2 = ""]) => {
6948
+ const noext = qmarksTestNoExt([$0]);
6949
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
6950
+ };
6951
+ var qmarksTestNoExt = ([$0]) => {
6952
+ const len = $0.length;
6953
+ return (f) => f.length === len && !f.startsWith(".");
6954
+ };
6955
+ var qmarksTestNoExtDot = ([$0]) => {
6956
+ const len = $0.length;
6957
+ return (f) => f.length === len && f !== "." && f !== "..";
6958
+ };
6959
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
6960
+ var path15 = {
6961
+ win32: { sep: "\\" },
6962
+ posix: { sep: "/" }
6963
+ };
6964
+ var sep = defaultPlatform === "win32" ? path15.win32.sep : path15.posix.sep;
6965
+ minimatch.sep = sep;
6966
+ var GLOBSTAR = Symbol("globstar **");
6967
+ minimatch.GLOBSTAR = GLOBSTAR;
6968
+ var qmark2 = "[^/]";
6969
+ var star2 = qmark2 + "*?";
6970
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
6971
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
6972
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
6973
+ minimatch.filter = filter;
6974
+ var ext = (a, b = {}) => Object.assign({}, a, b);
6975
+ var defaults = (def) => {
6976
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
6977
+ return minimatch;
6978
+ }
6979
+ const orig = minimatch;
6980
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
6981
+ return Object.assign(m, {
6982
+ Minimatch: class Minimatch extends orig.Minimatch {
6983
+ constructor(pattern, options = {}) {
6984
+ super(pattern, ext(def, options));
6985
+ }
6986
+ static defaults(options) {
6987
+ return orig.defaults(ext(def, options)).Minimatch;
6988
+ }
6989
+ },
6990
+ AST: class AST extends orig.AST {
6991
+ /* c8 ignore start */
6992
+ constructor(type, parent, options = {}) {
6993
+ super(type, parent, ext(def, options));
6994
+ }
6995
+ /* c8 ignore stop */
6996
+ static fromGlob(pattern, options = {}) {
6997
+ return orig.AST.fromGlob(pattern, ext(def, options));
6998
+ }
6999
+ },
7000
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
7001
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
7002
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
7003
+ defaults: (options) => orig.defaults(ext(def, options)),
7004
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
7005
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
7006
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
7007
+ sep: orig.sep,
7008
+ GLOBSTAR
7009
+ });
7010
+ };
7011
+ minimatch.defaults = defaults;
7012
+ var braceExpand = (pattern, options = {}) => {
7013
+ assertValidPattern(pattern);
7014
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
7015
+ return [pattern];
7016
+ }
7017
+ return expand(pattern);
7018
+ };
7019
+ minimatch.braceExpand = braceExpand;
7020
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
7021
+ minimatch.makeRe = makeRe;
7022
+ var match = (list, pattern, options = {}) => {
7023
+ const mm = new Minimatch(pattern, options);
7024
+ list = list.filter((f) => mm.match(f));
7025
+ if (mm.options.nonull && !list.length) {
7026
+ list.push(pattern);
7027
+ }
7028
+ return list;
7029
+ };
7030
+ minimatch.match = match;
7031
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
7032
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
7033
+ var Minimatch = class {
7034
+
7035
+
7036
+
7037
+
7038
+
7039
+
7040
+
7041
+
7042
+
7043
+
7044
+
7045
+
7046
+
7047
+
7048
+
7049
+
7050
+
7051
+ constructor(pattern, options = {}) {
7052
+ assertValidPattern(pattern);
7053
+ options = options || {};
7054
+ this.options = options;
7055
+ this.pattern = pattern;
7056
+ this.platform = options.platform || defaultPlatform;
7057
+ this.isWindows = this.platform === "win32";
7058
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
7059
+ if (this.windowsPathsNoEscape) {
7060
+ this.pattern = this.pattern.replace(/\\/g, "/");
7061
+ }
7062
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
7063
+ this.regexp = null;
7064
+ this.negate = false;
7065
+ this.nonegate = !!options.nonegate;
7066
+ this.comment = false;
7067
+ this.empty = false;
7068
+ this.partial = !!options.partial;
7069
+ this.nocase = !!this.options.nocase;
7070
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
7071
+ this.globSet = [];
7072
+ this.globParts = [];
7073
+ this.set = [];
7074
+ this.make();
7075
+ }
7076
+ hasMagic() {
7077
+ if (this.options.magicalBraces && this.set.length > 1) {
7078
+ return true;
7079
+ }
7080
+ for (const pattern of this.set) {
7081
+ for (const part of pattern) {
7082
+ if (typeof part !== "string")
7083
+ return true;
7084
+ }
7085
+ }
7086
+ return false;
7087
+ }
7088
+ debug(..._33) {
7089
+ }
7090
+ make() {
7091
+ const pattern = this.pattern;
7092
+ const options = this.options;
7093
+ if (!options.nocomment && pattern.charAt(0) === "#") {
7094
+ this.comment = true;
7095
+ return;
7096
+ }
7097
+ if (!pattern) {
7098
+ this.empty = true;
7099
+ return;
7100
+ }
7101
+ this.parseNegate();
7102
+ this.globSet = [...new Set(this.braceExpand())];
7103
+ if (options.debug) {
7104
+ this.debug = (...args) => console.error(...args);
7105
+ }
7106
+ this.debug(this.pattern, this.globSet);
7107
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
7108
+ this.globParts = this.preprocess(rawGlobParts);
7109
+ this.debug(this.pattern, this.globParts);
7110
+ let set = this.globParts.map((s, _33, __) => {
7111
+ if (this.isWindows && this.windowsNoMagicRoot) {
7112
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
7113
+ const isDrive = /^[a-z]:/i.test(s[0]);
7114
+ if (isUNC) {
7115
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
7116
+ } else if (isDrive) {
7117
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
7118
+ }
7119
+ }
7120
+ return s.map((ss) => this.parse(ss));
7121
+ });
7122
+ this.debug(this.pattern, set);
7123
+ this.set = set.filter((s) => s.indexOf(false) === -1);
7124
+ if (this.isWindows) {
7125
+ for (let i = 0; i < this.set.length; i++) {
7126
+ const p = this.set[i];
7127
+ if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
7128
+ p[2] = "?";
7129
+ }
7130
+ }
7131
+ }
7132
+ this.debug(this.pattern, this.set);
7133
+ }
7134
+ // various transforms to equivalent pattern sets that are
7135
+ // faster to process in a filesystem walk. The goal is to
7136
+ // eliminate what we can, and push all ** patterns as far
7137
+ // to the right as possible, even if it increases the number
7138
+ // of patterns that we have to process.
7139
+ preprocess(globParts) {
7140
+ if (this.options.noglobstar) {
7141
+ for (let i = 0; i < globParts.length; i++) {
7142
+ for (let j = 0; j < globParts[i].length; j++) {
7143
+ if (globParts[i][j] === "**") {
7144
+ globParts[i][j] = "*";
7145
+ }
7146
+ }
7147
+ }
7148
+ }
7149
+ const { optimizationLevel = 1 } = this.options;
7150
+ if (optimizationLevel >= 2) {
7151
+ globParts = this.firstPhasePreProcess(globParts);
7152
+ globParts = this.secondPhasePreProcess(globParts);
7153
+ } else if (optimizationLevel >= 1) {
7154
+ globParts = this.levelOneOptimize(globParts);
7155
+ } else {
7156
+ globParts = this.adjascentGlobstarOptimize(globParts);
7157
+ }
7158
+ return globParts;
7159
+ }
7160
+ // just get rid of adjascent ** portions
7161
+ adjascentGlobstarOptimize(globParts) {
7162
+ return globParts.map((parts) => {
7163
+ let gs = -1;
7164
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
7165
+ let i = gs;
7166
+ while (parts[i + 1] === "**") {
7167
+ i++;
7168
+ }
7169
+ if (i !== gs) {
7170
+ parts.splice(gs, i - gs);
7171
+ }
7172
+ }
7173
+ return parts;
7174
+ });
7175
+ }
7176
+ // get rid of adjascent ** and resolve .. portions
7177
+ levelOneOptimize(globParts) {
7178
+ return globParts.map((parts) => {
7179
+ parts = parts.reduce((set, part) => {
7180
+ const prev = set[set.length - 1];
7181
+ if (part === "**" && prev === "**") {
7182
+ return set;
7183
+ }
7184
+ if (part === "..") {
7185
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
7186
+ set.pop();
7187
+ return set;
7188
+ }
7189
+ }
7190
+ set.push(part);
7191
+ return set;
7192
+ }, []);
7193
+ return parts.length === 0 ? [""] : parts;
7194
+ });
7195
+ }
7196
+ levelTwoFileOptimize(parts) {
7197
+ if (!Array.isArray(parts)) {
7198
+ parts = this.slashSplit(parts);
7199
+ }
7200
+ let didSomething = false;
7201
+ do {
7202
+ didSomething = false;
7203
+ if (!this.preserveMultipleSlashes) {
7204
+ for (let i = 1; i < parts.length - 1; i++) {
7205
+ const p = parts[i];
7206
+ if (i === 1 && p === "" && parts[0] === "")
7207
+ continue;
7208
+ if (p === "." || p === "") {
7209
+ didSomething = true;
7210
+ parts.splice(i, 1);
7211
+ i--;
7212
+ }
7213
+ }
7214
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
7215
+ didSomething = true;
7216
+ parts.pop();
7217
+ }
7218
+ }
7219
+ let dd = 0;
7220
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
7221
+ const p = parts[dd - 1];
7222
+ if (p && p !== "." && p !== ".." && p !== "**") {
7223
+ didSomething = true;
7224
+ parts.splice(dd - 1, 2);
7225
+ dd -= 2;
7226
+ }
7227
+ }
7228
+ } while (didSomething);
7229
+ return parts.length === 0 ? [""] : parts;
7230
+ }
7231
+ // First phase: single-pattern processing
7232
+ // <pre> is 1 or more portions
7233
+ // <rest> is 1 or more portions
7234
+ // <p> is any portion other than ., .., '', or **
7235
+ // <e> is . or ''
7236
+ //
7237
+ // **/.. is *brutal* for filesystem walking performance, because
7238
+ // it effectively resets the recursive walk each time it occurs,
7239
+ // and ** cannot be reduced out by a .. pattern part like a regexp
7240
+ // or most strings (other than .., ., and '') can be.
7241
+ //
7242
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
7243
+ // <pre>/<e>/<rest> -> <pre>/<rest>
7244
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
7245
+ // **/**/<rest> -> **/<rest>
7246
+ //
7247
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
7248
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
7249
+ firstPhasePreProcess(globParts) {
7250
+ let didSomething = false;
7251
+ do {
7252
+ didSomething = false;
7253
+ for (let parts of globParts) {
7254
+ let gs = -1;
7255
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
7256
+ let gss = gs;
7257
+ while (parts[gss + 1] === "**") {
7258
+ gss++;
7259
+ }
7260
+ if (gss > gs) {
7261
+ parts.splice(gs + 1, gss - gs);
7262
+ }
7263
+ let next = parts[gs + 1];
7264
+ const p = parts[gs + 2];
7265
+ const p2 = parts[gs + 3];
7266
+ if (next !== "..")
7267
+ continue;
7268
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
7269
+ continue;
7270
+ }
7271
+ didSomething = true;
7272
+ parts.splice(gs, 1);
7273
+ const other = parts.slice(0);
7274
+ other[gs] = "**";
7275
+ globParts.push(other);
7276
+ gs--;
7277
+ }
7278
+ if (!this.preserveMultipleSlashes) {
7279
+ for (let i = 1; i < parts.length - 1; i++) {
7280
+ const p = parts[i];
7281
+ if (i === 1 && p === "" && parts[0] === "")
7282
+ continue;
7283
+ if (p === "." || p === "") {
7284
+ didSomething = true;
7285
+ parts.splice(i, 1);
7286
+ i--;
7287
+ }
7288
+ }
7289
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
7290
+ didSomething = true;
7291
+ parts.pop();
7292
+ }
7293
+ }
7294
+ let dd = 0;
7295
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
7296
+ const p = parts[dd - 1];
7297
+ if (p && p !== "." && p !== ".." && p !== "**") {
7298
+ didSomething = true;
7299
+ const needDot = dd === 1 && parts[dd + 1] === "**";
7300
+ const splin = needDot ? ["."] : [];
7301
+ parts.splice(dd - 1, 2, ...splin);
7302
+ if (parts.length === 0)
7303
+ parts.push("");
7304
+ dd -= 2;
7305
+ }
7306
+ }
7307
+ }
7308
+ } while (didSomething);
7309
+ return globParts;
7310
+ }
7311
+ // second phase: multi-pattern dedupes
7312
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
7313
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
7314
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
7315
+ //
7316
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
7317
+ // ^-- not valid because ** doens't follow symlinks
7318
+ secondPhasePreProcess(globParts) {
7319
+ for (let i = 0; i < globParts.length - 1; i++) {
7320
+ for (let j = i + 1; j < globParts.length; j++) {
7321
+ const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
7322
+ if (matched) {
7323
+ globParts[i] = [];
7324
+ globParts[j] = matched;
7325
+ break;
7326
+ }
7327
+ }
7328
+ }
7329
+ return globParts.filter((gs) => gs.length);
7330
+ }
7331
+ partsMatch(a, b, emptyGSMatch = false) {
7332
+ let ai = 0;
7333
+ let bi = 0;
7334
+ let result = [];
7335
+ let which = "";
7336
+ while (ai < a.length && bi < b.length) {
7337
+ if (a[ai] === b[bi]) {
7338
+ result.push(which === "b" ? b[bi] : a[ai]);
7339
+ ai++;
7340
+ bi++;
7341
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
7342
+ result.push(a[ai]);
7343
+ ai++;
7344
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
7345
+ result.push(b[bi]);
7346
+ bi++;
7347
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
7348
+ if (which === "b")
7349
+ return false;
7350
+ which = "a";
7351
+ result.push(a[ai]);
7352
+ ai++;
7353
+ bi++;
7354
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
7355
+ if (which === "a")
7356
+ return false;
7357
+ which = "b";
7358
+ result.push(b[bi]);
7359
+ ai++;
7360
+ bi++;
7361
+ } else {
7362
+ return false;
7363
+ }
7364
+ }
7365
+ return a.length === b.length && result;
7366
+ }
7367
+ parseNegate() {
7368
+ if (this.nonegate)
7369
+ return;
7370
+ const pattern = this.pattern;
7371
+ let negate = false;
7372
+ let negateOffset = 0;
7373
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
7374
+ negate = !negate;
7375
+ negateOffset++;
7376
+ }
7377
+ if (negateOffset)
7378
+ this.pattern = pattern.slice(negateOffset);
7379
+ this.negate = negate;
7380
+ }
7381
+ // set partial to true to test if, for example,
7382
+ // "/a/b" matches the start of "/*/b/*/d"
7383
+ // Partial means, if you run out of file before you run
7384
+ // out of pattern, then that's fine, as long as all
7385
+ // the parts match.
7386
+ matchOne(file, pattern, partial = false) {
7387
+ const options = this.options;
7388
+ if (this.isWindows) {
7389
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
7390
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
7391
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
7392
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
7393
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
7394
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
7395
+ if (typeof fdi === "number" && typeof pdi === "number") {
7396
+ const [fd, pd] = [file[fdi], pattern[pdi]];
7397
+ if (fd.toLowerCase() === pd.toLowerCase()) {
7398
+ pattern[pdi] = fd;
7399
+ if (pdi > fdi) {
7400
+ pattern = pattern.slice(pdi);
7401
+ } else if (fdi > pdi) {
7402
+ file = file.slice(fdi);
7403
+ }
7404
+ }
7405
+ }
7406
+ }
7407
+ const { optimizationLevel = 1 } = this.options;
7408
+ if (optimizationLevel >= 2) {
7409
+ file = this.levelTwoFileOptimize(file);
7410
+ }
7411
+ this.debug("matchOne", this, { file, pattern });
7412
+ this.debug("matchOne", file.length, pattern.length);
7413
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
7414
+ this.debug("matchOne loop");
7415
+ var p = pattern[pi];
7416
+ var f = file[fi];
7417
+ this.debug(pattern, p, f);
7418
+ if (p === false) {
7419
+ return false;
7420
+ }
7421
+ if (p === GLOBSTAR) {
7422
+ this.debug("GLOBSTAR", [pattern, p, f]);
7423
+ var fr = fi;
7424
+ var pr = pi + 1;
7425
+ if (pr === pl) {
7426
+ this.debug("** at the end");
7427
+ for (; fi < fl; fi++) {
7428
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
7429
+ return false;
7430
+ }
7431
+ return true;
7432
+ }
7433
+ while (fr < fl) {
7434
+ var swallowee = file[fr];
7435
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
7436
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
7437
+ this.debug("globstar found match!", fr, fl, swallowee);
7438
+ return true;
7439
+ } else {
7440
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
7441
+ this.debug("dot detected!", file, fr, pattern, pr);
7442
+ break;
7443
+ }
7444
+ this.debug("globstar swallow a segment, and continue");
7445
+ fr++;
7446
+ }
7447
+ }
7448
+ if (partial) {
7449
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
7450
+ if (fr === fl) {
7451
+ return true;
7452
+ }
7453
+ }
7454
+ return false;
7455
+ }
7456
+ let hit;
7457
+ if (typeof p === "string") {
7458
+ hit = f === p;
7459
+ this.debug("string match", p, f, hit);
7460
+ } else {
7461
+ hit = p.test(f);
7462
+ this.debug("pattern match", p, f, hit);
7463
+ }
7464
+ if (!hit)
7465
+ return false;
7466
+ }
7467
+ if (fi === fl && pi === pl) {
7468
+ return true;
7469
+ } else if (fi === fl) {
7470
+ return partial;
7471
+ } else if (pi === pl) {
7472
+ return fi === fl - 1 && file[fi] === "";
7473
+ } else {
7474
+ throw new Error("wtf?");
7475
+ }
7476
+ }
7477
+ braceExpand() {
7478
+ return braceExpand(this.pattern, this.options);
7479
+ }
7480
+ parse(pattern) {
7481
+ assertValidPattern(pattern);
7482
+ const options = this.options;
7483
+ if (pattern === "**")
7484
+ return GLOBSTAR;
7485
+ if (pattern === "")
7486
+ return "";
7487
+ let m;
7488
+ let fastTest = null;
7489
+ if (m = pattern.match(starRE)) {
7490
+ fastTest = options.dot ? starTestDot : starTest;
7491
+ } else if (m = pattern.match(starDotExtRE)) {
7492
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
7493
+ } else if (m = pattern.match(qmarksRE)) {
7494
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
7495
+ } else if (m = pattern.match(starDotStarRE)) {
7496
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
7497
+ } else if (m = pattern.match(dotStarRE)) {
7498
+ fastTest = dotStarTest;
7499
+ }
7500
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
7501
+ if (fastTest && typeof re === "object") {
7502
+ Reflect.defineProperty(re, "test", { value: fastTest });
7503
+ }
7504
+ return re;
7505
+ }
7506
+ makeRe() {
7507
+ if (this.regexp || this.regexp === false)
7508
+ return this.regexp;
7509
+ const set = this.set;
7510
+ if (!set.length) {
7511
+ this.regexp = false;
7512
+ return this.regexp;
7513
+ }
7514
+ const options = this.options;
7515
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
7516
+ const flags = new Set(options.nocase ? ["i"] : []);
7517
+ let re = set.map((pattern) => {
7518
+ const pp = pattern.map((p) => {
7519
+ if (p instanceof RegExp) {
7520
+ for (const f of p.flags.split(""))
7521
+ flags.add(f);
7522
+ }
7523
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
7524
+ });
7525
+ pp.forEach((p, i) => {
7526
+ const next = pp[i + 1];
7527
+ const prev = pp[i - 1];
7528
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
7529
+ return;
7530
+ }
7531
+ if (prev === void 0) {
7532
+ if (next !== void 0 && next !== GLOBSTAR) {
7533
+ pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
7534
+ } else {
7535
+ pp[i] = twoStar;
7536
+ }
7537
+ } else if (next === void 0) {
7538
+ pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?";
7539
+ } else if (next !== GLOBSTAR) {
7540
+ pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
7541
+ pp[i + 1] = GLOBSTAR;
7542
+ }
7543
+ });
7544
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
7545
+ }).join("|");
7546
+ const [open3, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
7547
+ re = "^" + open3 + re + close + "$";
7548
+ if (this.negate)
7549
+ re = "^(?!" + re + ").+$";
7550
+ try {
7551
+ this.regexp = new RegExp(re, [...flags].join(""));
7552
+ } catch (ex) {
7553
+ this.regexp = false;
7554
+ }
7555
+ return this.regexp;
7556
+ }
7557
+ slashSplit(p) {
7558
+ if (this.preserveMultipleSlashes) {
7559
+ return p.split("/");
7560
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
7561
+ return ["", ...p.split(/\/+/)];
7562
+ } else {
7563
+ return p.split(/\/+/);
7564
+ }
7565
+ }
7566
+ match(f, partial = this.partial) {
7567
+ this.debug("match", f, this.pattern);
7568
+ if (this.comment) {
7569
+ return false;
7570
+ }
7571
+ if (this.empty) {
7572
+ return f === "";
7573
+ }
7574
+ if (f === "/" && partial) {
7575
+ return true;
7576
+ }
7577
+ const options = this.options;
7578
+ if (this.isWindows) {
7579
+ f = f.split("\\").join("/");
7580
+ }
7581
+ const ff = this.slashSplit(f);
7582
+ this.debug(this.pattern, "split", ff);
7583
+ const set = this.set;
7584
+ this.debug(this.pattern, "set", set);
7585
+ let filename = ff[ff.length - 1];
7586
+ if (!filename) {
7587
+ for (let i = ff.length - 2; !filename && i >= 0; i--) {
7588
+ filename = ff[i];
7589
+ }
7590
+ }
7591
+ for (let i = 0; i < set.length; i++) {
7592
+ const pattern = set[i];
7593
+ let file = ff;
7594
+ if (options.matchBase && pattern.length === 1) {
7595
+ file = [filename];
7596
+ }
7597
+ const hit = this.matchOne(file, pattern, partial);
7598
+ if (hit) {
7599
+ if (options.flipNegate) {
7600
+ return true;
7601
+ }
7602
+ return !this.negate;
7603
+ }
7604
+ }
7605
+ if (options.flipNegate) {
7606
+ return false;
7607
+ }
7608
+ return this.negate;
7609
+ }
7610
+ static defaults(def) {
7611
+ return minimatch.defaults(def).Minimatch;
7612
+ }
7613
+ };
7614
+ minimatch.AST = AST;
7615
+ minimatch.Minimatch = Minimatch;
7616
+ minimatch.escape = escape;
7617
+ minimatch.unescape = unescape;
7618
+
7619
+ // src/cli/cmd/run/execute.ts
6080
7620
  var MAX_WORKER_COUNT = 10;
6081
7621
  async function execute(input2) {
6082
7622
  const effectiveConcurrency = Math.min(
@@ -6209,7 +7749,9 @@ function createWorkerTask(args) {
6209
7749
  const processableData = _lodash2.default.chain(sourceData).entries().filter(
6210
7750
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
6211
7751
  ).filter(
6212
- ([key]) => !assignedTask.onlyKeys.length || assignedTask.onlyKeys.includes(key)
7752
+ ([key]) => _optionalChain([assignedTask, 'access', _223 => _223.onlyKeys, 'optionalAccess', _224 => _224.some, 'call', _225 => _225(
7753
+ (pattern) => minimatch(key, pattern)
7754
+ )])
6213
7755
  ).fromPairs().value();
6214
7756
  if (!Object.keys(processableData).length) {
6215
7757
  return { status: "skipped" };
@@ -6296,13 +7838,13 @@ var flagsSchema2 = _zod.z.object({
6296
7838
 
6297
7839
  // src/cli/cmd/run/_utils.ts
6298
7840
  async function determineAuthId(ctx) {
6299
- const isByokMode = !!_optionalChain([ctx, 'access', _208 => _208.config, 'optionalAccess', _209 => _209.provider]);
7841
+ const isByokMode = !!_optionalChain([ctx, 'access', _226 => _226.config, 'optionalAccess', _227 => _227.provider]);
6300
7842
  if (isByokMode) {
6301
7843
  return null;
6302
7844
  } else {
6303
7845
  try {
6304
- const authStatus = await _optionalChain([ctx, 'access', _210 => _210.localizer, 'optionalAccess', _211 => _211.checkAuth, 'call', _212 => _212()]);
6305
- return _optionalChain([authStatus, 'optionalAccess', _213 => _213.username]) || null;
7846
+ const authStatus = await _optionalChain([ctx, 'access', _228 => _228.localizer, 'optionalAccess', _229 => _229.checkAuth, 'call', _230 => _230()]);
7847
+ return _optionalChain([authStatus, 'optionalAccess', _231 => _231.username]) || null;
6306
7848
  } catch (e3) {
6307
7849
  return null;
6308
7850
  }
@@ -6327,7 +7869,7 @@ var run_default = new (0, _interactivecommander.Command)().command("run").descri
6327
7869
  (val, prev) => prev ? [...prev, val] : [val]
6328
7870
  ).option(
6329
7871
  "--key <key>",
6330
- "Key to process. Process only a specific translation key, useful for updating a single entry",
7872
+ "Key to process. Process only a specific translation key, useful for updating a single entry. Accepts glob patterns.",
6331
7873
  (val, prev) => prev ? [...prev, val] : [val]
6332
7874
  ).option(
6333
7875
  "--force",
@@ -6450,7 +7992,7 @@ var InBranchFlow = class extends IntegrationFlow {
6450
7992
  _child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
6451
7993
  _child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
6452
7994
  _child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
6453
- _optionalChain([this, 'access', _214 => _214.platformKit, 'optionalAccess', _215 => _215.gitConfig, 'call', _216 => _216()]);
7995
+ _optionalChain([this, 'access', _232 => _232.platformKit, 'optionalAccess', _233 => _233.gitConfig, 'call', _234 => _234()]);
6454
7996
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
6455
7997
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
6456
7998
  if (!processOwnCommits) {
@@ -6460,7 +8002,7 @@ var InBranchFlow = class extends IntegrationFlow {
6460
8002
  ).toString();
6461
8003
  if (authorOfLastCommit === currentAuthor) {
6462
8004
  this.ora.warn(
6463
- `The last commit was already made by ${currentAuthor}, so this run will be skipped, as running again would have no effect. See docs: https://docs.lingo.dev/ci-action/overview`
8005
+ `The last commit was already made by ${currentAuthor}, so this run will be skipped, as running again would have no effect. See docs: https://lingo.dev/ci`
6464
8006
  );
6465
8007
  return false;
6466
8008
  }
@@ -6482,7 +8024,7 @@ var InBranchFlow = class extends IntegrationFlow {
6482
8024
  // src/cli/cmd/ci/flows/pull-request.ts
6483
8025
  var PullRequestFlow = class extends InBranchFlow {
6484
8026
  async preRun() {
6485
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _217 => _217()]);
8027
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _235 => _235()]);
6486
8028
  if (!canContinue) {
6487
8029
  return false;
6488
8030
  }
@@ -6737,10 +8279,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
6737
8279
  repo_slug: this.platformConfig.repositoryName,
6738
8280
  state: "OPEN"
6739
8281
  }).then(({ data: { values } }) => {
6740
- return _optionalChain([values, 'optionalAccess', _218 => _218.find, 'call', _219 => _219(
6741
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _220 => _220.branch, 'optionalAccess', _221 => _221.name]) === branch && _optionalChain([destination, 'optionalAccess', _222 => _222.branch, 'optionalAccess', _223 => _223.name]) === this.platformConfig.baseBranchName
8282
+ return _optionalChain([values, 'optionalAccess', _236 => _236.find, 'call', _237 => _237(
8283
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _238 => _238.branch, 'optionalAccess', _239 => _239.name]) === branch && _optionalChain([destination, 'optionalAccess', _240 => _240.branch, 'optionalAccess', _241 => _241.name]) === this.platformConfig.baseBranchName
6742
8284
  )]);
6743
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _224 => _224.id]));
8285
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _242 => _242.id]));
6744
8286
  }
6745
8287
  async closePullRequest({ pullRequestNumber }) {
6746
8288
  await this.bb.repositories.declinePullRequest({
@@ -6836,7 +8378,7 @@ var GitHubPlatformKit = class extends PlatformKit {
6836
8378
  repo: this.platformConfig.repositoryName,
6837
8379
  base: this.platformConfig.baseBranchName,
6838
8380
  state: "open"
6839
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _225 => _225.number]));
8381
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _243 => _243.number]));
6840
8382
  }
6841
8383
  async closePullRequest({ pullRequestNumber }) {
6842
8384
  await this.octokit.rest.pulls.update({
@@ -6963,7 +8505,7 @@ var GitlabPlatformKit = class extends PlatformKit {
6963
8505
  sourceBranch: branch,
6964
8506
  state: "opened"
6965
8507
  });
6966
- return _optionalChain([mergeRequests, 'access', _226 => _226[0], 'optionalAccess', _227 => _227.iid]);
8508
+ return _optionalChain([mergeRequests, 'access', _244 => _244[0], 'optionalAccess', _245 => _245.iid]);
6967
8509
  }
6968
8510
  async closePullRequest({
6969
8511
  pullRequestNumber
@@ -7053,7 +8595,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
7053
8595
  }
7054
8596
  const env = {
7055
8597
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
7056
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _228 => _228.pullRequest, 'optionalAccess', _229 => _229.toString, 'call', _230 => _230()]) || "false",
8598
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _246 => _246.pullRequest, 'optionalAccess', _247 => _247.toString, 'call', _248 => _248()]) || "false",
7057
8599
  ...options.commitMessage && {
7058
8600
  LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
7059
8601
  },
@@ -7073,7 +8615,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
7073
8615
  const { isPullRequestMode } = platformKit.config;
7074
8616
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
7075
8617
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
7076
- const canRun = await _optionalChain([flow, 'access', _231 => _231.preRun, 'optionalCall', _232 => _232()]);
8618
+ const canRun = await _optionalChain([flow, 'access', _249 => _249.preRun, 'optionalCall', _250 => _250()]);
7077
8619
  if (canRun === false) {
7078
8620
  return;
7079
8621
  }
@@ -7083,7 +8625,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
7083
8625
  if (!hasChanges) {
7084
8626
  return;
7085
8627
  }
7086
- await _optionalChain([flow, 'access', _233 => _233.postRun, 'optionalCall', _234 => _234()]);
8628
+ await _optionalChain([flow, 'access', _251 => _251.postRun, 'optionalCall', _252 => _252()]);
7087
8629
  });
7088
8630
  function parseBooleanArg(val) {
7089
8631
  if (val === true) return true;
@@ -7134,13 +8676,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
7134
8676
  flags
7135
8677
  });
7136
8678
  let buckets = getBuckets(i18nConfig);
7137
- if (_optionalChain([flags, 'access', _235 => _235.bucket, 'optionalAccess', _236 => _236.length])) {
8679
+ if (_optionalChain([flags, 'access', _253 => _253.bucket, 'optionalAccess', _254 => _254.length])) {
7138
8680
  buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
7139
8681
  }
7140
8682
  ora.succeed("Buckets retrieved");
7141
- if (_optionalChain([flags, 'access', _237 => _237.file, 'optionalAccess', _238 => _238.length])) {
8683
+ if (_optionalChain([flags, 'access', _255 => _255.file, 'optionalAccess', _256 => _256.length])) {
7142
8684
  buckets = buckets.map((bucket) => {
7143
- const paths = bucket.paths.filter((path16) => flags.file.find((file) => _optionalChain([path16, 'access', _239 => _239.pathPattern, 'optionalAccess', _240 => _240.match, 'call', _241 => _241(file)])));
8685
+ const paths = bucket.paths.filter((path17) => flags.file.find((file) => _optionalChain([path17, 'access', _257 => _257.pathPattern, 'optionalAccess', _258 => _258.match, 'call', _259 => _259(file)])));
7144
8686
  return { ...bucket, paths };
7145
8687
  }).filter((bucket) => bucket.paths.length > 0);
7146
8688
  if (buckets.length === 0) {
@@ -7150,13 +8692,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
7150
8692
  ora.info(`\x1B[36mProcessing only filtered buckets:\x1B[0m`);
7151
8693
  buckets.map((bucket) => {
7152
8694
  ora.info(` ${bucket.type}:`);
7153
- bucket.paths.forEach((path16) => {
7154
- ora.info(` - ${path16.pathPattern}`);
8695
+ bucket.paths.forEach((path17) => {
8696
+ ora.info(` - ${path17.pathPattern}`);
7155
8697
  });
7156
8698
  });
7157
8699
  }
7158
8700
  }
7159
- const targetLocales = _optionalChain([flags, 'access', _242 => _242.locale, 'optionalAccess', _243 => _243.length]) ? flags.locale : i18nConfig.locale.targets;
8701
+ const targetLocales = _optionalChain([flags, 'access', _260 => _260.locale, 'optionalAccess', _261 => _261.length]) ? flags.locale : i18nConfig.locale.targets;
7160
8702
  let totalSourceKeyCount = 0;
7161
8703
  let uniqueKeysToTranslate = 0;
7162
8704
  let totalExistingTranslations = 0;
@@ -7235,11 +8777,11 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
7235
8777
  );
7236
8778
  }
7237
8779
  if (!fileExists) {
7238
- fileStats[filePath].languageStats[targetLocale].missing = sourceKeys.length;
7239
- fileStats[filePath].languageStats[targetLocale].words = sourceWordCount;
7240
- languageStats[targetLocale].missing += sourceKeys.length;
7241
- languageStats[targetLocale].words += sourceWordCount;
7242
- totalWordCount.set(targetLocale, (totalWordCount.get(targetLocale) || 0) + sourceWordCount);
8780
+ fileStats[filePath].languageStats[_targetLocale].missing = sourceKeys.length;
8781
+ fileStats[filePath].languageStats[_targetLocale].words = sourceWordCount;
8782
+ languageStats[_targetLocale].missing += sourceKeys.length;
8783
+ languageStats[_targetLocale].words += sourceWordCount;
8784
+ totalWordCount.set(_targetLocale, (totalWordCount.get(_targetLocale) || 0) + sourceWordCount);
7243
8785
  bucketOra.succeed(
7244
8786
  `[${sourceLocale} -> ${targetLocale}] ${_chalk2.default.red(`0% complete`)} (0/${sourceKeys.length} keys) - file not found`
7245
8787
  );
@@ -7264,15 +8806,15 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
7264
8806
  wordsToTranslate += words;
7265
8807
  }
7266
8808
  }
7267
- fileStats[filePath].languageStats[targetLocale].missing = missingKeys.length;
7268
- fileStats[filePath].languageStats[targetLocale].updated = updatedKeys.length;
7269
- fileStats[filePath].languageStats[targetLocale].complete = completeKeys.length;
7270
- fileStats[filePath].languageStats[targetLocale].words = wordsToTranslate;
7271
- languageStats[targetLocale].missing += missingKeys.length;
7272
- languageStats[targetLocale].updated += updatedKeys.length;
7273
- languageStats[targetLocale].complete += completeKeys.length;
7274
- languageStats[targetLocale].words += wordsToTranslate;
7275
- totalWordCount.set(targetLocale, (totalWordCount.get(targetLocale) || 0) + wordsToTranslate);
8809
+ fileStats[filePath].languageStats[_targetLocale].missing = missingKeys.length;
8810
+ fileStats[filePath].languageStats[_targetLocale].updated = updatedKeys.length;
8811
+ fileStats[filePath].languageStats[_targetLocale].complete = completeKeys.length;
8812
+ fileStats[filePath].languageStats[_targetLocale].words = wordsToTranslate;
8813
+ languageStats[_targetLocale].missing += missingKeys.length;
8814
+ languageStats[_targetLocale].updated += updatedKeys.length;
8815
+ languageStats[_targetLocale].complete += completeKeys.length;
8816
+ languageStats[_targetLocale].words += wordsToTranslate;
8817
+ totalWordCount.set(_targetLocale, (totalWordCount.get(_targetLocale) || 0) + wordsToTranslate);
7276
8818
  const totalKeysInFile = sourceKeys.length;
7277
8819
  const completionPercent = (completeKeys.length / totalKeysInFile * 100).toFixed(1);
7278
8820
  if (missingKeys.length === 0 && updatedKeys.length === 0) {
@@ -7380,10 +8922,10 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
7380
8922
  if (flags.confirm && Object.keys(fileStats).length > 0) {
7381
8923
  console.log(_chalk2.default.bold(`
7382
8924
  \u{1F4D1} BREAKDOWN BY FILE:`));
7383
- Object.entries(fileStats).sort((a, b) => b[1].wordCount - a[1].wordCount).forEach(([path16, stats]) => {
8925
+ Object.entries(fileStats).sort((a, b) => b[1].wordCount - a[1].wordCount).forEach(([path17, stats]) => {
7384
8926
  if (stats.sourceKeys === 0) return;
7385
8927
  console.log(_chalk2.default.bold(`
7386
- \u2022 ${path16}:`));
8928
+ \u2022 ${path17}:`));
7387
8929
  console.log(` ${stats.sourceKeys} source keys, ~${stats.wordCount.toLocaleString()} source words`);
7388
8930
  const fileTable = new (0, _clitable32.default)({
7389
8931
  head: ["Language", "Status", "Details"],
@@ -7497,12 +9039,12 @@ function validateParams2(i18nConfig, flags) {
7497
9039
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
7498
9040
  docUrl: "bucketNotFound"
7499
9041
  });
7500
- } else if (_optionalChain([flags, 'access', _244 => _244.locale, 'optionalAccess', _245 => _245.some, 'call', _246 => _246((locale) => !i18nConfig.locale.targets.includes(locale))])) {
9042
+ } else if (_optionalChain([flags, 'access', _262 => _262.locale, 'optionalAccess', _263 => _263.some, 'call', _264 => _264((locale) => !i18nConfig.locale.targets.includes(locale))])) {
7501
9043
  throw new CLIError({
7502
9044
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
7503
9045
  docUrl: "localeTargetNotFound"
7504
9046
  });
7505
- } else if (_optionalChain([flags, 'access', _247 => _247.bucket, 'optionalAccess', _248 => _248.some, 'call', _249 => _249((bucket) => !i18nConfig.buckets[bucket])])) {
9047
+ } else if (_optionalChain([flags, 'access', _265 => _265.bucket, 'optionalAccess', _266 => _266.some, 'call', _267 => _267((bucket) => !i18nConfig.buckets[bucket])])) {
7506
9048
  throw new CLIError({
7507
9049
  message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
7508
9050
  docUrl: "bucketNotFound"
@@ -7585,7 +9127,7 @@ async function renderHero2() {
7585
9127
  // package.json
7586
9128
  var package_default = {
7587
9129
  name: "lingo.dev",
7588
- version: "0.99.3",
9130
+ version: "0.99.5",
7589
9131
  description: "Lingo.dev CLI",
7590
9132
  private: false,
7591
9133
  publishConfig: {