rolldown 1.0.0-beta.7-commit.25f3c61 → 1.0.0-beta.7-commit.170d158

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 (32) hide show
  1. package/bin/cli.mjs +2 -0
  2. package/dist/{cjs/cli.cjs → cli.cjs} +4 -5
  3. package/dist/cli.mjs +1829 -0
  4. package/dist/{cjs/experimental-index.cjs → experimental-index.cjs} +3 -3
  5. package/dist/{esm/experimental-index.mjs → experimental-index.mjs} +13 -2
  6. package/dist/{cjs/index.cjs → index.cjs} +2 -2
  7. package/dist/index.mjs +5 -0
  8. package/dist/{cjs/parallel-plugin-worker.cjs → parallel-plugin-worker.cjs} +3 -4
  9. package/dist/parallel-plugin-worker.mjs +47 -0
  10. package/dist/parse-ast-index.cjs +4 -0
  11. package/dist/parse-ast-index.mjs +4 -0
  12. package/dist/shared/chunk-DUYDk_2O.mjs +33 -0
  13. package/dist/shared/{parse-ast-index-DNOUVcBy.mjs → parse-ast-index-5U4JtZBO.mjs} +108 -110
  14. package/dist/shared/{parse-ast-index-0ei4fTjl.cjs → parse-ast-index-BfKb9n4T.cjs} +1 -1
  15. package/dist/shared/prompt-W5YHe0v6.mjs +854 -0
  16. package/dist/shared/{src-BPcsb-4N.cjs → src-B0nHUJsv.cjs} +26 -7
  17. package/dist/shared/src-kyIoH7SP.mjs +4319 -0
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/dist/types/api/rolldown/rolldown-build.d.ts +1 -0
  20. package/dist/types/binding.d.ts +8 -2
  21. package/dist/types/options/input-options.d.ts +5 -1
  22. package/package.json +32 -31
  23. package/bin/cli.js +0 -2
  24. package/dist/cjs/parse-ast-index.cjs +0 -4
  25. package/dist/esm/cli.mjs +0 -1755
  26. package/dist/esm/index.mjs +0 -4
  27. package/dist/esm/parallel-plugin-worker.mjs +0 -41
  28. package/dist/esm/parse-ast-index.mjs +0 -3
  29. package/dist/shared/prompt-C6jWWCza.mjs +0 -852
  30. package/dist/shared/src-DllTyFDp.mjs +0 -2888
  31. /package/dist/{cjs/parallel-plugin.cjs → parallel-plugin.cjs} +0 -0
  32. /package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -0
