@uptrademedia/site-kit 1.1.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/{chunk-LHMD7CAR.mjs → chunk-2STSAGNT.mjs} +28 -6
  2. package/dist/chunk-2STSAGNT.mjs.map +1 -0
  3. package/dist/{chunk-6ODMCZHH.js → chunk-C5TQLU5U.js} +166 -32
  4. package/dist/chunk-C5TQLU5U.js.map +1 -0
  5. package/dist/{chunk-IRNMIFOE.js → chunk-ICHCPLRB.js} +28 -6
  6. package/dist/chunk-ICHCPLRB.js.map +1 -0
  7. package/dist/{chunk-E6L6AY2Q.mjs → chunk-RLO3QJ65.mjs} +166 -32
  8. package/dist/chunk-RLO3QJ65.mjs.map +1 -0
  9. package/dist/cli/index.js +404 -782
  10. package/dist/cli/index.js.map +1 -1
  11. package/dist/cli/index.mjs +398 -774
  12. package/dist/cli/index.mjs.map +1 -1
  13. package/dist/engage/index.d.mts +3 -1
  14. package/dist/engage/index.d.ts +3 -1
  15. package/dist/engage/index.js +4 -4
  16. package/dist/engage/index.mjs +1 -1
  17. package/dist/index.js +7 -4
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +6 -3
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/llms/index.d.mts +23 -274
  22. package/dist/llms/index.d.ts +23 -274
  23. package/dist/llms/index.js +14 -14
  24. package/dist/llms/index.js.map +1 -1
  25. package/dist/llms/index.mjs +4 -4
  26. package/dist/llms/index.mjs.map +1 -1
  27. package/dist/robots/index.d.mts +46 -0
  28. package/dist/robots/index.d.ts +46 -0
  29. package/dist/robots/index.js +34 -0
  30. package/dist/robots/index.js.map +1 -0
  31. package/dist/robots/index.mjs +32 -0
  32. package/dist/robots/index.mjs.map +1 -0
  33. package/dist/seo/index.d.mts +1 -1
  34. package/dist/seo/index.d.ts +1 -1
  35. package/dist/seo/index.js +0 -3
  36. package/dist/seo/index.js.map +1 -1
  37. package/dist/seo/index.mjs +1 -1
  38. package/dist/sitemap/index.d.mts +6 -2
  39. package/dist/sitemap/index.d.ts +6 -2
  40. package/dist/sitemap/index.js +5 -8
  41. package/dist/sitemap/index.js.map +1 -1
  42. package/dist/sitemap/index.mjs +5 -5
  43. package/dist/sitemap/index.mjs.map +1 -1
  44. package/dist/types-Cl2SOKHd.d.mts +259 -0
  45. package/dist/types-Cl2SOKHd.d.ts +259 -0
  46. package/package.json +44 -39
  47. package/dist/chunk-6ODMCZHH.js.map +0 -1
  48. package/dist/chunk-E6L6AY2Q.mjs.map +0 -1
  49. package/dist/chunk-IRNMIFOE.js.map +0 -1
  50. package/dist/chunk-LHMD7CAR.mjs.map +0 -1
package/dist/cli/index.js CHANGED
@@ -10,21 +10,19 @@ var process6 = require('process');
10
10
  var os = require('os');
11
11
  var tty = require('tty');
12
12
  var assert = require('assert');
13
- var childProcess = require('child_process');
13
+ var child_process = require('child_process');
14
14
  var fs = require('fs');
15
- var path5 = require('path');
15
+ var path4 = require('path');
16
16
  var crypto = require('crypto');
17
17
  var stream = require('stream');
18
18
  var readline = require('readline');
19
- var fs7 = require('fs/promises');
20
- var buffer = require('buffer');
21
- var url = require('url');
22
- var util = require('util');
19
+ var fs2 = require('fs/promises');
20
+ var open = require('open');
23
21
  var http = require('http');
22
+ var url = require('url');
24
23
  var parser = require('@babel/parser');
25
24
  var traverse = require('@babel/traverse');
26
25
 
27
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
28
26
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
29
27
 
