conventional-changelog-storm-software 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +278 -0
  3. package/dist/chunk-2MZWLEPP.js +132 -0
  4. package/dist/chunk-3KLR5ZGK.js +1 -0
  5. package/dist/chunk-5GQ7ZUDG.cjs +2 -0
  6. package/dist/chunk-63544DKM.js +153 -0
  7. package/dist/chunk-DL5576FZ.cjs +10 -0
  8. package/dist/chunk-HVVJTAOT.cjs +160 -0
  9. package/dist/chunk-I6KKIB6V.js +77 -0
  10. package/dist/chunk-IJLTWVLG.js +57 -0
  11. package/dist/chunk-KRZANN66.cjs +82 -0
  12. package/dist/chunk-KTGUQC7L.js +1 -0
  13. package/dist/chunk-LPCM2SVA.js +45 -0
  14. package/dist/chunk-M7BTBQHL.cjs +134 -0
  15. package/dist/chunk-O35EG2LQ.js +8 -0
  16. package/dist/chunk-RR5776TG.cjs +7 -0
  17. package/dist/chunk-S5TOCB3P.js +1 -0
  18. package/dist/chunk-SPHHWYOU.cjs +2 -0
  19. package/dist/chunk-UK5DQTL2.cjs +47 -0
  20. package/dist/chunk-UXD2EFE6.js +1 -0
  21. package/dist/chunk-UZZOYD6Y.cjs +2360 -0
  22. package/dist/chunk-XHJNEOAM.cjs +2 -0
  23. package/dist/chunk-YBJMQHWU.cjs +67 -0
  24. package/dist/chunk-ZLZS2G36.js +2353 -0
  25. package/dist/chunk-ZPVHPMDE.cjs +2 -0
  26. package/dist/commit-types.cjs +11 -0
  27. package/dist/commit-types.d.cts +130 -0
  28. package/dist/commit-types.d.ts +130 -0
  29. package/dist/commit-types.js +1 -0
  30. package/dist/index.cjs +36 -0
  31. package/dist/index.d.cts +16 -0
  32. package/dist/index.d.ts +16 -0
  33. package/dist/index.js +23 -0
  34. package/dist/parser.cjs +13 -0
  35. package/dist/parser.d.cts +12 -0
  36. package/dist/parser.d.ts +12 -0
  37. package/dist/parser.js +3 -0
  38. package/dist/types/commit-types.cjs +4 -0
  39. package/dist/types/commit-types.d.cts +19 -0
  40. package/dist/types/commit-types.d.ts +19 -0
  41. package/dist/types/commit-types.js +1 -0
  42. package/dist/types/config.cjs +5 -0
  43. package/dist/types/config.d.cts +67 -0
  44. package/dist/types/config.d.ts +67 -0
  45. package/dist/types/config.js +1 -0
  46. package/dist/types/index.cjs +8 -0
  47. package/dist/types/index.d.cts +5 -0
  48. package/dist/types/index.d.ts +5 -0
  49. package/dist/types/index.js +4 -0
  50. package/dist/types/misc.cjs +5 -0
  51. package/dist/types/misc.d.cts +3 -0
  52. package/dist/types/misc.d.ts +3 -0
  53. package/dist/types/misc.js +1 -0
  54. package/dist/types/preset.cjs +5 -0
  55. package/dist/types/preset.d.cts +12 -0
  56. package/dist/types/preset.d.ts +12 -0
  57. package/dist/types/preset.js +1 -0
  58. package/dist/types/write.cjs +5 -0
  59. package/dist/types/write.d.cts +78 -0
  60. package/dist/types/write.d.ts +78 -0
  61. package/dist/types/write.js +1 -0
  62. package/dist/utilities/constants.cjs +44 -0
  63. package/dist/utilities/constants.d.cts +75 -0
  64. package/dist/utilities/constants.d.ts +75 -0
  65. package/dist/utilities/constants.js +2 -0
  66. package/dist/utilities/helpers.cjs +25 -0
  67. package/dist/utilities/helpers.d.cts +30 -0
  68. package/dist/utilities/helpers.d.ts +30 -0
  69. package/dist/utilities/helpers.js +3 -0
  70. package/dist/utilities/index.cjs +66 -0
  71. package/dist/utilities/index.d.cts +6 -0
  72. package/dist/utilities/index.d.ts +6 -0
  73. package/dist/utilities/index.js +4 -0
  74. package/dist/utilities/options.cjs +14 -0
  75. package/dist/utilities/options.d.cts +12 -0
  76. package/dist/utilities/options.d.ts +12 -0
  77. package/dist/utilities/options.js +4 -0
  78. package/dist/whatBump.cjs +14 -0
  79. package/dist/whatBump.d.cts +6 -0
  80. package/dist/whatBump.d.ts +6 -0
  81. package/dist/whatBump.js +4 -0
  82. package/dist/writer.cjs +14 -0
  83. package/dist/writer.d.cts +13 -0
  84. package/dist/writer.d.ts +13 -0
  85. package/dist/writer.js +4 -0
  86. package/package.json +203 -0
  87. package/templates/templates/commit.hbd +29 -0
  88. package/templates/templates/footer.hbd +9 -0
  89. package/templates/templates/header.hbd +9 -0
  90. package/templates/templates/template.hbd +21 -0