@@ -0,0 +1,4319 @@
1
+ import { __esm } from "./chunk-DUYDk_2O.mjs";
2
+ import { augmentCodeLocation, colors, error, import_binding, init_colors, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-5U4JtZBO.mjs";
3
+ import path from "node:path";
4
+ import { toJsonSchema } from "@valibot/to-json-schema";
5
+ import * as v from "valibot";
6
+ import { Buffer } from "node:buffer";
7
+ import { availableParallelism } from "node:os";
8
+ import { Worker } from "node:worker_threads";
9
+
10
+ //#region package.json
11
+ var version = "1.0.0-beta.7-commit.170d158";
12
+ var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
+
14
+ //#endregion
15
+ //#region src/builtin-plugin/utils.ts
16
+ function makeBuiltinPluginCallable(plugin) {
17
+ let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
18
+ const wrappedPlugin = plugin;
19
+ for (const key in callablePlugin) wrappedPlugin[key] = function(...args) {
20
+ return callablePlugin[key](...args);
21
+ };
22
+ return wrappedPlugin;
23
+ }
24
+ function bindingifyBuiltInPlugin(plugin) {
25
+ return {
26
+ __name: plugin.name,
27
+ options: plugin._options
28
+ };
29
+ }
30
+ var init_utils = __esm({ "src/builtin-plugin/utils.ts"() {} });
31
+
32
+ //#endregion
33
+ //#region src/builtin-plugin/constructors.ts
34
+ function modulePreloadPolyfillPlugin(config) {
35
+ return new BuiltinPlugin("builtin:module-preload-polyfill", config);
36
+ }
37
+ function dynamicImportVarsPlugin() {
38
+ return new BuiltinPlugin("builtin:dynamic-import-vars");
39
+ }
40
+ function importGlobPlugin(config) {
41
+ return new BuiltinPlugin("builtin:import-glob", config);
42
+ }
43
+ function manifestPlugin(config) {
44
+ return new BuiltinPlugin("builtin:manifest", config);
45
+ }
46
+ function wasmHelperPlugin() {
47
+ return new BuiltinPlugin("builtin:wasm-helper");
48
+ }
49
+ function wasmFallbackPlugin() {
50
+ return new BuiltinPlugin("builtin:wasm-fallback");
51
+ }
52
+ function loadFallbackPlugin() {
53
+ return new BuiltinPlugin("builtin:load-fallback");
54
+ }
55
+ function jsonPlugin(config) {
56
+ return new BuiltinPlugin("builtin:json", config);
57
+ }
58
+ function buildImportAnalysisPlugin(config) {
59
+ return new BuiltinPlugin("builtin:build-import-analysis", config);
60
+ }
61
+ function viteResolvePlugin(config) {
62
+ const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", {
63
+ ...config,
64
+ runtime: process.versions.deno ? "deno" : process.versions.bun ? "bun" : "node"
65
+ });
66
+ return makeBuiltinPluginCallable(builtinPlugin);
67
+ }
68
+ function moduleFederationPlugin(config) {
69
+ return new BuiltinPlugin("builtin:module-federation", {
70
+ ...config,
71
+ remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
72
+ if (typeof remote === "string") {
73
+ const [entryGlobalName] = remote.split("@");
74
+ const entry = remote.replace(entryGlobalName + "@", "");
75
+ return {
76
+ entry,
77
+ name,
78
+ entryGlobalName
79
+ };
80
+ }
81
+ return {
82
+ ...remote,
83
+ name: remote.name ?? name
84
+ };
85
+ }),
86
+ manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
87
+ });
88
+ }
89
+ function isolatedDeclarationPlugin(config) {
90
+ return new BuiltinPlugin("builtin:isolated-declaration", config);
91
+ }
92
+ var BuiltinPlugin;
93
+ var init_constructors = __esm({ "src/builtin-plugin/constructors.ts"() {
94
+ init_utils();
95
+ BuiltinPlugin = class {
96
+ constructor(name, _options) {
97
+ this.name = name;
98
+ this._options = _options;
99
+ }
100
+ };
101
+ } });
102
+
103
+ //#endregion
104
+ //#region src/utils/misc.ts
105
+ function arraify(value) {
106
+ return Array.isArray(value) ? value : [value];
107
+ }
108
+ function isNullish(value) {
109
+ return value === null || value === void 0;
110
+ }
111
+ function unimplemented(info) {
112
+ if (info) throw new Error(`unimplemented: ${info}`);
113
+ throw new Error("unimplemented");
114
+ }
115
+ function unreachable(info) {
116
+ if (info) throw new Error(`unreachable: ${info}`);
117
+ throw new Error("unreachable");
118
+ }
119
+ function unsupported(info) {
120
+ throw new Error(`UNSUPPORTED: ${info}`);
121
+ }
122
+ function noop(..._args) {}
123
+ var init_misc = __esm({ "src/utils/misc.ts"() {} });
124
+
125
+ //#endregion
126
+ //#region src/log/logging.ts
127
+ var LOG_LEVEL_SILENT, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, logLevelPriority;
128
+ var init_logging = __esm({ "src/log/logging.ts"() {
129
+ LOG_LEVEL_SILENT = "silent";
130
+ LOG_LEVEL_ERROR = "error";
131
+ LOG_LEVEL_WARN = "warn";
132
+ LOG_LEVEL_INFO = "info";
133
+ LOG_LEVEL_DEBUG = "debug";
134
+ logLevelPriority = {
135
+ [LOG_LEVEL_DEBUG]: 0,
136
+ [LOG_LEVEL_INFO]: 1,
137
+ [LOG_LEVEL_WARN]: 2,
138
+ [LOG_LEVEL_SILENT]: 3
139
+ };
140
+ } });
141
+
142
+ //#endregion
143
+ //#region src/log/log-handler.ts
144
+ function getLogHandler(level, code, logger, pluginName, logLevel) {
145
+ if (logLevelPriority[level] < logLevelPriority[logLevel]) return noop;
146
+ return (log, pos) => {
147
+ if (pos != null) logger(LOG_LEVEL_WARN, logInvalidLogPosition(pluginName));
148
+ log = normalizeLog(log);
149
+ if (log.code && !log.pluginCode) log.pluginCode = log.code;
150
+ log.code = code;
151
+ log.plugin = pluginName;
152
+ logger(level, log);
153
+ };
154
+ }
155
+ var normalizeLog;
156
+ var init_log_handler = __esm({ "src/log/log-handler.ts"() {
157
+ init_misc();
158
+ init_logging();
159
+ init_logs();
160
+ normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
161
+ } });
162
+
163
+ //#endregion
164
+ //#region src/log/logger.ts
165
+ function getLogger(plugins, onLog, logLevel, watchMode) {
166
+ const minimalPriority = logLevelPriority[logLevel];
167
+ const logger = (level, log, skipped = new Set()) => {
168
+ const logPriority = logLevelPriority[level];
169
+ if (logPriority < minimalPriority) return;
170
+ for (const plugin of getSortedPlugins("onLog", plugins)) {
171
+ if (skipped.has(plugin)) continue;
172
+ const { onLog: pluginOnLog } = plugin;
173
+ if (pluginOnLog) {
174
+ const getLogHandler$1 = (level$1) => {
175
+ if (logLevelPriority[level$1] < minimalPriority) return () => {};
176
+ return (log$1) => logger(level$1, normalizeLog(log$1), new Set(skipped).add(plugin));
177
+ };
178
+ const handler = "handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog;
179
+ if (handler.call({
180
+ debug: getLogHandler$1(LOG_LEVEL_DEBUG),
181
+ error: (log$1) => error(normalizeLog(log$1)),
182
+ info: getLogHandler$1(LOG_LEVEL_INFO),
183
+ meta: {
184
+ rollupVersion: "4.23.0",
185
+ rolldownVersion: VERSION,
186
+ watchMode
187
+ },
188
+ warn: getLogHandler$1(LOG_LEVEL_WARN),
189
+ pluginName: plugin.name || "unknown"
190
+ }, level, log) === false) return;
191
+ }
192
+ }
193
+ onLog(level, log);
194
+ };
195
+ return logger;
196
+ }
197
+ function relativeId(id) {
198
+ if (!path.isAbsolute(id)) return id;
199
+ return path.relative(path.resolve(), id);
200
+ }
201
+ var getOnLog, getDefaultOnLog, addLogToString, defaultPrintLog, getExtendedLogMessage;
202
+ var init_logger = __esm({ "src/log/logger.ts"() {
203
+ init_src();
204
+ init_plugin_driver();
205
+ init_log_handler();
206
+ init_logging();
207
+ init_logs();
208
+ getOnLog = (config, logLevel, printLog = defaultPrintLog) => {
209
+ const { onwarn, onLog } = config;
210
+ const defaultOnLog = getDefaultOnLog(printLog, onwarn);
211
+ if (onLog) {
212
+ const minimalPriority = logLevelPriority[logLevel];
213
+ return (level, log) => onLog(level, addLogToString(log), (level$1, handledLog) => {
214
+ if (level$1 === LOG_LEVEL_ERROR) return error(normalizeLog(handledLog));
215
+ if (logLevelPriority[level$1] >= minimalPriority) defaultOnLog(level$1, normalizeLog(handledLog));
216
+ });
217
+ }
218
+ return defaultOnLog;
219
+ };
220
+ getDefaultOnLog = (printLog, onwarn) => onwarn ? (level, log) => {
221
+ if (level === LOG_LEVEL_WARN) onwarn(addLogToString(log), (warning) => printLog(LOG_LEVEL_WARN, normalizeLog(warning)));
222
+ else printLog(level, log);
223
+ } : printLog;
224
+ addLogToString = (log) => {
225
+ Object.defineProperty(log, "toString", {
226
+ value: () => getExtendedLogMessage(log),
227
+ writable: true
228
+ });
229
+ return log;
230
+ };
231
+ defaultPrintLog = (level, log) => {
232
+ const message = getExtendedLogMessage(log);
233
+ switch (level) {
234
+ case LOG_LEVEL_WARN: return console.warn(message);
235
+ case LOG_LEVEL_DEBUG: return console.debug(message);
236
+ default: return console.info(message);
237
+ }
238
+ };
239
+ getExtendedLogMessage = (log) => {
240
+ let prefix = "";
241
+ if (log.plugin) prefix += `(${log.plugin} plugin) `;
242
+ if (log.loc) prefix += `${relativeId(log.loc.file)} (${log.loc.line}:${log.loc.column}) `;
243
+ return prefix + log.message;
244
+ };
245
+ } });
246
+
247
+ //#endregion
248
+ //#region src/utils/normalize-hook.ts
249
+ function normalizeHook(hook) {
250
+ if (typeof hook === "function" || typeof hook === "string") return {
251
+ handler: hook,
252
+ options: {},
253
+ meta: {}
254
+ };
255
+ if (typeof hook === "object" && hook !== null) {
256
+ const { handler, order,...options } = hook;
257
+ return {
258
+ handler,
259
+ options,
260
+ meta: { order }
261
+ };
262
+ }
263
+ unreachable("Invalid hook type");
264
+ }
265
+ var init_normalize_hook = __esm({ "src/utils/normalize-hook.ts"() {
266
+ init_misc();
267
+ } });
268
+
269
+ //#endregion
270
+ //#region src/constants/plugin.ts
271
+ var ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, ENUMERATED_PLUGIN_HOOK_NAMES, DEFINED_HOOK_NAMES;
272
+ var init_plugin$1 = __esm({ "src/constants/plugin.ts"() {
273
+ ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
274
+ "options",
275
+ "buildStart",
276
+ "resolveId",
277
+ "load",
278
+ "transform",
279
+ "moduleParsed",
280
+ "buildEnd",
281
+ "onLog",
282
+ "resolveDynamicImport",
283
+ "closeBundle",
284
+ "closeWatcher",
285
+ "watchChange"
286
+ ];
287
+ ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES = [
288
+ "augmentChunkHash",
289
+ "outputOptions",
290
+ "renderChunk",
291
+ "renderStart",
292
+ "renderError",
293
+ "writeBundle",
294
+ "generateBundle"
295
+ ];
296
+ ENUMERATED_PLUGIN_HOOK_NAMES = [
297
+ ...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
298
+ ...ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES,
299
+ "footer",
300
+ "banner",
301
+ "intro",
302
+ "outro"
303
+ ];
304
+ DEFINED_HOOK_NAMES = {
305
+ [ENUMERATED_PLUGIN_HOOK_NAMES[0]]: ENUMERATED_PLUGIN_HOOK_NAMES[0],
306
+ [ENUMERATED_PLUGIN_HOOK_NAMES[1]]: ENUMERATED_PLUGIN_HOOK_NAMES[1],
307
+ [ENUMERATED_PLUGIN_HOOK_NAMES[2]]: ENUMERATED_PLUGIN_HOOK_NAMES[2],
308
+ [ENUMERATED_PLUGIN_HOOK_NAMES[3]]: ENUMERATED_PLUGIN_HOOK_NAMES[3],
309
+ [ENUMERATED_PLUGIN_HOOK_NAMES[4]]: ENUMERATED_PLUGIN_HOOK_NAMES[4],
310
+ [ENUMERATED_PLUGIN_HOOK_NAMES[5]]: ENUMERATED_PLUGIN_HOOK_NAMES[5],
311
+ [ENUMERATED_PLUGIN_HOOK_NAMES[6]]: ENUMERATED_PLUGIN_HOOK_NAMES[6],
312
+ [ENUMERATED_PLUGIN_HOOK_NAMES[7]]: ENUMERATED_PLUGIN_HOOK_NAMES[7],
313
+ [ENUMERATED_PLUGIN_HOOK_NAMES[8]]: ENUMERATED_PLUGIN_HOOK_NAMES[8],
314
+ [ENUMERATED_PLUGIN_HOOK_NAMES[9]]: ENUMERATED_PLUGIN_HOOK_NAMES[9],
315
+ [ENUMERATED_PLUGIN_HOOK_NAMES[10]]: ENUMERATED_PLUGIN_HOOK_NAMES[10],
316
+ [ENUMERATED_PLUGIN_HOOK_NAMES[11]]: ENUMERATED_PLUGIN_HOOK_NAMES[11],
317
+ [ENUMERATED_PLUGIN_HOOK_NAMES[12]]: ENUMERATED_PLUGIN_HOOK_NAMES[12],
318
+ [ENUMERATED_PLUGIN_HOOK_NAMES[13]]: ENUMERATED_PLUGIN_HOOK_NAMES[13],
319
+ [ENUMERATED_PLUGIN_HOOK_NAMES[14]]: ENUMERATED_PLUGIN_HOOK_NAMES[14],
320
+ [ENUMERATED_PLUGIN_HOOK_NAMES[15]]: ENUMERATED_PLUGIN_HOOK_NAMES[15],
321
+ [ENUMERATED_PLUGIN_HOOK_NAMES[16]]: ENUMERATED_PLUGIN_HOOK_NAMES[16],
322
+ [ENUMERATED_PLUGIN_HOOK_NAMES[17]]: ENUMERATED_PLUGIN_HOOK_NAMES[17],
323
+ [ENUMERATED_PLUGIN_HOOK_NAMES[18]]: ENUMERATED_PLUGIN_HOOK_NAMES[18],
324
+ [ENUMERATED_PLUGIN_HOOK_NAMES[19]]: ENUMERATED_PLUGIN_HOOK_NAMES[19],
325
+ [ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20],
326
+ [ENUMERATED_PLUGIN_HOOK_NAMES[21]]: ENUMERATED_PLUGIN_HOOK_NAMES[21],
327
+ [ENUMERATED_PLUGIN_HOOK_NAMES[22]]: ENUMERATED_PLUGIN_HOOK_NAMES[22]
328
+ };
329
+ } });
330
+
331
+ //#endregion
332
+ //#region src/utils/async-flatten.ts
333
+ async function asyncFlatten(array) {
334
+ do
335
+ array = (await Promise.all(array)).flat(Infinity);
336
+ while (array.some((v$1) => v$1?.then));
337
+ return array;
338
+ }
339
+ var init_async_flatten = __esm({ "src/utils/async-flatten.ts"() {} });
340
+
341
+ //#endregion
342
+ //#region src/utils/normalize-plugin-option.ts
343
+ function checkOutputPluginOption(plugins, onLog) {
344
+ for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
345
+ delete plugin[hook];
346
+ onLog(LOG_LEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook));
347
+ }
348
+ return plugins;
349
+ }
350
+ function normalizePlugins(plugins, anonymousPrefix) {
351
+ for (const [index, plugin] of plugins.entries()) {
352
+ if ("_parallel" in plugin) continue;
353
+ if (plugin instanceof BuiltinPlugin) continue;
354
+ if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
355
+ }
356
+ return plugins;
357
+ }
358
+ var normalizePluginOption, ANONYMOUS_PLUGIN_PREFIX, ANONYMOUS_OUTPUT_PLUGIN_PREFIX;
359
+ var init_normalize_plugin_option = __esm({ "src/utils/normalize-plugin-option.ts"() {
360
+ init_constructors();
361
+ init_plugin$1();
362
+ init_logging();
363
+ init_logs();
364
+ init_async_flatten();
365
+ normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
366
+ ANONYMOUS_PLUGIN_PREFIX = "at position ";
367
+ ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
368
+ } });
369
+
370
+ //#endregion
371
+ //#region src/plugin/minimal-plugin-context.ts
372
+ var MinimalPluginContextImpl;
373
+ var init_minimal_plugin_context = __esm({ "src/plugin/minimal-plugin-context.ts"() {
374
+ init_src();
375
+ init_log_handler();
376
+ init_logging();
377
+ init_logs();
378
+ MinimalPluginContextImpl = class {
379
+ info;
380
+ warn;
381
+ debug;
382
+ meta;
383
+ constructor(onLog, logLevel, pluginName, watchMode, hookName) {
384
+ this.pluginName = pluginName;
385
+ this.hookName = hookName;
386
+ this.debug = getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", onLog, pluginName, logLevel);
387
+ this.info = getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", onLog, pluginName, logLevel);
388
+ this.warn = getLogHandler(LOG_LEVEL_WARN, "PLUGIN_WARNING", onLog, pluginName, logLevel);
389
+ this.meta = {
390
+ rollupVersion: "4.23.0",
391
+ rolldownVersion: VERSION,
392
+ watchMode
393
+ };
394
+ }
395
+ error(e$5) {
396
+ return error(logPluginError(normalizeLog(e$5), this.pluginName, { hook: this.hookName }));
397
+ }
398
+ };
399
+ } });
400
+
401
+ //#endregion
402
+ //#region src/plugin/plugin-driver.ts
403
+ function getObjectPlugins(plugins) {
404
+ return plugins.filter((plugin) => {
405
+ if (!plugin) return void 0;
406
+ if ("_parallel" in plugin) return void 0;
407
+ if (plugin instanceof BuiltinPlugin) return void 0;
408
+ return plugin;
409
+ });
410
+ }
411
+ function getSortedPlugins(hookName, plugins) {
412
+ const pre = [];
413
+ const normal = [];
414
+ const post = [];
415
+ for (const plugin of plugins) {
416
+ const hook = plugin[hookName];
417
+ if (hook) {
418
+ if (typeof hook === "object") {
419
+ if (hook.order === "pre") {
420
+ pre.push(plugin);
421
+ continue;
422
+ }
423
+ if (hook.order === "post") {
424
+ post.push(plugin);
425
+ continue;
426
+ }
427
+ }
428
+ normal.push(plugin);
429
+ }
430
+ }
431
+ return [
432
+ ...pre,
433
+ ...normal,
434
+ ...post
435
+ ];
436
+ }
437
+ var PluginDriver;
438
+ var init_plugin_driver = __esm({ "src/plugin/plugin-driver.ts"() {
439
+ init_constructors();
440
+ init_logger();
441
+ init_logging();
442
+ init_normalize_hook();
443
+ init_normalize_plugin_option();
444
+ init_minimal_plugin_context();
445
+ PluginDriver = class {
446
+ static async callOptionsHook(inputOptions, watchMode = false) {
447
+ const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
448
+ const plugins = getSortedPlugins("options", getObjectPlugins(await normalizePluginOption(inputOptions.plugins)));
449
+ const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel, watchMode);
450
+ for (const plugin of plugins) {
451
+ const name = plugin.name || "unknown";
452
+ const options = plugin.options;
453
+ if (options) {
454
+ const { handler } = normalizeHook(options);
455
+ const result = await handler.call(new MinimalPluginContextImpl(logger, logLevel, name, watchMode, "onLog"), inputOptions);
456
+ if (result) inputOptions = result;
457
+ }
458
+ }
459
+ return inputOptions;
460
+ }
461
+ static callOutputOptionsHook(rawPlugins, outputOptions, onLog, logLevel, watchMode) {
462
+ const sortedPlugins = getSortedPlugins("outputOptions", getObjectPlugins(rawPlugins));
463
+ for (const plugin of sortedPlugins) {
464
+ const name = plugin.name || "unknown";
465
+ const options = plugin.outputOptions;
466
+ if (options) {
467
+ const { handler } = normalizeHook(options);
468
+ const result = handler.call(new MinimalPluginContextImpl(onLog, logLevel, name, watchMode), outputOptions);
469
+ if (result) outputOptions = result;
470
+ }
471
+ }
472
+ return outputOptions;
473
+ }
474
+ };
475
+ } });
476
+
477
+ //#endregion
478
+ //#region src/utils/validator.ts
479
+ function validateCliOptions(options) {
480
+ let parsed = v.safeParse(CliOptionsSchema, options);
481
+ return [parsed.output, parsed.issues?.map((issue) => {
482
+ const option = issue.path?.map((pathItem) => pathItem.key).join(" ");
483
+ return `Invalid value for option ${option}: ${issue.message}`;
484
+ })];
485
+ }
486
+ function validateOption(key, options) {
487
+ if (process.env.ROLLDOWN_OPTIONS_VALIDATION === "loose") return;
488
+ let parsed = v.safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
489
+ if (!parsed.success) {
490
+ const errors = parsed.issues.map((issue) => {
491
+ const issuePaths = issue.path.map((path$1) => path$1.key);
492
+ let issueMsg = issue.message;
493
+ if (issue.type === "union") {
494
+ const subIssue = issue.issues?.find((i$21) => !(i$21.type !== issue.received && i$21.input === issue.input));
495
+ if (subIssue) {
496
+ if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
497
+ issueMsg = subIssue.message;
498
+ }
499
+ }
500
+ const stringPath = issuePaths.join(".");
501
+ const helper = key === "input" ? inputHelperMsgRecord[stringPath] : outputHelperMsgRecord[stringPath];
502
+ if (helper && helper.ignored) return "";
503
+ return `- For the "${stringPath}". ${issueMsg}. ${helper ? helper.msg : ""}`;
504
+ }).filter(Boolean);
505
+ if (errors.length) throw new Error(`Failed validate ${key} options.\n` + errors.join("\n"));
506
+ }
507
+ }
508
+ function getInputCliKeys() {
509
+ return v.keyof(InputCliOptionsSchema).options;
510
+ }
511
+ function getOutputCliKeys() {
512
+ return v.keyof(OutputCliOptionsSchema).options;
513
+ }
514
+ function getJsonSchema() {
515
+ return toJsonSchema(CliOptionsSchema);
516
+ }
517
+ var StringOrRegExpSchema, LogLevelSchema, LogLevelOptionSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, InputOptionSchema, ExternalSchema, ModuleTypesSchema, JsxOptionsSchema, HelperModeSchema, DecoratorOptionSchema, HelpersSchema, RewriteImportExtensionsSchema, TypescriptSchema, AssumptionsSchema, TransformOptionsSchema, WatchOptionsSchema, ChecksOptionsSchema, MinifyOptionsSchema, ResolveOptionsSchema, TreeshakingOptionsSchema, OnLogSchema, OnwarnSchema, HmrSchema, InputOptionsSchema, InputCliOverrideSchema, InputCliOptionsSchema, ESTarget, ModuleFormatSchema, AddonFunctionSchema, ChunkFileNamesSchema, AssetFileNamesSchema, SanitizeFileNameSchema, GlobalsFunctionSchema, AdvancedChunksSchema, OutputOptionsSchema, getAddonDescription, OutputCliOverrideSchema, OutputCliOptionsSchema, CliOptionsSchema, inputHelperMsgRecord, outputHelperMsgRecord;
518
+ var init_validator = __esm({ "src/utils/validator.ts"() {
519
+ init_colors();
520
+ StringOrRegExpSchema = v.union([v.string(), v.instance(RegExp)]);
521
+ LogLevelSchema = v.union([
522
+ v.literal("debug"),
523
+ v.literal("info"),
524
+ v.literal("warn")
525
+ ]);
526
+ LogLevelOptionSchema = v.union([LogLevelSchema, v.literal("silent")]);
527
+ LogLevelWithErrorSchema = v.union([LogLevelSchema, v.literal("error")]);
528
+ RollupLogSchema = v.any();
529
+ RollupLogWithStringSchema = v.union([RollupLogSchema, v.string()]);
530
+ InputOptionSchema = v.union([
531
+ v.string(),
532
+ v.array(v.string()),
533
+ v.record(v.string(), v.string())
534
+ ]);
535
+ ExternalSchema = v.union([
536
+ StringOrRegExpSchema,
537
+ v.array(StringOrRegExpSchema),
538
+ v.pipe(v.function(), v.args(v.tuple([
539
+ v.string(),
540
+ v.optional(v.string()),
541
+ v.boolean()
542
+ ])), v.returns(v.nullish(v.boolean())))
543
+ ]);
544
+ ModuleTypesSchema = v.record(v.string(), v.union([
545
+ v.literal("base64"),
546
+ v.literal("binary"),
547
+ v.literal("css"),
548
+ v.literal("dataurl"),
549
+ v.literal("empty"),
550
+ v.literal("js"),
551
+ v.literal("json"),
552
+ v.literal("jsx"),
553
+ v.literal("text"),
554
+ v.literal("ts"),
555
+ v.literal("tsx")
556
+ ]));
557
+ JsxOptionsSchema = v.strictObject({
558
+ development: v.pipe(v.optional(v.boolean()), v.description("Development specific information")),
559
+ factory: v.pipe(v.optional(v.string()), v.description("Jsx element transformation")),
560
+ fragment: v.pipe(v.optional(v.string()), v.description("Jsx fragment transformation")),
561
+ importSource: v.pipe(v.optional(v.string()), v.description("Import the factory of element and fragment if mode is classic")),
562
+ jsxImportSource: v.pipe(v.optional(v.string()), v.description("Import the factory of element and fragment if mode is automatic")),
563
+ mode: v.pipe(v.optional(v.union([
564
+ v.literal("classic"),
565
+ v.literal("automatic"),
566
+ v.literal("preserve")
567
+ ])), v.description("Jsx transformation mode")),
568
+ refresh: v.pipe(v.optional(v.boolean()), v.description("React refresh transformation"))
569
+ });
570
+ HelperModeSchema = v.union([v.literal("Runtime"), v.literal("External")]);
571
+ DecoratorOptionSchema = v.object({
572
+ legacy: v.optional(v.boolean()),
573
+ emitDecoratorMetadata: v.optional(v.boolean())
574
+ });
575
+ HelpersSchema = v.object({ mode: v.optional(HelperModeSchema) });
576
+ RewriteImportExtensionsSchema = v.union([
577
+ v.literal("rewrite"),
578
+ v.literal("remove"),
579
+ v.boolean()
580
+ ]);
581
+ TypescriptSchema = v.object({
582
+ jsxPragma: v.optional(v.string()),
583
+ jsxPragmaFrag: v.optional(v.string()),
584
+ onlyRemoveTypeImports: v.optional(v.boolean()),
585
+ allowNamespaces: v.optional(v.boolean()),
586
+ allowDeclareFields: v.optional(v.boolean()),
587
+ declaration: v.optional(v.object({
588
+ stripInternal: v.optional(v.boolean()),
589
+ sourcemap: v.optional(v.boolean())
590
+ })),
591
+ rewriteImportExtensions: v.optional(RewriteImportExtensionsSchema)
592
+ });
593
+ AssumptionsSchema = v.object({
594
+ ignoreFunctionLength: v.optional(v.boolean()),
595
+ noDocumentAll: v.optional(v.boolean()),
596
+ objectRestNoSymbols: v.optional(v.boolean()),
597
+ pureGetters: v.optional(v.boolean()),
598
+ setPublicClassFields: v.optional(v.boolean())
599
+ });
600
+ TransformOptionsSchema = v.object({
601
+ assumptions: v.optional(AssumptionsSchema),
602
+ typescript: v.optional(TypescriptSchema),
603
+ helpers: v.optional(HelpersSchema),
604
+ decorators: v.optional(DecoratorOptionSchema)
605
+ });
606
+ WatchOptionsSchema = v.strictObject({
607
+ chokidar: v.optional(v.never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
608
+ exclude: v.optional(v.union([StringOrRegExpSchema, v.array(StringOrRegExpSchema)])),
609
+ include: v.optional(v.union([StringOrRegExpSchema, v.array(StringOrRegExpSchema)])),
610
+ notify: v.pipe(v.optional(v.strictObject({
611
+ compareContents: v.optional(v.boolean()),
612
+ pollInterval: v.optional(v.number())
613
+ })), v.description("Notify options")),
614
+ skipWrite: v.pipe(v.optional(v.boolean()), v.description("Skip the bundle.write() step")),
615
+ buildDelay: v.pipe(v.optional(v.number()), v.description("Throttle watch rebuilds"))
616
+ });
617
+ ChecksOptionsSchema = v.strictObject({
618
+ circularDependency: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting circular dependency")),
619
+ eval: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting eval")),
620
+ missingGlobalName: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting missing global name")),
621
+ missingNameOptionForIifeExport: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting missing name option for iife export")),
622
+ mixedExport: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting mixed export")),
623
+ unresolvedEntry: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting unresolved entry")),
624
+ unresolvedImport: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting unresolved import")),
625
+ filenameConflict: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting filename conflict")),
626
+ commonJsVariableInEsm: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting common js variable in esm")),
627
+ importIsUndefined: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting import is undefined")),
628
+ configurationFieldConflict: v.pipe(v.optional(v.boolean()), v.description("Whether to emit warning when detecting configuration field conflict"))
629
+ });
630
+ MinifyOptionsSchema = v.strictObject({
631
+ mangle: v.boolean(),
632
+ compress: v.boolean(),
633
+ deadCodeElimination: v.boolean(),
634
+ removeWhitespace: v.boolean()
635
+ });
636
+ ResolveOptionsSchema = v.strictObject({
637
+ alias: v.optional(v.record(v.string(), v.union([v.string(), v.array(v.string())]))),
638
+ aliasFields: v.optional(v.array(v.array(v.string()))),
639
+ conditionNames: v.optional(v.array(v.string())),
640
+ extensionAlias: v.optional(v.record(v.string(), v.array(v.string()))),
641
+ exportsFields: v.optional(v.array(v.array(v.string()))),
642
+ extensions: v.optional(v.array(v.string())),
643
+ mainFields: v.optional(v.array(v.string())),
644
+ mainFiles: v.optional(v.array(v.string())),
645
+ modules: v.optional(v.array(v.string())),
646
+ symlinks: v.optional(v.boolean()),
647
+ tsconfigFilename: v.optional(v.string())
648
+ });
649
+ TreeshakingOptionsSchema = v.union([v.boolean(), v.looseObject({
650
+ annotations: v.optional(v.boolean()),
651
+ manualPureFunctions: v.optional(v.array(v.string())),
652
+ unknownGlobalSideEffects: v.optional(v.boolean())
653
+ })]);
654
+ OnLogSchema = v.pipe(v.function(), v.args(v.tuple([
655
+ LogLevelSchema,
656
+ RollupLogSchema,
657
+ v.pipe(v.function(), v.args(v.tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])))
658
+ ])));
659
+ OnwarnSchema = v.pipe(v.function(), v.args(v.tuple([RollupLogSchema, v.pipe(v.function(), v.args(v.tuple([v.union([RollupLogWithStringSchema, v.pipe(v.function(), v.returns(RollupLogWithStringSchema))])])))])));
660
+ HmrSchema = v.union([v.boolean(), v.strictObject({
661
+ port: v.optional(v.number()),
662
+ host: v.optional(v.string())
663
+ })]);
664
+ InputOptionsSchema = v.strictObject({
665
+ input: v.optional(InputOptionSchema),
666
+ plugins: v.optional(v.custom(() => true)),
667
+ external: v.optional(ExternalSchema),
668
+ resolve: v.optional(ResolveOptionsSchema),
669
+ cwd: v.pipe(v.optional(v.string()), v.description("Current working directory")),
670
+ platform: v.pipe(v.optional(v.union([
671
+ v.literal("browser"),
672
+ v.literal("neutral"),
673
+ v.literal("node")
674
+ ])), v.description(`Platform for which the code should be generated (node, ${colors.underline("browser")}, neutral)`)),
675
+ shimMissingExports: v.pipe(v.optional(v.boolean()), v.description("Create shim variables for missing exports")),
676
+ treeshake: v.optional(TreeshakingOptionsSchema),
677
+ logLevel: v.pipe(v.optional(LogLevelOptionSchema), v.description(`Log level (${colors.dim("silent")}, ${colors.underline(colors.gray("info"))}, debug, ${colors.yellow("warn")})`)),
678
+ onLog: v.optional(OnLogSchema),
679
+ onwarn: v.optional(OnwarnSchema),
680
+ moduleTypes: v.pipe(v.optional(ModuleTypesSchema), v.description("Module types for customized extensions")),
681
+ experimental: v.optional(v.strictObject({
682
+ disableLiveBindings: v.optional(v.boolean()),
683
+ enableComposingJsPlugins: v.optional(v.boolean()),
684
+ resolveNewUrlToAsset: v.optional(v.boolean()),
685
+ strictExecutionOrder: v.optional(v.boolean()),
686
+ hmr: v.optional(HmrSchema)
687
+ })),
688
+ define: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Define global variables")),
689
+ inject: v.optional(v.record(v.string(), v.union([v.string(), v.tuple([v.string(), v.string()])]))),
690
+ profilerNames: v.optional(v.boolean()),
691
+ jsx: v.optional(v.union([
692
+ v.boolean(),
693
+ JsxOptionsSchema,
694
+ v.string("react"),
695
+ v.string("react-jsx"),
696
+ v.string("preserve")
697
+ ])),
698
+ transform: v.optional(TransformOptionsSchema),
699
+ watch: v.optional(v.union([WatchOptionsSchema, v.literal(false)])),
700
+ dropLabels: v.pipe(v.optional(v.array(v.string())), v.description("Remove labeled statements with these label names")),
701
+ checks: v.optional(ChecksOptionsSchema),
702
+ keepNames: v.pipe(v.optional(v.boolean()), v.description("Keep function/class name"))
703
+ });
704
+ InputCliOverrideSchema = v.strictObject({
705
+ external: v.pipe(v.optional(v.array(v.string())), v.description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
706
+ inject: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Inject import statements on demand")),
707
+ treeshake: v.pipe(v.optional(v.boolean()), v.description("enable treeshaking")),
708
+ jsx: v.pipe(v.optional(JsxOptionsSchema), v.description("enable jsx"))
709
+ });
710
+ InputCliOptionsSchema = v.omit(v.strictObject({
711
+ ...InputOptionsSchema.entries,
712
+ ...InputCliOverrideSchema.entries
713
+ }), [
714
+ "input",
715
+ "plugins",
716
+ "onwarn",
717
+ "onLog",
718
+ "resolve",
719
+ "experimental",
720
+ "profilerNames",
721
+ "watch"
722
+ ]);
723
+ ESTarget = /* @__PURE__ */ function(ESTarget$1) {
724
+ ESTarget$1["ES6"] = "es6";
725
+ ESTarget$1["ES2015"] = "es2015";
726
+ ESTarget$1["ES2016"] = "es2016";
727
+ ESTarget$1["ES2017"] = "es2017";
728
+ ESTarget$1["ES2018"] = "es2018";
729
+ ESTarget$1["ES2019"] = "es2019";
730
+ ESTarget$1["ES2020"] = "es2020";
731
+ ESTarget$1["ES2021"] = "es2021";
732
+ ESTarget$1["ES2022"] = "es2022";
733
+ ESTarget$1["ES2023"] = "es2023";
734
+ ESTarget$1["ES2024"] = "es2024";
735
+ ESTarget$1["ESNext"] = "esnext";
736
+ return ESTarget$1;
737
+ }(ESTarget || {});
738
+ ModuleFormatSchema = v.union([
739
+ v.literal("es"),
740
+ v.literal("cjs"),
741
+ v.literal("esm"),
742
+ v.literal("module"),
743
+ v.literal("commonjs"),
744
+ v.literal("iife"),
745
+ v.literal("umd")
746
+ ]);
747
+ AddonFunctionSchema = v.pipe(v.function(), v.args(v.tuple([v.custom(() => true)])), v.returnsAsync(v.unionAsync([v.string(), v.pipeAsync(v.promise(), v.awaitAsync(), v.string())])));
748
+ ChunkFileNamesSchema = v.union([v.string(), v.pipe(v.function(), v.args(v.tuple([v.custom(() => true)])), v.returns(v.string()))]);
749
+ AssetFileNamesSchema = v.union([v.string(), v.pipe(v.function(), v.args(v.tuple([v.custom(() => true)])), v.returns(v.string()))]);
750
+ SanitizeFileNameSchema = v.union([v.boolean(), v.pipe(v.function(), v.args(v.tuple([v.string()])), v.returns(v.string()))]);
751
+ GlobalsFunctionSchema = v.pipe(v.function(), v.args(v.tuple([v.string()])), v.returns(v.string()));
752
+ AdvancedChunksSchema = v.strictObject({
753
+ minSize: v.optional(v.number()),
754
+ maxSize: v.optional(v.number()),
755
+ minModuleSize: v.optional(v.number()),
756
+ maxModuleSize: v.optional(v.number()),
757
+ minShareCount: v.optional(v.number()),
758
+ groups: v.optional(v.array(v.strictObject({
759
+ name: v.string(),
760
+ test: v.optional(v.union([v.string(), v.instance(RegExp)])),
761
+ priority: v.optional(v.number()),
762
+ minSize: v.optional(v.number()),
763
+ minShareCount: v.optional(v.number()),
764
+ maxSize: v.optional(v.number()),
765
+ minModuleSize: v.optional(v.number()),
766
+ maxModuleSize: v.optional(v.number())
767
+ })))
768
+ });
769
+ OutputOptionsSchema = v.strictObject({
770
+ dir: v.pipe(v.optional(v.string()), v.description("Output directory, defaults to `dist` if `file` is not set")),
771
+ file: v.pipe(v.optional(v.string()), v.description("Single output file")),
772
+ exports: v.pipe(v.optional(v.union([
773
+ v.literal("auto"),
774
+ v.literal("named"),
775
+ v.literal("default"),
776
+ v.literal("none")
777
+ ])), v.description(`Specify a export mode (${colors.underline("auto")}, named, default, none)`)),
778
+ hashCharacters: v.pipe(v.optional(v.union([
779
+ v.literal("base64"),
780
+ v.literal("base36"),
781
+ v.literal("hex")
782
+ ])), v.description("Use the specified character set for file hashes")),
783
+ format: v.pipe(v.optional(ModuleFormatSchema), v.description(`Output format of the generated bundle (supports ${colors.underline("esm")}, cjs, and iife)`)),
784
+ sourcemap: v.pipe(v.optional(v.union([
785
+ v.boolean(),
786
+ v.literal("inline"),
787
+ v.literal("hidden")
788
+ ])), v.description(`Generate sourcemap (\`-s inline\` for inline, or ${colors.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
789
+ sourcemapDebugIds: v.pipe(v.optional(v.boolean()), v.description("Inject sourcemap debug IDs")),
790
+ sourcemapIgnoreList: v.optional(v.union([v.boolean(), v.custom(() => true)])),
791
+ sourcemapPathTransform: v.optional(v.custom(() => true)),
792
+ banner: v.optional(v.union([v.string(), AddonFunctionSchema])),
793
+ footer: v.optional(v.union([v.string(), AddonFunctionSchema])),
794
+ intro: v.optional(v.union([v.string(), AddonFunctionSchema])),
795
+ outro: v.optional(v.union([v.string(), AddonFunctionSchema])),
796
+ extend: v.pipe(v.optional(v.boolean()), v.description("Extend global variable defined by name in IIFE / UMD formats")),
797
+ esModule: v.optional(v.union([v.boolean(), v.literal("if-default-prop")])),
798
+ assetFileNames: v.optional(AssetFileNamesSchema),
799
+ entryFileNames: v.optional(ChunkFileNamesSchema),
800
+ chunkFileNames: v.optional(ChunkFileNamesSchema),
801
+ cssEntryFileNames: v.optional(ChunkFileNamesSchema),
802
+ cssChunkFileNames: v.optional(ChunkFileNamesSchema),
803
+ sanitizeFileName: v.optional(SanitizeFileNameSchema),
804
+ minify: v.pipe(v.optional(v.union([
805
+ v.boolean(),
806
+ v.string("dce-only"),
807
+ MinifyOptionsSchema
808
+ ])), v.description("Minify the bundled file")),
809
+ name: v.pipe(v.optional(v.string()), v.description("Name for UMD / IIFE format outputs")),
810
+ globals: v.pipe(v.optional(v.union([v.record(v.string(), v.string()), GlobalsFunctionSchema])), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
811
+ externalLiveBindings: v.pipe(v.optional(v.boolean()), v.description("external live bindings")),
812
+ inlineDynamicImports: v.pipe(v.optional(v.boolean()), v.description("Inline dynamic imports")),
813
+ advancedChunks: v.optional(AdvancedChunksSchema),
814
+ comments: v.pipe(v.optional(v.union([v.literal("none"), v.literal("preserve-legal")])), v.description("Control comments in the output")),
815
+ target: v.pipe(v.optional(v.enum(ESTarget)), v.description("The JavaScript target environment")),
816
+ plugins: v.optional(v.custom(() => true))
817
+ });
818
+ getAddonDescription = (placement, wrapper) => {
819
+ return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
820
+ };
821
+ OutputCliOverrideSchema = v.strictObject({
822
+ assetFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for asset files")),
823
+ entryFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted entry chunks")),
824
+ chunkFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted secondary chunks")),
825
+ cssEntryFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted css entry chunks")),
826
+ cssChunkFileNames: v.pipe(v.optional(v.string()), v.description("Name pattern for emitted css secondary chunks")),
827
+ sanitizeFileName: v.pipe(v.optional(v.boolean()), v.description("Sanitize file name")),
828
+ banner: v.pipe(v.optional(v.string()), v.description(getAddonDescription("top", "outside"))),
829
+ footer: v.pipe(v.optional(v.string()), v.description(getAddonDescription("bottom", "outside"))),
830
+ intro: v.pipe(v.optional(v.string()), v.description(getAddonDescription("top", "inside"))),
831
+ outro: v.pipe(v.optional(v.string()), v.description(getAddonDescription("bottom", "inside"))),
832
+ esModule: v.pipe(v.optional(v.boolean()), v.description("Always generate `__esModule` marks in non-ESM formats, defaults to `if-default-prop` (use `--no-esModule` to always disable)")),
833
+ globals: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
834
+ advancedChunks: v.pipe(v.optional(v.strictObject({
835
+ minSize: v.pipe(v.optional(v.number()), v.description("Minimum size of the chunk")),
836
+ minShareCount: v.pipe(v.optional(v.number()), v.description("Minimum share count of the chunk"))
837
+ })), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
838
+ minify: v.pipe(v.optional(v.boolean()), v.description("Minify the bundled file"))
839
+ });
840
+ OutputCliOptionsSchema = v.omit(v.strictObject({
841
+ ...OutputOptionsSchema.entries,
842
+ ...OutputCliOverrideSchema.entries
843
+ }), [
844
+ "sourcemapIgnoreList",
845
+ "sourcemapPathTransform",
846
+ "plugins"
847
+ ]);
848
+ CliOptionsSchema = v.strictObject({
849
+ config: v.pipe(v.optional(v.union([v.string(), v.boolean()])), v.description("Path to the config file (default: `rolldown.config.js`)")),
850
+ help: v.pipe(v.optional(v.boolean()), v.description("Show help")),
851
+ version: v.pipe(v.optional(v.boolean()), v.description("Show version number")),
852
+ watch: v.pipe(v.optional(v.boolean()), v.description("Watch files in bundle and rebuild on changes")),
853
+ ...InputCliOptionsSchema.entries,
854
+ ...OutputCliOptionsSchema.entries
855
+ });
856
+ inputHelperMsgRecord = { output: { ignored: true } };
857
+ outputHelperMsgRecord = {};
858
+ } });
859
+
860
+ //#endregion
861
+ //#region src/constants/plugin-context.ts
862
+ var SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF;
863
+ var init_plugin_context$1 = __esm({ "src/constants/plugin-context.ts"() {
864
+ SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF = Symbol("plugin-context-resolve-caller");
865
+ } });
866
+
867
+ //#endregion
868
+ //#region src/options/normalized-input-options.ts
869
+ var NormalizedInputOptionsImpl;
870
+ var init_normalized_input_options = __esm({ "src/options/normalized-input-options.ts"() {
871
+ NormalizedInputOptionsImpl = class {
872
+ inner;
873
+ constructor(inner, onLog) {
874
+ this.onLog = onLog;
875
+ this.inner = inner;
876
+ }
877
+ get shimMissingExports() {
878
+ return this.inner.shimMissingExports;
879
+ }
880
+ get input() {
881
+ return this.inner.input;
882
+ }
883
+ get cwd() {
884
+ return this.inner.cwd ?? void 0;
885
+ }
886
+ get platform() {
887
+ return this.inner.platform;
888
+ }
889
+ };
890
+ } });
891
+
892
+ //#endregion
893
+ //#region src/types/sourcemap.ts
894
+ function bindingifySourcemap(map) {
895
+ if (map == null) return;
896
+ return { inner: typeof map === "string" ? map : {
897
+ file: map.file ?? void 0,
898
+ mappings: map.mappings,
899
+ sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
900
+ sources: map.sources?.map((s$10) => s$10 ?? void 0),
901
+ sourcesContent: map.sourcesContent?.map((s$10) => s$10 ?? void 0),
902
+ names: map.names,
903
+ x_google_ignoreList: map.x_google_ignoreList,
904
+ debugId: "debugId" in map ? map.debugId : void 0
905
+ } };
906
+ }
907
+ var init_sourcemap = __esm({ "src/types/sourcemap.ts"() {} });
908
+
909
+ //#endregion
910
+ //#region src/utils/error.ts
911
+ function normalizeErrors(rawErrors) {
912
+ const errors = rawErrors.map((e$5) => e$5 instanceof Error ? e$5 : Object.assign(new Error(), {
913
+ kind: e$5.kind,
914
+ message: e$5.message,
915
+ stack: void 0
916
+ }));
917
+ let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
918
+ for (let i$21 = 0; i$21 < errors.length; i$21++) {
919
+ summary += "\n";
920
+ if (i$21 >= 5) {
921
+ summary += "...";
922
+ break;
923
+ }
924
+ summary += getErrorMessage(errors[i$21]);
925
+ }
926
+ const wrapper = new Error(summary);
927
+ Object.defineProperty(wrapper, "errors", {
928
+ configurable: true,
929
+ enumerable: true,
930
+ get: () => errors,
931
+ set: (value) => Object.defineProperty(wrapper, "errors", {
932
+ configurable: true,
933
+ enumerable: true,
934
+ value
935
+ })
936
+ });
937
+ return wrapper;
938
+ }
939
+ function getErrorMessage(e$5) {
940
+ if (Object.hasOwn(e$5, "kind")) return e$5.message;
941
+ let s$10 = "";
942
+ if (e$5.plugin) s$10 += `[plugin ${e$5.plugin}]`;
943
+ const id = e$5.id ?? e$5.loc?.file;
944
+ if (id) {
945
+ s$10 += " " + id;
946
+ if (e$5.loc) s$10 += `:${e$5.loc.line}:${e$5.loc.column}`;
947
+ }
948
+ if (s$10) s$10 += "\n";
949
+ const message = `${e$5.name ?? "Error"}: ${e$5.message}`;
950
+ s$10 += message;
951
+ if (e$5.frame) s$10 = joinNewLine(s$10, e$5.frame);
952
+ if (e$5.stack) s$10 = joinNewLine(s$10, e$5.stack.replace(message, ""));
953
+ return s$10;
954
+ }
955
+ function joinNewLine(s1, s2) {
956
+ return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
957
+ }
958
+ var init_error = __esm({ "src/utils/error.ts"() {} });
959
+
960
+ //#endregion
961
+ //#region src/utils/resolved-external.ts
962
+ function transformResolvedExternal(bindingResolvedExternal$1) {
963
+ switch (bindingResolvedExternal$1.type) {
964
+ case "Bool": return bindingResolvedExternal$1.field0;
965
+ case "Absolute": return "absolute";
966
+ case "Relative": unreachable(`The PluginContext resolve result external couldn't be 'relative'`);
967
+ }
968
+ }
969
+ function bindingResolvedExternal(external) {
970
+ if (typeof external === "boolean") return {
971
+ type: "Bool",
972
+ field0: external
973
+ };
974
+ if (external === "absolute") return { type: "Absolute" };
975
+ if (external === "relative") return { type: "Relative" };
976
+ }
977
+ var init_resolved_external = __esm({ "src/utils/resolved-external.ts"() {
978
+ init_misc();
979
+ } });
980
+
981
+ //#endregion
982
+ //#region src/utils/transform-module-info.ts
983
+ function transformModuleInfo(info, option) {
984
+ return {
985
+ get ast() {
986
+ return unsupported("ModuleInfo#ast");
987
+ },
988
+ get code() {
989
+ return info.code;
990
+ },
991
+ id: info.id,
992
+ importers: info.importers,
993
+ dynamicImporters: info.dynamicImporters,
994
+ importedIds: info.importedIds,
995
+ dynamicallyImportedIds: info.dynamicallyImportedIds,
996
+ exports: info.exports,
997
+ isEntry: info.isEntry,
998
+ ...option
999
+ };
1000
+ }
1001
+ var init_transform_module_info = __esm({ "src/utils/transform-module-info.ts"() {
1002
+ init_misc();
1003
+ } });
1004
+
1005
+ //#endregion
1006
+ //#region src/utils/transform-side-effects.ts
1007
+ function bindingifySideEffects(sideEffects) {
1008
+ switch (sideEffects) {
1009
+ case true: return import_binding.BindingHookSideEffects.True;
1010
+ case false: return import_binding.BindingHookSideEffects.False;
1011
+ case "no-treeshake": return import_binding.BindingHookSideEffects.NoTreeshake;
1012
+ case null:
1013
+ case void 0: return void 0;
1014
+ default: throw new Error(`Unexpected side effects: ${sideEffects}`);
1015
+ }
1016
+ }
1017
+ var init_transform_side_effects = __esm({ "src/utils/transform-side-effects.ts"() {} });
1018
+
1019
+ //#endregion
1020
+ //#region src/utils/transform-sourcemap.ts
1021
+ function isEmptySourcemapFiled(array) {
1022
+ if (!array) return true;
1023
+ if (array.length === 0 || !array[0]) return true;
1024
+ return false;
1025
+ }
1026
+ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
1027
+ if (!rawMap) return;
1028
+ let map = typeof rawMap === "object" ? rawMap : JSON.parse(rawMap);
1029
+ if (isEmptySourcemapFiled(map.sourcesContent)) map.sourcesContent = [originalCode];
1030
+ if (isEmptySourcemapFiled(map.sources) || map.sources && map.sources.length === 1 && map.sources[0] !== id) map.sources = [id];
1031
+ return map;
1032
+ }
1033
+ var init_transform_sourcemap = __esm({ "src/utils/transform-sourcemap.ts"() {} });
1034
+
1035
+ //#endregion
1036
+ //#region src/plugin/bindingify-hook-filter.ts
1037
+ function bindingifyStringFilter(matcher) {
1038
+ if (typeof matcher === "string" || matcher instanceof RegExp) return { include: [matcher] };
1039
+ if (Array.isArray(matcher)) return { include: matcher };
1040
+ return {
1041
+ include: matcher.include ? arraify(matcher.include) : void 0,
1042
+ exclude: matcher.exclude ? arraify(matcher.exclude) : void 0
1043
+ };
1044
+ }
1045
+ function bindingifyResolveIdFilter(filterOption) {
1046
+ return filterOption?.id ? bindingifyStringFilter(filterOption.id) : void 0;
1047
+ }
1048
+ function bindingifyLoadFilter(filterOption) {
1049
+ return filterOption?.id ? bindingifyStringFilter(filterOption.id) : void 0;
1050
+ }
1051
+ function bindingifyTransformFilter(filterOption) {
1052
+ if (!filterOption) return void 0;
1053
+ const { id, code, moduleType } = filterOption;
1054
+ let moduleTypeRet;
1055
+ if (moduleType) if (Array.isArray(moduleType)) moduleTypeRet = moduleType;
1056
+ else moduleTypeRet = moduleType.include;
1057
+ return {
1058
+ id: id ? bindingifyStringFilter(id) : void 0,
1059
+ code: code ? bindingifyStringFilter(code) : void 0,
1060
+ moduleType: moduleTypeRet
1061
+ };
1062
+ }
1063
+ var init_bindingify_hook_filter = __esm({ "src/plugin/bindingify-hook-filter.ts"() {
1064
+ init_misc();
1065
+ } });
1066
+
1067
+ //#endregion
1068
+ //#region src/plugin/bindingify-plugin-hook-meta.ts
1069
+ function bindingifyPluginHookMeta(options) {
1070
+ return { order: bindingPluginOrder(options.order) };
1071
+ }
1072
+ function bindingPluginOrder(order) {
1073
+ switch (order) {
1074
+ case "post": return import_binding.BindingPluginOrder.Post;
1075
+ case "pre": return import_binding.BindingPluginOrder.Pre;
1076
+ case null:
1077
+ case void 0: return void 0;
1078
+ default: throw new Error(`Unknown plugin order: ${order}`);
1079
+ }
1080
+ }
1081
+ var init_bindingify_plugin_hook_meta = __esm({ "src/plugin/bindingify-plugin-hook-meta.ts"() {} });
1082
+
1083
+ //#endregion
1084
+ //#region src/utils/asset-source.ts
1085
+ function transformAssetSource(bindingAssetSource$1) {
1086
+ return bindingAssetSource$1.inner;
1087
+ }
1088
+ function bindingAssetSource(source) {
1089
+ return { inner: source };
1090
+ }
1091
+ var init_asset_source = __esm({ "src/utils/asset-source.ts"() {} });
1092
+
1093
+ //#endregion
1094
+ //#region src/plugin/plugin-context.ts
1095
+ var PluginContextImpl;
1096
+ var init_plugin_context = __esm({ "src/plugin/plugin-context.ts"() {
1097
+ init_logging();
1098
+ init_logs();
1099
+ init_parse_ast_index();
1100
+ init_minimal_plugin_context();
1101
+ init_asset_source();
1102
+ init_misc();
1103
+ init_resolved_external();
1104
+ init_transform_side_effects();
1105
+ PluginContextImpl = class extends MinimalPluginContextImpl {
1106
+ getModuleInfo;
1107
+ constructor(outputOptions, context, plugin, data, onLog, logLevel, watchMode, currentLoadingModule) {
1108
+ super(onLog, logLevel, plugin.name, watchMode);
1109
+ this.outputOptions = outputOptions;
1110
+ this.context = context;
1111
+ this.data = data;
1112
+ this.onLog = onLog;
1113
+ this.currentLoadingModule = currentLoadingModule;
1114
+ this.getModuleInfo = (id) => this.data.getModuleInfo(id, context);
1115
+ }
1116
+ async load(options) {
1117
+ const id = options.id;
1118
+ if (id === this.currentLoadingModule) this.onLog(LOG_LEVEL_WARN, logCycleLoading(this.pluginName, this.currentLoadingModule));
1119
+ const moduleInfo = this.data.getModuleInfo(id, this.context);
1120
+ if (moduleInfo && moduleInfo.code !== null) return moduleInfo;
1121
+ const rawOptions = {
1122
+ meta: options.meta || {},
1123
+ moduleSideEffects: options.moduleSideEffects || null,
1124
+ invalidate: false
1125
+ };
1126
+ this.data.updateModuleOption(id, rawOptions);
1127
+ async function createLoadModulePromise(context, data) {
1128
+ const loadPromise = data.loadModulePromiseMap.get(id);
1129
+ if (loadPromise) return loadPromise;
1130
+ let resolveFn;
1131
+ const promise = new Promise((resolve, _) => {
1132
+ resolveFn = resolve;
1133
+ });
1134
+ data.loadModulePromiseMap.set(id, promise);
1135
+ try {
1136
+ await context.load(id, bindingifySideEffects(options.moduleSideEffects), (_success) => {
1137
+ resolveFn();
1138
+ });
1139
+ } finally {
1140
+ data.loadModulePromiseMap.delete(id);
1141
+ }
1142
+ return promise;
1143
+ }
1144
+ await createLoadModulePromise(this.context, this.data);
1145
+ return this.data.getModuleInfo(id, this.context);
1146
+ }
1147
+ async resolve(source, importer, options) {
1148
+ let receipt = void 0;
1149
+ if (options != null) receipt = this.data.saveResolveOptions(options);
1150
+ const res = await this.context.resolve(source, importer, {
1151
+ custom: receipt,
1152
+ skipSelf: options?.skipSelf
1153
+ });
1154
+ if (receipt != null) this.data.removeSavedResolveOptions(receipt);
1155
+ if (res == null) return null;
1156
+ const info = this.data.getModuleOption(res.id) || {};
1157
+ return {
1158
+ ...res,
1159
+ external: transformResolvedExternal(res.external),
1160
+ ...info
1161
+ };
1162
+ }
1163
+ emitFile = (file) => {
1164
+ if (file.type === "prebuilt-chunk") return unimplemented("PluginContext.emitFile with type prebuilt-chunk");
1165
+ if (file.type === "chunk") return this.context.emitChunk(file);
1166
+ const fnSanitizedFileName = file.fileName || typeof this.outputOptions.sanitizeFileName !== "function" ? void 0 : this.outputOptions.sanitizeFileName(file.name || "asset");
1167
+ const filename = file.fileName ? void 0 : this.getAssetFileNames(file);
1168
+ return this.context.emitFile({
1169
+ ...file,
1170
+ originalFileName: file.originalFileName || void 0,
1171
+ source: bindingAssetSource(file.source)
1172
+ }, filename, fnSanitizedFileName);
1173
+ };
1174
+ getAssetFileNames(file) {
1175
+ if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
1176
+ names: file.name ? [file.name] : [],
1177
+ originalFileNames: file.originalFileName ? [file.originalFileName] : [],
1178
+ source: file.source,
1179
+ type: "asset"
1180
+ });
1181
+ }
1182
+ getFileName(referenceId) {
1183
+ return this.context.getFileName(referenceId);
1184
+ }
1185
+ getModuleIds() {
1186
+ return this.data.getModuleIds(this.context);
1187
+ }
1188
+ addWatchFile(id) {
1189
+ this.context.addWatchFile(id);
1190
+ }
1191
+ parse(input, options) {
1192
+ return parseAst(input, options);
1193
+ }
1194
+ };
1195
+ } });
1196
+
1197
+ //#endregion
1198
+ //#region src/plugin/transform-plugin-context.ts
1199
+ var TransformPluginContextImpl;
1200
+ var init_transform_plugin_context = __esm({ "src/plugin/transform-plugin-context.ts"() {
1201
+ init_log_handler();
1202
+ init_logs();
1203
+ init_plugin_context();
1204
+ TransformPluginContextImpl = class extends PluginContextImpl {
1205
+ constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption, watchMode) {
1206
+ super(outputOptions, context, plugin, data, onLog, LogLevelOption, watchMode, moduleId);
1207
+ this.inner = inner;
1208
+ this.moduleId = moduleId;
1209
+ this.moduleSource = moduleSource;
1210
+ const getLogHandler$1 = (handler) => (log, pos) => {
1211
+ log = normalizeLog(log);
1212
+ if (pos) augmentCodeLocation(log, pos, moduleSource, moduleId);
1213
+ log.id = moduleId;
1214
+ log.hook = "transform";
1215
+ handler(log);
1216
+ };
1217
+ this.debug = getLogHandler$1(this.debug);
1218
+ this.warn = getLogHandler$1(this.warn);
1219
+ this.info = getLogHandler$1(this.info);
1220
+ }
1221
+ error(e$5, pos) {
1222
+ if (typeof e$5 === "string") e$5 = { message: e$5 };
1223
+ if (pos) augmentCodeLocation(e$5, pos, this.moduleSource, this.moduleId);
1224
+ e$5.id = this.moduleId;
1225
+ e$5.hook = "transform";
1226
+ return error(logPluginError(normalizeLog(e$5), this.pluginName));
1227
+ }
1228
+ getCombinedSourcemap() {
1229
+ return JSON.parse(this.inner.getCombinedSourcemap());
1230
+ }
1231
+ };
1232
+ } });
1233
+
1234
+ //#endregion
1235
+ //#region src/plugin/bindingify-build-hooks.ts
1236
+ function bindingifyBuildStart(args) {
1237
+ const hook = args.plugin.buildStart;
1238
+ if (!hook) return {};
1239
+ const { handler, meta } = normalizeHook(hook);
1240
+ return {
1241
+ plugin: async (ctx, opts) => {
1242
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedInputOptionsImpl(opts, args.onLog));
1243
+ },
1244
+ meta: bindingifyPluginHookMeta(meta)
1245
+ };
1246
+ }
1247
+ function bindingifyBuildEnd(args) {
1248
+ const hook = args.plugin.buildEnd;
1249
+ if (!hook) return {};
1250
+ const { handler, meta } = normalizeHook(hook);
1251
+ return {
1252
+ plugin: async (ctx, err) => {
1253
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? normalizeErrors(err) : void 0);
1254
+ },
1255
+ meta: bindingifyPluginHookMeta(meta)
1256
+ };
1257
+ }
1258
+ function bindingifyResolveId(args) {
1259
+ const hook = args.plugin.resolveId;
1260
+ if (!hook) return {};
1261
+ const { handler, meta, options } = normalizeHook(hook);
1262
+ return {
1263
+ plugin: async (ctx, specifier, importer, extraOptions) => {
1264
+ const contextResolveOptions = extraOptions.custom != null ? args.pluginContextData.getSavedResolveOptions(extraOptions.custom) : void 0;
1265
+ const newExtraOptions = {
1266
+ ...extraOptions,
1267
+ custom: contextResolveOptions?.custom,
1268
+ [SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]: contextResolveOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]
1269
+ };
1270
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0, newExtraOptions);
1271
+ if (ret == null) return;
1272
+ if (ret === false) return {
1273
+ id: specifier,
1274
+ external: bindingResolvedExternal(true),
1275
+ normalizeExternalId: true
1276
+ };
1277
+ if (typeof ret === "string") return {
1278
+ id: ret,
1279
+ normalizeExternalId: true
1280
+ };
1281
+ let exist = args.pluginContextData.updateModuleOption(ret.id, {
1282
+ meta: ret.meta || {},
1283
+ moduleSideEffects: ret.moduleSideEffects ?? null,
1284
+ invalidate: false
1285
+ });
1286
+ return {
1287
+ id: ret.id,
1288
+ external: bindingResolvedExternal(ret.external),
1289
+ normalizeExternalId: false,
1290
+ sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1291
+ };
1292
+ },
1293
+ meta: bindingifyPluginHookMeta(meta),
1294
+ filter: bindingifyResolveIdFilter(options.filter)
1295
+ };
1296
+ }
1297
+ function bindingifyResolveDynamicImport(args) {
1298
+ const hook = args.plugin.resolveDynamicImport;
1299
+ if (!hook) return {};
1300
+ const { handler, meta } = normalizeHook(hook);
1301
+ return {
1302
+ plugin: async (ctx, specifier, importer) => {
1303
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0);
1304
+ if (ret == null) return;
1305
+ if (ret === false) return {
1306
+ id: specifier,
1307
+ external: bindingResolvedExternal(true)
1308
+ };
1309
+ if (typeof ret === "string") return { id: ret };
1310
+ const result = {
1311
+ id: ret.id,
1312
+ external: bindingResolvedExternal(ret.external)
1313
+ };
1314
+ if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1315
+ args.pluginContextData.updateModuleOption(ret.id, {
1316
+ meta: ret.meta || {},
1317
+ moduleSideEffects: ret.moduleSideEffects || null,
1318
+ invalidate: false
1319
+ });
1320
+ return result;
1321
+ },
1322
+ meta: bindingifyPluginHookMeta(meta)
1323
+ };
1324
+ }
1325
+ function bindingifyTransform(args) {
1326
+ const hook = args.plugin.transform;
1327
+ if (!hook) return {};
1328
+ const { handler, meta, options } = normalizeHook(hook);
1329
+ return {
1330
+ plugin: async (ctx, code, id, meta$1) => {
1331
+ const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel, args.watchMode), code, id, meta$1);
1332
+ if (ret == null) return void 0;
1333
+ if (typeof ret === "string") return { code: ret };
1334
+ let moduleOption = args.pluginContextData.updateModuleOption(id, {
1335
+ meta: ret.meta ?? {},
1336
+ moduleSideEffects: ret.moduleSideEffects ?? null,
1337
+ invalidate: false
1338
+ });
1339
+ return {
1340
+ code: ret.code,
1341
+ map: bindingifySourcemap(normalizeTransformHookSourcemap(id, code, ret.map)),
1342
+ sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
1343
+ moduleType: ret.moduleType
1344
+ };
1345
+ },
1346
+ meta: bindingifyPluginHookMeta(meta),
1347
+ filter: bindingifyTransformFilter(options.filter)
1348
+ };
1349
+ }
1350
+ function bindingifyLoad(args) {
1351
+ const hook = args.plugin.load;
1352
+ if (!hook) return {};
1353
+ const { handler, meta, options } = normalizeHook(hook);
1354
+ return {
1355
+ plugin: async (ctx, id) => {
1356
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode, id), id);
1357
+ if (ret == null) return;
1358
+ if (typeof ret === "string") return { code: ret };
1359
+ let moduleOption = args.pluginContextData.updateModuleOption(id, {
1360
+ meta: ret.meta || {},
1361
+ moduleSideEffects: ret.moduleSideEffects ?? null,
1362
+ invalidate: false
1363
+ });
1364
+ let map = preProcessSourceMap(ret, id);
1365
+ return {
1366
+ code: ret.code,
1367
+ map: bindingifySourcemap(map),
1368
+ moduleType: ret.moduleType,
1369
+ sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
1370
+ };
1371
+ },
1372
+ meta: bindingifyPluginHookMeta(meta),
1373
+ filter: bindingifyLoadFilter(options.filter)
1374
+ };
1375
+ }
1376
+ function preProcessSourceMap(ret, id) {
1377
+ if (!ret.map) return;
1378
+ let map = typeof ret.map === "object" ? ret.map : JSON.parse(ret.map);
1379
+ if (!isEmptySourcemapFiled(map.sources)) {
1380
+ const directory = path.dirname(id) || ".";
1381
+ const sourceRoot = map.sourceRoot || ".";
1382
+ map.sources = map.sources.map((source) => path.resolve(directory, sourceRoot, source));
1383
+ }
1384
+ return map;
1385
+ }
1386
+ function bindingifyModuleParsed(args) {
1387
+ const hook = args.plugin.moduleParsed;
1388
+ if (!hook) return {};
1389
+ const { handler, meta } = normalizeHook(hook);
1390
+ return {
1391
+ plugin: async (ctx, moduleInfo) => {
1392
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
1393
+ },
1394
+ meta: bindingifyPluginHookMeta(meta)
1395
+ };
1396
+ }
1397
+ var init_bindingify_build_hooks = __esm({ "src/plugin/bindingify-build-hooks.ts"() {
1398
+ init_normalize_hook();
1399
+ init_plugin_context$1();
1400
+ init_normalized_input_options();
1401
+ init_sourcemap();
1402
+ init_error();
1403
+ init_resolved_external();
1404
+ init_transform_module_info();
1405
+ init_transform_side_effects();
1406
+ init_transform_sourcemap();
1407
+ init_bindingify_hook_filter();
1408
+ init_bindingify_plugin_hook_meta();
1409
+ init_plugin_context();
1410
+ init_transform_plugin_context();
1411
+ } });
1412
+
1413
+ //#endregion
1414
+ //#region src/utils/transform-rendered-module.ts
1415
+ function transformToRenderedModule(bindingRenderedModule) {
1416
+ return {
1417
+ get code() {
1418
+ return bindingRenderedModule.code;
1419
+ },
1420
+ get renderedLength() {
1421
+ return bindingRenderedModule.code?.length || 0;
1422
+ },
1423
+ get renderedExports() {
1424
+ return bindingRenderedModule.renderedExports;
1425
+ }
1426
+ };
1427
+ }
1428
+ var init_transform_rendered_module = __esm({ "src/utils/transform-rendered-module.ts"() {} });
1429
+
1430
+ //#endregion
1431
+ //#region src/utils/transform-rendered-chunk.ts
1432
+ function transformRenderedChunk(chunk) {
1433
+ let modules = null;
1434
+ return {
1435
+ get name() {
1436
+ return chunk.name;
1437
+ },
1438
+ get isEntry() {
1439
+ return chunk.isEntry;
1440
+ },
1441
+ get isDynamicEntry() {
1442
+ return chunk.isDynamicEntry;
1443
+ },
1444
+ get facadeModuleId() {
1445
+ return chunk.facadeModuleId;
1446
+ },
1447
+ get moduleIds() {
1448
+ return chunk.moduleIds;
1449
+ },
1450
+ get exports() {
1451
+ return chunk.exports;
1452
+ },
1453
+ get fileName() {
1454
+ return chunk.fileName;
1455
+ },
1456
+ get imports() {
1457
+ return chunk.imports;
1458
+ },
1459
+ get dynamicImports() {
1460
+ return chunk.dynamicImports;
1461
+ },
1462
+ get modules() {
1463
+ if (!modules) modules = transformChunkModules(chunk.modules);
1464
+ return modules;
1465
+ }
1466
+ };
1467
+ }
1468
+ function transformChunkModules(modules) {
1469
+ const result = {};
1470
+ for (let i$21 = 0; i$21 < modules.values.length; i$21++) {
1471
+ let key = modules.keys[i$21];
1472
+ const mod = modules.values[i$21];
1473
+ result[key] = transformToRenderedModule(mod);
1474
+ }
1475
+ return result;
1476
+ }
1477
+ var init_transform_rendered_chunk = __esm({ "src/utils/transform-rendered-chunk.ts"() {
1478
+ init_transform_rendered_module();
1479
+ } });
1480
+
1481
+ //#endregion
1482
+ //#region src/utils/bindingify-output-options.ts
1483
+ function bindingifyOutputOptions(outputOptions) {
1484
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName } = outputOptions;
1485
+ return {
1486
+ dir,
1487
+ file: file == null ? void 0 : file,
1488
+ format: bindingifyFormat(format),
1489
+ exports,
1490
+ hashCharacters,
1491
+ sourcemap: bindingifySourcemap$1(sourcemap),
1492
+ sourcemapDebugIds,
1493
+ sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
1494
+ sourcemapPathTransform,
1495
+ banner: bindingifyAddon(banner),
1496
+ footer: bindingifyAddon(footer),
1497
+ intro: bindingifyAddon(intro),
1498
+ outro: bindingifyAddon(outro),
1499
+ extend: outputOptions.extend,
1500
+ globals,
1501
+ esModule,
1502
+ name,
1503
+ assetFileNames: bindingifyAssetFilenames(assetFileNames),
1504
+ entryFileNames,
1505
+ chunkFileNames,
1506
+ cssEntryFileNames,
1507
+ cssChunkFileNames,
1508
+ plugins: [],
1509
+ minify: outputOptions.minify,
1510
+ externalLiveBindings: outputOptions.externalLiveBindings,
1511
+ inlineDynamicImports: outputOptions.inlineDynamicImports,
1512
+ advancedChunks: outputOptions.advancedChunks,
1513
+ polyfillRequire: outputOptions.polyfillRequire,
1514
+ target: outputOptions.target,
1515
+ sanitizeFileName
1516
+ };
1517
+ }
1518
+ function bindingifyAddon(configAddon) {
1519
+ return async (chunk) => {
1520
+ if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
1521
+ return configAddon || "";
1522
+ };
1523
+ }
1524
+ function bindingifyFormat(format) {
1525
+ switch (format) {
1526
+ case void 0:
1527
+ case "es":
1528
+ case "esm":
1529
+ case "module": return "es";
1530
+ case "cjs":
1531
+ case "commonjs": return "cjs";
1532
+ case "iife": return "iife";
1533
+ case "umd": return "umd";
1534
+ case "experimental-app": return "app";
1535
+ default: unimplemented(`output.format: ${format}`);
1536
+ }
1537
+ }
1538
+ function bindingifySourcemap$1(sourcemap) {
1539
+ switch (sourcemap) {
1540
+ case true: return "file";
1541
+ case "inline": return "inline";
1542
+ case false:
1543
+ case void 0: return void 0;
1544
+ case "hidden": return "hidden";
1545
+ default: throw new Error(`unknown sourcemap: ${sourcemap}`);
1546
+ }
1547
+ }
1548
+ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
1549
+ return typeof sourcemapIgnoreList === "function" ? sourcemapIgnoreList : sourcemapIgnoreList === false ? () => false : (relativeSourcePath, _sourcemapPath) => relativeSourcePath.includes("node_modules");
1550
+ }
1551
+ function bindingifyAssetFilenames(assetFileNames) {
1552
+ if (typeof assetFileNames === "function") return (asset) => {
1553
+ return assetFileNames({
1554
+ names: asset.names,
1555
+ originalFileNames: asset.originalFileNames,
1556
+ source: transformAssetSource(asset.source),
1557
+ type: "asset"
1558
+ });
1559
+ };
1560
+ return assetFileNames;
1561
+ }
1562
+ var init_bindingify_output_options = __esm({ "src/utils/bindingify-output-options.ts"() {
1563
+ init_asset_source();
1564
+ init_misc();
1565
+ init_transform_rendered_chunk();
1566
+ } });
1567
+
1568
+ //#endregion
1569
+ //#region src/options/normalized-output-options.ts
1570
+ function normalizeAddon(value) {
1571
+ if (typeof value === "function") return value;
1572
+ return () => value || "";
1573
+ }
1574
+ var NormalizedOutputOptionsImpl;
1575
+ var init_normalized_output_options = __esm({ "src/options/normalized-output-options.ts"() {
1576
+ init_bindingify_output_options();
1577
+ NormalizedOutputOptionsImpl = class {
1578
+ constructor(inner, outputOptions, normalizedOutputPlugins) {
1579
+ this.inner = inner;
1580
+ this.outputOptions = outputOptions;
1581
+ this.normalizedOutputPlugins = normalizedOutputPlugins;
1582
+ }
1583
+ get dir() {
1584
+ return this.inner.dir ?? void 0;
1585
+ }
1586
+ get entryFileNames() {
1587
+ return this.inner.entryFilenames || this.outputOptions.entryFileNames;
1588
+ }
1589
+ get chunkFileNames() {
1590
+ return this.inner.chunkFilenames || this.outputOptions.chunkFileNames;
1591
+ }
1592
+ get assetFileNames() {
1593
+ return this.inner.assetFilenames || this.outputOptions.assetFileNames;
1594
+ }
1595
+ get format() {
1596
+ return this.inner.format;
1597
+ }
1598
+ get exports() {
1599
+ return this.inner.exports;
1600
+ }
1601
+ get sourcemap() {
1602
+ return this.inner.sourcemap;
1603
+ }
1604
+ get cssEntryFileNames() {
1605
+ return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
1606
+ }
1607
+ get cssChunkFileNames() {
1608
+ return this.inner.cssChunkFilenames || this.outputOptions.cssChunkFileNames;
1609
+ }
1610
+ get shimMissingExports() {
1611
+ return this.inner.shimMissingExports;
1612
+ }
1613
+ get name() {
1614
+ return this.inner.name ?? void 0;
1615
+ }
1616
+ get file() {
1617
+ return this.inner.file ?? void 0;
1618
+ }
1619
+ get inlineDynamicImports() {
1620
+ return this.inner.inlineDynamicImports;
1621
+ }
1622
+ get externalLiveBindings() {
1623
+ return this.inner.externalLiveBindings;
1624
+ }
1625
+ get banner() {
1626
+ return normalizeAddon(this.outputOptions.banner);
1627
+ }
1628
+ get footer() {
1629
+ return normalizeAddon(this.outputOptions.footer);
1630
+ }
1631
+ get intro() {
1632
+ return normalizeAddon(this.outputOptions.intro);
1633
+ }
1634
+ get outro() {
1635
+ return normalizeAddon(this.outputOptions.outro);
1636
+ }
1637
+ get esModule() {
1638
+ return this.inner.esModule;
1639
+ }
1640
+ get extend() {
1641
+ return this.inner.extend;
1642
+ }
1643
+ get globals() {
1644
+ return this.inner.globals || this.outputOptions.globals;
1645
+ }
1646
+ get hashCharacters() {
1647
+ return this.inner.hashCharacters;
1648
+ }
1649
+ get sourcemapDebugIds() {
1650
+ return this.inner.sourcemapDebugIds;
1651
+ }
1652
+ get sourcemapIgnoreList() {
1653
+ return bindingifySourcemapIgnoreList(this.outputOptions.sourcemapIgnoreList);
1654
+ }
1655
+ get sourcemapPathTransform() {
1656
+ return this.outputOptions.sourcemapPathTransform;
1657
+ }
1658
+ get minify() {
1659
+ return this.inner.minify;
1660
+ }
1661
+ get comments() {
1662
+ return this.inner.comments;
1663
+ }
1664
+ get polyfillRequire() {
1665
+ return this.inner.polyfillRequire;
1666
+ }
1667
+ get plugins() {
1668
+ return this.normalizedOutputPlugins;
1669
+ }
1670
+ };
1671
+ } });
1672
+
1673
+ //#endregion
1674
+ //#region src/utils/transform-to-rollup-output.ts
1675
+ function transformToRollupSourceMap(map) {
1676
+ const parsed = JSON.parse(map);
1677
+ const obj = {
1678
+ ...parsed,
1679
+ toString() {
1680
+ return JSON.stringify(obj);
1681
+ },
1682
+ toUrl() {
1683
+ return `data:application/json;charset=utf-8;base64,${Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
1684
+ }
1685
+ };
1686
+ return obj;
1687
+ }
1688
+ function transformToRollupOutputChunk(bindingChunk, changed) {
1689
+ const chunk = {
1690
+ type: "chunk",
1691
+ get code() {
1692
+ return bindingChunk.code;
1693
+ },
1694
+ fileName: bindingChunk.fileName,
1695
+ name: bindingChunk.name,
1696
+ get modules() {
1697
+ return transformChunkModules(bindingChunk.modules);
1698
+ },
1699
+ get imports() {
1700
+ return bindingChunk.imports;
1701
+ },
1702
+ get dynamicImports() {
1703
+ return bindingChunk.dynamicImports;
1704
+ },
1705
+ exports: bindingChunk.exports,
1706
+ isEntry: bindingChunk.isEntry,
1707
+ facadeModuleId: bindingChunk.facadeModuleId || null,
1708
+ isDynamicEntry: bindingChunk.isDynamicEntry,
1709
+ get moduleIds() {
1710
+ return bindingChunk.moduleIds;
1711
+ },
1712
+ get map() {
1713
+ return bindingChunk.map ? transformToRollupSourceMap(bindingChunk.map) : null;
1714
+ },
1715
+ sourcemapFileName: bindingChunk.sourcemapFileName || null,
1716
+ preliminaryFileName: bindingChunk.preliminaryFileName
1717
+ };
1718
+ const cache = {};
1719
+ return new Proxy(chunk, {
1720
+ get(target, p$3) {
1721
+ if (p$3 in cache) return cache[p$3];
1722
+ const value = target[p$3];
1723
+ cache[p$3] = value;
1724
+ return value;
1725
+ },
1726
+ set(target, p$3, newValue) {
1727
+ cache[p$3] = newValue;
1728
+ changed?.updated.add(bindingChunk.fileName);
1729
+ return true;
1730
+ },
1731
+ has(target, p$3) {
1732
+ if (p$3 in cache) return true;
1733
+ return p$3 in target;
1734
+ }
1735
+ });
1736
+ }
1737
+ function transformToRollupOutputAsset(bindingAsset, changed) {
1738
+ const asset = {
1739
+ type: "asset",
1740
+ fileName: bindingAsset.fileName,
1741
+ originalFileName: bindingAsset.originalFileName || null,
1742
+ originalFileNames: bindingAsset.originalFileNames,
1743
+ get source() {
1744
+ return transformAssetSource(bindingAsset.source);
1745
+ },
1746
+ name: bindingAsset.name ?? void 0,
1747
+ names: bindingAsset.names
1748
+ };
1749
+ const cache = {};
1750
+ return new Proxy(asset, {
1751
+ get(target, p$3) {
1752
+ if (p$3 in cache) return cache[p$3];
1753
+ const value = target[p$3];
1754
+ cache[p$3] = value;
1755
+ return value;
1756
+ },
1757
+ set(target, p$3, newValue) {
1758
+ cache[p$3] = newValue;
1759
+ changed?.updated.add(bindingAsset.fileName);
1760
+ return true;
1761
+ }
1762
+ });
1763
+ }
1764
+ function transformToRollupOutput(output, changed) {
1765
+ handleOutputErrors(output);
1766
+ const { chunks, assets } = output;
1767
+ return { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk, changed)), ...assets.map((asset) => transformToRollupOutputAsset(asset, changed))] };
1768
+ }
1769
+ function handleOutputErrors(output) {
1770
+ const rawErrors = output.errors;
1771
+ if (rawErrors.length > 0) throw normalizeErrors(rawErrors);
1772
+ }
1773
+ function transformToOutputBundle(output, changed) {
1774
+ const bundle = Object.fromEntries(transformToRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
1775
+ return new Proxy(bundle, { deleteProperty(target, property) {
1776
+ if (typeof property === "string") changed.deleted.add(property);
1777
+ return true;
1778
+ } });
1779
+ }
1780
+ function collectChangedBundle(changed, bundle) {
1781
+ const assets = [];
1782
+ const chunks = [];
1783
+ for (const key in bundle) {
1784
+ if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
1785
+ const item = bundle[key];
1786
+ if (item.type === "asset") assets.push({
1787
+ filename: item.fileName,
1788
+ originalFileNames: item.originalFileNames,
1789
+ source: bindingAssetSource(item.source),
1790
+ names: item.names
1791
+ });
1792
+ else chunks.push({
1793
+ code: item.code,
1794
+ filename: item.fileName,
1795
+ name: item.name,
1796
+ isEntry: item.isEntry,
1797
+ exports: item.exports,
1798
+ modules: {},
1799
+ imports: item.imports,
1800
+ dynamicImports: item.dynamicImports,
1801
+ facadeModuleId: item.facadeModuleId || void 0,
1802
+ isDynamicEntry: item.isDynamicEntry,
1803
+ moduleIds: item.moduleIds,
1804
+ map: bindingifySourcemap(item.map),
1805
+ sourcemapFilename: item.sourcemapFileName || void 0,
1806
+ preliminaryFilename: item.preliminaryFileName
1807
+ });
1808
+ }
1809
+ return {
1810
+ assets,
1811
+ chunks,
1812
+ deleted: Array.from(changed.deleted)
1813
+ };
1814
+ }
1815
+ var init_transform_to_rollup_output = __esm({ "src/utils/transform-to-rollup-output.ts"() {
1816
+ init_sourcemap();
1817
+ init_asset_source();
1818
+ init_error();
1819
+ init_transform_rendered_chunk();
1820
+ } });
1821
+
1822
+ //#endregion
1823
+ //#region src/plugin/bindingify-output-hooks.ts
1824
+ function bindingifyRenderStart(args) {
1825
+ const hook = args.plugin.renderStart;
1826
+ if (!hook) return {};
1827
+ const { handler, meta } = normalizeHook(hook);
1828
+ return {
1829
+ plugin: async (ctx, opts) => {
1830
+ handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
1831
+ },
1832
+ meta: bindingifyPluginHookMeta(meta)
1833
+ };
1834
+ }
1835
+ function bindingifyRenderChunk(args) {
1836
+ const hook = args.plugin.renderChunk;
1837
+ if (!hook) return {};
1838
+ const { handler, meta } = normalizeHook(hook);
1839
+ return {
1840
+ plugin: async (ctx, code, chunk, opts, meta$1) => {
1841
+ if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(meta$1.chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
1842
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), args.pluginContextData.getRenderChunkMeta());
1843
+ if (ret == null) return;
1844
+ if (typeof ret === "string") return { code: ret };
1845
+ if (!ret.map) return { code: ret.code };
1846
+ return {
1847
+ code: ret.code,
1848
+ map: bindingifySourcemap(ret.map)
1849
+ };
1850
+ },
1851
+ meta: bindingifyPluginHookMeta(meta)
1852
+ };
1853
+ }
1854
+ function bindingifyAugmentChunkHash(args) {
1855
+ const hook = args.plugin.augmentChunkHash;
1856
+ if (!hook) return {};
1857
+ const { handler, meta } = normalizeHook(hook);
1858
+ return {
1859
+ plugin: async (ctx, chunk) => {
1860
+ return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1861
+ },
1862
+ meta: bindingifyPluginHookMeta(meta)
1863
+ };
1864
+ }
1865
+ function bindingifyRenderError(args) {
1866
+ const hook = args.plugin.renderError;
1867
+ if (!hook) return {};
1868
+ const { handler, meta } = normalizeHook(hook);
1869
+ return {
1870
+ plugin: async (ctx, err) => {
1871
+ handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), normalizeErrors(err));
1872
+ },
1873
+ meta: bindingifyPluginHookMeta(meta)
1874
+ };
1875
+ }
1876
+ function bindingifyGenerateBundle(args) {
1877
+ const hook = args.plugin.generateBundle;
1878
+ if (!hook) return {};
1879
+ const { handler, meta } = normalizeHook(hook);
1880
+ return {
1881
+ plugin: async (ctx, bundle, isWrite, opts) => {
1882
+ const changed = {
1883
+ updated: new Set(),
1884
+ deleted: new Set()
1885
+ };
1886
+ const output = transformToOutputBundle(bundle, changed);
1887
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
1888
+ return collectChangedBundle(changed, output);
1889
+ },
1890
+ meta: bindingifyPluginHookMeta(meta)
1891
+ };
1892
+ }
1893
+ function bindingifyWriteBundle(args) {
1894
+ const hook = args.plugin.writeBundle;
1895
+ if (!hook) return {};
1896
+ const { handler, meta } = normalizeHook(hook);
1897
+ return {
1898
+ plugin: async (ctx, bundle, opts) => {
1899
+ const changed = {
1900
+ updated: new Set(),
1901
+ deleted: new Set()
1902
+ };
1903
+ const output = transformToOutputBundle(bundle, changed);
1904
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
1905
+ return collectChangedBundle(changed, output);
1906
+ },
1907
+ meta: bindingifyPluginHookMeta(meta)
1908
+ };
1909
+ }
1910
+ function bindingifyCloseBundle(args) {
1911
+ const hook = args.plugin.closeBundle;
1912
+ if (!hook) return {};
1913
+ const { handler, meta } = normalizeHook(hook);
1914
+ return {
1915
+ plugin: async (ctx) => {
1916
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
1917
+ },
1918
+ meta: bindingifyPluginHookMeta(meta)
1919
+ };
1920
+ }
1921
+ function bindingifyBanner(args) {
1922
+ const hook = args.plugin.banner;
1923
+ if (!hook) return {};
1924
+ const { handler, meta } = normalizeHook(hook);
1925
+ return {
1926
+ plugin: async (ctx, chunk) => {
1927
+ if (typeof handler === "string") return handler;
1928
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1929
+ },
1930
+ meta: bindingifyPluginHookMeta(meta)
1931
+ };
1932
+ }
1933
+ function bindingifyFooter(args) {
1934
+ const hook = args.plugin.footer;
1935
+ if (!hook) return {};
1936
+ const { handler, meta } = normalizeHook(hook);
1937
+ return {
1938
+ plugin: async (ctx, chunk) => {
1939
+ if (typeof handler === "string") return handler;
1940
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1941
+ },
1942
+ meta: bindingifyPluginHookMeta(meta)
1943
+ };
1944
+ }
1945
+ function bindingifyIntro(args) {
1946
+ const hook = args.plugin.intro;
1947
+ if (!hook) return {};
1948
+ const { handler, meta } = normalizeHook(hook);
1949
+ return {
1950
+ plugin: async (ctx, chunk) => {
1951
+ if (typeof handler === "string") return handler;
1952
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1953
+ },
1954
+ meta: bindingifyPluginHookMeta(meta)
1955
+ };
1956
+ }
1957
+ function bindingifyOutro(args) {
1958
+ const hook = args.plugin.outro;
1959
+ if (!hook) return {};
1960
+ const { handler, meta } = normalizeHook(hook);
1961
+ return {
1962
+ plugin: async (ctx, chunk) => {
1963
+ if (typeof handler === "string") return handler;
1964
+ return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
1965
+ },
1966
+ meta: bindingifyPluginHookMeta(meta)
1967
+ };
1968
+ }
1969
+ var init_bindingify_output_hooks = __esm({ "src/plugin/bindingify-output-hooks.ts"() {
1970
+ init_normalized_input_options();
1971
+ init_normalized_output_options();
1972
+ init_sourcemap();
1973
+ init_error();
1974
+ init_normalize_hook();
1975
+ init_transform_rendered_chunk();
1976
+ init_transform_to_rollup_output();
1977
+ init_bindingify_plugin_hook_meta();
1978
+ init_plugin_context();
1979
+ } });
1980
+
1981
+ //#endregion
1982
+ //#region src/plugin/bindingify-watch-hooks.ts
1983
+ function bindingifyWatchChange(args) {
1984
+ const hook = args.plugin.watchChange;
1985
+ if (!hook) return {};
1986
+ const { handler, meta } = normalizeHook(hook);
1987
+ return {
1988
+ plugin: async (ctx, id, event) => {
1989
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
1990
+ },
1991
+ meta: bindingifyPluginHookMeta(meta)
1992
+ };
1993
+ }
1994
+ function bindingifyCloseWatcher(args) {
1995
+ const hook = args.plugin.closeWatcher;
1996
+ if (!hook) return {};
1997
+ const { handler, meta } = normalizeHook(hook);
1998
+ return {
1999
+ plugin: async (ctx) => {
2000
+ await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
2001
+ },
2002
+ meta: bindingifyPluginHookMeta(meta)
2003
+ };
2004
+ }
2005
+ var init_bindingify_watch_hooks = __esm({ "src/plugin/bindingify-watch-hooks.ts"() {
2006
+ init_normalize_hook();
2007
+ init_bindingify_plugin_hook_meta();
2008
+ init_plugin_context();
2009
+ } });
2010
+
2011
+ //#endregion
2012
+ //#region src/plugin/bindingify-plugin.ts
2013
+ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
2014
+ const args = {
2015
+ plugin,
2016
+ options,
2017
+ outputOptions,
2018
+ pluginContextData,
2019
+ onLog,
2020
+ logLevel,
2021
+ watchMode,
2022
+ normalizedOutputPlugins
2023
+ };
2024
+ const { plugin: buildStart, meta: buildStartMeta } = bindingifyBuildStart(args);
2025
+ const { plugin: resolveId, meta: resolveIdMeta, filter: resolveIdFilter } = bindingifyResolveId(args);
2026
+ const { plugin: resolveDynamicImport, meta: resolveDynamicImportMeta } = bindingifyResolveDynamicImport(args);
2027
+ const { plugin: buildEnd, meta: buildEndMeta } = bindingifyBuildEnd(args);
2028
+ const { plugin: transform, meta: transformMeta, filter: transformFilter } = bindingifyTransform(args);
2029
+ const { plugin: moduleParsed, meta: moduleParsedMeta } = bindingifyModuleParsed(args);
2030
+ const { plugin: load, meta: loadMeta, filter: loadFilter } = bindingifyLoad(args);
2031
+ const { plugin: renderChunk, meta: renderChunkMeta } = bindingifyRenderChunk(args);
2032
+ const { plugin: augmentChunkHash, meta: augmentChunkHashMeta } = bindingifyAugmentChunkHash(args);
2033
+ const { plugin: renderStart, meta: renderStartMeta } = bindingifyRenderStart(args);
2034
+ const { plugin: renderError, meta: renderErrorMeta } = bindingifyRenderError(args);
2035
+ const { plugin: generateBundle, meta: generateBundleMeta } = bindingifyGenerateBundle(args);
2036
+ const { plugin: writeBundle, meta: writeBundleMeta } = bindingifyWriteBundle(args);
2037
+ const { plugin: closeBundle, meta: closeBundleMeta } = bindingifyCloseBundle(args);
2038
+ const { plugin: banner, meta: bannerMeta } = bindingifyBanner(args);
2039
+ const { plugin: footer, meta: footerMeta } = bindingifyFooter(args);
2040
+ const { plugin: intro, meta: introMeta } = bindingifyIntro(args);
2041
+ const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
2042
+ const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
2043
+ const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
2044
+ const result = {
2045
+ name: plugin.name,
2046
+ buildStart,
2047
+ buildStartMeta,
2048
+ resolveId,
2049
+ resolveIdMeta,
2050
+ resolveIdFilter,
2051
+ resolveDynamicImport,
2052
+ resolveDynamicImportMeta,
2053
+ buildEnd,
2054
+ buildEndMeta,
2055
+ transform,
2056
+ transformMeta,
2057
+ transformFilter,
2058
+ moduleParsed,
2059
+ moduleParsedMeta,
2060
+ load,
2061
+ loadMeta,
2062
+ loadFilter,
2063
+ renderChunk,
2064
+ renderChunkMeta,
2065
+ augmentChunkHash,
2066
+ augmentChunkHashMeta,
2067
+ renderStart,
2068
+ renderStartMeta,
2069
+ renderError,
2070
+ renderErrorMeta,
2071
+ generateBundle,
2072
+ generateBundleMeta,
2073
+ writeBundle,
2074
+ writeBundleMeta,
2075
+ closeBundle,
2076
+ closeBundleMeta,
2077
+ banner,
2078
+ bannerMeta,
2079
+ footer,
2080
+ footerMeta,
2081
+ intro,
2082
+ introMeta,
2083
+ outro,
2084
+ outroMeta,
2085
+ watchChange,
2086
+ watchChangeMeta,
2087
+ closeWatcher,
2088
+ closeWatcherMeta
2089
+ };
2090
+ return wrapHandlers(result);
2091
+ }
2092
+ function wrapHandlers(plugin) {
2093
+ for (const hookName of [
2094
+ "buildStart",
2095
+ "resolveId",
2096
+ "resolveDynamicImport",
2097
+ "buildEnd",
2098
+ "transform",
2099
+ "moduleParsed",
2100
+ "load",
2101
+ "renderChunk",
2102
+ "augmentChunkHash",
2103
+ "renderStart",
2104
+ "renderError",
2105
+ "generateBundle",
2106
+ "writeBundle",
2107
+ "closeBundle",
2108
+ "banner",
2109
+ "footer",
2110
+ "intro",
2111
+ "outro",
2112
+ "watchChange",
2113
+ "closeWatcher"
2114
+ ]) {
2115
+ const handler = plugin[hookName];
2116
+ if (handler) plugin[hookName] = async (...args) => {
2117
+ try {
2118
+ return await handler(...args);
2119
+ } catch (e$5) {
2120
+ return error(logPluginError(e$5, plugin.name, {
2121
+ hook: hookName,
2122
+ id: hookName === "transform" ? args[2] : void 0
2123
+ }));
2124
+ }
2125
+ };
2126
+ }
2127
+ return plugin;
2128
+ }
2129
+ var init_bindingify_plugin = __esm({ "src/plugin/bindingify-plugin.ts"() {
2130
+ init_bindingify_build_hooks();
2131
+ init_bindingify_output_hooks();
2132
+ init_logs();
2133
+ init_bindingify_watch_hooks();
2134
+ } });
2135
+
2136
+ //#endregion
2137
+ //#region src/plugin/plugin-context-data.ts
2138
+ var PluginContextData;
2139
+ var init_plugin_context_data = __esm({ "src/plugin/plugin-context-data.ts"() {
2140
+ init_transform_module_info();
2141
+ PluginContextData = class {
2142
+ moduleOptionMap = new Map();
2143
+ resolveOptionsMap = new Map();
2144
+ loadModulePromiseMap = new Map();
2145
+ meta = null;
2146
+ updateModuleOption(id, option) {
2147
+ const existing = this.moduleOptionMap.get(id);
2148
+ if (existing) {
2149
+ if (option.moduleSideEffects != null) existing.moduleSideEffects = option.moduleSideEffects;
2150
+ if (option.meta != null) Object.assign(existing.meta, option.meta);
2151
+ if (option.invalidate != null) existing.invalidate = option.invalidate;
2152
+ } else {
2153
+ this.moduleOptionMap.set(id, option);
2154
+ return option;
2155
+ }
2156
+ return existing;
2157
+ }
2158
+ getModuleOption(id) {
2159
+ const option = this.moduleOptionMap.get(id);
2160
+ if (!option) {
2161
+ const raw = {
2162
+ moduleSideEffects: null,
2163
+ meta: {}
2164
+ };
2165
+ this.moduleOptionMap.set(id, raw);
2166
+ return raw;
2167
+ }
2168
+ return option;
2169
+ }
2170
+ getModuleInfo(id, context) {
2171
+ const bindingInfo = context.getModuleInfo(id);
2172
+ if (bindingInfo) {
2173
+ const info = transformModuleInfo(bindingInfo, this.getModuleOption(id));
2174
+ return this.proxyModuleInfo(id, info);
2175
+ }
2176
+ return null;
2177
+ }
2178
+ proxyModuleInfo(id, info) {
2179
+ let moduleSideEffects = info.moduleSideEffects;
2180
+ Object.defineProperty(info, "moduleSideEffects", {
2181
+ get() {
2182
+ return moduleSideEffects;
2183
+ },
2184
+ set: (v$1) => {
2185
+ this.updateModuleOption(id, {
2186
+ moduleSideEffects: v$1,
2187
+ meta: info.meta,
2188
+ invalidate: true
2189
+ });
2190
+ moduleSideEffects = v$1;
2191
+ }
2192
+ });
2193
+ return info;
2194
+ }
2195
+ getModuleIds(context) {
2196
+ const moduleIds = context.getModuleIds();
2197
+ return moduleIds.values();
2198
+ }
2199
+ saveResolveOptions(options) {
2200
+ const index = this.resolveOptionsMap.size;
2201
+ this.resolveOptionsMap.set(index, options);
2202
+ return index;
2203
+ }
2204
+ getSavedResolveOptions(receipt) {
2205
+ return this.resolveOptionsMap.get(receipt);
2206
+ }
2207
+ removeSavedResolveOptions(receipt) {
2208
+ this.resolveOptionsMap.delete(receipt);
2209
+ }
2210
+ setRenderChunkMeta(meta) {
2211
+ this.meta = meta;
2212
+ }
2213
+ getRenderChunkMeta() {
2214
+ return this.meta;
2215
+ }
2216
+ };
2217
+ } });
2218
+
2219
+ //#endregion
2220
+ //#region src/utils/normalize-string-or-regex.ts
2221
+ function normalizedStringOrRegex(pattern) {
2222
+ if (!pattern) return void 0;
2223
+ if (!Array.isArray(pattern)) pattern = [pattern];
2224
+ return pattern;
2225
+ }
2226
+ var init_normalize_string_or_regex = __esm({ "src/utils/normalize-string-or-regex.ts"() {} });
2227
+
2228
+ //#endregion
2229
+ //#region src/utils/bindingify-input-options.ts
2230
+ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
2231
+ const pluginContextData = new PluginContextData();
2232
+ const plugins = rawPlugins.map((plugin) => {
2233
+ if ("_parallel" in plugin) return void 0;
2234
+ if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
2235
+ return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
2236
+ });
2237
+ return {
2238
+ input: bindingifyInput(inputOptions.input),
2239
+ plugins,
2240
+ cwd: inputOptions.cwd ?? process.cwd(),
2241
+ external: bindingifyExternal(inputOptions.external),
2242
+ resolve: bindingifyResolve(inputOptions.resolve),
2243
+ platform: inputOptions.platform,
2244
+ shimMissingExports: inputOptions.shimMissingExports,
2245
+ logLevel: bindingifyLogLevel(logLevel),
2246
+ onLog,
2247
+ treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
2248
+ moduleTypes: inputOptions.moduleTypes,
2249
+ define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
2250
+ inject: bindingifyInject(inputOptions.inject),
2251
+ experimental: {
2252
+ strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
2253
+ disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
2254
+ viteMode: inputOptions.experimental?.viteMode,
2255
+ resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
2256
+ hmr: bindingifyHmr(inputOptions.experimental?.hmr)
2257
+ },
2258
+ profilerNames: inputOptions?.profilerNames,
2259
+ jsx: bindingifyJsx(inputOptions.jsx),
2260
+ transform: inputOptions.transform,
2261
+ watch: bindingifyWatch(inputOptions.watch),
2262
+ dropLabels: inputOptions.dropLabels,
2263
+ keepNames: inputOptions.keepNames,
2264
+ checks: inputOptions.checks,
2265
+ deferSyncScanData: () => {
2266
+ let ret = [];
2267
+ pluginContextData.moduleOptionMap.forEach((value, key) => {
2268
+ if (value.invalidate) ret.push({
2269
+ id: key,
2270
+ sideEffects: bindingifySideEffects(value.moduleSideEffects)
2271
+ });
2272
+ });
2273
+ return ret;
2274
+ },
2275
+ makeAbsoluteExternalsRelative: bindingifyMakeAbsoluteExternalsRelative(inputOptions.makeAbsoluteExternalsRelative)
2276
+ };
2277
+ }
2278
+ function bindingifyHmr(hmr) {
2279
+ if (hmr) {
2280
+ if (typeof hmr === "boolean") return hmr ? {} : void 0;
2281
+ return hmr;
2282
+ }
2283
+ }
2284
+ function bindingifyExternal(external) {
2285
+ if (external) {
2286
+ if (typeof external === "function") return (id, importer, isResolved) => {
2287
+ if (id.startsWith("\0")) return false;
2288
+ return external(id, importer, isResolved) ?? false;
2289
+ };
2290
+ const externalArr = arraify(external);
2291
+ return (id, _importer, _isResolved) => {
2292
+ return externalArr.some((pat) => {
2293
+ if (pat instanceof RegExp) return pat.test(id);
2294
+ return id === pat;
2295
+ });
2296
+ };
2297
+ }
2298
+ }
2299
+ function bindingifyResolve(resolve) {
2300
+ if (resolve) {
2301
+ const { alias, extensionAlias,...rest } = resolve;
2302
+ return {
2303
+ alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
2304
+ find: name,
2305
+ replacements: arraify(replacement)
2306
+ })) : void 0,
2307
+ extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
2308
+ target: name,
2309
+ replacements: value
2310
+ })) : void 0,
2311
+ ...rest
2312
+ };
2313
+ }
2314
+ }
2315
+ function bindingifyInject(inject) {
2316
+ if (inject) return Object.entries(inject).map(([alias, item]) => {
2317
+ if (Array.isArray(item)) {
2318
+ if (item[1] === "*") return {
2319
+ tagNamespace: true,
2320
+ alias,
2321
+ from: item[0]
2322
+ };
2323
+ return {
2324
+ tagNamed: true,
2325
+ alias,
2326
+ from: item[0],
2327
+ imported: item[1]
2328
+ };
2329
+ } else return {
2330
+ tagNamed: true,
2331
+ imported: "default",
2332
+ alias,
2333
+ from: item
2334
+ };
2335
+ });
2336
+ }
2337
+ function bindingifyLogLevel(logLevel) {
2338
+ switch (logLevel) {
2339
+ case "silent": return import_binding.BindingLogLevel.Silent;
2340
+ case "debug": return import_binding.BindingLogLevel.Debug;
2341
+ case "warn": return import_binding.BindingLogLevel.Warn;
2342
+ case "info": return import_binding.BindingLogLevel.Info;
2343
+ default: throw new Error(`Unexpected log level: ${logLevel}`);
2344
+ }
2345
+ }
2346
+ function bindingifyInput(input) {
2347
+ if (input === void 0) return [];
2348
+ if (typeof input === "string") return [{ import: input }];
2349
+ if (Array.isArray(input)) return input.map((src) => ({ import: src }));
2350
+ return Object.entries(input).map(([name, import_path]) => {
2351
+ return {
2352
+ name,
2353
+ import: import_path
2354
+ };
2355
+ });
2356
+ }
2357
+ function bindingifyJsx(input) {
2358
+ switch (input) {
2359
+ case false: return { type: "Disable" };
2360
+ case "react": return { type: "React" };
2361
+ case "react-jsx": return { type: "ReactJsx" };
2362
+ case "preserve": return { type: "Preserve" };
2363
+ case void 0: return void 0;
2364
+ }
2365
+ if (input.mode === "preserve") return { type: "Preserve" };
2366
+ const mode = input.mode ?? "automatic";
2367
+ return {
2368
+ type: "Enable",
2369
+ field0: {
2370
+ runtime: mode,
2371
+ importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0,
2372
+ pragma: input.factory,
2373
+ pragmaFrag: input.fragment,
2374
+ development: input.development,
2375
+ refresh: input.refresh
2376
+ }
2377
+ };
2378
+ }
2379
+ function bindingifyWatch(watch$1) {
2380
+ if (watch$1) return {
2381
+ buildDelay: watch$1.buildDelay,
2382
+ skipWrite: watch$1.skipWrite,
2383
+ include: normalizedStringOrRegex(watch$1.include),
2384
+ exclude: normalizedStringOrRegex(watch$1.exclude)
2385
+ };
2386
+ }
2387
+ function bindingifyTreeshakeOptions(config) {
2388
+ if (config === false) return void 0;
2389
+ if (config === true || config === void 0) return { moduleSideEffects: true };
2390
+ let normalizedConfig = {
2391
+ moduleSideEffects: true,
2392
+ annotations: config.annotations,
2393
+ manualPureFunctions: config.manualPureFunctions,
2394
+ unknownGlobalSideEffects: config.unknownGlobalSideEffects
2395
+ };
2396
+ if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
2397
+ else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
2398
+ external: true,
2399
+ sideEffects: false
2400
+ }, {
2401
+ external: false,
2402
+ sideEffects: true
2403
+ }];
2404
+ else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
2405
+ return normalizedConfig;
2406
+ }
2407
+ function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative) {
2408
+ if (makeAbsoluteExternalsRelative === "ifRelativeSource") return { type: "IfRelativeSource" };
2409
+ if (typeof makeAbsoluteExternalsRelative === "boolean") return {
2410
+ type: "Bool",
2411
+ field0: makeAbsoluteExternalsRelative
2412
+ };
2413
+ }
2414
+ var init_bindingify_input_options = __esm({ "src/utils/bindingify-input-options.ts"() {
2415
+ init_constructors();
2416
+ init_utils();
2417
+ init_bindingify_plugin();
2418
+ init_plugin_context_data();
2419
+ init_misc();
2420
+ init_normalize_string_or_regex();
2421
+ init_transform_side_effects();
2422
+ } });
2423
+
2424
+ //#endregion
2425
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ANXBDSUI.js
2426
+ var init_chunk_ANXBDSUI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ANXBDSUI.js"() {} });
2427
+
2428
+ //#endregion
2429
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3GOCSNFN.js
2430
+ var init_chunk_3GOCSNFN = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3GOCSNFN.js"() {
2431
+ init_chunk_ANXBDSUI();
2432
+ } });
2433
+
2434
+ //#endregion
2435
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LFJW7BOT.js
2436
+ var init_chunk_LFJW7BOT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LFJW7BOT.js"() {
2437
+ init_chunk_3GOCSNFN();
2438
+ } });
2439
+
2440
+ //#endregion
2441
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7ZI6JRPB.js
2442
+ var init_chunk_7ZI6JRPB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7ZI6JRPB.js"() {
2443
+ init_chunk_LFJW7BOT();
2444
+ init_chunk_ANXBDSUI();
2445
+ } });
2446
+
2447
+ //#endregion
2448
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OXJMERKM.js
2449
+ var init_chunk_OXJMERKM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OXJMERKM.js"() {
2450
+ init_chunk_LFJW7BOT();
2451
+ init_chunk_ANXBDSUI();
2452
+ } });
2453
+
2454
+ //#endregion
2455
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-D6FCK2GA.js
2456
+ function u$13(o$12, n$7, a$15) {
2457
+ let t$14 = (r$12) => o$12(r$12, ...n$7);
2458
+ return a$15 === void 0 ? t$14 : Object.assign(t$14, {
2459
+ lazy: a$15,
2460
+ lazyArgs: n$7
2461
+ });
2462
+ }
2463
+ var init_chunk_D6FCK2GA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-D6FCK2GA.js"() {} });
2464
+
2465
+ //#endregion
2466
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WIMGWYZL.js
2467
+ function u$11(r$12, n$7, o$12) {
2468
+ let a$15 = r$12.length - n$7.length;
2469
+ if (a$15 === 0) return r$12(...n$7);
2470
+ if (a$15 === 1) return u$13(r$12, n$7, o$12);
2471
+ throw new Error("Wrong number of arguments");
2472
+ }
2473
+ var init_chunk_WIMGWYZL = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WIMGWYZL.js"() {
2474
+ init_chunk_D6FCK2GA();
2475
+ } });
2476
+
2477
+ //#endregion
2478
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BSLJB6JE.js
2479
+ var init_chunk_BSLJB6JE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BSLJB6JE.js"() {
2480
+ init_chunk_WIMGWYZL();
2481
+ } });
2482
+
2483
+ //#endregion
2484
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NJXNQM3G.js
2485
+ var init_chunk_NJXNQM3G = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NJXNQM3G.js"() {} });
2486
+
2487
+ //#endregion
2488
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RKHJ2CP.js
2489
+ var init_chunk_6RKHJ2CP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RKHJ2CP.js"() {
2490
+ init_chunk_WIMGWYZL();
2491
+ } });
2492
+
2493
+ //#endregion
2494
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QDGUNRDA.js
2495
+ var init_chunk_QDGUNRDA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QDGUNRDA.js"() {
2496
+ init_chunk_D6FCK2GA();
2497
+ } });
2498
+
2499
+ //#endregion
2500
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MYLLMFC7.js
2501
+ var init_chunk_MYLLMFC7 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MYLLMFC7.js"() {
2502
+ init_chunk_WIMGWYZL();
2503
+ } });
2504
+
2505
+ //#endregion
2506
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DEVKGLTN.js
2507
+ var o$11, c$3, i$20;
2508
+ var init_chunk_DEVKGLTN = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DEVKGLTN.js"() {
2509
+ o$11 = [
2510
+ " ",
2511
+ `
2512
+ `,
2513
+ "\v",
2514
+ "\f",
2515
+ "\r",
2516
+ " ",
2517
+ "…",
2518
+ "\xA0",
2519
+ " ",
2520
+ " ",
2521
+ " ",
2522
+ " ",
2523
+ " ",
2524
+ " ",
2525
+ " ",
2526
+ " ",
2527
+ " ",
2528
+ " ",
2529
+ " ",
2530
+ " ",
2531
+ "\u2028",
2532
+ "\u2029",
2533
+ " ",
2534
+ " ",
2535
+ " ",
2536
+ ""
2537
+ ], c$3 = new Set([
2538
+ "-",
2539
+ "_",
2540
+ ...o$11
2541
+ ]), i$20 = (r$12) => {
2542
+ let e$5 = [], t$14 = "", u$14 = () => {
2543
+ t$14.length > 0 && (e$5.push(t$14), t$14 = "");
2544
+ };
2545
+ for (let s$10 of r$12) {
2546
+ if (c$3.has(s$10)) {
2547
+ u$14();
2548
+ continue;
2549
+ }
2550
+ if (/[a-z]$/u.test(t$14) && /[A-Z]/u.test(s$10)) u$14();
2551
+ else if (/[A-Z][A-Z]$/u.test(t$14) && /[a-z]/u.test(s$10)) {
2552
+ let n$7 = t$14.slice(-1);
2553
+ t$14 = t$14.slice(0, -1), u$14(), t$14 = n$7;
2554
+ } else /\d$/u.test(t$14) !== /\d/u.test(s$10) && u$14();
2555
+ t$14 += s$10;
2556
+ }
2557
+ return u$14(), e$5;
2558
+ };
2559
+ } });
2560
+
2561
+ //#endregion
2562
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-N4JUOEMS.js
2563
+ var init_chunk_N4JUOEMS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-N4JUOEMS.js"() {
2564
+ init_chunk_DEVKGLTN();
2565
+ } });
2566
+
2567
+ //#endregion
2568
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YRJ25UV2.js
2569
+ var init_chunk_YRJ25UV2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YRJ25UV2.js"() {
2570
+ init_chunk_DEVKGLTN();
2571
+ init_chunk_WIMGWYZL();
2572
+ } });
2573
+
2574
+ //#endregion
2575
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Q5ASJ5N7.js
2576
+ var init_chunk_Q5ASJ5N7 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Q5ASJ5N7.js"() {
2577
+ init_chunk_WIMGWYZL();
2578
+ } });
2579
+
2580
+ //#endregion
2581
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WZOX4VKU.js
2582
+ var init_chunk_WZOX4VKU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WZOX4VKU.js"() {
2583
+ init_chunk_DEVKGLTN();
2584
+ init_chunk_WIMGWYZL();
2585
+ } });
2586
+
2587
+ //#endregion
2588
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Y3VKZ3P5.js
2589
+ var init_chunk_Y3VKZ3P5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-Y3VKZ3P5.js"() {
2590
+ init_chunk_WIMGWYZL();
2591
+ } });
2592
+
2593
+ //#endregion
2594
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZRKG4NSC.js
2595
+ var init_chunk_ZRKG4NSC = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZRKG4NSC.js"() {
2596
+ init_chunk_WIMGWYZL();
2597
+ } });
2598
+
2599
+ //#endregion
2600
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJLMYOTX.js
2601
+ var init_chunk_QJLMYOTX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJLMYOTX.js"() {
2602
+ init_chunk_LFJW7BOT();
2603
+ init_chunk_ANXBDSUI();
2604
+ } });
2605
+
2606
+ //#endregion
2607
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DM52TTEP.js
2608
+ var init_chunk_DM52TTEP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DM52TTEP.js"() {
2609
+ init_chunk_WIMGWYZL();
2610
+ } });
2611
+
2612
+ //#endregion
2613
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2P44HXVH.js
2614
+ var init_chunk_2P44HXVH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2P44HXVH.js"() {
2615
+ init_chunk_WIMGWYZL();
2616
+ } });
2617
+
2618
+ //#endregion
2619
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZJS5DNQW.js
2620
+ var init_chunk_ZJS5DNQW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZJS5DNQW.js"() {
2621
+ init_chunk_ANXBDSUI();
2622
+ init_chunk_WIMGWYZL();
2623
+ } });
2624
+
2625
+ //#endregion
2626
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DH3BPT6T.js
2627
+ var init_chunk_DH3BPT6T = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DH3BPT6T.js"() {} });
2628
+
2629
+ //#endregion
2630
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OAMXQXGR.js
2631
+ var init_chunk_OAMXQXGR = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OAMXQXGR.js"() {
2632
+ init_chunk_WIMGWYZL();
2633
+ } });
2634
+
2635
+ //#endregion
2636
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P5WDBFN2.js
2637
+ var init_chunk_P5WDBFN2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P5WDBFN2.js"() {
2638
+ init_chunk_DH3BPT6T();
2639
+ init_chunk_OAMXQXGR();
2640
+ } });
2641
+
2642
+ //#endregion
2643
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EMIEIAAH.js
2644
+ var init_chunk_EMIEIAAH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EMIEIAAH.js"() {} });
2645
+
2646
+ //#endregion
2647
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-AHDTEY6L.js
2648
+ var init_chunk_AHDTEY6L = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-AHDTEY6L.js"() {
2649
+ init_chunk_P5WDBFN2();
2650
+ init_chunk_EMIEIAAH();
2651
+ } });
2652
+
2653
+ //#endregion
2654
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4UEQNEAO.js
2655
+ var init_chunk_4UEQNEAO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4UEQNEAO.js"() {
2656
+ init_chunk_WIMGWYZL();
2657
+ } });
2658
+
2659
+ //#endregion
2660
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4PLMLCP.js
2661
+ var init_chunk_T4PLMLCP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4PLMLCP.js"() {
2662
+ init_chunk_WIMGWYZL();
2663
+ } });
2664
+
2665
+ //#endregion
2666
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SSDL7ATG.js
2667
+ var init_chunk_SSDL7ATG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SSDL7ATG.js"() {
2668
+ init_chunk_WIMGWYZL();
2669
+ } });
2670
+
2671
+ //#endregion
2672
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EVIH3PFY.js
2673
+ var init_chunk_EVIH3PFY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EVIH3PFY.js"() {
2674
+ init_chunk_WIMGWYZL();
2675
+ } });
2676
+
2677
+ //#endregion
2678
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RBODUO3Q.js
2679
+ var init_chunk_RBODUO3Q = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RBODUO3Q.js"() {} });
2680
+
2681
+ //#endregion
2682
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-S52RID4A.js
2683
+ var init_chunk_S52RID4A = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-S52RID4A.js"() {
2684
+ init_chunk_WIMGWYZL();
2685
+ } });
2686
+
2687
+ //#endregion
2688
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WWPMIW33.js
2689
+ var init_chunk_WWPMIW33 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WWPMIW33.js"() {
2690
+ init_chunk_WIMGWYZL();
2691
+ } });
2692
+
2693
+ //#endregion
2694
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-57KROWWS.js
2695
+ var init_chunk_57KROWWS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-57KROWWS.js"() {
2696
+ init_chunk_WIMGWYZL();
2697
+ } });
2698
+
2699
+ //#endregion
2700
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-V6HCOU6T.js
2701
+ var init_chunk_V6HCOU6T = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-V6HCOU6T.js"() {} });
2702
+
2703
+ //#endregion
2704
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ALS6JP7S.js
2705
+ var init_chunk_ALS6JP7S = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ALS6JP7S.js"() {
2706
+ init_chunk_WIMGWYZL();
2707
+ } });
2708
+
2709
+ //#endregion
2710
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QTQTP2VB.js
2711
+ var init_chunk_QTQTP2VB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QTQTP2VB.js"() {
2712
+ init_chunk_WIMGWYZL();
2713
+ } });
2714
+
2715
+ //#endregion
2716
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NFFV4IQT.js
2717
+ var init_chunk_NFFV4IQT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NFFV4IQT.js"() {
2718
+ init_chunk_WIMGWYZL();
2719
+ } });
2720
+
2721
+ //#endregion
2722
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FDH4IRIM.js
2723
+ var init_chunk_FDH4IRIM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FDH4IRIM.js"() {
2724
+ init_chunk_EMIEIAAH();
2725
+ } });
2726
+
2727
+ //#endregion
2728
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QEKOZYJ5.js
2729
+ var init_chunk_QEKOZYJ5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QEKOZYJ5.js"() {} });
2730
+
2731
+ //#endregion
2732
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YDIA5YQI.js
2733
+ var init_chunk_YDIA5YQI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YDIA5YQI.js"() {
2734
+ init_chunk_QEKOZYJ5();
2735
+ init_chunk_WIMGWYZL();
2736
+ } });
2737
+
2738
+ //#endregion
2739
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6OEKBHIX.js
2740
+ var init_chunk_6OEKBHIX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6OEKBHIX.js"() {
2741
+ init_chunk_QEKOZYJ5();
2742
+ init_chunk_WIMGWYZL();
2743
+ } });
2744
+
2745
+ //#endregion
2746
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GDGEDZJG.js
2747
+ var init_chunk_GDGEDZJG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GDGEDZJG.js"() {
2748
+ init_chunk_QEKOZYJ5();
2749
+ init_chunk_WIMGWYZL();
2750
+ } });
2751
+
2752
+ //#endregion
2753
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XE3XIKTJ.js
2754
+ var init_chunk_XE3XIKTJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XE3XIKTJ.js"() {
2755
+ init_chunk_QEKOZYJ5();
2756
+ init_chunk_WIMGWYZL();
2757
+ } });
2758
+
2759
+ //#endregion
2760
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HVJXDSOP.js
2761
+ var init_chunk_HVJXDSOP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HVJXDSOP.js"() {
2762
+ init_chunk_QEKOZYJ5();
2763
+ init_chunk_WIMGWYZL();
2764
+ } });
2765
+
2766
+ //#endregion
2767
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MSOX5OUI.js
2768
+ var init_chunk_MSOX5OUI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MSOX5OUI.js"() {
2769
+ init_chunk_WIMGWYZL();
2770
+ } });
2771
+
2772
+ //#endregion
2773
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C4OZY4Z2.js
2774
+ var init_chunk_C4OZY4Z2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C4OZY4Z2.js"() {
2775
+ init_chunk_WIMGWYZL();
2776
+ } });
2777
+
2778
+ //#endregion
2779
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P2PQB7KO.js
2780
+ var init_chunk_P2PQB7KO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P2PQB7KO.js"() {
2781
+ init_chunk_WIMGWYZL();
2782
+ } });
2783
+
2784
+ //#endregion
2785
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FZHIMCK6.js
2786
+ var init_chunk_FZHIMCK6 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FZHIMCK6.js"() {} });
2787
+
2788
+ //#endregion
2789
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHZ33J57.js
2790
+ var init_chunk_UHZ33J57 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHZ33J57.js"() {
2791
+ init_chunk_FZHIMCK6();
2792
+ init_chunk_WIMGWYZL();
2793
+ } });
2794
+
2795
+ //#endregion
2796
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RL33UFT.js
2797
+ var init_chunk_6RL33UFT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6RL33UFT.js"() {
2798
+ init_chunk_WIMGWYZL();
2799
+ } });
2800
+
2801
+ //#endregion
2802
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YNNF733L.js
2803
+ var init_chunk_YNNF733L = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YNNF733L.js"() {
2804
+ init_chunk_WIMGWYZL();
2805
+ } });
2806
+
2807
+ //#endregion
2808
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4YLWJIJ6.js
2809
+ var init_chunk_4YLWJIJ6 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4YLWJIJ6.js"() {
2810
+ init_chunk_WIMGWYZL();
2811
+ } });
2812
+
2813
+ //#endregion
2814
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KVHF7QRD.js
2815
+ var init_chunk_KVHF7QRD = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KVHF7QRD.js"() {
2816
+ init_chunk_WIMGWYZL();
2817
+ } });
2818
+
2819
+ //#endregion
2820
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UA6DVSZ3.js
2821
+ var init_chunk_UA6DVSZ3 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UA6DVSZ3.js"() {} });
2822
+
2823
+ //#endregion
2824
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-G5B2IDWB.js
2825
+ var init_chunk_G5B2IDWB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-G5B2IDWB.js"() {
2826
+ init_chunk_WIMGWYZL();
2827
+ } });
2828
+
2829
+ //#endregion
2830
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3FKP6OOU.js
2831
+ var init_chunk_3FKP6OOU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3FKP6OOU.js"() {
2832
+ init_chunk_WIMGWYZL();
2833
+ } });
2834
+
2835
+ //#endregion
2836
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFSOOVKJ.js
2837
+ var init_chunk_VFSOOVKJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFSOOVKJ.js"() {} });
2838
+
2839
+ //#endregion
2840
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K3UJMX27.js
2841
+ var init_chunk_K3UJMX27 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K3UJMX27.js"() {} });
2842
+
2843
+ //#endregion
2844
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LE6I3KC6.js
2845
+ var init_chunk_LE6I3KC6 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-LE6I3KC6.js"() {
2846
+ init_chunk_WIMGWYZL();
2847
+ } });
2848
+
2849
+ //#endregion
2850
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENS7GPLZ.js
2851
+ var init_chunk_ENS7GPLZ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENS7GPLZ.js"() {
2852
+ init_chunk_WIMGWYZL();
2853
+ } });
2854
+
2855
+ //#endregion
2856
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DSLWSGID.js
2857
+ var init_chunk_DSLWSGID = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DSLWSGID.js"() {
2858
+ init_chunk_EMIEIAAH();
2859
+ } });
2860
+
2861
+ //#endregion
2862
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R72GEKLP.js
2863
+ var init_chunk_R72GEKLP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R72GEKLP.js"() {} });
2864
+
2865
+ //#endregion
2866
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3IFJP4R5.js
2867
+ var init_chunk_3IFJP4R5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3IFJP4R5.js"() {
2868
+ init_chunk_WIMGWYZL();
2869
+ } });
2870
+
2871
+ //#endregion
2872
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J4EKWFDW.js
2873
+ var init_chunk_J4EKWFDW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J4EKWFDW.js"() {
2874
+ init_chunk_WIMGWYZL();
2875
+ } });
2876
+
2877
+ //#endregion
2878
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PGMPBC5Q.js
2879
+ var init_chunk_PGMPBC5Q = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PGMPBC5Q.js"() {
2880
+ init_chunk_WIMGWYZL();
2881
+ } });
2882
+
2883
+ //#endregion
2884
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GGYFZTDW.js
2885
+ var init_chunk_GGYFZTDW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GGYFZTDW.js"() {
2886
+ init_chunk_WIMGWYZL();
2887
+ } });
2888
+
2889
+ //#endregion
2890
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EDOGCRPU.js
2891
+ var init_chunk_EDOGCRPU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-EDOGCRPU.js"() {
2892
+ init_chunk_3GOCSNFN();
2893
+ } });
2894
+
2895
+ //#endregion
2896
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4NRWDO7P.js
2897
+ var init_chunk_4NRWDO7P = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4NRWDO7P.js"() {
2898
+ init_chunk_WIMGWYZL();
2899
+ } });
2900
+
2901
+ //#endregion
2902
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W6ZHPGFP.js
2903
+ var init_chunk_W6ZHPGFP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W6ZHPGFP.js"() {
2904
+ init_chunk_WIMGWYZL();
2905
+ } });
2906
+
2907
+ //#endregion
2908
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J3IRE4DI.js
2909
+ var init_chunk_J3IRE4DI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J3IRE4DI.js"() {
2910
+ init_chunk_DH3BPT6T();
2911
+ init_chunk_EMIEIAAH();
2912
+ } });
2913
+
2914
+ //#endregion
2915
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RZUYD7QY.js
2916
+ var init_chunk_RZUYD7QY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-RZUYD7QY.js"() {
2917
+ init_chunk_WIMGWYZL();
2918
+ } });
2919
+
2920
+ //#endregion
2921
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-A3PVMI4K.js
2922
+ var init_chunk_A3PVMI4K = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-A3PVMI4K.js"() {
2923
+ init_chunk_OAMXQXGR();
2924
+ init_chunk_WIMGWYZL();
2925
+ } });
2926
+
2927
+ //#endregion
2928
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4ZFFLFWV.js
2929
+ var init_chunk_4ZFFLFWV = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-4ZFFLFWV.js"() {
2930
+ init_chunk_WIMGWYZL();
2931
+ } });
2932
+
2933
+ //#endregion
2934
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C6IMN7SF.js
2935
+ var init_chunk_C6IMN7SF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-C6IMN7SF.js"() {} });
2936
+
2937
+ //#endregion
2938
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NS6ZBRLP.js
2939
+ var init_chunk_NS6ZBRLP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NS6ZBRLP.js"() {
2940
+ init_chunk_WIMGWYZL();
2941
+ } });
2942
+
2943
+ //#endregion
2944
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FMPZ2CLX.js
2945
+ var init_chunk_FMPZ2CLX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FMPZ2CLX.js"() {} });
2946
+
2947
+ //#endregion
2948
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3ZJAREUD.js
2949
+ var init_chunk_3ZJAREUD = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3ZJAREUD.js"() {
2950
+ init_chunk_WIMGWYZL();
2951
+ } });
2952
+
2953
+ //#endregion
2954
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZXVA7VDE.js
2955
+ var init_chunk_ZXVA7VDE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZXVA7VDE.js"() {
2956
+ init_chunk_LFJW7BOT();
2957
+ } });
2958
+
2959
+ //#endregion
2960
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-567G5ZXL.js
2961
+ var init_chunk_567G5ZXL = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-567G5ZXL.js"() {
2962
+ init_chunk_WIMGWYZL();
2963
+ } });
2964
+
2965
+ //#endregion
2966
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KQRZQWDE.js
2967
+ var init_chunk_KQRZQWDE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KQRZQWDE.js"() {
2968
+ init_chunk_567G5ZXL();
2969
+ init_chunk_WIMGWYZL();
2970
+ } });
2971
+
2972
+ //#endregion
2973
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3D3RWAVJ.js
2974
+ var init_chunk_3D3RWAVJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3D3RWAVJ.js"() {
2975
+ init_chunk_WIMGWYZL();
2976
+ } });
2977
+
2978
+ //#endregion
2979
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K2FFNW24.js
2980
+ var init_chunk_K2FFNW24 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-K2FFNW24.js"() {
2981
+ init_chunk_WIMGWYZL();
2982
+ } });
2983
+
2984
+ //#endregion
2985
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5S4PYKVY.js
2986
+ var init_chunk_5S4PYKVY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5S4PYKVY.js"() {
2987
+ init_chunk_WIMGWYZL();
2988
+ } });
2989
+
2990
+ //#endregion
2991
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5WKPQX7L.js
2992
+ var init_chunk_5WKPQX7L = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5WKPQX7L.js"() {} });
2993
+
2994
+ //#endregion
2995
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BZNENX2T.js
2996
+ var init_chunk_BZNENX2T = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BZNENX2T.js"() {} });
2997
+
2998
+ //#endregion
2999
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PDQFB3TV.js
3000
+ var init_chunk_PDQFB3TV = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PDQFB3TV.js"() {
3001
+ init_chunk_BZNENX2T();
3002
+ init_chunk_WIMGWYZL();
3003
+ } });
3004
+
3005
+ //#endregion
3006
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XMLUDZIW.js
3007
+ var init_chunk_XMLUDZIW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XMLUDZIW.js"() {} });
3008
+
3009
+ //#endregion
3010
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GMMLSO2N.js
3011
+ var init_chunk_GMMLSO2N = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GMMLSO2N.js"() {
3012
+ init_chunk_WIMGWYZL();
3013
+ } });
3014
+
3015
+ //#endregion
3016
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5NQBDF4H.js
3017
+ function t$5(...n$7) {
3018
+ return u$11(Object.keys, n$7);
3019
+ }
3020
+ var init_chunk_5NQBDF4H = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5NQBDF4H.js"() {
3021
+ init_chunk_WIMGWYZL();
3022
+ } });
3023
+
3024
+ //#endregion
3025
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PFSVCZNE.js
3026
+ var init_chunk_PFSVCZNE = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PFSVCZNE.js"() {
3027
+ init_chunk_WIMGWYZL();
3028
+ } });
3029
+
3030
+ //#endregion
3031
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VO5MRBXA.js
3032
+ var init_chunk_VO5MRBXA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VO5MRBXA.js"() {
3033
+ init_chunk_WIMGWYZL();
3034
+ } });
3035
+
3036
+ //#endregion
3037
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XUX3ZEXI.js
3038
+ var init_chunk_XUX3ZEXI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XUX3ZEXI.js"() {
3039
+ init_chunk_WIMGWYZL();
3040
+ } });
3041
+
3042
+ //#endregion
3043
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KZIKCQ56.js
3044
+ var init_chunk_KZIKCQ56 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KZIKCQ56.js"() {
3045
+ init_chunk_WIMGWYZL();
3046
+ } });
3047
+
3048
+ //#endregion
3049
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P3DXEVTH.js
3050
+ var init_chunk_P3DXEVTH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P3DXEVTH.js"() {
3051
+ init_chunk_WIMGWYZL();
3052
+ } });
3053
+
3054
+ //#endregion
3055
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6GTAPB47.js
3056
+ var init_chunk_6GTAPB47 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-6GTAPB47.js"() {} });
3057
+
3058
+ //#endregion
3059
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NMC53JVB.js
3060
+ var init_chunk_NMC53JVB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NMC53JVB.js"() {} });
3061
+
3062
+ //#endregion
3063
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PULGOXDA.js
3064
+ var init_chunk_PULGOXDA = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PULGOXDA.js"() {} });
3065
+
3066
+ //#endregion
3067
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OLNQBNAJ.js
3068
+ var init_chunk_OLNQBNAJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OLNQBNAJ.js"() {
3069
+ init_chunk_WIMGWYZL();
3070
+ } });
3071
+
3072
+ //#endregion
3073
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QOEIYQAG.js
3074
+ var init_chunk_QOEIYQAG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QOEIYQAG.js"() {
3075
+ init_chunk_WIMGWYZL();
3076
+ } });
3077
+
3078
+ //#endregion
3079
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SFZGYJFI.js
3080
+ var init_chunk_SFZGYJFI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SFZGYJFI.js"() {} });
3081
+
3082
+ //#endregion
3083
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JJZ7E4YG.js
3084
+ var init_chunk_JJZ7E4YG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JJZ7E4YG.js"() {} });
3085
+
3086
+ //#endregion
3087
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VCYTMP4D.js
3088
+ var init_chunk_VCYTMP4D = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VCYTMP4D.js"() {} });
3089
+
3090
+ //#endregion
3091
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-CAZXBO45.js
3092
+ var init_chunk_CAZXBO45 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-CAZXBO45.js"() {} });
3093
+
3094
+ //#endregion
3095
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENOHV5LT.js
3096
+ var init_chunk_ENOHV5LT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ENOHV5LT.js"() {} });
3097
+
3098
+ //#endregion
3099
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-U753ZCO5.js
3100
+ var init_chunk_U753ZCO5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-U753ZCO5.js"() {} });
3101
+
3102
+ //#endregion
3103
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5DU4ITSF.js
3104
+ var init_chunk_5DU4ITSF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5DU4ITSF.js"() {} });
3105
+
3106
+ //#endregion
3107
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GK5I7C4J.js
3108
+ var init_chunk_GK5I7C4J = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GK5I7C4J.js"() {} });
3109
+
3110
+ //#endregion
3111
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HV3WACXG.js
3112
+ var init_chunk_HV3WACXG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HV3WACXG.js"() {} });
3113
+
3114
+ //#endregion
3115
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JK3VNB42.js
3116
+ var init_chunk_JK3VNB42 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-JK3VNB42.js"() {} });
3117
+
3118
+ //#endregion
3119
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T45O7BFY.js
3120
+ var init_chunk_T45O7BFY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T45O7BFY.js"() {
3121
+ init_chunk_LFJW7BOT();
3122
+ init_chunk_ANXBDSUI();
3123
+ } });
3124
+
3125
+ //#endregion
3126
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OP5ZF26D.js
3127
+ var init_chunk_OP5ZF26D = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OP5ZF26D.js"() {
3128
+ init_chunk_WIMGWYZL();
3129
+ } });
3130
+
3131
+ //#endregion
3132
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BO3LQZNF.js
3133
+ var init_chunk_BO3LQZNF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-BO3LQZNF.js"() {} });
3134
+
3135
+ //#endregion
3136
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-I3D2BSWJ.js
3137
+ var init_chunk_I3D2BSWJ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-I3D2BSWJ.js"() {} });
3138
+
3139
+ //#endregion
3140
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7QX4DO53.js
3141
+ var init_chunk_7QX4DO53 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-7QX4DO53.js"() {} });
3142
+
3143
+ //#endregion
3144
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VMV5GVZ5.js
3145
+ var init_chunk_VMV5GVZ5 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VMV5GVZ5.js"() {} });
3146
+
3147
+ //#endregion
3148
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OWH4IQQW.js
3149
+ var init_chunk_OWH4IQQW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OWH4IQQW.js"() {} });
3150
+
3151
+ //#endregion
3152
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ETADWPSK.js
3153
+ var init_chunk_ETADWPSK = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ETADWPSK.js"() {} });
3154
+
3155
+ //#endregion
3156
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OFZGPGDZ.js
3157
+ var init_chunk_OFZGPGDZ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OFZGPGDZ.js"() {
3158
+ init_chunk_WIMGWYZL();
3159
+ } });
3160
+
3161
+ //#endregion
3162
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HGKLN5KY.js
3163
+ var init_chunk_HGKLN5KY = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HGKLN5KY.js"() {
3164
+ init_chunk_WIMGWYZL();
3165
+ } });
3166
+
3167
+ //#endregion
3168
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R7PILVSQ.js
3169
+ var init_chunk_R7PILVSQ = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-R7PILVSQ.js"() {
3170
+ init_chunk_HGKLN5KY();
3171
+ init_chunk_WIMGWYZL();
3172
+ } });
3173
+
3174
+ //#endregion
3175
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE3ESO.js
3176
+ var init_chunk_HJSE3ESO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE3ESO.js"() {} });
3177
+
3178
+ //#endregion
3179
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-B6PG574O.js
3180
+ var init_chunk_B6PG574O = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-B6PG574O.js"() {
3181
+ init_chunk_WIMGWYZL();
3182
+ } });
3183
+
3184
+ //#endregion
3185
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ICBBHOCR.js
3186
+ var init_chunk_ICBBHOCR = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ICBBHOCR.js"() {
3187
+ init_chunk_LFJW7BOT();
3188
+ init_chunk_ANXBDSUI();
3189
+ } });
3190
+
3191
+ //#endregion
3192
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DAE7EJQ2.js
3193
+ var init_chunk_DAE7EJQ2 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-DAE7EJQ2.js"() {
3194
+ init_chunk_EMIEIAAH();
3195
+ init_chunk_OAMXQXGR();
3196
+ } });
3197
+
3198
+ //#endregion
3199
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XPCYQPKH.js
3200
+ var init_chunk_XPCYQPKH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XPCYQPKH.js"() {
3201
+ init_chunk_ANXBDSUI();
3202
+ init_chunk_D6FCK2GA();
3203
+ } });
3204
+
3205
+ //#endregion
3206
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FRNNS7AX.js
3207
+ var init_chunk_FRNNS7AX = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-FRNNS7AX.js"() {
3208
+ init_chunk_WIMGWYZL();
3209
+ } });
3210
+
3211
+ //#endregion
3212
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJOWZFYO.js
3213
+ var init_chunk_QJOWZFYO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-QJOWZFYO.js"() {
3214
+ init_chunk_FZHIMCK6();
3215
+ init_chunk_WIMGWYZL();
3216
+ } });
3217
+
3218
+ //#endregion
3219
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VIBSXWWU.js
3220
+ var init_chunk_VIBSXWWU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VIBSXWWU.js"() {
3221
+ init_chunk_WIMGWYZL();
3222
+ } });
3223
+
3224
+ //#endregion
3225
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4H4IOYC.js
3226
+ var init_chunk_T4H4IOYC = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T4H4IOYC.js"() {
3227
+ init_chunk_WIMGWYZL();
3228
+ } });
3229
+
3230
+ //#endregion
3231
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GPLTWAVR.js
3232
+ var init_chunk_GPLTWAVR = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GPLTWAVR.js"() {
3233
+ init_chunk_WIMGWYZL();
3234
+ } });
3235
+
3236
+ //#endregion
3237
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PIX5OHMW.js
3238
+ var init_chunk_PIX5OHMW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PIX5OHMW.js"() {
3239
+ init_chunk_WIMGWYZL();
3240
+ } });
3241
+
3242
+ //#endregion
3243
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VVM5DH6Z.js
3244
+ var init_chunk_VVM5DH6Z = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VVM5DH6Z.js"() {
3245
+ init_chunk_WIMGWYZL();
3246
+ } });
3247
+
3248
+ //#endregion
3249
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PVYOMZ3I.js
3250
+ var init_chunk_PVYOMZ3I = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-PVYOMZ3I.js"() {
3251
+ init_chunk_WIMGWYZL();
3252
+ } });
3253
+
3254
+ //#endregion
3255
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P6LAFGAN.js
3256
+ var init_chunk_P6LAFGAN = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-P6LAFGAN.js"() {
3257
+ init_chunk_ANXBDSUI();
3258
+ init_chunk_WIMGWYZL();
3259
+ } });
3260
+
3261
+ //#endregion
3262
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SGAFZVQH.js
3263
+ var init_chunk_SGAFZVQH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-SGAFZVQH.js"() {} });
3264
+
3265
+ //#endregion
3266
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MQDP6CFS.js
3267
+ var init_chunk_MQDP6CFS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-MQDP6CFS.js"() {
3268
+ init_chunk_SGAFZVQH();
3269
+ init_chunk_ANXBDSUI();
3270
+ init_chunk_WIMGWYZL();
3271
+ } });
3272
+
3273
+ //#endregion
3274
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UZ6BOIAH.js
3275
+ var init_chunk_UZ6BOIAH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UZ6BOIAH.js"() {
3276
+ init_chunk_WIMGWYZL();
3277
+ } });
3278
+
3279
+ //#endregion
3280
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KI5UAETW.js
3281
+ var init_chunk_KI5UAETW = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-KI5UAETW.js"() {
3282
+ init_chunk_WIMGWYZL();
3283
+ } });
3284
+
3285
+ //#endregion
3286
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GYH2VCL4.js
3287
+ var init_chunk_GYH2VCL4 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GYH2VCL4.js"() {
3288
+ init_chunk_WIMGWYZL();
3289
+ } });
3290
+
3291
+ //#endregion
3292
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-26ILFTOP.js
3293
+ var init_chunk_26ILFTOP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-26ILFTOP.js"() {
3294
+ init_chunk_SGAFZVQH();
3295
+ init_chunk_WIMGWYZL();
3296
+ } });
3297
+
3298
+ //#endregion
3299
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2KIKGHAO.js
3300
+ var init_chunk_2KIKGHAO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2KIKGHAO.js"() {
3301
+ init_chunk_WIMGWYZL();
3302
+ } });
3303
+
3304
+ //#endregion
3305
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YVMG2XEU.js
3306
+ var init_chunk_YVMG2XEU = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-YVMG2XEU.js"() {} });
3307
+
3308
+ //#endregion
3309
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZP6YI2JT.js
3310
+ var init_chunk_ZP6YI2JT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZP6YI2JT.js"() {
3311
+ init_chunk_ANXBDSUI();
3312
+ init_chunk_WIMGWYZL();
3313
+ } });
3314
+
3315
+ //#endregion
3316
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OCJMJQKO.js
3317
+ var init_chunk_OCJMJQKO = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OCJMJQKO.js"() {
3318
+ init_chunk_P5WDBFN2();
3319
+ init_chunk_EMIEIAAH();
3320
+ } });
3321
+
3322
+ //#endregion
3323
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J7R2OSHS.js
3324
+ var init_chunk_J7R2OSHS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-J7R2OSHS.js"() {
3325
+ init_chunk_WIMGWYZL();
3326
+ } });
3327
+
3328
+ //#endregion
3329
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GIKF2ZNG.js
3330
+ var init_chunk_GIKF2ZNG = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GIKF2ZNG.js"() {
3331
+ init_chunk_WIMGWYZL();
3332
+ } });
3333
+
3334
+ //#endregion
3335
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XWBKJZIP.js
3336
+ var init_chunk_XWBKJZIP = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XWBKJZIP.js"() {
3337
+ init_chunk_WIMGWYZL();
3338
+ } });
3339
+
3340
+ //#endregion
3341
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XHPQVWZM.js
3342
+ var init_chunk_XHPQVWZM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XHPQVWZM.js"() {
3343
+ init_chunk_WIMGWYZL();
3344
+ } });
3345
+
3346
+ //#endregion
3347
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2OQBQB3V.js
3348
+ var init_chunk_2OQBQB3V = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-2OQBQB3V.js"() {
3349
+ init_chunk_WIMGWYZL();
3350
+ } });
3351
+
3352
+ //#endregion
3353
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-H4OTHZJB.js
3354
+ var init_chunk_H4OTHZJB = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-H4OTHZJB.js"() {
3355
+ init_chunk_WIMGWYZL();
3356
+ } });
3357
+
3358
+ //#endregion
3359
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XZ6COQKM.js
3360
+ function a$13(n$7, t$14, e$5) {
3361
+ return n$7(e$5[0]) ? (r$12) => t$14(r$12, ...e$5) : t$14(...e$5);
3362
+ }
3363
+ function u$12(...n$7) {
3364
+ return a$13(s$8, o$9, n$7);
3365
+ }
3366
+ function o$9(n$7, ...t$14) {
3367
+ for (let [e$5, r$12] of t$14) if (e$5(n$7)) return r$12(n$7);
3368
+ throw new Error("conditional: data failed for all cases");
3369
+ }
3370
+ function s$8(n$7) {
3371
+ if (!Array.isArray(n$7)) return !1;
3372
+ let [t$14, e$5, ...r$12] = n$7;
3373
+ return typeof t$14 == "function" && t$14.length <= 1 && typeof e$5 == "function" && e$5.length <= 1 && r$12.length === 0;
3374
+ }
3375
+ function R(n$7 = d$11) {
3376
+ return [T$7, n$7];
3377
+ }
3378
+ var x$2, T$7, d$11;
3379
+ var init_chunk_XZ6COQKM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-XZ6COQKM.js"() {
3380
+ x$2 = Object.assign(u$12, { defaultCase: R });
3381
+ T$7 = () => !0, d$11 = () => {};
3382
+ } });
3383
+
3384
+ //#endregion
3385
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T5XG33UI.js
3386
+ var init_chunk_T5XG33UI = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-T5XG33UI.js"() {} });
3387
+
3388
+ //#endregion
3389
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZTNFU7RH.js
3390
+ var init_chunk_ZTNFU7RH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-ZTNFU7RH.js"() {
3391
+ init_chunk_WIMGWYZL();
3392
+ } });
3393
+
3394
+ //#endregion
3395
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OIQJEOF7.js
3396
+ var init_chunk_OIQJEOF7 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-OIQJEOF7.js"() {} });
3397
+
3398
+ //#endregion
3399
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GKXRNLHM.js
3400
+ var init_chunk_GKXRNLHM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-GKXRNLHM.js"() {
3401
+ init_chunk_LFJW7BOT();
3402
+ init_chunk_ANXBDSUI();
3403
+ } });
3404
+
3405
+ //#endregion
3406
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NYIWN625.js
3407
+ var init_chunk_NYIWN625 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-NYIWN625.js"() {
3408
+ init_chunk_LFJW7BOT();
3409
+ init_chunk_ANXBDSUI();
3410
+ } });
3411
+
3412
+ //#endregion
3413
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WPTI67A4.js
3414
+ var init_chunk_WPTI67A4 = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WPTI67A4.js"() {
3415
+ init_chunk_WIMGWYZL();
3416
+ } });
3417
+
3418
+ //#endregion
3419
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W2ARC73P.js
3420
+ var init_chunk_W2ARC73P = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-W2ARC73P.js"() {
3421
+ init_chunk_WIMGWYZL();
3422
+ } });
3423
+
3424
+ //#endregion
3425
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3UBK2BVM.js
3426
+ var init_chunk_3UBK2BVM = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3UBK2BVM.js"() {
3427
+ init_chunk_WIMGWYZL();
3428
+ } });
3429
+
3430
+ //#endregion
3431
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFECZ57D.js
3432
+ var init_chunk_VFECZ57D = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VFECZ57D.js"() {
3433
+ init_chunk_WIMGWYZL();
3434
+ } });
3435
+
3436
+ //#endregion
3437
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VG2NVNXT.js
3438
+ var init_chunk_VG2NVNXT = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-VG2NVNXT.js"() {
3439
+ init_chunk_WIMGWYZL();
3440
+ } });
3441
+
3442
+ //#endregion
3443
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE36CH.js
3444
+ var init_chunk_HJSE36CH = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-HJSE36CH.js"() {
3445
+ init_chunk_FZHIMCK6();
3446
+ init_chunk_WIMGWYZL();
3447
+ } });
3448
+
3449
+ //#endregion
3450
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WFMWIRTS.js
3451
+ var init_chunk_WFMWIRTS = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WFMWIRTS.js"() {
3452
+ init_chunk_WIMGWYZL();
3453
+ } });
3454
+
3455
+ //#endregion
3456
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHDYHGOF.js
3457
+ var init_chunk_UHDYHGOF = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-UHDYHGOF.js"() {
3458
+ init_chunk_WIMGWYZL();
3459
+ } });
3460
+
3461
+ //#endregion
3462
+ //#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/index.js
3463
+ var init_dist = __esm({ "../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/index.js"() {
3464
+ init_chunk_7ZI6JRPB();
3465
+ init_chunk_OXJMERKM();
3466
+ init_chunk_BSLJB6JE();
3467
+ init_chunk_NJXNQM3G();
3468
+ init_chunk_6RKHJ2CP();
3469
+ init_chunk_QDGUNRDA();
3470
+ init_chunk_MYLLMFC7();
3471
+ init_chunk_N4JUOEMS();
3472
+ init_chunk_YRJ25UV2();
3473
+ init_chunk_Q5ASJ5N7();
3474
+ init_chunk_WZOX4VKU();
3475
+ init_chunk_Y3VKZ3P5();
3476
+ init_chunk_ZRKG4NSC();
3477
+ init_chunk_QJLMYOTX();
3478
+ init_chunk_DM52TTEP();
3479
+ init_chunk_2P44HXVH();
3480
+ init_chunk_ZJS5DNQW();
3481
+ init_chunk_AHDTEY6L();
3482
+ init_chunk_4UEQNEAO();
3483
+ init_chunk_T4PLMLCP();
3484
+ init_chunk_SSDL7ATG();
3485
+ init_chunk_EVIH3PFY();
3486
+ init_chunk_RBODUO3Q();
3487
+ init_chunk_S52RID4A();
3488
+ init_chunk_WWPMIW33();
3489
+ init_chunk_57KROWWS();
3490
+ init_chunk_V6HCOU6T();
3491
+ init_chunk_ALS6JP7S();
3492
+ init_chunk_QTQTP2VB();
3493
+ init_chunk_NFFV4IQT();
3494
+ init_chunk_FDH4IRIM();
3495
+ init_chunk_YDIA5YQI();
3496
+ init_chunk_6OEKBHIX();
3497
+ init_chunk_GDGEDZJG();
3498
+ init_chunk_XE3XIKTJ();
3499
+ init_chunk_HVJXDSOP();
3500
+ init_chunk_MSOX5OUI();
3501
+ init_chunk_C4OZY4Z2();
3502
+ init_chunk_P2PQB7KO();
3503
+ init_chunk_UHZ33J57();
3504
+ init_chunk_6RL33UFT();
3505
+ init_chunk_YNNF733L();
3506
+ init_chunk_4YLWJIJ6();
3507
+ init_chunk_KVHF7QRD();
3508
+ init_chunk_UA6DVSZ3();
3509
+ init_chunk_G5B2IDWB();
3510
+ init_chunk_3FKP6OOU();
3511
+ init_chunk_VFSOOVKJ();
3512
+ init_chunk_K3UJMX27();
3513
+ init_chunk_LE6I3KC6();
3514
+ init_chunk_ENS7GPLZ();
3515
+ init_chunk_DSLWSGID();
3516
+ init_chunk_R72GEKLP();
3517
+ init_chunk_3IFJP4R5();
3518
+ init_chunk_J4EKWFDW();
3519
+ init_chunk_PGMPBC5Q();
3520
+ init_chunk_GGYFZTDW();
3521
+ init_chunk_EDOGCRPU();
3522
+ init_chunk_4NRWDO7P();
3523
+ init_chunk_W6ZHPGFP();
3524
+ init_chunk_J3IRE4DI();
3525
+ init_chunk_RZUYD7QY();
3526
+ init_chunk_A3PVMI4K();
3527
+ init_chunk_4ZFFLFWV();
3528
+ init_chunk_C6IMN7SF();
3529
+ init_chunk_NS6ZBRLP();
3530
+ init_chunk_FMPZ2CLX();
3531
+ init_chunk_3ZJAREUD();
3532
+ init_chunk_ZXVA7VDE();
3533
+ init_chunk_KQRZQWDE();
3534
+ init_chunk_567G5ZXL();
3535
+ init_chunk_3D3RWAVJ();
3536
+ init_chunk_K2FFNW24();
3537
+ init_chunk_5S4PYKVY();
3538
+ init_chunk_5WKPQX7L();
3539
+ init_chunk_PDQFB3TV();
3540
+ init_chunk_XMLUDZIW();
3541
+ init_chunk_GMMLSO2N();
3542
+ init_chunk_5NQBDF4H();
3543
+ init_chunk_PFSVCZNE();
3544
+ init_chunk_VO5MRBXA();
3545
+ init_chunk_XUX3ZEXI();
3546
+ init_chunk_KZIKCQ56();
3547
+ init_chunk_P3DXEVTH();
3548
+ init_chunk_6GTAPB47();
3549
+ init_chunk_NMC53JVB();
3550
+ init_chunk_BZNENX2T();
3551
+ init_chunk_PULGOXDA();
3552
+ init_chunk_OLNQBNAJ();
3553
+ init_chunk_QOEIYQAG();
3554
+ init_chunk_SFZGYJFI();
3555
+ init_chunk_JJZ7E4YG();
3556
+ init_chunk_VCYTMP4D();
3557
+ init_chunk_CAZXBO45();
3558
+ init_chunk_ENOHV5LT();
3559
+ init_chunk_U753ZCO5();
3560
+ init_chunk_5DU4ITSF();
3561
+ init_chunk_GK5I7C4J();
3562
+ init_chunk_HV3WACXG();
3563
+ init_chunk_JK3VNB42();
3564
+ init_chunk_T45O7BFY();
3565
+ init_chunk_OP5ZF26D();
3566
+ init_chunk_BO3LQZNF();
3567
+ init_chunk_I3D2BSWJ();
3568
+ init_chunk_7QX4DO53();
3569
+ init_chunk_VMV5GVZ5();
3570
+ init_chunk_OWH4IQQW();
3571
+ init_chunk_ETADWPSK();
3572
+ init_chunk_OFZGPGDZ();
3573
+ init_chunk_R7PILVSQ();
3574
+ init_chunk_HGKLN5KY();
3575
+ init_chunk_HJSE3ESO();
3576
+ init_chunk_B6PG574O();
3577
+ init_chunk_ICBBHOCR();
3578
+ init_chunk_DAE7EJQ2();
3579
+ init_chunk_XPCYQPKH();
3580
+ init_chunk_FRNNS7AX();
3581
+ init_chunk_QJOWZFYO();
3582
+ init_chunk_VIBSXWWU();
3583
+ init_chunk_T4H4IOYC();
3584
+ init_chunk_GPLTWAVR();
3585
+ init_chunk_PIX5OHMW();
3586
+ init_chunk_VVM5DH6Z();
3587
+ init_chunk_PVYOMZ3I();
3588
+ init_chunk_P6LAFGAN();
3589
+ init_chunk_MQDP6CFS();
3590
+ init_chunk_UZ6BOIAH();
3591
+ init_chunk_KI5UAETW();
3592
+ init_chunk_GYH2VCL4();
3593
+ init_chunk_26ILFTOP();
3594
+ init_chunk_2KIKGHAO();
3595
+ init_chunk_YVMG2XEU();
3596
+ init_chunk_ZP6YI2JT();
3597
+ init_chunk_OCJMJQKO();
3598
+ init_chunk_P5WDBFN2();
3599
+ init_chunk_OAMXQXGR();
3600
+ init_chunk_J7R2OSHS();
3601
+ init_chunk_GIKF2ZNG();
3602
+ init_chunk_XWBKJZIP();
3603
+ init_chunk_XHPQVWZM();
3604
+ init_chunk_2OQBQB3V();
3605
+ init_chunk_H4OTHZJB();
3606
+ init_chunk_XZ6COQKM();
3607
+ init_chunk_T5XG33UI();
3608
+ init_chunk_ZTNFU7RH();
3609
+ init_chunk_OIQJEOF7();
3610
+ init_chunk_GKXRNLHM();
3611
+ init_chunk_NYIWN625();
3612
+ init_chunk_LFJW7BOT();
3613
+ init_chunk_3GOCSNFN();
3614
+ init_chunk_WPTI67A4();
3615
+ init_chunk_W2ARC73P();
3616
+ init_chunk_3UBK2BVM();
3617
+ init_chunk_VFECZ57D();
3618
+ init_chunk_VG2NVNXT();
3619
+ init_chunk_HJSE36CH();
3620
+ init_chunk_WFMWIRTS();
3621
+ init_chunk_UHDYHGOF();
3622
+ init_chunk_WIMGWYZL();
3623
+ } });
3624
+
3625
+ //#endregion
3626
+ //#region src/utils/plugin/index.ts
3627
+ var isPluginHookName;
3628
+ var init_plugin = __esm({ "src/utils/plugin/index.ts"() {
3629
+ init_plugin$1();
3630
+ isPluginHookName = function() {
3631
+ const PLUGIN_HOOK_NAMES_SET = new Set(ENUMERATED_PLUGIN_HOOK_NAMES);
3632
+ return function isPluginHookName$1(hookName) {
3633
+ return PLUGIN_HOOK_NAMES_SET.has(hookName);
3634
+ };
3635
+ }();
3636
+ } });
3637
+
3638
+ //#endregion
3639
+ //#region src/utils/compose-js-plugins.ts
3640
+ function isUnsupportedHooks(hookName) {
3641
+ return unsupportedHooks.has(hookName);
3642
+ }
3643
+ function createComposedPlugin(plugins) {
3644
+ const names = [];
3645
+ const batchedHooks = {};
3646
+ plugins.forEach((plugin, index) => {
3647
+ const pluginName = plugin.name || `Anonymous(index: ${index})`;
3648
+ names.push(pluginName);
3649
+ t$5(plugin).forEach((pluginProp) => {
3650
+ if (isUnsupportedHooks(pluginProp)) throw new Error(`Failed to compose js plugins. Plugin ${pluginName} has an unsupported hook: ${pluginProp}`);
3651
+ if (!isPluginHookName(pluginProp)) return;
3652
+ switch (pluginProp) {
3653
+ case "buildStart": {
3654
+ const handlers = batchedHooks.buildStart ?? [];
3655
+ batchedHooks.buildStart = handlers;
3656
+ if (plugin.buildStart) handlers.push([plugin.buildStart, plugin]);
3657
+ break;
3658
+ }
3659
+ case "load": {
3660
+ const handlers = batchedHooks.load ?? [];
3661
+ batchedHooks.load = handlers;
3662
+ if (plugin.load) handlers.push([plugin.load, plugin]);
3663
+ break;
3664
+ }
3665
+ case "transform": {
3666
+ const handlers = batchedHooks.transform ?? [];
3667
+ batchedHooks.transform = handlers;
3668
+ if (plugin.transform) handlers.push([plugin.transform, plugin]);
3669
+ break;
3670
+ }
3671
+ case "resolveId": {
3672
+ const handlers = batchedHooks.resolveId ?? [];
3673
+ batchedHooks.resolveId = handlers;
3674
+ if (plugin.resolveId) handlers.push([plugin.resolveId, plugin]);
3675
+ break;
3676
+ }
3677
+ case "buildEnd": {
3678
+ const handlers = batchedHooks.buildEnd ?? [];
3679
+ batchedHooks.buildEnd = handlers;
3680
+ if (plugin.buildEnd) handlers.push([plugin.buildEnd, plugin]);
3681
+ break;
3682
+ }
3683
+ case "renderChunk": {
3684
+ const handlers = batchedHooks.renderChunk ?? [];
3685
+ batchedHooks.renderChunk = handlers;
3686
+ if (plugin.renderChunk) handlers.push([plugin.renderChunk, plugin]);
3687
+ break;
3688
+ }
3689
+ case "banner":
3690
+ case "footer":
3691
+ case "intro":
3692
+ case "outro": {
3693
+ const hook = plugin[pluginProp];
3694
+ if (hook) (batchedHooks[pluginProp] ??= []).push([hook, plugin]);
3695
+ break;
3696
+ }
3697
+ case "closeBundle": {
3698
+ const handlers = batchedHooks.closeBundle ?? [];
3699
+ batchedHooks.closeBundle = handlers;
3700
+ if (plugin.closeBundle) handlers.push([plugin.closeBundle, plugin]);
3701
+ break;
3702
+ }
3703
+ case "watchChange": {
3704
+ const handlers = batchedHooks.watchChange ?? [];
3705
+ batchedHooks.watchChange = handlers;
3706
+ if (plugin.watchChange) handlers.push([plugin.watchChange, plugin]);
3707
+ break;
3708
+ }
3709
+ case "closeWatcher": {
3710
+ const handlers = batchedHooks.closeWatcher ?? [];
3711
+ batchedHooks.closeWatcher = handlers;
3712
+ if (plugin.closeWatcher) handlers.push([plugin.closeWatcher, plugin]);
3713
+ break;
3714
+ }
3715
+ default: {}
3716
+ }
3717
+ });
3718
+ });
3719
+ const composed = { name: `Composed(${names.join(", ")})` };
3720
+ const createFixedPluginResolveFnMap = new Map();
3721
+ function applyFixedPluginResolveFn(ctx, plugin) {
3722
+ const createFixedPluginResolveFn = createFixedPluginResolveFnMap.get(plugin);
3723
+ if (createFixedPluginResolveFn) ctx.resolve = createFixedPluginResolveFn(ctx, ctx.resolve.bind(ctx));
3724
+ return ctx;
3725
+ }
3726
+ if (batchedHooks.resolveId) {
3727
+ const batchedHandlers = batchedHooks.resolveId;
3728
+ const handlerSymbols = batchedHandlers.map(([_handler, plugin]) => Symbol(plugin.name ?? `Anonymous`));
3729
+ for (let handlerIdx = 0; handlerIdx < batchedHandlers.length; handlerIdx++) {
3730
+ const [_handler, plugin] = batchedHandlers[handlerIdx];
3731
+ const handlerSymbol = handlerSymbols[handlerIdx];
3732
+ const createFixedPluginResolveFn = (ctx, resolve) => {
3733
+ return (source, importer, rawContextResolveOptions) => {
3734
+ const contextResolveOptions = rawContextResolveOptions ?? {};
3735
+ if (contextResolveOptions.skipSelf) {
3736
+ contextResolveOptions[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF] = handlerSymbol;
3737
+ contextResolveOptions.skipSelf = false;
3738
+ }
3739
+ return resolve(source, importer, contextResolveOptions);
3740
+ };
3741
+ };
3742
+ createFixedPluginResolveFnMap.set(plugin, createFixedPluginResolveFn);
3743
+ }
3744
+ composed.resolveId = async function(source, importer, rawHookResolveIdOptions) {
3745
+ const hookResolveIdOptions = rawHookResolveIdOptions;
3746
+ const symbolForCallerThatSkipSelf = hookResolveIdOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF];
3747
+ for (let handlerIdx = 0; handlerIdx < batchedHandlers.length; handlerIdx++) {
3748
+ const [handler, plugin] = batchedHandlers[handlerIdx];
3749
+ const handlerSymbol = handlerSymbols[handlerIdx];
3750
+ if (symbolForCallerThatSkipSelf === handlerSymbol) continue;
3751
+ const { handler: handlerFn } = normalizeHook(handler);
3752
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), source, importer, rawHookResolveIdOptions);
3753
+ if (!isNullish(result)) return result;
3754
+ }
3755
+ };
3756
+ }
3757
+ t$5(batchedHooks).forEach((hookName) => {
3758
+ switch (hookName) {
3759
+ case "resolveId": break;
3760
+ case "buildStart": {
3761
+ if (batchedHooks.buildStart) {
3762
+ const batchedHandlers = batchedHooks.buildStart;
3763
+ composed.buildStart = async function(options) {
3764
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3765
+ const { handler: handlerFn } = normalizeHook(handler);
3766
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin), options);
3767
+ }));
3768
+ };
3769
+ }
3770
+ break;
3771
+ }
3772
+ case "load": {
3773
+ if (batchedHooks.load) {
3774
+ const batchedHandlers = batchedHooks.load;
3775
+ composed.load = async function(id) {
3776
+ for (const [handler, plugin] of batchedHandlers) {
3777
+ const { handler: handlerFn } = normalizeHook(handler);
3778
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), id);
3779
+ if (!isNullish(result)) return result;
3780
+ }
3781
+ };
3782
+ }
3783
+ break;
3784
+ }
3785
+ case "transform": {
3786
+ if (batchedHooks.transform) {
3787
+ const batchedHandlers = batchedHooks.transform;
3788
+ composed.transform = async function(initialCode, id, moduleType) {
3789
+ let code = initialCode;
3790
+ let moduleSideEffects = void 0;
3791
+ function updateOutput(newCode, newModuleSideEffects) {
3792
+ code = newCode;
3793
+ moduleSideEffects = newModuleSideEffects ?? void 0;
3794
+ }
3795
+ for (const [handler, plugin] of batchedHandlers) {
3796
+ const { handler: handlerFn } = normalizeHook(handler);
3797
+ this.getCombinedSourcemap = () => {
3798
+ throw new Error(`The getCombinedSourcemap is not implement in transform hook at composedJsPlugins`);
3799
+ };
3800
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, id, moduleType);
3801
+ if (!isNullish(result)) {
3802
+ if (typeof result === "string") updateOutput(result);
3803
+ else if (result.code) updateOutput(result.code, result.moduleSideEffects);
3804
+ }
3805
+ }
3806
+ return {
3807
+ code,
3808
+ moduleSideEffects
3809
+ };
3810
+ };
3811
+ }
3812
+ break;
3813
+ }
3814
+ case "buildEnd": {
3815
+ if (batchedHooks.buildEnd) {
3816
+ const batchedHandlers = batchedHooks.buildEnd;
3817
+ composed.buildEnd = async function(err) {
3818
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3819
+ const { handler: handlerFn } = normalizeHook(handler);
3820
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin), err);
3821
+ }));
3822
+ };
3823
+ }
3824
+ break;
3825
+ }
3826
+ case "renderChunk": {
3827
+ if (batchedHooks.renderChunk) {
3828
+ const batchedHandlers = batchedHooks.renderChunk;
3829
+ composed.renderChunk = async function(code, chunk, options, meta) {
3830
+ for (const [handler, plugin] of batchedHandlers) {
3831
+ const { handler: handlerFn } = normalizeHook(handler);
3832
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, chunk, options, meta);
3833
+ if (!isNullish(result)) return result;
3834
+ }
3835
+ };
3836
+ }
3837
+ break;
3838
+ }
3839
+ case "banner":
3840
+ case "footer":
3841
+ case "intro":
3842
+ case "outro": {
3843
+ const hooks = batchedHooks[hookName];
3844
+ if (hooks?.length) composed[hookName] = async function(chunk) {
3845
+ const ret = [];
3846
+ for (const [hook, plugin] of hooks) {
3847
+ const { handler } = normalizeHook(hook);
3848
+ ret.push(typeof handler === "string" ? handler : await handler.call(applyFixedPluginResolveFn(this, plugin), chunk));
3849
+ }
3850
+ return ret.join("\n");
3851
+ };
3852
+ break;
3853
+ }
3854
+ case "closeBundle": {
3855
+ if (batchedHooks.closeBundle) {
3856
+ const batchedHandlers = batchedHooks.closeBundle;
3857
+ composed.closeBundle = async function() {
3858
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3859
+ const { handler: handlerFn } = normalizeHook(handler);
3860
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin));
3861
+ }));
3862
+ };
3863
+ }
3864
+ break;
3865
+ }
3866
+ case "watchChange": {
3867
+ if (batchedHooks.watchChange) {
3868
+ const batchedHandlers = batchedHooks.watchChange;
3869
+ composed.watchChange = async function(id, event) {
3870
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3871
+ const { handler: handlerFn } = normalizeHook(handler);
3872
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin), id, event);
3873
+ }));
3874
+ };
3875
+ }
3876
+ break;
3877
+ }
3878
+ case "closeWatcher": {
3879
+ if (batchedHooks.closeWatcher) {
3880
+ const batchedHandlers = batchedHooks.closeWatcher;
3881
+ composed.closeWatcher = async function() {
3882
+ await Promise.all(batchedHandlers.map(([handler, plugin]) => {
3883
+ const { handler: handlerFn } = normalizeHook(handler);
3884
+ return handlerFn.call(applyFixedPluginResolveFn(this, plugin));
3885
+ }));
3886
+ };
3887
+ }
3888
+ break;
3889
+ }
3890
+ default: {}
3891
+ }
3892
+ });
3893
+ return composed;
3894
+ }
3895
+ function isComposablePlugin(plugin) {
3896
+ if (plugin instanceof BuiltinPlugin) return false;
3897
+ if ("_parallel" in plugin) return false;
3898
+ const hasNotComposablePattern = t$5(plugin).some((hookName) => {
3899
+ if (!isPluginHookName(hookName)) return false;
3900
+ const OK_TO_COMPOSE = false;
3901
+ if (isUnsupportedHooks(hookName)) return !OK_TO_COMPOSE;
3902
+ if (plugin[hookName]) {
3903
+ const { meta } = normalizeHook(plugin[hookName]);
3904
+ if (meta.order === "pre" || meta.order === "post") return !OK_TO_COMPOSE;
3905
+ }
3906
+ return OK_TO_COMPOSE;
3907
+ });
3908
+ if (hasNotComposablePattern) return false;
3909
+ return true;
3910
+ }
3911
+ function composeJsPlugins(plugins) {
3912
+ const newPlugins = [];
3913
+ const toBeComposed = [];
3914
+ plugins.forEach((plugin) => {
3915
+ if (isComposablePlugin(plugin)) toBeComposed.push(plugin);
3916
+ else {
3917
+ if (toBeComposed.length > 0) {
3918
+ if (toBeComposed.length > 1) newPlugins.push(createComposedPlugin(toBeComposed));
3919
+ else newPlugins.push(toBeComposed[0]);
3920
+ toBeComposed.length = 0;
3921
+ }
3922
+ newPlugins.push(plugin);
3923
+ }
3924
+ });
3925
+ if (toBeComposed.length > 0) {
3926
+ if (toBeComposed.length > 1) newPlugins.push(createComposedPlugin(toBeComposed));
3927
+ else newPlugins.push(toBeComposed[0]);
3928
+ toBeComposed.length = 0;
3929
+ }
3930
+ return newPlugins;
3931
+ }
3932
+ var unsupportedHookName, unsupportedHooks;
3933
+ var init_compose_js_plugins = __esm({ "src/utils/compose-js-plugins.ts"() {
3934
+ init_dist();
3935
+ init_constructors();
3936
+ init_plugin_context$1();
3937
+ init_misc();
3938
+ init_normalize_hook();
3939
+ init_plugin();
3940
+ unsupportedHookName = [
3941
+ "augmentChunkHash",
3942
+ "generateBundle",
3943
+ "moduleParsed",
3944
+ "onLog",
3945
+ "options",
3946
+ "outputOptions",
3947
+ "renderError",
3948
+ "renderStart",
3949
+ "resolveDynamicImport",
3950
+ "writeBundle"
3951
+ ];
3952
+ unsupportedHooks = new Set(unsupportedHookName);
3953
+ } });
3954
+
3955
+ //#endregion
3956
+ //#region src/utils/initialize-parallel-plugins.ts
3957
+ async function initializeParallelPlugins(plugins) {
3958
+ const pluginInfos = [];
3959
+ for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
3960
+ const { fileUrl, options } = plugin._parallel;
3961
+ pluginInfos.push({
3962
+ index,
3963
+ fileUrl,
3964
+ options
3965
+ });
3966
+ }
3967
+ if (pluginInfos.length <= 0) return void 0;
3968
+ const count = Math.min(availableParallelism(), 8);
3969
+ const parallelJsPluginRegistry = new import_binding.ParallelJsPluginRegistry(count);
3970
+ const registryId = parallelJsPluginRegistry.id;
3971
+ const workers = await initializeWorkers(registryId, count, pluginInfos);
3972
+ const stopWorkers = async () => {
3973
+ await Promise.all(workers.map((worker) => worker.terminate()));
3974
+ };
3975
+ return {
3976
+ registry: parallelJsPluginRegistry,
3977
+ stopWorkers
3978
+ };
3979
+ }
3980
+ function initializeWorkers(registryId, count, pluginInfos) {
3981
+ return Promise.all(Array.from({ length: count }, (_, i$21) => initializeWorker(registryId, pluginInfos, i$21)));
3982
+ }
3983
+ async function initializeWorker(registryId, pluginInfos, threadNumber) {
3984
+ const urlString = import.meta.resolve("#parallel-plugin-worker");
3985
+ const workerData$1 = {
3986
+ registryId,
3987
+ pluginInfos,
3988
+ threadNumber
3989
+ };
3990
+ let worker;
3991
+ try {
3992
+ worker = new Worker(new URL(urlString), { workerData: workerData$1 });
3993
+ worker.unref();
3994
+ await new Promise((resolve, reject) => {
3995
+ worker.once("message", async (message) => {
3996
+ if (message.type === "error") reject(message.error);
3997
+ else resolve();
3998
+ });
3999
+ });
4000
+ return worker;
4001
+ } catch (e$5) {
4002
+ worker?.terminate();
4003
+ throw e$5;
4004
+ }
4005
+ }
4006
+ var init_initialize_parallel_plugins = __esm({ "src/utils/initialize-parallel-plugins.ts"() {} });
4007
+
4008
+ //#endregion
4009
+ //#region src/utils/create-bundler-option.ts
4010
+ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isClose) {
4011
+ const inputPlugins = await normalizePluginOption(inputOptions.plugins);
4012
+ const outputPlugins = await normalizePluginOption(outputOptions.plugins);
4013
+ const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
4014
+ const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
4015
+ if (!isClose) outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
4016
+ if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, logMinifyWarning());
4017
+ const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
4018
+ let plugins = [...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX), ...checkOutputPluginOption(normalizePlugins(normalizedOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)];
4019
+ if (inputOptions.experimental?.enableComposingJsPlugins ?? false) plugins = composeJsPlugins(plugins);
4020
+ const parallelPluginInitResult = await initializeParallelPlugins(plugins);
4021
+ try {
4022
+ const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode);
4023
+ const bindingOutputOptions = bindingifyOutputOptions(outputOptions);
4024
+ return {
4025
+ bundlerOptions: {
4026
+ inputOptions: bindingInputOptions,
4027
+ outputOptions: bindingOutputOptions,
4028
+ parallelPluginsRegistry: parallelPluginInitResult?.registry
4029
+ },
4030
+ inputOptions,
4031
+ onLog,
4032
+ stopWorkers: parallelPluginInitResult?.stopWorkers
4033
+ };
4034
+ } catch (e$5) {
4035
+ await parallelPluginInitResult?.stopWorkers();
4036
+ throw e$5;
4037
+ }
4038
+ }
4039
+ var init_create_bundler_option = __esm({ "src/utils/create-bundler-option.ts"() {
4040
+ init_logger();
4041
+ init_logging();
4042
+ init_logs();
4043
+ init_plugin_driver();
4044
+ init_bindingify_input_options();
4045
+ init_bindingify_output_options();
4046
+ init_compose_js_plugins();
4047
+ init_initialize_parallel_plugins();
4048
+ init_normalize_plugin_option();
4049
+ } });
4050
+
4051
+ //#endregion
4052
+ //#region src/utils/create-bundler.ts
4053
+ async function createBundler(inputOptions, outputOptions, isClose) {
4054
+ const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
4055
+ if (asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
4056
+ try {
4057
+ return {
4058
+ bundler: new import_binding.Bundler(option.bundlerOptions),
4059
+ stopWorkers: option.stopWorkers,
4060
+ shutdown: () => {
4061
+ (0, import_binding.shutdownAsyncRuntime)();
4062
+ asyncRuntimeShutdown = true;
4063
+ }
4064
+ };
4065
+ } catch (e$5) {
4066
+ await option.stopWorkers?.();
4067
+ throw e$5;
4068
+ }
4069
+ }
4070
+ var asyncRuntimeShutdown;
4071
+ var init_create_bundler = __esm({ "src/utils/create-bundler.ts"() {
4072
+ init_create_bundler_option();
4073
+ asyncRuntimeShutdown = false;
4074
+ } });
4075
+
4076
+ //#endregion
4077
+ //#region src/api/rolldown/rolldown-build.ts
4078
+ var RolldownBuild;
4079
+ var init_rolldown_build = __esm({ "src/api/rolldown/rolldown-build.ts"() {
4080
+ init_create_bundler();
4081
+ init_transform_to_rollup_output();
4082
+ init_validator();
4083
+ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4084
+ RolldownBuild = class {
4085
+ #inputOptions;
4086
+ #bundler;
4087
+ constructor(inputOptions) {
4088
+ this.#inputOptions = inputOptions;
4089
+ }
4090
+ get closed() {
4091
+ return this.#bundler?.bundler.closed ?? false;
4092
+ }
4093
+ async #getBundlerWithStopWorker(outputOptions, isClose) {
4094
+ if (this.#bundler) await this.#bundler.stopWorkers?.();
4095
+ return this.#bundler = await createBundler(this.#inputOptions, outputOptions, isClose);
4096
+ }
4097
+ async generate(outputOptions = {}) {
4098
+ validateOption("output", outputOptions);
4099
+ const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4100
+ const output = await bundler.generate();
4101
+ return transformToRollupOutput(output);
4102
+ }
4103
+ async write(outputOptions = {}) {
4104
+ validateOption("output", outputOptions);
4105
+ const { bundler } = await this.#getBundlerWithStopWorker(outputOptions);
4106
+ const output = await bundler.write();
4107
+ return transformToRollupOutput(output);
4108
+ }
4109
+ async close() {
4110
+ const { bundler, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4111
+ await stopWorkers?.();
4112
+ await bundler.close();
4113
+ shutdown();
4114
+ }
4115
+ async [Symbol.asyncDispose]() {
4116
+ await this.close();
4117
+ }
4118
+ async generateHmrPatch(changedFiles) {
4119
+ return this.#bundler?.bundler.generateHmrPatch(changedFiles);
4120
+ }
4121
+ get watchFiles() {
4122
+ return this.#bundler?.bundler.watchFiles ?? [];
4123
+ }
4124
+ };
4125
+ } });
4126
+
4127
+ //#endregion
4128
+ //#region src/api/rolldown/index.ts
4129
+ var rolldown;
4130
+ var init_rolldown = __esm({ "src/api/rolldown/index.ts"() {
4131
+ init_plugin_driver();
4132
+ init_validator();
4133
+ init_rolldown_build();
4134
+ rolldown = async (input) => {
4135
+ validateOption("input", input);
4136
+ const inputOptions = await PluginDriver.callOptionsHook(input);
4137
+ return new RolldownBuild(inputOptions);
4138
+ };
4139
+ } });
4140
+
4141
+ //#endregion
4142
+ //#region src/api/build.ts
4143
+ async function build(options) {
4144
+ if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
4145
+ else {
4146
+ const { output, write = true,...inputOptions } = options;
4147
+ const build$1 = await rolldown(inputOptions);
4148
+ try {
4149
+ if (write) return await build$1.write(output);
4150
+ else return await build$1.generate(output);
4151
+ } finally {
4152
+ await build$1.close();
4153
+ }
4154
+ }
4155
+ }
4156
+ var init_build = __esm({ "src/api/build.ts"() {
4157
+ init_rolldown();
4158
+ } });
4159
+
4160
+ //#endregion
4161
+ //#region src/api/watch/watch-emitter.ts
4162
+ var WatcherEmitter;
4163
+ var init_watch_emitter = __esm({ "src/api/watch/watch-emitter.ts"() {
4164
+ init_error();
4165
+ WatcherEmitter = class {
4166
+ listeners = new Map();
4167
+ timer;
4168
+ constructor() {
4169
+ this.timer = setInterval(
4170
+ () => {},
4171
+ 1e9
4172
+ /* Low power usage */
4173
+ );
4174
+ }
4175
+ on(event, listener) {
4176
+ const listeners = this.listeners.get(event);
4177
+ if (listeners) listeners.push(listener);
4178
+ else this.listeners.set(event, [listener]);
4179
+ return this;
4180
+ }
4181
+ async onEvent(event) {
4182
+ const listeners = this.listeners.get(event.eventKind());
4183
+ if (listeners) switch (event.eventKind()) {
4184
+ case "close":
4185
+ case "restart":
4186
+ for (const listener of listeners) await listener();
4187
+ break;
4188
+ case "event":
4189
+ for (const listener of listeners) {
4190
+ const code = event.bundleEventKind();
4191
+ switch (code) {
4192
+ case "BUNDLE_END":
4193
+ const { duration, output } = event.bundleEndData();
4194
+ await listener({
4195
+ code: "BUNDLE_END",
4196
+ duration,
4197
+ output: [output]
4198
+ });
4199
+ break;
4200
+ case "ERROR":
4201
+ const errors = event.errors();
4202
+ await listener({
4203
+ code: "ERROR",
4204
+ error: normalizeErrors(errors)
4205
+ });
4206
+ break;
4207
+ default:
4208
+ await listener({ code });
4209
+ break;
4210
+ }
4211
+ }
4212
+ break;
4213
+ case "change":
4214
+ for (const listener of listeners) {
4215
+ const { path: path$1, kind } = event.watchChangeData();
4216
+ await listener(path$1, { event: kind });
4217
+ }
4218
+ break;
4219
+ default: throw new Error(`Unknown event: ${event}`);
4220
+ }
4221
+ }
4222
+ async close() {
4223
+ clearInterval(this.timer);
4224
+ }
4225
+ };
4226
+ } });
4227
+
4228
+ //#endregion
4229
+ //#region src/api/watch/watcher.ts
4230
+ async function createWatcher(emitter, input) {
4231
+ const options = arraify(input);
4232
+ const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
4233
+ const inputOptions = await PluginDriver.callOptionsHook(option, true);
4234
+ return createBundlerOptions(inputOptions, output, true);
4235
+ })).flat());
4236
+ const notifyOptions = getValidNotifyOption(bundlerOptions);
4237
+ const bindingWatcher = new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
4238
+ const watcher = new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers));
4239
+ watcher.start();
4240
+ }
4241
+ function getValidNotifyOption(bundlerOptions) {
4242
+ let result;
4243
+ for (const option of bundlerOptions) if (option.inputOptions.watch) {
4244
+ const notifyOption = option.inputOptions.watch.notify;
4245
+ if (notifyOption) if (result) {
4246
+ option.onLog(LOG_LEVEL_WARN, logMultiplyNotifyOption());
4247
+ return result;
4248
+ } else result = notifyOption;
4249
+ }
4250
+ }
4251
+ var Watcher;
4252
+ var init_watcher = __esm({ "src/api/watch/watcher.ts"() {
4253
+ init_logging();
4254
+ init_logs();
4255
+ init_plugin_driver();
4256
+ init_create_bundler_option();
4257
+ init_misc();
4258
+ Watcher = class {
4259
+ closed;
4260
+ inner;
4261
+ emitter;
4262
+ stopWorkers;
4263
+ constructor(emitter, inner, stopWorkers) {
4264
+ this.closed = false;
4265
+ this.inner = inner;
4266
+ this.emitter = emitter;
4267
+ const originClose = emitter.close.bind(emitter);
4268
+ emitter.close = async () => {
4269
+ await this.close();
4270
+ originClose();
4271
+ };
4272
+ this.stopWorkers = stopWorkers;
4273
+ }
4274
+ async close() {
4275
+ if (this.closed) return;
4276
+ this.closed = true;
4277
+ for (const stop of this.stopWorkers) await stop?.();
4278
+ await this.inner.close();
4279
+ (0, import_binding.shutdownAsyncRuntime)();
4280
+ }
4281
+ start() {
4282
+ process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
4283
+ }
4284
+ };
4285
+ } });
4286
+
4287
+ //#endregion
4288
+ //#region src/api/watch/index.ts
4289
+ var watch;
4290
+ var init_watch = __esm({ "src/api/watch/index.ts"() {
4291
+ init_watch_emitter();
4292
+ init_watcher();
4293
+ watch = (input) => {
4294
+ const emitter = new WatcherEmitter();
4295
+ createWatcher(emitter, input);
4296
+ return emitter;
4297
+ };
4298
+ } });
4299
+
4300
+ //#endregion
4301
+ //#region src/utils/define-config.ts
4302
+ function defineConfig(config) {
4303
+ return config;
4304
+ }
4305
+ var init_define_config = __esm({ "src/utils/define-config.ts"() {} });
4306
+
4307
+ //#endregion
4308
+ //#region src/index.ts
4309
+ var VERSION;
4310
+ var init_src = __esm({ "src/index.ts"() {
4311
+ init_build();
4312
+ init_rolldown();
4313
+ init_watch();
4314
+ init_define_config();
4315
+ VERSION = version;
4316
+ } });
4317
+
4318
+ //#endregion
4319
+ export { BuiltinPlugin, PluginContextData, VERSION, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, init_bindingify_plugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_misc, init_normalize_string_or_regex, init_plugin_context_data, init_rolldown, init_src, init_transform_to_rollup_output, init_validator, init_watch, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };