powerlines 0.42.30 → 0.42.32

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 (141) hide show
  1. package/dist/api-D6i8MmbC.mjs +6063 -0
  2. package/dist/api-D6i8MmbC.mjs.map +1 -0
  3. package/dist/api-DZoRNTY7.cjs +6083 -0
  4. package/dist/{api-context-AY_byIdN.mjs → api-context-BQi9M07D.mjs} +414 -6
  5. package/dist/api-context-BQi9M07D.mjs.map +1 -0
  6. package/dist/{api-context-BTrJUKNX.cjs → api-context-k3dnn5KR.cjs} +425 -9
  7. package/dist/astro.cjs +4 -5
  8. package/dist/astro.d.cts +2 -2
  9. package/dist/astro.d.cts.map +1 -1
  10. package/dist/astro.d.mts +2 -2
  11. package/dist/astro.d.mts.map +1 -1
  12. package/dist/astro.mjs +3 -3
  13. package/dist/astro.mjs.map +1 -1
  14. package/dist/base-Bl_AMAlI.d.cts +12 -0
  15. package/dist/base-Bl_AMAlI.d.cts.map +1 -0
  16. package/dist/base-hjCHfNY6.d.mts +12 -0
  17. package/dist/base-hjCHfNY6.d.mts.map +1 -0
  18. package/dist/{chunk-AIJqnxB6.cjs → chunk-7azAqIA9.cjs} +7 -0
  19. package/dist/{chunk-CtajNgzt.mjs → chunk-WJdhOJK3.mjs} +10 -1
  20. package/dist/config.cjs +1 -1
  21. package/dist/config.mjs +1 -1
  22. package/dist/constants.cjs +1 -1
  23. package/dist/constants.mjs +1 -1
  24. package/dist/context/index.cjs +1 -1
  25. package/dist/context/index.d.cts +260 -1
  26. package/dist/context/index.d.cts.map +1 -1
  27. package/dist/context/index.d.mts +260 -1
  28. package/dist/context/index.d.mts.map +1 -1
  29. package/dist/context/index.mjs +1 -1
  30. package/dist/esbuild.cjs +3 -10
  31. package/dist/esbuild.d.cts +2 -2
  32. package/dist/esbuild.d.cts.map +1 -1
  33. package/dist/esbuild.d.mts +2 -2
  34. package/dist/esbuild.d.mts.map +1 -1
  35. package/dist/esbuild.mjs +2 -2
  36. package/dist/esbuild.mjs.map +1 -1
  37. package/dist/farm.cjs +5 -6
  38. package/dist/farm.d.cts +2 -2
  39. package/dist/farm.d.cts.map +1 -1
  40. package/dist/farm.d.mts +2 -2
  41. package/dist/farm.d.mts.map +1 -1
  42. package/dist/farm.mjs +2 -2
  43. package/dist/farm.mjs.map +1 -1
  44. package/dist/index.cjs +5 -7
  45. package/dist/index.d.cts +3 -3
  46. package/dist/index.d.mts +3 -3
  47. package/dist/index.mjs +3 -4
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/next.cjs +5 -6
  50. package/dist/next.d.cts +2 -2
  51. package/dist/next.d.cts.map +1 -1
  52. package/dist/next.d.mts +2 -2
  53. package/dist/next.d.mts.map +1 -1
  54. package/dist/next.mjs +4 -4
  55. package/dist/next.mjs.map +1 -1
  56. package/dist/nuxt.cjs +8 -9
  57. package/dist/nuxt.d.cts +2 -2
  58. package/dist/nuxt.d.cts.map +1 -1
  59. package/dist/nuxt.d.mts +2 -2
  60. package/dist/nuxt.d.mts.map +1 -1
  61. package/dist/nuxt.mjs +7 -7
  62. package/dist/nuxt.mjs.map +1 -1
  63. package/dist/plugin-utils.cjs +1 -1
  64. package/dist/plugin-utils.mjs +1 -1
  65. package/dist/rolldown.cjs +4 -11
  66. package/dist/rolldown.d.cts +2 -2
  67. package/dist/rolldown.d.cts.map +1 -1
  68. package/dist/rolldown.d.mts +2 -2
  69. package/dist/rolldown.d.mts.map +1 -1
  70. package/dist/rolldown.mjs +2 -2
  71. package/dist/rolldown.mjs.map +1 -1
  72. package/dist/rollup.cjs +4 -11
  73. package/dist/rollup.d.cts +2 -2
  74. package/dist/rollup.d.cts.map +1 -1
  75. package/dist/rollup.d.mts +2 -2
  76. package/dist/rollup.d.mts.map +1 -1
  77. package/dist/rollup.mjs +2 -2
  78. package/dist/rollup.mjs.map +1 -1
  79. package/dist/rspack.cjs +4 -11
  80. package/dist/rspack.d.cts +2 -2
  81. package/dist/rspack.d.cts.map +1 -1
  82. package/dist/rspack.d.mts +2 -2
  83. package/dist/rspack.d.mts.map +1 -1
  84. package/dist/rspack.mjs +2 -2
  85. package/dist/rspack.mjs.map +1 -1
  86. package/dist/storage/index.cjs +1 -1
  87. package/dist/storage/index.d.cts +1 -1
  88. package/dist/storage/index.d.mts +1 -1
  89. package/dist/storage/index.mjs +1 -1
  90. package/dist/{tsconfig-B0kfe_iM.cjs → tsconfig-BhVGZ2DK.cjs} +2 -2
  91. package/dist/{tsconfig-B8RooiIp.mjs → tsconfig-CzYPBpDS.mjs} +2 -2
  92. package/dist/{tsconfig-B8RooiIp.mjs.map → tsconfig-CzYPBpDS.mjs.map} +1 -1
  93. package/dist/tsdown.cjs +5 -12
  94. package/dist/tsdown.d.cts +2 -2
  95. package/dist/tsdown.d.cts.map +1 -1
  96. package/dist/tsdown.d.mts +2 -2
  97. package/dist/tsdown.d.mts.map +1 -1
  98. package/dist/tsdown.mjs +3 -3
  99. package/dist/tsdown.mjs.map +1 -1
  100. package/dist/tsup.cjs +5 -12
  101. package/dist/tsup.d.cts +547 -3
  102. package/dist/tsup.d.cts.map +1 -1
  103. package/dist/tsup.d.mts +547 -3
  104. package/dist/tsup.d.mts.map +1 -1
  105. package/dist/tsup.mjs +3 -3
  106. package/dist/tsup.mjs.map +1 -1
  107. package/dist/typescript/index.cjs +2 -2
  108. package/dist/typescript/index.d.cts +6 -1
  109. package/dist/typescript/index.d.cts.map +1 -1
  110. package/dist/typescript/index.d.mts +6 -1
  111. package/dist/typescript/index.d.mts.map +1 -1
  112. package/dist/typescript/index.mjs +1 -1
  113. package/dist/unloader.cjs +5 -6
  114. package/dist/unloader.d.cts +2 -2
  115. package/dist/unloader.d.mts +2 -2
  116. package/dist/unloader.mjs +2 -2
  117. package/dist/unloader.mjs.map +1 -1
  118. package/dist/unplugin.cjs +2 -2
  119. package/dist/unplugin.mjs +1 -1
  120. package/dist/utils.cjs +1 -1
  121. package/dist/utils.mjs +1 -1
  122. package/dist/{virtual-CJChzKrr.cjs → virtual-BHb4iMd_.cjs} +3 -3
  123. package/dist/{virtual-DB9ki0Y6.mjs → virtual-OEHgBu0s.mjs} +3 -3
  124. package/dist/{virtual-DB9ki0Y6.mjs.map → virtual-OEHgBu0s.mjs.map} +1 -1
  125. package/dist/vite.cjs +4 -11
  126. package/dist/vite.d.cts +2 -2
  127. package/dist/vite.d.mts +2 -2
  128. package/dist/vite.mjs +2 -2
  129. package/dist/vite.mjs.map +1 -1
  130. package/dist/webpack.cjs +4 -11
  131. package/dist/webpack.d.cts +2 -2
  132. package/dist/webpack.d.cts.map +1 -1
  133. package/dist/webpack.d.mts +2 -2
  134. package/dist/webpack.d.mts.map +1 -1
  135. package/dist/webpack.mjs +2 -2
  136. package/dist/webpack.mjs.map +1 -1
  137. package/package.json +14 -14
  138. package/dist/api-BQswQ9mT.mjs +0 -861
  139. package/dist/api-BQswQ9mT.mjs.map +0 -1
  140. package/dist/api-D7HzHvkw.cjs +0 -881
  141. package/dist/api-context-AY_byIdN.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { t as utils_exports } from "./utils.mjs";
