rollipop 0.1.0-alpha.12 → 0.1.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/commands.cjs CHANGED
@@ -1,11 +1,10 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
8
  var __copyProps = (to, from, except, desc) => {
10
9
  if (from && typeof from === "object" || typeof from === "function") {
11
10
  for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
@@ -74,6 +73,8 @@ let _react_native_community_cli_server_api = require("@react-native-community/cl
74
73
  let _react_native_dev_middleware = require("@react-native/dev-middleware");
75
74
  let fastify = require("fastify");
76
75
  fastify = __toESM(fastify);
76
+ let mitt = require("mitt");
77
+ mitt = __toESM(mitt);
77
78
  let node_http = require("node:http");
78
79
  node_http = __toESM(node_http);
79
80
  let node_events = require("node:events");
@@ -88,6 +89,7 @@ let mime = require("mime");
88
89
  mime = __toESM(mime);
89
90
  let ajv = require("ajv");
90
91
  ajv = __toESM(ajv);
92
+ let _babel_code_frame = require("@babel/code-frame");
91
93
  let ws = require("ws");
92
94
  ws = __toESM(ws);
93
95
  let _svgr_core = require("@svgr/core");
@@ -131,9 +133,9 @@ function printLogo() {
131
133
  DESCRIPTIONS.forEach((description, index) => {
132
134
  const descriptionHalfLength = description.length / 2;
133
135
  const logoHalfWidth = maxLogoWidth / 2;
134
- const padding$1 = " ".repeat(PADDING - descriptionHalfLength + logoHalfWidth);
135
- if (index === 0) console.log(padding$1 + chalk.default.bold.hex(PRIMARY_COLOR)(description));
136
- else console.log(padding$1 + description);
136
+ const padding = " ".repeat(PADDING - descriptionHalfLength + logoHalfWidth);
137
+ if (index === 0) console.log(padding + chalk.default.bold.hex(PRIMARY_COLOR)(description));
138
+ else console.log(padding + description);
137
139
  });
138
140
  console.log("");
139
141
  }
@@ -168,7 +170,7 @@ const FALSY_VALUES = [
168
170
  ];
169
171
  function parseDebugKeys() {
170
172
  return Object.keys(process.env).filter((key) => /^debug_/i.test(key)).reduce((acc, key) => {
171
- const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, key$1) => key$1.toUpperCase());
173
+ const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, key) => key.toUpperCase());
172
174
  let value = process.env[key];
173
175
  const lowerCase = typeof value === "string" ? value.toLowerCase() : value.toString();
174
176
  if (TRUTHY_VALUES.includes(lowerCase)) value = true;
@@ -400,18 +402,18 @@ function setupInteractiveMode(options) {
400
402
  process.emit("SIGINT");
401
403
  process.exit(0);
402
404
  }
403
- const targetCommand = allCommands.find((command$2) => command$2.key === sequence && (command$2.shift ?? false) === shift);
405
+ const targetCommand = allCommands.find((command) => command.key === sequence && (command.shift ?? false) === shift);
404
406
  if (targetCommand) targetCommand.handler.call({
405
407
  server: devServer,
406
408
  logger: logger$2
407
409
  });
408
410
  });
409
411
  console.log();