30
28
  function _interopNamespace(e) {
@@ -49,11 +47,10 @@ var process6__default = /*#__PURE__*/_interopDefault(process6);
49
47
  var os__default = /*#__PURE__*/_interopDefault(os);
50
48
  var tty__default = /*#__PURE__*/_interopDefault(tty);
51
49
  var assert__default = /*#__PURE__*/_interopDefault(assert);
52
- var childProcess__default = /*#__PURE__*/_interopDefault(childProcess);
53
- var fs__default = /*#__PURE__*/_interopDefault(fs);
54
- var path5__default = /*#__PURE__*/_interopDefault(path5);
50
+ var path4__default = /*#__PURE__*/_interopDefault(path4);
55
51
  var readline__default = /*#__PURE__*/_interopDefault(readline);
56
- var fs7__default = /*#__PURE__*/_interopDefault(fs7);
52
+ var fs2__default = /*#__PURE__*/_interopDefault(fs2);
53
+ var open__default = /*#__PURE__*/_interopDefault(open);
57
54
  var http__default = /*#__PURE__*/_interopDefault(http);
58
55
  var parser__namespace = /*#__PURE__*/_interopNamespace(parser);
59
56
  var traverse__default = /*#__PURE__*/_interopDefault(traverse);
@@ -952,10 +949,10 @@ var require_suggestSimilar = chunkZSMWDLMK_js.__commonJS({
952
949
  var require_command = chunkZSMWDLMK_js.__commonJS({
953
950
  "node_modules/commander/lib/command.js"(exports$1) {
954
951
  var EventEmitter = chunkZSMWDLMK_js.__require("events").EventEmitter;
955
- var childProcess2 = chunkZSMWDLMK_js.__require("child_process");
952
+ var childProcess = chunkZSMWDLMK_js.__require("child_process");
956
953
  var path15 = chunkZSMWDLMK_js.__require("path");
957
- var fs14 = chunkZSMWDLMK_js.__require("fs");
958
- var process17 = chunkZSMWDLMK_js.__require("process");
954
+ var fs10 = chunkZSMWDLMK_js.__require("fs");
955
+ var process11 = chunkZSMWDLMK_js.__require("process");
959
956
  var { Argument: Argument2, humanReadableArgName } = require_argument();
960
957
  var { CommanderError: CommanderError2 } = require_error();
961
958
  var { Help: Help2 } = require_help();
@@ -1001,10 +998,10 @@ var require_command = chunkZSMWDLMK_js.__commonJS({
1001
998
  this._showHelpAfterError = false;
1002
999
  this._showSuggestionAfterError = true;
1003
1000
  this._outputConfiguration = {
1004
- writeOut: (str) => process17.stdout.write(str),
1005
- writeErr: (str) => process17.stderr.write(str),
1006
- getOutHelpWidth: () => process17.stdout.isTTY ? process17.stdout.columns : void 0,
1007
- getErrHelpWidth: () => process17.stderr.isTTY ? process17.stderr.columns : void 0,
1001
+ writeOut: (str) => process11.stdout.write(str),
1002
+ writeErr: (str) => process11.stderr.write(str),
1003
+ getOutHelpWidth: () => process11.stdout.isTTY ? process11.stdout.columns : void 0,
1004
+ getErrHelpWidth: () => process11.stderr.isTTY ? process11.stderr.columns : void 0,
1008
1005
  outputError: (str, write) => write(str)
1009
1006
  };
1010
1007
  this._hidden = false;
@@ -1360,7 +1357,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1360
1357
  if (this._exitCallback) {
1361
1358
  this._exitCallback(new CommanderError2(exitCode, code, message));
1362
1359
  }
1363
- process17.exit(exitCode);
1360
+ process11.exit(exitCode);
1364
1361
  }
1365
1362
  /**
1366
1363
  * Register callback `fn` for the command.
@@ -1691,8 +1688,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
1691
1688
  }
1692
1689
  parseOptions = parseOptions || {};
1693
1690
  if (argv === void 0) {
1694
- argv = process17.argv;
1695
- if (process17.versions && process17.versions.electron) {
1691
+ argv = process11.argv;
1692
+ if (process11.versions && process11.versions.electron) {
1696
1693
  parseOptions.from = "electron";
1697
1694
  }
1698
1695
  }
@@ -1705,7 +1702,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1705
1702
  userArgs = argv.slice(2);
1706
1703
  break;
1707
1704
  case "electron":
1708
- if (process17.defaultApp) {
1705
+ if (process11.defaultApp) {
1709
1706
  this._scriptPath = argv[1];
1710
1707
  userArgs = argv.slice(2);
1711
1708
  } else {
@@ -1777,9 +1774,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
1777
1774
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1778
1775
  function findFile(baseDir, baseName) {
1779
1776
  const localBin = path15.resolve(baseDir, baseName);
1780
- if (fs14.existsSync(localBin)) return localBin;
1777
+ if (fs10.existsSync(localBin)) return localBin;
1781
1778
  if (sourceExt.includes(path15.extname(baseName))) return void 0;
1782
- const foundExt = sourceExt.find((ext) => fs14.existsSync(`${localBin}${ext}`));
1779
+ const foundExt = sourceExt.find((ext) => fs10.existsSync(`${localBin}${ext}`));
1783
1780
  if (foundExt) return `${localBin}${foundExt}`;
1784
1781
  return void 0;
1785
1782
  }
@@ -1790,7 +1787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1790
1787
  if (this._scriptPath) {
1791
1788
  let resolvedScriptPath;
1792
1789
  try {
1793
- resolvedScriptPath = fs14.realpathSync(this._scriptPath);
1790
+ resolvedScriptPath = fs10.realpathSync(this._scriptPath);
1794
1791
  } catch (err) {
1795
1792
  resolvedScriptPath = this._scriptPath;
1796
1793
  }
@@ -1808,23 +1805,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
1808
1805
  }
1809
1806
  launchWithNode = sourceExt.includes(path15.extname(executableFile));
1810
1807
  let proc;
1811
- if (process17.platform !== "win32") {
1808
+ if (process11.platform !== "win32") {
1812
1809
  if (launchWithNode) {
1813
1810
  args.unshift(executableFile);
1814
- args = incrementNodeInspectorPort(process17.execArgv).concat(args);
1815
- proc = childProcess2.spawn(process17.argv[0], args, { stdio: "inherit" });
1811
+ args = incrementNodeInspectorPort(process11.execArgv).concat(args);
1812
+ proc = childProcess.spawn(process11.argv[0], args, { stdio: "inherit" });
1816
1813
  } else {
1817
- proc = childProcess2.spawn(executableFile, args, { stdio: "inherit" });
1814
+ proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
1818
1815
  }
1819
1816
  } else {
1820
1817
  args.unshift(executableFile);
1821
- args = incrementNodeInspectorPort(process17.execArgv).concat(args);
1822
- proc = childProcess2.spawn(process17.execPath, args, { stdio: "inherit" });
1818
+ args = incrementNodeInspectorPort(process11.execArgv).concat(args);
1819
+ proc = childProcess.spawn(process11.execPath, args, { stdio: "inherit" });
1823
1820
  }
1824
1821
  if (!proc.killed) {
1825
1822
  const signals2 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
1826
1823
  signals2.forEach((signal) => {
1827
- process17.on(signal, () => {
1824
+ process11.on(signal, () => {
1828
1825
  if (proc.killed === false && proc.exitCode === null) {
1829
1826
  proc.kill(signal);
1830
1827
  }
@@ -1833,10 +1830,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1833
1830
  }
1834
1831
  const exitCallback = this._exitCallback;
1835
1832
  if (!exitCallback) {
1836
- proc.on("close", process17.exit.bind(process17));
1833
+ proc.on("close", process11.exit.bind(process11));
1837
1834
  } else {
1838
1835
  proc.on("close", () => {
1839
- exitCallback(new CommanderError2(process17.exitCode || 0, "commander.executeSubCommandAsync", "(close)"));
1836
+ exitCallback(new CommanderError2(process11.exitCode || 0, "commander.executeSubCommandAsync", "(close)"));
1840
1837
  });
1841
1838
  }
1842
1839
  proc.on("error", (err) => {
@@ -1851,7 +1848,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1851
1848
  throw new Error(`'${executableFile}' not executable`);
1852
1849
  }
1853
1850
  if (!exitCallback) {
1854
- process17.exit(1);
1851
+ process11.exit(1);
1855
1852
  } else {
1856
1853
  const wrappedError = new CommanderError2(1, "commander.executeSubCommandAsync", "(error)");
1857
1854
  wrappedError.nestedError = err;
@@ -2317,11 +2314,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2317
2314
  */
2318
2315
  _parseOptionsEnv() {
2319
2316
  this.options.forEach((option) => {
2320
- if (option.envVar && option.envVar in process17.env) {
2317
+ if (option.envVar && option.envVar in process11.env) {
2321
2318
  const optionKey = option.attributeName();
2322
2319
  if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(this.getOptionValueSource(optionKey))) {
2323
2320
  if (option.required || option.optional) {
2324
- this.emit(`optionEnv:${option.name()}`, process17.env[option.envVar]);
2321
+ this.emit(`optionEnv:${option.name()}`, process11.env[option.envVar]);
2325
2322
  } else {
2326
2323
  this.emit(`optionEnv:${option.name()}`);
2327
2324
  }
@@ -2697,7 +2694,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2697
2694
  */
2698
2695
  help(contextOptions) {
2699
2696
  this.outputHelp(contextOptions);
2700
- let exitCode = process17.exitCode || 0;
2697
+ let exitCode = process11.exitCode || 0;
2701
2698
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
2702
2699
  exitCode = 1;
2703
2700
  }
@@ -7747,7 +7744,7 @@ var require_innerFrom = chunkZSMWDLMK_js.__commonJS({
7747
7744
  exports$1.fromIterable = fromIterable;
7748
7745
  function fromAsyncIterable(asyncIterable) {
7749
7746
  return new Observable_1.Observable(function(subscriber) {
7750
- process17(asyncIterable, subscriber).catch(function(err) {
7747
+ process11(asyncIterable, subscriber).catch(function(err) {
7751
7748
  return subscriber.error(err);
7752
7749
  });
7753
7750
  });
@@ -7757,7 +7754,7 @@ var require_innerFrom = chunkZSMWDLMK_js.__commonJS({
7757
7754
  return fromAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(readableStream));
7758
7755
  }
7759
7756
  exports$1.fromReadableStreamLike = fromReadableStreamLike;
7760
- function process17(asyncIterable, subscriber) {
7757
+ function process11(asyncIterable, subscriber) {
7761
7758
  var asyncIterable_1, asyncIterable_1_1;
7762
7759
  var e_2, _a;
7763
7760
  return __awaiter(this, void 0, void 0, function() {
@@ -15292,7 +15289,7 @@ var require_has_flag = chunkZSMWDLMK_js.__commonJS({
15292
15289
  // node_modules/supports-color/index.js
15293
15290
  var require_supports_color = chunkZSMWDLMK_js.__commonJS({
15294
15291
  "node_modules/supports-color/index.js"(exports$1, module) {
15295
- var os4 = chunkZSMWDLMK_js.__require("os");
15292
+ var os3 = chunkZSMWDLMK_js.__require("os");
15296
15293
  var tty2 = chunkZSMWDLMK_js.__require("tty");
15297
15294
  var hasFlag2 = require_has_flag();
15298
15295
  var { env: env2 } = process;
@@ -15340,7 +15337,7 @@ var require_supports_color = chunkZSMWDLMK_js.__commonJS({
15340
15337
  return min;
15341
15338
  }
15342
15339
  if (process.platform === "win32") {
15343
- const osRelease = os4.release().split(".");
15340
+ const osRelease = os3.release().split(".");
15344
15341
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
15345
15342
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
15346
15343
  }
@@ -15809,11 +15806,11 @@ var require_signals = chunkZSMWDLMK_js.__commonJS({
15809
15806
  // node_modules/inquirer/node_modules/signal-exit/index.js
15810
15807
  var require_signal_exit = chunkZSMWDLMK_js.__commonJS({
15811
15808
  "node_modules/inquirer/node_modules/signal-exit/index.js"(exports$1, module) {
15812
- var process17 = global.process;
15813
- var processOk2 = function(process18) {
15814
- return process18 && typeof process18 === "object" && typeof process18.removeListener === "function" && typeof process18.emit === "function" && typeof process18.reallyExit === "function" && typeof process18.listeners === "function" && typeof process18.kill === "function" && typeof process18.pid === "number" && typeof process18.on === "function";
15809
+ var process11 = global.process;
15810
+ var processOk2 = function(process12) {
15811
+ return process12 && typeof process12 === "object" && typeof process12.removeListener === "function" && typeof process12.emit === "function" && typeof process12.reallyExit === "function" && typeof process12.listeners === "function" && typeof process12.kill === "function" && typeof process12.pid === "number" && typeof process12.on === "function";
15815
15812
  };
15816
- if (!processOk2(process17)) {
15813
+ if (!processOk2(process11)) {
15817
15814
  module.exports = function() {
15818
15815
  return function() {
15819
15816
  };
@@ -15821,15 +15818,15 @@ var require_signal_exit = chunkZSMWDLMK_js.__commonJS({
15821
15818
  } else {
15822
15819
  assert2 = chunkZSMWDLMK_js.__require("assert");
15823
15820
  signals2 = require_signals();
15824
- isWin = /^win/i.test(process17.platform);
15821
+ isWin = /^win/i.test(process11.platform);
15825
15822
  EE = chunkZSMWDLMK_js.__require("events");
15826
15823
  if (typeof EE !== "function") {
15827
15824
  EE = EE.EventEmitter;
15828
15825
  }
15829
- if (process17.__signal_exit_emitter__) {
15830
- emitter = process17.__signal_exit_emitter__;
15826
+ if (process11.__signal_exit_emitter__) {
15827
+ emitter = process11.__signal_exit_emitter__;
15831
15828
  } else {
15832
- emitter = process17.__signal_exit_emitter__ = new EE();
15829
+ emitter = process11.__signal_exit_emitter__ = new EE();
15833
15830
  emitter.count = 0;
15834
15831
  emitter.emitted = {};
15835
15832
  }
@@ -15866,12 +15863,12 @@ var require_signal_exit = chunkZSMWDLMK_js.__commonJS({
15866
15863
  loaded = false;
15867
15864
  signals2.forEach(function(sig) {
15868
15865
  try {
15869
- process17.removeListener(sig, sigListeners[sig]);
15866
+ process11.removeListener(sig, sigListeners[sig]);
15870
15867
  } catch (er) {
15871
15868
  }
15872
15869
  });
15873
- process17.emit = originalProcessEmit;
15874
- process17.reallyExit = originalProcessReallyExit;
15870
+ process11.emit = originalProcessEmit;
15871
+ process11.reallyExit = originalProcessReallyExit;
15875
15872
  emitter.count -= 1;
15876
15873
  };
15877
15874
  module.exports.unload = unload2;
@@ -15888,7 +15885,7 @@ var require_signal_exit = chunkZSMWDLMK_js.__commonJS({
15888
15885
  if (!processOk2(global.process)) {
15889
15886
  return;
15890
15887
  }
15891
- var listeners = process17.listeners(sig);
15888
+ var listeners = process11.listeners(sig);
15892
15889
  if (listeners.length === emitter.count) {
15893
15890
  unload2();
15894
15891
  emit("exit", null, sig);
@@ -15896,7 +15893,7 @@ var require_signal_exit = chunkZSMWDLMK_js.__commonJS({
15896
15893
  if (isWin && sig === "SIGHUP") {
15897
15894
  sig = "SIGINT";
15898
15895
  }
15899
- process17.kill(process17.pid, sig);
15896
+ process11.kill(process11.pid, sig);
15900
15897
  }
15901
15898
  };
15902
15899
  });
@@ -15912,36 +15909,36 @@ var require_signal_exit = chunkZSMWDLMK_js.__commonJS({
15912
15909
  emitter.count += 1;
15913
15910
  signals2 = signals2.filter(function(sig) {
15914
15911
  try {
15915
- process17.on(sig, sigListeners[sig]);
15912
+ process11.on(sig, sigListeners[sig]);
15916
15913
  return true;
15917
15914
  } catch (er) {
15918
15915
  return false;
15919
15916
  }
15920
15917
  });
15921
- process17.emit = processEmit;
15922
- process17.reallyExit = processReallyExit;
15918
+ process11.emit = processEmit;
15919
+ process11.reallyExit = processReallyExit;
15923
15920
  };
15924
15921
  module.exports.load = load2;
15925
- originalProcessReallyExit = process17.reallyExit;
15922
+ originalProcessReallyExit = process11.reallyExit;
15926
15923
  processReallyExit = function processReallyExit2(code) {
15927
15924
  if (!processOk2(global.process)) {
15928
15925
  return;
15929
15926
  }
15930
- process17.exitCode = code || /* istanbul ignore next */
15927
+ process11.exitCode = code || /* istanbul ignore next */
15931
15928
  0;
15932
- emit("exit", process17.exitCode, null);
15933
- emit("afterexit", process17.exitCode, null);
15934
- originalProcessReallyExit.call(process17, process17.exitCode);
15929
+ emit("exit", process11.exitCode, null);
15930
+ emit("afterexit", process11.exitCode, null);
15931
+ originalProcessReallyExit.call(process11, process11.exitCode);
15935
15932
  };
15936
- originalProcessEmit = process17.emit;
15933
+ originalProcessEmit = process11.emit;
15937
15934
  processEmit = function processEmit2(ev, arg) {
15938
15935
  if (ev === "exit" && processOk2(global.process)) {
15939
15936
  if (arg !== void 0) {
15940
- process17.exitCode = arg;
15937
+ process11.exitCode = arg;
15941
15938
  }
15942
15939
  var ret = originalProcessEmit.apply(this, arguments);
15943
- emit("exit", process17.exitCode, null);
15944
- emit("afterexit", process17.exitCode, null);
15940
+ emit("exit", process11.exitCode, null);
15941
+ emit("afterexit", process11.exitCode, null);
15945
15942
  return ret;
15946
15943
  } else {
15947
15944
  return originalProcessEmit.apply(this, arguments);
@@ -16467,12 +16464,12 @@ var require_buffer_list = chunkZSMWDLMK_js.__commonJS({
16467
16464
  return (String )(input);
16468
16465
  }
16469
16466
  var _require = chunkZSMWDLMK_js.__require("buffer");
16470
- var Buffer3 = _require.Buffer;
16467
+ var Buffer2 = _require.Buffer;
16471
16468
  var _require2 = chunkZSMWDLMK_js.__require("util");
16472
16469
  var inspect = _require2.inspect;
16473
16470
  var custom = inspect && inspect.custom || "inspect";
16474
16471
  function copyBuffer(src, target, offset) {
16475
- Buffer3.prototype.copy.call(src, target, offset);
16472
+ Buffer2.prototype.copy.call(src, target, offset);
16476
16473
  }
16477
16474
  module.exports = /* @__PURE__ */ (function() {
16478
16475
  function BufferList() {
@@ -16532,8 +16529,8 @@ var require_buffer_list = chunkZSMWDLMK_js.__commonJS({
16532
16529
  }, {
16533
16530
  key: "concat",
16534
16531
  value: function concat(n) {
16535
- if (this.length === 0) return Buffer3.alloc(0);
16536
- var ret = Buffer3.allocUnsafe(n >>> 0);
16532
+ if (this.length === 0) return Buffer2.alloc(0);
16533
+ var ret = Buffer2.allocUnsafe(n >>> 0);
16537
16534
  var p = this.head;
16538
16535
  var i = 0;
16539
16536
  while (p) {
@@ -16597,7 +16594,7 @@ var require_buffer_list = chunkZSMWDLMK_js.__commonJS({
16597
16594
  }, {
16598
16595
  key: "_getBuffer",
16599
16596
  value: function _getBuffer(n) {
16600
- var ret = Buffer3.allocUnsafe(n);
16597
+ var ret = Buffer2.allocUnsafe(n);
16601
16598
  var p = this.head;
16602
16599
  var c = 1;
16603
16600
  p.data.copy(ret);
@@ -16922,14 +16919,14 @@ var require_stream_writable = chunkZSMWDLMK_js.__commonJS({
16922
16919
  deprecate: require_node()
16923
16920
  };
16924
16921
  var Stream = require_stream();
16925
- var Buffer3 = chunkZSMWDLMK_js.__require("buffer").Buffer;
16922
+ var Buffer2 = chunkZSMWDLMK_js.__require("buffer").Buffer;
16926
16923
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
16927
16924
  };
16928
16925
  function _uint8ArrayToBuffer(chunk) {
16929
- return Buffer3.from(chunk);
16926
+ return Buffer2.from(chunk);
16930
16927
  }
16931
16928
  function _isUint8Array(obj) {
16932
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
16929
+ return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
16933
16930
  }
16934
16931
  var destroyImpl = require_destroy();
16935
16932
  var _require = require_state();
@@ -17057,7 +17054,7 @@ var require_stream_writable = chunkZSMWDLMK_js.__commonJS({
17057
17054
  var state = this._writableState;
17058
17055
  var ret = false;
17059
17056
  var isBuf = !state.objectMode && _isUint8Array(chunk);
17060
- if (isBuf && !Buffer3.isBuffer(chunk)) {
17057
+ if (isBuf && !Buffer2.isBuffer(chunk)) {
17061
17058
  chunk = _uint8ArrayToBuffer(chunk);
17062
17059
  }
17063
17060
  if (typeof encoding === "function") {
@@ -17101,7 +17098,7 @@ var require_stream_writable = chunkZSMWDLMK_js.__commonJS({
17101
17098
  });
17102
17099
  function decodeChunk(state, chunk, encoding) {
17103
17100
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
17104
- chunk = Buffer3.from(chunk, encoding);
17101
+ chunk = Buffer2.from(chunk, encoding);
17105
17102
  }
17106
17103
  return chunk;
17107
17104
  }
@@ -17470,34 +17467,34 @@ var require_stream_duplex = chunkZSMWDLMK_js.__commonJS({
17470
17467
  var require_safe_buffer = chunkZSMWDLMK_js.__commonJS({
17471
17468
  "node_modules/safe-buffer/index.js"(exports$1, module) {
17472
17469
  var buffer = chunkZSMWDLMK_js.__require("buffer");
17473
- var Buffer3 = buffer.Buffer;
17470
+ var Buffer2 = buffer.Buffer;
17474
17471
  function copyProps(src, dst) {
17475
17472
  for (var key in src) {
17476
17473
  dst[key] = src[key];
17477
17474
  }
17478
17475
  }
17479
- if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
17476
+ if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
17480
17477
  module.exports = buffer;
17481
17478
  } else {
17482
17479
  copyProps(buffer, exports$1);
17483
17480
  exports$1.Buffer = SafeBuffer;
17484
17481
  }
17485
17482
  function SafeBuffer(arg, encodingOrOffset, length) {
17486
- return Buffer3(arg, encodingOrOffset, length);
17483
+ return Buffer2(arg, encodingOrOffset, length);
17487
17484
  }
17488
- SafeBuffer.prototype = Object.create(Buffer3.prototype);
17489
- copyProps(Buffer3, SafeBuffer);
17485
+ SafeBuffer.prototype = Object.create(Buffer2.prototype);
17486
+ copyProps(Buffer2, SafeBuffer);
17490
17487
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
17491
17488
  if (typeof arg === "number") {
17492
17489
  throw new TypeError("Argument must not be a number");
17493
17490
  }
17494
- return Buffer3(arg, encodingOrOffset, length);
17491
+ return Buffer2(arg, encodingOrOffset, length);
17495
17492
  };
17496
17493
  SafeBuffer.alloc = function(size, fill, encoding) {
17497
17494
  if (typeof size !== "number") {
17498
17495
  throw new TypeError("Argument must be a number");
17499
17496
  }
17500
- var buf = Buffer3(size);
17497
+ var buf = Buffer2(size);
17501
17498
  if (fill !== void 0) {
17502
17499
  if (typeof encoding === "string") {
17503
17500
  buf.fill(fill, encoding);
@@ -17513,7 +17510,7 @@ var require_safe_buffer = chunkZSMWDLMK_js.__commonJS({
17513
17510
  if (typeof size !== "number") {
17514
17511
  throw new TypeError("Argument must be a number");
17515
17512
  }
17516
- return Buffer3(size);
17513
+ return Buffer2(size);
17517
17514
  };
17518
17515
  SafeBuffer.allocUnsafeSlow = function(size) {
17519
17516
  if (typeof size !== "number") {
@@ -17527,8 +17524,8 @@ var require_safe_buffer = chunkZSMWDLMK_js.__commonJS({
17527
17524
  // node_modules/string_decoder/lib/string_decoder.js
17528
17525
  var require_string_decoder = chunkZSMWDLMK_js.__commonJS({
17529
17526
  "node_modules/string_decoder/lib/string_decoder.js"(exports$1) {
17530
- var Buffer3 = require_safe_buffer().Buffer;
17531
- var isEncoding = Buffer3.isEncoding || function(encoding) {
17527
+ var Buffer2 = require_safe_buffer().Buffer;
17528
+ var isEncoding = Buffer2.isEncoding || function(encoding) {
17532
17529
  encoding = "" + encoding;
17533
17530
  switch (encoding && encoding.toLowerCase()) {
17534
17531
  case "hex":
@@ -17576,7 +17573,7 @@ var require_string_decoder = chunkZSMWDLMK_js.__commonJS({
17576
17573
  }
17577
17574
  function normalizeEncoding(enc) {
17578
17575
  var nenc = _normalizeEncoding(enc);
17579
- if (typeof nenc !== "string" && (Buffer3.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
17576
+ if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
17580
17577
  return nenc || enc;
17581
17578
  }
17582
17579
  exports$1.StringDecoder = StringDecoder;
@@ -17605,7 +17602,7 @@ var require_string_decoder = chunkZSMWDLMK_js.__commonJS({
17605
17602
  }
17606
17603
  this.lastNeed = 0;
17607
17604
  this.lastTotal = 0;
17608
- this.lastChar = Buffer3.allocUnsafe(nb);
17605
+ this.lastChar = Buffer2.allocUnsafe(nb);
17609
17606
  }
17610
17607
  StringDecoder.prototype.write = function(buf) {
17611
17608
  if (buf.length === 0) return "";
@@ -18162,14 +18159,14 @@ var require_stream_readable = chunkZSMWDLMK_js.__commonJS({
18162
18159
  return emitter.listeners(type).length;
18163
18160
  };
18164
18161
  var Stream = require_stream();
18165
- var Buffer3 = chunkZSMWDLMK_js.__require("buffer").Buffer;
18162
+ var Buffer2 = chunkZSMWDLMK_js.__require("buffer").Buffer;
18166
18163
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
18167
18164
  };
18168
18165
  function _uint8ArrayToBuffer(chunk) {
18169
- return Buffer3.from(chunk);
18166
+ return Buffer2.from(chunk);
18170
18167
  }
18171
18168
  function _isUint8Array(obj) {
18172
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
18169
+ return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
18173
18170
  }
18174
18171
  var debugUtil = chunkZSMWDLMK_js.__require("util");
18175
18172
  var debug;
@@ -18277,7 +18274,7 @@ var require_stream_readable = chunkZSMWDLMK_js.__commonJS({
18277
18274
  if (typeof chunk === "string") {
18278
18275
  encoding = encoding || state.defaultEncoding;
18279
18276
  if (encoding !== state.encoding) {
18280
- chunk = Buffer3.from(chunk, encoding);
18277
+ chunk = Buffer2.from(chunk, encoding);
18281
18278
  encoding = "";
18282
18279
  }
18283
18280
  skipChunkCheck = true;
@@ -18302,7 +18299,7 @@ var require_stream_readable = chunkZSMWDLMK_js.__commonJS({
18302
18299
  if (er) {
18303
18300
  errorOrDestroy(stream, er);
18304
18301
  } else if (state.objectMode || chunk && chunk.length > 0) {
18305
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer3.prototype) {
18302
+ if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
18306
18303
  chunk = _uint8ArrayToBuffer(chunk);
18307
18304
  }
18308
18305
  if (addToFront) {
@@ -19108,7 +19105,7 @@ var require_readable = chunkZSMWDLMK_js.__commonJS({
19108
19105
  // node_modules/bl/BufferList.js
19109
19106
  var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19110
19107
  "node_modules/bl/BufferList.js"(exports$1, module) {
19111
- var { Buffer: Buffer3 } = chunkZSMWDLMK_js.__require("buffer");
19108
+ var { Buffer: Buffer2 } = chunkZSMWDLMK_js.__require("buffer");
19112
19109
  var symbol = /* @__PURE__ */ Symbol.for("BufferList");
19113
19110
  function BufferList(buf) {
19114
19111
  if (!(this instanceof BufferList)) {
@@ -19172,10 +19169,10 @@ var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19172
19169
  srcEnd = this.length;
19173
19170
  }
19174
19171
  if (srcStart >= this.length) {
19175
- return dst || Buffer3.alloc(0);
19172
+ return dst || Buffer2.alloc(0);
19176
19173
  }
19177
19174
  if (srcEnd <= 0) {
19178
- return dst || Buffer3.alloc(0);
19175
+ return dst || Buffer2.alloc(0);
19179
19176
  }
19180
19177
  const copy2 = !!dst;
19181
19178
  const off = this._offset(srcStart);
@@ -19185,7 +19182,7 @@ var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19185
19182
  let start = off[1];
19186
19183
  if (srcStart === 0 && srcEnd === this.length) {
19187
19184
  if (!copy2) {
19188
- return this._bufs.length === 1 ? this._bufs[0] : Buffer3.concat(this._bufs, this.length);
19185
+ return this._bufs.length === 1 ? this._bufs[0] : Buffer2.concat(this._bufs, this.length);
19189
19186
  }
19190
19187
  for (let i = 0; i < this._bufs.length; i++) {
19191
19188
  this._bufs[i].copy(dst, bufoff);
@@ -19197,7 +19194,7 @@ var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19197
19194
  return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes);
19198
19195
  }
19199
19196
  if (!copy2) {
19200
- dst = Buffer3.allocUnsafe(len);
19197
+ dst = Buffer2.allocUnsafe(len);
19201
19198
  }
19202
19199
  for (let i = off[0]; i < this._bufs.length; i++) {
19203
19200
  const l = this._bufs[i].length - start;
@@ -19273,7 +19270,7 @@ var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19273
19270
  return this;
19274
19271
  }
19275
19272
  if (buf.buffer) {
19276
- this._appendBuffer(Buffer3.from(buf.buffer, buf.byteOffset, buf.byteLength));
19273
+ this._appendBuffer(Buffer2.from(buf.buffer, buf.byteOffset, buf.byteLength));
19277
19274
  } else if (Array.isArray(buf)) {
19278
19275
  for (let i = 0; i < buf.length; i++) {
19279
19276
  this.append(buf[i]);
@@ -19286,7 +19283,7 @@ var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19286
19283
  if (typeof buf === "number") {
19287
19284
  buf = buf.toString();
19288
19285
  }
19289
- this._appendBuffer(Buffer3.from(buf));
19286
+ this._appendBuffer(Buffer2.from(buf));
19290
19287
  }
19291
19288
  return this;
19292
19289
  };
@@ -19302,15 +19299,15 @@ var require_BufferList = chunkZSMWDLMK_js.__commonJS({
19302
19299
  if (typeof search === "function" || Array.isArray(search)) {
19303
19300
  throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');
19304
19301
  } else if (typeof search === "number") {
19305
- search = Buffer3.from([search]);
19302
+ search = Buffer2.from([search]);
19306
19303
  } else if (typeof search === "string") {
19307
- search = Buffer3.from(search, encoding);
19304
+ search = Buffer2.from(search, encoding);
19308
19305
  } else if (this._isBufferList(search)) {
19309
19306
  search = search.slice();
19310
19307
  } else if (Array.isArray(search.buffer)) {
19311
- search = Buffer3.from(search.buffer, search.byteOffset, search.byteLength);
19312
- } else if (!Buffer3.isBuffer(search)) {
19313
- search = Buffer3.from(search);
19308
+ search = Buffer2.from(search.buffer, search.byteOffset, search.byteLength);
19309
+ } else if (!Buffer2.isBuffer(search)) {
19310
+ search = Buffer2.from(search);
19314
19311
  }
19315
19312
  offset = Number(offset || 0);
19316
19313
  if (isNaN(offset)) {
@@ -25368,10 +25365,10 @@ var require_lib2 = chunkZSMWDLMK_js.__commonJS({
25368
25365
  exports$1.analyse = analyse;
25369
25366
  var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
25370
25367
  let fd;
25371
- const fs14 = (0, node_1.default)();
25368
+ const fs10 = (0, node_1.default)();
25372
25369
  const handler = (err, buffer) => {
25373
25370
  if (fd) {
25374
- fs14.closeSync(fd);
25371
+ fs10.closeSync(fd);
25375
25372
  }
25376
25373
  if (err) {
25377
25374
  reject(err);
@@ -25383,9 +25380,9 @@ var require_lib2 = chunkZSMWDLMK_js.__commonJS({
25383
25380
  };
25384
25381
  const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
25385
25382
  if (sampleSize > 0) {
25386
- fd = fs14.openSync(filepath, "r");
25383
+ fd = fs10.openSync(filepath, "r");
25387
25384
  let sample = Buffer.allocUnsafe(sampleSize);
25388
- fs14.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
25385
+ fs10.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
25389
25386
  if (err) {
25390
25387
  handler(err, null);
25391
25388
  } else {
@@ -25397,22 +25394,22 @@ var require_lib2 = chunkZSMWDLMK_js.__commonJS({
25397
25394
  });
25398
25395
  return;
25399
25396
  }
25400
- fs14.readFile(filepath, handler);
25397
+ fs10.readFile(filepath, handler);
25401
25398
  });
25402
25399
  exports$1.detectFile = detectFile;
25403
25400
  var detectFileSync = (filepath, opts = {}) => {
25404
- const fs14 = (0, node_1.default)();
25401
+ const fs10 = (0, node_1.default)();
25405
25402
  if (opts && opts.sampleSize) {
25406
- const fd = fs14.openSync(filepath, "r");
25403
+ const fd = fs10.openSync(filepath, "r");
25407
25404
  let sample = Buffer.allocUnsafe(opts.sampleSize);
25408
- const bytesRead = fs14.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
25405
+ const bytesRead = fs10.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
25409
25406
  if (bytesRead < opts.sampleSize) {
25410
25407
  sample = sample.subarray(0, bytesRead);
25411
25408
  }
25412
- fs14.closeSync(fd);
25409
+ fs10.closeSync(fd);
25413
25410
  return (0, exports$1.detect)(sample);
25414
25411
  }
25415
- return (0, exports$1.detect)(fs14.readFileSync(filepath));
25412
+ return (0, exports$1.detect)(fs10.readFileSync(filepath));
25416
25413
  };
25417
25414
  exports$1.detectFileSync = detectFileSync;
25418
25415
  exports$1.default = {
@@ -25428,7 +25425,7 @@ var require_lib2 = chunkZSMWDLMK_js.__commonJS({
25428
25425
  var require_safer = chunkZSMWDLMK_js.__commonJS({
25429
25426
  "node_modules/safer-buffer/safer.js"(exports$1, module) {
25430
25427
  var buffer = chunkZSMWDLMK_js.__require("buffer");
25431
- var Buffer3 = buffer.Buffer;
25428
+ var Buffer2 = buffer.Buffer;
25432
25429
  var safer = {};
25433
25430
  var key;
25434
25431
  for (key in buffer) {
@@ -25437,12 +25434,12 @@ var require_safer = chunkZSMWDLMK_js.__commonJS({
25437
25434
  safer[key] = buffer[key];
25438
25435
  }
25439
25436
  var Safer = safer.Buffer = {};
25440
- for (key in Buffer3) {
25441
- if (!Buffer3.hasOwnProperty(key)) continue;
25437
+ for (key in Buffer2) {
25438
+ if (!Buffer2.hasOwnProperty(key)) continue;
25442
25439
  if (key === "allocUnsafe" || key === "allocUnsafeSlow") continue;
25443
- Safer[key] = Buffer3[key];
25440
+ Safer[key] = Buffer2[key];
25444
25441
  }
25445
- safer.Buffer.prototype = Buffer3.prototype;
25442
+ safer.Buffer.prototype = Buffer2.prototype;
25446
25443
  if (!Safer.from || Safer.from === Uint8Array.from) {
25447
25444
  Safer.from = function(value, encodingOrOffset, length) {
25448
25445
  if (typeof value === "number") {
@@ -25451,7 +25448,7 @@ var require_safer = chunkZSMWDLMK_js.__commonJS({
25451
25448
  if (value && typeof value.length === "undefined") {
25452
25449
  throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
25453
25450
  }
25454
- return Buffer3(value, encodingOrOffset, length);
25451
+ return Buffer2(value, encodingOrOffset, length);
25455
25452
  };
25456
25453
  }
25457
25454
  if (!Safer.alloc) {
@@ -25462,7 +25459,7 @@ var require_safer = chunkZSMWDLMK_js.__commonJS({
25462
25459
  if (size < 0 || size >= 2 * (1 << 30)) {
25463
25460
  throw new RangeError('The value "' + size + '" is invalid for option "size"');
25464
25461
  }
25465
- var buf = Buffer3(size);
25462
+ var buf = Buffer2(size);
25466
25463
  if (!fill || fill.length === 0) {
25467
25464
  buf.fill(0);
25468
25465
  } else if (typeof encoding === "string") {
@@ -25554,7 +25551,7 @@ var require_merge_exports = chunkZSMWDLMK_js.__commonJS({
25554
25551
  // node_modules/iconv-lite/encodings/internal.js
25555
25552
  var require_internal = chunkZSMWDLMK_js.__commonJS({
25556
25553
  "node_modules/iconv-lite/encodings/internal.js"(exports$1, module) {
25557
- var Buffer3 = require_safer().Buffer;
25554
+ var Buffer2 = require_safer().Buffer;
25558
25555
  module.exports = {
25559
25556
  // Encodings
25560
25557
  utf8: { type: "_internal", bomAware: true },
@@ -25578,7 +25575,7 @@ var require_internal = chunkZSMWDLMK_js.__commonJS({
25578
25575
  } else if (this.enc === "cesu8") {
25579
25576
  this.enc = "utf8";
25580
25577
  this.encoder = InternalEncoderCesu8;
25581
- if (Buffer3.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
25578
+ if (Buffer2.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
25582
25579
  this.decoder = InternalDecoderCesu8;
25583
25580
  this.defaultCharUnicode = iconv2.defaultCharUnicode;
25584
25581
  }
@@ -25591,8 +25588,8 @@ var require_internal = chunkZSMWDLMK_js.__commonJS({
25591
25588
  this.decoder = new StringDecoder(codec.enc);
25592
25589
  }
25593
25590
  InternalDecoder.prototype.write = function(buf) {
25594
- if (!Buffer3.isBuffer(buf)) {
25595
- buf = Buffer3.from(buf);
25591
+ if (!Buffer2.isBuffer(buf)) {
25592
+ buf = Buffer2.from(buf);
25596
25593
  }
25597
25594
  return this.decoder.write(buf);
25598
25595
  };
@@ -25603,7 +25600,7 @@ var require_internal = chunkZSMWDLMK_js.__commonJS({
25603
25600
  this.enc = codec.enc;
25604
25601
  }
25605
25602
  InternalEncoder.prototype.write = function(str) {
25606
- return Buffer3.from(str, this.enc);
25603
+ return Buffer2.from(str, this.enc);
25607
25604
  };
25608
25605
  InternalEncoder.prototype.end = function() {
25609
25606
  };
@@ -25615,15 +25612,15 @@ var require_internal = chunkZSMWDLMK_js.__commonJS({
25615
25612
  var completeQuads = str.length - str.length % 4;
25616
25613
  this.prevStr = str.slice(completeQuads);
25617
25614
  str = str.slice(0, completeQuads);
25618
- return Buffer3.from(str, "base64");
25615
+ return Buffer2.from(str, "base64");
25619
25616
  };
25620
25617
  InternalEncoderBase64.prototype.end = function() {
25621
- return Buffer3.from(this.prevStr, "base64");
25618
+ return Buffer2.from(this.prevStr, "base64");
25622
25619
  };
25623
25620
  function InternalEncoderCesu8(options, codec) {
25624
25621
  }
25625
25622
  InternalEncoderCesu8.prototype.write = function(str) {
25626
- var buf = Buffer3.alloc(str.length * 3);
25623
+ var buf = Buffer2.alloc(str.length * 3);
25627
25624
  var bufIdx = 0;
25628
25625
  for (var i = 0; i < str.length; i++) {
25629
25626
  var charCode = str.charCodeAt(i);
@@ -25719,13 +25716,13 @@ var require_internal = chunkZSMWDLMK_js.__commonJS({
25719
25716
  str = str.slice(0, str.length - 1);
25720
25717
  }
25721
25718
  }
25722
- return Buffer3.from(str, this.enc);
25719
+ return Buffer2.from(str, this.enc);
25723
25720
  };
25724
25721
  InternalEncoderUtf8.prototype.end = function() {
25725
25722
  if (this.highSurrogate) {
25726
25723
  var str = this.highSurrogate;
25727
25724
  this.highSurrogate = "";
25728
- return Buffer3.from(str, this.enc);
25725
+ return Buffer2.from(str, this.enc);
25729
25726
  }
25730
25727
  };
25731
25728
  }
@@ -25734,7 +25731,7 @@ var require_internal = chunkZSMWDLMK_js.__commonJS({
25734
25731
  // node_modules/iconv-lite/encodings/utf32.js
25735
25732
  var require_utf32 = chunkZSMWDLMK_js.__commonJS({
25736
25733
  "node_modules/iconv-lite/encodings/utf32.js"(exports$1) {
25737
- var Buffer3 = require_safer().Buffer;
25734
+ var Buffer2 = require_safer().Buffer;
25738
25735
  exports$1._utf32 = Utf32Codec;
25739
25736
  function Utf32Codec(codecOptions, iconv2) {
25740
25737
  this.iconv = iconv2;
@@ -25752,8 +25749,8 @@ var require_utf32 = chunkZSMWDLMK_js.__commonJS({
25752
25749
  this.highSurrogate = 0;
25753
25750
  }
25754
25751
  Utf32Encoder.prototype.write = function(str) {
25755
- var src = Buffer3.from(str, "ucs2");
25756
- var dst = Buffer3.alloc(src.length * 2);
25752
+ var src = Buffer2.from(str, "ucs2");
25753
+ var dst = Buffer2.alloc(src.length * 2);
25757
25754
  var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
25758
25755
  var offset = 0;
25759
25756
  for (var i = 0; i < src.length; i += 2) {
@@ -25789,7 +25786,7 @@ var require_utf32 = chunkZSMWDLMK_js.__commonJS({
25789
25786
  if (!this.highSurrogate) {
25790
25787
  return;
25791
25788
  }
25792
- var buf = Buffer3.alloc(4);
25789
+ var buf = Buffer2.alloc(4);
25793
25790
  if (this.isLE) {
25794
25791
  buf.writeUInt32LE(this.highSurrogate, 0);
25795
25792
  } else {
@@ -25809,7 +25806,7 @@ var require_utf32 = chunkZSMWDLMK_js.__commonJS({
25809
25806
  }
25810
25807
  var i = 0;
25811
25808
  var codepoint = 0;
25812
- var dst = Buffer3.alloc(src.length + 4);
25809
+ var dst = Buffer2.alloc(src.length + 4);
25813
25810
  var offset = 0;
25814
25811
  var isLE = this.isLE;
25815
25812
  var overflow = this.overflow;
@@ -25964,7 +25961,7 @@ var require_utf32 = chunkZSMWDLMK_js.__commonJS({
25964
25961
  // node_modules/iconv-lite/encodings/utf16.js
25965
25962
  var require_utf16 = chunkZSMWDLMK_js.__commonJS({
25966
25963
  "node_modules/iconv-lite/encodings/utf16.js"(exports$1) {
25967
- var Buffer3 = require_safer().Buffer;
25964
+ var Buffer2 = require_safer().Buffer;
25968
25965
  exports$1.utf16be = Utf16BECodec;
25969
25966
  function Utf16BECodec() {
25970
25967
  }
@@ -25974,7 +25971,7 @@ var require_utf16 = chunkZSMWDLMK_js.__commonJS({
25974
25971
  function Utf16BEEncoder() {
25975
25972
  }
25976
25973
  Utf16BEEncoder.prototype.write = function(str) {
25977
- var buf = Buffer3.from(str, "ucs2");
25974
+ var buf = Buffer2.from(str, "ucs2");
25978
25975
  for (var i = 0; i < buf.length; i += 2) {
25979
25976
  var tmp = buf[i];
25980
25977
  buf[i] = buf[i + 1];
@@ -25991,7 +25988,7 @@ var require_utf16 = chunkZSMWDLMK_js.__commonJS({
25991
25988
  if (buf.length == 0) {
25992
25989
  return "";
25993
25990
  }
25994
- var buf2 = Buffer3.alloc(buf.length + 1);
25991
+ var buf2 = Buffer2.alloc(buf.length + 1);
25995
25992
  var i = 0;
25996
25993
  var j = 0;
25997
25994
  if (this.overflowByte !== -1) {
@@ -26106,7 +26103,7 @@ var require_utf16 = chunkZSMWDLMK_js.__commonJS({
26106
26103
  // node_modules/iconv-lite/encodings/utf7.js
26107
26104
  var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26108
26105
  "node_modules/iconv-lite/encodings/utf7.js"(exports$1) {
26109
- var Buffer3 = require_safer().Buffer;
26106
+ var Buffer2 = require_safer().Buffer;
26110
26107
  exports$1.utf7 = Utf7Codec;
26111
26108
  exports$1.unicode11utf7 = "utf7";
26112
26109
  function Utf7Codec(codecOptions, iconv2) {
@@ -26120,7 +26117,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26120
26117
  this.iconv = codec.iconv;
26121
26118
  }
26122
26119
  Utf7Encoder.prototype.write = function(str) {
26123
- return Buffer3.from(str.replace(nonDirectChars, function(chunk) {
26120
+ return Buffer2.from(str.replace(nonDirectChars, function(chunk) {
26124
26121
  return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
26125
26122
  }.bind(this)));
26126
26123
  };
@@ -26158,7 +26155,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26158
26155
  res += "+";
26159
26156
  } else {
26160
26157
  var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii");
26161
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
26158
+ res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be");
26162
26159
  }
26163
26160
  if (buf[i2] != minusChar) {
26164
26161
  i2--;
@@ -26176,7 +26173,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26176
26173
  var canBeDecoded = b64str.length - b64str.length % 8;
26177
26174
  base64Accum = b64str.slice(canBeDecoded);
26178
26175
  b64str = b64str.slice(0, canBeDecoded);
26179
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
26176
+ res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be");
26180
26177
  }
26181
26178
  this.inBase64 = inBase64;
26182
26179
  this.base64Accum = base64Accum;
@@ -26185,7 +26182,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26185
26182
  Utf7Decoder.prototype.end = function() {
26186
26183
  var res = "";
26187
26184
  if (this.inBase64 && this.base64Accum.length > 0) {
26188
- res = this.iconv.decode(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
26185
+ res = this.iconv.decode(Buffer2.from(this.base64Accum, "base64"), "utf16-be");
26189
26186
  }
26190
26187
  this.inBase64 = false;
26191
26188
  this.base64Accum = "";
@@ -26201,14 +26198,14 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26201
26198
  function Utf7IMAPEncoder(options, codec) {
26202
26199
  this.iconv = codec.iconv;
26203
26200
  this.inBase64 = false;
26204
- this.base64Accum = Buffer3.alloc(6);
26201
+ this.base64Accum = Buffer2.alloc(6);
26205
26202
  this.base64AccumIdx = 0;
26206
26203
  }
26207
26204
  Utf7IMAPEncoder.prototype.write = function(str) {
26208
26205
  var inBase64 = this.inBase64;
26209
26206
  var base64Accum = this.base64Accum;
26210
26207
  var base64AccumIdx = this.base64AccumIdx;
26211
- var buf = Buffer3.alloc(str.length * 5 + 10);
26208
+ var buf = Buffer2.alloc(str.length * 5 + 10);
26212
26209
  var bufIdx = 0;
26213
26210
  for (var i2 = 0; i2 < str.length; i2++) {
26214
26211
  var uChar = str.charCodeAt(i2);
@@ -26247,7 +26244,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26247
26244
  return buf.slice(0, bufIdx);
26248
26245
  };
26249
26246
  Utf7IMAPEncoder.prototype.end = function() {
26250
- var buf = Buffer3.alloc(10);
26247
+ var buf = Buffer2.alloc(10);
26251
26248
  var bufIdx = 0;
26252
26249
  if (this.inBase64) {
26253
26250
  if (this.base64AccumIdx > 0) {
@@ -26284,7 +26281,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26284
26281
  res += "&";
26285
26282
  } else {
26286
26283
  var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii").replace(/,/g, "/");
26287
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
26284
+ res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be");
26288
26285
  }
26289
26286
  if (buf[i2] != minusChar) {
26290
26287
  i2--;
@@ -26302,7 +26299,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26302
26299
  var canBeDecoded = b64str.length - b64str.length % 8;
26303
26300
  base64Accum = b64str.slice(canBeDecoded);
26304
26301
  b64str = b64str.slice(0, canBeDecoded);
26305
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
26302
+ res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be");
26306
26303
  }
26307
26304
  this.inBase64 = inBase64;
26308
26305
  this.base64Accum = base64Accum;
@@ -26311,7 +26308,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26311
26308
  Utf7IMAPDecoder.prototype.end = function() {
26312
26309
  var res = "";
26313
26310
  if (this.inBase64 && this.base64Accum.length > 0) {
26314
- res = this.iconv.decode(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
26311
+ res = this.iconv.decode(Buffer2.from(this.base64Accum, "base64"), "utf16-be");
26315
26312
  }
26316
26313
  this.inBase64 = false;
26317
26314
  this.base64Accum = "";
@@ -26323,7 +26320,7 @@ var require_utf7 = chunkZSMWDLMK_js.__commonJS({
26323
26320
  // node_modules/iconv-lite/encodings/sbcs-codec.js
26324
26321
  var require_sbcs_codec = chunkZSMWDLMK_js.__commonJS({
26325
26322
  "node_modules/iconv-lite/encodings/sbcs-codec.js"(exports$1) {
26326
- var Buffer3 = require_safer().Buffer;
26323
+ var Buffer2 = require_safer().Buffer;
26327
26324
  exports$1._sbcs = SBCSCodec;
26328
26325
  function SBCSCodec(codecOptions, iconv2) {
26329
26326
  if (!codecOptions) {
@@ -26339,8 +26336,8 @@ var require_sbcs_codec = chunkZSMWDLMK_js.__commonJS({
26339
26336
  }
26340
26337
  codecOptions.chars = asciiString + codecOptions.chars;
26341
26338
  }
26342
- this.decodeBuf = Buffer3.from(codecOptions.chars, "ucs2");
26343
- var encodeBuf = Buffer3.alloc(65536, iconv2.defaultCharSingleByte.charCodeAt(0));
26339
+ this.decodeBuf = Buffer2.from(codecOptions.chars, "ucs2");
26340
+ var encodeBuf = Buffer2.alloc(65536, iconv2.defaultCharSingleByte.charCodeAt(0));
26344
26341
  for (var i = 0; i < codecOptions.chars.length; i++) {
26345
26342
  encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
26346
26343
  }
@@ -26352,7 +26349,7 @@ var require_sbcs_codec = chunkZSMWDLMK_js.__commonJS({
26352
26349
  this.encodeBuf = codec.encodeBuf;
26353
26350
  }
26354
26351
  SBCSEncoder.prototype.write = function(str) {
26355
- var buf = Buffer3.alloc(str.length);
26352
+ var buf = Buffer2.alloc(str.length);
26356
26353
  for (var i = 0; i < str.length; i++) {
26357
26354
  buf[i] = this.encodeBuf[str.charCodeAt(i)];
26358
26355
  }
@@ -26365,7 +26362,7 @@ var require_sbcs_codec = chunkZSMWDLMK_js.__commonJS({
26365
26362
  }
26366
26363
  SBCSDecoder.prototype.write = function(buf) {
26367
26364
  var decodeBuf = this.decodeBuf;
26368
- var newBuf = Buffer3.alloc(buf.length * 2);
26365
+ var newBuf = Buffer2.alloc(buf.length * 2);
26369
26366
  var idx1 = 0;
26370
26367
  var idx2 = 0;
26371
26368
  for (var i = 0; i < buf.length; i++) {
@@ -26990,7 +26987,7 @@ var require_sbcs_data_generated = chunkZSMWDLMK_js.__commonJS({
26990
26987
  // node_modules/iconv-lite/encodings/dbcs-codec.js
26991
26988
  var require_dbcs_codec = chunkZSMWDLMK_js.__commonJS({
26992
26989
  "node_modules/iconv-lite/encodings/dbcs-codec.js"(exports$1) {
26993
- var Buffer3 = require_safer().Buffer;
26990
+ var Buffer2 = require_safer().Buffer;
26994
26991
  exports$1._dbcs = DBCSCodec;
26995
26992
  var UNASSIGNED = -1;
26996
26993
  var GB18030_CODE = -2;
@@ -27226,7 +27223,7 @@ var require_dbcs_codec = chunkZSMWDLMK_js.__commonJS({
27226
27223
  this.gb18030 = codec.gb18030;
27227
27224
  }
27228
27225
  DBCSEncoder.prototype.write = function(str) {
27229
- var newBuf = Buffer3.alloc(str.length * (this.gb18030 ? 4 : 3));
27226
+ var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3));
27230
27227
  var leadSurrogate = this.leadSurrogate;
27231
27228
  var seqObj = this.seqObj;
27232
27229
  var nextChar = -1;
@@ -27329,7 +27326,7 @@ var require_dbcs_codec = chunkZSMWDLMK_js.__commonJS({
27329
27326
  if (this.leadSurrogate === -1 && this.seqObj === void 0) {
27330
27327
  return;
27331
27328
  }
27332
- var newBuf = Buffer3.alloc(10);
27329
+ var newBuf = Buffer2.alloc(10);
27333
27330
  var j = 0;
27334
27331
  if (this.seqObj) {
27335
27332
  var dbcsCode = this.seqObj[DEF_CHAR];
@@ -27359,7 +27356,7 @@ var require_dbcs_codec = chunkZSMWDLMK_js.__commonJS({
27359
27356
  this.gb18030 = codec.gb18030;
27360
27357
  }
27361
27358
  DBCSDecoder.prototype.write = function(buf) {
27362
- var newBuf = Buffer3.alloc(buf.length * 2);
27359
+ var newBuf = Buffer2.alloc(buf.length * 2);
27363
27360
  var nodeIdx = this.nodeIdx;
27364
27361
  var prevBytes = this.prevBytes;
27365
27362
  var prevOffset = this.prevBytes.length;
@@ -28964,7 +28961,7 @@ var require_encodings = chunkZSMWDLMK_js.__commonJS({
28964
28961
  // node_modules/iconv-lite/lib/streams.js
28965
28962
  var require_streams = chunkZSMWDLMK_js.__commonJS({
28966
28963
  "node_modules/iconv-lite/lib/streams.js"(exports$1, module) {
28967
- var Buffer3 = require_safer().Buffer;
28964
+ var Buffer2 = require_safer().Buffer;
28968
28965
  module.exports = function(streamModule) {
28969
28966
  var Transform = streamModule.Transform;
28970
28967
  function IconvLiteEncoderStream(conv, options) {
@@ -29004,7 +29001,7 @@ var require_streams = chunkZSMWDLMK_js.__commonJS({
29004
29001
  chunks.push(chunk);
29005
29002
  });
29006
29003
  this.on("end", function() {
29007
- cb(null, Buffer3.concat(chunks));
29004
+ cb(null, Buffer2.concat(chunks));
29008
29005
  });
29009
29006
  return this;
29010
29007
  };
@@ -29018,7 +29015,7 @@ var require_streams = chunkZSMWDLMK_js.__commonJS({
29018
29015
  constructor: { value: IconvLiteDecoderStream }
29019
29016
  });
29020
29017
  IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
29021
- if (!Buffer3.isBuffer(chunk) && !(chunk instanceof Uint8Array)) {
29018
+ if (!Buffer2.isBuffer(chunk) && !(chunk instanceof Uint8Array)) {
29022
29019
  return done(new Error("Iconv decoding stream needs buffers as its input."));
29023
29020
  }
29024
29021
  try {
@@ -29060,7 +29057,7 @@ var require_streams = chunkZSMWDLMK_js.__commonJS({
29060
29057
  // node_modules/iconv-lite/lib/index.js
29061
29058
  var require_lib3 = chunkZSMWDLMK_js.__commonJS({
29062
29059
  "node_modules/iconv-lite/lib/index.js"(exports$1, module) {
29063
- var Buffer3 = require_safer().Buffer;
29060
+ var Buffer2 = require_safer().Buffer;
29064
29061
  var bomHandling = require_bom_handling();
29065
29062
  var mergeModules = require_merge_exports();
29066
29063
  module.exports.encodings = null;
@@ -29071,7 +29068,7 @@ var require_lib3 = chunkZSMWDLMK_js.__commonJS({
29071
29068
  var encoder = module.exports.getEncoder(encoding, options);
29072
29069
  var res = encoder.write(str);
29073
29070
  var trail = encoder.end();
29074
- return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
29071
+ return trail && trail.length > 0 ? Buffer2.concat([res, trail]) : res;
29075
29072
  };
29076
29073
  module.exports.decode = function decode(buf, encoding, options) {
29077
29074
  if (typeof buf === "string") {
@@ -29079,7 +29076,7 @@ var require_lib3 = chunkZSMWDLMK_js.__commonJS({
29079
29076
  console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
29080
29077
  module.exports.skipDecodeWarning = true;
29081
29078
  }
29082
- buf = Buffer3.from("" + (buf || ""), "binary");
29079
+ buf = Buffer2.from("" + (buf || ""), "binary");
29083
29080
  }
29084
29081
  var decoder = module.exports.getDecoder(encoding, options);
29085
29082
  var res = decoder.write(buf);
@@ -29920,7 +29917,7 @@ if (process.platform === "linux") {
29920
29917
  }
29921
29918
 
29922
29919
  // node_modules/signal-exit/dist/mjs/index.js
29923
- var processOk = (process17) => !!process17 && typeof process17 === "object" && typeof process17.removeListener === "function" && typeof process17.emit === "function" && typeof process17.reallyExit === "function" && typeof process17.listeners === "function" && typeof process17.kill === "function" && typeof process17.pid === "number" && typeof process17.on === "function";
29920
+ var processOk = (process11) => !!process11 && typeof process11 === "object" && typeof process11.removeListener === "function" && typeof process11.emit === "function" && typeof process11.reallyExit === "function" && typeof process11.listeners === "function" && typeof process11.kill === "function" && typeof process11.pid === "number" && typeof process11.on === "function";
29924
29921
  var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
29925
29922
  var global2 = globalThis;
29926
29923
  var ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -30003,7 +30000,7 @@ var SignalExitFallback = class extends SignalExitBase {
30003
30000
  };
30004
30001
  var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _SignalExit_instances, processReallyExit_fn, processEmit_fn;
30005
30002
  var SignalExit = class extends SignalExitBase {
30006
- constructor(process17) {
30003
+ constructor(process11) {
30007
30004
  super();
30008
30005
  chunkZSMWDLMK_js.__privateAdd(this, _SignalExit_instances);
30009
30006
  // "SIGHUP" throws an `ENOSYS` error on Windows,
@@ -30017,13 +30014,13 @@ var SignalExit = class extends SignalExitBase {
30017
30014
  chunkZSMWDLMK_js.__privateAdd(this, _originalProcessReallyExit);
30018
30015
  chunkZSMWDLMK_js.__privateAdd(this, _sigListeners, {});
30019
30016
  chunkZSMWDLMK_js.__privateAdd(this, _loaded, false);
30020
- chunkZSMWDLMK_js.__privateSet(this, _process, process17);
30017
+ chunkZSMWDLMK_js.__privateSet(this, _process, process11);
30021
30018
  chunkZSMWDLMK_js.__privateSet(this, _sigListeners, {});
30022
30019
  for (const sig of signals) {
30023
30020
  chunkZSMWDLMK_js.__privateGet(this, _sigListeners)[sig] = () => {
30024
30021
  const listeners = chunkZSMWDLMK_js.__privateGet(this, _process).listeners(sig);
30025
30022
  let { count } = chunkZSMWDLMK_js.__privateGet(this, _emitter);
30026
- const p = process17;
30023
+ const p = process11;
30027
30024
  if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
30028
30025
  count += p.__signal_exit_emitter__.count;
30029
30026
  }
@@ -30032,12 +30029,12 @@ var SignalExit = class extends SignalExitBase {
30032
30029
  const ret = chunkZSMWDLMK_js.__privateGet(this, _emitter).emit("exit", null, sig);
30033
30030
  const s = sig === "SIGHUP" ? chunkZSMWDLMK_js.__privateGet(this, _hupSig) : sig;
30034
30031
  if (!ret)
30035
- process17.kill(process17.pid, s);
30032
+ process11.kill(process11.pid, s);
30036
30033
  }
30037
30034
  };
30038
30035
  }
30039
- chunkZSMWDLMK_js.__privateSet(this, _originalProcessReallyExit, process17.reallyExit);
30040
- chunkZSMWDLMK_js.__privateSet(this, _originalProcessEmit, process17.emit);
30036
+ chunkZSMWDLMK_js.__privateSet(this, _originalProcessReallyExit, process11.reallyExit);
30037
+ chunkZSMWDLMK_js.__privateSet(this, _originalProcessEmit, process11.emit);
30041
30038
  }
30042
30039
  onExit(cb, opts) {
30043
30040
  if (!processOk(chunkZSMWDLMK_js.__privateGet(this, _process))) {
@@ -32524,8 +32521,8 @@ var ExternalEditor = class {
32524
32521
  const prefix = sanitizeAffix(this.fileOptions.prefix);
32525
32522
  const postfix = sanitizeAffix(this.fileOptions.postfix);
32526
32523
  const filename = `${prefix}${id}${postfix}`;
32527
- const candidate = path5__default.default.resolve(baseDir, filename);
32528
- const baseResolved = path5__default.default.resolve(baseDir) + path5__default.default.sep;
32524
+ const candidate = path4__default.default.resolve(baseDir, filename);
32525
+ const baseResolved = path4__default.default.resolve(baseDir) + path4__default.default.sep;
32529
32526
  if (!candidate.startsWith(baseResolved)) {
32530
32527
  throw new Error("Resolved temporary file escaped the base directory");
32531
32528
  }
@@ -32564,7 +32561,7 @@ var ExternalEditor = class {
32564
32561
  }
32565
32562
  launchEditor() {
32566
32563
  try {
32567
- const editorProcess = childProcess.spawnSync(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
32564
+ const editorProcess = child_process.spawnSync(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
32568
32565
  this.lastExitStatus = editorProcess.status ?? 0;
32569
32566
  } catch (launchError) {
32570
32567
  throw new LaunchEditorError(launchError);
@@ -32572,7 +32569,7 @@ var ExternalEditor = class {
32572
32569
  }
32573
32570
  launchEditorAsync(callback) {
32574
32571
  try {
32575
- const editorProcess = childProcess.spawn(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
32572
+ const editorProcess = child_process.spawn(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
32576
32573
  editorProcess.on("exit", (code) => {
32577
32574
  this.lastExitStatus = code;
32578
32575
  setImmediate(callback);
@@ -32981,472 +32978,6 @@ var inquirer = {
32981
32978
  Separator
32982
32979
  };
32983
32980
  var lib_default = inquirer;
32984
- var isDockerCached;
32985
- function hasDockerEnv() {
32986
- try {
32987
- fs__default.default.statSync("/.dockerenv");
32988
- return true;
32989
- } catch {
32990
- return false;
32991
- }
32992
- }
32993
- function hasDockerCGroup() {
32994
- try {
32995
- return fs__default.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
32996
- } catch {
32997
- return false;
32998
- }
32999
- }
33000
- function isDocker() {
33001
- if (isDockerCached === void 0) {
33002
- isDockerCached = hasDockerEnv() || hasDockerCGroup();
33003
- }
33004
- return isDockerCached;
33005
- }
33006
-
33007
- // node_modules/is-inside-container/index.js
33008
- var cachedResult;
33009
- var hasContainerEnv = () => {
33010
- try {
33011
- fs__default.default.statSync("/run/.containerenv");
33012
- return true;
33013
- } catch {
33014
- return false;
33015
- }
33016
- };
33017
- function isInsideContainer() {
33018
- if (cachedResult === void 0) {
33019
- cachedResult = hasContainerEnv() || isDocker();
33020
- }
33021
- return cachedResult;
33022
- }
33023
-
33024
- // node_modules/is-wsl/index.js
33025
- var isWsl = () => {
33026
- if (process6__default.default.platform !== "linux") {
33027
- return false;
33028
- }
33029
- if (os__default.default.release().toLowerCase().includes("microsoft")) {
33030
- if (isInsideContainer()) {
33031
- return false;
33032
- }
33033
- return true;
33034
- }
33035
- try {
33036
- return fs__default.default.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
33037
- } catch {
33038
- return false;
33039
- }
33040
- };
33041
- var is_wsl_default = process6__default.default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
33042
-
33043
- // node_modules/wsl-utils/index.js
33044
- var wslDrivesMountPoint = /* @__PURE__ */ (() => {
33045
- const defaultMountPoint = "/mnt/";
33046
- let mountPoint;
33047
- return async function() {
33048
- if (mountPoint) {
33049
- return mountPoint;
33050
- }
33051
- const configFilePath = "/etc/wsl.conf";
33052
- let isConfigFileExists = false;
33053
- try {
33054
- await fs7__default.default.access(configFilePath, fs7.constants.F_OK);
33055
- isConfigFileExists = true;
33056
- } catch {
33057
- }
33058
- if (!isConfigFileExists) {
33059
- return defaultMountPoint;
33060
- }
33061
- const configContent = await fs7__default.default.readFile(configFilePath, { encoding: "utf8" });
33062
- const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
33063
- if (!configMountPoint) {
33064
- return defaultMountPoint;
33065
- }
33066
- mountPoint = configMountPoint.groups.mountPoint.trim();
33067
- mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
33068
- return mountPoint;
33069
- };
33070
- })();
33071
- var powerShellPathFromWsl = async () => {
33072
- const mountPoint = await wslDrivesMountPoint();
33073
- return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
33074
- };
33075
- var powerShellPath = async () => {
33076
- if (is_wsl_default) {
33077
- return powerShellPathFromWsl();
33078
- }
33079
- return `${process6__default.default.env.SYSTEMROOT || process6__default.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
33080
- };
33081
-
33082
- // node_modules/define-lazy-prop/index.js
33083
- function defineLazyProperty(object, propertyName, valueGetter) {
33084
- const define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
33085
- Object.defineProperty(object, propertyName, {
33086
- configurable: true,
33087
- enumerable: true,
33088
- get() {
33089
- const result = valueGetter();
33090
- define(result);
33091
- return result;
33092
- },
33093
- set(value) {
33094
- define(value);
33095
- }
33096
- });
33097
- return object;
33098
- }
33099
- var execFileAsync = util.promisify(childProcess.execFile);
33100
- async function defaultBrowserId() {
33101
- if (process6__default.default.platform !== "darwin") {
33102
- throw new Error("macOS only");
33103
- }
33104
- const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
33105
- const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
33106
- const browserId = match?.groups.id ?? "com.apple.Safari";
33107
- if (browserId === "com.apple.safari") {
33108
- return "com.apple.Safari";
33109
- }
33110
- return browserId;
33111
- }
33112
- var execFileAsync2 = util.promisify(childProcess.execFile);
33113
- async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
33114
- if (process6__default.default.platform !== "darwin") {
33115
- throw new Error("macOS only");
33116
- }
33117
- const outputArguments = humanReadableOutput ? [] : ["-ss"];
33118
- const execOptions = {};
33119
- if (signal) {
33120
- execOptions.signal = signal;
33121
- }
33122
- const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
33123
- return stdout.trim();
33124
- }
33125
-
33126
- // node_modules/bundle-name/index.js
33127
- async function bundleName(bundleId) {
33128
- return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
33129
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
33130
- }
33131
- var execFileAsync3 = util.promisify(childProcess.execFile);
33132
- var windowsBrowserProgIds = {
33133
- MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
33134
- // The missing `L` is correct.
33135
- MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
33136
- MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
33137
- AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
33138
- ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
33139
- ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
33140
- ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
33141
- ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
33142
- BraveHTML: { name: "Brave", id: "com.brave.Browser" },
33143
- BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
33144
- BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
33145
- BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
33146
- FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
33147
- OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
33148
- VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
33149
- "IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
33150
- };
33151
- new Map(Object.entries(windowsBrowserProgIds));
33152
- var UnknownBrowserError = class extends Error {
33153
- };
33154
- async function defaultBrowser(_execFileAsync = execFileAsync3) {
33155
- const { stdout } = await _execFileAsync("reg", [
33156
- "QUERY",
33157
- " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
33158
- "/v",
33159
- "ProgId"
33160
- ]);
33161
- const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
33162
- if (!match) {
33163
- throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
33164
- }
33165
- const { id } = match.groups;
33166
- const dotIndex = id.lastIndexOf(".");
33167
- const hyphenIndex = id.lastIndexOf("-");
33168
- const baseIdByDot = dotIndex === -1 ? void 0 : id.slice(0, dotIndex);
33169
- const baseIdByHyphen = hyphenIndex === -1 ? void 0 : id.slice(0, hyphenIndex);
33170
- return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
33171
- }
33172
-
33173
- // node_modules/default-browser/index.js
33174
- var execFileAsync4 = util.promisify(childProcess.execFile);
33175
- var titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
33176
- async function defaultBrowser2() {
33177
- if (process6__default.default.platform === "darwin") {
33178
- const id = await defaultBrowserId();
33179
- const name = await bundleName(id);
33180
- return { name, id };
33181
- }
33182
- if (process6__default.default.platform === "linux") {
33183
- const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
33184
- const id = stdout.trim();
33185
- const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
33186
- return { name, id };
33187
- }
33188
- if (process6__default.default.platform === "win32") {
33189
- return defaultBrowser();
33190
- }
33191
- throw new Error("Only macOS, Linux, and Windows are supported");
33192
- }
33193
-
33194
- // node_modules/open/index.js
33195
- var execFile5 = util.promisify(childProcess__default.default.execFile);
33196
- var __dirname$1 = path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href))));
33197
- var localXdgOpenPath = path5__default.default.join(__dirname$1, "xdg-open");
33198
- var { platform, arch } = process6__default.default;
33199
- async function getWindowsDefaultBrowserFromWsl() {
33200
- const powershellPath = await powerShellPath();
33201
- const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
33202
- const encodedCommand = buffer.Buffer.from(rawCommand, "utf16le").toString("base64");
33203
- const { stdout } = await execFile5(
33204
- powershellPath,
33205
- [
33206
- "-NoProfile",
33207
- "-NonInteractive",
33208
- "-ExecutionPolicy",
33209
- "Bypass",
33210
- "-EncodedCommand",
33211
- encodedCommand
33212
- ],
33213
- { encoding: "utf8" }
33214
- );
33215
- const progId = stdout.trim();
33216
- const browserMap = {
33217
- ChromeHTML: "com.google.chrome",
33218
- BraveHTML: "com.brave.Browser",
33219
- MSEdgeHTM: "com.microsoft.edge",
33220
- FirefoxURL: "org.mozilla.firefox"
33221
- };
33222
- return browserMap[progId] ? { id: browserMap[progId] } : {};
33223
- }
33224
- var pTryEach = async (array, mapper) => {
33225
- let latestError;
33226
- for (const item of array) {
33227
- try {
33228
- return await mapper(item);
33229
- } catch (error) {
33230
- latestError = error;
33231
- }
33232
- }
33233
- throw latestError;
33234
- };
33235
- var baseOpen = async (options) => {
33236
- options = {
33237
- wait: false,
33238
- background: false,
33239
- newInstance: false,
33240
- allowNonzeroExitCode: false,
33241
- ...options
33242
- };
33243
- if (Array.isArray(options.app)) {
33244
- return pTryEach(options.app, (singleApp) => baseOpen({
33245
- ...options,
33246
- app: singleApp
33247
- }));
33248
- }
33249
- let { name: app, arguments: appArguments = [] } = options.app ?? {};
33250
- appArguments = [...appArguments];
33251
- if (Array.isArray(app)) {
33252
- return pTryEach(app, (appName) => baseOpen({
33253
- ...options,
33254
- app: {
33255
- name: appName,
33256
- arguments: appArguments
33257
- }
33258
- }));
33259
- }
33260
- if (app === "browser" || app === "browserPrivate") {
33261
- const ids = {
33262
- "com.google.chrome": "chrome",
33263
- "google-chrome.desktop": "chrome",
33264
- "com.brave.Browser": "brave",
33265
- "org.mozilla.firefox": "firefox",
33266
- "firefox.desktop": "firefox",
33267
- "com.microsoft.msedge": "edge",
33268
- "com.microsoft.edge": "edge",
33269
- "com.microsoft.edgemac": "edge",
33270
- "microsoft-edge.desktop": "edge"
33271
- };
33272
- const flags = {
33273
- chrome: "--incognito",
33274
- brave: "--incognito",
33275
- firefox: "--private-window",
33276
- edge: "--inPrivate"
33277
- };
33278
- const browser = is_wsl_default ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser2();
33279
- if (browser.id in ids) {
33280
- const browserName = ids[browser.id];
33281
- if (app === "browserPrivate") {
33282
- appArguments.push(flags[browserName]);
33283
- }
33284
- return baseOpen({
33285
- ...options,
33286
- app: {
33287
- name: apps[browserName],
33288
- arguments: appArguments
33289
- }
33290
- });
33291
- }
33292
- throw new Error(`${browser.name} is not supported as a default browser`);
33293
- }
33294
- let command;
33295
- const cliArguments = [];
33296
- const childProcessOptions = {};
33297
- if (platform === "darwin") {
33298
- command = "open";
33299
- if (options.wait) {
33300
- cliArguments.push("--wait-apps");
33301
- }
33302
- if (options.background) {
33303
- cliArguments.push("--background");
33304
- }
33305
- if (options.newInstance) {
33306
- cliArguments.push("--new");
33307
- }
33308
- if (app) {
33309
- cliArguments.push("-a", app);
33310
- }
33311
- } else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
33312
- command = await powerShellPath();
33313
- cliArguments.push(
33314
- "-NoProfile",
33315
- "-NonInteractive",
33316
- "-ExecutionPolicy",
33317
- "Bypass",
33318
- "-EncodedCommand"
33319
- );
33320
- if (!is_wsl_default) {
33321
- childProcessOptions.windowsVerbatimArguments = true;
33322
- }
33323
- const encodedArguments = ["Start"];
33324
- if (options.wait) {
33325
- encodedArguments.push("-Wait");
33326
- }
33327
- if (app) {
33328
- encodedArguments.push(`"\`"${app}\`""`);
33329
- if (options.target) {
33330
- appArguments.push(options.target);
33331
- }
33332
- } else if (options.target) {
33333
- encodedArguments.push(`"${options.target}"`);
33334
- }
33335
- if (appArguments.length > 0) {
33336
- appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
33337
- encodedArguments.push("-ArgumentList", appArguments.join(","));
33338
- }
33339
- options.target = buffer.Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
33340
- } else {
33341
- if (app) {
33342
- command = app;
33343
- } else {
33344
- const isBundled = !__dirname$1 || __dirname$1 === "/";
33345
- let exeLocalXdgOpen = false;
33346
- try {
33347
- await fs7__default.default.access(localXdgOpenPath, fs7.constants.X_OK);
33348
- exeLocalXdgOpen = true;
33349
- } catch {
33350
- }
33351
- const useSystemXdgOpen = process6__default.default.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
33352
- command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
33353
- }
33354
- if (appArguments.length > 0) {
33355
- cliArguments.push(...appArguments);
33356
- }
33357
- if (!options.wait) {
33358
- childProcessOptions.stdio = "ignore";
33359
- childProcessOptions.detached = true;
33360
- }
33361
- }
33362
- if (platform === "darwin" && appArguments.length > 0) {
33363
- cliArguments.push("--args", ...appArguments);
33364
- }
33365
- if (options.target) {
33366
- cliArguments.push(options.target);
33367
- }
33368
- const subprocess = childProcess__default.default.spawn(command, cliArguments, childProcessOptions);
33369
- if (options.wait) {
33370
- return new Promise((resolve, reject) => {
33371
- subprocess.once("error", reject);
33372
- subprocess.once("close", (exitCode) => {
33373
- if (!options.allowNonzeroExitCode && exitCode > 0) {
33374
- reject(new Error(`Exited with code ${exitCode}`));
33375
- return;
33376
- }
33377
- resolve(subprocess);
33378
- });
33379
- });
33380
- }
33381
- subprocess.unref();
33382
- return subprocess;
33383
- };
33384
- var open = (target, options) => {
33385
- if (typeof target !== "string") {
33386
- throw new TypeError("Expected a `target`");
33387
- }
33388
- return baseOpen({
33389
- ...options,
33390
- target
33391
- });
33392
- };
33393
- function detectArchBinary(binary) {
33394
- if (typeof binary === "string" || Array.isArray(binary)) {
33395
- return binary;
33396
- }
33397
- const { [arch]: archBinary } = binary;
33398
- if (!archBinary) {
33399
- throw new Error(`${arch} is not supported`);
33400
- }
33401
- return archBinary;
33402
- }
33403
- function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
33404
- if (wsl && is_wsl_default) {
33405
- return detectArchBinary(wsl);
33406
- }
33407
- if (!platformBinary) {
33408
- throw new Error(`${platform} is not supported`);
33409
- }
33410
- return detectArchBinary(platformBinary);
33411
- }
33412
- var apps = {};
33413
- defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
33414
- darwin: "google chrome",
33415
- win32: "chrome",
33416
- linux: ["google-chrome", "google-chrome-stable", "chromium"]
33417
- }, {
33418
- wsl: {
33419
- ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
33420
- x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
33421
- }
33422
- }));
33423
- defineLazyProperty(apps, "brave", () => detectPlatformBinary({
33424
- darwin: "brave browser",
33425
- win32: "brave",
33426
- linux: ["brave-browser", "brave"]
33427
- }, {
33428
- wsl: {
33429
- ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
33430
- x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
33431
- }
33432
- }));
33433
- defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
33434
- darwin: "firefox",
33435
- win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
33436
- linux: "firefox"
33437
- }, {
33438
- wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
33439
- }));
33440
- defineLazyProperty(apps, "edge", () => detectPlatformBinary({
33441
- darwin: "microsoft edge",
33442
- win32: "msedge",
33443
- linux: ["microsoft-edge", "microsoft-edge-dev"]
33444
- }, {
33445
- wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
33446
- }));
33447
- defineLazyProperty(apps, "browser", () => "browser");
33448
- defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
33449
- var open_default = open;
33450
32981
  var PORTAL_URL = process.env.UPTRADE_PORTAL_URL || "https://portal.uptrademedia.com";
33451
32982
  var API_URL = process.env.UPTRADE_API_URL || "https://api.uptrademedia.com";
33452
32983
  async function authenticateWithUptrade() {
@@ -33511,7 +33042,7 @@ async function authenticateWithUptrade() {
33511
33042
  console.log("\n Opening browser for authentication...");
33512
33043
  console.log(` If browser doesn't open, visit: ${authUrl}
33513
33044
  `);
33514
- open_default(authUrl).catch(() => {
33045
+ open__default.default(authUrl).catch(() => {
33515
33046
  console.log(" Could not open browser automatically.");
33516
33047
  });
33517
33048
  });
@@ -33756,7 +33287,7 @@ async function initCommand(options) {
33756
33287
  type: "input",
33757
33288
  name: "name",
33758
33289
  message: "Project name:",
33759
- default: path5__default.default.basename(process.cwd()),
33290
+ default: path4__default.default.basename(process.cwd()),
33760
33291
  validate: (input) => input.length > 0 || "Name is required"
33761
33292
  },
33762
33293
  {
@@ -33869,7 +33400,7 @@ async function initCommand(options) {
33869
33400
  async function checkNextJsProject() {
33870
33401
  try {
33871
33402
  const packageJson = JSON.parse(
33872
- await fs7__default.default.readFile(path5__default.default.join(process.cwd(), "package.json"), "utf-8")
33403
+ await fs2__default.default.readFile(path4__default.default.join(process.cwd(), "package.json"), "utf-8")
33873
33404
  );
33874
33405
  return !!(packageJson.dependencies?.next || packageJson.devDependencies?.next);
33875
33406
  } catch {
@@ -33896,7 +33427,7 @@ async function scanCommand(options) {
33896
33427
  console.log("");
33897
33428
  console.log(source_default.bold(" Scanning codebase..."));
33898
33429
  console.log("");
33899
- const targetDir = path5__default.default.resolve(options.dir || ".");
33430
+ const targetDir = path4__default.default.resolve(options.dir || ".");
33900
33431
  const spinner = ora("Looking for forms, metadata, widgets, schemas, FAQs, analytics, and images...").start();
33901
33432
  let scanResults;
33902
33433
  try {
@@ -34074,7 +33605,7 @@ function filePathToPagePath(filePath) {
34074
33605
  }
34075
33606
  if (p.startsWith("pages/") || p.startsWith("src/pages/")) {
34076
33607
  p = p.replace(/^pages\//, "").replace(/^src\/pages\//, "");
34077
- const base = path5__default.default.basename(p, path5__default.default.extname(p));
33608
+ const base = path4__default.default.basename(p, path4__default.default.extname(p));
34078
33609
  return base === "index" ? "/" : "/" + base;
34079
33610
  }
34080
33611
  p = p.replace(/\.[^.]+$/, "").replace(/^\.\//, "").replace(/\\/g, "/");
@@ -34117,10 +33648,10 @@ async function imagesCommand(subcommand, options) {
34117
33648
  }
34118
33649
  }
34119
33650
  async function scanImages(options) {
34120
- const targetDir = path5__default.default.resolve(options.dir || ".");
34121
- const publicDir = path5__default.default.join(targetDir, "public");
33651
+ const targetDir = path4__default.default.resolve(options.dir || ".");
33652
+ const publicDir = path4__default.default.join(targetDir, "public");
34122
33653
  try {
34123
- await fs7__default.default.access(publicDir);
33654
+ await fs2__default.default.access(publicDir);
34124
33655
  } catch {
34125
33656
  console.log(source_default.yellow(" \u26A0 No public folder found"));
34126
33657
  console.log(source_default.gray(" This command scans for images in your public folder."));
@@ -34188,7 +33719,7 @@ async function uploadImages(options) {
34188
33719
  console.log("");
34189
33720
  process.exit(1);
34190
33721
  }
34191
- const targetDir = path5__default.default.resolve(options.dir || ".");
33722
+ const targetDir = path4__default.default.resolve(options.dir || ".");
34192
33723
  const spinner = ora("Scanning for images...").start();
34193
33724
  const results = await scanPublicImages(targetDir);
34194
33725
  spinner.stop();
@@ -34241,7 +33772,7 @@ async function uploadImages(options) {
34241
33772
  const uploadSpinner = ora(`Uploading ${img.filename}...`).start();
34242
33773
  try {
34243
33774
  const result = await uploadImageToPortal(
34244
- path5__default.default.join(targetDir, img.filePath),
33775
+ path4__default.default.join(targetDir, img.filePath),
34245
33776
  img,
34246
33777
  { apiUrl, apiKey, category: options.category }
34247
33778
  );
@@ -34260,8 +33791,8 @@ async function uploadImages(options) {
34260
33791
  }
34261
33792
  console.log("");
34262
33793
  if (uploaded.length > 0) {
34263
- const manifestPath = path5__default.default.join(targetDir, ".uptrade-images.json");
34264
- await fs7__default.default.writeFile(manifestPath, JSON.stringify({
33794
+ const manifestPath = path4__default.default.join(targetDir, ".uptrade-images.json");
33795
+ await fs2__default.default.writeFile(manifestPath, JSON.stringify({
34265
33796
  uploaded,
34266
33797
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
34267
33798
  }, null, 2));
@@ -34273,8 +33804,8 @@ async function uploadImages(options) {
34273
33804
  console.log("");
34274
33805
  }
34275
33806
  async function migrateImages(options) {
34276
- const targetDir = path5__default.default.resolve(options.dir || ".");
34277
- const manifestPath = path5__default.default.join(targetDir, ".uptrade-images.json");
33807
+ const targetDir = path4__default.default.resolve(options.dir || ".");
33808
+ const manifestPath = path4__default.default.join(targetDir, ".uptrade-images.json");
34278
33809
  const apiUrl = process.env.UPTRADE_API_URL || process.env.NEXT_PUBLIC_PORTAL_API_URL || "https://api.uptrademedia.com";
34279
33810
  const apiKey = process.env.UPTRADE_API_KEY || "";
34280
33811
  if (!apiKey) {
@@ -34283,7 +33814,7 @@ async function migrateImages(options) {
34283
33814
  }
34284
33815
  let manifest;
34285
33816
  try {
34286
- const content = await fs7__default.default.readFile(manifestPath, "utf-8");
33817
+ const content = await fs2__default.default.readFile(manifestPath, "utf-8");
34287
33818
  manifest = JSON.parse(content);
34288
33819
  } catch {
34289
33820
  console.log(source_default.yellow(" \u26A0 No upload manifest found"));
@@ -34377,9 +33908,9 @@ async function migrateImages(options) {
34377
33908
  let successCount = 0;
34378
33909
  let failCount = 0;
34379
33910
  for (const [filePath, fileMigrations] of byFile) {
34380
- const fileSpinner = ora(`Migrating ${path5__default.default.basename(filePath)}...`).start();
33911
+ const fileSpinner = ora(`Migrating ${path4__default.default.basename(filePath)}...`).start();
34381
33912
  try {
34382
- await migrateFileImages(path5__default.default.join(targetDir, filePath), fileMigrations);
33913
+ await migrateFileImages(path4__default.default.join(targetDir, filePath), fileMigrations);
34383
33914
  successCount += fileMigrations.length;
34384
33915
  fileSpinner.succeed(`Migrated: ${filePath} (${fileMigrations.length} images)`);
34385
33916
  } catch (error) {
@@ -34401,7 +33932,7 @@ async function migrateImages(options) {
34401
33932
  console.log("");
34402
33933
  }
34403
33934
  async function uploadAndMigrate(options) {
34404
- const targetDir = path5__default.default.resolve(options.dir || ".");
33935
+ const targetDir = path4__default.default.resolve(options.dir || ".");
34405
33936
  const apiUrl = process.env.UPTRADE_API_URL || process.env.NEXT_PUBLIC_PORTAL_API_URL || "https://api.uptrademedia.com";
34406
33937
  const apiKey = process.env.UPTRADE_API_KEY || "";
34407
33938
  if (!apiKey) {
@@ -34468,7 +33999,7 @@ async function uploadAndMigrate(options) {
34468
33999
  const uploadSpinner = ora(`Uploading ${img.filename}...`).start();
34469
34000
  try {
34470
34001
  const result = await uploadImageToPortal(
34471
- path5__default.default.join(targetDir, img.filePath),
34002
+ path4__default.default.join(targetDir, img.filePath),
34472
34003
  img,
34473
34004
  { apiUrl, apiKey, category: options.category }
34474
34005
  );
@@ -34540,9 +34071,9 @@ async function uploadAndMigrate(options) {
34540
34071
  let successCount = 0;
34541
34072
  let failCount = 0;
34542
34073
  for (const [filePath, fileMigrations] of byFile) {
34543
- const fileSpinner = ora(`Migrating ${path5__default.default.basename(filePath)}...`).start();
34074
+ const fileSpinner = ora(`Migrating ${path4__default.default.basename(filePath)}...`).start();
34544
34075
  try {
34545
- await migrateFileImages(path5__default.default.join(targetDir, filePath), fileMigrations);
34076
+ await migrateFileImages(path4__default.default.join(targetDir, filePath), fileMigrations);
34546
34077
  successCount += fileMigrations.length;
34547
34078
  fileSpinner.succeed(`Migrated: ${filePath} (${fileMigrations.length} images)`);
34548
34079
  } catch (error) {
@@ -34550,8 +34081,8 @@ async function uploadAndMigrate(options) {
34550
34081
  fileSpinner.fail(`Failed: ${filePath} - ${error.message}`);
34551
34082
  }
34552
34083
  }
34553
- const manifestPath = path5__default.default.join(targetDir, ".uptrade-images.json");
34554
- await fs7__default.default.writeFile(manifestPath, JSON.stringify({
34084
+ const manifestPath = path4__default.default.join(targetDir, ".uptrade-images.json");
34085
+ await fs2__default.default.writeFile(manifestPath, JSON.stringify({
34555
34086
  uploaded,
34556
34087
  criticalKeptLocal: criticalImages.map((i) => i.filename),
34557
34088
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
@@ -34577,11 +34108,11 @@ async function uploadAndMigrate(options) {
34577
34108
  console.log("");
34578
34109
  }
34579
34110
  async function replaceWithCdnUrls(options) {
34580
- const targetDir = path5__default.default.resolve(options.dir || ".");
34581
- const manifestPath = path5__default.default.join(targetDir, ".uptrade-images.json");
34111
+ const targetDir = path4__default.default.resolve(options.dir || ".");
34112
+ const manifestPath = path4__default.default.join(targetDir, ".uptrade-images.json");
34582
34113
  let manifest;
34583
34114
  try {
34584
- const content = await fs7__default.default.readFile(manifestPath, "utf-8");
34115
+ const content = await fs2__default.default.readFile(manifestPath, "utf-8");
34585
34116
  manifest = JSON.parse(content);
34586
34117
  } catch {
34587
34118
  console.log(source_default.yellow(" \u26A0 No upload manifest found"));
@@ -34606,7 +34137,7 @@ async function replaceWithCdnUrls(options) {
34606
34137
  const seenFileLines = /* @__PURE__ */ new Set();
34607
34138
  for (const file of dataFiles) {
34608
34139
  try {
34609
- const content = await fs7__default.default.readFile(file, "utf-8");
34140
+ const content = await fs2__default.default.readFile(file, "utf-8");
34610
34141
  const lines = content.split("\n");
34611
34142
  for (let i = 0; i < lines.length; i++) {
34612
34143
  for (const img of imagesWithUrls) {
@@ -34626,7 +34157,7 @@ async function replaceWithCdnUrls(options) {
34626
34157
  if (!seenFileLines.has(key)) {
34627
34158
  seenFileLines.add(key);
34628
34159
  replacements2.push({
34629
- file: path5__default.default.relative(targetDir, file),
34160
+ file: path4__default.default.relative(targetDir, file),
34630
34161
  localPath: pattern,
34631
34162
  cdnUrl: img.publicUrl,
34632
34163
  line: i + 1
@@ -34674,16 +34205,16 @@ async function replaceWithCdnUrls(options) {
34674
34205
  let successCount = 0;
34675
34206
  let failCount = 0;
34676
34207
  for (const [filePath, fileReplacements] of byFile) {
34677
- const fileSpinner = ora(`Updating ${path5__default.default.basename(filePath)}...`).start();
34208
+ const fileSpinner = ora(`Updating ${path4__default.default.basename(filePath)}...`).start();
34678
34209
  try {
34679
- const fullPath = path5__default.default.join(targetDir, filePath);
34680
- let content = await fs7__default.default.readFile(fullPath, "utf-8");
34210
+ const fullPath = path4__default.default.join(targetDir, filePath);
34211
+ let content = await fs2__default.default.readFile(fullPath, "utf-8");
34681
34212
  for (const r of fileReplacements) {
34682
34213
  const escaped = r.localPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
34683
34214
  content = content.replace(new RegExp(escaped, "g"), r.cdnUrl);
34684
34215
  successCount++;
34685
34216
  }
34686
- await fs7__default.default.writeFile(fullPath, content, "utf-8");
34217
+ await fs2__default.default.writeFile(fullPath, content, "utf-8");
34687
34218
  fileSpinner.succeed(`Updated: ${filePath} (${fileReplacements.length} paths)`);
34688
34219
  } catch (error) {
34689
34220
  failCount += fileReplacements.length;
@@ -34704,8 +34235,8 @@ async function replaceWithCdnUrls(options) {
34704
34235
  console.log("");
34705
34236
  }
34706
34237
  async function refreshManifest(options) {
34707
- const targetDir = path5__default.default.resolve(options.dir || ".");
34708
- const manifestPath = path5__default.default.join(targetDir, ".uptrade-images.json");
34238
+ const targetDir = path4__default.default.resolve(options.dir || ".");
34239
+ const manifestPath = path4__default.default.join(targetDir, ".uptrade-images.json");
34709
34240
  const apiUrl = process.env.UPTRADE_API_URL || process.env.NEXT_PUBLIC_PORTAL_API_URL || "https://api.uptrademedia.com";
34710
34241
  const apiKey = process.env.UPTRADE_API_KEY || "";
34711
34242
  if (!apiKey) {
@@ -34714,7 +34245,7 @@ async function refreshManifest(options) {
34714
34245
  }
34715
34246
  let manifest;
34716
34247
  try {
34717
- const content = await fs7__default.default.readFile(manifestPath, "utf-8");
34248
+ const content = await fs2__default.default.readFile(manifestPath, "utf-8");
34718
34249
  manifest = JSON.parse(content);
34719
34250
  } catch {
34720
34251
  console.log(source_default.yellow(" \u26A0 No upload manifest found"));
@@ -34749,7 +34280,7 @@ async function refreshManifest(options) {
34749
34280
  updatedCount++;
34750
34281
  }
34751
34282
  }
34752
- await fs7__default.default.writeFile(manifestPath, JSON.stringify({
34283
+ await fs2__default.default.writeFile(manifestPath, JSON.stringify({
34753
34284
  ...manifest,
34754
34285
  refreshed: (/* @__PURE__ */ new Date()).toISOString()
34755
34286
  }, null, 2));
@@ -34770,9 +34301,9 @@ async function findDataFiles(rootDir) {
34770
34301
  const excludeFiles = [".uptrade-images.json"];
34771
34302
  async function scan(dir) {
34772
34303
  try {
34773
- const entries = await fs7__default.default.readdir(dir, { withFileTypes: true });
34304
+ const entries = await fs2__default.default.readdir(dir, { withFileTypes: true });
34774
34305
  for (const entry of entries) {
34775
- const fullPath = path5__default.default.join(dir, entry.name);
34306
+ const fullPath = path4__default.default.join(dir, entry.name);
34776
34307
  if (entry.isDirectory()) {
34777
34308
  if (["node_modules", ".next", ".git", "dist", "build"].includes(entry.name)) {
34778
34309
  continue;
@@ -34782,7 +34313,7 @@ async function findDataFiles(rootDir) {
34782
34313
  if (excludeFiles.includes(entry.name)) {
34783
34314
  continue;
34784
34315
  }
34785
- const ext = path5__default.default.extname(entry.name).toLowerCase();
34316
+ const ext = path4__default.default.extname(entry.name).toLowerCase();
34786
34317
  if ([".js", ".ts", ".json", ".jsx", ".tsx", ".mjs", ".cjs"].includes(ext)) {
34787
34318
  files.push(fullPath);
34788
34319
  }
@@ -34795,17 +34326,17 @@ async function findDataFiles(rootDir) {
34795
34326
  return files;
34796
34327
  }
34797
34328
  async function scanPublicImages(rootDir) {
34798
- const publicDir = path5__default.default.join(rootDir, "public");
34329
+ const publicDir = path4__default.default.join(rootDir, "public");
34799
34330
  const images = [];
34800
34331
  let totalSize = 0;
34801
34332
  let usageCount = 0;
34802
34333
  const imageFiles = await findImagesRecursive(publicDir);
34803
34334
  const sourceFiles = await findSourceFiles(rootDir);
34804
34335
  for (const imagePath of imageFiles) {
34805
- const relPath = path5__default.default.relative(rootDir, imagePath);
34806
- const filename = path5__default.default.basename(imagePath);
34807
- const ext = path5__default.default.extname(filename).toLowerCase();
34808
- const stat = await fs7__default.default.stat(imagePath);
34336
+ const relPath = path4__default.default.relative(rootDir, imagePath);
34337
+ const filename = path4__default.default.basename(imagePath);
34338
+ const ext = path4__default.default.extname(filename).toLowerCase();
34339
+ const stat = await fs2__default.default.stat(imagePath);
34809
34340
  const category = getCategoryFromPath(relPath);
34810
34341
  const suggestedSlotId = generateSlotId(relPath);
34811
34342
  const usedIn = await findImageUsages(imagePath, sourceFiles, rootDir);
@@ -34828,13 +34359,13 @@ async function scanPublicImages(rootDir) {
34828
34359
  }
34829
34360
  async function findImagesRecursive(dir, files = []) {
34830
34361
  try {
34831
- const entries = await fs7__default.default.readdir(dir, { withFileTypes: true });
34362
+ const entries = await fs2__default.default.readdir(dir, { withFileTypes: true });
34832
34363
  for (const entry of entries) {
34833
- const fullPath = path5__default.default.join(dir, entry.name);
34364
+ const fullPath = path4__default.default.join(dir, entry.name);
34834
34365
  if (entry.isDirectory()) {
34835
34366
  await findImagesRecursive(fullPath, files);
34836
34367
  } else if (entry.isFile()) {
34837
- const ext = path5__default.default.extname(entry.name).toLowerCase();
34368
+ const ext = path4__default.default.extname(entry.name).toLowerCase();
34838
34369
  if (IMAGE_EXTENSIONS.includes(ext)) {
34839
34370
  files.push(fullPath);
34840
34371
  }
@@ -34845,9 +34376,9 @@ async function findImagesRecursive(dir, files = []) {
34845
34376
  return files;
34846
34377
  }
34847
34378
  async function findSourceFiles(dir, files = []) {
34848
- const entries = await fs7__default.default.readdir(dir, { withFileTypes: true });
34379
+ const entries = await fs2__default.default.readdir(dir, { withFileTypes: true });
34849
34380
  for (const entry of entries) {
34850
- const fullPath = path5__default.default.join(dir, entry.name);
34381
+ const fullPath = path4__default.default.join(dir, entry.name);
34851
34382
  if (entry.isDirectory()) {
34852
34383
  if (["node_modules", ".next", ".git", "dist", "build", "public"].includes(entry.name)) {
34853
34384
  continue;
@@ -34863,8 +34394,8 @@ async function findSourceFiles(dir, files = []) {
34863
34394
  }
34864
34395
  async function findImageUsages(imagePath, sourceFiles, rootDir) {
34865
34396
  const usages = [];
34866
- const filename = path5__default.default.basename(imagePath);
34867
- const relPath = path5__default.default.relative(path5__default.default.join(rootDir, "public"), imagePath);
34397
+ const filename = path4__default.default.basename(imagePath);
34398
+ const relPath = path4__default.default.relative(path4__default.default.join(rootDir, "public"), imagePath);
34868
34399
  const patterns = [
34869
34400
  `/${relPath}`,
34870
34401
  // /images/hero.jpg
@@ -34877,7 +34408,7 @@ async function findImageUsages(imagePath, sourceFiles, rootDir) {
34877
34408
  ];
34878
34409
  for (const sourceFile of sourceFiles) {
34879
34410
  try {
34880
- const content = await fs7__default.default.readFile(sourceFile, "utf-8");
34411
+ const content = await fs2__default.default.readFile(sourceFile, "utf-8");
34881
34412
  const lines = content.split("\n");
34882
34413
  for (let i = 0; i < lines.length; i++) {
34883
34414
  const line = lines[i];
@@ -34886,7 +34417,7 @@ async function findImageUsages(imagePath, sourceFiles, rootDir) {
34886
34417
  const elementType = detectElementType(line);
34887
34418
  const canAutoMigrate = ["img", "Image"].includes(elementType);
34888
34419
  usages.push({
34889
- filePath: path5__default.default.relative(rootDir, sourceFile),
34420
+ filePath: path4__default.default.relative(rootDir, sourceFile),
34890
34421
  line: i + 1,
34891
34422
  elementType,
34892
34423
  altText: extractAltText(line),
@@ -34958,7 +34489,7 @@ function detectCriticalImage(filename, relPath, usages, fileSize) {
34958
34489
  (u) => u.filePath.includes("layout.") || u.filePath.includes("/layout/")
34959
34490
  );
34960
34491
  const usedInCriticalComponent = usages.some((u) => {
34961
- const fileName = path5__default.default.basename(u.filePath).toLowerCase();
34492
+ const fileName = path4__default.default.basename(u.filePath).toLowerCase();
34962
34493
  return fileName.includes("header") || fileName.includes("navbar") || fileName.includes("nav.") || fileName.includes("hero") || fileName.includes("footer");
34963
34494
  });
34964
34495
  const isSiteLogo = SITE_LOGO_PATTERNS.some((p) => p.test(filename));
@@ -35046,7 +34577,7 @@ async function uploadImageToPortal(localPath, image, config2) {
35046
34577
  };
35047
34578
  }
35048
34579
  async function migrateFileImages(filePath, migrations) {
35049
- let content = await fs7__default.default.readFile(filePath, "utf-8");
34580
+ let content = await fs2__default.default.readFile(filePath, "utf-8");
35050
34581
  const lines = content.split("\n");
35051
34582
  const sortedMigrations = [...migrations].sort((a, b) => b.usage.line - a.usage.line);
35052
34583
  for (const m of sortedMigrations) {
@@ -35070,7 +34601,7 @@ async function migrateFileImages(filePath, migrations) {
35070
34601
  lines.splice(insertIndex, 0, importLine);
35071
34602
  }
35072
34603
  content = lines.join("\n");
35073
- await fs7__default.default.writeFile(filePath, content, "utf-8");
34604
+ await fs2__default.default.writeFile(filePath, content, "utf-8");
35074
34605
  }
35075
34606
  function formatBytes(bytes) {
35076
34607
  if (bytes < 1024) return `${bytes} B`;
@@ -35094,7 +34625,7 @@ async function uploadAndMigrateImages(scanResults, options) {
35094
34625
  for (const img of scanResults.images) {
35095
34626
  try {
35096
34627
  const uploadResult = await uploadImageToPortal(
35097
- path5__default.default.join(rootDir, img.filePath),
34628
+ path4__default.default.join(rootDir, img.filePath),
35098
34629
  img,
35099
34630
  {
35100
34631
  apiUrl: options.apiUrl,
@@ -35122,7 +34653,7 @@ async function uploadAndMigrateImages(scanResults, options) {
35122
34653
  }
35123
34654
  for (const [filePath, migrations] of byFile) {
35124
34655
  try {
35125
- await migrateFileImages(path5__default.default.join(rootDir, filePath), migrations);
34656
+ await migrateFileImages(path4__default.default.join(rootDir, filePath), migrations);
35126
34657
  result.migrated += migrations.length;
35127
34658
  } catch (error) {
35128
34659
  result.errors.push(`Migration failed for ${filePath}: ${error.message}`);
@@ -35149,14 +34680,14 @@ async function migrateCommand(options) {
35149
34680
  console.log("");
35150
34681
  }
35151
34682
  if (options.file) {
35152
- const filePath = path5__default.default.resolve(options.file);
34683
+ const filePath = path4__default.default.resolve(options.file);
35153
34684
  try {
35154
- await fs7__default.default.access(filePath);
34685
+ await fs2__default.default.access(filePath);
35155
34686
  } catch {
35156
34687
  console.log(source_default.red(` \u2717 File not found: ${filePath}`));
35157
34688
  process.exit(1);
35158
34689
  }
35159
- const spinner = ora(`Migrating ${path5__default.default.basename(filePath)}...`).start();
34690
+ const spinner = ora(`Migrating ${path4__default.default.basename(filePath)}...`).start();
35160
34691
  try {
35161
34692
  const result = await chunk4TGJYNHV_js.migrateFile(filePath, {
35162
34693
  projectId,
@@ -35373,7 +34904,7 @@ async function locationsCommand(subcommand, arg, options) {
35373
34904
  async function templateCommand(sourcePath, options, config2) {
35374
34905
  const spinner = ora("Analyzing source page...").start();
35375
34906
  try {
35376
- const resolvedPath = path5__default.default.resolve(sourcePath);
34907
+ const resolvedPath = path4__default.default.resolve(sourcePath);
35377
34908
  if (!fs.existsSync(resolvedPath)) {
35378
34909
  spinner.fail(`File not found: ${sourcePath}`);
35379
34910
  return;
@@ -35427,9 +34958,9 @@ async function templateCommand(sourcePath, options, config2) {
35427
34958
  },
35428
34959
  managed_components: ["schema", "faqs", "metadata"]
35429
34960
  };
35430
- await fs7__default.default.mkdir(TEMPLATES_DIR, { recursive: true });
35431
- const templatePath = path5__default.default.join(TEMPLATES_DIR, `${templateName}.json`);
35432
- await fs7__default.default.writeFile(templatePath, JSON.stringify(template, null, 2));
34961
+ await fs2__default.default.mkdir(TEMPLATES_DIR, { recursive: true });
34962
+ const templatePath = path4__default.default.join(TEMPLATES_DIR, `${templateName}.json`);
34963
+ await fs2__default.default.writeFile(templatePath, JSON.stringify(template, null, 2));
35433
34964
  console.log("");
35434
34965
  console.log(source_default.green(" \u2713 Template created:"), source_default.cyan(templatePath));
35435
34966
  console.log("");
@@ -35507,7 +35038,7 @@ function inferGenerationHint(propName) {
35507
35038
  return void 0;
35508
35039
  }
35509
35040
  function inferTemplateName(sourcePath) {
35510
- const parts = sourcePath.split(path5__default.default.sep);
35041
+ const parts = sourcePath.split(path4__default.default.sep);
35511
35042
  const pageIndex = parts.findIndex((p) => p === "page.tsx" || p === "page.jsx");
35512
35043
  if (pageIndex > 0) {
35513
35044
  return parts[pageIndex - 1];
@@ -35516,14 +35047,14 @@ function inferTemplateName(sourcePath) {
35516
35047
  return filtered[filtered.length - 1] || "template";
35517
35048
  }
35518
35049
  function inferSourcePagePath(sourcePath) {
35519
- const parts = sourcePath.split(path5__default.default.sep);
35050
+ const parts = sourcePath.split(path4__default.default.sep);
35520
35051
  const appIndex = parts.findIndex((p) => p === "app" || p === "pages");
35521
35052
  if (appIndex >= 0) {
35522
35053
  const pathParts = parts.slice(appIndex + 1);
35523
35054
  const filtered = pathParts.filter((p) => !["page.tsx", "page.jsx", "index.tsx", "index.jsx"].includes(p));
35524
35055
  return "/" + filtered.join("/");
35525
35056
  }
35526
- return "/" + path5__default.default.basename(sourcePath, path5__default.default.extname(sourcePath));
35057
+ return "/" + path4__default.default.basename(sourcePath, path4__default.default.extname(sourcePath));
35527
35058
  }
35528
35059
  function toSnakeCase(str) {
35529
35060
  return str.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/^_/, "");
@@ -35535,7 +35066,7 @@ function truncate(str, maxLength) {
35535
35066
  async function uploadCommand(templateName, config2) {
35536
35067
  const spinner = ora("Uploading template to Portal...").start();
35537
35068
  try {
35538
- const templatePath = path5__default.default.join(TEMPLATES_DIR, `${templateName}.json`);
35069
+ const templatePath = path4__default.default.join(TEMPLATES_DIR, `${templateName}.json`);
35539
35070
  if (!fs.existsSync(templatePath)) {
35540
35071
  spinner.fail(`Template not found: ${templatePath}`);
35541
35072
  console.log(source_default.gray(` Run: npx uptrade-setup locations template <page> --name ${templateName}`));
@@ -35677,7 +35208,7 @@ async function listCommand(config2) {
35677
35208
  }
35678
35209
  console.log("");
35679
35210
  if (fs.existsSync(TEMPLATES_DIR)) {
35680
- const files = await fs7__default.default.readdir(TEMPLATES_DIR);
35211
+ const files = await fs2__default.default.readdir(TEMPLATES_DIR);
35681
35212
  const localTemplates = files.filter((f) => f.endsWith(".json"));
35682
35213
  if (localTemplates.length > 0) {
35683
35214
  console.log(source_default.gray(" Local (not uploaded):"));
@@ -35692,7 +35223,7 @@ async function listCommand(config2) {
35692
35223
  }
35693
35224
  }
35694
35225
  async function loadConfig() {
35695
- const configPath = path5__default.default.join(".uptrade", "config.json");
35226
+ const configPath = path4__default.default.join(".uptrade", "config.json");
35696
35227
  if (fs.existsSync(configPath)) {
35697
35228
  try {
35698
35229
  const config2 = JSON.parse(fs.readFileSync(configPath, "utf-8"));
@@ -35713,7 +35244,7 @@ async function loadConfig() {
35713
35244
  }
35714
35245
  var API_URL3 = process.env.UPTRADE_API_URL || process.env.NEXT_PUBLIC_UPTRADE_API_URL || "https://api.uptrademedia.com";
35715
35246
  async function loadConfig2() {
35716
- const configPath = path5__default.default.join(".uptrade", "config.json");
35247
+ const configPath = path4__default.default.join(".uptrade", "config.json");
35717
35248
  if (fs.existsSync(configPath)) {
35718
35249
  try {
35719
35250
  const config2 = JSON.parse(fs.readFileSync(configPath, "utf-8"));
@@ -35788,8 +35319,8 @@ async function extractCommand(options, config2) {
35788
35319
  const faqContexts = [];
35789
35320
  for (const faq of faqSections) {
35790
35321
  try {
35791
- const fullPath = path5__default.default.resolve(process.cwd(), faq.filePath);
35792
- const content = await fs7__default.default.readFile(fullPath, "utf-8");
35322
+ const fullPath = path4__default.default.resolve(process.cwd(), faq.filePath);
35323
+ const content = await fs2__default.default.readFile(fullPath, "utf-8");
35793
35324
  let pagePath = faq.filePath.replace(/^app\//, "/").replace(/^src\/app\//, "/").replace(/\/page\.(tsx?|jsx?)$/, "").replace(/\[([^\]]+)\]/g, ":$1");
35794
35325
  if (pagePath === "" || pagePath === "/page") pagePath = "/";
35795
35326
  const importMatches = content.matchAll(/import\s+(?:\{[^}]+\}|\w+)\s+from\s+['"]([^'"]+)['"]/g);
@@ -35803,14 +35334,14 @@ async function extractCommand(options, config2) {
35803
35334
  if (importPath.startsWith("@/")) {
35804
35335
  resolvedPath = importPath.replace("@/", "./");
35805
35336
  } else if (importPath.startsWith(".")) {
35806
- resolvedPath = path5__default.default.resolve(path5__default.default.dirname(fullPath), importPath);
35337
+ resolvedPath = path4__default.default.resolve(path4__default.default.dirname(fullPath), importPath);
35807
35338
  }
35808
35339
  const extensions = ["", ".js", ".ts", ".jsx", ".tsx", ".json"];
35809
35340
  for (const ext of extensions) {
35810
35341
  const tryPath = resolvedPath + ext;
35811
35342
  if (fs.existsSync(tryPath)) {
35812
35343
  try {
35813
- importedFiles[importPath] = await fs7__default.default.readFile(tryPath, "utf-8");
35344
+ importedFiles[importPath] = await fs2__default.default.readFile(tryPath, "utf-8");
35814
35345
  } catch {
35815
35346
  }
35816
35347
  break;
@@ -36065,7 +35596,7 @@ function getApiUrl() {
36065
35596
  return process.env.UPTRADE_API_URL || process.env.NEXT_PUBLIC_UPTRADE_API_URL || "https://api.uptrademedia.com";
36066
35597
  }
36067
35598
  async function loadConfig3() {
36068
- const configPath = path5__default.default.join(".uptrade", "config.json");
35599
+ const configPath = path4__default.default.join(".uptrade", "config.json");
36069
35600
  if (fs.existsSync(configPath)) {
36070
35601
  try {
36071
35602
  const config2 = JSON.parse(fs.readFileSync(configPath, "utf-8"));
@@ -36295,10 +35826,10 @@ async function setupCommand(options) {
36295
35826
  }
36296
35827
  async function scanForPageFiles(rootDir) {
36297
35828
  const pages = [];
36298
- const appDir = path5__default.default.join(rootDir, "app");
36299
- const srcAppDir = path5__default.default.join(rootDir, "src", "app");
36300
- const pagesDir = path5__default.default.join(rootDir, "pages");
36301
- const srcPagesDir = path5__default.default.join(rootDir, "src", "pages");
35829
+ const appDir = path4__default.default.join(rootDir, "app");
35830
+ const srcAppDir = path4__default.default.join(rootDir, "src", "app");
35831
+ const pagesDir = path4__default.default.join(rootDir, "pages");
35832
+ const srcPagesDir = path4__default.default.join(rootDir, "src", "pages");
36302
35833
  const dirs = [appDir, srcAppDir, pagesDir, srcPagesDir];
36303
35834
  for (const dir of dirs) {
36304
35835
  if (fs.existsSync(dir)) {
@@ -36308,9 +35839,9 @@ async function scanForPageFiles(rootDir) {
36308
35839
  return pages;
36309
35840
  }
36310
35841
  async function scanDirectory(dir, baseDir, pages) {
36311
- const entries = await fs7__default.default.readdir(dir, { withFileTypes: true });
35842
+ const entries = await fs2__default.default.readdir(dir, { withFileTypes: true });
36312
35843
  for (const entry of entries) {
36313
- const fullPath = path5__default.default.join(dir, entry.name);
35844
+ const fullPath = path4__default.default.join(dir, entry.name);
36314
35845
  if (entry.isDirectory()) {
36315
35846
  if (entry.name.startsWith(".") || entry.name === "node_modules" || entry.name === "api") {
36316
35847
  continue;
@@ -36320,9 +35851,9 @@ async function scanDirectory(dir, baseDir, pages) {
36320
35851
  const isPage = entry.name.match(/^page\.(tsx?|jsx?)$/);
36321
35852
  const isLegacyPage = baseDir.includes("/pages") && entry.name.match(/\.(tsx?|jsx?)$/) && !entry.name.startsWith("_");
36322
35853
  if (isPage || isLegacyPage) {
36323
- const content = await fs7__default.default.readFile(fullPath, "utf-8");
36324
- const relativePath = path5__default.default.relative(baseDir, fullPath);
36325
- let pagePath = "/" + path5__default.default.dirname(relativePath).replace(/\\/g, "/").replace(/\/page$/, "");
35854
+ const content = await fs2__default.default.readFile(fullPath, "utf-8");
35855
+ const relativePath = path4__default.default.relative(baseDir, fullPath);
35856
+ let pagePath = "/" + path4__default.default.dirname(relativePath).replace(/\\/g, "/").replace(/\/page$/, "");
36326
35857
  pagePath = pagePath.replace(/\[([^\]]+)\]/g, ":$1").replace(/^\/\.$/, "/");
36327
35858
  if (pagePath === "/.") pagePath = "/";
36328
35859
  pages.push({
@@ -36342,17 +35873,17 @@ async function gatherImportedFiles(page, rootDir) {
36342
35873
  if (importPath.toLowerCase().includes("faq") || importPath.includes("@/data") || importPath.includes("./data") || importPath.includes("../data") || importPath.includes("/constants") || importPath.includes("/content") || importPath.includes("practice-areas") || importPath.includes("subpages") || importPath.includes("pages-data")) {
36343
35874
  let resolvedPath = importPath;
36344
35875
  if (importPath.startsWith("@/")) {
36345
- resolvedPath = path5__default.default.join(rootDir, importPath.replace("@/", ""));
35876
+ resolvedPath = path4__default.default.join(rootDir, importPath.replace("@/", ""));
36346
35877
  } else if (importPath.startsWith(".")) {
36347
- const pageDir = path5__default.default.dirname(path5__default.default.join(rootDir, "app", page.filePath));
36348
- resolvedPath = path5__default.default.resolve(pageDir, importPath);
35878
+ const pageDir = path4__default.default.dirname(path4__default.default.join(rootDir, "app", page.filePath));
35879
+ resolvedPath = path4__default.default.resolve(pageDir, importPath);
36349
35880
  }
36350
35881
  const extensions = ["", ".js", ".ts", ".jsx", ".tsx", ".json"];
36351
35882
  for (const ext of extensions) {
36352
35883
  const tryPath = resolvedPath + ext;
36353
35884
  if (fs.existsSync(tryPath)) {
36354
35885
  try {
36355
- page.importedFiles[importPath] = await fs7__default.default.readFile(tryPath, "utf-8");
35886
+ page.importedFiles[importPath] = await fs2__default.default.readFile(tryPath, "utf-8");
36356
35887
  } catch {
36357
35888
  }
36358
35889
  break;
@@ -36401,27 +35932,27 @@ async function expandDynamicRoutes(pages, rootDir) {
36401
35932
  async function findDynamicRouteData(page, parentPath, rootDir) {
36402
35933
  const results = [];
36403
35934
  const dataFilePaths = [
36404
- path5__default.default.join(rootDir, "data", "practice-areas.js"),
36405
- path5__default.default.join(rootDir, "data", "practice-areas.ts"),
36406
- path5__default.default.join(rootDir, "data", "personal-injury-pages.js"),
36407
- path5__default.default.join(rootDir, "data", "personal-injury-pages.ts"),
36408
- path5__default.default.join(rootDir, "data", "pages.js"),
36409
- path5__default.default.join(rootDir, "data", "pages.ts"),
36410
- path5__default.default.join(rootDir, "data", "content.js"),
36411
- path5__default.default.join(rootDir, "data", "content.ts"),
36412
- path5__default.default.join(rootDir, "data", "services.js"),
36413
- path5__default.default.join(rootDir, "data", "services.ts"),
36414
- path5__default.default.join(rootDir, "data", "subpages.js"),
36415
- path5__default.default.join(rootDir, "data", "subpages.ts"),
36416
- path5__default.default.join(rootDir, "src", "data", "practice-areas.js"),
36417
- path5__default.default.join(rootDir, "src", "data", "practice-areas.ts")
35935
+ path4__default.default.join(rootDir, "data", "practice-areas.js"),
35936
+ path4__default.default.join(rootDir, "data", "practice-areas.ts"),
35937
+ path4__default.default.join(rootDir, "data", "personal-injury-pages.js"),
35938
+ path4__default.default.join(rootDir, "data", "personal-injury-pages.ts"),
35939
+ path4__default.default.join(rootDir, "data", "pages.js"),
35940
+ path4__default.default.join(rootDir, "data", "pages.ts"),
35941
+ path4__default.default.join(rootDir, "data", "content.js"),
35942
+ path4__default.default.join(rootDir, "data", "content.ts"),
35943
+ path4__default.default.join(rootDir, "data", "services.js"),
35944
+ path4__default.default.join(rootDir, "data", "services.ts"),
35945
+ path4__default.default.join(rootDir, "data", "subpages.js"),
35946
+ path4__default.default.join(rootDir, "data", "subpages.ts"),
35947
+ path4__default.default.join(rootDir, "src", "data", "practice-areas.js"),
35948
+ path4__default.default.join(rootDir, "src", "data", "practice-areas.ts")
36418
35949
  ];
36419
35950
  const routeSegment = parentPath.replace(/^\//, "").split("/")[0];
36420
35951
  const routeSegmentNormalized = routeSegment.replace(/-/g, "");
36421
35952
  for (const dataFile of dataFilePaths) {
36422
35953
  if (!fs.existsSync(dataFile)) continue;
36423
35954
  try {
36424
- const content = await fs7__default.default.readFile(dataFile, "utf-8");
35955
+ const content = await fs2__default.default.readFile(dataFile, "utf-8");
36425
35956
  const exportPattern = new RegExp(
36426
35957
  `export\\s+const\\s+(${routeSegment.replace(/-/g, "[\\-_]?")}\\w*|\\w*${routeSegmentNormalized}\\w*)\\s*=\\s*\\{`,
36427
35958
  "i"
@@ -36738,8 +36269,8 @@ async function checkApiConnectivity() {
36738
36269
  async function checkProjectConfig() {
36739
36270
  const checks = [];
36740
36271
  try {
36741
- const packageJsonPath = path5__default.default.join(process.cwd(), "package.json");
36742
- const packageJson = JSON.parse(await fs7__default.default.readFile(packageJsonPath, "utf-8"));
36272
+ const packageJsonPath = path4__default.default.join(process.cwd(), "package.json");
36273
+ const packageJson = JSON.parse(await fs2__default.default.readFile(packageJsonPath, "utf-8"));
36743
36274
  const hasSiteKit = packageJson.dependencies?.["@uptrade/site-kit"] || packageJson.devDependencies?.["@uptrade/site-kit"];
36744
36275
  if (hasSiteKit) {
36745
36276
  checks.push({
@@ -36774,14 +36305,14 @@ async function checkProjectConfig() {
36774
36305
  }
36775
36306
  async function checkSiteKitProvider() {
36776
36307
  const layoutPaths = [
36777
- path5__default.default.join(process.cwd(), "app", "layout.tsx"),
36778
- path5__default.default.join(process.cwd(), "app", "layout.jsx"),
36779
- path5__default.default.join(process.cwd(), "src", "app", "layout.tsx"),
36780
- path5__default.default.join(process.cwd(), "src", "app", "layout.jsx")
36308
+ path4__default.default.join(process.cwd(), "app", "layout.tsx"),
36309
+ path4__default.default.join(process.cwd(), "app", "layout.jsx"),
36310
+ path4__default.default.join(process.cwd(), "src", "app", "layout.tsx"),
36311
+ path4__default.default.join(process.cwd(), "src", "app", "layout.jsx")
36781
36312
  ];
36782
36313
  for (const layoutPath of layoutPaths) {
36783
36314
  try {
36784
- const content = await fs7__default.default.readFile(layoutPath, "utf-8");
36315
+ const content = await fs2__default.default.readFile(layoutPath, "utf-8");
36785
36316
  if (content.includes("SiteKitProvider")) {
36786
36317
  return {
36787
36318
  name: "SiteKitProvider",
@@ -36802,15 +36333,15 @@ async function checkSiteKitProvider() {
36802
36333
  }
36803
36334
  async function checkSitemap() {
36804
36335
  const sitemapPaths = [
36805
- path5__default.default.join(process.cwd(), "app", "sitemap.ts"),
36806
- path5__default.default.join(process.cwd(), "app", "sitemap.tsx"),
36807
- path5__default.default.join(process.cwd(), "app", "sitemap.js"),
36808
- path5__default.default.join(process.cwd(), "src", "app", "sitemap.ts"),
36809
- path5__default.default.join(process.cwd(), "src", "app", "sitemap.tsx")
36336
+ path4__default.default.join(process.cwd(), "app", "sitemap.ts"),
36337
+ path4__default.default.join(process.cwd(), "app", "sitemap.tsx"),
36338
+ path4__default.default.join(process.cwd(), "app", "sitemap.js"),
36339
+ path4__default.default.join(process.cwd(), "src", "app", "sitemap.ts"),
36340
+ path4__default.default.join(process.cwd(), "src", "app", "sitemap.tsx")
36810
36341
  ];
36811
36342
  for (const sitemapPath of sitemapPaths) {
36812
36343
  try {
36813
- const content = await fs7__default.default.readFile(sitemapPath, "utf-8");
36344
+ const content = await fs2__default.default.readFile(sitemapPath, "utf-8");
36814
36345
  if (content.includes("createSitemap") || content.includes("@uptrade/site-kit")) {
36815
36346
  return {
36816
36347
  name: "Sitemap",
@@ -36916,8 +36447,8 @@ async function syncPagesToPortal(apiUrl, apiKey, dryRun) {
36916
36447
  }
36917
36448
  function findAppDir() {
36918
36449
  const candidates = [
36919
- path5__default.default.join(process.cwd(), "app"),
36920
- path5__default.default.join(process.cwd(), "src", "app")
36450
+ path4__default.default.join(process.cwd(), "app"),
36451
+ path4__default.default.join(process.cwd(), "src", "app")
36921
36452
  ];
36922
36453
  for (const candidate of candidates) {
36923
36454
  if (fs.existsSync(candidate)) {
@@ -36927,7 +36458,7 @@ function findAppDir() {
36927
36458
  return null;
36928
36459
  }
36929
36460
  function discoverPages(appDir, currentPath = "", pages = []) {
36930
- const fullPath = path5__default.default.join(appDir, currentPath);
36461
+ const fullPath = path4__default.default.join(appDir, currentPath);
36931
36462
  if (!fs.existsSync(fullPath)) {
36932
36463
  return pages;
36933
36464
  }
@@ -36949,7 +36480,7 @@ function discoverPages(appDir, currentPath = "", pages = []) {
36949
36480
  });
36950
36481
  }
36951
36482
  for (const entry of entries) {
36952
- const entryPath = path5__default.default.join(fullPath, entry);
36483
+ const entryPath = path4__default.default.join(fullPath, entry);
36953
36484
  const stat = fs.statSync(entryPath);
36954
36485
  if (stat.isDirectory()) {
36955
36486
  const folderName = entry.toLowerCase();
@@ -36962,7 +36493,7 @@ function discoverPages(appDir, currentPath = "", pages = []) {
36962
36493
  if (entry.startsWith("_")) {
36963
36494
  continue;
36964
36495
  }
36965
- discoverPages(appDir, path5__default.default.join(currentPath, entry), pages);
36496
+ discoverPages(appDir, path4__default.default.join(currentPath, entry), pages);
36966
36497
  }
36967
36498
  }
36968
36499
  return pages;
@@ -36986,8 +36517,8 @@ async function apiRoutesCommand(options) {
36986
36517
  console.log("");
36987
36518
  process.exit(1);
36988
36519
  }
36989
- const routeDir = path5__default.default.join(appDir, "_uptrade", "api", "[...path]");
36990
- const routeFile = path5__default.default.join(routeDir, "route.ts");
36520
+ const routeDir = path4__default.default.join(appDir, "_uptrade", "api", "[...path]");
36521
+ const routeFile = path4__default.default.join(routeDir, "route.ts");
36991
36522
  if (fs.existsSync(routeFile) && !options.force) {
36992
36523
  console.log(source_default.yellow(" \u26A0 API routes already exist"));
36993
36524
  console.log(source_default.gray(` ${routeFile}`));
@@ -37004,8 +36535,8 @@ async function apiRoutesCommand(options) {
37004
36535
  }
37005
36536
  const spinner = ora("Creating API routes...").start();
37006
36537
  try {
37007
- await fs7__default.default.mkdir(routeDir, { recursive: true });
37008
- await fs7__default.default.writeFile(routeFile, generateRouteHandler());
36538
+ await fs2__default.default.mkdir(routeDir, { recursive: true });
36539
+ await fs2__default.default.writeFile(routeFile, generateRouteHandler());
37009
36540
  spinner.succeed("Created API proxy routes");
37010
36541
  console.log(source_default.gray(` ${routeFile}`));
37011
36542
  console.log("");
@@ -37024,8 +36555,8 @@ async function apiRoutesCommand(options) {
37024
36555
  }
37025
36556
  function findAppDir2() {
37026
36557
  const candidates = [
37027
- path5__default.default.join(process.cwd(), "app"),
37028
- path5__default.default.join(process.cwd(), "src", "app")
36558
+ path4__default.default.join(process.cwd(), "app"),
36559
+ path4__default.default.join(process.cwd(), "src", "app")
37029
36560
  ];
37030
36561
  for (const candidate of candidates) {
37031
36562
  if (fs.existsSync(candidate)) {
@@ -37141,7 +36672,7 @@ async function installCommand(options) {
37141
36672
  console.log("");
37142
36673
  console.log(source_default.bold(" Install @uptrade/site-kit"));
37143
36674
  console.log("");
37144
- const packageJsonPath = path5__default.default.join(process.cwd(), "package.json");
36675
+ const packageJsonPath = path4__default.default.join(process.cwd(), "package.json");
37145
36676
  if (!fs.existsSync(packageJsonPath)) {
37146
36677
  console.log(source_default.red(" \u2717 No package.json found"));
37147
36678
  console.log(source_default.gray(" Make sure you are in a Node.js project"));
@@ -37163,7 +36694,7 @@ async function installCommand(options) {
37163
36694
  }
37164
36695
  const spinner = ora("Installing...").start();
37165
36696
  try {
37166
- childProcess.execSync(fullCmd, {
36697
+ child_process.execSync(fullCmd, {
37167
36698
  stdio: "pipe",
37168
36699
  cwd: process.cwd()
37169
36700
  });
@@ -37171,7 +36702,8 @@ async function installCommand(options) {
37171
36702
  console.log("");
37172
36703
  console.log(source_default.green(" Next steps:"));
37173
36704
  console.log(source_default.gray(" 1. Run: npx uptrade-setup init"));
37174
- console.log(source_default.gray(" 2. Follow the setup wizard"));
36705
+ console.log(source_default.gray(" 2. Run: npx uptrade-setup scaffold (sitemap, robots, llms routes)"));
36706
+ console.log(source_default.gray(" 3. Follow the setup wizard"));
37175
36707
  console.log("");
37176
36708
  } catch (error) {
37177
36709
  spinner.fail("Installation failed");
@@ -37180,10 +36712,10 @@ async function installCommand(options) {
37180
36712
  }
37181
36713
  }
37182
36714
  function detectPackageManager() {
37183
- if (fs.existsSync(path5__default.default.join(process.cwd(), "pnpm-lock.yaml"))) {
36715
+ if (fs.existsSync(path4__default.default.join(process.cwd(), "pnpm-lock.yaml"))) {
37184
36716
  return "pnpm";
37185
36717
  }
37186
- if (fs.existsSync(path5__default.default.join(process.cwd(), "yarn.lock"))) {
36718
+ if (fs.existsSync(path4__default.default.join(process.cwd(), "yarn.lock"))) {
37187
36719
  return "yarn";
37188
36720
  }
37189
36721
  return "npm";
@@ -37192,7 +36724,7 @@ async function upgradeCommand(options) {
37192
36724
  console.log("");
37193
36725
  console.log(source_default.bold(" Upgrade @uptrade/site-kit"));
37194
36726
  console.log("");
37195
- const packageJsonPath = path5__default.default.join(process.cwd(), "package.json");
36727
+ const packageJsonPath = path4__default.default.join(process.cwd(), "package.json");
37196
36728
  if (!fs.existsSync(packageJsonPath)) {
37197
36729
  console.log(source_default.red(" \u2717 No package.json found"));
37198
36730
  console.log("");
@@ -37222,7 +36754,7 @@ async function upgradeCommand(options) {
37222
36754
  }
37223
36755
  const spinner = ora("Upgrading...").start();
37224
36756
  try {
37225
- const result = childProcess.execSync(fullCmd, {
36757
+ const result = child_process.execSync(fullCmd, {
37226
36758
  stdio: "pipe",
37227
36759
  cwd: process.cwd()
37228
36760
  });
@@ -37237,14 +36769,103 @@ async function upgradeCommand(options) {
37237
36769
  }
37238
36770
  }
37239
36771
  function detectPackageManager2() {
37240
- if (fs.existsSync(path5__default.default.join(process.cwd(), "pnpm-lock.yaml"))) {
36772
+ if (fs.existsSync(path4__default.default.join(process.cwd(), "pnpm-lock.yaml"))) {
37241
36773
  return "pnpm";
37242
36774
  }
37243
- if (fs.existsSync(path5__default.default.join(process.cwd(), "yarn.lock"))) {
36775
+ if (fs.existsSync(path4__default.default.join(process.cwd(), "yarn.lock"))) {
37244
36776
  return "yarn";
37245
36777
  }
37246
36778
  return "npm";
37247
36779
  }
36780
+ async function scaffoldCommand(options) {
36781
+ console.log("");
36782
+ console.log(source_default.bold(" Scaffold Site-Kit default stack"));
36783
+ console.log(source_default.gray(" sitemap, robots.txt, llms.txt, llms-full.txt"));
36784
+ console.log("");
36785
+ const appDir = await findAppDir3();
36786
+ if (!appDir) {
36787
+ console.log(source_default.red(" \u2717 No app directory found (app/ or src/app/)"));
36788
+ process.exit(1);
36789
+ }
36790
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
36791
+ const files = [
36792
+ {
36793
+ path: path4__default.default.join(appDir, "sitemap.ts"),
36794
+ content: `import { createSitemap } from '@uptrademedia/site-kit/sitemap'
36795
+
36796
+ export default createSitemap({
36797
+ baseUrl: process.env.NEXT_PUBLIC_SITE_URL || '${baseUrl}',
36798
+ // additionalPaths: async () => [...],
36799
+ })
36800
+ `
36801
+ },
36802
+ {
36803
+ path: path4__default.default.join(appDir, "robots.txt", "route.ts"),
36804
+ content: `import { createRobots } from '@uptrademedia/site-kit/robots'
36805
+
36806
+ const handler = createRobots({
36807
+ baseUrl: process.env.NEXT_PUBLIC_SITE_URL || '${baseUrl}',
36808
+ })
36809
+
36810
+ export const GET = handler
36811
+ `
36812
+ },
36813
+ {
36814
+ path: path4__default.default.join(appDir, "llms.txt", "route.ts"),
36815
+ content: `import { createLLMsTxtHandler } from '@uptrademedia/site-kit/llms'
36816
+
36817
+ export const GET = createLLMsTxtHandler({ preferStatic: true })
36818
+ `
36819
+ },
36820
+ {
36821
+ path: path4__default.default.join(appDir, "llms-full.txt", "route.ts"),
36822
+ content: `import { createLLMsFullTxtHandler } from '@uptrademedia/site-kit/llms'
36823
+
36824
+ export const GET = createLLMsFullTxtHandler({ preferStatic: true })
36825
+ `
36826
+ }
36827
+ ];
36828
+ if (options.dryRun) {
36829
+ console.log(source_default.yellow(" [DRY RUN] Would create:"));
36830
+ for (const f of files) {
36831
+ console.log(source_default.gray(` ${f.path}`));
36832
+ }
36833
+ console.log("");
36834
+ return;
36835
+ }
36836
+ const spinner = ora("Scaffolding...").start();
36837
+ for (const f of files) {
36838
+ try {
36839
+ if (fs.existsSync(f.path) && !options.force) {
36840
+ spinner.warn(`Skipped (exists): ${path4__default.default.relative(process.cwd(), f.path)}`);
36841
+ continue;
36842
+ }
36843
+ await fs2__default.default.mkdir(path4__default.default.dirname(f.path), { recursive: true });
36844
+ await fs2__default.default.writeFile(f.path, f.content, "utf-8");
36845
+ spinner.succeed(`Created ${path4__default.default.relative(process.cwd(), f.path)}`);
36846
+ } catch (err) {
36847
+ spinner.fail(`Failed: ${f.path}`);
36848
+ console.log(source_default.red(` ${err.message}`));
36849
+ }
36850
+ }
36851
+ console.log("");
36852
+ console.log(source_default.green(" Next steps:"));
36853
+ console.log(source_default.gray(" - Set NEXT_PUBLIC_SITE_URL in .env.local"));
36854
+ console.log(source_default.gray(" - Set NEXT_PUBLIC_UPTRADE_API_KEY for llms.txt"));
36855
+ console.log(source_default.gray(" - Add getLocalData to llms route if using local data"));
36856
+ console.log("");
36857
+ }
36858
+ async function findAppDir3() {
36859
+ const cwd = process.cwd();
36860
+ const candidates = [
36861
+ path4__default.default.join(cwd, "app"),
36862
+ path4__default.default.join(cwd, "src", "app")
36863
+ ];
36864
+ for (const dir of candidates) {
36865
+ if (fs.existsSync(dir)) return dir;
36866
+ }
36867
+ return null;
36868
+ }
37248
36869
 
37249
36870
  // src/cli/index.ts
37250
36871
  dotenv.config({ path: ".env.local" });
@@ -37263,6 +36884,7 @@ program2.command("sync").description("Sync local content to Portal (pages, blog,
37263
36884
  program2.command("api-routes").description("Generate _uptrade API proxy routes").option("--dry-run", "Show changes without applying").option("--force", "Overwrite existing routes").action(apiRoutesCommand);
37264
36885
  program2.command("install").description("Install @uptrade/site-kit in current project").option("-D, --dev", "Install as dev dependency").option("--dry-run", "Show command without running").action(installCommand);
37265
36886
  program2.command("upgrade").description("Upgrade @uptrade/site-kit to latest version").option("-v, --version <version>", "Target version (default: latest)").option("--dry-run", "Show command without running").action(upgradeCommand);
36887
+ program2.command("scaffold").description("Scaffold sitemap, robots, llms routes (default stack)").option("--dry-run", "Show what would be created").option("-f, --force", "Overwrite existing files").action(scaffoldCommand);
37266
36888
  if (process.argv.length === 2) {
37267
36889
  process.argv.push("init");
37268
36890
  }