2
2
  import { t as plugin_utils_exports } from "./plugin-utils.mjs";
3
3
  import { t as constants_exports } from "./constants.mjs";
4
- import { i as getTsconfigFilePath } from "./tsconfig-B8RooiIp.mjs";
4
+ import { i as getTsconfigFilePath } from "./tsconfig-CzYPBpDS.mjs";
5
5
  import { t as config_exports } from "./config.mjs";
6
- import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-DB9ki0Y6.mjs";
6
+ import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-OEHgBu0s.mjs";
7
7
  import { relativeToWorkspaceRoot } from "@stryke/fs/get-workspace-root";
8
8
  import { toArray } from "@stryke/convert/to-array";
9
9
  import { existsSync } from "@stryke/fs/exists";
@@ -22,10 +22,13 @@ import { isSet } from "@stryke/type-checks/is-set";
22
22
  import { isSetObject } from "@stryke/type-checks/is-set-object";
23
23
  import { isSetString } from "@stryke/type-checks/is-set-string";
24
24
  import { isString } from "@stryke/type-checks/is-string";
25
- import chalk from "chalk";
25
+ import process from "node:process";
26
+ import os from "node:os";
27
+ import tty from "node:tty";
26
28
  import defu$1, { createDefu, defu } from "defu";
27
29
  import { prettyBytes } from "@stryke/string-format/pretty-bytes";