@@ -0,0 +1,2353 @@
1
+ import { formatDate } from './chunk-I6KKIB6V.js';
2
+ import { CHANGELOG_COMMITS } from './chunk-IJLTWVLG.js';
3
+ import { existsSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import chalk from 'chalk';
6
+ import { loadConfig } from 'c12';
7
+ import defu from 'defu';
8
+ import { readFile } from 'node:fs/promises';
9
+
10
+ var MAX_PATH_SEARCH_DEPTH = 30;
11
+ var depth = 0;
12
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
13
+ const _startPath = startPath ?? process.cwd();
14
+ if (endDirectoryNames.some(
15
+ (endDirName) => existsSync(join(_startPath, endDirName))
16
+ )) {
17
+ return _startPath;
18
+ }
19
+ if (endFileNames.some(
20
+ (endFileName) => existsSync(join(_startPath, endFileName))
21
+ )) {
22
+ return _startPath;
23
+ }
24
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
25
+ const parent = join(_startPath, "..");
26
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
27
+ }
28
+ return void 0;
29
+ }
30
+
31
+ // ../config-tools/dist/chunk-7IMLZPZF.js
32
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
33
+ function normalizeWindowsPath(input = "") {
34
+ if (!input) {
35
+ return input;
36
+ }
37
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r2) => r2.toUpperCase());
38
+ }
39
+ var _UNC_REGEX = /^[/\\]{2}/;
40
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
41
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
42
+ var correctPaths = function(path) {
43
+ if (!path || path.length === 0) {
44
+ return ".";
45
+ }
46
+ path = normalizeWindowsPath(path);
47
+ const isUNCPath = path.match(_UNC_REGEX);
48
+ const isPathAbsolute = isAbsolute(path);
49
+ const trailingSeparator = path[path.length - 1] === "/";
50
+ path = normalizeString(path, !isPathAbsolute);
51
+ if (path.length === 0) {
52
+ if (isPathAbsolute) {
53
+ return "/";
54
+ }
55
+ return trailingSeparator ? "./" : ".";
56
+ }
57
+ if (trailingSeparator) {
58
+ path += "/";
59
+ }
60
+ if (_DRIVE_LETTER_RE.test(path)) {
61
+ path += "/";
62
+ }
63
+ if (isUNCPath) {
64
+ if (!isPathAbsolute) {
65
+ return `//./${path}`;
66
+ }
67
+ return `//${path}`;
68
+ }
69
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
70
+ };
71
+ var joinPaths = function(...segments) {
72
+ let path = "";
73
+ for (const seg of segments) {
74
+ if (!seg) {
75
+ continue;
76
+ }
77
+ if (path.length > 0) {
78
+ const pathTrailing = path[path.length - 1] === "/";
79
+ const segLeading = seg[0] === "/";
80
+ const both = pathTrailing && segLeading;
81
+ if (both) {
82
+ path += seg.slice(1);
83
+ } else {
84
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
85
+ }
86
+ } else {
87
+ path += seg;
88
+ }
89
+ }
90
+ return correctPaths(path);
91
+ };
92
+ function normalizeString(path, allowAboveRoot) {
93
+ let res = "";
94
+ let lastSegmentLength = 0;
95
+ let lastSlash = -1;
96
+ let dots = 0;
97
+ let char = null;
98
+ for (let index = 0; index <= path.length; ++index) {
99
+ if (index < path.length) {
100
+ char = path[index];
101
+ } else if (char === "/") {
102
+ break;
103
+ } else {
104
+ char = "/";
105
+ }
106
+ if (char === "/") {
107
+ if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
108
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
109
+ if (res.length > 2) {
110
+ const lastSlashIndex = res.lastIndexOf("/");
111
+ if (lastSlashIndex === -1) {
112
+ res = "";
113
+ lastSegmentLength = 0;
114
+ } else {
115
+ res = res.slice(0, lastSlashIndex);
116
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
117
+ }
118
+ lastSlash = index;
119
+ dots = 0;
120
+ continue;
121
+ } else if (res.length > 0) {
122
+ res = "";
123
+ lastSegmentLength = 0;
124
+ lastSlash = index;
125
+ dots = 0;
126
+ continue;
127
+ }
128
+ }
129
+ if (allowAboveRoot) {
130
+ res += res.length > 0 ? "/.." : "..";
131
+ lastSegmentLength = 2;
132
+ }
133
+ } else {
134
+ if (res.length > 0) {
135
+ res += `/${path.slice(lastSlash + 1, index)}`;
136
+ } else {
137
+ res = path.slice(lastSlash + 1, index);
138
+ }
139
+ lastSegmentLength = index - lastSlash - 1;
140
+ }
141
+ lastSlash = index;
142
+ dots = 0;
143
+ } else if (char === "." && dots !== -1) {
144
+ ++dots;
145
+ } else {
146
+ dots = -1;
147
+ }
148
+ }
149
+ return res;
150
+ }
151
+ var isAbsolute = function(p3) {
152
+ return _IS_ABSOLUTE_RE.test(p3);
153
+ };
154
+
155
+ // ../config-tools/dist/chunk-SZXSPLS6.js
156
+ var rootFiles = [
157
+ "storm-workspace.json",
158
+ "storm-workspace.yaml",
159
+ "storm-workspace.yml",
160
+ "storm-workspace.js",
161
+ "storm-workspace.ts",
162
+ ".storm-workspace.json",
163
+ ".storm-workspace.yaml",
164
+ ".storm-workspace.yml",
165
+ ".storm-workspace.js",
166
+ ".storm-workspace.ts",
167
+ "lerna.json",
168
+ "nx.json",
169
+ "turbo.json",
170
+ "npm-workspace.json",
171
+ "yarn-workspace.json",
172
+ "pnpm-workspace.json",
173
+ "npm-workspace.yaml",
174
+ "yarn-workspace.yaml",
175
+ "pnpm-workspace.yaml",
176
+ "npm-workspace.yml",
177
+ "yarn-workspace.yml",
178
+ "pnpm-workspace.yml",
179
+ "npm-lock.json",
180
+ "yarn-lock.json",
181
+ "pnpm-lock.json",
182
+ "npm-lock.yaml",
183
+ "yarn-lock.yaml",
184
+ "pnpm-lock.yaml",
185
+ "npm-lock.yml",
186
+ "yarn-lock.yml",
187
+ "pnpm-lock.yml",
188
+ "bun.lockb"
189
+ ];
190
+ var rootDirectories = [
191
+ ".storm-workspace",
192
+ ".nx",
193
+ ".github",
194
+ ".vscode",
195
+ ".verdaccio"
196
+ ];
197
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
198
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
199
+ return correctPaths(
200
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
201
+ );
202
+ }
203
+ return correctPaths(
204
+ findFolderUp(
205
+ pathInsideMonorepo ?? process.cwd(),
206
+ rootFiles,
207
+ rootDirectories
208
+ )
209
+ );
210
+ }
211
+ function findWorkspaceRoot(pathInsideMonorepo) {
212
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
213
+ if (!result) {
214
+ throw new Error(
215
+ `Cannot find workspace root upwards from known path. Files search list includes:
216
+ ${rootFiles.join(
217
+ "\n"
218
+ )}
219
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
220
+ );
221
+ }
222
+ return result;
223
+ }
224
+
225
+ // ../config-tools/dist/chunk-LA3S35UI.js
226
+ var DEFAULT_COLOR_CONFIG = {
227
+ dark: {
228
+ brand: "#2dd4bf",
229
+ success: "#10b981",
230
+ info: "#58a6ff",
231
+ warning: "#f3d371",
232
+ danger: "#D8314A",
233
+ fatal: "#a40e26"}
234
+ };
235
+ var chalkDefault = {
236
+ hex: (_3) => (message) => message,
237
+ bgHex: (_3) => ({
238
+ whiteBright: (message) => message,
239
+ white: (message) => message
240
+ }),
241
+ white: (message) => message,
242
+ whiteBright: (message) => message,
243
+ gray: (message) => message,
244
+ bold: {
245
+ hex: (_3) => (message) => message,
246
+ bgHex: (_3) => ({
247
+ whiteBright: (message) => message,
248
+ white: (message) => message
249
+ }),
250
+ whiteBright: (message) => message,
251
+ white: (message) => message
252
+ },
253
+ dim: {
254
+ hex: (_3) => (message) => message,
255
+ gray: (message) => message
256
+ }
257
+ };
258
+ var getChalk = () => {
259
+ let _chalk = chalk;
260
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
261
+ _chalk = chalkDefault;
262
+ }
263
+ return _chalk;
264
+ };
265
+
266
+ // ../config-tools/dist/chunk-G2MK47WL.js
267
+ function isUnicodeSupported() {
268
+ if (process.platform !== "win32") {
269
+ return process.env.TERM !== "linux";
270
+ }
271
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
272
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
273
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
274
+ process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
275
+ }
276
+
277
+ // ../config-tools/dist/chunk-POXTJ6GF.js
278
+ var LogLevel = {
279
+ SILENT: 0,
280
+ FATAL: 10,
281
+ ERROR: 20,
282
+ WARN: 30,
283
+ SUCCESS: 35,
284
+ INFO: 40,
285
+ DEBUG: 60,
286
+ TRACE: 70,
287
+ ALL: 100
288
+ };
289
+ var LogLevelLabel = {
290
+ SILENT: "silent",
291
+ FATAL: "fatal",
292
+ ERROR: "error",
293
+ WARN: "warn",
294
+ SUCCESS: "success",
295
+ INFO: "info",
296
+ DEBUG: "debug",
297
+ TRACE: "trace",
298
+ ALL: "all"
299
+ };
300
+
301
+ // ../config-tools/dist/chunk-LM2UMGYA.js
302
+ var useIcon = (c2, fallback) => isUnicodeSupported() ? c2 : fallback;
303
+ var CONSOLE_ICONS = {
304
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
305
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
306
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
307
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
308
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
309
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
310
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
311
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
312
+ };
313
+
314
+ // ../config-tools/dist/chunk-CZ4IE2QN.js
315
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
316
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
317
+ };
318
+
319
+ // ../config-tools/dist/chunk-K4CDYUQR.js
320
+ var getLogLevel = (label) => {
321
+ switch (label) {
322
+ case "all":
323
+ return LogLevel.ALL;
324
+ case "trace":
325
+ return LogLevel.TRACE;
326
+ case "debug":
327
+ return LogLevel.DEBUG;
328
+ case "info":
329
+ return LogLevel.INFO;
330
+ case "warn":
331
+ return LogLevel.WARN;
332
+ case "error":
333
+ return LogLevel.ERROR;
334
+ case "fatal":
335
+ return LogLevel.FATAL;
336
+ case "silent":
337
+ return LogLevel.SILENT;
338
+ default:
339
+ return LogLevel.INFO;
340
+ }
341
+ };
342
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
343
+ if (logLevel >= LogLevel.ALL) {
344
+ return LogLevelLabel.ALL;
345
+ }
346
+ if (logLevel >= LogLevel.TRACE) {
347
+ return LogLevelLabel.TRACE;
348
+ }
349
+ if (logLevel >= LogLevel.DEBUG) {
350
+ return LogLevelLabel.DEBUG;
351
+ }
352
+ if (logLevel >= LogLevel.INFO) {
353
+ return LogLevelLabel.INFO;
354
+ }
355
+ if (logLevel >= LogLevel.WARN) {
356
+ return LogLevelLabel.WARN;
357
+ }
358
+ if (logLevel >= LogLevel.ERROR) {
359
+ return LogLevelLabel.ERROR;
360
+ }
361
+ if (logLevel >= LogLevel.FATAL) {
362
+ return LogLevelLabel.FATAL;
363
+ }
364
+ if (logLevel <= LogLevel.SILENT) {
365
+ return LogLevelLabel.SILENT;
366
+ }
367
+ return LogLevelLabel.INFO;
368
+ };
369
+
370
+ // ../config-tools/dist/chunk-7L77OWOV.js
371
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
372
+ const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
373
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
374
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
375
+ return (_3) => {
376
+ };
377
+ }
378
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
379
+ return (message) => {
380
+ console.error(
381
+ `
382
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
383
+ `
384
+ );
385
+ };
386
+ }
387
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
388
+ return (message) => {
389
+ console.error(
390
+ `
391
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
392
+ `
393
+ );
394
+ };
395
+ }
396
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
397
+ return (message) => {
398
+ console.warn(
399
+ `
400
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
401
+ `
402
+ );
403
+ };
404
+ }
405
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
406
+ return (message) => {
407
+ console.info(
408
+ `
409
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
410
+ `
411
+ );
412
+ };
413
+ }
414
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
415
+ return (message) => {
416
+ console.info(
417
+ `
418
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
419
+ `
420
+ );
421
+ };
422
+ }
423
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
424
+ return (message) => {
425
+ console.debug(
426
+ `
427
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
428
+ `
429
+ );
430
+ };
431
+ }
432
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
433
+ return (message) => {
434
+ console.debug(
435
+ `
436
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
437
+ `
438
+ );
439
+ };
440
+ }
441
+ return (message) => {
442
+ console.log(
443
+ `
444
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
445
+ `
446
+ );
447
+ };
448
+ };
449
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
450
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
451
+ var MAX_DEPTH = 4;
452
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
453
+ if (depth2 > MAX_DEPTH) {
454
+ return "<max depth>";
455
+ }
456
+ const prefix = options.prefix ?? "-";
457
+ const skip = options.skip ?? [];
458
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
459
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
460
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
461
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
462
+ message[key],
463
+ { prefix: `${prefix}-`, skip },
464
+ depth2 + 1
465
+ ) : message[key]}`
466
+ ).join("\n")}` : message;
467
+ };
468
+ var _isFunction = (value) => {
469
+ try {
470
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
471
+ } catch {
472
+ return false;
473
+ }
474
+ };
475
+ var getConfigFileByName = async (fileName, filePath, options = {}) => {
476
+ const workspacePath = filePath || findWorkspaceRoot(filePath);
477
+ const configs = await Promise.all([
478
+ loadConfig({
479
+ cwd: workspacePath,
480
+ packageJson: true,
481
+ name: fileName,
482
+ envName: fileName?.toUpperCase(),
483
+ jitiOptions: {
484
+ debug: false,
485
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
486
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
487
+ "jiti"
488
+ )
489
+ },
490
+ ...options
491
+ }),
492
+ loadConfig({
493
+ cwd: workspacePath,
494
+ packageJson: true,
495
+ name: fileName,
496
+ envName: fileName?.toUpperCase(),
497
+ jitiOptions: {
498
+ debug: false,
499
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
500
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
501
+ "jiti"
502
+ )
503
+ },
504
+ configFile: fileName,
505
+ ...options
506
+ })
507
+ ]);
508
+ return defu(configs[0] ?? {}, configs[1] ?? {});
509
+ };
510
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
511
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
512
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
513
+ let config = result.config;
514
+ const configFile = result.configFile;
515
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
516
+ writeTrace(
517
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
518
+ {
519
+ logLevel: "all"
520
+ }
521
+ );
522
+ }
523
+ if (additionalFileNames && additionalFileNames.length > 0) {
524
+ const results = await Promise.all(
525
+ additionalFileNames.map(
526
+ (fileName) => getConfigFileByName(fileName, workspacePath)
527
+ )
528
+ );
529
+ for (const result2 of results) {
530
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
531
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
532
+ writeTrace(
533
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
534
+ {
535
+ logLevel: "all"
536
+ }
537
+ );
538
+ }
539
+ config = defu(result2.config ?? {}, config ?? {});
540
+ }
541
+ }
542
+ }
543
+ if (!config || Object.keys(config).length === 0) {
544
+ return void 0;
545
+ }
546
+ config.configFile = configFile;
547
+ return config;
548
+ };
549
+
550
+ // ../config/dist/chunk-TYDRIJER.js
551
+ var s = "https://docs.stormsoftware.com";
552
+ var r = "https://stormsoftware.com";
553
+ var a = "https://stormsoftware.com/license";
554
+ var i = "Apache-2.0";
555
+ var S = "tools/errors/codes.json";
556
+ var A = "The workspace's banner image";
557
+
558
+ // ../config/dist/chunk-WOT6VMZA.js
559
+ var d = Object.defineProperty;
560
+ var e2 = (c2, a2) => {
561
+ for (var b2 in a2) d(c2, b2, { get: a2[b2], enumerable: true });
562
+ };
563
+
564
+ // ../config/dist/chunk-UOSBSGBU.js
565
+ function f(e4, t3, r2) {
566
+ function n2(c2, s2) {
567
+ var d2;
568
+ Object.defineProperty(c2, "_zod", { value: c2._zod ?? {}, enumerable: false }), (d2 = c2._zod).traits ?? (d2.traits = /* @__PURE__ */ new Set()), c2._zod.traits.add(e4), t3(c2, s2);
569
+ for (let $ in o2.prototype) $ in c2 || Object.defineProperty(c2, $, { value: o2.prototype[$].bind(c2) });
570
+ c2._zod.constr = o2, c2._zod.def = s2;
571
+ }
572
+ let i2 = r2?.Parent ?? Object;
573
+ class a2 extends i2 {
574
+ }
575
+ Object.defineProperty(a2, "name", { value: e4 });
576
+ function o2(c2) {
577
+ var s2;
578
+ let d2 = r2?.Parent ? new a2() : this;
579
+ n2(d2, c2), (s2 = d2._zod).deferred ?? (s2.deferred = []);
580
+ for (let $ of d2._zod.deferred) $();
581
+ return d2;
582
+ }
583
+ return Object.defineProperty(o2, "init", { value: n2 }), Object.defineProperty(o2, Symbol.hasInstance, { value: (c2) => r2?.Parent && c2 instanceof r2.Parent ? true : c2?._zod?.traits?.has(e4) }), Object.defineProperty(o2, "name", { value: e4 }), o2;
584
+ }
585
+ var U = class extends Error {
586
+ constructor() {
587
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
588
+ }
589
+ };
590
+ var ze = {};
591
+ function O(e4) {
592
+ return ze;
593
+ }
594
+ var l = {};
595
+ e2(l, { BIGINT_FORMAT_RANGES: () => et, Class: () => we, NUMBER_FORMAT_RANGES: () => Qe, aborted: () => L, allowsEval: () => qe, assert: () => Qr, assertEqual: () => Xr, assertIs: () => Yr, assertNever: () => Hr, assertNotEqual: () => qr, assignProp: () => Z, base64ToUint8Array: () => rt, base64urlToUint8Array: () => hn, cached: () => ee, captureStackTrace: () => te, cleanEnum: () => vn, cleanRegex: () => W, clone: () => S2, cloneDef: () => tn, createTransparentProxy: () => cn, defineLazy: () => x, esc: () => Xe, escapeRegex: () => R, extend: () => dn, finalizeIssue: () => N, floatSafeRemainder: () => Ke, getElementAtPath: () => rn, getEnumValues: () => Q, getLengthableOrigin: () => Oe, getParsedType: () => un, getSizableOrigin: () => tt, hexToUint8Array: () => _n, isObject: () => G, isPlainObject: () => C, issue: () => Pe, joinValues: () => p, jsonStringifyReplacer: () => Ie, merge: () => pn, mergeDefs: () => D, normalizeParams: () => M, nullish: () => Se, numKeys: () => an, objectClone: () => en, omit: () => ln, optionalKeys: () => Ue, partial: () => fn, pick: () => sn, prefixIssues: () => P, primitiveTypes: () => He, promiseAllObject: () => nn, propertyKeyTypes: () => je, randomString: () => on, required: () => gn, safeExtend: () => mn, shallowClone: () => Ye, stringifyPrimitive: () => m, uint8ArrayToBase64: () => nt, uint8ArrayToBase64url: () => $n, uint8ArrayToHex: () => bn, unwrapMessage: () => J });
596
+ function Xr(e4) {
597
+ return e4;
598
+ }
599
+ function qr(e4) {
600
+ return e4;
601
+ }
602
+ function Yr(e4) {
603
+ }
604
+ function Hr(e4) {
605
+ throw new Error();
606
+ }
607
+ function Qr(e4) {
608
+ }
609
+ function Q(e4) {
610
+ let t3 = Object.values(e4).filter((n2) => typeof n2 == "number");
611
+ return Object.entries(e4).filter(([n2, i2]) => t3.indexOf(+n2) === -1).map(([n2, i2]) => i2);
612
+ }
613
+ function p(e4, t3 = "|") {
614
+ return e4.map((r2) => m(r2)).join(t3);
615
+ }
616
+ function Ie(e4, t3) {
617
+ return typeof t3 == "bigint" ? t3.toString() : t3;
618
+ }
619
+ function ee(e4) {
620
+ return { get value() {
621
+ {
622
+ let r2 = e4();
623
+ return Object.defineProperty(this, "value", { value: r2 }), r2;
624
+ }
625
+ } };
626
+ }
627
+ function Se(e4) {
628
+ return e4 == null;
629
+ }
630
+ function W(e4) {
631
+ let t3 = e4.startsWith("^") ? 1 : 0, r2 = e4.endsWith("$") ? e4.length - 1 : e4.length;
632
+ return e4.slice(t3, r2);
633
+ }
634
+ function Ke(e4, t3) {
635
+ let r2 = (e4.toString().split(".")[1] || "").length, n2 = t3.toString(), i2 = (n2.split(".")[1] || "").length;
636
+ if (i2 === 0 && /\d?e-\d?/.test(n2)) {
637
+ let s2 = n2.match(/\d?e-(\d?)/);
638
+ s2?.[1] && (i2 = Number.parseInt(s2[1]));
639
+ }
640
+ let a2 = r2 > i2 ? r2 : i2, o2 = Number.parseInt(e4.toFixed(a2).replace(".", "")), c2 = Number.parseInt(t3.toFixed(a2).replace(".", ""));
641
+ return o2 % c2 / 10 ** a2;
642
+ }
643
+ var Be = Symbol("evaluating");
644
+ function x(e4, t3, r2) {
645
+ let n2;
646
+ Object.defineProperty(e4, t3, { get() {
647
+ if (n2 !== Be) return n2 === void 0 && (n2 = Be, n2 = r2()), n2;
648
+ }, set(i2) {
649
+ Object.defineProperty(e4, t3, { value: i2 });
650
+ }, configurable: true });
651
+ }
652
+ function en(e4) {
653
+ return Object.create(Object.getPrototypeOf(e4), Object.getOwnPropertyDescriptors(e4));
654
+ }
655
+ function Z(e4, t3, r2) {
656
+ Object.defineProperty(e4, t3, { value: r2, writable: true, enumerable: true, configurable: true });
657
+ }
658
+ function D(...e4) {
659
+ let t3 = {};
660
+ for (let r2 of e4) {
661
+ let n2 = Object.getOwnPropertyDescriptors(r2);
662
+ Object.assign(t3, n2);
663
+ }
664
+ return Object.defineProperties({}, t3);
665
+ }
666
+ function tn(e4) {
667
+ return D(e4._zod.def);
668
+ }
669
+ function rn(e4, t3) {
670
+ return t3 ? t3.reduce((r2, n2) => r2?.[n2], e4) : e4;
671
+ }
672
+ function nn(e4) {
673
+ let t3 = Object.keys(e4), r2 = t3.map((n2) => e4[n2]);
674
+ return Promise.all(r2).then((n2) => {
675
+ let i2 = {};
676
+ for (let a2 = 0; a2 < t3.length; a2++) i2[t3[a2]] = n2[a2];
677
+ return i2;
678
+ });
679
+ }
680
+ function on(e4 = 10) {
681
+ let t3 = "abcdefghijklmnopqrstuvwxyz", r2 = "";
682
+ for (let n2 = 0; n2 < e4; n2++) r2 += t3[Math.floor(Math.random() * t3.length)];
683
+ return r2;
684
+ }
685
+ function Xe(e4) {
686
+ return JSON.stringify(e4);
687
+ }
688
+ var te = "captureStackTrace" in Error ? Error.captureStackTrace : (...e4) => {
689
+ };
690
+ function G(e4) {
691
+ return typeof e4 == "object" && e4 !== null && !Array.isArray(e4);
692
+ }
693
+ var qe = ee(() => {
694
+ if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return false;
695
+ try {
696
+ let e4 = Function;
697
+ return new e4(""), true;
698
+ } catch {
699
+ return false;
700
+ }
701
+ });
702
+ function C(e4) {
703
+ if (G(e4) === false) return false;
704
+ let t3 = e4.constructor;
705
+ if (t3 === void 0) return true;
706
+ let r2 = t3.prototype;
707
+ return !(G(r2) === false || Object.prototype.hasOwnProperty.call(r2, "isPrototypeOf") === false);
708
+ }
709
+ function Ye(e4) {
710
+ return C(e4) ? { ...e4 } : Array.isArray(e4) ? [...e4] : e4;
711
+ }
712
+ function an(e4) {
713
+ let t3 = 0;
714
+ for (let r2 in e4) Object.prototype.hasOwnProperty.call(e4, r2) && t3++;
715
+ return t3;
716
+ }
717
+ var un = (e4) => {
718
+ let t3 = typeof e4;
719
+ switch (t3) {
720
+ case "undefined":
721
+ return "undefined";
722
+ case "string":
723
+ return "string";
724
+ case "number":
725
+ return Number.isNaN(e4) ? "nan" : "number";
726
+ case "boolean":
727
+ return "boolean";
728
+ case "function":
729
+ return "function";
730
+ case "bigint":
731
+ return "bigint";
732
+ case "symbol":
733
+ return "symbol";
734
+ case "object":
735
+ return Array.isArray(e4) ? "array" : e4 === null ? "null" : e4.then && typeof e4.then == "function" && e4.catch && typeof e4.catch == "function" ? "promise" : typeof Map < "u" && e4 instanceof Map ? "map" : typeof Set < "u" && e4 instanceof Set ? "set" : typeof Date < "u" && e4 instanceof Date ? "date" : typeof File < "u" && e4 instanceof File ? "file" : "object";
736
+ default:
737
+ throw new Error(`Unknown data type: ${t3}`);
738
+ }
739
+ };
740
+ var je = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
741
+ var He = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
742
+ function R(e4) {
743
+ return e4.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
744
+ }
745
+ function S2(e4, t3, r2) {
746
+ let n2 = new e4._zod.constr(t3 ?? e4._zod.def);
747
+ return (!t3 || r2?.parent) && (n2._zod.parent = e4), n2;
748
+ }
749
+ function M(e4) {
750
+ let t3 = e4;
751
+ if (!t3) return {};
752
+ if (typeof t3 == "string") return { error: () => t3 };
753
+ if (t3?.message !== void 0) {
754
+ if (t3?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
755
+ t3.error = t3.message;
756
+ }
757
+ return delete t3.message, typeof t3.error == "string" ? { ...t3, error: () => t3.error } : t3;
758
+ }
759
+ function cn(e4) {
760
+ let t3;
761
+ return new Proxy({}, { get(r2, n2, i2) {
762
+ return t3 ?? (t3 = e4()), Reflect.get(t3, n2, i2);
763
+ }, set(r2, n2, i2, a2) {
764
+ return t3 ?? (t3 = e4()), Reflect.set(t3, n2, i2, a2);
765
+ }, has(r2, n2) {
766
+ return t3 ?? (t3 = e4()), Reflect.has(t3, n2);
767
+ }, deleteProperty(r2, n2) {
768
+ return t3 ?? (t3 = e4()), Reflect.deleteProperty(t3, n2);
769
+ }, ownKeys(r2) {
770
+ return t3 ?? (t3 = e4()), Reflect.ownKeys(t3);
771
+ }, getOwnPropertyDescriptor(r2, n2) {
772
+ return t3 ?? (t3 = e4()), Reflect.getOwnPropertyDescriptor(t3, n2);
773
+ }, defineProperty(r2, n2, i2) {
774
+ return t3 ?? (t3 = e4()), Reflect.defineProperty(t3, n2, i2);
775
+ } });
776
+ }
777
+ function m(e4) {
778
+ return typeof e4 == "bigint" ? e4.toString() + "n" : typeof e4 == "string" ? `"${e4}"` : `${e4}`;
779
+ }
780
+ function Ue(e4) {
781
+ return Object.keys(e4).filter((t3) => e4[t3]._zod.optin === "optional" && e4[t3]._zod.optout === "optional");
782
+ }
783
+ var Qe = { safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], int32: [-2147483648, 2147483647], uint32: [0, 4294967295], float32: [-34028234663852886e22, 34028234663852886e22], float64: [-Number.MAX_VALUE, Number.MAX_VALUE] };
784
+ var et = { int64: [BigInt("-9223372036854775808"), BigInt("9223372036854775807")], uint64: [BigInt(0), BigInt("18446744073709551615")] };
785
+ function sn(e4, t3) {
786
+ let r2 = e4._zod.def, n2 = D(e4._zod.def, { get shape() {
787
+ let i2 = {};
788
+ for (let a2 in t3) {
789
+ if (!(a2 in r2.shape)) throw new Error(`Unrecognized key: "${a2}"`);
790
+ t3[a2] && (i2[a2] = r2.shape[a2]);
791
+ }
792
+ return Z(this, "shape", i2), i2;
793
+ }, checks: [] });
794
+ return S2(e4, n2);
795
+ }
796
+ function ln(e4, t3) {
797
+ let r2 = e4._zod.def, n2 = D(e4._zod.def, { get shape() {
798
+ let i2 = { ...e4._zod.def.shape };
799
+ for (let a2 in t3) {
800
+ if (!(a2 in r2.shape)) throw new Error(`Unrecognized key: "${a2}"`);
801
+ t3[a2] && delete i2[a2];
802
+ }
803
+ return Z(this, "shape", i2), i2;
804
+ }, checks: [] });
805
+ return S2(e4, n2);
806
+ }
807
+ function dn(e4, t3) {
808
+ if (!C(t3)) throw new Error("Invalid input to extend: expected a plain object");
809
+ let r2 = e4._zod.def.checks;
810
+ if (r2 && r2.length > 0) throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
811
+ let i2 = D(e4._zod.def, { get shape() {
812
+ let a2 = { ...e4._zod.def.shape, ...t3 };
813
+ return Z(this, "shape", a2), a2;
814
+ }, checks: [] });
815
+ return S2(e4, i2);
816
+ }
817
+ function mn(e4, t3) {
818
+ if (!C(t3)) throw new Error("Invalid input to safeExtend: expected a plain object");
819
+ let r2 = { ...e4._zod.def, get shape() {
820
+ let n2 = { ...e4._zod.def.shape, ...t3 };
821
+ return Z(this, "shape", n2), n2;
822
+ }, checks: e4._zod.def.checks };
823
+ return S2(e4, r2);
824
+ }
825
+ function pn(e4, t3) {
826
+ let r2 = D(e4._zod.def, { get shape() {
827
+ let n2 = { ...e4._zod.def.shape, ...t3._zod.def.shape };
828
+ return Z(this, "shape", n2), n2;
829
+ }, get catchall() {
830
+ return t3._zod.def.catchall;
831
+ }, checks: [] });
832
+ return S2(e4, r2);
833
+ }
834
+ function fn(e4, t3, r2) {
835
+ let n2 = D(t3._zod.def, { get shape() {
836
+ let i2 = t3._zod.def.shape, a2 = { ...i2 };
837
+ if (r2) for (let o2 in r2) {
838
+ if (!(o2 in i2)) throw new Error(`Unrecognized key: "${o2}"`);
839
+ r2[o2] && (a2[o2] = e4 ? new e4({ type: "optional", innerType: i2[o2] }) : i2[o2]);
840
+ }
841
+ else for (let o2 in i2) a2[o2] = e4 ? new e4({ type: "optional", innerType: i2[o2] }) : i2[o2];
842
+ return Z(this, "shape", a2), a2;
843
+ }, checks: [] });
844
+ return S2(t3, n2);
845
+ }
846
+ function gn(e4, t3, r2) {
847
+ let n2 = D(t3._zod.def, { get shape() {
848
+ let i2 = t3._zod.def.shape, a2 = { ...i2 };
849
+ if (r2) for (let o2 in r2) {
850
+ if (!(o2 in a2)) throw new Error(`Unrecognized key: "${o2}"`);
851
+ r2[o2] && (a2[o2] = new e4({ type: "nonoptional", innerType: i2[o2] }));
852
+ }
853
+ else for (let o2 in i2) a2[o2] = new e4({ type: "nonoptional", innerType: i2[o2] });
854
+ return Z(this, "shape", a2), a2;
855
+ }, checks: [] });
856
+ return S2(t3, n2);
857
+ }
858
+ function L(e4, t3 = 0) {
859
+ if (e4.aborted === true) return true;
860
+ for (let r2 = t3; r2 < e4.issues.length; r2++) if (e4.issues[r2]?.continue !== true) return true;
861
+ return false;
862
+ }
863
+ function P(e4, t3) {
864
+ return t3.map((r2) => {
865
+ var n2;
866
+ return (n2 = r2).path ?? (n2.path = []), r2.path.unshift(e4), r2;
867
+ });
868
+ }
869
+ function J(e4) {
870
+ return typeof e4 == "string" ? e4 : e4?.message;
871
+ }
872
+ function N(e4, t3, r2) {
873
+ let n2 = { ...e4, path: e4.path ?? [] };
874
+ if (!e4.message) {
875
+ let i2 = J(e4.inst?._zod.def?.error?.(e4)) ?? J(t3?.error?.(e4)) ?? J(r2.customError?.(e4)) ?? J(r2.localeError?.(e4)) ?? "Invalid input";
876
+ n2.message = i2;
877
+ }
878
+ return delete n2.inst, delete n2.continue, t3?.reportInput || delete n2.input, n2;
879
+ }
880
+ function tt(e4) {
881
+ return e4 instanceof Set ? "set" : e4 instanceof Map ? "map" : e4 instanceof File ? "file" : "unknown";
882
+ }
883
+ function Oe(e4) {
884
+ return Array.isArray(e4) ? "array" : typeof e4 == "string" ? "string" : "unknown";
885
+ }
886
+ function Pe(...e4) {
887
+ let [t3, r2, n2] = e4;
888
+ return typeof t3 == "string" ? { message: t3, code: "custom", input: r2, inst: n2 } : { ...t3 };
889
+ }
890
+ function vn(e4) {
891
+ return Object.entries(e4).filter(([t3, r2]) => Number.isNaN(Number.parseInt(t3, 10))).map((t3) => t3[1]);
892
+ }
893
+ function rt(e4) {
894
+ let t3 = atob(e4), r2 = new Uint8Array(t3.length);
895
+ for (let n2 = 0; n2 < t3.length; n2++) r2[n2] = t3.charCodeAt(n2);
896
+ return r2;
897
+ }
898
+ function nt(e4) {
899
+ let t3 = "";
900
+ for (let r2 = 0; r2 < e4.length; r2++) t3 += String.fromCharCode(e4[r2]);
901
+ return btoa(t3);
902
+ }
903
+ function hn(e4) {
904
+ let t3 = e4.replace(/-/g, "+").replace(/_/g, "/"), r2 = "=".repeat((4 - t3.length % 4) % 4);
905
+ return rt(t3 + r2);
906
+ }
907
+ function $n(e4) {
908
+ return nt(e4).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
909
+ }
910
+ function _n(e4) {
911
+ let t3 = e4.replace(/^0x/, "");
912
+ if (t3.length % 2 !== 0) throw new Error("Invalid hex string length");
913
+ let r2 = new Uint8Array(t3.length / 2);
914
+ for (let n2 = 0; n2 < t3.length; n2 += 2) r2[n2 / 2] = Number.parseInt(t3.slice(n2, n2 + 2), 16);
915
+ return r2;
916
+ }
917
+ function bn(e4) {
918
+ return Array.from(e4).map((t3) => t3.toString(16).padStart(2, "0")).join("");
919
+ }
920
+ var we = class {
921
+ constructor(...t3) {
922
+ }
923
+ };
924
+ var it = (e4, t3) => {
925
+ e4.name = "$ZodError", Object.defineProperty(e4, "_zod", { value: e4._zod, enumerable: false }), Object.defineProperty(e4, "issues", { value: t3, enumerable: false }), e4.message = JSON.stringify(t3, Ie, 2), Object.defineProperty(e4, "toString", { value: () => e4.message, enumerable: false });
926
+ };
927
+ var ot = f("$ZodError", it);
928
+ var B = f("$ZodError", it, { Parent: Error });
929
+ var xn = (e4) => (t3, r2, n2, i2) => {
930
+ let a2 = n2 ? Object.assign(n2, { async: false }) : { async: false }, o2 = t3._zod.run({ value: r2, issues: [] }, a2);
931
+ if (o2 instanceof Promise) throw new U();
932
+ if (o2.issues.length) {
933
+ let c2 = new (i2?.Err ?? e4)(o2.issues.map((s2) => N(s2, a2, O())));
934
+ throw te(c2, i2?.callee), c2;
935
+ }
936
+ return o2.value;
937
+ };
938
+ var re = xn(B);
939
+ var zn = (e4) => async (t3, r2, n2, i2) => {
940
+ let a2 = n2 ? Object.assign(n2, { async: true }) : { async: true }, o2 = t3._zod.run({ value: r2, issues: [] }, a2);
941
+ if (o2 instanceof Promise && (o2 = await o2), o2.issues.length) {
942
+ let c2 = new (i2?.Err ?? e4)(o2.issues.map((s2) => N(s2, a2, O())));
943
+ throw te(c2, i2?.callee), c2;
944
+ }
945
+ return o2.value;
946
+ };
947
+ var ne = zn(B);
948
+ var kn = (e4) => (t3, r2, n2) => {
949
+ let i2 = n2 ? { ...n2, async: false } : { async: false }, a2 = t3._zod.run({ value: r2, issues: [] }, i2);
950
+ if (a2 instanceof Promise) throw new U();
951
+ return a2.issues.length ? { success: false, error: new (e4 ?? ot)(a2.issues.map((o2) => N(o2, i2, O()))) } : { success: true, data: a2.value };
952
+ };
953
+ var K = kn(B);
954
+ var wn = (e4) => async (t3, r2, n2) => {
955
+ let i2 = n2 ? Object.assign(n2, { async: true }) : { async: true }, a2 = t3._zod.run({ value: r2, issues: [] }, i2);
956
+ return a2 instanceof Promise && (a2 = await a2), a2.issues.length ? { success: false, error: new e4(a2.issues.map((o2) => N(o2, i2, O()))) } : { success: true, data: a2.value };
957
+ };
958
+ var X = wn(B);
959
+ var at = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
960
+ var ut = (e4) => {
961
+ let t3 = e4 ? `[\\s\\S]{${e4?.minimum ?? 0},${e4?.maximum ?? ""}}` : "[\\s\\S]*";
962
+ return new RegExp(`^${t3}$`);
963
+ };
964
+ var ct = /^(?:true|false)$/i;
965
+ var V = f("$ZodCheck", (e4, t3) => {
966
+ var r2;
967
+ e4._zod ?? (e4._zod = {}), e4._zod.def = t3, (r2 = e4._zod).onattach ?? (r2.onattach = []);
968
+ });
969
+ var st = f("$ZodCheckLengthEquals", (e4, t3) => {
970
+ var r2;
971
+ V.init(e4, t3), (r2 = e4._zod.def).when ?? (r2.when = (n2) => {
972
+ let i2 = n2.value;
973
+ return !Se(i2) && i2.length !== void 0;
974
+ }), e4._zod.onattach.push((n2) => {
975
+ let i2 = n2._zod.bag;
976
+ i2.minimum = t3.length, i2.maximum = t3.length, i2.length = t3.length;
977
+ }), e4._zod.check = (n2) => {
978
+ let i2 = n2.value, a2 = i2.length;
979
+ if (a2 === t3.length) return;
980
+ let o2 = Oe(i2), c2 = a2 > t3.length;
981
+ n2.issues.push({ origin: o2, ...c2 ? { code: "too_big", maximum: t3.length } : { code: "too_small", minimum: t3.length }, inclusive: true, exact: true, input: n2.value, inst: e4, continue: !t3.abort });
982
+ };
983
+ });
984
+ var Ne = f("$ZodCheckStringFormat", (e4, t3) => {
985
+ var r2, n2;
986
+ V.init(e4, t3), e4._zod.onattach.push((i2) => {
987
+ let a2 = i2._zod.bag;
988
+ a2.format = t3.format, t3.pattern && (a2.patterns ?? (a2.patterns = /* @__PURE__ */ new Set()), a2.patterns.add(t3.pattern));
989
+ }), t3.pattern ? (r2 = e4._zod).check ?? (r2.check = (i2) => {
990
+ t3.pattern.lastIndex = 0, !t3.pattern.test(i2.value) && i2.issues.push({ origin: "string", code: "invalid_format", format: t3.format, input: i2.value, ...t3.pattern ? { pattern: t3.pattern.toString() } : {}, inst: e4, continue: !t3.abort });
991
+ }) : (n2 = e4._zod).check ?? (n2.check = () => {
992
+ });
993
+ });
994
+ var lt = f("$ZodCheckRegex", (e4, t3) => {
995
+ Ne.init(e4, t3), e4._zod.check = (r2) => {
996
+ t3.pattern.lastIndex = 0, !t3.pattern.test(r2.value) && r2.issues.push({ origin: "string", code: "invalid_format", format: "regex", input: r2.value, pattern: t3.pattern.toString(), inst: e4, continue: !t3.abort });
997
+ };
998
+ });
999
+ var dt = f("$ZodCheckOverwrite", (e4, t3) => {
1000
+ V.init(e4, t3), e4._zod.check = (r2) => {
1001
+ r2.value = t3.tx(r2.value);
1002
+ };
1003
+ });
1004
+ var pt = { major: 4, minor: 1, patch: 8 };
1005
+ var y = f("$ZodType", (e4, t3) => {
1006
+ var r2;
1007
+ e4 ?? (e4 = {}), e4._zod.def = t3, e4._zod.bag = e4._zod.bag || {}, e4._zod.version = pt;
1008
+ let n2 = [...e4._zod.def.checks ?? []];
1009
+ e4._zod.traits.has("$ZodCheck") && n2.unshift(e4);
1010
+ for (let i2 of n2) for (let a2 of i2._zod.onattach) a2(e4);
1011
+ if (n2.length === 0) (r2 = e4._zod).deferred ?? (r2.deferred = []), e4._zod.deferred?.push(() => {
1012
+ e4._zod.run = e4._zod.parse;
1013
+ });
1014
+ else {
1015
+ let i2 = (o2, c2, s2) => {
1016
+ let d2 = L(o2), $;
1017
+ for (let I of c2) {
1018
+ if (I._zod.def.when) {
1019
+ if (!I._zod.def.when(o2)) continue;
1020
+ } else if (d2) continue;
1021
+ let E2 = o2.issues.length, A2 = I._zod.check(o2);
1022
+ if (A2 instanceof Promise && s2?.async === false) throw new U();
1023
+ if ($ || A2 instanceof Promise) $ = ($ ?? Promise.resolve()).then(async () => {
1024
+ await A2, o2.issues.length !== E2 && (d2 || (d2 = L(o2, E2)));
1025
+ });
1026
+ else {
1027
+ if (o2.issues.length === E2) continue;
1028
+ d2 || (d2 = L(o2, E2));
1029
+ }
1030
+ }
1031
+ return $ ? $.then(() => o2) : o2;
1032
+ }, a2 = (o2, c2, s2) => {
1033
+ if (L(o2)) return o2.aborted = true, o2;
1034
+ let d2 = i2(c2, n2, s2);
1035
+ if (d2 instanceof Promise) {
1036
+ if (s2.async === false) throw new U();
1037
+ return d2.then(($) => e4._zod.parse($, s2));
1038
+ }
1039
+ return e4._zod.parse(d2, s2);
1040
+ };
1041
+ e4._zod.run = (o2, c2) => {
1042
+ if (c2.skipChecks) return e4._zod.parse(o2, c2);
1043
+ if (c2.direction === "backward") {
1044
+ let d2 = e4._zod.parse({ value: o2.value, issues: [] }, { ...c2, skipChecks: true });
1045
+ return d2 instanceof Promise ? d2.then(($) => a2($, o2, c2)) : a2(d2, o2, c2);
1046
+ }
1047
+ let s2 = e4._zod.parse(o2, c2);
1048
+ if (s2 instanceof Promise) {
1049
+ if (c2.async === false) throw new U();
1050
+ return s2.then((d2) => i2(d2, n2, c2));
1051
+ }
1052
+ return i2(s2, n2, c2);
1053
+ };
1054
+ }
1055
+ e4["~standard"] = { validate: (i2) => {
1056
+ try {
1057
+ let a2 = K(e4, i2);
1058
+ return a2.success ? { value: a2.data } : { issues: a2.error?.issues };
1059
+ } catch {
1060
+ return X(e4, i2).then((o2) => o2.success ? { value: o2.data } : { issues: o2.error?.issues });
1061
+ }
1062
+ }, vendor: "zod", version: 1 };
1063
+ });
1064
+ var oe = f("$ZodString", (e4, t3) => {
1065
+ y.init(e4, t3), e4._zod.pattern = [...e4?._zod.bag?.patterns ?? []].pop() ?? ut(e4._zod.bag), e4._zod.parse = (r2, n2) => {
1066
+ if (t3.coerce) try {
1067
+ r2.value = String(r2.value);
1068
+ } catch {
1069
+ }
1070
+ return typeof r2.value == "string" || r2.issues.push({ expected: "string", code: "invalid_type", input: r2.value, inst: e4 }), r2;
1071
+ };
1072
+ });
1073
+ var Ze = f("$ZodStringFormat", (e4, t3) => {
1074
+ Ne.init(e4, t3), oe.init(e4, t3);
1075
+ });
1076
+ var $t = f("$ZodURL", (e4, t3) => {
1077
+ Ze.init(e4, t3), e4._zod.check = (r2) => {
1078
+ try {
1079
+ let n2 = r2.value.trim(), i2 = new URL(n2);
1080
+ t3.hostname && (t3.hostname.lastIndex = 0, t3.hostname.test(i2.hostname) || r2.issues.push({ code: "invalid_format", format: "url", note: "Invalid hostname", pattern: at.source, input: r2.value, inst: e4, continue: !t3.abort })), t3.protocol && (t3.protocol.lastIndex = 0, t3.protocol.test(i2.protocol.endsWith(":") ? i2.protocol.slice(0, -1) : i2.protocol) || r2.issues.push({ code: "invalid_format", format: "url", note: "Invalid protocol", pattern: t3.protocol.source, input: r2.value, inst: e4, continue: !t3.abort })), t3.normalize ? r2.value = i2.href : r2.value = n2;
1081
+ return;
1082
+ } catch {
1083
+ r2.issues.push({ code: "invalid_format", format: "url", input: r2.value, inst: e4, continue: !t3.abort });
1084
+ }
1085
+ };
1086
+ });
1087
+ var De = f("$ZodBoolean", (e4, t3) => {
1088
+ y.init(e4, t3), e4._zod.pattern = ct, e4._zod.parse = (r2, n2) => {
1089
+ if (t3.coerce) try {
1090
+ r2.value = !!r2.value;
1091
+ } catch {
1092
+ }
1093
+ let i2 = r2.value;
1094
+ return typeof i2 == "boolean" || r2.issues.push({ expected: "boolean", code: "invalid_type", input: i2, inst: e4 }), r2;
1095
+ };
1096
+ });
1097
+ var _t = f("$ZodAny", (e4, t3) => {
1098
+ y.init(e4, t3), e4._zod.parse = (r2) => r2;
1099
+ });
1100
+ function ft(e4, t3, r2) {
1101
+ e4.issues.length && t3.issues.push(...P(r2, e4.issues)), t3.value[r2] = e4.value;
1102
+ }
1103
+ var bt = f("$ZodArray", (e4, t3) => {
1104
+ y.init(e4, t3), e4._zod.parse = (r2, n2) => {
1105
+ let i2 = r2.value;
1106
+ if (!Array.isArray(i2)) return r2.issues.push({ expected: "array", code: "invalid_type", input: i2, inst: e4 }), r2;
1107
+ r2.value = Array(i2.length);
1108
+ let a2 = [];
1109
+ for (let o2 = 0; o2 < i2.length; o2++) {
1110
+ let c2 = i2[o2], s2 = t3.element._zod.run({ value: c2, issues: [] }, n2);
1111
+ s2 instanceof Promise ? a2.push(s2.then((d2) => ft(d2, r2, o2))) : ft(s2, r2, o2);
1112
+ }
1113
+ return a2.length ? Promise.all(a2).then(() => r2) : r2;
1114
+ };
1115
+ });
1116
+ function ie(e4, t3, r2, n2) {
1117
+ e4.issues.length && t3.issues.push(...P(r2, e4.issues)), e4.value === void 0 ? r2 in n2 && (t3.value[r2] = void 0) : t3.value[r2] = e4.value;
1118
+ }
1119
+ function jn(e4) {
1120
+ let t3 = Object.keys(e4.shape);
1121
+ for (let n2 of t3) if (!e4.shape?.[n2]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${n2}": expected a Zod schema`);
1122
+ let r2 = Ue(e4.shape);
1123
+ return { ...e4, keys: t3, keySet: new Set(t3), numKeys: t3.length, optionalKeys: new Set(r2) };
1124
+ }
1125
+ function Un(e4, t3, r2, n2, i2, a2) {
1126
+ let o2 = [], c2 = i2.keySet, s2 = i2.catchall._zod, d2 = s2.def.type;
1127
+ for (let $ of Object.keys(t3)) {
1128
+ if (c2.has($)) continue;
1129
+ if (d2 === "never") {
1130
+ o2.push($);
1131
+ continue;
1132
+ }
1133
+ let I = s2.run({ value: t3[$], issues: [] }, n2);
1134
+ I instanceof Promise ? e4.push(I.then((E2) => ie(E2, r2, $, t3))) : ie(I, r2, $, t3);
1135
+ }
1136
+ return o2.length && r2.issues.push({ code: "unrecognized_keys", keys: o2, input: t3, inst: a2 }), e4.length ? Promise.all(e4).then(() => r2) : r2;
1137
+ }
1138
+ var yt = f("$ZodObject", (e4, t3) => {
1139
+ y.init(e4, t3);
1140
+ let r2 = ee(() => jn(t3));
1141
+ x(e4._zod, "propValues", () => {
1142
+ let o2 = t3.shape, c2 = {};
1143
+ for (let s2 in o2) {
1144
+ let d2 = o2[s2]._zod;
1145
+ if (d2.values) {
1146
+ c2[s2] ?? (c2[s2] = /* @__PURE__ */ new Set());
1147
+ for (let $ of d2.values) c2[s2].add($);
1148
+ }
1149
+ }
1150
+ return c2;
1151
+ });
1152
+ let n2 = G, i2 = t3.catchall, a2;
1153
+ e4._zod.parse = (o2, c2) => {
1154
+ a2 ?? (a2 = r2.value);
1155
+ let s2 = o2.value;
1156
+ if (!n2(s2)) return o2.issues.push({ expected: "object", code: "invalid_type", input: s2, inst: e4 }), o2;
1157
+ o2.value = {};
1158
+ let d2 = [], $ = a2.shape;
1159
+ for (let I of a2.keys) {
1160
+ let A2 = $[I]._zod.run({ value: s2[I], issues: [] }, c2);
1161
+ A2 instanceof Promise ? d2.push(A2.then((H) => ie(H, o2, I, s2))) : ie(A2, o2, I, s2);
1162
+ }
1163
+ return i2 ? Un(d2, s2, o2, c2, r2.value, e4) : d2.length ? Promise.all(d2).then(() => o2) : o2;
1164
+ };
1165
+ });
1166
+ function gt(e4, t3, r2, n2) {
1167
+ for (let a2 of e4) if (a2.issues.length === 0) return t3.value = a2.value, t3;
1168
+ let i2 = e4.filter((a2) => !L(a2));
1169
+ return i2.length === 1 ? (t3.value = i2[0].value, i2[0]) : (t3.issues.push({ code: "invalid_union", input: t3.value, inst: r2, errors: e4.map((a2) => a2.issues.map((o2) => N(o2, n2, O()))) }), t3);
1170
+ }
1171
+ var xt = f("$ZodUnion", (e4, t3) => {
1172
+ y.init(e4, t3), x(e4._zod, "optin", () => t3.options.some((i2) => i2._zod.optin === "optional") ? "optional" : void 0), x(e4._zod, "optout", () => t3.options.some((i2) => i2._zod.optout === "optional") ? "optional" : void 0), x(e4._zod, "values", () => {
1173
+ if (t3.options.every((i2) => i2._zod.values)) return new Set(t3.options.flatMap((i2) => Array.from(i2._zod.values)));
1174
+ }), x(e4._zod, "pattern", () => {
1175
+ if (t3.options.every((i2) => i2._zod.pattern)) {
1176
+ let i2 = t3.options.map((a2) => a2._zod.pattern);
1177
+ return new RegExp(`^(${i2.map((a2) => W(a2.source)).join("|")})$`);
1178
+ }
1179
+ });
1180
+ let r2 = t3.options.length === 1, n2 = t3.options[0]._zod.run;
1181
+ e4._zod.parse = (i2, a2) => {
1182
+ if (r2) return n2(i2, a2);
1183
+ let o2 = false, c2 = [];
1184
+ for (let s2 of t3.options) {
1185
+ let d2 = s2._zod.run({ value: i2.value, issues: [] }, a2);
1186
+ if (d2 instanceof Promise) c2.push(d2), o2 = true;
1187
+ else {
1188
+ if (d2.issues.length === 0) return d2;
1189
+ c2.push(d2);
1190
+ }
1191
+ }
1192
+ return o2 ? Promise.all(c2).then((s2) => gt(s2, i2, e4, a2)) : gt(c2, i2, e4, a2);
1193
+ };
1194
+ });
1195
+ var zt = f("$ZodRecord", (e4, t3) => {
1196
+ y.init(e4, t3), e4._zod.parse = (r2, n2) => {
1197
+ let i2 = r2.value;
1198
+ if (!C(i2)) return r2.issues.push({ expected: "record", code: "invalid_type", input: i2, inst: e4 }), r2;
1199
+ let a2 = [];
1200
+ if (t3.keyType._zod.values) {
1201
+ let o2 = t3.keyType._zod.values;
1202
+ r2.value = {};
1203
+ for (let s2 of o2) if (typeof s2 == "string" || typeof s2 == "number" || typeof s2 == "symbol") {
1204
+ let d2 = t3.valueType._zod.run({ value: i2[s2], issues: [] }, n2);
1205
+ d2 instanceof Promise ? a2.push(d2.then(($) => {
1206
+ $.issues.length && r2.issues.push(...P(s2, $.issues)), r2.value[s2] = $.value;
1207
+ })) : (d2.issues.length && r2.issues.push(...P(s2, d2.issues)), r2.value[s2] = d2.value);
1208
+ }
1209
+ let c2;
1210
+ for (let s2 in i2) o2.has(s2) || (c2 = c2 ?? [], c2.push(s2));
1211
+ c2 && c2.length > 0 && r2.issues.push({ code: "unrecognized_keys", input: i2, inst: e4, keys: c2 });
1212
+ } else {
1213
+ r2.value = {};
1214
+ for (let o2 of Reflect.ownKeys(i2)) {
1215
+ if (o2 === "__proto__") continue;
1216
+ let c2 = t3.keyType._zod.run({ value: o2, issues: [] }, n2);
1217
+ if (c2 instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
1218
+ if (c2.issues.length) {
1219
+ r2.issues.push({ code: "invalid_key", origin: "record", issues: c2.issues.map((d2) => N(d2, n2, O())), input: o2, path: [o2], inst: e4 }), r2.value[c2.value] = c2.value;
1220
+ continue;
1221
+ }
1222
+ let s2 = t3.valueType._zod.run({ value: i2[o2], issues: [] }, n2);
1223
+ s2 instanceof Promise ? a2.push(s2.then((d2) => {
1224
+ d2.issues.length && r2.issues.push(...P(o2, d2.issues)), r2.value[c2.value] = d2.value;
1225
+ })) : (s2.issues.length && r2.issues.push(...P(o2, s2.issues)), r2.value[c2.value] = s2.value);
1226
+ }
1227
+ }
1228
+ return a2.length ? Promise.all(a2).then(() => r2) : r2;
1229
+ };
1230
+ });
1231
+ var kt = f("$ZodEnum", (e4, t3) => {
1232
+ y.init(e4, t3);
1233
+ let r2 = Q(t3.entries), n2 = new Set(r2);
1234
+ e4._zod.values = n2, e4._zod.pattern = new RegExp(`^(${r2.filter((i2) => je.has(typeof i2)).map((i2) => typeof i2 == "string" ? R(i2) : i2.toString()).join("|")})$`), e4._zod.parse = (i2, a2) => {
1235
+ let o2 = i2.value;
1236
+ return n2.has(o2) || i2.issues.push({ code: "invalid_value", values: r2, input: o2, inst: e4 }), i2;
1237
+ };
1238
+ });
1239
+ var wt = f("$ZodLiteral", (e4, t3) => {
1240
+ if (y.init(e4, t3), t3.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
1241
+ e4._zod.values = new Set(t3.values), e4._zod.pattern = new RegExp(`^(${t3.values.map((r2) => typeof r2 == "string" ? R(r2) : r2 ? R(r2.toString()) : String(r2)).join("|")})$`), e4._zod.parse = (r2, n2) => {
1242
+ let i2 = r2.value;
1243
+ return e4._zod.values.has(i2) || r2.issues.push({ code: "invalid_value", values: t3.values, input: i2, inst: e4 }), r2;
1244
+ };
1245
+ });
1246
+ function vt(e4, t3) {
1247
+ return e4.issues.length && t3 === void 0 ? { issues: [], value: void 0 } : e4;
1248
+ }
1249
+ var It = f("$ZodOptional", (e4, t3) => {
1250
+ y.init(e4, t3), e4._zod.optin = "optional", e4._zod.optout = "optional", x(e4._zod, "values", () => t3.innerType._zod.values ? /* @__PURE__ */ new Set([...t3.innerType._zod.values, void 0]) : void 0), x(e4._zod, "pattern", () => {
1251
+ let r2 = t3.innerType._zod.pattern;
1252
+ return r2 ? new RegExp(`^(${W(r2.source)})?$`) : void 0;
1253
+ }), e4._zod.parse = (r2, n2) => {
1254
+ if (t3.innerType._zod.optin === "optional") {
1255
+ let i2 = t3.innerType._zod.run(r2, n2);
1256
+ return i2 instanceof Promise ? i2.then((a2) => vt(a2, r2.value)) : vt(i2, r2.value);
1257
+ }
1258
+ return r2.value === void 0 ? r2 : t3.innerType._zod.run(r2, n2);
1259
+ };
1260
+ });
1261
+ var St = f("$ZodNullable", (e4, t3) => {
1262
+ y.init(e4, t3), x(e4._zod, "optin", () => t3.innerType._zod.optin), x(e4._zod, "optout", () => t3.innerType._zod.optout), x(e4._zod, "pattern", () => {
1263
+ let r2 = t3.innerType._zod.pattern;
1264
+ return r2 ? new RegExp(`^(${W(r2.source)}|null)$`) : void 0;
1265
+ }), x(e4._zod, "values", () => t3.innerType._zod.values ? /* @__PURE__ */ new Set([...t3.innerType._zod.values, null]) : void 0), e4._zod.parse = (r2, n2) => r2.value === null ? r2 : t3.innerType._zod.run(r2, n2);
1266
+ });
1267
+ var jt = f("$ZodDefault", (e4, t3) => {
1268
+ y.init(e4, t3), e4._zod.optin = "optional", x(e4._zod, "values", () => t3.innerType._zod.values), e4._zod.parse = (r2, n2) => {
1269
+ if (n2.direction === "backward") return t3.innerType._zod.run(r2, n2);
1270
+ if (r2.value === void 0) return r2.value = t3.defaultValue, r2;
1271
+ let i2 = t3.innerType._zod.run(r2, n2);
1272
+ return i2 instanceof Promise ? i2.then((a2) => ht(a2, t3)) : ht(i2, t3);
1273
+ };
1274
+ });
1275
+ function ht(e4, t3) {
1276
+ return e4.value === void 0 && (e4.value = t3.defaultValue), e4;
1277
+ }
1278
+ var ae = class {
1279
+ constructor() {
1280
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1281
+ }
1282
+ add(t3, ...r2) {
1283
+ let n2 = r2[0];
1284
+ if (this._map.set(t3, n2), n2 && typeof n2 == "object" && "id" in n2) {
1285
+ if (this._idmap.has(n2.id)) throw new Error(`ID ${n2.id} already exists in the registry`);
1286
+ this._idmap.set(n2.id, t3);
1287
+ }
1288
+ return this;
1289
+ }
1290
+ clear() {
1291
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1292
+ }
1293
+ remove(t3) {
1294
+ let r2 = this._map.get(t3);
1295
+ return r2 && typeof r2 == "object" && "id" in r2 && this._idmap.delete(r2.id), this._map.delete(t3), this;
1296
+ }
1297
+ get(t3) {
1298
+ let r2 = t3._zod.parent;
1299
+ if (r2) {
1300
+ let n2 = { ...this.get(r2) ?? {} };
1301
+ delete n2.id;
1302
+ let i2 = { ...n2, ...this._map.get(t3) };
1303
+ return Object.keys(i2).length ? i2 : void 0;
1304
+ }
1305
+ return this._map.get(t3);
1306
+ }
1307
+ has(t3) {
1308
+ return this._map.has(t3);
1309
+ }
1310
+ };
1311
+ function Te() {
1312
+ return new ae();
1313
+ }
1314
+ function Ot(e4, t3) {
1315
+ return new e4({ type: "string", ...M(t3) });
1316
+ }
1317
+ function Pt(e4, t3) {
1318
+ return new e4({ type: "string", format: "url", check: "string_format", abort: false, ...M(t3) });
1319
+ }
1320
+ function Nt(e4, t3) {
1321
+ return new e4({ type: "boolean", ...M(t3) });
1322
+ }
1323
+ function Zt(e4) {
1324
+ return new e4({ type: "any" });
1325
+ }
1326
+ function Ee(e4, t3) {
1327
+ return new st({ check: "length_equals", ...M(t3), length: e4 });
1328
+ }
1329
+ function Ae(e4, t3) {
1330
+ return new lt({ check: "string_format", format: "regex", ...M(t3), pattern: e4 });
1331
+ }
1332
+ function Me(e4) {
1333
+ return new dt({ check: "overwrite", tx: e4 });
1334
+ }
1335
+ function v() {
1336
+ return Me((e4) => e4.trim());
1337
+ }
1338
+ function z() {
1339
+ return Me((e4) => e4.toLowerCase());
1340
+ }
1341
+ var j = f("ZodMiniType", (e4, t3) => {
1342
+ if (!e4._zod) throw new Error("Uninitialized schema in ZodMiniType.");
1343
+ y.init(e4, t3), e4.def = t3, e4.type = t3.type, e4.parse = (r2, n2) => re(e4, r2, n2, { callee: e4.parse }), e4.safeParse = (r2, n2) => K(e4, r2, n2), e4.parseAsync = async (r2, n2) => ne(e4, r2, n2, { callee: e4.parseAsync }), e4.safeParseAsync = async (r2, n2) => X(e4, r2, n2), e4.check = (...r2) => e4.clone({ ...t3, checks: [...t3.checks ?? [], ...r2.map((n2) => typeof n2 == "function" ? { _zod: { check: n2, def: { check: "custom" }, onattach: [] } } : n2)] }), e4.clone = (r2, n2) => S2(e4, r2, n2), e4.brand = () => e4, e4.register = ((r2, n2) => (r2.add(e4, n2), e4));
1344
+ });
1345
+ var Le = f("ZodMiniString", (e4, t3) => {
1346
+ oe.init(e4, t3), j.init(e4, t3);
1347
+ });
1348
+ function g(e4) {
1349
+ return Ot(Le, e4);
1350
+ }
1351
+ var Dt = f("ZodMiniStringFormat", (e4, t3) => {
1352
+ Ze.init(e4, t3), Le.init(e4, t3);
1353
+ });
1354
+ var Mn = f("ZodMiniURL", (e4, t3) => {
1355
+ $t.init(e4, t3), Dt.init(e4, t3);
1356
+ });
1357
+ function k(e4) {
1358
+ return Pt(Mn, e4);
1359
+ }
1360
+ var Tt = f("ZodMiniBoolean", (e4, t3) => {
1361
+ De.init(e4, t3), j.init(e4, t3);
1362
+ });
1363
+ function Ce(e4) {
1364
+ return Nt(Tt, e4);
1365
+ }
1366
+ var Ln = f("ZodMiniAny", (e4, t3) => {
1367
+ _t.init(e4, t3), j.init(e4, t3);
1368
+ });
1369
+ function Et() {
1370
+ return Zt(Ln);
1371
+ }
1372
+ var Cn = f("ZodMiniArray", (e4, t3) => {
1373
+ bt.init(e4, t3), j.init(e4, t3);
1374
+ });
1375
+ function Re(e4, t3) {
1376
+ return new Cn({ type: "array", element: e4, ...l.normalizeParams(t3) });
1377
+ }
1378
+ var Rn = f("ZodMiniObject", (e4, t3) => {
1379
+ yt.init(e4, t3), j.init(e4, t3), l.defineLazy(e4, "shape", () => t3.shape);
1380
+ });
1381
+ function w(e4, t3) {
1382
+ let r2 = { type: "object", get shape() {
1383
+ return l.assignProp(this, "shape", { ...e4 }), this.shape;
1384
+ }, ...l.normalizeParams(t3) };
1385
+ return new Rn(r2);
1386
+ }
1387
+ var Vn = f("ZodMiniUnion", (e4, t3) => {
1388
+ xt.init(e4, t3), j.init(e4, t3);
1389
+ });
1390
+ function T(e4, t3) {
1391
+ return new Vn({ type: "union", options: e4, ...l.normalizeParams(t3) });
1392
+ }
1393
+ var Fn = f("ZodMiniRecord", (e4, t3) => {
1394
+ zt.init(e4, t3), j.init(e4, t3);
1395
+ });
1396
+ function Ve(e4, t3, r2) {
1397
+ return new Fn({ type: "record", keyType: e4, valueType: t3, ...l.normalizeParams(r2) });
1398
+ }
1399
+ var Jn = f("ZodMiniEnum", (e4, t3) => {
1400
+ kt.init(e4, t3), j.init(e4, t3), e4.options = Object.values(t3.entries);
1401
+ });
1402
+ function Y(e4, t3) {
1403
+ let r2 = Array.isArray(e4) ? Object.fromEntries(e4.map((n2) => [n2, n2])) : e4;
1404
+ return new Jn({ type: "enum", entries: r2, ...l.normalizeParams(t3) });
1405
+ }
1406
+ var Gn = f("ZodMiniLiteral", (e4, t3) => {
1407
+ wt.init(e4, t3), j.init(e4, t3);
1408
+ });
1409
+ function At(e4, t3) {
1410
+ return new Gn({ type: "literal", values: Array.isArray(e4) ? e4 : [e4], ...l.normalizeParams(t3) });
1411
+ }
1412
+ var Wn = f("ZodMiniOptional", (e4, t3) => {
1413
+ It.init(e4, t3), j.init(e4, t3);
1414
+ });
1415
+ function h(e4) {
1416
+ return new Wn({ type: "optional", innerType: e4 });
1417
+ }
1418
+ var Bn = f("ZodMiniNullable", (e4, t3) => {
1419
+ St.init(e4, t3), j.init(e4, t3);
1420
+ });
1421
+ function Mt(e4) {
1422
+ return new Bn({ type: "nullable", innerType: e4 });
1423
+ }
1424
+ var Kn = f("ZodMiniDefault", (e4, t3) => {
1425
+ jt.init(e4, t3), j.init(e4, t3);
1426
+ });
1427
+ function _(e4, t3) {
1428
+ return new Kn({ type: "default", innerType: e4, get defaultValue() {
1429
+ return typeof t3 == "function" ? t3() : l.shallowClone(t3);
1430
+ } });
1431
+ }
1432
+ var u = Te();
1433
+ var b = g().check(Ee(7), z(), Ae(/^#([0-9a-f]{3}){1,2}$/i), v());
1434
+ u.add(b, { description: "A base schema for describing the format of colors" });
1435
+ var ce = _(b, "#151718");
1436
+ u.add(ce, { description: "The dark background color of the workspace" });
1437
+ var se = _(b, "#cbd5e1");
1438
+ u.add(se, { description: "The light background color of the workspace" });
1439
+ var le = _(b, "#1fb2a6");
1440
+ u.add(le, { description: "The primary brand specific color of the workspace" });
1441
+ var de = h(b);
1442
+ u.add(de, { description: "The alternate brand specific color of the workspace" });
1443
+ var me = h(b);
1444
+ u.add(me, { description: "The secondary brand specific color of the workspace" });
1445
+ var pe = _(b, "#3fa6ff");
1446
+ u.add(pe, { description: "The color used to display hyperlink text" });
1447
+ var fe = _(b, "#818cf8");
1448
+ u.add(fe, { description: "The second brand specific color of the workspace" });
1449
+ var ge = _(b, "#45b27e");
1450
+ u.add(ge, { description: "The success color of the workspace" });
1451
+ var ve = _(b, "#38bdf8");
1452
+ u.add(ve, { description: "The informational color of the workspace" });
1453
+ var he = _(b, "#f3d371");
1454
+ u.add(he, { description: "The warning color of the workspace" });
1455
+ var $e = _(b, "#d8314a");
1456
+ u.add($e, { description: "The danger color of the workspace" });
1457
+ var _e = h(b);
1458
+ u.add(_e, { description: "The fatal color of the workspace" });
1459
+ var be = _(b, "#4ade80");
1460
+ u.add(be, { description: "The positive number color of the workspace" });
1461
+ var ye = _(b, "#ef4444");
1462
+ u.add(ye, { description: "The negative number color of the workspace" });
1463
+ var xe = h(Re(b));
1464
+ u.add(xe, { description: "The color stops for the base gradient color pattern used in the workspace" });
1465
+ var ti = w({ foreground: se, background: ce, brand: le, alternate: de, accent: me, link: pe, help: fe, success: ge, info: ve, warning: he, danger: $e, fatal: _e, positive: be, negative: ye, gradient: xe });
1466
+ var ri = w({ foreground: ce, background: se, brand: le, alternate: de, accent: me, link: pe, help: fe, success: ge, info: ve, warning: he, danger: $e, fatal: _e, positive: be, negative: ye, gradient: xe });
1467
+ var ni = w({ dark: ti, light: ri });
1468
+ var ii = w({ dark: ce, light: se, brand: le, alternate: de, accent: me, link: pe, help: fe, success: ge, info: ve, warning: he, danger: $e, fatal: _e, positive: be, negative: ye, gradient: xe });
1469
+ var F = h(k());
1470
+ u.add(F, { description: "A remote registry URL used to publish distributable packages" });
1471
+ var Ct = _(w({ github: F, npm: F, cargo: F, cyclone: F, container: F }), {});
1472
+ u.add(Ct, { description: "A list of remote registry URLs used by Storm Software" });
1473
+ var Fe = T([ii, ni]);
1474
+ u.add(Fe, { description: "Colors used for various workspace elements" });
1475
+ var Rt = Ve(T([T([At("base"), g()]), g()]), Fe);
1476
+ u.add(Rt, { description: "Storm theme config values used for styling various package elements" });
1477
+ var Vt = h(T([g().check(v()), Re(g().check(v()))]));
1478
+ u.add(Vt, { description: "The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration." });
1479
+ var Ft = g().check(v());
1480
+ u.add(Ft, { description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)" });
1481
+ var Jt = g().check(v());
1482
+ u.add(Jt, { description: "The email of the workspace bot" });
1483
+ var Gt = w({ name: Ft, email: Jt });
1484
+ u.add(Gt, { description: "The workspace's bot user's config used to automated various operations tasks" });
1485
+ var Wt = h(g().check(v(), k()));
1486
+ u.add(Wt, { description: "A URL to a banner image used to display the workspace's release" });
1487
+ var Bt = _(g().check(v()), A);
1488
+ u.add(Bt, { description: "The alt text for the workspace's release banner image" });
1489
+ var Kt = w({ url: Wt, alt: Bt });
1490
+ u.add(Kt, { description: "The workspace's banner image used during the release process" });
1491
+ var Xt = h(g().check(v()));
1492
+ u.add(Xt, { description: "A header message appended to the start of the workspace's release notes" });
1493
+ var qt = h(g().check(v()));
1494
+ u.add(qt, { description: "A footer message appended to the end of the workspace's release notes" });
1495
+ var Yt = w({ banner: T([Kt, g().check(v(), k())]), header: Xt, footer: qt });
1496
+ u.add(Yt, { description: "The workspace's release config used during the release process" });
1497
+ var Ht = h(g().check(v()));
1498
+ u.add(Ht, { description: "A Twitter/X account associated with the organization/project" });
1499
+ var Qt = h(g().check(v()));
1500
+ u.add(Qt, { description: "A Discord account associated with the organization/project" });
1501
+ var er = h(g().check(v()));
1502
+ u.add(er, { description: "A Telegram account associated with the organization/project" });
1503
+ var tr = h(g().check(v()));
1504
+ u.add(tr, { description: "A Slack account associated with the organization/project" });
1505
+ var rr = h(g().check(v()));
1506
+ u.add(rr, { description: "A Medium account associated with the organization/project" });
1507
+ var nr = h(g().check(v()));
1508
+ u.add(nr, { description: "A GitHub account associated with the organization/project" });
1509
+ var ir = w({ twitter: Ht, discord: Qt, telegram: er, slack: tr, medium: rr, github: nr });
1510
+ u.add(ir, { description: "The workspace's account config used to store various social media links" });
1511
+ var or = h(g().check(v()));
1512
+ u.add(or, { description: "The directory used to store the environment's cached file data" });
1513
+ var ar = h(g().check(v()));
1514
+ u.add(ar, { description: "The directory used to store the environment's data files" });
1515
+ var ur = h(g().check(v()));
1516
+ u.add(ur, { description: "The directory used to store the environment's configuration files" });
1517
+ var cr = h(g().check(v()));
1518
+ u.add(cr, { description: "The directory used to store the environment's temp files" });
1519
+ var sr = h(g().check(v()));
1520
+ u.add(sr, { description: "The directory used to store the environment's log files" });
1521
+ var lr = _(g().check(v()), "dist");
1522
+ u.add(lr, { description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)" });
1523
+ var dr = w({ cache: or, data: ar, config: ur, temp: cr, log: sr, build: lr });
1524
+ u.add(dr, { description: "Various directories used by the workspace to store data, cache, and configuration files" });
1525
+ var mr = _(Y(["minimal", "monorepo"]), "monorepo");
1526
+ u.add(mr, { description: "The variant of the workspace. This can be used to enable or disable certain features or configurations." });
1527
+ var pr = _(g().check(v()), S);
1528
+ u.add(pr, { description: "The path to the workspace's error codes JSON file" });
1529
+ var fr = h(k());
1530
+ u.add(fr, { description: "A URL to a page that looks up the workspace's error messages given a specific error code" });
1531
+ var gr = w({ codesFile: pr, url: fr });
1532
+ u.add(gr, { description: "The workspace's error config used when creating error details during a system error" });
1533
+ var vr = h(g().check(v(), z()));
1534
+ u.add(vr, { description: "The name of the organization" });
1535
+ var hr = h(g().check(v()));
1536
+ u.add(hr, { description: "A description of the organization" });
1537
+ var $r = h(k());
1538
+ u.add($r, { description: "A URL to the organization's logo image" });
1539
+ var _r = h(k());
1540
+ u.add(_r, { description: "A URL to the organization's icon image" });
1541
+ var br = h(k());
1542
+ u.add(br, { description: "A URL to a page that provides more information about the organization" });
1543
+ var yr = w({ name: vr, description: hr, logo: $r, icon: _r, url: br });
1544
+ u.add(yr, { description: "The workspace's organization details" });
1545
+ var xr = _(g().check(v(), z()), "https://public.storm-cdn.com/schemas/storm-workspace.schema.json");
1546
+ u.add(xr, { description: "The URL or file path to the JSON schema file that describes the Storm configuration file" });
1547
+ var zr = g().check(v(), z());
1548
+ u.add(zr, { description: "The name of the workspace/project/service/package/scope using this configuration" });
1549
+ var kr = g().check(v(), z());
1550
+ u.add(kr, { description: "The namespace of the workspace/project/service/package/scope using this configuration" });
1551
+ var wr = T([yr, g().check(v(), z())]);
1552
+ u.add(wr, { description: "The organization of the workspace. This can be a string or an object containing the organization's details" });
1553
+ var Ir = g().check(v(), z());
1554
+ u.add(Ir, { description: "The repo URL of the workspace (i.e. the GitHub repository URL)" });
1555
+ var Sr = _(g().check(v()), "Apache-2.0");
1556
+ u.add(Sr, { description: "The license type of the package" });
1557
+ var jr = h(k());
1558
+ u.add(jr, { description: "The homepage of the workspace" });
1559
+ var Ur = h(k());
1560
+ u.add(Ur, { description: "The documentation site for the workspace" });
1561
+ var Or = h(k());
1562
+ u.add(Or, { description: "The development portal site for the workspace" });
1563
+ var Pr = h(k());
1564
+ u.add(Pr, { description: "The licensing site for the workspace" });
1565
+ var Nr = h(k());
1566
+ u.add(Nr, { description: "The contact site for the workspace" });
1567
+ var Zr = h(k());
1568
+ u.add(Zr, { description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value" });
1569
+ var Dr = _(g().check(v(), z()), "main");
1570
+ u.add(Dr, { description: "The branch of the workspace" });
1571
+ var Tr = h(g().check(v(), z()));
1572
+ u.add(Tr, { description: "A tag specifying the version pre-release identifier" });
1573
+ var Er = h(g().check(v(), z()));
1574
+ u.add(Er, { description: "The owner of the package" });
1575
+ var Ar = _(Y(["development", "staging", "production"]).check(v(), z()), "production");
1576
+ u.add(Ar, { description: "The current runtime environment mode for the package" });
1577
+ var Mr = g().check(v(), z());
1578
+ u.add(Mr, { description: "The root directory of the workspace" });
1579
+ var Lr = _(Ce(), false);
1580
+ u.add(Lr, { description: "Should all known types of workspace caching be skipped?" });
1581
+ var Cr = _(Y(["npm", "yarn", "pnpm", "bun"]), "npm");
1582
+ u.add(Cr, { description: "The JavaScript/TypeScript package manager used by the repository" });
1583
+ var Rr = _(g().check(v()), "America/New_York");
1584
+ u.add(Rr, { description: "The default timezone of the workspace" });
1585
+ var Vr = _(g().check(v()), "en-US");
1586
+ u.add(Vr, { description: "The default locale of the workspace" });
1587
+ var Fr = _(Y(["silent", "fatal", "error", "warn", "success", "info", "debug", "trace", "all"]), "info");
1588
+ u.add(Fr, { description: "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)." });
1589
+ var Jr = _(Ce(), true);
1590
+ u.add(Jr, { description: "Should the logging of the current Storm Workspace configuration be skipped?" });
1591
+ var Gr = _(Mt(g().check(v())), null);
1592
+ u.add(Gr, { description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace." });
1593
+ var Je = _(Ve(g(), Et()), {});
1594
+ u.add(Je, { description: "Configuration of each used extension" });
1595
+ var Yl = w({ $schema: xr, extends: Vt, name: zr, variant: mr, namespace: kr, organization: wr, repository: Ir, license: Sr, homepage: jr, docs: Ur, portal: Or, licensing: Pr, contact: Nr, support: Zr, branch: Dr, preid: Tr, owner: Er, bot: Gt, release: Yt, socials: ir, error: gr, mode: Ar, workspaceRoot: Mr, skipCache: Lr, directories: dr, packageManager: Cr, timezone: Rr, locale: Vr, logLevel: Fr, skipConfigLogging: Jr, registry: Ct, configFile: Gr, colors: T([Fe, Rt]), extensions: Je });
1596
+ u.add(Je, { description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo." });
1597
+
1598
+ // ../config/dist/chunk-WIOU3CJS.js
1599
+ var e3 = ["dark", "light", "base", "brand", "alternate", "accent", "link", "success", "help", "info", "warning", "danger", "fatal", "positive", "negative"];
1600
+ async function getPackageJsonConfig(root) {
1601
+ let license = i;
1602
+ let homepage = void 0;
1603
+ let support = void 0;
1604
+ let name = void 0;
1605
+ let namespace = void 0;
1606
+ let repository = void 0;
1607
+ const workspaceRoot = findWorkspaceRoot(root);
1608
+ if (existsSync(join(workspaceRoot, "package.json"))) {
1609
+ const file = await readFile(
1610
+ joinPaths(workspaceRoot, "package.json"),
1611
+ "utf8"
1612
+ );
1613
+ if (file) {
1614
+ const packageJson = JSON.parse(file);
1615
+ if (packageJson.name) {
1616
+ name = packageJson.name;
1617
+ }
1618
+ if (packageJson.namespace) {
1619
+ namespace = packageJson.namespace;
1620
+ }
1621
+ if (packageJson.repository) {
1622
+ if (typeof packageJson.repository === "string") {
1623
+ repository = packageJson.repository;
1624
+ } else if (packageJson.repository.url) {
1625
+ repository = packageJson.repository.url;
1626
+ }
1627
+ }
1628
+ if (packageJson.license) {
1629
+ license = packageJson.license;
1630
+ }
1631
+ if (packageJson.homepage) {
1632
+ homepage = packageJson.homepage;
1633
+ }
1634
+ if (packageJson.bugs) {
1635
+ if (typeof packageJson.bugs === "string") {
1636
+ support = packageJson.bugs;
1637
+ } else if (packageJson.bugs.url) {
1638
+ support = packageJson.bugs.url;
1639
+ }
1640
+ }
1641
+ }
1642
+ }
1643
+ return {
1644
+ workspaceRoot,
1645
+ name,
1646
+ namespace,
1647
+ repository,
1648
+ license,
1649
+ homepage,
1650
+ support
1651
+ };
1652
+ }
1653
+ function applyDefaultConfig(config) {
1654
+ if (!config.support && config.contact) {
1655
+ config.support = config.contact;
1656
+ }
1657
+ if (!config.contact && config.support) {
1658
+ config.contact = config.support;
1659
+ }
1660
+ if (config.homepage) {
1661
+ if (!config.docs) {
1662
+ config.docs = `${config.homepage}/docs`;
1663
+ }
1664
+ if (!config.license) {
1665
+ config.license = `${config.homepage}/license`;
1666
+ }
1667
+ if (!config.support) {
1668
+ config.support = `${config.homepage}/support`;
1669
+ }
1670
+ if (!config.contact) {
1671
+ config.contact = `${config.homepage}/contact`;
1672
+ }
1673
+ if (!config.error?.codesFile || !config?.error?.url) {
1674
+ config.error ??= { codesFile: S };
1675
+ if (config.homepage) {
1676
+ config.error.url ??= `${config.homepage}/errors`;
1677
+ }
1678
+ }
1679
+ }
1680
+ return config;
1681
+ }
1682
+
1683
+ // ../config-tools/dist/chunk-FOHZ3IDH.js
1684
+ var setExtensionEnv = (extensionName, extension) => {
1685
+ for (const key of Object.keys(extension ?? {})) {
1686
+ if (extension[key]) {
1687
+ const result = key?.replace(
1688
+ /([A-Z])+/g,
1689
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
1690
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
1691
+ let extensionKey;
1692
+ if (result.length === 0) {
1693
+ return;
1694
+ }
1695
+ if (result.length === 1) {
1696
+ extensionKey = result[0]?.toUpperCase() ?? "";
1697
+ } else {
1698
+ extensionKey = result.reduce((ret, part) => {
1699
+ return `${ret}_${part.toLowerCase()}`;
1700
+ });
1701
+ }
1702
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
1703
+ }
1704
+ }
1705
+ };
1706
+ var setConfigEnv = (config) => {
1707
+ const prefix = "STORM_";
1708
+ if (config.extends) {
1709
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
1710
+ }
1711
+ if (config.name) {
1712
+ process.env[`${prefix}NAME`] = config.name;
1713
+ }
1714
+ if (config.variant) {
1715
+ process.env[`${prefix}VARIANT`] = config.variant;
1716
+ }
1717
+ if (config.namespace) {
1718
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
1719
+ }
1720
+ if (config.owner) {
1721
+ process.env[`${prefix}OWNER`] = config.owner;
1722
+ }
1723
+ if (config.bot) {
1724
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
1725
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
1726
+ }
1727
+ if (config.error) {
1728
+ process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
1729
+ process.env[`${prefix}ERROR_URL`] = config.error.url;
1730
+ }
1731
+ if (config.release) {
1732
+ if (config.release.banner) {
1733
+ if (typeof config.release.banner === "string") {
1734
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
1735
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
1736
+ } else {
1737
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
1738
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
1739
+ process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
1740
+ }
1741
+ }
1742
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
1743
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1744
+ }
1745
+ if (config.socials) {
1746
+ if (config.socials.twitter) {
1747
+ process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
1748
+ }
1749
+ if (config.socials.discord) {
1750
+ process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
1751
+ }
1752
+ if (config.socials.telegram) {
1753
+ process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
1754
+ }
1755
+ if (config.socials.slack) {
1756
+ process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
1757
+ }
1758
+ if (config.socials.medium) {
1759
+ process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
1760
+ }
1761
+ if (config.socials.github) {
1762
+ process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
1763
+ }
1764
+ }
1765
+ if (config.organization) {
1766
+ if (typeof config.organization === "string") {
1767
+ process.env[`${prefix}ORG`] = config.organization;
1768
+ process.env[`${prefix}ORG_NAME`] = config.organization;
1769
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
1770
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
1771
+ } else {
1772
+ process.env[`${prefix}ORG`] = config.organization.name;
1773
+ process.env[`${prefix}ORG_NAME`] = config.organization.name;
1774
+ process.env[`${prefix}ORGANIZATION`] = config.organization.name;
1775
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
1776
+ if (config.organization.url) {
1777
+ process.env[`${prefix}ORG_URL`] = config.organization.url;
1778
+ process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
1779
+ }
1780
+ if (config.organization.description) {
1781
+ process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
1782
+ process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
1783
+ }
1784
+ if (config.organization.logo) {
1785
+ process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
1786
+ process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
1787
+ }
1788
+ if (config.organization.icon) {
1789
+ process.env[`${prefix}ORG_ICON`] = config.organization.icon;
1790
+ process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
1791
+ }
1792
+ }
1793
+ }
1794
+ if (config.packageManager) {
1795
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
1796
+ }
1797
+ if (config.license) {
1798
+ process.env[`${prefix}LICENSE`] = config.license;
1799
+ }
1800
+ if (config.homepage) {
1801
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
1802
+ }
1803
+ if (config.docs) {
1804
+ process.env[`${prefix}DOCS`] = config.docs;
1805
+ }
1806
+ if (config.portal) {
1807
+ process.env[`${prefix}PORTAL`] = config.portal;
1808
+ }
1809
+ if (config.licensing) {
1810
+ process.env[`${prefix}LICENSING`] = config.licensing;
1811
+ }
1812
+ if (config.contact) {
1813
+ process.env[`${prefix}CONTACT`] = config.contact;
1814
+ }
1815
+ if (config.support) {
1816
+ process.env[`${prefix}SUPPORT`] = config.support;
1817
+ }
1818
+ if (config.timezone) {
1819
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
1820
+ process.env.TZ = config.timezone;
1821
+ process.env.DEFAULT_TIMEZONE = config.timezone;
1822
+ process.env.TIMEZONE = config.timezone;
1823
+ }
1824
+ if (config.locale) {
1825
+ process.env[`${prefix}LOCALE`] = config.locale;
1826
+ process.env.DEFAULT_LOCALE = config.locale;
1827
+ process.env.LOCALE = config.locale;
1828
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1829
+ }
1830
+ if (config.configFile) {
1831
+ process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
1832
+ config.configFile
1833
+ );
1834
+ }
1835
+ if (config.workspaceRoot) {
1836
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
1837
+ process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
1838
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
1839
+ }
1840
+ if (config.directories) {
1841
+ if (!config.skipCache && config.directories.cache) {
1842
+ process.env[`${prefix}CACHE_DIR`] = correctPaths(
1843
+ config.directories.cache
1844
+ );
1845
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1846
+ }
1847
+ if (config.directories.data) {
1848
+ process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
1849
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1850
+ }
1851
+ if (config.directories.config) {
1852
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths(
1853
+ config.directories.config
1854
+ );
1855
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1856
+ }
1857
+ if (config.directories.temp) {
1858
+ process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
1859
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1860
+ }
1861
+ if (config.directories.log) {
1862
+ process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
1863
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1864
+ }
1865
+ if (config.directories.build) {
1866
+ process.env[`${prefix}BUILD_DIR`] = correctPaths(
1867
+ config.directories.build
1868
+ );
1869
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1870
+ }
1871
+ }
1872
+ if (config.skipCache !== void 0) {
1873
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
1874
+ if (config.skipCache) {
1875
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
1876
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
1877
+ }
1878
+ }
1879
+ if (config.mode) {
1880
+ process.env[`${prefix}MODE`] = config.mode;
1881
+ process.env.NODE_ENV = config.mode;
1882
+ process.env.ENVIRONMENT = config.mode;
1883
+ }
1884
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
1885
+ for (const key of Object.keys(config.colors)) {
1886
+ setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
1887
+ }
1888
+ } else {
1889
+ setThemeColorsEnv(
1890
+ `${prefix}COLOR_`,
1891
+ config.colors
1892
+ );
1893
+ }
1894
+ if (config.repository) {
1895
+ process.env[`${prefix}REPOSITORY`] = config.repository;
1896
+ }
1897
+ if (config.branch) {
1898
+ process.env[`${prefix}BRANCH`] = config.branch;
1899
+ }
1900
+ if (config.preid) {
1901
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
1902
+ }
1903
+ if (config.registry) {
1904
+ if (config.registry.github) {
1905
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
1906
+ }
1907
+ if (config.registry.npm) {
1908
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
1909
+ }
1910
+ if (config.registry.cargo) {
1911
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
1912
+ }
1913
+ if (config.registry.cyclone) {
1914
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
1915
+ config.registry.cyclone
1916
+ );
1917
+ }
1918
+ if (config.registry.container) {
1919
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
1920
+ config.registry.container
1921
+ );
1922
+ }
1923
+ }
1924
+ if (config.logLevel) {
1925
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
1926
+ process.env.LOG_LEVEL = String(config.logLevel);
1927
+ process.env.NX_VERBOSE_LOGGING = String(
1928
+ getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
1929
+ );
1930
+ process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
1931
+ }
1932
+ if (config.skipConfigLogging !== void 0) {
1933
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
1934
+ config.skipConfigLogging
1935
+ );
1936
+ }
1937
+ process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
1938
+ for (const key of Object.keys(config.extensions ?? {})) {
1939
+ if (config.extensions[key] && Object.keys(config.extensions[key])) {
1940
+ setExtensionEnv(key, config.extensions[key]);
1941
+ }
1942
+ }
1943
+ };
1944
+ var setThemeColorsEnv = (prefix, config) => {
1945
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1946
+ };
1947
+ var setSingleThemeColorsEnv = (prefix, config) => {
1948
+ if (config.dark) {
1949
+ process.env[`${prefix}DARK`] = config.dark;
1950
+ }
1951
+ if (config.light) {
1952
+ process.env[`${prefix}LIGHT`] = config.light;
1953
+ }
1954
+ if (config.brand) {
1955
+ process.env[`${prefix}BRAND`] = config.brand;
1956
+ }
1957
+ if (config.alternate) {
1958
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1959
+ }
1960
+ if (config.accent) {
1961
+ process.env[`${prefix}ACCENT`] = config.accent;
1962
+ }
1963
+ if (config.link) {
1964
+ process.env[`${prefix}LINK`] = config.link;
1965
+ }
1966
+ if (config.help) {
1967
+ process.env[`${prefix}HELP`] = config.help;
1968
+ }
1969
+ if (config.success) {
1970
+ process.env[`${prefix}SUCCESS`] = config.success;
1971
+ }
1972
+ if (config.info) {
1973
+ process.env[`${prefix}INFO`] = config.info;
1974
+ }
1975
+ if (config.warning) {
1976
+ process.env[`${prefix}WARNING`] = config.warning;
1977
+ }
1978
+ if (config.danger) {
1979
+ process.env[`${prefix}DANGER`] = config.danger;
1980
+ }
1981
+ if (config.fatal) {
1982
+ process.env[`${prefix}FATAL`] = config.fatal;
1983
+ }
1984
+ if (config.positive) {
1985
+ process.env[`${prefix}POSITIVE`] = config.positive;
1986
+ }
1987
+ if (config.negative) {
1988
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1989
+ }
1990
+ if (config.gradient) {
1991
+ for (let i2 = 0; i2 < config.gradient.length; i2++) {
1992
+ process.env[`${prefix}GRADIENT_${i2}`] = config.gradient[i2];
1993
+ }
1994
+ }
1995
+ };
1996
+ var setMultiThemeColorsEnv = (prefix, config) => {
1997
+ return {
1998
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
1999
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
2000
+ };
2001
+ };
2002
+ var setBaseThemeColorsEnv = (prefix, config) => {
2003
+ if (config.foreground) {
2004
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
2005
+ }
2006
+ if (config.background) {
2007
+ process.env[`${prefix}BACKGROUND`] = config.background;
2008
+ }
2009
+ if (config.brand) {
2010
+ process.env[`${prefix}BRAND`] = config.brand;
2011
+ }
2012
+ if (config.alternate) {
2013
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
2014
+ }
2015
+ if (config.accent) {
2016
+ process.env[`${prefix}ACCENT`] = config.accent;
2017
+ }
2018
+ if (config.link) {
2019
+ process.env[`${prefix}LINK`] = config.link;
2020
+ }
2021
+ if (config.help) {
2022
+ process.env[`${prefix}HELP`] = config.help;
2023
+ }
2024
+ if (config.success) {
2025
+ process.env[`${prefix}SUCCESS`] = config.success;
2026
+ }
2027
+ if (config.info) {
2028
+ process.env[`${prefix}INFO`] = config.info;
2029
+ }
2030
+ if (config.warning) {
2031
+ process.env[`${prefix}WARNING`] = config.warning;
2032
+ }
2033
+ if (config.danger) {
2034
+ process.env[`${prefix}DANGER`] = config.danger;
2035
+ }
2036
+ if (config.fatal) {
2037
+ process.env[`${prefix}FATAL`] = config.fatal;
2038
+ }
2039
+ if (config.positive) {
2040
+ process.env[`${prefix}POSITIVE`] = config.positive;
2041
+ }
2042
+ if (config.negative) {
2043
+ process.env[`${prefix}NEGATIVE`] = config.negative;
2044
+ }
2045
+ if (config.gradient) {
2046
+ for (let i2 = 0; i2 < config.gradient.length; i2++) {
2047
+ process.env[`${prefix}GRADIENT_${i2}`] = config.gradient[i2];
2048
+ }
2049
+ }
2050
+ };
2051
+ var getConfigEnv = () => {
2052
+ const prefix = "STORM_";
2053
+ let config = {
2054
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
2055
+ name: process.env[`${prefix}NAME`] || void 0,
2056
+ variant: process.env[`${prefix}VARIANT`] || void 0,
2057
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
2058
+ owner: process.env[`${prefix}OWNER`] || void 0,
2059
+ bot: {
2060
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
2061
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
2062
+ },
2063
+ release: {
2064
+ banner: {
2065
+ url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
2066
+ alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
2067
+ },
2068
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
2069
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
2070
+ },
2071
+ error: {
2072
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
2073
+ url: process.env[`${prefix}ERROR_URL`] || void 0
2074
+ },
2075
+ socials: {
2076
+ twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
2077
+ discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
2078
+ telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
2079
+ slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
2080
+ medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
2081
+ github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
2082
+ },
2083
+ organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
2084
+ name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
2085
+ description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
2086
+ url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
2087
+ logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
2088
+ icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
2089
+ } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
2090
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
2091
+ license: process.env[`${prefix}LICENSE`] || void 0,
2092
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
2093
+ docs: process.env[`${prefix}DOCS`] || void 0,
2094
+ portal: process.env[`${prefix}PORTAL`] || void 0,
2095
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
2096
+ contact: process.env[`${prefix}CONTACT`] || void 0,
2097
+ support: process.env[`${prefix}SUPPORT`] || void 0,
2098
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
2099
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
2100
+ configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
2101
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
2102
+ directories: {
2103
+ cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
2104
+ data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
2105
+ config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
2106
+ temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
2107
+ log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
2108
+ build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
2109
+ },
2110
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
2111
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
2112
+ // ci:
2113
+ // process.env[`${prefix}CI`] !== undefined
2114
+ // ? Boolean(
2115
+ // process.env[`${prefix}CI`] ??
2116
+ // process.env.CI ??
2117
+ // process.env.CONTINUOUS_INTEGRATION
2118
+ // )
2119
+ // : undefined,
2120
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
2121
+ branch: process.env[`${prefix}BRANCH`] || void 0,
2122
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
2123
+ registry: {
2124
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
2125
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
2126
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
2127
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
2128
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
2129
+ },
2130
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
2131
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2132
+ ) ? getLogLevelLabel(
2133
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2134
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
2135
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
2136
+ };
2137
+ const themeNames = Object.keys(process.env).filter(
2138
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
2139
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
2140
+ )
2141
+ );
2142
+ config.colors = themeNames.length > 0 ? themeNames.reduce(
2143
+ (ret, themeName) => {
2144
+ ret[themeName] = getThemeColorsEnv(prefix, themeName);
2145
+ return ret;
2146
+ },
2147
+ {}
2148
+ ) : getThemeColorsEnv(prefix);
2149
+ if (config.docs === s) {
2150
+ if (config.homepage === r) {
2151
+ config.docs = `${r}/projects/${config.name}/docs`;
2152
+ } else {
2153
+ config.docs = `${config.homepage}/docs`;
2154
+ }
2155
+ }
2156
+ if (config.licensing === a) {
2157
+ if (config.homepage === r) {
2158
+ config.licensing = `${r}/projects/${config.name}/licensing`;
2159
+ } else {
2160
+ config.licensing = `${config.homepage}/docs`;
2161
+ }
2162
+ }
2163
+ const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
2164
+ if (serializedConfig) {
2165
+ const parsed = JSON.parse(serializedConfig);
2166
+ config = {
2167
+ ...config,
2168
+ ...parsed,
2169
+ colors: { ...config.colors, ...parsed.colors },
2170
+ extensions: { ...config.extensions, ...parsed.extensions }
2171
+ };
2172
+ }
2173
+ return config;
2174
+ };
2175
+ var getThemeColorsEnv = (prefix, theme) => {
2176
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
2177
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
2178
+ };
2179
+ var getSingleThemeColorsEnv = (prefix) => {
2180
+ const gradient = [];
2181
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2182
+ gradient.push(
2183
+ process.env[`${prefix}GRADIENT_START`],
2184
+ process.env[`${prefix}GRADIENT_END`]
2185
+ );
2186
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2187
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2188
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
2189
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2190
+ index++;
2191
+ }
2192
+ }
2193
+ return {
2194
+ dark: process.env[`${prefix}DARK`],
2195
+ light: process.env[`${prefix}LIGHT`],
2196
+ brand: process.env[`${prefix}BRAND`],
2197
+ alternate: process.env[`${prefix}ALTERNATE`],
2198
+ accent: process.env[`${prefix}ACCENT`],
2199
+ link: process.env[`${prefix}LINK`],
2200
+ help: process.env[`${prefix}HELP`],
2201
+ success: process.env[`${prefix}SUCCESS`],
2202
+ info: process.env[`${prefix}INFO`],
2203
+ warning: process.env[`${prefix}WARNING`],
2204
+ danger: process.env[`${prefix}DANGER`],
2205
+ fatal: process.env[`${prefix}FATAL`],
2206
+ positive: process.env[`${prefix}POSITIVE`],
2207
+ negative: process.env[`${prefix}NEGATIVE`],
2208
+ gradient
2209
+ };
2210
+ };
2211
+ var getMultiThemeColorsEnv = (prefix) => {
2212
+ return {
2213
+ light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
2214
+ dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
2215
+ };
2216
+ };
2217
+ var getBaseThemeColorsEnv = (prefix) => {
2218
+ const gradient = [];
2219
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2220
+ gradient.push(
2221
+ process.env[`${prefix}GRADIENT_START`],
2222
+ process.env[`${prefix}GRADIENT_END`]
2223
+ );
2224
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2225
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2226
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
2227
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2228
+ index++;
2229
+ }
2230
+ }
2231
+ return {
2232
+ foreground: process.env[`${prefix}FOREGROUND`],
2233
+ background: process.env[`${prefix}BACKGROUND`],
2234
+ brand: process.env[`${prefix}BRAND`],
2235
+ alternate: process.env[`${prefix}ALTERNATE`],
2236
+ accent: process.env[`${prefix}ACCENT`],
2237
+ link: process.env[`${prefix}LINK`],
2238
+ help: process.env[`${prefix}HELP`],
2239
+ success: process.env[`${prefix}SUCCESS`],
2240
+ info: process.env[`${prefix}INFO`],
2241
+ warning: process.env[`${prefix}WARNING`],
2242
+ danger: process.env[`${prefix}DANGER`],
2243
+ fatal: process.env[`${prefix}FATAL`],
2244
+ positive: process.env[`${prefix}POSITIVE`],
2245
+ negative: process.env[`${prefix}NEGATIVE`],
2246
+ gradient
2247
+ };
2248
+ };
2249
+ var _static_cache = void 0;
2250
+ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
2251
+ let result;
2252
+ if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
2253
+ let _workspaceRoot = workspaceRoot;
2254
+ if (!_workspaceRoot) {
2255
+ _workspaceRoot = findWorkspaceRoot();
2256
+ }
2257
+ const configEnv = getConfigEnv();
2258
+ const configFile = await getConfigFile(_workspaceRoot);
2259
+ if (!configFile) {
2260
+ if (!skipLogs) {
2261
+ writeWarning(
2262
+ "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
2263
+ { logLevel: "all" }
2264
+ );
2265
+ }
2266
+ if (useDefault === false) {
2267
+ return void 0;
2268
+ }
2269
+ }
2270
+ const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
2271
+ const configInput = defu(
2272
+ configEnv,
2273
+ configFile,
2274
+ defaultConfig
2275
+ );
2276
+ try {
2277
+ result = applyDefaultConfig(
2278
+ await Yl.parseAsync(configInput)
2279
+ );
2280
+ result.workspaceRoot ??= _workspaceRoot;
2281
+ } catch (error) {
2282
+ throw new Error(
2283
+ `Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
2284
+
2285
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${formatLogMessage(
2286
+ configInput
2287
+ )}`,
2288
+ {
2289
+ cause: error
2290
+ }
2291
+ );
2292
+ }
2293
+ } else {
2294
+ result = _static_cache.data;
2295
+ }
2296
+ _static_cache = {
2297
+ timestamp: Date.now(),
2298
+ data: result
2299
+ };
2300
+ return result;
2301
+ };
2302
+ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
2303
+ const config = await createStormWorkspaceConfig(
2304
+ void 0,
2305
+ void 0,
2306
+ workspaceRoot,
2307
+ skipLogs,
2308
+ true
2309
+ );
2310
+ setConfigEnv(config);
2311
+ if (!skipLogs && !config.skipConfigLogging) {
2312
+ writeTrace(
2313
+ `\u2699\uFE0F Using Storm Workspace configuration:
2314
+ ${formatLogMessage(config)}`,
2315
+ config
2316
+ );
2317
+ }
2318
+ return config;
2319
+ };
2320
+
2321
+ // ../config-tools/dist/chunk-OUICITIJ.js
2322
+ var getConfig = (workspaceRoot, skipLogs = false) => {
2323
+ return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
2324
+ };
2325
+ var getWorkspaceConfig = (skipLogs = true, options = {}) => {
2326
+ let workspaceRoot = options.workspaceRoot;
2327
+ if (!workspaceRoot) {
2328
+ workspaceRoot = findWorkspaceRoot(options.cwd);
2329
+ }
2330
+ return getConfig(workspaceRoot, skipLogs);
2331
+ };
2332
+
2333
+ // src/utilities/options.ts
2334
+ async function resolveOptions(config = {}) {
2335
+ const workspaceConfig = await getWorkspaceConfig();
2336
+ const resolvedOptions = {
2337
+ workspace: workspaceConfig,
2338
+ ignoreCommits: config.ignoreCommits || [],
2339
+ types: config.types || CHANGELOG_COMMITS,
2340
+ bumpStrict: !!config.bumpStrict,
2341
+ scope: workspaceConfig.variant !== "minimal" ? config.scope : void 0,
2342
+ issueUrlFormat: config.issueUrlFormat || "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
2343
+ commitUrlFormat: "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
2344
+ compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
2345
+ userUrlFormat: "{{host}}/{{user}}",
2346
+ issuePrefixes: ["#"],
2347
+ preMajor: !!config.preMajor,
2348
+ formatDate: config.formatDate || formatDate
2349
+ };
2350
+ return resolvedOptions;
2351
+ }
2352
+
2353
+ export { resolveOptions };