410
- allCommands.forEach((command$2, index) => {
412
+ allCommands.forEach((command, index) => {
411
413
  if (defaultCommands.length === index) console.log();
412
- const leadingLabel = command$2.shift ? "»" : "» Press";
413
- const shortcut = chalk.default.bold(shortcutLabel(command$2.key, command$2.shift));
414
- console.log(`${leadingLabel} ${shortcut} │ ${typeof command$2.description === "function" ? command$2.description() : command$2.description}`);
414
+ const leadingLabel = command.shift ? "»" : "» Press";
415
+ const shortcut = chalk.default.bold(shortcutLabel(command.key, command.shift));
416
+ console.log(`${leadingLabel} ${shortcut} │ ${typeof command.description === "function" ? command.description() : command.description}`);
415
417
  });
416
418
  }
417
419
  function getDefaultCommands(devServer, debuggerOpener) {
@@ -460,10 +462,10 @@ function shortcutLabel(key, shift) {
460
462
  if (shift) return `shift+${key}`;
461
463
  return key;
462
464
  }
463
- function assertHasNoDuplicateCommands(defaultCommands, commands$1) {
465
+ function assertHasNoDuplicateCommands(defaultCommands, commands) {
464
466
  const defaultCommandKeys = defaultCommands.map(({ key, shift }) => shortcutLabel(key, shift));
465
- const duplicateKeys = commands$1.map(({ key, shift }) => shortcutLabel(key, shift)).filter((key) => defaultCommandKeys.includes(key));
466
- const invalidCommandKeys = commands$1.filter(({ key }) => key.length > 1).map(({ key, shift }) => shortcutLabel(key, shift));
467
+ const duplicateKeys = commands.map(({ key, shift }) => shortcutLabel(key, shift)).filter((key) => defaultCommandKeys.includes(key));
468
+ const invalidCommandKeys = commands.filter(({ key }) => key.length > 1).map(({ key, shift }) => shortcutLabel(key, shift));
467
469
  if (invalidCommandKeys.length > 0) throw new Error(`Invalid commands: ${invalidCommandKeys.join(", ")}`);
468
470
  if (duplicateKeys.length > 0) throw new Error(`Duplicate commands: ${duplicateKeys.join(", ")}`);
469
471
  }
@@ -508,10 +510,10 @@ function parseFlowSyntax(code) {
508
510
  babel: true
509
511
  });
510
512
  }
511
- function generateSourceFromAst(ast, id$3) {
513
+ function generateSourceFromAst(ast, id) {
512
514
  const generated = (0, _babel_generator.generate)(ast, {
513
515
  sourceMaps: true,
514
- sourceFileName: node_path.default.basename(id$3)
516
+ sourceFileName: node_path.default.basename(id)
515
517
  });
516
518
  return {
517
519
  code: generated.code,
@@ -648,13 +650,13 @@ function getPolyfillScriptPaths(reactNativePath) {
648
650
  const scriptPath = node_path.default.join(reactNativePath, "rn-get-polyfills");
649
651
  return require(scriptPath)();
650
652
  }
651
- function getGlobalVariables(dev$1, buildType) {
652
- const isDevServerMode = dev$1 && buildType === "serve";
653
+ function getGlobalVariables(dev, buildType) {
654
+ const isDevServerMode = dev && buildType === "serve";
653
655
  return [
654
656
  `var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow():Date.now();`,
655
- `var __DEV__=${dev$1};`,
657
+ `var __DEV__=${dev};`,
656
658
  `var ${GLOBAL_IDENTIFIER}=typeof globalThis!=='undefined'?globalThis:typeof global !== 'undefined'?global:typeof window!=='undefined'?window:this;`,
657
- `var process=globalThis.process||{};process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"${dev$1 ? "development" : "production"}";`,
659
+ `var process=globalThis.process||{};process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"${dev ? "development" : "production"}";`,
658
660
  isDevServerMode ? `var $RefreshReg$ = () => {};` : null,
659
661
  isDevServerMode ? `var $RefreshSig$ = () => (v) => v;` : null
660
662
  ].filter(es_toolkit.isNotNil);
@@ -940,25 +942,25 @@ var ClientLogReporter = class {
940
942
  }
941
943
  }
942
944
  };
943
- var ProgressFlags = /* @__PURE__ */ function(ProgressFlags$1) {
944
- ProgressFlags$1[ProgressFlags$1["NONE"] = 0] = "NONE";
945
- ProgressFlags$1[ProgressFlags$1["BUILD_IN_PROGRESS"] = 1] = "BUILD_IN_PROGRESS";
946
- ProgressFlags$1[ProgressFlags$1["FILE_CHANGED"] = 2] = "FILE_CHANGED";
947
- return ProgressFlags$1;
945
+ var ProgressFlags = /* @__PURE__ */ function(ProgressFlags) {
946
+ ProgressFlags[ProgressFlags["NONE"] = 0] = "NONE";
947
+ ProgressFlags[ProgressFlags["BUILD_IN_PROGRESS"] = 1] = "BUILD_IN_PROGRESS";
948
+ ProgressFlags[ProgressFlags["FILE_CHANGED"] = 2] = "FILE_CHANGED";
949
+ return ProgressFlags;
948
950
  }(ProgressFlags || {});
949
951
  var ProgressBarStatusReporter = class {
950
952
  renderManager = ProgressBarRenderManager.getInstance();
951
953
  progressBar;
952
954
  flags = ProgressFlags.NONE;
953
- constructor(id$3, label, initialTotalModules) {
954
- this.progressBar = this.renderManager.register(id$3, {
955
+ constructor(id, label, initialTotalModules) {
956
+ this.progressBar = this.renderManager.register(id, {
955
957
  label,
956
958
  total: initialTotalModules
957
959
  });
958
960
  }
959
- renderProgress(id$3, totalModules, transformedModules) {
961
+ renderProgress(id, totalModules, transformedModules) {
960
962
  if (totalModules != null) this.progressBar.setTotal(totalModules);
961
- this.progressBar.setCurrent(transformedModules).setModuleId(id$3);
963
+ this.progressBar.setCurrent(transformedModules).setModuleId(id);
962
964
  this.renderManager.render();
963
965
  }
964
966
  update(event) {
@@ -979,12 +981,12 @@ var ProgressBarStatusReporter = class {
979
981
  this.renderManager.release();
980
982
  break;
981
983
  case "transform":
982
- const { id: id$3, totalModules, transformedModules } = event;
984
+ const { id, totalModules, transformedModules } = event;
983
985
  if (this.flags & ProgressFlags.FILE_CHANGED) {
984
- logger$1.debug("Transformed changed file", { id: id$3 });
986
+ logger$1.debug("Transformed changed file", { id });
985
987
  return;
986
988
  }
987
- this.renderProgress(id$3, totalModules, transformedModules);
989
+ this.renderProgress(id, totalModules, transformedModules);
988
990
  break;
989
991
  case "watch_change":
990
992
  this.flags |= ProgressFlags.FILE_CHANGED;
@@ -1041,9 +1043,9 @@ function getDefaultConfig(projectRoot, mode) {
1041
1043
  },
1042
1044
  serializer: {
1043
1045
  prelude: [getInitializeCorePath(projectRoot)],
1044
- polyfills: getPolyfillScriptPaths(reactNativePath).map((path$14) => ({
1046
+ polyfills: getPolyfillScriptPaths(reactNativePath).map((path) => ({
1045
1047
  type: "iife",
1046
- code: generateSourceFromAst(stripFlowSyntax(node_fs.default.readFileSync(path$14, "utf-8")), path$14).code
1048
+ code: generateSourceFromAst(stripFlowSyntax(node_fs.default.readFileSync(path, "utf-8")), path).code
1047
1049
  }))
1048
1050
  },
1049
1051
  watcher: {
@@ -1059,12 +1061,12 @@ function getDefaultConfig(projectRoot, mode) {
1059
1061
  globalIdentifiers: DEFAULT_REACT_NATIVE_GLOBAL_IDENTIFIERS
1060
1062
  },
1061
1063
  devMode: { hmr: true },
1064
+ reporter: new ClientLogReporter(),
1062
1065
  terminal: { status: (() => {
1063
1066
  if (isDebugEnabled()) return "compat";
1064
1067
  if (process.stderr.isTTY) return "progress";
1065
1068
  return "compat";
1066
1069
  })() },
1067
- reporter: new ClientLogReporter(),
1068
1070
  envDir: projectRoot,
1069
1071
  envPrefix: DEFAULT_ENV_PREFIX
1070
1072
  };
@@ -1148,19 +1150,19 @@ async function flattenPluginOption(pluginOption) {
1148
1150
  }
1149
1151
  async function resolvePluginConfig(baseConfig, plugins) {
1150
1152
  let mergedConfig = (0, es_toolkit.omit)(baseConfig, ["plugins", "dangerously_overrideRolldownOptions"]);
1151
- for (const plugin$3 of plugins) {
1152
- const context = createPluginContext(plugin$3.name);
1153
- if (typeof plugin$3.config === "function") {
1154
- const config = await plugin$3.config.call(context, mergedConfig);
1153
+ for (const plugin of plugins) {
1154
+ const context = createPluginContext(plugin.name);
1155
+ if (typeof plugin.config === "function") {
1156
+ const config = await plugin.config.call(context, mergedConfig);
1155
1157
  if (config != null) mergedConfig = mergeConfig(mergedConfig, config);
1156
- } else if (typeof plugin$3.config === "object") mergedConfig = mergeConfig(mergedConfig, plugin$3.config);
1158
+ } else if (typeof plugin.config === "object") mergedConfig = mergeConfig(mergedConfig, plugin.config);
1157
1159
  }
1158
1160
  return mergedConfig;
1159
1161
  }
1160
1162
  async function invokeConfigResolved(config, plugins) {
1161
- await Promise.all(plugins.map((plugin$3) => {
1162
- const context = createPluginContext(plugin$3.name);
1163
- return plugin$3.configResolved?.call(context, config);
1163
+ await Promise.all(plugins.map((plugin) => {
1164
+ const context = createPluginContext(plugin.name);
1165
+ return plugin.configResolved?.call(context, config);
1164
1166
  }));
1165
1167
  }
1166
1168
 
@@ -1178,8 +1180,8 @@ var FileSystemCache = class FileSystemCache {
1178
1180
  force: true
1179
1181
  });
1180
1182
  }
1181
- constructor(projectRoot, id$3) {
1182
- this.cacheDirectory = node_path.default.join(FileSystemCache.getCacheDirectory(projectRoot), id$3);
1183
+ constructor(projectRoot, id) {
1184
+ this.cacheDirectory = node_path.default.join(FileSystemCache.getCacheDirectory(projectRoot), id);
1183
1185
  this.ensureCacheDirectory(this.cacheDirectory);
1184
1186
  logger$1.debug("cache directory:", this.cacheDirectory);
1185
1187
  }
@@ -1253,10 +1255,10 @@ function md5(data) {
1253
1255
  //#endregion
1254
1256
  //#region src/utils/serialize.ts
1255
1257
  function serialize(value) {
1256
- return JSON.stringify(value, (_, value$1) => {
1257
- if (typeof value$1 === "function") return value$1.toString();
1258
- if (value$1 instanceof RegExp) return value$1.toString();
1259
- return value$1;
1258
+ return JSON.stringify(value, (_, value) => {
1259
+ if (typeof value === "function") return value.toString();
1260
+ if (value instanceof RegExp) return value.toString();
1261
+ return value;
1260
1262
  });
1261
1263
  }
1262
1264
 
@@ -1280,7 +1282,7 @@ function filterTransformAffectedConfig(config) {
1280
1282
  serializer.prelude,
1281
1283
  reactNative.assetRegistryPath,
1282
1284
  devMode,
1283
- plugins.map((plugin$3, index) => `${plugin$3.name}#${index}`)
1285
+ plugins.map((plugin, index) => `${plugin.name}#${index}`)
1284
1286
  ];
1285
1287
  }
1286
1288
 
@@ -1312,8 +1314,8 @@ var FileStorage = class FileStorage {
1312
1314
 
1313
1315
  //#endregion
1314
1316
  //#region src/utils/string.ts
1315
- function indent(text, indent$1, space = " ") {
1316
- return text.replace(/^/gm, space.repeat(indent$1));
1317
+ function indent(text, indent, space = " ") {
1318
+ return text.replace(/^/gm, space.repeat(indent));
1317
1319
  }
1318
1320
 
1319
1321
  //#endregion
@@ -1324,13 +1326,13 @@ function asLiteral(value) {
1324
1326
  function asIdentifier(name) {
1325
1327
  return name;
1326
1328
  }
1327
- function nodeEnvironment(dev$1) {
1328
- return dev$1 ? "development" : "production";
1329
+ function nodeEnvironment(dev) {
1330
+ return dev ? "development" : "production";
1329
1331
  }
1330
- function iife(body, path$14 = "<unknown>") {
1332
+ function iife(body, path = "<unknown>") {
1331
1333
  const bodyPlaceholder = "__BODY__";
1332
1334
  return dedent.default`
1333
- // ${path$14}
1335
+ // ${path}
1334
1336
  (function (global) {
1335
1337
  ${bodyPlaceholder}
1336
1338
  })(${GLOBAL_IDENTIFIER});
@@ -1359,7 +1361,7 @@ function bindReporter(config, eventSource) {
1359
1361
  eventSource.emit("watchChange", event.id);
1360
1362
  break;
1361
1363
  }
1362
- originalReporter.update(event);
1364
+ originalReporter?.update(event);
1363
1365
  } };
1364
1366
  return config;
1365
1367
  }
@@ -1396,8 +1398,8 @@ function getBaseUrl(host, port, https) {
1396
1398
 
1397
1399
  //#endregion
1398
1400
  //#region src/utils/storage.ts
1399
- function getBuildTotalModules(storage, id$3) {
1400
- return storage.get().build[id$3]?.totalModules ?? 0;
1401
+ function getBuildTotalModules(storage, id) {
1402
+ return storage.get().build[id]?.totalModules ?? 0;
1401
1403
  }
1402
1404
 
1403
1405
  //#endregion
@@ -1429,30 +1431,6 @@ function loadEnv(options) {
1429
1431
  return env;
1430
1432
  }
1431
1433
 
1432
- //#endregion
1433
- //#region node_modules/mitt/dist/mitt.mjs
1434
- function mitt_default(n) {
1435
- return {
1436
- all: n = n || /* @__PURE__ */ new Map(),
1437
- on: function(t, e) {
1438
- var i = n.get(t);
1439
- i ? i.push(e) : n.set(t, [e]);
1440
- },
1441
- off: function(t, e) {
1442
- var i = n.get(t);
1443
- i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
1444
- },
1445
- emit: function(t, e) {
1446
- var i = n.get(t);
1447
- i && i.slice().map(function(n$1) {
1448
- n$1(e);
1449
- }), (i = n.get("*")) && i.slice().map(function(n$1) {
1450
- n$1(t, e);
1451
- });
1452
- }
1453
- };
1454
- }
1455
-
1456
1434
  //#endregion
1457
1435
  //#region src/server/logger.ts
1458
1436
  const logger = new Logger("dev-server");
@@ -1502,12 +1480,12 @@ async function assertDevServerStatus(options) {
1502
1480
  }
1503
1481
  if (shouldExit) process.exit(1);
1504
1482
  }
1505
- var DevServerStatus = /* @__PURE__ */ function(DevServerStatus$1) {
1506
- DevServerStatus$1[DevServerStatus$1["NOT_RUNNING"] = 0] = "NOT_RUNNING";
1507
- DevServerStatus$1[DevServerStatus$1["MATCHED_SERVER_RUNNING"] = 1] = "MATCHED_SERVER_RUNNING";
1508
- DevServerStatus$1[DevServerStatus$1["PORT_TAKEN"] = 2] = "PORT_TAKEN";
1509
- DevServerStatus$1[DevServerStatus$1["UNKNOWN"] = 3] = "UNKNOWN";
1510
- return DevServerStatus$1;
1483
+ var DevServerStatus = /* @__PURE__ */ function(DevServerStatus) {
1484
+ DevServerStatus[DevServerStatus["NOT_RUNNING"] = 0] = "NOT_RUNNING";
1485
+ DevServerStatus[DevServerStatus["MATCHED_SERVER_RUNNING"] = 1] = "MATCHED_SERVER_RUNNING";
1486
+ DevServerStatus[DevServerStatus["PORT_TAKEN"] = 2] = "PORT_TAKEN";
1487
+ DevServerStatus[DevServerStatus["UNKNOWN"] = 3] = "UNKNOWN";
1488
+ return DevServerStatus;
1511
1489
  }(DevServerStatus || {});
1512
1490
  async function getDevServerStatus(devServerUrl, projectRoot) {
1513
1491
  const { hostname, port } = new URL(devServerUrl);
@@ -1638,9 +1616,9 @@ var BundlerDevEngine = class extends node_events.default {
1638
1616
  }
1639
1617
  get sourceMappingURL() {
1640
1618
  const { host, port } = this.options.server;
1641
- const { platform, dev: dev$1 } = this.buildOptions;
1619
+ const { platform, dev } = this.buildOptions;
1642
1620
  const [name] = this.config.entry.split(".");
1643
- return `http://${host}:${port}/${name}.bundle.map?platform=${platform}&dev=${dev$1}`;
1621
+ return `http://${host}:${port}/${name}.bundle.map?platform=${platform}&dev=${dev}`;
1644
1622
  }
1645
1623
  async initialize() {
1646
1624
  if (this._state !== "idle" || this._devEngine != null) return this;
@@ -1721,10 +1699,10 @@ var BundlerPool = class BundlerPool {
1721
1699
  bundleName,
1722
1700
  key
1723
1701
  });
1724
- const instance$1 = new BundlerDevEngine({ server: this.resolvedServerOptions }, this.config, buildOptions);
1702
+ const instance = new BundlerDevEngine({ server: this.resolvedServerOptions }, this.config, buildOptions);
1725
1703
  logger.debug("Setting new bundler instance", { key });
1726
- BundlerPool.instances.set(key, instance$1);
1727
- return instance$1;
1704
+ BundlerPool.instances.set(key, instance);
1705
+ return instance;
1728
1706
  }
1729
1707
  }
1730
1708
  };
@@ -1765,18 +1743,18 @@ const queryParamSchema = (0, json_schema_to_ts.asConst)({
1765
1743
  },
1766
1744
  required: ["platform"]
1767
1745
  });
1768
- const plugin$2 = (0, fastify_plugin.default)((fastify$1, options) => {
1746
+ const plugin$2 = (0, fastify_plugin.default)((fastify, options) => {
1769
1747
  const { projectRoot, host, port, https, preferNativePlatform } = options;
1770
1748
  const baseUrl = https ? `https://${host}:${port}` : `http://${host}:${port}`;
1771
1749
  function resolveAsset(asset) {
1772
1750
  return node_path.default.resolve(projectRoot, asset);
1773
1751
  }
1774
- fastify$1.get(`/${DEV_SERVER_ASSET_PATH}/*`, {
1752
+ fastify.get(`/${DEV_SERVER_ASSET_PATH}/*`, {
1775
1753
  schema: { querystring: queryParamSchema },
1776
1754
  async handler(request, reply) {
1777
- const { url: url$5, query } = request;
1778
- const { pathname } = new URL(url$5, baseUrl);
1779
- const assetPath = resolveAsset(pathname.replace(/* @__PURE__ */ new RegExp(`^/${DEV_SERVER_ASSET_PATH}/?`), ""));
1755
+ const { url, query } = request;
1756
+ const { pathname } = new URL(url, baseUrl);
1757
+ const assetPath = resolveAsset(pathname.replace(new RegExp(`^/${DEV_SERVER_ASSET_PATH}/?`), ""));
1780
1758
  let handle = null;
1781
1759
  try {
1782
1760
  handle = await node_fs.default.promises.open(resolveAssetPath(assetPath, {
@@ -1787,7 +1765,7 @@ const plugin$2 = (0, fastify_plugin.default)((fastify$1, options) => {
1787
1765
  const { size } = await handle.stat();
1788
1766
  await reply.header("Content-Type", mime.default.getType(assetPath) ?? "").header("Content-Length", size).send(assetData);
1789
1767
  } catch (error) {
1790
- fastify$1.log.error(error, "Failed to serve asset (scale assets resolving is not implemented yet)");
1768
+ fastify.log.error(error, "Failed to serve asset (scale assets resolving is not implemented yet)");
1791
1769
  await reply.status(500).send();
1792
1770
  } finally {
1793
1771
  await handle?.close();
@@ -1914,7 +1892,7 @@ function withGetBundleErrorHandler(reply, task) {
1914
1892
  return reply.status(500).send(error instanceof Error ? error.message : "Internal Server Error");
1915
1893
  });
1916
1894
  }
1917
- const plugin$1 = (0, fastify_plugin.default)((fastify$1, options) => {
1895
+ const plugin$1 = (0, fastify_plugin.default)((fastify, options) => {
1918
1896
  const { getBundler } = options;
1919
1897
  const getBundleOptions = (buildOptions) => {
1920
1898
  return {
@@ -1924,7 +1902,7 @@ const plugin$1 = (0, fastify_plugin.default)((fastify$1, options) => {
1924
1902
  sourcemap: buildOptions.inlineSourceMap ? "inline" : true
1925
1903
  };
1926
1904
  };
1927
- fastify$1.get("/:name.bundle", {
1905
+ fastify.get("/:name.bundle", {
1928
1906
  schema: {
1929
1907
  params: routeParamSchema,
1930
1908
  querystring: bundleRequestSchema
@@ -1951,7 +1929,7 @@ const plugin$1 = (0, fastify_plugin.default)((fastify$1, options) => {
1951
1929
  }
1952
1930
  }
1953
1931
  });
1954
- fastify$1.get("/:name.map", {
1932
+ fastify.get("/:name.map", {
1955
1933
  schema: {
1956
1934
  params: routeParamSchema,
1957
1935
  querystring: bundleRequestSchema
@@ -1971,1394 +1949,30 @@ const plugin$1 = (0, fastify_plugin.default)((fastify$1, options) => {
1971
1949
  }, { name: "serve-bundle" });
1972
1950
 
1973
1951
  //#endregion
1974
- //#region node_modules/picocolors/picocolors.js
1975
- var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1976
- let p = process || {}, argv = p.argv || [], env = p.env || {};
1977
- let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
1978
- let formatter = (open, close, replace = open) => (input) => {
1979
- let string = "" + input, index = string.indexOf(close, open.length);
1980
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
1981
- };
1982
- let replaceClose = (string, close, replace, index) => {
1983
- let result = "", cursor = 0;
1984
- do {
1985
- result += string.substring(cursor, index) + replace;
1986
- cursor = index + close.length;
1987
- index = string.indexOf(close, cursor);
1988
- } while (~index);
1989
- return result + string.substring(cursor);
1990
- };
1991
- let createColors = (enabled = isColorSupported) => {
1992
- let f = enabled ? formatter : () => String;
1952
+ //#region src/utils/url.ts
1953
+ function parseUrl(value) {
1954
+ if (value.startsWith("/")) {
1955
+ const [pathname, query] = value.split("?");
1993
1956
  return {
1994
- isColorSupported: enabled,
1995
- reset: f("\x1B[0m", "\x1B[0m"),
1996
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
1997
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
1998
- italic: f("\x1B[3m", "\x1B[23m"),
1999
- underline: f("\x1B[4m", "\x1B[24m"),
2000
- inverse: f("\x1B[7m", "\x1B[27m"),
2001
- hidden: f("\x1B[8m", "\x1B[28m"),
2002
- strikethrough: f("\x1B[9m", "\x1B[29m"),
2003
- black: f("\x1B[30m", "\x1B[39m"),
2004
- red: f("\x1B[31m", "\x1B[39m"),
2005
- green: f("\x1B[32m", "\x1B[39m"),
2006
- yellow: f("\x1B[33m", "\x1B[39m"),
2007
- blue: f("\x1B[34m", "\x1B[39m"),
2008
- magenta: f("\x1B[35m", "\x1B[39m"),
2009
- cyan: f("\x1B[36m", "\x1B[39m"),
2010
- white: f("\x1B[37m", "\x1B[39m"),
2011
- gray: f("\x1B[90m", "\x1B[39m"),
2012
- bgBlack: f("\x1B[40m", "\x1B[49m"),
2013
- bgRed: f("\x1B[41m", "\x1B[49m"),
2014
- bgGreen: f("\x1B[42m", "\x1B[49m"),
2015
- bgYellow: f("\x1B[43m", "\x1B[49m"),
2016
- bgBlue: f("\x1B[44m", "\x1B[49m"),
2017
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
2018
- bgCyan: f("\x1B[46m", "\x1B[49m"),
2019
- bgWhite: f("\x1B[47m", "\x1B[49m"),
2020
- blackBright: f("\x1B[90m", "\x1B[39m"),
2021
- redBright: f("\x1B[91m", "\x1B[39m"),
2022
- greenBright: f("\x1B[92m", "\x1B[39m"),
2023
- yellowBright: f("\x1B[93m", "\x1B[39m"),
2024
- blueBright: f("\x1B[94m", "\x1B[39m"),
2025
- magentaBright: f("\x1B[95m", "\x1B[39m"),
2026
- cyanBright: f("\x1B[96m", "\x1B[39m"),
2027
- whiteBright: f("\x1B[97m", "\x1B[39m"),
2028
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
2029
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
2030
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
2031
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
2032
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
2033
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
2034
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
2035
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
1957
+ pathname,
1958
+ query: query ? toQueryObject(new URLSearchParams(query)) : {}
2036
1959
  };
2037
- };
2038
- module.exports = createColors();
2039
- module.exports.createColors = createColors;
2040
- }));
2041
-
2042
- //#endregion
2043
- //#region node_modules/js-tokens/index.js
2044
- var require_js_tokens = /* @__PURE__ */ __commonJSMin(((exports) => {
2045
- Object.defineProperty(exports, "__esModule", { value: true });
2046
- exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
2047
- exports.matchToToken = function(match) {
2048
- var token = {
2049
- type: "invalid",
2050
- value: match[0],
2051
- closed: void 0
2052
- };
2053
- if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);
2054
- else if (match[5]) token.type = "comment";
2055
- else if (match[6]) token.type = "comment", token.closed = !!match[7];
2056
- else if (match[8]) token.type = "regex";
2057
- else if (match[9]) token.type = "number";
2058
- else if (match[10]) token.type = "name";
2059
- else if (match[11]) token.type = "punctuator";
2060
- else if (match[12]) token.type = "whitespace";
2061
- return token;
2062
- };
2063
- }));
2064
-
2065
- //#endregion
2066
- //#region node_modules/@babel/helper-validator-identifier/lib/identifier.js
2067
- var require_identifier = /* @__PURE__ */ __commonJSMin(((exports) => {
2068
- Object.defineProperty(exports, "__esModule", { value: true });
2069
- exports.isIdentifierChar = isIdentifierChar;
2070
- exports.isIdentifierName = isIdentifierName;
2071
- exports.isIdentifierStart = isIdentifierStart;
2072
- let nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
2073
- let nonASCIIidentifierChars = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
2074
- const nonASCIIidentifierStart = /* @__PURE__ */ new RegExp("[" + nonASCIIidentifierStartChars + "]");
2075
- const nonASCIIidentifier = /* @__PURE__ */ new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
2076
- nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
2077
- const astralIdentifierStartCodes = [
2078
- 0,
2079
- 11,
2080
- 2,
2081
- 25,
2082
- 2,
2083
- 18,
2084
- 2,
2085
- 1,
2086
- 2,
2087
- 14,
2088
- 3,
2089
- 13,
2090
- 35,
2091
- 122,
2092
- 70,
2093
- 52,
2094
- 268,
2095
- 28,
2096
- 4,
2097
- 48,
2098
- 48,
2099
- 31,
2100
- 14,
2101
- 29,
2102
- 6,
2103
- 37,
2104
- 11,
2105
- 29,
2106
- 3,
2107
- 35,
2108
- 5,
2109
- 7,
2110
- 2,
2111
- 4,
2112
- 43,
2113
- 157,
2114
- 19,
2115
- 35,
2116
- 5,
2117
- 35,
2118
- 5,
2119
- 39,
2120
- 9,
2121
- 51,
2122
- 13,
2123
- 10,
2124
- 2,
2125
- 14,
2126
- 2,
2127
- 6,
2128
- 2,
2129
- 1,
2130
- 2,
2131
- 10,
2132
- 2,
2133
- 14,
2134
- 2,
2135
- 6,
2136
- 2,
2137
- 1,
2138
- 4,
2139
- 51,
2140
- 13,
2141
- 310,
2142
- 10,
2143
- 21,
2144
- 11,
2145
- 7,
2146
- 25,
2147
- 5,
2148
- 2,
2149
- 41,
2150
- 2,
2151
- 8,
2152
- 70,
2153
- 5,
2154
- 3,
2155
- 0,
2156
- 2,
2157
- 43,
2158
- 2,
2159
- 1,
2160
- 4,
2161
- 0,
2162
- 3,
2163
- 22,
2164
- 11,
2165
- 22,
2166
- 10,
2167
- 30,
2168
- 66,
2169
- 18,
2170
- 2,
2171
- 1,
2172
- 11,
2173
- 21,
2174
- 11,
2175
- 25,
2176
- 7,
2177
- 25,
2178
- 39,
2179
- 55,
2180
- 7,
2181
- 1,
2182
- 65,
2183
- 0,
2184
- 16,
2185
- 3,
2186
- 2,
2187
- 2,
2188
- 2,
2189
- 28,
2190
- 43,
2191
- 28,
2192
- 4,
2193
- 28,
2194
- 36,
2195
- 7,
2196
- 2,
2197
- 27,
2198
- 28,
2199
- 53,
2200
- 11,
2201
- 21,
2202
- 11,
2203
- 18,
2204
- 14,
2205
- 17,
2206
- 111,
2207
- 72,
2208
- 56,
2209
- 50,
2210
- 14,
2211
- 50,
2212
- 14,
2213
- 35,
2214
- 39,
2215
- 27,
2216
- 10,
2217
- 22,
2218
- 251,
2219
- 41,
2220
- 7,
2221
- 1,
2222
- 17,
2223
- 5,
2224
- 57,
2225
- 28,
2226
- 11,
2227
- 0,
2228
- 9,
2229
- 21,
2230
- 43,
2231
- 17,
2232
- 47,
2233
- 20,
2234
- 28,
2235
- 22,
2236
- 13,
2237
- 52,
2238
- 58,
2239
- 1,
2240
- 3,
2241
- 0,
2242
- 14,
2243
- 44,
2244
- 33,
2245
- 24,
2246
- 27,
2247
- 35,
2248
- 30,
2249
- 0,
2250
- 3,
2251
- 0,
2252
- 9,
2253
- 34,
2254
- 4,
2255
- 0,
2256
- 13,
2257
- 47,
2258
- 15,
2259
- 3,
2260
- 22,
2261
- 0,
2262
- 2,
2263
- 0,
2264
- 36,
2265
- 17,
2266
- 2,
2267
- 24,
2268
- 20,
2269
- 1,
2270
- 64,
2271
- 6,
2272
- 2,
2273
- 0,
2274
- 2,
2275
- 3,
2276
- 2,
2277
- 14,
2278
- 2,
2279
- 9,
2280
- 8,
2281
- 46,
2282
- 39,
2283
- 7,
2284
- 3,
2285
- 1,
2286
- 3,
2287
- 21,
2288
- 2,
2289
- 6,
2290
- 2,
2291
- 1,
2292
- 2,
2293
- 4,
2294
- 4,
2295
- 0,
2296
- 19,
2297
- 0,
2298
- 13,
2299
- 4,
2300
- 31,
2301
- 9,
2302
- 2,
2303
- 0,
2304
- 3,
2305
- 0,
2306
- 2,
2307
- 37,
2308
- 2,
2309
- 0,
2310
- 26,
2311
- 0,
2312
- 2,
2313
- 0,
2314
- 45,
2315
- 52,
2316
- 19,
2317
- 3,
2318
- 21,
2319
- 2,
2320
- 31,
2321
- 47,
2322
- 21,
2323
- 1,
2324
- 2,
2325
- 0,
2326
- 185,
2327
- 46,
2328
- 42,
2329
- 3,
2330
- 37,
2331
- 47,
2332
- 21,
2333
- 0,
2334
- 60,
2335
- 42,
2336
- 14,
2337
- 0,
2338
- 72,
2339
- 26,
2340
- 38,
2341
- 6,
2342
- 186,
2343
- 43,
2344
- 117,
2345
- 63,
2346
- 32,
2347
- 7,
2348
- 3,
2349
- 0,
2350
- 3,
2351
- 7,
2352
- 2,
2353
- 1,
2354
- 2,
2355
- 23,
2356
- 16,
2357
- 0,
2358
- 2,
2359
- 0,
2360
- 95,
2361
- 7,
2362
- 3,
2363
- 38,
2364
- 17,
2365
- 0,
2366
- 2,
2367
- 0,
2368
- 29,
2369
- 0,
2370
- 11,
2371
- 39,
2372
- 8,
2373
- 0,
2374
- 22,
2375
- 0,
2376
- 12,
2377
- 45,
2378
- 20,
2379
- 0,
2380
- 19,
2381
- 72,
2382
- 200,
2383
- 32,
2384
- 32,
2385
- 8,
2386
- 2,
2387
- 36,
2388
- 18,
2389
- 0,
2390
- 50,
2391
- 29,
2392
- 113,
2393
- 6,
2394
- 2,
2395
- 1,
2396
- 2,
2397
- 37,
2398
- 22,
2399
- 0,
2400
- 26,
2401
- 5,
2402
- 2,
2403
- 1,
2404
- 2,
2405
- 31,
2406
- 15,
2407
- 0,
2408
- 24,
2409
- 43,
2410
- 261,
2411
- 18,
2412
- 16,
2413
- 0,
2414
- 2,
2415
- 12,
2416
- 2,
2417
- 33,
2418
- 125,
2419
- 0,
2420
- 80,
2421
- 921,
2422
- 103,
2423
- 110,
2424
- 18,
2425
- 195,
2426
- 2637,
2427
- 96,
2428
- 16,
2429
- 1071,
2430
- 18,
2431
- 5,
2432
- 26,
2433
- 3994,
2434
- 6,
2435
- 582,
2436
- 6842,
2437
- 29,
2438
- 1763,
2439
- 568,
2440
- 8,
2441
- 30,
2442
- 18,
2443
- 78,
2444
- 18,
2445
- 29,
2446
- 19,
2447
- 47,
2448
- 17,
2449
- 3,
2450
- 32,
2451
- 20,
2452
- 6,
2453
- 18,
2454
- 433,
2455
- 44,
2456
- 212,
2457
- 63,
2458
- 33,
2459
- 24,
2460
- 3,
2461
- 24,
2462
- 45,
2463
- 74,
2464
- 6,
2465
- 0,
2466
- 67,
2467
- 12,
2468
- 65,
2469
- 1,
2470
- 2,
2471
- 0,
2472
- 15,
2473
- 4,
2474
- 10,
2475
- 7381,
2476
- 42,
2477
- 31,
2478
- 98,
2479
- 114,
2480
- 8702,
2481
- 3,
2482
- 2,
2483
- 6,
2484
- 2,
2485
- 1,
2486
- 2,
2487
- 290,
2488
- 16,
2489
- 0,
2490
- 30,
2491
- 2,
2492
- 3,
2493
- 0,
2494
- 15,
2495
- 3,
2496
- 9,
2497
- 395,
2498
- 2309,
2499
- 106,
2500
- 6,
2501
- 12,
2502
- 4,
2503
- 8,
2504
- 8,
2505
- 9,
2506
- 5991,
2507
- 84,
2508
- 2,
2509
- 70,
2510
- 2,
2511
- 1,
2512
- 3,
2513
- 0,
2514
- 3,
2515
- 1,
2516
- 3,
2517
- 3,
2518
- 2,
2519
- 11,
2520
- 2,
2521
- 0,
2522
- 2,
2523
- 6,
2524
- 2,
2525
- 64,
2526
- 2,
2527
- 3,
2528
- 3,
2529
- 7,
2530
- 2,
2531
- 6,
2532
- 2,
2533
- 27,
2534
- 2,
2535
- 3,
2536
- 2,
2537
- 4,
2538
- 2,
2539
- 0,
2540
- 4,
2541
- 6,
2542
- 2,
2543
- 339,
2544
- 3,
2545
- 24,
2546
- 2,
2547
- 24,
2548
- 2,
2549
- 30,
2550
- 2,
2551
- 24,
2552
- 2,
2553
- 30,
2554
- 2,
2555
- 24,
2556
- 2,
2557
- 30,
2558
- 2,
2559
- 24,
2560
- 2,
2561
- 30,
2562
- 2,
2563
- 24,
2564
- 2,
2565
- 7,
2566
- 1845,
2567
- 30,
2568
- 7,
2569
- 5,
2570
- 262,
2571
- 61,
2572
- 147,
2573
- 44,
2574
- 11,
2575
- 6,
2576
- 17,
2577
- 0,
2578
- 322,
2579
- 29,
2580
- 19,
2581
- 43,
2582
- 485,
2583
- 27,
2584
- 229,
2585
- 29,
2586
- 3,
2587
- 0,
2588
- 208,
2589
- 30,
2590
- 2,
2591
- 2,
2592
- 2,
2593
- 1,
2594
- 2,
2595
- 6,
2596
- 3,
2597
- 4,
2598
- 10,
2599
- 1,
2600
- 225,
2601
- 6,
2602
- 2,
2603
- 3,
2604
- 2,
2605
- 1,
2606
- 2,
2607
- 14,
2608
- 2,
2609
- 196,
2610
- 60,
2611
- 67,
2612
- 8,
2613
- 0,
2614
- 1205,
2615
- 3,
2616
- 2,
2617
- 26,
2618
- 2,
2619
- 1,
2620
- 2,
2621
- 0,
2622
- 3,
2623
- 0,
2624
- 2,
2625
- 9,
2626
- 2,
2627
- 3,
2628
- 2,
2629
- 0,
2630
- 2,
2631
- 0,
2632
- 7,
2633
- 0,
2634
- 5,
2635
- 0,
2636
- 2,
2637
- 0,
2638
- 2,
2639
- 0,
2640
- 2,
2641
- 2,
2642
- 2,
2643
- 1,
2644
- 2,
2645
- 0,
2646
- 3,
2647
- 0,
2648
- 2,
2649
- 0,
2650
- 2,
2651
- 0,
2652
- 2,
2653
- 0,
2654
- 2,
2655
- 0,
2656
- 2,
2657
- 1,
2658
- 2,
2659
- 0,
2660
- 3,
2661
- 3,
2662
- 2,
2663
- 6,
2664
- 2,
2665
- 3,
2666
- 2,
2667
- 3,
2668
- 2,
2669
- 0,
2670
- 2,
2671
- 9,
2672
- 2,
2673
- 16,
2674
- 6,
2675
- 2,
2676
- 2,
2677
- 4,
2678
- 2,
2679
- 16,
2680
- 4421,
2681
- 42719,
2682
- 33,
2683
- 4381,
2684
- 3,
2685
- 5773,
2686
- 3,
2687
- 7472,
2688
- 16,
2689
- 621,
2690
- 2467,
2691
- 541,
2692
- 1507,
2693
- 4938,
2694
- 6,
2695
- 8489
2696
- ];
2697
- const astralIdentifierCodes = [
2698
- 509,
2699
- 0,
2700
- 227,
2701
- 0,
2702
- 150,
2703
- 4,
2704
- 294,
2705
- 9,
2706
- 1368,
2707
- 2,
2708
- 2,
2709
- 1,
2710
- 6,
2711
- 3,
2712
- 41,
2713
- 2,
2714
- 5,
2715
- 0,
2716
- 166,
2717
- 1,
2718
- 574,
2719
- 3,
2720
- 9,
2721
- 9,
2722
- 7,
2723
- 9,
2724
- 32,
2725
- 4,
2726
- 318,
2727
- 1,
2728
- 78,
2729
- 5,
2730
- 71,
2731
- 10,
2732
- 50,
2733
- 3,
2734
- 123,
2735
- 2,
2736
- 54,
2737
- 14,
2738
- 32,
2739
- 10,
2740
- 3,
2741
- 1,
2742
- 11,
2743
- 3,
2744
- 46,
2745
- 10,
2746
- 8,
2747
- 0,
2748
- 46,
2749
- 9,
2750
- 7,
2751
- 2,
2752
- 37,
2753
- 13,
2754
- 2,
2755
- 9,
2756
- 6,
2757
- 1,
2758
- 45,
2759
- 0,
2760
- 13,
2761
- 2,
2762
- 49,
2763
- 13,
2764
- 9,
2765
- 3,
2766
- 2,
2767
- 11,
2768
- 83,
2769
- 11,
2770
- 7,
2771
- 0,
2772
- 3,
2773
- 0,
2774
- 158,
2775
- 11,
2776
- 6,
2777
- 9,
2778
- 7,
2779
- 3,
2780
- 56,
2781
- 1,
2782
- 2,
2783
- 6,
2784
- 3,
2785
- 1,
2786
- 3,
2787
- 2,
2788
- 10,
2789
- 0,
2790
- 11,
2791
- 1,
2792
- 3,
2793
- 6,
2794
- 4,
2795
- 4,
2796
- 68,
2797
- 8,
2798
- 2,
2799
- 0,
2800
- 3,
2801
- 0,
2802
- 2,
2803
- 3,
2804
- 2,
2805
- 4,
2806
- 2,
2807
- 0,
2808
- 15,
2809
- 1,
2810
- 83,
2811
- 17,
2812
- 10,
2813
- 9,
2814
- 5,
2815
- 0,
2816
- 82,
2817
- 19,
2818
- 13,
2819
- 9,
2820
- 214,
2821
- 6,
2822
- 3,
2823
- 8,
2824
- 28,
2825
- 1,
2826
- 83,
2827
- 16,
2828
- 16,
2829
- 9,
2830
- 82,
2831
- 12,
2832
- 9,
2833
- 9,
2834
- 7,
2835
- 19,
2836
- 58,
2837
- 14,
2838
- 5,
2839
- 9,
2840
- 243,
2841
- 14,
2842
- 166,
2843
- 9,
2844
- 71,
2845
- 5,
2846
- 2,
2847
- 1,
2848
- 3,
2849
- 3,
2850
- 2,
2851
- 0,
2852
- 2,
2853
- 1,
2854
- 13,
2855
- 9,
2856
- 120,
2857
- 6,
2858
- 3,
2859
- 6,
2860
- 4,
2861
- 0,
2862
- 29,
2863
- 9,
2864
- 41,
2865
- 6,
2866
- 2,
2867
- 3,
2868
- 9,
2869
- 0,
2870
- 10,
2871
- 10,
2872
- 47,
2873
- 15,
2874
- 199,
2875
- 7,
2876
- 137,
2877
- 9,
2878
- 54,
2879
- 7,
2880
- 2,
2881
- 7,
2882
- 17,
2883
- 9,
2884
- 57,
2885
- 21,
2886
- 2,
2887
- 13,
2888
- 123,
2889
- 5,
2890
- 4,
2891
- 0,
2892
- 2,
2893
- 1,
2894
- 2,
2895
- 6,
2896
- 2,
2897
- 0,
2898
- 9,
2899
- 9,
2900
- 49,
2901
- 4,
2902
- 2,
2903
- 1,
2904
- 2,
2905
- 4,
2906
- 9,
2907
- 9,
2908
- 55,
2909
- 9,
2910
- 266,
2911
- 3,
2912
- 10,
2913
- 1,
2914
- 2,
2915
- 0,
2916
- 49,
2917
- 6,
2918
- 4,
2919
- 4,
2920
- 14,
2921
- 10,
2922
- 5350,
2923
- 0,
2924
- 7,
2925
- 14,
2926
- 11465,
2927
- 27,
2928
- 2343,
2929
- 9,
2930
- 87,
2931
- 9,
2932
- 39,
2933
- 4,
2934
- 60,
2935
- 6,
2936
- 26,
2937
- 9,
2938
- 535,
2939
- 9,
2940
- 470,
2941
- 0,
2942
- 2,
2943
- 54,
2944
- 8,
2945
- 3,
2946
- 82,
2947
- 0,
2948
- 12,
2949
- 1,
2950
- 19628,
2951
- 1,
2952
- 4178,
2953
- 9,
2954
- 519,
2955
- 45,
2956
- 3,
2957
- 22,
2958
- 543,
2959
- 4,
2960
- 4,
2961
- 5,
2962
- 9,
2963
- 7,
2964
- 3,
2965
- 6,
2966
- 31,
2967
- 3,
2968
- 149,
2969
- 2,
2970
- 1418,
2971
- 49,
2972
- 513,
2973
- 54,
2974
- 5,
2975
- 49,
2976
- 9,
2977
- 0,
2978
- 15,
2979
- 0,
2980
- 23,
2981
- 4,
2982
- 2,
2983
- 14,
2984
- 1361,
2985
- 6,
2986
- 2,
2987
- 16,
2988
- 3,
2989
- 6,
2990
- 2,
2991
- 1,
2992
- 2,
2993
- 4,
2994
- 101,
2995
- 0,
2996
- 161,
2997
- 6,
2998
- 10,
2999
- 9,
3000
- 357,
3001
- 0,
3002
- 62,
3003
- 13,
3004
- 499,
3005
- 13,
3006
- 245,
3007
- 1,
3008
- 2,
3009
- 9,
3010
- 233,
3011
- 0,
3012
- 3,
3013
- 0,
3014
- 8,
3015
- 1,
3016
- 6,
3017
- 0,
3018
- 475,
3019
- 6,
3020
- 110,
3021
- 6,
3022
- 6,
3023
- 9,
3024
- 4759,
3025
- 9,
3026
- 787719,
3027
- 239
3028
- ];
3029
- function isInAstralSet(code, set) {
3030
- let pos = 65536;
3031
- for (let i = 0, length = set.length; i < length; i += 2) {
3032
- pos += set[i];
3033
- if (pos > code) return false;
3034
- pos += set[i + 1];
3035
- if (pos >= code) return true;
3036
- }
3037
- return false;
3038
- }
3039
- function isIdentifierStart(code) {
3040
- if (code < 65) return code === 36;
3041
- if (code <= 90) return true;
3042
- if (code < 97) return code === 95;
3043
- if (code <= 122) return true;
3044
- if (code <= 65535) return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
3045
- return isInAstralSet(code, astralIdentifierStartCodes);
3046
- }
3047
- function isIdentifierChar(code) {
3048
- if (code < 48) return code === 36;
3049
- if (code < 58) return true;
3050
- if (code < 65) return false;
3051
- if (code <= 90) return true;
3052
- if (code < 97) return code === 95;
3053
- if (code <= 122) return true;
3054
- if (code <= 65535) return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
3055
- return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
3056
- }
3057
- function isIdentifierName(name) {
3058
- let isFirst = true;
3059
- for (let i = 0; i < name.length; i++) {
3060
- let cp = name.charCodeAt(i);
3061
- if ((cp & 64512) === 55296 && i + 1 < name.length) {
3062
- const trail = name.charCodeAt(++i);
3063
- if ((trail & 64512) === 56320) cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
3064
- }
3065
- if (isFirst) {
3066
- isFirst = false;
3067
- if (!isIdentifierStart(cp)) return false;
3068
- } else if (!isIdentifierChar(cp)) return false;
3069
- }
3070
- return !isFirst;
3071
1960
  }
3072
- }));
3073
-
3074
- //#endregion
3075
- //#region node_modules/@babel/helper-validator-identifier/lib/keyword.js
3076
- var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
3077
- Object.defineProperty(exports, "__esModule", { value: true });
3078
- exports.isKeyword = isKeyword;
3079
- exports.isReservedWord = isReservedWord;
3080
- exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
3081
- exports.isStrictBindReservedWord = isStrictBindReservedWord;
3082
- exports.isStrictReservedWord = isStrictReservedWord;
3083
- const reservedWords = {
3084
- keyword: [
3085
- "break",
3086
- "case",
3087
- "catch",
3088
- "continue",
3089
- "debugger",
3090
- "default",
3091
- "do",
3092
- "else",
3093
- "finally",
3094
- "for",
3095
- "function",
3096
- "if",
3097
- "return",
3098
- "switch",
3099
- "throw",
3100
- "try",
3101
- "var",
3102
- "const",
3103
- "while",
3104
- "with",
3105
- "new",
3106
- "this",
3107
- "super",
3108
- "class",
3109
- "extends",
3110
- "export",
3111
- "import",
3112
- "null",
3113
- "true",
3114
- "false",
3115
- "in",
3116
- "instanceof",
3117
- "typeof",
3118
- "void",
3119
- "delete"
3120
- ],
3121
- strict: [
3122
- "implements",
3123
- "interface",
3124
- "let",
3125
- "package",
3126
- "private",
3127
- "protected",
3128
- "public",
3129
- "static",
3130
- "yield"
3131
- ],
3132
- strictBind: ["eval", "arguments"]
1961
+ const url = new URL(value);
1962
+ return {
1963
+ pathname: url.pathname,
1964
+ query: toQueryObject(url.searchParams)
3133
1965
  };
3134
- const keywords = new Set(reservedWords.keyword);
3135
- const reservedWordsStrictSet = new Set(reservedWords.strict);
3136
- const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
3137
- function isReservedWord(word, inModule) {
3138
- return inModule && word === "await" || word === "enum";
3139
- }
3140
- function isStrictReservedWord(word, inModule) {
3141
- return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
3142
- }
3143
- function isStrictBindOnlyReservedWord(word) {
3144
- return reservedWordsStrictBindSet.has(word);
3145
- }
3146
- function isStrictBindReservedWord(word, inModule) {
3147
- return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
3148
- }
3149
- function isKeyword(word) {
3150
- return keywords.has(word);
3151
- }
3152
- }));
3153
-
3154
- //#endregion
3155
- //#region node_modules/@babel/helper-validator-identifier/lib/index.js
3156
- var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
3157
- Object.defineProperty(exports, "__esModule", { value: true });
3158
- Object.defineProperty(exports, "isIdentifierChar", {
3159
- enumerable: true,
3160
- get: function() {
3161
- return _identifier.isIdentifierChar;
3162
- }
3163
- });
3164
- Object.defineProperty(exports, "isIdentifierName", {
3165
- enumerable: true,
3166
- get: function() {
3167
- return _identifier.isIdentifierName;
3168
- }
3169
- });
3170
- Object.defineProperty(exports, "isIdentifierStart", {
3171
- enumerable: true,
3172
- get: function() {
3173
- return _identifier.isIdentifierStart;
3174
- }
3175
- });
3176
- Object.defineProperty(exports, "isKeyword", {
3177
- enumerable: true,
3178
- get: function() {
3179
- return _keyword.isKeyword;
3180
- }
3181
- });
3182
- Object.defineProperty(exports, "isReservedWord", {
3183
- enumerable: true,
3184
- get: function() {
3185
- return _keyword.isReservedWord;
3186
- }
3187
- });
3188
- Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
3189
- enumerable: true,
3190
- get: function() {
3191
- return _keyword.isStrictBindOnlyReservedWord;
3192
- }
3193
- });
3194
- Object.defineProperty(exports, "isStrictBindReservedWord", {
3195
- enumerable: true,
3196
- get: function() {
3197
- return _keyword.isStrictBindReservedWord;
3198
- }
3199
- });
3200
- Object.defineProperty(exports, "isStrictReservedWord", {
3201
- enumerable: true,
3202
- get: function() {
3203
- return _keyword.isStrictReservedWord;
3204
- }
3205
- });
3206
- var _identifier = require_identifier();
3207
- var _keyword = require_keyword();
3208
- }));
3209
-
3210
- //#endregion
3211
- //#region node_modules/@babel/code-frame/lib/index.js
3212
- var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
3213
- Object.defineProperty(exports, "__esModule", { value: true });
3214
- var picocolors = require_picocolors();
3215
- var jsTokens = require_js_tokens();
3216
- var helperValidatorIdentifier = require_lib$1();
3217
- function isColorSupported() {
3218
- return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
3219
- }
3220
- const compose = (f, g) => (v) => f(g(v));
3221
- function buildDefs(colors) {
3222
- return {
3223
- keyword: colors.cyan,
3224
- capitalized: colors.yellow,
3225
- jsxIdentifier: colors.yellow,
3226
- punctuator: colors.yellow,
3227
- number: colors.magenta,
3228
- string: colors.green,
3229
- regex: colors.magenta,
3230
- comment: colors.gray,
3231
- invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
3232
- gutter: colors.gray,
3233
- marker: compose(colors.red, colors.bold),
3234
- message: compose(colors.red, colors.bold),
3235
- reset: colors.reset
3236
- };
3237
- }
3238
- const defsOn = buildDefs(picocolors.createColors(true));
3239
- const defsOff = buildDefs(picocolors.createColors(false));
3240
- function getDefs(enabled) {
3241
- return enabled ? defsOn : defsOff;
3242
- }
3243
- const sometimesKeywords = new Set([
3244
- "as",
3245
- "async",
3246
- "from",
3247
- "get",
3248
- "of",
3249
- "set"
3250
- ]);
3251
- const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
3252
- const BRACKET = /^[()[\]{}]$/;
3253
- let tokenize;
3254
- {
3255
- const JSX_TAG = /^[a-z][\w-]*$/i;
3256
- const getTokenType = function(token, offset, text) {
3257
- if (token.type === "name") {
3258
- if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) return "keyword";
3259
- if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) return "jsxIdentifier";
3260
- if (token.value[0] !== token.value[0].toLowerCase()) return "capitalized";
3261
- }
3262
- if (token.type === "punctuator" && BRACKET.test(token.value)) return "bracket";
3263
- if (token.type === "invalid" && (token.value === "@" || token.value === "#")) return "punctuator";
3264
- return token.type;
3265
- };
3266
- tokenize = function* (text) {
3267
- let match;
3268
- while (match = jsTokens.default.exec(text)) {
3269
- const token = jsTokens.matchToToken(match);
3270
- yield {
3271
- type: getTokenType(token, match.index, text),
3272
- value: token.value
3273
- };
3274
- }
3275
- };
3276
- }
3277
- function highlight(text) {
3278
- if (text === "") return "";
3279
- const defs = getDefs(true);
3280
- let highlighted = "";
3281
- for (const { type, value } of tokenize(text)) if (type in defs) highlighted += value.split(NEWLINE$1).map((str) => defs[type](str)).join("\n");
3282
- else highlighted += value;
3283
- return highlighted;
3284
- }
3285
- const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
3286
- function getMarkerLines(loc, source, opts) {
3287
- const startLoc = Object.assign({
3288
- column: 0,
3289
- line: -1
3290
- }, loc.start);
3291
- const endLoc = Object.assign({}, startLoc, loc.end);
3292
- const { linesAbove = 2, linesBelow = 3 } = opts || {};
3293
- const startLine = startLoc.line;
3294
- const startColumn = startLoc.column;
3295
- const endLine = endLoc.line;
3296
- const endColumn = endLoc.column;
3297
- let start = Math.max(startLine - (linesAbove + 1), 0);
3298
- let end = Math.min(source.length, endLine + linesBelow);
3299
- if (startLine === -1) start = 0;
3300
- if (endLine === -1) end = source.length;
3301
- const lineDiff = endLine - startLine;
3302
- const markerLines = {};
3303
- if (lineDiff) for (let i = 0; i <= lineDiff; i++) {
3304
- const lineNumber = i + startLine;
3305
- if (!startColumn) markerLines[lineNumber] = true;
3306
- else if (i === 0) markerLines[lineNumber] = [startColumn, source[lineNumber - 1].length - startColumn + 1];
3307
- else if (i === lineDiff) markerLines[lineNumber] = [0, endColumn];
3308
- else markerLines[lineNumber] = [0, source[lineNumber - i].length];
3309
- }
3310
- else if (startColumn === endColumn) if (startColumn) markerLines[startLine] = [startColumn, 0];
3311
- else markerLines[startLine] = true;
3312
- else markerLines[startLine] = [startColumn, endColumn - startColumn];
3313
- return {
3314
- start,
3315
- end,
3316
- markerLines
3317
- };
3318
- }
3319
- function codeFrameColumns(rawLines, loc, opts = {}) {
3320
- const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
3321
- const defs = getDefs(shouldHighlight);
3322
- const { start, end, markerLines } = getMarkerLines(loc, rawLines.split(NEWLINE), opts);
3323
- const hasColumns = loc.start && typeof loc.start.column === "number";
3324
- const numberMaxWidth = String(end).length;
3325
- let frame = (shouldHighlight ? highlight(rawLines) : rawLines).split(NEWLINE, end).slice(start, end).map((line, index) => {
3326
- const number = start + 1 + index;
3327
- const gutter = ` ${` ${number}`.slice(-numberMaxWidth)} |`;
3328
- const hasMarker = markerLines[number];
3329
- const lastMarkerLine = !markerLines[number + 1];
3330
- if (hasMarker) {
3331
- let markerLine = "";
3332
- if (Array.isArray(hasMarker)) {
3333
- const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
3334
- const numberOfMarkers = hasMarker[1] || 1;
3335
- markerLine = [
3336
- "\n ",
3337
- defs.gutter(gutter.replace(/\d/g, " ")),
3338
- " ",
3339
- markerSpacing,
3340
- defs.marker("^").repeat(numberOfMarkers)
3341
- ].join("");
3342
- if (lastMarkerLine && opts.message) markerLine += " " + defs.message(opts.message);
3343
- }
3344
- return [
3345
- defs.marker(">"),
3346
- defs.gutter(gutter),
3347
- line.length > 0 ? ` ${line}` : "",
3348
- markerLine
3349
- ].join("");
3350
- } else return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
3351
- }).join("\n");
3352
- if (opts.message && !hasColumns) frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
3353
- if (shouldHighlight) return defs.reset(frame);
3354
- else return frame;
3355
- }
3356
- exports.codeFrameColumns = codeFrameColumns;
3357
- }));
1966
+ }
1967
+ function toQueryObject(searchParams) {
1968
+ return searchParams.entries().reduce((acc, [key, value]) => ({
1969
+ ...acc,
1970
+ [key]: value
1971
+ }), {});
1972
+ }
3358
1973
 
3359
1974
  //#endregion
3360
1975
  //#region src/server/symbolicate.ts
3361
- var import_lib = require_lib();
3362
1976
  /**
3363
1977
  * @see https://github.com/facebook/react-native/blob/0.83-stable/packages/metro-config/src/index.flow.js#L17
3364
1978
  */
@@ -3397,10 +2011,10 @@ function originalPositionFor(sourceMapConsumer, frame) {
3397
2011
  column: frame.column,
3398
2012
  line: frame.lineNumber
3399
2013
  });
3400
- return Object.entries(originalPosition).reduce((frame$1, [key, value]) => {
2014
+ return Object.entries(originalPosition).reduce((frame, [key, value]) => {
3401
2015
  const targetKey = convertFrameKey(key);
3402
2016
  return {
3403
- ...frame$1,
2017
+ ...frame,
3404
2018
  ...value ? { [targetKey]: value } : null
3405
2019
  };
3406
2020
  }, frame);
@@ -3421,17 +2035,17 @@ function convertFrameKey(key) {
3421
2035
  return key;
3422
2036
  }
3423
2037
  function getCodeFrame(sourceMapConsumer, frames, bundle) {
3424
- const frame = frames.find((frame$1) => {
3425
- return frame$1.lineNumber != null && frame$1.column != null && !isCollapsed(frame$1);
2038
+ const frame = frames.find((frame) => {
2039
+ return frame.lineNumber != null && frame.column != null && !isCollapsed(frame);
3426
2040
  });
3427
2041
  if (frame?.file == null || frame.column == null || frame.lineNumber == null) return null;
3428
2042
  try {
3429
2043
  const { lineNumber, column, file } = frame;
3430
2044
  const unresolved = file.startsWith("http");
3431
2045
  const source = unresolved ? bundle.code : sourceMapConsumer.sourceContentFor(frame.file);
3432
- const fileName = unresolved ? url.default.parse(file).pathname ?? "unknown" : file;
2046
+ const fileName = unresolved ? parseUrl(file).pathname ?? "unknown" : file;
3433
2047
  let content = "";
3434
- if (source) content = (0, import_lib.codeFrameColumns)(source, { start: {
2048
+ if (source) content = (0, _babel_code_frame.codeFrameColumns)(source, { start: {
3435
2049
  column,
3436
2050
  line: lineNumber
3437
2051
  } }, { highlightCode: true });
@@ -3461,15 +2075,15 @@ const bodySchema = (0, json_schema_to_ts.asConst)({
3461
2075
  },
3462
2076
  required: ["stack"]
3463
2077
  });
3464
- const plugin = (0, fastify_plugin.default)((fastify$1, options) => {
2078
+ const plugin = (0, fastify_plugin.default)((fastify, options) => {
3465
2079
  const { getBundler } = options;
3466
- fastify$1.post("/symbolicate", {
2080
+ fastify.post("/symbolicate", {
3467
2081
  schema: { body: bodySchema },
3468
2082
  async handler(request, reply) {
3469
2083
  const { stack } = request.body;
3470
2084
  const bundleUrl = stack.find((frame) => frame.file?.startsWith("http"));
3471
2085
  (0, es_toolkit.invariant)(bundleUrl?.file, "No bundle URL found in stack frames");
3472
- const { pathname, query } = url.default.parse(bundleUrl.file, true);
2086
+ const { pathname, query } = parseUrl(bundleUrl.file);
3473
2087
  (0, es_toolkit.invariant)(pathname, "No pathname found in bundle URL");
3474
2088
  (0, es_toolkit.invariant)(query.platform, "No platform found in query");
3475
2089
  (0, es_toolkit.invariant)(query.dev, "No dev found in query");
@@ -3538,11 +2152,11 @@ function getWebSocketUpgradeHandler(websocketEndpoints) {
3538
2152
  socket.destroy();
3539
2153
  return;
3540
2154
  }
3541
- const { pathname } = url.default.parse(request.url, true);
2155
+ const { pathname } = parseUrl(request.url);
3542
2156
  if (pathname != null && websocketEndpoints[pathname]) {
3543
2157
  const wss = websocketEndpoints[pathname];
3544
- wss.handleUpgrade(request, socket, head, (socket$1) => {
3545
- wss.emit("connection", socket$1, request);
2158
+ wss.handleUpgrade(request, socket, head, (socket) => {
2159
+ wss.emit("connection", socket, request);
3546
2160
  });
3547
2161
  } else socket.destroy();
3548
2162
  };
@@ -3671,8 +2285,8 @@ var HMRServer = class extends WebSocketServer {
3671
2285
  sendError(client, error) {
3672
2286
  try {
3673
2287
  this.send(client, JSON.stringify(error));
3674
- } catch (error$1) {
3675
- this.logger.error(`Failed to send HMR error message to client (clientId: ${client.id})`, error$1);
2288
+ } catch (error) {
2289
+ this.logger.error(`Failed to send HMR error message to client (clientId: ${client.id})`, error);
3676
2290
  }
3677
2291
  }
3678
2292
  cleanup(client) {
@@ -3703,12 +2317,12 @@ var HMRServer = class extends WebSocketServer {
3703
2317
  };
3704
2318
  this.logger.trace("HMR client message received", traceMessage);
3705
2319
  } catch (error) {
3706
- const message$1 = "Failed to parse HMR client message";
3707
- this.logger.error(message$1, error);
2320
+ const message = "Failed to parse HMR client message";
2321
+ this.logger.error(message, error);
3708
2322
  this.sendError(client, {
3709
2323
  type: "InternalError",
3710
2324
  errors: [{ description: error instanceof Error ? error.message : String(error) }],
3711
- message: message$1
2325
+ message
3712
2326
  });
3713
2327
  return;
3714
2328
  }
@@ -3769,7 +2383,7 @@ async function createDevServer(config, options) {
3769
2383
  projectRoot,
3770
2384
  port
3771
2385
  });
3772
- const emitter = mitt_default();
2386
+ const emitter = (0, mitt.default)();
3773
2387
  const fastify$1 = (0, fastify.default)({
3774
2388
  loggerInstance: new DevServerLogger(),
3775
2389
  disableRequestLogging: true
@@ -3805,7 +2419,7 @@ async function createDevServer(config, options) {
3805
2419
  bundlerPool,
3806
2420
  reportEvent: (event) => {
3807
2421
  reportEvent?.(event);
3808
- config.reporter.update(event);
2422
+ config.reporter?.update(event);
3809
2423
  }
3810
2424
  }).on("connection", (client) => emitter.emit("device.connected", { client })).on("message", (client, data) => emitter.emit("device.message", {
3811
2425
  client,
@@ -3855,9 +2469,9 @@ async function createDevServer(config, options) {
3855
2469
  }
3856
2470
  async function invokeConfigureServer(server, plugins) {
3857
2471
  const postConfigureServerHandlers = [];
3858
- for (const plugin$3 of plugins) {
3859
- const context = createPluginContext(plugin$3.name);
3860
- const result = await plugin$3.configureServer?.call(context, server);
2472
+ for (const plugin of plugins) {
2473
+ const context = createPluginContext(plugin.name);
2474
+ const result = await plugin.configureServer?.call(context, server);
3861
2475
  if (typeof result === "function") postConfigureServerHandlers.push(result);
3862
2476
  }
3863
2477
  return { invokePostConfigureServer: async () => {
@@ -3907,7 +2521,7 @@ async function resolveScaledAssets(options) {
3907
2521
  const files = node_fs.default.readdirSync(dirname);
3908
2522
  const stripedBasename = stripSuffix(assetPath, context);
3909
2523
  const suffixPattern = platformSuffixPattern(context);
3910
- const assetRegExp = /* @__PURE__ */ new RegExp(`${stripedBasename}(${SCALE_PATTERN})?(?:${suffixPattern})?${extension}$`);
2524
+ const assetRegExp = new RegExp(`${stripedBasename}(${SCALE_PATTERN})?(?:${suffixPattern})?${extension}$`);
3911
2525
  const scaledAssets = {};
3912
2526
  for (const file of files.sort((a, b) => getAssetPriority(b, context) - getAssetPriority(a, context))) {
3913
2527
  const match = assetRegExp.exec(file);
@@ -3952,13 +2566,13 @@ function stripSuffix(assetPath, context) {
3952
2566
  const basename = node_path.default.basename(assetPath);
3953
2567
  const extension = node_path.default.extname(assetPath);
3954
2568
  const suffixPattern = platformSuffixPattern(context);
3955
- return basename.replace(/* @__PURE__ */ new RegExp(`(${SCALE_PATTERN})?(?:${suffixPattern})?${extension}$`), "");
2569
+ return basename.replace(new RegExp(`(${SCALE_PATTERN})?(?:${suffixPattern})?${extension}$`), "");
3956
2570
  }
3957
2571
  function getAssetPriority(assetPath, context) {
3958
2572
  const suffixPattern = platformSuffixPattern(context);
3959
- if ((/* @__PURE__ */ new RegExp(`${SCALE_PATTERN}(?:${suffixPattern})`)).test(assetPath)) return 3;
3960
- else if ((/* @__PURE__ */ new RegExp(`(?:${suffixPattern})`)).test(assetPath)) return 2;
3961
- else if ((/* @__PURE__ */ new RegExp(`${SCALE_PATTERN}`)).test(assetPath)) return 1;
2573
+ if (new RegExp(`${SCALE_PATTERN}(?:${suffixPattern})`).test(assetPath)) return 3;
2574
+ else if (new RegExp(`(?:${suffixPattern})`).test(assetPath)) return 2;
2575
+ else if (new RegExp(`${SCALE_PATTERN}`).test(assetPath)) return 1;
3962
2576
  return 0;
3963
2577
  }
3964
2578
  function addSuffix(assetPath, context, options) {
@@ -4041,10 +2655,10 @@ async function copyAssetsToDestination(options) {
4041
2655
  return Promise.all(assets.map((asset) => {
4042
2656
  return Promise.all(asset.scales.map(async (scale) => {
4043
2657
  if (platform !== "android") {
4044
- const from$1 = resolveAssetPath(asset.id, context, scale);
4045
- const to$1 = node_path.default.join(assetsDir, getIosAssetDestinationPath(asset, scale));
4046
- mkdirWithAssertPath(to$1);
4047
- return node_fs.default.copyFileSync(from$1, to$1);
2658
+ const from = resolveAssetPath(asset.id, context, scale);
2659
+ const to = node_path.default.join(assetsDir, getIosAssetDestinationPath(asset, scale));
2660
+ mkdirWithAssertPath(to);
2661
+ return node_fs.default.copyFileSync(from, to);
4048
2662
  }
4049
2663
  const from = resolveAssetPath(asset.id, context, scale);
4050
2664
  const to = node_path.default.join(assetsDir, getAndroidAssetDestinationPath(asset, scale));
@@ -4091,15 +2705,15 @@ function generateAssetRegistryCode(assetRegistryPath, asset) {
4091
2705
  //#endregion
4092
2706
  //#region src/core/plugins/utils/transform-utils.ts
4093
2707
  const TRANSFORM_FLAGS_KEY = Symbol("transform-flags");
4094
- let TransformFlag = /* @__PURE__ */ function(TransformFlag$1) {
4095
- TransformFlag$1[TransformFlag$1["NONE"] = 0] = "NONE";
4096
- TransformFlag$1[TransformFlag$1["CODEGEN_REQUIRED"] = 1] = "CODEGEN_REQUIRED";
4097
- TransformFlag$1[TransformFlag$1["STRIP_FLOW_REQUIRED"] = 2] = "STRIP_FLOW_REQUIRED";
4098
- TransformFlag$1[TransformFlag$1["SKIP_ALL"] = 128] = "SKIP_ALL";
4099
- return TransformFlag$1;
2708
+ let TransformFlag = /* @__PURE__ */ function(TransformFlag) {
2709
+ TransformFlag[TransformFlag["NONE"] = 0] = "NONE";
2710
+ TransformFlag[TransformFlag["CODEGEN_REQUIRED"] = 1] = "CODEGEN_REQUIRED";
2711
+ TransformFlag[TransformFlag["STRIP_FLOW_REQUIRED"] = 2] = "STRIP_FLOW_REQUIRED";
2712
+ TransformFlag[TransformFlag["SKIP_ALL"] = 128] = "SKIP_ALL";
2713
+ return TransformFlag;
4100
2714
  }({});
4101
- function setFlag(context, id$3, flag, options) {
4102
- const moduleInfo = context.getModuleInfo(id$3);
2715
+ function setFlag(context, id, flag, options) {
2716
+ const moduleInfo = context.getModuleInfo(id);
4103
2717
  if (moduleInfo && hasFlag(moduleInfo.meta)) {
4104
2718
  if (options?.override) moduleInfo.meta[TRANSFORM_FLAGS_KEY] = flag;
4105
2719
  else moduleInfo.meta[TRANSFORM_FLAGS_KEY] |= flag;
@@ -4109,8 +2723,8 @@ function setFlag(context, id$3, flag, options) {
4109
2723
  function hasFlag(meta) {
4110
2724
  return TRANSFORM_FLAGS_KEY in meta;
4111
2725
  }
4112
- function getFlag(context, id$3) {
4113
- return getFlagFromModuleInfo(context.getModuleInfo(id$3));
2726
+ function getFlag(context, id) {
2727
+ return getFlagFromModuleInfo(context.getModuleInfo(id));
4114
2728
  }
4115
2729
  function getFlagFromModuleInfo(moduleInfo) {
4116
2730
  if (moduleInfo && hasFlag(moduleInfo.meta)) return moduleInfo.meta[TRANSFORM_FLAGS_KEY];
@@ -4123,18 +2737,18 @@ function withTransformBoundary(plugins, options) {
4123
2737
  name: "rollipop:transform-initializer",
4124
2738
  transform: {
4125
2739
  order: "pre",
4126
- handler(_code, id$3) {
4127
- if (context.state.hmrUpdates.has(id$3)) {
4128
- context.state.hmrUpdates.delete(id$3);
4129
- return { meta: setFlag(this, id$3, TransformFlag.NONE, { override: true }) };
2740
+ handler(_code, id) {
2741
+ if (context.state.hmrUpdates.has(id)) {
2742
+ context.state.hmrUpdates.delete(id);
2743
+ return { meta: setFlag(this, id, TransformFlag.NONE, { override: true }) };
4130
2744
  }
4131
2745
  }
4132
2746
  }
4133
2747
  },
4134
2748
  {
4135
2749
  name: "rollipop:transform-change-watcher",
4136
- watchChange(id$3) {
4137
- context.state.hmrUpdates.add(id$3);
2750
+ watchChange(id) {
2751
+ context.state.hmrUpdates.add(id);
4138
2752
  }
4139
2753
  },
4140
2754
  options?.beforeTransform,
@@ -4151,8 +2765,8 @@ function getPersistCachePlugins(options) {
4151
2765
  afterTransform: null
4152
2766
  };
4153
2767
  const { sourceExtensions, context } = options;
4154
- const includePattern = /* @__PURE__ */ new RegExp(`\\.(?:${sourceExtensions.join("|")})$`);
4155
- const filter = [(0, _rollipop_rolldown_pluginutils.exclude)((0, _rollipop_rolldown_pluginutils.id)(/@oxc-project\+runtime/)), (0, _rollipop_rolldown_pluginutils.include)((0, _rollipop_rolldown_pluginutils.id)(includePattern))];
2768
+ const includePattern = new RegExp(`\\.(?:${sourceExtensions.join("|")})$`);
2769
+ const filter = [(0, _rollipop_rolldown_pluginutils.exclude)((0, _rollipop_rolldown_pluginutils.or)((0, _rollipop_rolldown_pluginutils.id)(/rolldown\/runtime/), (0, _rollipop_rolldown_pluginutils.id)(/@oxc-project\+runtime/))), (0, _rollipop_rolldown_pluginutils.include)((0, _rollipop_rolldown_pluginutils.id)(includePattern))];
4156
2770
  let cacheHits = 0;
4157
2771
  return {
4158
2772
  beforeTransform: {
@@ -4166,15 +2780,15 @@ function getPersistCachePlugins(options) {
4166
2780
  transform: {
4167
2781
  order: "pre",
4168
2782
  filter,
4169
- handler(_code, id$3) {
4170
- const key = getCacheKey(id$3, context.id);
2783
+ handler(_code, id) {
2784
+ const key = getCacheKey(id, context.id);
4171
2785
  const cache = context.cache.get(key);
4172
2786
  if (cache != null) {
4173
2787
  cacheHits++;
4174
2788
  return {
4175
2789
  code: cache,
4176
2790
  moduleType: "tsx",
4177
- meta: setFlag(this, id$3, TransformFlag.SKIP_ALL)
2791
+ meta: setFlag(this, id, TransformFlag.SKIP_ALL)
4178
2792
  };
4179
2793
  }
4180
2794
  }
@@ -4185,9 +2799,9 @@ function getPersistCachePlugins(options) {
4185
2799
  transform: {
4186
2800
  order: "post",
4187
2801
  filter,
4188
- handler(code, id$3) {
4189
- if (getFlag(this, id$3) & TransformFlag.SKIP_ALL) return;
4190
- context.cache.set(getCacheKey(id$3, context.id), code);
2802
+ handler(code, id) {
2803
+ if (getFlag(this, id) & TransformFlag.SKIP_ALL) return;
2804
+ context.cache.set(getCacheKey(id, context.id), code);
4191
2805
  }
4192
2806
  },
4193
2807
  buildEnd() {
@@ -4196,60 +2810,60 @@ function getPersistCachePlugins(options) {
4196
2810
  }
4197
2811
  };
4198
2812
  }
4199
- function getCacheKey(id$3, buildHash) {
4200
- const { mtimeMs } = node_fs.default.statSync(id$3);
4201
- return xxhash(`${id$3}${buildHash}${mtimeMs}`);
2813
+ function getCacheKey(id, buildHash) {
2814
+ const { mtimeMs } = node_fs.default.statSync(id);
2815
+ return xxhash(`${id}${buildHash}${mtimeMs}`);
4202
2816
  }
4203
2817
  /**
4204
2818
  * Enhance a plugin to cache the result. (transform hook only)
4205
2819
  */
4206
- function cacheable(plugin$3) {
2820
+ function cacheable(plugin) {
4207
2821
  let configured = false;
4208
- const originalTransform = plugin$3.transform;
2822
+ const originalTransform = plugin.transform;
4209
2823
  if (typeof originalTransform === "function") {
4210
- plugin$3.transform = function(code, id$3, meta) {
4211
- if (getFlag(this, id$3) & TransformFlag.SKIP_ALL) return;
4212
- return originalTransform.call(this, code, id$3, meta);
2824
+ plugin.transform = function(code, id, meta) {
2825
+ if (getFlag(this, id) & TransformFlag.SKIP_ALL) return;
2826
+ return originalTransform.call(this, code, id, meta);
4213
2827
  };
4214
2828
  configured = true;
4215
2829
  }
4216
2830
  if (typeof originalTransform === "object") {
4217
- plugin$3.transform = {
2831
+ plugin.transform = {
4218
2832
  ...originalTransform,
4219
- handler(code, id$3, meta) {
4220
- if (getFlag(this, id$3) & TransformFlag.SKIP_ALL) return;
4221
- return originalTransform.handler.call(this, code, id$3, meta);
2833
+ handler(code, id, meta) {
2834
+ if (getFlag(this, id) & TransformFlag.SKIP_ALL) return;
2835
+ return originalTransform.handler.call(this, code, id, meta);
4222
2836
  }
4223
2837
  };
4224
2838
  configured = true;
4225
2839
  }
4226
- if (configured) plugin$3.name = `${plugin$3.name}:cacheable`;
4227
- else logger$1.warn(`Plugin '${plugin$3.name}' is could not be cached`);
4228
- return plugin$3;
2840
+ if (configured) plugin.name = `${plugin.name}:cacheable`;
2841
+ else logger$1.warn(`Plugin '${plugin.name}' is could not be cached`);
2842
+ return plugin;
4229
2843
  }
4230
2844
 
4231
2845
  //#endregion
4232
2846
  //#region src/core/plugins/utils/source.ts
4233
2847
  const TS_EXTENSION_REGEXP = /\.tsx?$/;
4234
- function isTS(id$3) {
4235
- return TS_EXTENSION_REGEXP.test(id$3);
2848
+ function isTS(id) {
2849
+ return TS_EXTENSION_REGEXP.test(id);
4236
2850
  }
4237
- function isJSX(id$3) {
4238
- return id$3.endsWith("x");
2851
+ function isJSX(id) {
2852
+ return id.endsWith("x");
4239
2853
  }
4240
2854
 
4241
2855
  //#endregion
4242
2856
  //#region src/core/plugins/react-native-plugin.ts
4243
2857
  function reactNativePlugin(config, options) {
4244
2858
  const { buildType, flowFilter, codegenFilter, assetsDir, assetExtensions, assetRegistryPath } = options;
4245
- const assetExtensionRegex = /* @__PURE__ */ new RegExp(`\\.(?:${assetExtensions.join("|")})$`);
2859
+ const assetExtensionRegex = new RegExp(`\\.(?:${assetExtensions.join("|")})$`);
4246
2860
  const codegenPlugin = {
4247
2861
  name: "rollipop:react-native-codegen-marker",
4248
2862
  transform: {
4249
2863
  order: "pre",
4250
2864
  filter: codegenFilter,
4251
- handler(_code, id$3) {
4252
- return { meta: setFlag(this, id$3, TransformFlag.CODEGEN_REQUIRED) };
2865
+ handler(_code, id) {
2866
+ return { meta: setFlag(this, id, TransformFlag.CODEGEN_REQUIRED) };
4253
2867
  }
4254
2868
  }
4255
2869
  };
@@ -4258,11 +2872,11 @@ function reactNativePlugin(config, options) {
4258
2872
  transform: {
4259
2873
  order: "pre",
4260
2874
  filter: flowFilter,
4261
- handler(code, id$3) {
4262
- const flags = getFlag(this, id$3);
2875
+ handler(code, id) {
2876
+ const flags = getFlag(this, id);
4263
2877
  if (flags & TransformFlag.SKIP_ALL) return;
4264
- if (flags & TransformFlag.CODEGEN_REQUIRED) return { meta: setFlag(this, id$3, TransformFlag.STRIP_FLOW_REQUIRED) };
4265
- const result = generateSourceFromAst(stripFlowSyntax(code), id$3);
2878
+ if (flags & TransformFlag.CODEGEN_REQUIRED) return { meta: setFlag(this, id, TransformFlag.STRIP_FLOW_REQUIRED) };
2879
+ const result = generateSourceFromAst(stripFlowSyntax(code), id);
4266
2880
  return {
4267
2881
  code: result.code,
4268
2882
  map: result.map,
@@ -4276,18 +2890,18 @@ function reactNativePlugin(config, options) {
4276
2890
  name: "rollipop:react-native-asset",
4277
2891
  load: {
4278
2892
  filter: [(0, _rollipop_rolldown_pluginutils.include)((0, _rollipop_rolldown_pluginutils.id)(assetExtensionRegex))],
4279
- async handler(id$3) {
4280
- this.debug(`Asset ${id$3} found`);
2893
+ async handler(id) {
2894
+ this.debug(`Asset ${id} found`);
4281
2895
  const assetData = await resolveScaledAssets({
4282
2896
  projectRoot: config.root,
4283
- assetPath: id$3,
2897
+ assetPath: id,
4284
2898
  platform: options.platform,
4285
2899
  preferNativePlatform: config.resolver.preferNativePlatform
4286
2900
  });
4287
2901
  assets.push(assetData);
4288
2902
  return {
4289
2903
  code: generateAssetRegistryCode(assetRegistryPath, assetData),
4290
- meta: setFlag(this, id$3, TransformFlag.SKIP_ALL),
2904
+ meta: setFlag(this, id, TransformFlag.SKIP_ALL),
4291
2905
  moduleType: "js"
4292
2906
  };
4293
2907
  }
@@ -4315,15 +2929,15 @@ function reactNativePlugin(config, options) {
4315
2929
  name: "rollipop:react-native-replace-hmr-client",
4316
2930
  resolveId: {
4317
2931
  filter: [(0, _rollipop_rolldown_pluginutils.include)((0, _rollipop_rolldown_pluginutils.id)(/\/HMRClient\.js$/))],
4318
- async handler(id$3, importer) {
4319
- const resolvedId = await this.resolve(id$3, importer, { skipSelf: true });
2932
+ async handler(id, importer) {
2933
+ const resolvedId = await this.resolve(id, importer, { skipSelf: true });
4320
2934
  if (resolvedId?.id === hmrClientPath) await this.load({ id: resolvedId.id });
4321
2935
  }
4322
2936
  },
4323
2937
  load: {
4324
2938
  filter: [(0, _rollipop_rolldown_pluginutils.include)((0, _rollipop_rolldown_pluginutils.id)((0, _rollipop_rolldown_pluginutils.exactRegex)(hmrClientPath)))],
4325
- handler(id$3) {
4326
- this.debug(`Replacing HMR client: ${id$3}`);
2939
+ handler(id) {
2940
+ this.debug(`Replacing HMR client: ${id}`);
4327
2941
  return hmrConfig?.clientImplement ?? defaultRuntimeImplements.clientImplement;
4328
2942
  }
4329
2943
  }
@@ -4344,17 +2958,17 @@ const DEFAULT_EXCLUDE_REGEX = /\/node_modules\//;
4344
2958
  const HAS_REFRESH_REGEX = /\$RefreshReg\$\(/;
4345
2959
  const ONLY_REACT_COMPONENT_REGEX = /extends\s+(?:React\.)?(?:Pure)?Component/;
4346
2960
  function reactRefreshPlugin(options) {
4347
- const { include: include$3 = DEFAULT_INCLUDE_REGEX, exclude: exclude$1 = DEFAULT_EXCLUDE_REGEX } = options ?? {};
2961
+ const { include = DEFAULT_INCLUDE_REGEX, exclude = DEFAULT_EXCLUDE_REGEX } = options ?? {};
4348
2962
  return [{
4349
2963
  name: "rollipop:transform-react-refresh",
4350
2964
  transform: {
4351
2965
  filter: { id: {
4352
- include: include$3,
4353
- exclude: exclude$1
2966
+ include,
2967
+ exclude
4354
2968
  } },
4355
- handler(code, id$3) {
4356
- if (getFlag(this, id$3) & TransformFlag.SKIP_ALL) return;
4357
- const result = (0, _rollipop_rolldown_experimental.transformSync)(id$3, code, {
2969
+ handler(code, id) {
2970
+ if (getFlag(this, id) & TransformFlag.SKIP_ALL) return;
2971
+ const result = (0, _rollipop_rolldown_experimental.transformSync)(id, code, {
4358
2972
  sourcemap: true,
4359
2973
  jsx: {
4360
2974
  runtime: "automatic",
@@ -4375,15 +2989,15 @@ function reactRefreshPlugin(options) {
4375
2989
  name: "rollipop:react-refresh-boundary",
4376
2990
  transform: {
4377
2991
  filter: { id: {
4378
- include: include$3,
4379
- exclude: exclude$1
2992
+ include,
2993
+ exclude
4380
2994
  } },
4381
- handler(code, id$3, meta) {
4382
- if (getFlag(this, id$3) & TransformFlag.SKIP_ALL) return;
2995
+ handler(code, id, meta) {
2996
+ if (getFlag(this, id) & TransformFlag.SKIP_ALL) return;
4383
2997
  const { magicString } = meta;
4384
2998
  (0, es_toolkit.invariant)(magicString != null, "magicString is not available");
4385
2999
  applyRefreshWrapper(magicString, {
4386
- id: id$3,
3000
+ id,
4387
3001
  hasRefresh: HAS_REFRESH_REGEX.test(code),
4388
3002
  onlyReactComponent: ONLY_REACT_COMPONENT_REGEX.test(code)
4389
3003
  });
@@ -4393,12 +3007,12 @@ function reactRefreshPlugin(options) {
4393
3007
  }];
4394
3008
  }
4395
3009
  function applyRefreshWrapper(s, options) {
4396
- const { id: id$3, hasRefresh, onlyReactComponent } = options;
3010
+ const { id, hasRefresh, onlyReactComponent } = options;
4397
3011
  if (!(hasRefresh || onlyReactComponent)) return;
4398
3012
  if (hasRefresh) s.prepend(`
4399
3013
  var __prev$RefreshReg$ = global.$RefreshReg$;
4400
3014
  var __prev$RefreshSig$ = global.$RefreshSig$;
4401
- global.$RefreshReg$ = function(type, id) { return __ReactRefresh.register(type, ${JSON.stringify(id$3)} + ' ' + id) }
3015
+ global.$RefreshReg$ = function(type, id) { return __ReactRefresh.register(type, ${JSON.stringify(id)} + ' ' + id) }
4402
3016
  global.$RefreshSig$ = function() { return __ReactRefresh.createSignatureFunctionForTransform(); }
4403
3017
  `);
4404
3018
  s.append(`
@@ -4435,12 +3049,12 @@ function preludePlugin(options) {
4435
3049
  meta: { [IS_ENTRY]: true }
4436
3050
  };
4437
3051
  } },
4438
- load: { handler(id$3) {
3052
+ load: { handler(id) {
4439
3053
  if (processed) return;
4440
- const moduleInfo = this.getModuleInfo(id$3);
3054
+ const moduleInfo = this.getModuleInfo(id);
4441
3055
  if (moduleInfo && isEntry(moduleInfo.meta)) {
4442
- this.debug(`Prelude plugin found entry ${id$3}`);
4443
- const modifiedSource = [preludeImportStatements, node_fs.default.readFileSync(id$3, "utf-8")].join("\n");
3056
+ this.debug(`Prelude plugin found entry ${id}`);
3057
+ const modifiedSource = [preludeImportStatements, node_fs.default.readFileSync(id, "utf-8")].join("\n");
4444
3058
  processed = true;
4445
3059
  return modifiedSource;
4446
3060
  }
@@ -4458,10 +3072,10 @@ function jsonPlugin() {
4458
3072
  name: "rollipop:json",
4459
3073
  load: {
4460
3074
  filter: [(0, _rollipop_rolldown_pluginutils.include)((0, _rollipop_rolldown_pluginutils.id)(/\.json$/))],
4461
- handler(id$3) {
3075
+ handler(id) {
4462
3076
  return {
4463
- code: `export = ${node_fs.default.readFileSync(id$3, "utf-8")};`,
4464
- meta: setFlag(this, id$3, TransformFlag.SKIP_ALL),
3077
+ code: `export = ${node_fs.default.readFileSync(id, "utf-8")};`,
3078
+ meta: setFlag(this, id, TransformFlag.SKIP_ALL),
4465
3079
  moduleType: "ts"
4466
3080
  };
4467
3081
  }
@@ -4477,13 +3091,13 @@ function svgPlugin(options) {
4477
3091
  name: "rollipop:svg",
4478
3092
  load: {
4479
3093
  filter: { id: /\.svg$/ },
4480
- async handler(id$3) {
3094
+ async handler(id) {
4481
3095
  return {
4482
- code: await (0, _svgr_core.transform)(node_fs.default.readFileSync(id$3, "utf-8"), {
3096
+ code: await (0, _svgr_core.transform)(node_fs.default.readFileSync(id, "utf-8"), {
4483
3097
  template: defaultTemplate,
4484
3098
  plugins: [require.resolve("@svgr/plugin-jsx")],
4485
3099
  native: true
4486
- }, { filePath: id$3 }),
3100
+ }, { filePath: id }),
4487
3101
  moduleType: "jsx"
4488
3102
  };
4489
3103
  }
@@ -4506,7 +3120,7 @@ export default ${SVG_COMPONENT_NAME};`;
4506
3120
  //#endregion
4507
3121
  //#region src/utils/babel.ts
4508
3122
  function mergeBabelOptions(baseOptions, ...options) {
4509
- return options.reduce((acc, options$1) => (0, es_toolkit.mergeWith)(acc, options$1, merge$3), baseOptions);
3123
+ return options.reduce((acc, options) => (0, es_toolkit.mergeWith)(acc, options, merge$3), baseOptions);
4510
3124
  }
4511
3125
  function merge$3(target, source, key) {
4512
3126
  if (key === "plugins") return [...target ?? [], ...source ?? []];
@@ -4518,47 +3132,47 @@ function merge$3(target, source, key) {
4518
3132
  function babelPlugin(options) {
4519
3133
  const { rules = [] } = options ?? {};
4520
3134
  const babelOptionsById = /* @__PURE__ */ new Map();
4521
- const babelRules = rules.map(({ filter, options: options$1 }, index) => {
3135
+ const babelRules = rules.map(({ filter, options }, index) => {
4522
3136
  return {
4523
3137
  name: `rollipop:babel-rule-${index}`,
4524
3138
  transform: {
4525
3139
  filter,
4526
- handler(code, id$3) {
4527
- const existingBabelOptions = babelOptionsById.get(id$3);
4528
- const resolvedOptions = typeof options$1 === "function" ? options$1(code, id$3) : options$1;
4529
- existingBabelOptions ? existingBabelOptions.push(resolvedOptions) : babelOptionsById.set(id$3, [resolvedOptions]);
3140
+ handler(code, id) {
3141
+ const existingBabelOptions = babelOptionsById.get(id);
3142
+ const resolvedOptions = typeof options === "function" ? options(code, id) : options;
3143
+ existingBabelOptions ? existingBabelOptions.push(resolvedOptions) : babelOptionsById.set(id, [resolvedOptions]);
4530
3144
  }
4531
3145
  }
4532
3146
  };
4533
3147
  });
4534
- const babelPlugin$1 = {
3148
+ const babelPlugin = {
4535
3149
  name: "rollipop:babel",
4536
3150
  buildStart() {
4537
3151
  babelOptionsById.clear();
4538
3152
  },
4539
- transform: { handler(code, id$3) {
4540
- const flags = getFlag(this, id$3);
3153
+ transform: { handler(code, id) {
3154
+ const flags = getFlag(this, id);
4541
3155
  if (flags & TransformFlag.SKIP_ALL) return;
4542
- const babelOptions = babelOptionsById.get(id$3) ?? [];
3156
+ const babelOptions = babelOptionsById.get(id) ?? [];
4543
3157
  if (!(flags & TransformFlag.CODEGEN_REQUIRED || babelOptions.length > 0)) return;
4544
- const baseOptions = getPreset$1(flags, id$3);
3158
+ const baseOptions = getPreset$1(flags, id);
4545
3159
  const result = _babel_core.transformSync(code, {
4546
- filename: id$3,
3160
+ filename: id,
4547
3161
  babelrc: false,
4548
3162
  configFile: false,
4549
3163
  sourceMaps: true,
4550
3164
  ...mergeBabelOptions(baseOptions, ...babelOptions)
4551
3165
  });
4552
- (0, es_toolkit.invariant)(result?.code, `Failed to transform with babel: ${id$3}`);
3166
+ (0, es_toolkit.invariant)(result?.code, `Failed to transform with babel: ${id}`);
4553
3167
  return {
4554
3168
  code: result.code,
4555
3169
  map: result.map
4556
3170
  };
4557
3171
  } }
4558
3172
  };
4559
- return [...babelRules, babelPlugin$1].map(cacheable);
3173
+ return [...babelRules, babelPlugin].map(cacheable);
4560
3174
  }
4561
- function getPreset$1(flags, id$3) {
3175
+ function getPreset$1(flags, id) {
4562
3176
  const presets = [];
4563
3177
  const plugins = [];
4564
3178
  let parserOpts = null;
@@ -4568,8 +3182,8 @@ function getPreset$1(flags, id$3) {
4568
3182
  parseLangTypes: "flow",
4569
3183
  reactRuntimeTarget: "19"
4570
3184
  }], require.resolve("@babel/plugin-transform-flow-strip-types"));
4571
- } else if (isTS(id$3)) plugins.push([require.resolve("@babel/plugin-transform-typescript"), {
4572
- isTSX: isJSX(id$3),
3185
+ } else if (isTS(id)) plugins.push([require.resolve("@babel/plugin-transform-typescript"), {
3186
+ isTSX: isJSX(id),
4573
3187
  allowNamespaces: true
4574
3188
  }]);
4575
3189
  if (flags & TransformFlag.CODEGEN_REQUIRED) plugins.push([require.resolve("@react-native/babel-plugin-codegen")]);
@@ -4584,7 +3198,7 @@ function getPreset$1(flags, id$3) {
4584
3198
  //#endregion
4585
3199
  //#region src/utils/swc.ts
4586
3200
  function mergeSwcOptions(baseOptions, ...options) {
4587
- return options.reduce((acc, options$1) => (0, es_toolkit.mergeWith)(acc, options$1, merge$2), baseOptions);
3201
+ return options.reduce((acc, options) => (0, es_toolkit.mergeWith)(acc, options, merge$2), baseOptions);
4588
3202
  }
4589
3203
  function merge$2(target, source, key) {
4590
3204
  if (key === "plugins") return [...target ?? [], ...source ?? []];
@@ -4595,30 +3209,30 @@ function merge$2(target, source, key) {
4595
3209
  function swcPlugin(options) {
4596
3210
  const { rules = [] } = options ?? {};
4597
3211
  const swcOptionsById = /* @__PURE__ */ new Map();
4598
- const swcRules = rules.map(({ filter, options: options$1 }, index) => {
3212
+ const swcRules = rules.map(({ filter, options }, index) => {
4599
3213
  return {
4600
3214
  name: `rollipop:swc-rule-${index}`,
4601
3215
  transform: {
4602
3216
  filter,
4603
- handler(code, id$3) {
4604
- const existingBabelOptions = swcOptionsById.get(id$3);
4605
- const resolvedOptions = typeof options$1 === "function" ? options$1(code, id$3) : options$1;
4606
- existingBabelOptions ? existingBabelOptions.push(resolvedOptions) : swcOptionsById.set(id$3, [resolvedOptions]);
3217
+ handler(code, id) {
3218
+ const existingBabelOptions = swcOptionsById.get(id);
3219
+ const resolvedOptions = typeof options === "function" ? options(code, id) : options;
3220
+ existingBabelOptions ? existingBabelOptions.push(resolvedOptions) : swcOptionsById.set(id, [resolvedOptions]);
4607
3221
  }
4608
3222
  }
4609
3223
  };
4610
3224
  });
4611
- const swcPlugin$1 = {
3225
+ const swcPlugin = {
4612
3226
  name: "rollipop:swc",
4613
3227
  buildStart() {
4614
3228
  swcOptionsById.clear();
4615
3229
  },
4616
- transform: { handler(code, id$3) {
4617
- if (getFlag(this, id$3) & TransformFlag.SKIP_ALL) return;
4618
- const swcOptions = swcOptionsById.get(id$3) ?? [];
3230
+ transform: { handler(code, id) {
3231
+ if (getFlag(this, id) & TransformFlag.SKIP_ALL) return;
3232
+ const swcOptions = swcOptionsById.get(id) ?? [];
4619
3233
  const baseOptions = getPreset();
4620
3234
  const result = _swc_core.transformSync(code, {
4621
- filename: id$3,
3235
+ filename: id,
4622
3236
  configFile: false,
4623
3237
  swcrc: false,
4624
3238
  sourceMaps: true,
@@ -4631,7 +3245,7 @@ function swcPlugin(options) {
4631
3245
  };
4632
3246
  } }
4633
3247
  };
4634
- return [...swcRules, swcPlugin$1].map(cacheable);
3248
+ return [...swcRules, swcPlugin].map(cacheable);
4635
3249
  }
4636
3250
  function getPreset() {
4637
3251
  return {
@@ -4683,21 +3297,21 @@ function reporterPlugin(options) {
4683
3297
  },
4684
3298
  transform: {
4685
3299
  order: "post",
4686
- handler(_code, id$3) {
3300
+ handler(_code, id) {
4687
3301
  ++transformedModules;
4688
3302
  if (!unknownTotalModules && totalModules < transformedModules) totalModules = transformedModules;
4689
3303
  reporter?.update({
4690
3304
  type: "transform",
4691
- id: id$3,
3305
+ id,
4692
3306
  totalModules: unknownTotalModules ? void 0 : totalModules,
4693
3307
  transformedModules
4694
3308
  });
4695
3309
  }
4696
3310
  },
4697
- watchChange(id$3) {
3311
+ watchChange(id) {
4698
3312
  reporter?.update({
4699
3313
  type: "watch_change",
4700
- id: id$3
3314
+ id
4701
3315
  });
4702
3316
  }
4703
3317
  };
@@ -4709,8 +3323,8 @@ resolveRolldownOptions.cache = /* @__PURE__ */ new Map();
4709
3323
  async function resolveRolldownOptions(context, config, buildOptions, devEngineOptions) {
4710
3324
  const cachedOptions = resolveRolldownOptions.cache.get(context.id);
4711
3325
  if (cachedOptions != null) return cachedOptions;
4712
- const { platform, dev: dev$1, cache } = buildOptions;
4713
- const isDevServerMode = dev$1 && context.buildType === "serve";
3326
+ const { platform, dev, cache } = buildOptions;
3327
+ const isDevServerMode = dev && context.buildType === "serve";
4714
3328
  (0, es_toolkit.invariant)(isDevServerMode ? devEngineOptions != null : true, "devEngineOptions is required in dev server mode");
4715
3329
  const env = loadEnv(config);
4716
3330
  const builtInEnv = {
@@ -4737,12 +3351,12 @@ async function resolveRolldownOptions(context, config, buildOptions, devEngineOp
4737
3351
  target: "es2015",
4738
3352
  jsx: {
4739
3353
  runtime: "automatic",
4740
- development: dev$1
3354
+ development: dev
4741
3355
  },
4742
3356
  define: {
4743
- __DEV__: asLiteral(dev$1),
3357
+ __DEV__: asLiteral(dev),
4744
3358
  global: asIdentifier(GLOBAL_IDENTIFIER),
4745
- "process.env.NODE_ENV": asLiteral(nodeEnvironment(dev$1)),
3359
+ "process.env.NODE_ENV": asLiteral(nodeEnvironment(dev)),
4746
3360
  "process.env.DEBUG_ROLLIPOP": asLiteral(isDebugEnabled()),
4747
3361
  ...defineEnvFromObject(env),
4748
3362
  ...defineEnvFromObject(builtInEnv)
@@ -4757,15 +3371,15 @@ async function resolveRolldownOptions(context, config, buildOptions, devEngineOp
4757
3371
  sourceExtensions,
4758
3372
  context
4759
3373
  });
4760
- const statusReporter = (() => {
3374
+ const defaultReporters = [(() => {
4761
3375
  switch (config.terminal.status) {
4762
3376
  case "compat": return new CompatStatusReporter();
4763
3377
  case "progress": return new ProgressBarStatusReporter(context.id, `[${platform}, ${buildOptions.dev ? "dev" : "prod"}]`, getBuildTotalModules(context.storage, context.id));
4764
3378
  }
4765
- })();
3379
+ })()];
4766
3380
  const reporterOptions = {
4767
3381
  initialTotalModules: getBuildTotalModules(context.storage, context.id),
4768
- reporter: mergeReporters([statusReporter, config.reporter].filter(es_toolkit.isNotNil))
3382
+ reporter: mergeReporters([...defaultReporters, config.reporter].filter(es_toolkit.isNotNil))
4769
3383
  };
4770
3384
  const finalOptions = await applyDangerouslyOverrideOptionsFinalizer(config, {
4771
3385
  platform: "neutral",
@@ -4782,7 +3396,7 @@ async function resolveRolldownOptions(context, config, buildOptions, devEngineOp
4782
3396
  plugins: withTransformBoundary([
4783
3397
  preludePlugin({ modulePaths: preludePaths }),
4784
3398
  reactNativePlugin(config, {
4785
- dev: dev$1,
3399
+ dev,
4786
3400
  platform,
4787
3401
  buildType: context.buildType,
4788
3402
  codegenFilter: codegen.filter,
@@ -4822,12 +3436,11 @@ async function resolveRolldownOptions(context, config, buildOptions, devEngineOp
4822
3436
  outro: rolldownOutro,
4823
3437
  intro: async (chunk) => {
4824
3438
  return [
4825
- ...getGlobalVariables(dev$1, context.buildType),
3439
+ ...getGlobalVariables(dev, context.buildType),
4826
3440
  ...loadPolyfills(polyfills),
4827
3441
  typeof rolldownIntro === "function" ? await rolldownIntro(chunk) : rolldownIntro
4828
3442
  ].filter(es_toolkit.isNotNil).join("\n");
4829
3443
  },
4830
- keepNames: dev$1,
4831
3444
  minify: buildOptions.minify ?? rolldownMinify,
4832
3445
  sourcemap: buildOptions.sourcemap ?? rolldownSourcemap,
4833
3446
  sourcemapBaseUrl: rolldownSourcemapBaseUrl,
@@ -4843,16 +3456,16 @@ async function resolveRolldownOptions(context, config, buildOptions, devEngineOp
4843
3456
  }
4844
3457
  function getResolveExtensions({ platform, sourceExtensions, assetExtensions, preferNativePlatform }) {
4845
3458
  const supportedExtensions = [...sourceExtensions, ...assetExtensions];
4846
- return [...[platform, preferNativePlatform ? "native" : null].filter(es_toolkit.isNotNil).map((platform$1) => {
4847
- return supportedExtensions.map((extension) => `.${platform$1}.${extension}`);
3459
+ return [...[platform, preferNativePlatform ? "native" : null].filter(es_toolkit.isNotNil).map((platform) => {
3460
+ return supportedExtensions.map((extension) => `.${platform}.${extension}`);
4848
3461
  }), ...supportedExtensions.map((extension) => `.${extension}`)].flat();
4849
3462
  }
4850
3463
  function loadPolyfills(polyfills) {
4851
3464
  return polyfills.map((polyfill) => {
4852
3465
  if (typeof polyfill === "string") return node_fs.default.readFileSync(polyfill, "utf-8");
4853
- const path$14 = "path" in polyfill ? polyfill.path : void 0;
3466
+ const path = "path" in polyfill ? polyfill.path : void 0;
4854
3467
  const content = "code" in polyfill ? polyfill.code : node_fs.default.readFileSync(polyfill.path, "utf-8");
4855
- return polyfill.type === "iife" ? iife(content, path$14) : content;
3468
+ return polyfill.type === "iife" ? iife(content, path) : content;
4856
3469
  });
4857
3470
  }
4858
3471
  async function applyDangerouslyOverrideOptionsFinalizer(config, inputOptions, outputOptions) {
@@ -4912,11 +3525,11 @@ var Bundler = class Bundler {
4912
3525
  return createId(config, buildOptions);
4913
3526
  }
4914
3527
  static createContext(buildType, config, buildOptions) {
4915
- const id$3 = Bundler.createId(config, buildOptions);
3528
+ const id = Bundler.createId(config, buildOptions);
4916
3529
  return {
4917
- id: id$3,
3530
+ id,
4918
3531
  root: config.root,
4919
- cache: new FileSystemCache(config.root, id$3),
3532
+ cache: new FileSystemCache(config.root, id),
4920
3533
  storage: FileStorage.getInstance(config.root),
4921
3534
  buildType,
4922
3535
  state: { hmrUpdates: /* @__PURE__ */ new Set() }
@@ -5207,7 +3820,6 @@ const command = {
5207
3820
  //#endregion
5208
3821
  //#region src/commands.ts
5209
3822
  const commands = [createReactNativeCliCommand(command$1), createReactNativeCliCommand(command)];
5210
- var commands_default = commands;
5211
3823
 
5212
3824
  //#endregion
5213
- module.exports = commands_default;
3825
+ module.exports = commands;