28
30
  import { match, tsconfigPathsToRegExp } from "bundle-require";
31
+ import { fileURLToPath } from "node:url";
29
32
  import { getField } from "@stryke/helpers/get-field";
30
33
  import { readJsonFile } from "@stryke/fs/json";
31
34
  import "@stryke/fs/remove-file";
@@ -53,8 +56,413 @@ import { isAbsolutePath } from "@stryke/path/is-type";
53
56
  import { slash } from "@stryke/path/slash";
54
57
  import { isRegExp } from "@stryke/type-checks/is-regexp";
55
58
  import { Blob } from "node:buffer";
56
- import { fileURLToPath } from "node:url";
57
59
 
60
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
61
+ const ANSI_BACKGROUND_OFFSET = 10;
62
+ const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
63
+ const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
64
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
65
+ const styles$1 = {
66
+ modifier: {
67
+ reset: [0, 0],
68
+ bold: [1, 22],
69
+ dim: [2, 22],
70
+ italic: [3, 23],
71
+ underline: [4, 24],
72
+ overline: [53, 55],
73
+ inverse: [7, 27],
74
+ hidden: [8, 28],
75
+ strikethrough: [9, 29]
76
+ },
77
+ color: {
78
+ black: [30, 39],
79
+ red: [31, 39],
80
+ green: [32, 39],
81
+ yellow: [33, 39],
82
+ blue: [34, 39],
83
+ magenta: [35, 39],
84
+ cyan: [36, 39],
85
+ white: [37, 39],
86
+ blackBright: [90, 39],
87
+ gray: [90, 39],
88
+ grey: [90, 39],
89
+ redBright: [91, 39],
90
+ greenBright: [92, 39],
91
+ yellowBright: [93, 39],
92
+ blueBright: [94, 39],
93
+ magentaBright: [95, 39],
94
+ cyanBright: [96, 39],
95
+ whiteBright: [97, 39]
96
+ },
97
+ bgColor: {
98
+ bgBlack: [40, 49],
99
+ bgRed: [41, 49],
100
+ bgGreen: [42, 49],
101
+ bgYellow: [43, 49],
102
+ bgBlue: [44, 49],
103
+ bgMagenta: [45, 49],
104
+ bgCyan: [46, 49],
105
+ bgWhite: [47, 49],
106
+ bgBlackBright: [100, 49],
107
+ bgGray: [100, 49],
108
+ bgGrey: [100, 49],
109
+ bgRedBright: [101, 49],
110
+ bgGreenBright: [102, 49],
111
+ bgYellowBright: [103, 49],
112
+ bgBlueBright: [104, 49],
113
+ bgMagentaBright: [105, 49],
114
+ bgCyanBright: [106, 49],
115
+ bgWhiteBright: [107, 49]
116
+ }
117
+ };
118
+ const modifierNames = Object.keys(styles$1.modifier);
119
+ const foregroundColorNames = Object.keys(styles$1.color);
120
+ const backgroundColorNames = Object.keys(styles$1.bgColor);
121
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
122
+ function assembleStyles() {
123
+ const codes = /* @__PURE__ */ new Map();
124
+ for (const [groupName, group] of Object.entries(styles$1)) {
125
+ for (const [styleName, style] of Object.entries(group)) {
126
+ styles$1[styleName] = {
127
+ open: `\u001B[${style[0]}m`,
128
+ close: `\u001B[${style[1]}m`
129
+ };
130
+ group[styleName] = styles$1[styleName];
131
+ codes.set(style[0], style[1]);
132
+ }
133
+ Object.defineProperty(styles$1, groupName, {
134
+ value: group,
135
+ enumerable: false
136
+ });
137
+ }
138
+ Object.defineProperty(styles$1, "codes", {
139
+ value: codes,
140
+ enumerable: false
141
+ });
142
+ styles$1.color.close = "\x1B[39m";
143
+ styles$1.bgColor.close = "\x1B[49m";
144
+ styles$1.color.ansi = wrapAnsi16();
145
+ styles$1.color.ansi256 = wrapAnsi256();
146
+ styles$1.color.ansi16m = wrapAnsi16m();
147
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
148
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
149
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
150
+ Object.defineProperties(styles$1, {
151
+ rgbToAnsi256: {
152
+ value(red, green, blue) {
153
+ if (red === green && green === blue) {
154
+ if (red < 8) return 16;
155
+ if (red > 248) return 231;
156
+ return Math.round((red - 8) / 247 * 24) + 232;
157
+ }
158
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
159
+ },
160
+ enumerable: false
161
+ },
162
+ hexToRgb: {
163
+ value(hex) {
164
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
165
+ if (!matches) return [
166
+ 0,
167
+ 0,
168
+ 0
169
+ ];
170
+ let [colorString] = matches;
171
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
172
+ const integer = Number.parseInt(colorString, 16);
173
+ return [
174
+ integer >> 16 & 255,
175
+ integer >> 8 & 255,
176
+ integer & 255
177
+ ];
178
+ },
179
+ enumerable: false
180
+ },
181
+ hexToAnsi256: {
182
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
183
+ enumerable: false
184
+ },
185
+ ansi256ToAnsi: {
186
+ value(code) {
187
+ if (code < 8) return 30 + code;
188
+ if (code < 16) return 90 + (code - 8);
189
+ let red;
190
+ let green;
191
+ let blue;
192
+ if (code >= 232) {
193
+ red = ((code - 232) * 10 + 8) / 255;
194
+ green = red;
195
+ blue = red;
196
+ } else {
197
+ code -= 16;
198
+ const remainder = code % 36;
199
+ red = Math.floor(code / 36) / 5;
200
+ green = Math.floor(remainder / 6) / 5;
201
+ blue = remainder % 6 / 5;
202
+ }
203
+ const value = Math.max(red, green, blue) * 2;
204
+ if (value === 0) return 30;
205
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
206
+ if (value === 2) result += 60;
207
+ return result;
208
+ },
209
+ enumerable: false
210
+ },
211
+ rgbToAnsi: {
212
+ value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
213
+ enumerable: false
214
+ },
215
+ hexToAnsi: {
216
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
217
+ enumerable: false
218
+ }
219
+ });
220
+ return styles$1;
221
+ }
222
+ const ansiStyles = assembleStyles();
223
+
224
+ //#endregion
225
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
226
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
227
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
228
+ const position = argv.indexOf(prefix + flag);
229
+ const terminatorPosition = argv.indexOf("--");
230
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
231
+ }
232
+ const { env } = process;
233
+ let flagForceColor;
234
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
235
+ else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
236
+ function envForceColor() {
237
+ if ("FORCE_COLOR" in env) {
238
+ if (env.FORCE_COLOR === "true") return 1;
239
+ if (env.FORCE_COLOR === "false") return 0;
240
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
241
+ }
242
+ }
243
+ function translateLevel(level) {
244
+ if (level === 0) return false;
245
+ return {
246
+ level,
247
+ hasBasic: true,
248
+ has256: level >= 2,
249
+ has16m: level >= 3
250
+ };
251
+ }
252
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
253
+ const noFlagForceColor = envForceColor();
254
+ if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
255
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
256
+ if (forceColor === 0) return 0;
257
+ if (sniffFlags) {
258
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
259
+ if (hasFlag("color=256")) return 2;
260
+ }
261
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
262
+ if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
263
+ const min = forceColor || 0;
264
+ if (env.TERM === "dumb") return min;
265
+ if (process.platform === "win32") {
266
+ const osRelease = os.release().split(".");
267
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
268
+ return 1;
269
+ }
270
+ if ("CI" in env) {
271
+ if ([
272
+ "GITHUB_ACTIONS",
273
+ "GITEA_ACTIONS",
274
+ "CIRCLECI"
275
+ ].some((key) => key in env)) return 3;
276
+ if ([
277
+ "TRAVIS",
278
+ "APPVEYOR",
279
+ "GITLAB_CI",
280
+ "BUILDKITE",
281
+ "DRONE"
282
+ ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
283
+ return min;
284
+ }
285
+ if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
286
+ if (env.COLORTERM === "truecolor") return 3;
287
+ if (env.TERM === "xterm-kitty") return 3;
288
+ if (env.TERM === "xterm-ghostty") return 3;
289
+ if (env.TERM === "wezterm") return 3;
290
+ if ("TERM_PROGRAM" in env) {
291
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
292
+ switch (env.TERM_PROGRAM) {
293
+ case "iTerm.app": return version >= 3 ? 3 : 2;
294
+ case "Apple_Terminal": return 2;
295
+ }
296
+ }
297
+ if (/-256(color)?$/i.test(env.TERM)) return 2;
298
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
299
+ if ("COLORTERM" in env) return 1;
300
+ return min;
301
+ }
302
+ function createSupportsColor(stream, options = {}) {
303
+ return translateLevel(_supportsColor(stream, {
304
+ streamIsTTY: stream && stream.isTTY,
305
+ ...options
306
+ }));
307
+ }
308
+ const supportsColor = {
309
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
310
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
311
+ };
312
+
313
+ //#endregion
314
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
315
+ function stringReplaceAll(string, substring, replacer) {
316
+ let index = string.indexOf(substring);
317
+ if (index === -1) return string;
318
+ const substringLength = substring.length;
319
+ let endIndex = 0;
320
+ let returnValue = "";
321
+ do {
322
+ returnValue += string.slice(endIndex, index) + substring + replacer;
323
+ endIndex = index + substringLength;
324
+ index = string.indexOf(substring, endIndex);
325
+ } while (index !== -1);
326
+ returnValue += string.slice(endIndex);
327
+ return returnValue;
328
+ }
329
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
330
+ let endIndex = 0;
331
+ let returnValue = "";
332
+ do {
333
+ const gotCR = string[index - 1] === "\r";
334
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
335
+ endIndex = index + 1;
336
+ index = string.indexOf("\n", endIndex);
337
+ } while (index !== -1);
338
+ returnValue += string.slice(endIndex);
339
+ return returnValue;
340
+ }
341
+
342
+ //#endregion
343
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
344
+ const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
345
+ const GENERATOR = Symbol("GENERATOR");
346
+ const STYLER = Symbol("STYLER");
347
+ const IS_EMPTY = Symbol("IS_EMPTY");
348
+ const levelMapping = [
349
+ "ansi",
350
+ "ansi",
351
+ "ansi256",
352
+ "ansi16m"
353
+ ];
354
+ const styles = Object.create(null);
355
+ const applyOptions = (object, options = {}) => {
356
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
357
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
358
+ object.level = options.level === void 0 ? colorLevel : options.level;
359
+ };
360
+ const chalkFactory = (options) => {
361
+ const chalk = (...strings) => strings.join(" ");
362
+ applyOptions(chalk, options);
363
+ Object.setPrototypeOf(chalk, createChalk.prototype);
364
+ return chalk;
365
+ };
366
+ function createChalk(options) {
367
+ return chalkFactory(options);
368
+ }
369
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
370
+ for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
371
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
372
+ Object.defineProperty(this, styleName, { value: builder });
373
+ return builder;
374
+ } };
375
+ styles.visible = { get() {
376
+ const builder = createBuilder(this, this[STYLER], true);
377
+ Object.defineProperty(this, "visible", { value: builder });
378
+ return builder;
379
+ } };
380
+ const getModelAnsi = (model, level, type, ...arguments_) => {
381
+ if (model === "rgb") {
382
+ if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
383
+ if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
384
+ return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
385
+ }
386
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
387
+ return ansiStyles[type][model](...arguments_);
388
+ };
389
+ for (const model of [
390
+ "rgb",
391
+ "hex",
392
+ "ansi256"
393
+ ]) {
394
+ styles[model] = { get() {
395
+ const { level } = this;
396
+ return function(...arguments_) {
397
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
398
+ return createBuilder(this, styler, this[IS_EMPTY]);
399
+ };
400
+ } };
401
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
402
+ styles[bgModel] = { get() {
403
+ const { level } = this;
404
+ return function(...arguments_) {
405
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
406
+ return createBuilder(this, styler, this[IS_EMPTY]);
407
+ };
408
+ } };
409
+ }
410
+ const proto = Object.defineProperties(() => {}, {
411
+ ...styles,
412
+ level: {
413
+ enumerable: true,
414
+ get() {
415
+ return this[GENERATOR].level;
416
+ },
417
+ set(level) {
418
+ this[GENERATOR].level = level;
419
+ }
420
+ }
421
+ });
422
+ const createStyler = (open, close, parent) => {
423
+ let openAll;
424
+ let closeAll;
425
+ if (parent === void 0) {
426
+ openAll = open;
427
+ closeAll = close;
428
+ } else {
429
+ openAll = parent.openAll + open;
430
+ closeAll = close + parent.closeAll;
431
+ }
432
+ return {
433
+ open,
434
+ close,
435
+ openAll,
436
+ closeAll,
437
+ parent
438
+ };
439
+ };
440
+ const createBuilder = (self, _styler, _isEmpty) => {
441
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
442
+ Object.setPrototypeOf(builder, proto);
443
+ builder[GENERATOR] = self;
444
+ builder[STYLER] = _styler;
445
+ builder[IS_EMPTY] = _isEmpty;
446
+ return builder;
447
+ };
448
+ const applyStyle = (self, string) => {
449
+ if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
450
+ let styler = self[STYLER];
451
+ if (styler === void 0) return string;
452
+ const { openAll, closeAll } = styler;
453
+ if (string.includes("\x1B")) while (styler !== void 0) {
454
+ string = stringReplaceAll(string, styler.close, styler.open);
455
+ styler = styler.parent;
456
+ }
457
+ const lfIndex = string.indexOf("\n");
458
+ if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
459
+ return openAll + string + closeAll;
460
+ };
461
+ Object.defineProperties(createChalk.prototype, styles);
462
+ const chalk = createChalk();
463
+ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
464
+
465
+ //#endregion
58
466
  //#region src/_internal/helpers/hooks.ts
59
467
  const mergeResultObjects = createDefu((obj, key, value) => {
60
468
  if (isString(obj[key]) && isString(value)) {
@@ -2914,5 +3322,5 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
2914
3322
  };
2915
3323
 
2916
3324
  //#endregion
2917
- export { FileId as a, FileStorage as c, writeMetaFile as d, callHook as f, PowerlinesContext as i, FileSystem as l, PowerlinesEnvironmentContext as n, FileMetadata as o, mergeConfigs as p, createPluginContext as r, FileMetadata_KeyValuePair as s, PowerlinesAPIContext as t, _capnpFileId as u };
2918
- //# sourceMappingURL=api-context-AY_byIdN.mjs.map
3325
+ export { FileId as a, FileStorage as c, writeMetaFile as d, callHook as f, PowerlinesContext as i, FileSystem as l, chalk as m, PowerlinesEnvironmentContext as n, FileMetadata as o, mergeConfigs as p, createPluginContext as r, FileMetadata_KeyValuePair as s, PowerlinesAPIContext as t, _capnpFileId as u };
3326
+ //# sourceMappingURL=api-context-BQi9M07D.mjs.map