@soybeanjs/changelog 0.3.25 → 0.4.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.
package/dist/index.cjs DELETED
@@ -1,2543 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
-
33
- // node_modules/.pnpm/tsup@8.5.0_jiti@2.5.1_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
34
- var init_cjs_shims = __esm({
35
- "node_modules/.pnpm/tsup@8.5.0_jiti@2.5.1_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js"() {
36
- "use strict";
37
- }
38
- });
39
-
40
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs
41
- var prompt_exports = {};
42
- __export(prompt_exports, {
43
- kCancel: () => kCancel,
44
- prompt: () => prompt
45
- });
46
- function getDefaultExportFromCjs(x2) {
47
- return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
48
- }
49
- function requireSrc() {
50
- if (hasRequiredSrc) return src;
51
- hasRequiredSrc = 1;
52
- const ESC = "\x1B";
53
- const CSI = `${ESC}[`;
54
- const beep = "\x07";
55
- const cursor = {
56
- to(x2, y3) {
57
- if (!y3) return `${CSI}${x2 + 1}G`;
58
- return `${CSI}${y3 + 1};${x2 + 1}H`;
59
- },
60
- move(x2, y3) {
61
- let ret = "";
62
- if (x2 < 0) ret += `${CSI}${-x2}D`;
63
- else if (x2 > 0) ret += `${CSI}${x2}C`;
64
- if (y3 < 0) ret += `${CSI}${-y3}A`;
65
- else if (y3 > 0) ret += `${CSI}${y3}B`;
66
- return ret;
67
- },
68
- up: (count = 1) => `${CSI}${count}A`,
69
- down: (count = 1) => `${CSI}${count}B`,
70
- forward: (count = 1) => `${CSI}${count}C`,
71
- backward: (count = 1) => `${CSI}${count}D`,
72
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
73
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
74
- left: `${CSI}G`,
75
- hide: `${CSI}?25l`,
76
- show: `${CSI}?25h`,
77
- save: `${ESC}7`,
78
- restore: `${ESC}8`
79
- };
80
- const scroll = {
81
- up: (count = 1) => `${CSI}S`.repeat(count),
82
- down: (count = 1) => `${CSI}T`.repeat(count)
83
- };
84
- const erase = {
85
- screen: `${CSI}2J`,
86
- up: (count = 1) => `${CSI}1J`.repeat(count),
87
- down: (count = 1) => `${CSI}J`.repeat(count),
88
- line: `${CSI}2K`,
89
- lineEnd: `${CSI}K`,
90
- lineStart: `${CSI}1K`,
91
- lines(count) {
92
- let clear = "";
93
- for (let i2 = 0; i2 < count; i2++)
94
- clear += this.line + (i2 < count - 1 ? cursor.up() : "");
95
- if (count)
96
- clear += cursor.left;
97
- return clear;
98
- }
99
- };
100
- src = { cursor, scroll, erase, beep };
101
- return src;
102
- }
103
- function requirePicocolors() {
104
- if (hasRequiredPicocolors) return picocolors.exports;
105
- hasRequiredPicocolors = 1;
106
- let p = process || {}, argv2 = p.argv || [], env2 = p.env || {};
107
- let isColorSupported2 = !(!!env2.NO_COLOR || argv2.includes("--no-color")) && (!!env2.FORCE_COLOR || argv2.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
108
- let formatter = (open, close, replace = open) => (input) => {
109
- let string = "" + input, index = string.indexOf(close, open.length);
110
- return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
111
- };
112
- let replaceClose2 = (string, close, replace, index) => {
113
- let result = "", cursor = 0;
114
- do {
115
- result += string.substring(cursor, index) + replace;
116
- cursor = index + close.length;
117
- index = string.indexOf(close, cursor);
118
- } while (~index);
119
- return result + string.substring(cursor);
120
- };
121
- let createColors2 = (enabled = isColorSupported2) => {
122
- let f3 = enabled ? formatter : () => String;
123
- return {
124
- isColorSupported: enabled,
125
- reset: f3("\x1B[0m", "\x1B[0m"),
126
- bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
127
- dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
128
- italic: f3("\x1B[3m", "\x1B[23m"),
129
- underline: f3("\x1B[4m", "\x1B[24m"),
130
- inverse: f3("\x1B[7m", "\x1B[27m"),
131
- hidden: f3("\x1B[8m", "\x1B[28m"),
132
- strikethrough: f3("\x1B[9m", "\x1B[29m"),
133
- black: f3("\x1B[30m", "\x1B[39m"),
134
- red: f3("\x1B[31m", "\x1B[39m"),
135
- green: f3("\x1B[32m", "\x1B[39m"),
136
- yellow: f3("\x1B[33m", "\x1B[39m"),
137
- blue: f3("\x1B[34m", "\x1B[39m"),
138
- magenta: f3("\x1B[35m", "\x1B[39m"),
139
- cyan: f3("\x1B[36m", "\x1B[39m"),
140
- white: f3("\x1B[37m", "\x1B[39m"),
141
- gray: f3("\x1B[90m", "\x1B[39m"),
142
- bgBlack: f3("\x1B[40m", "\x1B[49m"),
143
- bgRed: f3("\x1B[41m", "\x1B[49m"),
144
- bgGreen: f3("\x1B[42m", "\x1B[49m"),
145
- bgYellow: f3("\x1B[43m", "\x1B[49m"),
146
- bgBlue: f3("\x1B[44m", "\x1B[49m"),
147
- bgMagenta: f3("\x1B[45m", "\x1B[49m"),
148
- bgCyan: f3("\x1B[46m", "\x1B[49m"),
149
- bgWhite: f3("\x1B[47m", "\x1B[49m"),
150
- blackBright: f3("\x1B[90m", "\x1B[39m"),
151
- redBright: f3("\x1B[91m", "\x1B[39m"),
152
- greenBright: f3("\x1B[92m", "\x1B[39m"),
153
- yellowBright: f3("\x1B[93m", "\x1B[39m"),
154
- blueBright: f3("\x1B[94m", "\x1B[39m"),
155
- magentaBright: f3("\x1B[95m", "\x1B[39m"),
156
- cyanBright: f3("\x1B[96m", "\x1B[39m"),
157
- whiteBright: f3("\x1B[97m", "\x1B[39m"),
158
- bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
159
- bgRedBright: f3("\x1B[101m", "\x1B[49m"),
160
- bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
161
- bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
162
- bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
163
- bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
164
- bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
165
- bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
166
- };
167
- };
168
- picocolors.exports = createColors2();
169
- picocolors.exports.createColors = createColors2;
170
- return picocolors.exports;
171
- }
172
- function J({ onlyFirst: t2 = false } = {}) {
173
- const F3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
174
- return new RegExp(F3, t2 ? void 0 : "g");
175
- }
176
- function T$1(t2) {
177
- if (typeof t2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``);
178
- return t2.replace(Q, "");
179
- }
180
- function O(t2) {
181
- return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
182
- }
183
- function A$1(t2, u3 = {}) {
184
- if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = T$1(t2), t2.length === 0)) return 0;
185
- t2 = t2.replace(FD(), " ");
186
- const F3 = u3.ambiguousIsNarrow ? 1 : 2;
187
- let e2 = 0;
188
- for (const s2 of t2) {
189
- const i2 = s2.codePointAt(0);
190
- if (i2 <= 31 || i2 >= 127 && i2 <= 159 || i2 >= 768 && i2 <= 879) continue;
191
- switch (DD.eastAsianWidth(s2)) {
192
- case "F":
193
- case "W":
194
- e2 += 2;
195
- break;
196
- case "A":
197
- e2 += F3;
198
- break;
199
- default:
200
- e2 += 1;
201
- }
202
- }
203
- return e2;
204
- }
205
- function sD() {
206
- const t2 = /* @__PURE__ */ new Map();
207
- for (const [u3, F3] of Object.entries(r)) {
208
- for (const [e2, s2] of Object.entries(F3)) r[e2] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F3[e2] = r[e2], t2.set(s2[0], s2[1]);
209
- Object.defineProperty(r, u3, { value: F3, enumerable: false });
210
- }
211
- return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L$1(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L$1(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F3, e2) => u3 === F3 && F3 === e2 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F3 / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
212
- const F3 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
213
- if (!F3) return [0, 0, 0];
214
- let [e2] = F3;
215
- e2.length === 3 && (e2 = [...e2].map((i2) => i2 + i2).join(""));
216
- const s2 = Number.parseInt(e2, 16);
217
- return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
218
- }, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
219
- if (u3 < 8) return 30 + u3;
220
- if (u3 < 16) return 90 + (u3 - 8);
221
- let F3, e2, s2;
222
- if (u3 >= 232) F3 = ((u3 - 232) * 10 + 8) / 255, e2 = F3, s2 = F3;
223
- else {
224
- u3 -= 16;
225
- const C3 = u3 % 36;
226
- F3 = Math.floor(u3 / 36) / 5, e2 = Math.floor(C3 / 6) / 5, s2 = C3 % 6 / 5;
227
- }
228
- const i2 = Math.max(F3, e2, s2) * 2;
229
- if (i2 === 0) return 30;
230
- let D2 = 30 + (Math.round(s2) << 2 | Math.round(e2) << 1 | Math.round(F3));
231
- return i2 === 2 && (D2 += 60), D2;
232
- }, enumerable: false }, rgbToAnsi: { value: (u3, F3, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F3, e2)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
233
- }
234
- function G(t2, u3, F3) {
235
- return String(t2).normalize().replace(/\r\n/g, `
236
- `).split(`
237
- `).map((e2) => oD(e2, u3, F3)).join(`
238
- `);
239
- }
240
- function k$1(t2, u3) {
241
- if (typeof t2 == "string") return c.aliases.get(t2) === u3;
242
- for (const F3 of t2) if (F3 !== void 0 && k$1(F3, u3)) return true;
243
- return false;
244
- }
245
- function lD(t2, u3) {
246
- if (t2 === u3) return;
247
- const F3 = t2.split(`
248
- `), e2 = u3.split(`
249
- `), s2 = [];
250
- for (let i2 = 0; i2 < Math.max(F3.length, e2.length); i2++) F3[i2] !== e2[i2] && s2.push(i2);
251
- return s2;
252
- }
253
- function d$1(t2, u3) {
254
- const F3 = t2;
255
- F3.isTTY && F3.setRawMode(u3);
256
- }
257
- function ce() {
258
- return import_node_process.default.platform !== "win32" ? import_node_process.default.env.TERM !== "linux" : !!import_node_process.default.env.CI || !!import_node_process.default.env.WT_SESSION || !!import_node_process.default.env.TERMINUS_SUBLIME || import_node_process.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process.default.env.TERM_PROGRAM === "vscode" || import_node_process.default.env.TERM === "xterm-256color" || import_node_process.default.env.TERM === "alacritty" || import_node_process.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
259
- }
260
- async function prompt(message, opts = {}) {
261
- const handleCancel = (value) => {
262
- if (typeof value !== "symbol" || value.toString() !== "Symbol(clack:cancel)") {
263
- return value;
264
- }
265
- switch (opts.cancel) {
266
- case "reject": {
267
- const error = new Error("Prompt cancelled.");
268
- error.name = "ConsolaPromptCancelledError";
269
- if (Error.captureStackTrace) {
270
- Error.captureStackTrace(error, prompt);
271
- }
272
- throw error;
273
- }
274
- case "undefined": {
275
- return void 0;
276
- }
277
- case "null": {
278
- return null;
279
- }
280
- case "symbol": {
281
- return kCancel;
282
- }
283
- default:
284
- case "default": {
285
- return opts.default ?? opts.initial;
286
- }
287
- }
288
- };
289
- if (!opts.type || opts.type === "text") {
290
- return await he({
291
- message,
292
- defaultValue: opts.default,
293
- placeholder: opts.placeholder,
294
- initialValue: opts.initial
295
- }).then(handleCancel);
296
- }
297
- if (opts.type === "confirm") {
298
- return await ye({
299
- message,
300
- initialValue: opts.initial
301
- }).then(handleCancel);
302
- }
303
- if (opts.type === "select") {
304
- return await ve({
305
- message,
306
- options: opts.options.map(
307
- (o3) => typeof o3 === "string" ? { value: o3, label: o3 } : o3
308
- ),
309
- initialValue: opts.initial
310
- }).then(handleCancel);
311
- }
312
- if (opts.type === "multiselect") {
313
- return await fe({
314
- message,
315
- options: opts.options.map(
316
- (o3) => typeof o3 === "string" ? { value: o3, label: o3 } : o3
317
- ),
318
- required: opts.required,
319
- initialValues: opts.initial
320
- }).then(handleCancel);
321
- }
322
- throw new Error(`Unknown prompt type: ${opts.type}`);
323
- }
324
- var import_node_util2, import_node_process, import_node_readline, import_node_tty, src, hasRequiredSrc, srcExports, picocolors, hasRequiredPicocolors, picocolorsExports, e, Q, P$1, X, DD, uD, FD, m, L$1, N, I, r, tD, eD, iD, v, CD, w$1, W$1, rD, R, y, V$1, z, ED, _, nD, oD, aD, c, S, AD, pD, h, x, fD, bD, mD, Y, wD, SD, $D, q, jD, PD, V, u, le, L, W, C, o, d, k, P, A, T, F, w, B, he, ye, ve, fe, kCancel;
325
- var init_prompt = __esm({
326
- "node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs"() {
327
- "use strict";
328
- init_cjs_shims();
329
- import_node_util2 = require("util");
330
- import_node_process = __toESM(require("process"), 1);
331
- import_node_readline = __toESM(require("readline"), 1);
332
- import_node_tty = require("tty");
333
- srcExports = requireSrc();
334
- picocolors = { exports: {} };
335
- picocolorsExports = /* @__PURE__ */ requirePicocolors();
336
- e = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
337
- Q = J();
338
- P$1 = { exports: {} };
339
- (function(t2) {
340
- var u3 = {};
341
- t2.exports = u3, u3.eastAsianWidth = function(e2) {
342
- var s2 = e2.charCodeAt(0), i2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D2 = s2;
343
- return 55296 <= s2 && s2 <= 56319 && 56320 <= i2 && i2 <= 57343 && (s2 &= 1023, i2 &= 1023, D2 = s2 << 10 | i2, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
344
- }, u3.characterLength = function(e2) {
345
- var s2 = this.eastAsianWidth(e2);
346
- return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
347
- };
348
- function F3(e2) {
349
- return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
350
- }
351
- u3.length = function(e2) {
352
- for (var s2 = F3(e2), i2 = 0, D2 = 0; D2 < s2.length; D2++) i2 = i2 + this.characterLength(s2[D2]);
353
- return i2;
354
- }, u3.slice = function(e2, s2, i2) {
355
- textLen = u3.length(e2), s2 = s2 || 0, i2 = i2 || 1, s2 < 0 && (s2 = textLen + s2), i2 < 0 && (i2 = textLen + i2);
356
- for (var D2 = "", C3 = 0, o3 = F3(e2), E = 0; E < o3.length; E++) {
357
- var a2 = o3[E], n2 = u3.length(a2);
358
- if (C3 >= s2 - (n2 == 2 ? 1 : 0)) if (C3 + n2 <= i2) D2 += a2;
359
- else break;
360
- C3 += n2;
361
- }
362
- return D2;
363
- };
364
- })(P$1);
365
- X = P$1.exports;
366
- DD = O(X);
367
- uD = function() {
368
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
369
- };
370
- FD = O(uD);
371
- m = 10;
372
- L$1 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`;
373
- N = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`;
374
- I = (t2 = 0) => (u3, F3, e2) => `\x1B[${38 + t2};2;${u3};${F3};${e2}m`;
375
- r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
376
- Object.keys(r.modifier);
377
- tD = Object.keys(r.color);
378
- eD = Object.keys(r.bgColor);
379
- [...tD, ...eD];
380
- iD = sD();
381
- v = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
382
- CD = 39;
383
- w$1 = "\x07";
384
- W$1 = "[";
385
- rD = "]";
386
- R = "m";
387
- y = `${rD}8;;`;
388
- V$1 = (t2) => `${v.values().next().value}${W$1}${t2}${R}`;
389
- z = (t2) => `${v.values().next().value}${y}${t2}${w$1}`;
390
- ED = (t2) => t2.split(" ").map((u3) => A$1(u3));
391
- _ = (t2, u3, F3) => {
392
- const e2 = [...u3];
393
- let s2 = false, i2 = false, D2 = A$1(T$1(t2[t2.length - 1]));
394
- for (const [C3, o3] of e2.entries()) {
395
- const E = A$1(o3);
396
- if (D2 + E <= F3 ? t2[t2.length - 1] += o3 : (t2.push(o3), D2 = 0), v.has(o3) && (s2 = true, i2 = e2.slice(C3 + 1).join("").startsWith(y)), s2) {
397
- i2 ? o3 === w$1 && (s2 = false, i2 = false) : o3 === R && (s2 = false);
398
- continue;
399
- }
400
- D2 += E, D2 === F3 && C3 < e2.length - 1 && (t2.push(""), D2 = 0);
401
- }
402
- !D2 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
403
- };
404
- nD = (t2) => {
405
- const u3 = t2.split(" ");
406
- let F3 = u3.length;
407
- for (; F3 > 0 && !(A$1(u3[F3 - 1]) > 0); ) F3--;
408
- return F3 === u3.length ? t2 : u3.slice(0, F3).join(" ") + u3.slice(F3).join("");
409
- };
410
- oD = (t2, u3, F3 = {}) => {
411
- if (F3.trim !== false && t2.trim() === "") return "";
412
- let e2 = "", s2, i2;
413
- const D2 = ED(t2);
414
- let C3 = [""];
415
- for (const [E, a2] of t2.split(" ").entries()) {
416
- F3.trim !== false && (C3[C3.length - 1] = C3[C3.length - 1].trimStart());
417
- let n2 = A$1(C3[C3.length - 1]);
418
- if (E !== 0 && (n2 >= u3 && (F3.wordWrap === false || F3.trim === false) && (C3.push(""), n2 = 0), (n2 > 0 || F3.trim === false) && (C3[C3.length - 1] += " ", n2++)), F3.hard && D2[E] > u3) {
419
- const B2 = u3 - n2, p = 1 + Math.floor((D2[E] - B2 - 1) / u3);
420
- Math.floor((D2[E] - 1) / u3) < p && C3.push(""), _(C3, a2, u3);
421
- continue;
422
- }
423
- if (n2 + D2[E] > u3 && n2 > 0 && D2[E] > 0) {
424
- if (F3.wordWrap === false && n2 < u3) {
425
- _(C3, a2, u3);
426
- continue;
427
- }
428
- C3.push("");
429
- }
430
- if (n2 + D2[E] > u3 && F3.wordWrap === false) {
431
- _(C3, a2, u3);
432
- continue;
433
- }
434
- C3[C3.length - 1] += a2;
435
- }
436
- F3.trim !== false && (C3 = C3.map((E) => nD(E)));
437
- const o3 = [...C3.join(`
438
- `)];
439
- for (const [E, a2] of o3.entries()) {
440
- if (e2 += a2, v.has(a2)) {
441
- const { groups: B2 } = new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`).exec(o3.slice(E).join("")) || { groups: {} };
442
- if (B2.code !== void 0) {
443
- const p = Number.parseFloat(B2.code);
444
- s2 = p === CD ? void 0 : p;
445
- } else B2.uri !== void 0 && (i2 = B2.uri.length === 0 ? void 0 : B2.uri);
446
- }
447
- const n2 = iD.codes.get(Number(s2));
448
- o3[E + 1] === `
449
- ` ? (i2 && (e2 += z("")), s2 && n2 && (e2 += V$1(n2))) : a2 === `
450
- ` && (s2 && n2 && (e2 += V$1(s2)), i2 && (e2 += z(i2)));
451
- }
452
- return e2;
453
- };
454
- aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
455
- c = { actions: new Set(aD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
456
- globalThis.process.platform.startsWith("win");
457
- S = Symbol("clack:cancel");
458
- AD = Object.defineProperty;
459
- pD = (t2, u3, F3) => u3 in t2 ? AD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F3 }) : t2[u3] = F3;
460
- h = (t2, u3, F3) => (pD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F3), F3);
461
- x = class {
462
- constructor(u3, F3 = true) {
463
- h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
464
- const { input: e2 = import_node_process.stdin, output: s2 = import_node_process.stdout, render: i2, signal: D2, ...C3 } = u3;
465
- this.opts = C3, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i2.bind(this), this._track = F3, this._abortSignal = D2, this.input = e2, this.output = s2;
466
- }
467
- unsubscribe() {
468
- this._subscribers.clear();
469
- }
470
- setSubscriber(u3, F3) {
471
- const e2 = this._subscribers.get(u3) ?? [];
472
- e2.push(F3), this._subscribers.set(u3, e2);
473
- }
474
- on(u3, F3) {
475
- this.setSubscriber(u3, { cb: F3 });
476
- }
477
- once(u3, F3) {
478
- this.setSubscriber(u3, { cb: F3, once: true });
479
- }
480
- emit(u3, ...F3) {
481
- const e2 = this._subscribers.get(u3) ?? [], s2 = [];
482
- for (const i2 of e2) i2.cb(...F3), i2.once && s2.push(() => e2.splice(e2.indexOf(i2), 1));
483
- for (const i2 of s2) i2();
484
- }
485
- prompt() {
486
- return new Promise((u3, F3) => {
487
- if (this._abortSignal) {
488
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u3(S);
489
- this._abortSignal.addEventListener("abort", () => {
490
- this.state = "cancel", this.close();
491
- }, { once: true });
492
- }
493
- const e2 = new import_node_tty.WriteStream(0);
494
- e2._write = (s2, i2, D2) => {
495
- var _a8, _b5;
496
- this._track && (this.value = (_a8 = this.rl) == null ? void 0 : _a8.line.replace(/\t/g, ""), this._cursor = ((_b5 = this.rl) == null ? void 0 : _b5.cursor) ?? 0, this.emit("value", this.value)), D2();
497
- }, this.input.pipe(e2), this.rl = import_node_readline.default.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d$1(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
498
- this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u3(this.value);
499
- }), this.once("cancel", () => {
500
- this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u3(S);
501
- });
502
- });
503
- }
504
- onKeypress(u3, F3) {
505
- var _a8, _b5;
506
- if (this.state === "error" && (this.state = "active"), (F3 == null ? void 0 : F3.name) && (!this._track && c.aliases.has(F3.name) && this.emit("cursor", c.aliases.get(F3.name)), c.actions.has(F3.name) && this.emit("cursor", F3.name)), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || ((_a8 = this.rl) == null ? void 0 : _a8.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), (F3 == null ? void 0 : F3.name) === "return") {
507
- if (this.opts.validate) {
508
- const e2 = this.opts.validate(this.value);
509
- e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", (_b5 = this.rl) == null ? void 0 : _b5.write(this.value));
510
- }
511
- this.state !== "error" && (this.state = "submit");
512
- }
513
- k$1([u3, F3 == null ? void 0 : F3.name, F3 == null ? void 0 : F3.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
514
- }
515
- close() {
516
- var _a8;
517
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
518
- `), d$1(this.input, false), (_a8 = this.rl) == null ? void 0 : _a8.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
519
- }
520
- restoreCursor() {
521
- const u3 = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
522
- `).length - 1;
523
- this.output.write(srcExports.cursor.move(-999, u3 * -1));
524
- }
525
- render() {
526
- const u3 = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
527
- if (u3 !== this._prevFrame) {
528
- if (this.state === "initial") this.output.write(srcExports.cursor.hide);
529
- else {
530
- const F3 = lD(this._prevFrame, u3);
531
- if (this.restoreCursor(), F3 && (F3 == null ? void 0 : F3.length) === 1) {
532
- const e2 = F3[0];
533
- this.output.write(srcExports.cursor.move(0, e2)), this.output.write(srcExports.erase.lines(1));
534
- const s2 = u3.split(`
535
- `);
536
- this.output.write(s2[e2]), this._prevFrame = u3, this.output.write(srcExports.cursor.move(0, s2.length - e2 - 1));
537
- return;
538
- }
539
- if (F3 && (F3 == null ? void 0 : F3.length) > 1) {
540
- const e2 = F3[0];
541
- this.output.write(srcExports.cursor.move(0, e2)), this.output.write(srcExports.erase.down());
542
- const s2 = u3.split(`
543
- `).slice(e2);
544
- this.output.write(s2.join(`
545
- `)), this._prevFrame = u3;
546
- return;
547
- }
548
- this.output.write(srcExports.erase.down());
549
- }
550
- this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
551
- }
552
- }
553
- };
554
- fD = class extends x {
555
- get cursor() {
556
- return this.value ? 0 : 1;
557
- }
558
- get _value() {
559
- return this.cursor === 0;
560
- }
561
- constructor(u3) {
562
- super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
563
- this.value = this._value;
564
- }), this.on("confirm", (F3) => {
565
- this.output.write(srcExports.cursor.move(0, -1)), this.value = F3, this.state = "submit", this.close();
566
- }), this.on("cursor", () => {
567
- this.value = !this.value;
568
- });
569
- }
570
- };
571
- bD = Object.defineProperty;
572
- mD = (t2, u3, F3) => u3 in t2 ? bD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F3 }) : t2[u3] = F3;
573
- Y = (t2, u3, F3) => (mD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F3), F3);
574
- wD = class extends x {
575
- constructor(u3) {
576
- super(u3, false), Y(this, "options"), Y(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F3 }) => F3 === u3.cursorAt), 0), this.on("key", (F3) => {
577
- F3 === "a" && this.toggleAll();
578
- }), this.on("cursor", (F3) => {
579
- switch (F3) {
580
- case "left":
581
- case "up":
582
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
583
- break;
584
- case "down":
585
- case "right":
586
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
587
- break;
588
- case "space":
589
- this.toggleValue();
590
- break;
591
- }
592
- });
593
- }
594
- get _value() {
595
- return this.options[this.cursor].value;
596
- }
597
- toggleAll() {
598
- const u3 = this.value.length === this.options.length;
599
- this.value = u3 ? [] : this.options.map((F3) => F3.value);
600
- }
601
- toggleValue() {
602
- const u3 = this.value.includes(this._value);
603
- this.value = u3 ? this.value.filter((F3) => F3 !== this._value) : [...this.value, this._value];
604
- }
605
- };
606
- SD = Object.defineProperty;
607
- $D = (t2, u3, F3) => u3 in t2 ? SD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F3 }) : t2[u3] = F3;
608
- q = (t2, u3, F3) => ($D(t2, typeof u3 != "symbol" ? u3 + "" : u3, F3), F3);
609
- jD = class extends x {
610
- constructor(u3) {
611
- super(u3, false), q(this, "options"), q(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F3 }) => F3 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F3) => {
612
- switch (F3) {
613
- case "left":
614
- case "up":
615
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
616
- break;
617
- case "down":
618
- case "right":
619
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
620
- break;
621
- }
622
- this.changeValue();
623
- });
624
- }
625
- get _value() {
626
- return this.options[this.cursor];
627
- }
628
- changeValue() {
629
- this.value = this._value.value;
630
- }
631
- };
632
- PD = class extends x {
633
- get valueWithCursor() {
634
- if (this.state === "submit") return this.value;
635
- if (this.cursor >= this.value.length) return `${this.value}\u2588`;
636
- const u3 = this.value.slice(0, this.cursor), [F3, ...e$1] = this.value.slice(this.cursor);
637
- return `${u3}${e.inverse(F3)}${e$1.join("")}`;
638
- }
639
- get cursor() {
640
- return this._cursor;
641
- }
642
- constructor(u3) {
643
- super(u3), this.on("finalize", () => {
644
- this.value || (this.value = u3.defaultValue);
645
- });
646
- }
647
- };
648
- V = ce();
649
- u = (t2, n2) => V ? t2 : n2;
650
- le = u("\u276F", ">");
651
- L = u("\u25A0", "x");
652
- W = u("\u25B2", "x");
653
- C = u("\u2714", "\u221A");
654
- o = u("");
655
- d = u("");
656
- k = u("\u25CF", ">");
657
- P = u("\u25CB", " ");
658
- A = u("\u25FB", "[\u2022]");
659
- T = u("\u25FC", "[+]");
660
- F = u("\u25FB", "[ ]");
661
- w = (t2) => {
662
- switch (t2) {
663
- case "initial":
664
- case "active":
665
- return e.cyan(le);
666
- case "cancel":
667
- return e.red(L);
668
- case "error":
669
- return e.yellow(W);
670
- case "submit":
671
- return e.green(C);
672
- }
673
- };
674
- B = (t2) => {
675
- const { cursor: n2, options: s2, style: r3 } = t2, i2 = t2.maxItems ?? Number.POSITIVE_INFINITY, a2 = Math.max(process.stdout.rows - 4, 0), c3 = Math.min(a2, Math.max(i2, 5));
676
- let l2 = 0;
677
- n2 >= l2 + c3 - 3 ? l2 = Math.max(Math.min(n2 - c3 + 3, s2.length - c3), 0) : n2 < l2 + 2 && (l2 = Math.max(n2 - 2, 0));
678
- const $ = c3 < s2.length && l2 > 0, p = c3 < s2.length && l2 + c3 < s2.length;
679
- return s2.slice(l2, l2 + c3).map((M, v2, x2) => {
680
- const j = v2 === 0 && $, E = v2 === x2.length - 1 && p;
681
- return j || E ? e.dim("...") : r3(M, v2 + l2 === n2);
682
- });
683
- };
684
- he = (t2) => new PD({ validate: t2.validate, placeholder: t2.placeholder, defaultValue: t2.defaultValue, initialValue: t2.initialValue, render() {
685
- var _a8;
686
- const n2 = `${e.gray(o)}
687
- ${w(this.state)} ${t2.message}
688
- `, s2 = t2.placeholder ? e.inverse(t2.placeholder[0]) + e.dim(t2.placeholder.slice(1)) : e.inverse(e.hidden("_")), r3 = this.value ? this.valueWithCursor : s2;
689
- switch (this.state) {
690
- case "error":
691
- return `${n2.trim()}
692
- ${e.yellow(o)} ${r3}
693
- ${e.yellow(d)} ${e.yellow(this.error)}
694
- `;
695
- case "submit":
696
- return `${n2}${e.gray(o)} ${e.dim(this.value || t2.placeholder)}`;
697
- case "cancel":
698
- return `${n2}${e.gray(o)} ${e.strikethrough(e.dim(this.value ?? ""))}${((_a8 = this.value) == null ? void 0 : _a8.trim()) ? `
699
- ${e.gray(o)}` : ""}`;
700
- default:
701
- return `${n2}${e.cyan(o)} ${r3}
702
- ${e.cyan(d)}
703
- `;
704
- }
705
- } }).prompt();
706
- ye = (t2) => {
707
- const n2 = t2.active ?? "Yes", s2 = t2.inactive ?? "No";
708
- return new fD({ active: n2, inactive: s2, initialValue: t2.initialValue ?? true, render() {
709
- const r3 = `${e.gray(o)}
710
- ${w(this.state)} ${t2.message}
711
- `, i2 = this.value ? n2 : s2;
712
- switch (this.state) {
713
- case "submit":
714
- return `${r3}${e.gray(o)} ${e.dim(i2)}`;
715
- case "cancel":
716
- return `${r3}${e.gray(o)} ${e.strikethrough(e.dim(i2))}
717
- ${e.gray(o)}`;
718
- default:
719
- return `${r3}${e.cyan(o)} ${this.value ? `${e.green(k)} ${n2}` : `${e.dim(P)} ${e.dim(n2)}`} ${e.dim("/")} ${this.value ? `${e.dim(P)} ${e.dim(s2)}` : `${e.green(k)} ${s2}`}
720
- ${e.cyan(d)}
721
- `;
722
- }
723
- } }).prompt();
724
- };
725
- ve = (t2) => {
726
- const n2 = (s2, r3) => {
727
- const i2 = s2.label ?? String(s2.value);
728
- switch (r3) {
729
- case "selected":
730
- return `${e.dim(i2)}`;
731
- case "active":
732
- return `${e.green(k)} ${i2} ${s2.hint ? e.dim(`(${s2.hint})`) : ""}`;
733
- case "cancelled":
734
- return `${e.strikethrough(e.dim(i2))}`;
735
- default:
736
- return `${e.dim(P)} ${e.dim(i2)}`;
737
- }
738
- };
739
- return new jD({ options: t2.options, initialValue: t2.initialValue, render() {
740
- const s2 = `${e.gray(o)}
741
- ${w(this.state)} ${t2.message}
742
- `;
743
- switch (this.state) {
744
- case "submit":
745
- return `${s2}${e.gray(o)} ${n2(this.options[this.cursor], "selected")}`;
746
- case "cancel":
747
- return `${s2}${e.gray(o)} ${n2(this.options[this.cursor], "cancelled")}
748
- ${e.gray(o)}`;
749
- default:
750
- return `${s2}${e.cyan(o)} ${B({ cursor: this.cursor, options: this.options, maxItems: t2.maxItems, style: (r3, i2) => n2(r3, i2 ? "active" : "inactive") }).join(`
751
- ${e.cyan(o)} `)}
752
- ${e.cyan(d)}
753
- `;
754
- }
755
- } }).prompt();
756
- };
757
- fe = (t2) => {
758
- const n2 = (s2, r3) => {
759
- const i2 = s2.label ?? String(s2.value);
760
- return r3 === "active" ? `${e.cyan(A)} ${i2} ${s2.hint ? e.dim(`(${s2.hint})`) : ""}` : r3 === "selected" ? `${e.green(T)} ${e.dim(i2)}` : r3 === "cancelled" ? `${e.strikethrough(e.dim(i2))}` : r3 === "active-selected" ? `${e.green(T)} ${i2} ${s2.hint ? e.dim(`(${s2.hint})`) : ""}` : r3 === "submitted" ? `${e.dim(i2)}` : `${e.dim(F)} ${e.dim(i2)}`;
761
- };
762
- return new wD({ options: t2.options, initialValues: t2.initialValues, required: t2.required ?? true, cursorAt: t2.cursorAt, validate(s2) {
763
- if (this.required && s2.length === 0) return `Please select at least one option.
764
- ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`;
765
- }, render() {
766
- const s2 = `${e.gray(o)}
767
- ${w(this.state)} ${t2.message}
768
- `, r3 = (i2, a2) => {
769
- const c3 = this.value.includes(i2.value);
770
- return a2 && c3 ? n2(i2, "active-selected") : c3 ? n2(i2, "selected") : n2(i2, a2 ? "active" : "inactive");
771
- };
772
- switch (this.state) {
773
- case "submit":
774
- return `${s2}${e.gray(o)} ${this.options.filter(({ value: i2 }) => this.value.includes(i2)).map((i2) => n2(i2, "submitted")).join(e.dim(", ")) || e.dim("none")}`;
775
- case "cancel": {
776
- const i2 = this.options.filter(({ value: a2 }) => this.value.includes(a2)).map((a2) => n2(a2, "cancelled")).join(e.dim(", "));
777
- return `${s2}${e.gray(o)} ${i2.trim() ? `${i2}
778
- ${e.gray(o)}` : ""}`;
779
- }
780
- case "error": {
781
- const i2 = this.error.split(`
782
- `).map((a2, c3) => c3 === 0 ? `${e.yellow(d)} ${e.yellow(a2)}` : ` ${a2}`).join(`
783
- `);
784
- return `${s2 + e.yellow(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t2.maxItems, style: r3 }).join(`
785
- ${e.yellow(o)} `)}
786
- ${i2}
787
- `;
788
- }
789
- default:
790
- return `${s2}${e.cyan(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t2.maxItems, style: r3 }).join(`
791
- ${e.cyan(o)} `)}
792
- ${e.cyan(d)}
793
- `;
794
- }
795
- } }).prompt();
796
- };
797
- `${e.gray(o)} `;
798
- kCancel = Symbol.for("cancel");
799
- }
800
- });
801
-
802
- // src/index.ts
803
- var index_exports = {};
804
- __export(index_exports, {
805
- generateChangelog: () => generateChangelog,
806
- generateTotalChangelog: () => generateTotalChangelog,
807
- getChangelogMarkdown: () => getChangelogMarkdown,
808
- getTotalChangelogMarkdown: () => getTotalChangelogMarkdown
809
- });
810
- module.exports = __toCommonJS(index_exports);
811
- init_cjs_shims();
812
- var import_cli_progress = require("cli-progress");
813
-
814
- // src/options.ts
815
- init_cjs_shims();
816
- var import_node_process3 = __toESM(require("process"), 1);
817
- var import_promises = require("fs/promises");
818
-
819
- // src/git.ts
820
- init_cjs_shims();
821
- var import_ofetch = require("ofetch");
822
- var import_dayjs = __toESM(require("dayjs"), 1);
823
-
824
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
825
- init_cjs_shims();
826
-
827
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
828
- init_cjs_shims();
829
- var LogLevels = {
830
- silent: Number.NEGATIVE_INFINITY,
831
- fatal: 0,
832
- error: 0,
833
- warn: 1,
834
- log: 2,
835
- info: 3,
836
- success: 3,
837
- fail: 3,
838
- ready: 3,
839
- start: 3,
840
- box: 3,
841
- debug: 4,
842
- trace: 5,
843
- verbose: Number.POSITIVE_INFINITY
844
- };
845
- var LogTypes = {
846
- // Silent
847
- silent: {
848
- level: -1
849
- },
850
- // Level 0
851
- fatal: {
852
- level: LogLevels.fatal
853
- },
854
- error: {
855
- level: LogLevels.error
856
- },
857
- // Level 1
858
- warn: {
859
- level: LogLevels.warn
860
- },
861
- // Level 2
862
- log: {
863
- level: LogLevels.log
864
- },
865
- // Level 3
866
- info: {
867
- level: LogLevels.info
868
- },
869
- success: {
870
- level: LogLevels.success
871
- },
872
- fail: {
873
- level: LogLevels.fail
874
- },
875
- ready: {
876
- level: LogLevels.info
877
- },
878
- start: {
879
- level: LogLevels.info
880
- },
881
- box: {
882
- level: LogLevels.info
883
- },
884
- // Level 4
885
- debug: {
886
- level: LogLevels.debug
887
- },
888
- // Level 5
889
- trace: {
890
- level: LogLevels.trace
891
- },
892
- // Verbose
893
- verbose: {
894
- level: LogLevels.verbose
895
- }
896
- };
897
- function isPlainObject$1(value) {
898
- if (value === null || typeof value !== "object") {
899
- return false;
900
- }
901
- const prototype = Object.getPrototypeOf(value);
902
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
903
- return false;
904
- }
905
- if (Symbol.iterator in value) {
906
- return false;
907
- }
908
- if (Symbol.toStringTag in value) {
909
- return Object.prototype.toString.call(value) === "[object Module]";
910
- }
911
- return true;
912
- }
913
- function _defu(baseObject, defaults, namespace = ".", merger) {
914
- if (!isPlainObject$1(defaults)) {
915
- return _defu(baseObject, {}, namespace, merger);
916
- }
917
- const object = Object.assign({}, defaults);
918
- for (const key in baseObject) {
919
- if (key === "__proto__" || key === "constructor") {
920
- continue;
921
- }
922
- const value = baseObject[key];
923
- if (value === null || value === void 0) {
924
- continue;
925
- }
926
- if (merger && merger(object, key, value, namespace)) {
927
- continue;
928
- }
929
- if (Array.isArray(value) && Array.isArray(object[key])) {
930
- object[key] = [...value, ...object[key]];
931
- } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
932
- object[key] = _defu(
933
- value,
934
- object[key],
935
- (namespace ? `${namespace}.` : "") + key.toString(),
936
- merger
937
- );
938
- } else {
939
- object[key] = value;
940
- }
941
- }
942
- return object;
943
- }
944
- function createDefu(merger) {
945
- return (...arguments_) => (
946
- // eslint-disable-next-line unicorn/no-array-reduce
947
- arguments_.reduce((p, c3) => _defu(p, c3, "", merger), {})
948
- );
949
- }
950
- var defu = createDefu();
951
- function isPlainObject(obj) {
952
- return Object.prototype.toString.call(obj) === "[object Object]";
953
- }
954
- function isLogObj(arg) {
955
- if (!isPlainObject(arg)) {
956
- return false;
957
- }
958
- if (!arg.message && !arg.args) {
959
- return false;
960
- }
961
- if (arg.stack) {
962
- return false;
963
- }
964
- return true;
965
- }
966
- var paused = false;
967
- var queue = [];
968
- var Consola = class _Consola {
969
- options;
970
- _lastLog;
971
- _mockFn;
972
- /**
973
- * Creates an instance of Consola with specified options or defaults.
974
- *
975
- * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
976
- */
977
- constructor(options = {}) {
978
- const types = options.types || LogTypes;
979
- this.options = defu(
980
- {
981
- ...options,
982
- defaults: { ...options.defaults },
983
- level: _normalizeLogLevel(options.level, types),
984
- reporters: [...options.reporters || []]
985
- },
986
- {
987
- types: LogTypes,
988
- throttle: 1e3,
989
- throttleMin: 5,
990
- formatOptions: {
991
- date: true,
992
- colors: false,
993
- compact: true
994
- }
995
- }
996
- );
997
- for (const type in types) {
998
- const defaults = {
999
- type,
1000
- ...this.options.defaults,
1001
- ...types[type]
1002
- };
1003
- this[type] = this._wrapLogFn(defaults);
1004
- this[type].raw = this._wrapLogFn(
1005
- defaults,
1006
- true
1007
- );
1008
- }
1009
- if (this.options.mockFn) {
1010
- this.mockTypes();
1011
- }
1012
- this._lastLog = {};
1013
- }
1014
- /**
1015
- * Gets the current log level of the Consola instance.
1016
- *
1017
- * @returns {number} The current log level.
1018
- */
1019
- get level() {
1020
- return this.options.level;
1021
- }
1022
- /**
1023
- * Sets the minimum log level that will be output by the instance.
1024
- *
1025
- * @param {number} level - The new log level to set.
1026
- */
1027
- set level(level) {
1028
- this.options.level = _normalizeLogLevel(
1029
- level,
1030
- this.options.types,
1031
- this.options.level
1032
- );
1033
- }
1034
- /**
1035
- * Displays a prompt to the user and returns the response.
1036
- * Throw an error if `prompt` is not supported by the current configuration.
1037
- *
1038
- * @template T
1039
- * @param {string} message - The message to display in the prompt.
1040
- * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
1041
- * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
1042
- */
1043
- prompt(message, opts) {
1044
- if (!this.options.prompt) {
1045
- throw new Error("prompt is not supported!");
1046
- }
1047
- return this.options.prompt(message, opts);
1048
- }
1049
- /**
1050
- * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
1051
- *
1052
- * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
1053
- * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
1054
- */
1055
- create(options) {
1056
- const instance = new _Consola({
1057
- ...this.options,
1058
- ...options
1059
- });
1060
- if (this._mockFn) {
1061
- instance.mockTypes(this._mockFn);
1062
- }
1063
- return instance;
1064
- }
1065
- /**
1066
- * Creates a new Consola instance with the specified default log object properties.
1067
- *
1068
- * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
1069
- * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
1070
- */
1071
- withDefaults(defaults) {
1072
- return this.create({
1073
- ...this.options,
1074
- defaults: {
1075
- ...this.options.defaults,
1076
- ...defaults
1077
- }
1078
- });
1079
- }
1080
- /**
1081
- * Creates a new Consola instance with a specified tag, which will be included in every log.
1082
- *
1083
- * @param {string} tag - The tag to include in each log of the new instance.
1084
- * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
1085
- */
1086
- withTag(tag) {
1087
- return this.withDefaults({
1088
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
1089
- });
1090
- }
1091
- /**
1092
- * Adds a custom reporter to the Consola instance.
1093
- * Reporters will be called for each log message, depending on their implementation and log level.
1094
- *
1095
- * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
1096
- * @returns {Consola} The current Consola instance.
1097
- */
1098
- addReporter(reporter) {
1099
- this.options.reporters.push(reporter);
1100
- return this;
1101
- }
1102
- /**
1103
- * Removes a custom reporter from the Consola instance.
1104
- * If no reporter is specified, all reporters will be removed.
1105
- *
1106
- * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
1107
- * @returns {Consola} The current Consola instance.
1108
- */
1109
- removeReporter(reporter) {
1110
- if (reporter) {
1111
- const i2 = this.options.reporters.indexOf(reporter);
1112
- if (i2 !== -1) {
1113
- return this.options.reporters.splice(i2, 1);
1114
- }
1115
- } else {
1116
- this.options.reporters.splice(0);
1117
- }
1118
- return this;
1119
- }
1120
- /**
1121
- * Replaces all reporters of the Consola instance with the specified array of reporters.
1122
- *
1123
- * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
1124
- * @returns {Consola} The current Consola instance.
1125
- */
1126
- setReporters(reporters) {
1127
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
1128
- return this;
1129
- }
1130
- wrapAll() {
1131
- this.wrapConsole();
1132
- this.wrapStd();
1133
- }
1134
- restoreAll() {
1135
- this.restoreConsole();
1136
- this.restoreStd();
1137
- }
1138
- /**
1139
- * Overrides console methods with Consola logging methods for consistent logging.
1140
- */
1141
- wrapConsole() {
1142
- for (const type in this.options.types) {
1143
- if (!console["__" + type]) {
1144
- console["__" + type] = console[type];
1145
- }
1146
- console[type] = this[type].raw;
1147
- }
1148
- }
1149
- /**
1150
- * Restores the original console methods, removing Consola overrides.
1151
- */
1152
- restoreConsole() {
1153
- for (const type in this.options.types) {
1154
- if (console["__" + type]) {
1155
- console[type] = console["__" + type];
1156
- delete console["__" + type];
1157
- }
1158
- }
1159
- }
1160
- /**
1161
- * Overrides standard output and error streams to redirect them through Consola.
1162
- */
1163
- wrapStd() {
1164
- this._wrapStream(this.options.stdout, "log");
1165
- this._wrapStream(this.options.stderr, "log");
1166
- }
1167
- _wrapStream(stream, type) {
1168
- if (!stream) {
1169
- return;
1170
- }
1171
- if (!stream.__write) {
1172
- stream.__write = stream.write;
1173
- }
1174
- stream.write = (data) => {
1175
- this[type].raw(String(data).trim());
1176
- };
1177
- }
1178
- /**
1179
- * Restores the original standard output and error streams, removing the Consola redirection.
1180
- */
1181
- restoreStd() {
1182
- this._restoreStream(this.options.stdout);
1183
- this._restoreStream(this.options.stderr);
1184
- }
1185
- _restoreStream(stream) {
1186
- if (!stream) {
1187
- return;
1188
- }
1189
- if (stream.__write) {
1190
- stream.write = stream.__write;
1191
- delete stream.__write;
1192
- }
1193
- }
1194
- /**
1195
- * Pauses logging, queues incoming logs until resumed.
1196
- */
1197
- pauseLogs() {
1198
- paused = true;
1199
- }
1200
- /**
1201
- * Resumes logging, processing any queued logs.
1202
- */
1203
- resumeLogs() {
1204
- paused = false;
1205
- const _queue = queue.splice(0);
1206
- for (const item of _queue) {
1207
- item[0]._logFn(item[1], item[2]);
1208
- }
1209
- }
1210
- /**
1211
- * Replaces logging methods with mocks if a mock function is provided.
1212
- *
1213
- * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
1214
- */
1215
- mockTypes(mockFn) {
1216
- const _mockFn = mockFn || this.options.mockFn;
1217
- this._mockFn = _mockFn;
1218
- if (typeof _mockFn !== "function") {
1219
- return;
1220
- }
1221
- for (const type in this.options.types) {
1222
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
1223
- this[type].raw = this[type];
1224
- }
1225
- }
1226
- _wrapLogFn(defaults, isRaw) {
1227
- return (...args) => {
1228
- if (paused) {
1229
- queue.push([this, defaults, args, isRaw]);
1230
- return;
1231
- }
1232
- return this._logFn(defaults, args, isRaw);
1233
- };
1234
- }
1235
- _logFn(defaults, args, isRaw) {
1236
- if ((defaults.level || 0) > this.level) {
1237
- return false;
1238
- }
1239
- const logObj = {
1240
- date: /* @__PURE__ */ new Date(),
1241
- args: [],
1242
- ...defaults,
1243
- level: _normalizeLogLevel(defaults.level, this.options.types)
1244
- };
1245
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
1246
- Object.assign(logObj, args[0]);
1247
- } else {
1248
- logObj.args = [...args];
1249
- }
1250
- if (logObj.message) {
1251
- logObj.args.unshift(logObj.message);
1252
- delete logObj.message;
1253
- }
1254
- if (logObj.additional) {
1255
- if (!Array.isArray(logObj.additional)) {
1256
- logObj.additional = logObj.additional.split("\n");
1257
- }
1258
- logObj.args.push("\n" + logObj.additional.join("\n"));
1259
- delete logObj.additional;
1260
- }
1261
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
1262
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
1263
- const resolveLog = (newLog = false) => {
1264
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
1265
- if (this._lastLog.object && repeated > 0) {
1266
- const args2 = [...this._lastLog.object.args];
1267
- if (repeated > 1) {
1268
- args2.push(`(repeated ${repeated} times)`);
1269
- }
1270
- this._log({ ...this._lastLog.object, args: args2 });
1271
- this._lastLog.count = 1;
1272
- }
1273
- if (newLog) {
1274
- this._lastLog.object = logObj;
1275
- this._log(logObj);
1276
- }
1277
- };
1278
- clearTimeout(this._lastLog.timeout);
1279
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
1280
- this._lastLog.time = logObj.date;
1281
- if (diffTime < this.options.throttle) {
1282
- try {
1283
- const serializedLog = JSON.stringify([
1284
- logObj.type,
1285
- logObj.tag,
1286
- logObj.args
1287
- ]);
1288
- const isSameLog = this._lastLog.serialized === serializedLog;
1289
- this._lastLog.serialized = serializedLog;
1290
- if (isSameLog) {
1291
- this._lastLog.count = (this._lastLog.count || 0) + 1;
1292
- if (this._lastLog.count > this.options.throttleMin) {
1293
- this._lastLog.timeout = setTimeout(
1294
- resolveLog,
1295
- this.options.throttle
1296
- );
1297
- return;
1298
- }
1299
- }
1300
- } catch {
1301
- }
1302
- }
1303
- resolveLog(true);
1304
- }
1305
- _log(logObj) {
1306
- for (const reporter of this.options.reporters) {
1307
- reporter.log(logObj, {
1308
- options: this.options
1309
- });
1310
- }
1311
- }
1312
- };
1313
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
1314
- if (input === void 0) {
1315
- return defaultLevel;
1316
- }
1317
- if (typeof input === "number") {
1318
- return input;
1319
- }
1320
- if (types[input] && types[input].level !== void 0) {
1321
- return types[input].level;
1322
- }
1323
- return defaultLevel;
1324
- }
1325
- Consola.prototype.add = Consola.prototype.addReporter;
1326
- Consola.prototype.remove = Consola.prototype.removeReporter;
1327
- Consola.prototype.clear = Consola.prototype.removeReporter;
1328
- Consola.prototype.withScope = Consola.prototype.withTag;
1329
- Consola.prototype.mock = Consola.prototype.mockTypes;
1330
- Consola.prototype.pause = Consola.prototype.pauseLogs;
1331
- Consola.prototype.resume = Consola.prototype.resumeLogs;
1332
- function createConsola(options = {}) {
1333
- return new Consola(options);
1334
- }
1335
-
1336
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
1337
- init_cjs_shims();
1338
- var import_node_util = require("util");
1339
- var import_node_path = require("path");
1340
- function parseStack(stack, message) {
1341
- const cwd = process.cwd() + import_node_path.sep;
1342
- const lines = stack.split("\n").splice(message.split("\n").length).map((l2) => l2.trim().replace("file://", "").replace(cwd, ""));
1343
- return lines;
1344
- }
1345
- function writeStream(data, stream) {
1346
- const write = stream.__write || stream.write;
1347
- return write.call(stream, data);
1348
- }
1349
- var bracket = (x2) => x2 ? `[${x2}]` : "";
1350
- var BasicReporter = class {
1351
- formatStack(stack, message, opts) {
1352
- const indent = " ".repeat(((opts == null ? void 0 : opts.errorLevel) || 0) + 1);
1353
- return indent + parseStack(stack, message).join(`
1354
- ${indent}`);
1355
- }
1356
- formatError(err, opts) {
1357
- const message = err.message ?? (0, import_node_util.formatWithOptions)(opts, err);
1358
- const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
1359
- const level = (opts == null ? void 0 : opts.errorLevel) || 0;
1360
- const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
1361
- const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
1362
- return causedPrefix + message + "\n" + stack + causedError;
1363
- }
1364
- formatArgs(args, opts) {
1365
- const _args = args.map((arg) => {
1366
- if (arg && typeof arg.stack === "string") {
1367
- return this.formatError(arg, opts);
1368
- }
1369
- return arg;
1370
- });
1371
- return (0, import_node_util.formatWithOptions)(opts, ..._args);
1372
- }
1373
- formatDate(date, opts) {
1374
- return opts.date ? date.toLocaleTimeString() : "";
1375
- }
1376
- filterAndJoin(arr) {
1377
- return arr.filter(Boolean).join(" ");
1378
- }
1379
- formatLogObj(logObj, opts) {
1380
- const message = this.formatArgs(logObj.args, opts);
1381
- if (logObj.type === "box") {
1382
- return "\n" + [
1383
- bracket(logObj.tag),
1384
- logObj.title && logObj.title,
1385
- ...message.split("\n")
1386
- ].filter(Boolean).map((l2) => " > " + l2).join("\n") + "\n";
1387
- }
1388
- return this.filterAndJoin([
1389
- bracket(logObj.type),
1390
- bracket(logObj.tag),
1391
- message
1392
- ]);
1393
- }
1394
- log(logObj, ctx) {
1395
- const line = this.formatLogObj(logObj, {
1396
- columns: ctx.options.stdout.columns || 0,
1397
- ...ctx.options.formatOptions
1398
- });
1399
- return writeStream(
1400
- line + "\n",
1401
- logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
1402
- );
1403
- }
1404
- };
1405
-
1406
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
1407
- var import_node_process2 = __toESM(require("process"), 1);
1408
-
1409
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
1410
- init_cjs_shims();
1411
- var tty = __toESM(require("tty"), 1);
1412
- var {
1413
- env = {},
1414
- argv = [],
1415
- platform = ""
1416
- } = typeof process === "undefined" ? {} : process;
1417
- var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
1418
- var isForced = "FORCE_COLOR" in env || argv.includes("--color");
1419
- var isWindows = platform === "win32";
1420
- var isDumbTerminal = env.TERM === "dumb";
1421
- var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
1422
- var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
1423
- var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
1424
- function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
1425
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
1426
- }
1427
- function clearBleed(index, string, open, close, replace) {
1428
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
1429
- }
1430
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
1431
- return (string) => string || !(string === "" || string === void 0) ? clearBleed(
1432
- ("" + string).indexOf(close, at),
1433
- string,
1434
- open,
1435
- close,
1436
- replace
1437
- ) : "";
1438
- }
1439
- function init(open, close, replace) {
1440
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
1441
- }
1442
- var colorDefs = {
1443
- reset: init(0, 0),
1444
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
1445
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
1446
- italic: init(3, 23),
1447
- underline: init(4, 24),
1448
- inverse: init(7, 27),
1449
- hidden: init(8, 28),
1450
- strikethrough: init(9, 29),
1451
- black: init(30, 39),
1452
- red: init(31, 39),
1453
- green: init(32, 39),
1454
- yellow: init(33, 39),
1455
- blue: init(34, 39),
1456
- magenta: init(35, 39),
1457
- cyan: init(36, 39),
1458
- white: init(37, 39),
1459
- gray: init(90, 39),
1460
- bgBlack: init(40, 49),
1461
- bgRed: init(41, 49),
1462
- bgGreen: init(42, 49),
1463
- bgYellow: init(43, 49),
1464
- bgBlue: init(44, 49),
1465
- bgMagenta: init(45, 49),
1466
- bgCyan: init(46, 49),
1467
- bgWhite: init(47, 49),
1468
- blackBright: init(90, 39),
1469
- redBright: init(91, 39),
1470
- greenBright: init(92, 39),
1471
- yellowBright: init(93, 39),
1472
- blueBright: init(94, 39),
1473
- magentaBright: init(95, 39),
1474
- cyanBright: init(96, 39),
1475
- whiteBright: init(97, 39),
1476
- bgBlackBright: init(100, 49),
1477
- bgRedBright: init(101, 49),
1478
- bgGreenBright: init(102, 49),
1479
- bgYellowBright: init(103, 49),
1480
- bgBlueBright: init(104, 49),
1481
- bgMagentaBright: init(105, 49),
1482
- bgCyanBright: init(106, 49),
1483
- bgWhiteBright: init(107, 49)
1484
- };
1485
- function createColors(useColor = isColorSupported) {
1486
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
1487
- }
1488
- var colors = createColors();
1489
- function getColor(color, fallback = "reset") {
1490
- return colors[color] || colors[fallback];
1491
- }
1492
- var ansiRegex = [
1493
- String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
1494
- String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
1495
- ].join("|");
1496
- function stripAnsi(text) {
1497
- return text.replace(new RegExp(ansiRegex, "g"), "");
1498
- }
1499
- var boxStylePresets = {
1500
- solid: {
1501
- tl: "\u250C",
1502
- tr: "\u2510",
1503
- bl: "\u2514",
1504
- br: "\u2518",
1505
- h: "\u2500",
1506
- v: "\u2502"
1507
- },
1508
- double: {
1509
- tl: "\u2554",
1510
- tr: "\u2557",
1511
- bl: "\u255A",
1512
- br: "\u255D",
1513
- h: "\u2550",
1514
- v: "\u2551"
1515
- },
1516
- doubleSingle: {
1517
- tl: "\u2553",
1518
- tr: "\u2556",
1519
- bl: "\u2559",
1520
- br: "\u255C",
1521
- h: "\u2500",
1522
- v: "\u2551"
1523
- },
1524
- doubleSingleRounded: {
1525
- tl: "\u256D",
1526
- tr: "\u256E",
1527
- bl: "\u2570",
1528
- br: "\u256F",
1529
- h: "\u2500",
1530
- v: "\u2551"
1531
- },
1532
- singleThick: {
1533
- tl: "\u250F",
1534
- tr: "\u2513",
1535
- bl: "\u2517",
1536
- br: "\u251B",
1537
- h: "\u2501",
1538
- v: "\u2503"
1539
- },
1540
- singleDouble: {
1541
- tl: "\u2552",
1542
- tr: "\u2555",
1543
- bl: "\u2558",
1544
- br: "\u255B",
1545
- h: "\u2550",
1546
- v: "\u2502"
1547
- },
1548
- singleDoubleRounded: {
1549
- tl: "\u256D",
1550
- tr: "\u256E",
1551
- bl: "\u2570",
1552
- br: "\u256F",
1553
- h: "\u2550",
1554
- v: "\u2502"
1555
- },
1556
- rounded: {
1557
- tl: "\u256D",
1558
- tr: "\u256E",
1559
- bl: "\u2570",
1560
- br: "\u256F",
1561
- h: "\u2500",
1562
- v: "\u2502"
1563
- }
1564
- };
1565
- var defaultStyle = {
1566
- borderColor: "white",
1567
- borderStyle: "rounded",
1568
- valign: "center",
1569
- padding: 2,
1570
- marginLeft: 1,
1571
- marginTop: 1,
1572
- marginBottom: 1
1573
- };
1574
- function box(text, _opts = {}) {
1575
- const opts = {
1576
- ..._opts,
1577
- style: {
1578
- ...defaultStyle,
1579
- ..._opts.style
1580
- }
1581
- };
1582
- const textLines = text.split("\n");
1583
- const boxLines = [];
1584
- const _color = getColor(opts.style.borderColor);
1585
- const borderStyle = {
1586
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
1587
- };
1588
- if (_color) {
1589
- for (const key in borderStyle) {
1590
- borderStyle[key] = _color(
1591
- borderStyle[key]
1592
- );
1593
- }
1594
- }
1595
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
1596
- const height = textLines.length + paddingOffset;
1597
- const width = Math.max(
1598
- ...textLines.map((line) => stripAnsi(line).length),
1599
- opts.title ? stripAnsi(opts.title).length : 0
1600
- ) + paddingOffset;
1601
- const widthOffset = width + paddingOffset;
1602
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
1603
- if (opts.style.marginTop > 0) {
1604
- boxLines.push("".repeat(opts.style.marginTop));
1605
- }
1606
- if (opts.title) {
1607
- const title = _color ? _color(opts.title) : opts.title;
1608
- const left = borderStyle.h.repeat(
1609
- Math.floor((width - stripAnsi(opts.title).length) / 2)
1610
- );
1611
- const right = borderStyle.h.repeat(
1612
- width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
1613
- );
1614
- boxLines.push(
1615
- `${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
1616
- );
1617
- } else {
1618
- boxLines.push(
1619
- `${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
1620
- );
1621
- }
1622
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
1623
- for (let i2 = 0; i2 < height; i2++) {
1624
- if (i2 < valignOffset || i2 >= valignOffset + textLines.length) {
1625
- boxLines.push(
1626
- `${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
1627
- );
1628
- } else {
1629
- const line = textLines[i2 - valignOffset];
1630
- const left = " ".repeat(paddingOffset);
1631
- const right = " ".repeat(width - stripAnsi(line).length);
1632
- boxLines.push(
1633
- `${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
1634
- );
1635
- }
1636
- }
1637
- boxLines.push(
1638
- `${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
1639
- );
1640
- if (opts.style.marginBottom > 0) {
1641
- boxLines.push("".repeat(opts.style.marginBottom));
1642
- }
1643
- return boxLines.join("\n");
1644
- }
1645
-
1646
- // node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
1647
- var import_node_util3 = require("util");
1648
- var import_node_path2 = require("path");
1649
- var import_node_tty2 = require("tty");
1650
- var import_meta = {};
1651
- var r2 = /* @__PURE__ */ Object.create(null);
1652
- var i = (e2) => {
1653
- var _a8, _b5;
1654
- return ((_a8 = globalThis.process) == null ? void 0 : _a8.env) || import_meta.env || ((_b5 = globalThis.Deno) == null ? void 0 : _b5.env.toObject()) || globalThis.__env__ || (e2 ? r2 : globalThis);
1655
- };
1656
- var o2 = new Proxy(r2, { get(e2, s2) {
1657
- return i()[s2] ?? r2[s2];
1658
- }, has(e2, s2) {
1659
- const E = i();
1660
- return s2 in E || s2 in r2;
1661
- }, set(e2, s2, E) {
1662
- const B2 = i(true);
1663
- return B2[s2] = E, true;
1664
- }, deleteProperty(e2, s2) {
1665
- if (!s2) return false;
1666
- const E = i(true);
1667
- return delete E[s2], true;
1668
- }, ownKeys() {
1669
- const e2 = i(true);
1670
- return Object.keys(e2);
1671
- } });
1672
- var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
1673
- var f2 = [["APPVEYOR"], ["AWS_AMPLIFY", "AWS_APP_ID", { ci: true }], ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"], ["APPCIRCLE", "AC_APPCIRCLE"], ["BAMBOO", "bamboo_planKey"], ["BITBUCKET", "BITBUCKET_COMMIT"], ["BITRISE", "BITRISE_IO"], ["BUDDY", "BUDDY_WORKSPACE_ID"], ["BUILDKITE"], ["CIRCLE", "CIRCLECI"], ["CIRRUS", "CIRRUS_CI"], ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }], ["CODEBUILD", "CODEBUILD_BUILD_ARN"], ["CODEFRESH", "CF_BUILD_ID"], ["DRONE"], ["DRONE", "DRONE_BUILD_EVENT"], ["DSARI"], ["GITHUB_ACTIONS"], ["GITLAB", "GITLAB_CI"], ["GITLAB", "CI_MERGE_REQUEST_ID"], ["GOCD", "GO_PIPELINE_LABEL"], ["LAYERCI"], ["HUDSON", "HUDSON_URL"], ["JENKINS", "JENKINS_URL"], ["MAGNUM"], ["NETLIFY"], ["NETLIFY", "NETLIFY_LOCAL", { ci: false }], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["VERCEL", "VERCEL", { ci: false }], ["VERCEL", "VERCEL_ENV", { ci: false }], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }], ["CODESANDBOX", "CODESANDBOX_HOST", { ci: false }], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"], ["ZEABUR"], ["CODESPHERE", "CODESPHERE_APP_ID", { ci: true }], ["RAILWAY", "RAILWAY_PROJECT_ID"], ["RAILWAY", "RAILWAY_SERVICE_ID"], ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"], ["FIREBASE_APP_HOSTING", "FIREBASE_APP_HOSTING", { ci: true }]];
1674
- function b() {
1675
- var _a8, _b5, _c, _d, _e, _f;
1676
- if ((_a8 = globalThis.process) == null ? void 0 : _a8.env) for (const e2 of f2) {
1677
- const s2 = e2[1] || e2[0];
1678
- if ((_b5 = globalThis.process) == null ? void 0 : _b5.env[s2]) return { name: e2[0].toLowerCase(), ...e2[2] };
1679
- }
1680
- return ((_d = (_c = globalThis.process) == null ? void 0 : _c.env) == null ? void 0 : _d.SHELL) === "/bin/jsh" && ((_f = (_e = globalThis.process) == null ? void 0 : _e.versions) == null ? void 0 : _f.webcontainer) ? { name: "stackblitz", ci: false } : { name: "", ci: false };
1681
- }
1682
- var l = b();
1683
- l.name;
1684
- function n(e2) {
1685
- return e2 ? e2 !== "false" : false;
1686
- }
1687
- var _a;
1688
- var I2 = ((_a = globalThis.process) == null ? void 0 : _a.platform) || "";
1689
- var T2 = n(o2.CI) || l.ci !== false;
1690
- var _a2, _b;
1691
- var a = n(((_a2 = globalThis.process) == null ? void 0 : _a2.stdout) && ((_b = globalThis.process) == null ? void 0 : _b.stdout.isTTY));
1692
- var g2 = n(o2.DEBUG);
1693
- var R2 = t === "test" || n(o2.TEST);
1694
- n(o2.MINIMAL) || T2 || R2 || !a;
1695
- var A2 = /^win/i.test(I2);
1696
- !n(o2.NO_COLOR) && (n(o2.FORCE_COLOR) || (a || A2) && o2.TERM !== "dumb" || T2);
1697
- var _a3, _b2;
1698
- var C2 = (((_b2 = (_a3 = globalThis.process) == null ? void 0 : _a3.versions) == null ? void 0 : _b2.node) || "").replace(/^v/, "") || null;
1699
- Number(C2 == null ? void 0 : C2.split(".")[0]) || null;
1700
- var y2 = globalThis.process || /* @__PURE__ */ Object.create(null);
1701
- var _2 = { versions: {} };
1702
- new Proxy(y2, { get(e2, s2) {
1703
- if (s2 === "env") return o2;
1704
- if (s2 in e2) return e2[s2];
1705
- if (s2 in _2) return _2[s2];
1706
- } });
1707
- var _a4, _b3;
1708
- var c2 = ((_b3 = (_a4 = globalThis.process) == null ? void 0 : _a4.release) == null ? void 0 : _b3.name) === "node";
1709
- var _a5, _b4;
1710
- var O2 = !!globalThis.Bun || !!((_b4 = (_a5 = globalThis.process) == null ? void 0 : _a5.versions) == null ? void 0 : _b4.bun);
1711
- var D = !!globalThis.Deno;
1712
- var L2 = !!globalThis.fastly;
1713
- var S2 = !!globalThis.Netlify;
1714
- var u2 = !!globalThis.EdgeRuntime;
1715
- var _a6;
1716
- var N2 = ((_a6 = globalThis.navigator) == null ? void 0 : _a6.userAgent) === "Cloudflare-Workers";
1717
- var F2 = [[S2, "netlify"], [u2, "edge-light"], [N2, "workerd"], [L2, "fastly"], [D, "deno"], [O2, "bun"], [c2, "node"]];
1718
- function G2() {
1719
- const e2 = F2.find((s2) => s2[0]);
1720
- if (e2) return { name: e2[1] };
1721
- }
1722
- var P2 = G2();
1723
- (P2 == null ? void 0 : P2.name) || "";
1724
- function ansiRegex2({ onlyFirst = false } = {}) {
1725
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1726
- const pattern = [
1727
- `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
1728
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
1729
- ].join("|");
1730
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
1731
- }
1732
- var regex = ansiRegex2();
1733
- function stripAnsi2(string) {
1734
- if (typeof string !== "string") {
1735
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1736
- }
1737
- return string.replace(regex, "");
1738
- }
1739
- function isAmbiguous(x2) {
1740
- return x2 === 161 || x2 === 164 || x2 === 167 || x2 === 168 || x2 === 170 || x2 === 173 || x2 === 174 || x2 >= 176 && x2 <= 180 || x2 >= 182 && x2 <= 186 || x2 >= 188 && x2 <= 191 || x2 === 198 || x2 === 208 || x2 === 215 || x2 === 216 || x2 >= 222 && x2 <= 225 || x2 === 230 || x2 >= 232 && x2 <= 234 || x2 === 236 || x2 === 237 || x2 === 240 || x2 === 242 || x2 === 243 || x2 >= 247 && x2 <= 250 || x2 === 252 || x2 === 254 || x2 === 257 || x2 === 273 || x2 === 275 || x2 === 283 || x2 === 294 || x2 === 295 || x2 === 299 || x2 >= 305 && x2 <= 307 || x2 === 312 || x2 >= 319 && x2 <= 322 || x2 === 324 || x2 >= 328 && x2 <= 331 || x2 === 333 || x2 === 338 || x2 === 339 || x2 === 358 || x2 === 359 || x2 === 363 || x2 === 462 || x2 === 464 || x2 === 466 || x2 === 468 || x2 === 470 || x2 === 472 || x2 === 474 || x2 === 476 || x2 === 593 || x2 === 609 || x2 === 708 || x2 === 711 || x2 >= 713 && x2 <= 715 || x2 === 717 || x2 === 720 || x2 >= 728 && x2 <= 731 || x2 === 733 || x2 === 735 || x2 >= 768 && x2 <= 879 || x2 >= 913 && x2 <= 929 || x2 >= 931 && x2 <= 937 || x2 >= 945 && x2 <= 961 || x2 >= 963 && x2 <= 969 || x2 === 1025 || x2 >= 1040 && x2 <= 1103 || x2 === 1105 || x2 === 8208 || x2 >= 8211 && x2 <= 8214 || x2 === 8216 || x2 === 8217 || x2 === 8220 || x2 === 8221 || x2 >= 8224 && x2 <= 8226 || x2 >= 8228 && x2 <= 8231 || x2 === 8240 || x2 === 8242 || x2 === 8243 || x2 === 8245 || x2 === 8251 || x2 === 8254 || x2 === 8308 || x2 === 8319 || x2 >= 8321 && x2 <= 8324 || x2 === 8364 || x2 === 8451 || x2 === 8453 || x2 === 8457 || x2 === 8467 || x2 === 8470 || x2 === 8481 || x2 === 8482 || x2 === 8486 || x2 === 8491 || x2 === 8531 || x2 === 8532 || x2 >= 8539 && x2 <= 8542 || x2 >= 8544 && x2 <= 8555 || x2 >= 8560 && x2 <= 8569 || x2 === 8585 || x2 >= 8592 && x2 <= 8601 || x2 === 8632 || x2 === 8633 || x2 === 8658 || x2 === 8660 || x2 === 8679 || x2 === 8704 || x2 === 8706 || x2 === 8707 || x2 === 8711 || x2 === 8712 || x2 === 8715 || x2 === 8719 || x2 === 8721 || x2 === 8725 || x2 === 8730 || x2 >= 8733 && x2 <= 8736 || x2 === 8739 || x2 === 8741 || x2 >= 8743 && x2 <= 8748 || x2 === 8750 || x2 >= 8756 && x2 <= 8759 || x2 === 8764 || x2 === 8765 || x2 === 8776 || x2 === 8780 || x2 === 8786 || x2 === 8800 || x2 === 8801 || x2 >= 8804 && x2 <= 8807 || x2 === 8810 || x2 === 8811 || x2 === 8814 || x2 === 8815 || x2 === 8834 || x2 === 8835 || x2 === 8838 || x2 === 8839 || x2 === 8853 || x2 === 8857 || x2 === 8869 || x2 === 8895 || x2 === 8978 || x2 >= 9312 && x2 <= 9449 || x2 >= 9451 && x2 <= 9547 || x2 >= 9552 && x2 <= 9587 || x2 >= 9600 && x2 <= 9615 || x2 >= 9618 && x2 <= 9621 || x2 === 9632 || x2 === 9633 || x2 >= 9635 && x2 <= 9641 || x2 === 9650 || x2 === 9651 || x2 === 9654 || x2 === 9655 || x2 === 9660 || x2 === 9661 || x2 === 9664 || x2 === 9665 || x2 >= 9670 && x2 <= 9672 || x2 === 9675 || x2 >= 9678 && x2 <= 9681 || x2 >= 9698 && x2 <= 9701 || x2 === 9711 || x2 === 9733 || x2 === 9734 || x2 === 9737 || x2 === 9742 || x2 === 9743 || x2 === 9756 || x2 === 9758 || x2 === 9792 || x2 === 9794 || x2 === 9824 || x2 === 9825 || x2 >= 9827 && x2 <= 9829 || x2 >= 9831 && x2 <= 9834 || x2 === 9836 || x2 === 9837 || x2 === 9839 || x2 === 9886 || x2 === 9887 || x2 === 9919 || x2 >= 9926 && x2 <= 9933 || x2 >= 9935 && x2 <= 9939 || x2 >= 9941 && x2 <= 9953 || x2 === 9955 || x2 === 9960 || x2 === 9961 || x2 >= 9963 && x2 <= 9969 || x2 === 9972 || x2 >= 9974 && x2 <= 9977 || x2 === 9979 || x2 === 9980 || x2 === 9982 || x2 === 9983 || x2 === 10045 || x2 >= 10102 && x2 <= 10111 || x2 >= 11094 && x2 <= 11097 || x2 >= 12872 && x2 <= 12879 || x2 >= 57344 && x2 <= 63743 || x2 >= 65024 && x2 <= 65039 || x2 === 65533 || x2 >= 127232 && x2 <= 127242 || x2 >= 127248 && x2 <= 127277 || x2 >= 127280 && x2 <= 127337 || x2 >= 127344 && x2 <= 127373 || x2 === 127375 || x2 === 127376 || x2 >= 127387 && x2 <= 127404 || x2 >= 917760 && x2 <= 917999 || x2 >= 983040 && x2 <= 1048573 || x2 >= 1048576 && x2 <= 1114109;
1741
- }
1742
- function isFullWidth(x2) {
1743
- return x2 === 12288 || x2 >= 65281 && x2 <= 65376 || x2 >= 65504 && x2 <= 65510;
1744
- }
1745
- function isWide(x2) {
1746
- return x2 >= 4352 && x2 <= 4447 || x2 === 8986 || x2 === 8987 || x2 === 9001 || x2 === 9002 || x2 >= 9193 && x2 <= 9196 || x2 === 9200 || x2 === 9203 || x2 === 9725 || x2 === 9726 || x2 === 9748 || x2 === 9749 || x2 >= 9776 && x2 <= 9783 || x2 >= 9800 && x2 <= 9811 || x2 === 9855 || x2 >= 9866 && x2 <= 9871 || x2 === 9875 || x2 === 9889 || x2 === 9898 || x2 === 9899 || x2 === 9917 || x2 === 9918 || x2 === 9924 || x2 === 9925 || x2 === 9934 || x2 === 9940 || x2 === 9962 || x2 === 9970 || x2 === 9971 || x2 === 9973 || x2 === 9978 || x2 === 9981 || x2 === 9989 || x2 === 9994 || x2 === 9995 || x2 === 10024 || x2 === 10060 || x2 === 10062 || x2 >= 10067 && x2 <= 10069 || x2 === 10071 || x2 >= 10133 && x2 <= 10135 || x2 === 10160 || x2 === 10175 || x2 === 11035 || x2 === 11036 || x2 === 11088 || x2 === 11093 || x2 >= 11904 && x2 <= 11929 || x2 >= 11931 && x2 <= 12019 || x2 >= 12032 && x2 <= 12245 || x2 >= 12272 && x2 <= 12287 || x2 >= 12289 && x2 <= 12350 || x2 >= 12353 && x2 <= 12438 || x2 >= 12441 && x2 <= 12543 || x2 >= 12549 && x2 <= 12591 || x2 >= 12593 && x2 <= 12686 || x2 >= 12688 && x2 <= 12773 || x2 >= 12783 && x2 <= 12830 || x2 >= 12832 && x2 <= 12871 || x2 >= 12880 && x2 <= 42124 || x2 >= 42128 && x2 <= 42182 || x2 >= 43360 && x2 <= 43388 || x2 >= 44032 && x2 <= 55203 || x2 >= 63744 && x2 <= 64255 || x2 >= 65040 && x2 <= 65049 || x2 >= 65072 && x2 <= 65106 || x2 >= 65108 && x2 <= 65126 || x2 >= 65128 && x2 <= 65131 || x2 >= 94176 && x2 <= 94180 || x2 === 94192 || x2 === 94193 || x2 >= 94208 && x2 <= 100343 || x2 >= 100352 && x2 <= 101589 || x2 >= 101631 && x2 <= 101640 || x2 >= 110576 && x2 <= 110579 || x2 >= 110581 && x2 <= 110587 || x2 === 110589 || x2 === 110590 || x2 >= 110592 && x2 <= 110882 || x2 === 110898 || x2 >= 110928 && x2 <= 110930 || x2 === 110933 || x2 >= 110948 && x2 <= 110951 || x2 >= 110960 && x2 <= 111355 || x2 >= 119552 && x2 <= 119638 || x2 >= 119648 && x2 <= 119670 || x2 === 126980 || x2 === 127183 || x2 === 127374 || x2 >= 127377 && x2 <= 127386 || x2 >= 127488 && x2 <= 127490 || x2 >= 127504 && x2 <= 127547 || x2 >= 127552 && x2 <= 127560 || x2 === 127568 || x2 === 127569 || x2 >= 127584 && x2 <= 127589 || x2 >= 127744 && x2 <= 127776 || x2 >= 127789 && x2 <= 127797 || x2 >= 127799 && x2 <= 127868 || x2 >= 127870 && x2 <= 127891 || x2 >= 127904 && x2 <= 127946 || x2 >= 127951 && x2 <= 127955 || x2 >= 127968 && x2 <= 127984 || x2 === 127988 || x2 >= 127992 && x2 <= 128062 || x2 === 128064 || x2 >= 128066 && x2 <= 128252 || x2 >= 128255 && x2 <= 128317 || x2 >= 128331 && x2 <= 128334 || x2 >= 128336 && x2 <= 128359 || x2 === 128378 || x2 === 128405 || x2 === 128406 || x2 === 128420 || x2 >= 128507 && x2 <= 128591 || x2 >= 128640 && x2 <= 128709 || x2 === 128716 || x2 >= 128720 && x2 <= 128722 || x2 >= 128725 && x2 <= 128727 || x2 >= 128732 && x2 <= 128735 || x2 === 128747 || x2 === 128748 || x2 >= 128756 && x2 <= 128764 || x2 >= 128992 && x2 <= 129003 || x2 === 129008 || x2 >= 129292 && x2 <= 129338 || x2 >= 129340 && x2 <= 129349 || x2 >= 129351 && x2 <= 129535 || x2 >= 129648 && x2 <= 129660 || x2 >= 129664 && x2 <= 129673 || x2 >= 129679 && x2 <= 129734 || x2 >= 129742 && x2 <= 129756 || x2 >= 129759 && x2 <= 129769 || x2 >= 129776 && x2 <= 129784 || x2 >= 131072 && x2 <= 196605 || x2 >= 196608 && x2 <= 262141;
1747
- }
1748
- function validate(codePoint) {
1749
- if (!Number.isSafeInteger(codePoint)) {
1750
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1751
- }
1752
- }
1753
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
1754
- validate(codePoint);
1755
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
1756
- return 2;
1757
- }
1758
- return 1;
1759
- }
1760
- var emojiRegex = () => {
1761
- return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
1762
- };
1763
- var _a7;
1764
- var segmenter = ((_a7 = globalThis.Intl) == null ? void 0 : _a7.Segmenter) ? new Intl.Segmenter() : { segment: (str) => str.split("") };
1765
- var defaultIgnorableCodePointRegex = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u");
1766
- function stringWidth$1(string, options = {}) {
1767
- if (typeof string !== "string" || string.length === 0) {
1768
- return 0;
1769
- }
1770
- const {
1771
- ambiguousIsNarrow = true,
1772
- countAnsiEscapeCodes = false
1773
- } = options;
1774
- if (!countAnsiEscapeCodes) {
1775
- string = stripAnsi2(string);
1776
- }
1777
- if (string.length === 0) {
1778
- return 0;
1779
- }
1780
- let width = 0;
1781
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
1782
- for (const { segment: character } of segmenter.segment(string)) {
1783
- const codePoint = character.codePointAt(0);
1784
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1785
- continue;
1786
- }
1787
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
1788
- continue;
1789
- }
1790
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
1791
- continue;
1792
- }
1793
- if (codePoint >= 55296 && codePoint <= 57343) {
1794
- continue;
1795
- }
1796
- if (codePoint >= 65024 && codePoint <= 65039) {
1797
- continue;
1798
- }
1799
- if (defaultIgnorableCodePointRegex.test(character)) {
1800
- continue;
1801
- }
1802
- if (emojiRegex().test(character)) {
1803
- width += 2;
1804
- continue;
1805
- }
1806
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
1807
- }
1808
- return width;
1809
- }
1810
- function isUnicodeSupported() {
1811
- const { env: env2 } = import_node_process2.default;
1812
- const { TERM, TERM_PROGRAM } = env2;
1813
- if (import_node_process2.default.platform !== "win32") {
1814
- return TERM !== "linux";
1815
- }
1816
- return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1817
- }
1818
- var TYPE_COLOR_MAP = {
1819
- info: "cyan",
1820
- fail: "red",
1821
- success: "green",
1822
- ready: "green",
1823
- start: "magenta"
1824
- };
1825
- var LEVEL_COLOR_MAP = {
1826
- 0: "red",
1827
- 1: "yellow"
1828
- };
1829
- var unicode = isUnicodeSupported();
1830
- var s = (c3, fallback) => unicode ? c3 : fallback;
1831
- var TYPE_ICONS = {
1832
- error: s("\u2716", "\xD7"),
1833
- fatal: s("\u2716", "\xD7"),
1834
- ready: s("\u2714", "\u221A"),
1835
- warn: s("\u26A0", "\u203C"),
1836
- info: s("\u2139", "i"),
1837
- success: s("\u2714", "\u221A"),
1838
- debug: s("\u2699", "D"),
1839
- trace: s("\u2192", "\u2192"),
1840
- fail: s("\u2716", "\xD7"),
1841
- start: s("\u25D0", "o"),
1842
- log: ""
1843
- };
1844
- function stringWidth(str) {
1845
- const hasICU = typeof Intl === "object";
1846
- if (!hasICU || !Intl.Segmenter) {
1847
- return stripAnsi(str).length;
1848
- }
1849
- return stringWidth$1(str);
1850
- }
1851
- var FancyReporter = class extends BasicReporter {
1852
- formatStack(stack, message, opts) {
1853
- const indent = " ".repeat(((opts == null ? void 0 : opts.errorLevel) || 0) + 1);
1854
- return `
1855
- ${indent}` + parseStack(stack, message).map(
1856
- (line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_3, m2) => `(${colors.cyan(m2)})`)
1857
- ).join(`
1858
- ${indent}`);
1859
- }
1860
- formatType(logObj, isBadge, opts) {
1861
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1862
- if (isBadge) {
1863
- return getBgColor(typeColor)(
1864
- colors.black(` ${logObj.type.toUpperCase()} `)
1865
- );
1866
- }
1867
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1868
- return _type ? getColor2(typeColor)(_type) : "";
1869
- }
1870
- formatLogObj(logObj, opts) {
1871
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
1872
- "\n"
1873
- );
1874
- if (logObj.type === "box") {
1875
- return box(
1876
- characterFormat(
1877
- message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
1878
- ),
1879
- {
1880
- title: logObj.title ? characterFormat(logObj.title) : void 0,
1881
- style: logObj.style
1882
- }
1883
- );
1884
- }
1885
- const date = this.formatDate(logObj.date, opts);
1886
- const coloredDate = date && colors.gray(date);
1887
- const isBadge = logObj.badge ?? logObj.level < 2;
1888
- const type = this.formatType(logObj, isBadge, opts);
1889
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1890
- let line;
1891
- const left = this.filterAndJoin([type, characterFormat(message)]);
1892
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1893
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1894
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1895
- line += characterFormat(
1896
- additional.length > 0 ? "\n" + additional.join("\n") : ""
1897
- );
1898
- if (logObj.type === "trace") {
1899
- const _err = new Error("Trace: " + logObj.message);
1900
- line += this.formatStack(_err.stack || "", _err.message);
1901
- }
1902
- return isBadge ? "\n" + line + "\n" : line;
1903
- }
1904
- };
1905
- function characterFormat(str) {
1906
- return str.replace(/`([^`]+)`/gm, (_3, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_3, m2) => ` ${colors.underline(m2)} `);
1907
- }
1908
- function getColor2(color = "white") {
1909
- return colors[color] || colors.white;
1910
- }
1911
- function getBgColor(color = "bgWhite") {
1912
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1913
- }
1914
- function createConsola2(options = {}) {
1915
- let level = _getDefaultLogLevel();
1916
- if (process.env.CONSOLA_LEVEL) {
1917
- level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1918
- }
1919
- const consola2 = createConsola({
1920
- level,
1921
- defaults: { level },
1922
- stdout: process.stdout,
1923
- stderr: process.stderr,
1924
- prompt: (...args) => Promise.resolve().then(() => (init_prompt(), prompt_exports)).then((m2) => m2.prompt(...args)),
1925
- reporters: options.reporters || [
1926
- options.fancy ?? !(T2 || R2) ? new FancyReporter() : new BasicReporter()
1927
- ],
1928
- ...options
1929
- });
1930
- return consola2;
1931
- }
1932
- function _getDefaultLogLevel() {
1933
- if (g2) {
1934
- return LogLevels.debug;
1935
- }
1936
- if (R2) {
1937
- return LogLevels.warn;
1938
- }
1939
- return LogLevels.info;
1940
- }
1941
- var consola = createConsola2();
1942
-
1943
- // src/git.ts
1944
- var import_semver = __toESM(require("semver"), 1);
1945
-
1946
- // src/shared.ts
1947
- init_cjs_shims();
1948
- async function execCommand(cmd, args, options) {
1949
- var _a8;
1950
- const { execa } = await import("execa");
1951
- const res = await execa(cmd, args, options);
1952
- return ((_a8 = res == null ? void 0 : res.stdout) == null ? void 0 : _a8.trim()) || "";
1953
- }
1954
- function notNullish(v2) {
1955
- return v2 !== null && v2 !== void 0;
1956
- }
1957
- function partition(array, ...filters) {
1958
- const result = Array.from({ length: filters.length + 1 }).fill(null).map(() => []);
1959
- array.forEach((e2, idx, arr) => {
1960
- let i2 = 0;
1961
- for (const filter of filters) {
1962
- if (filter(e2, idx, arr)) {
1963
- result[i2].push(e2);
1964
- return;
1965
- }
1966
- i2 += 1;
1967
- }
1968
- result[i2].push(e2);
1969
- });
1970
- return result;
1971
- }
1972
- function groupBy(items, key, groups = {}) {
1973
- for (const item of items) {
1974
- const v2 = item[key];
1975
- groups[v2] || (groups[v2] = []);
1976
- groups[v2].push(item);
1977
- }
1978
- return groups;
1979
- }
1980
- function capitalize(str) {
1981
- return str.charAt(0).toUpperCase() + str.slice(1);
1982
- }
1983
- function join(array, glue = ", ", finalGlue = " and ") {
1984
- if (!array || array.length === 0) return "";
1985
- if (array.length === 1) return array[0];
1986
- if (array.length === 2) return array.join(finalGlue);
1987
- return `${array.slice(0, -1).join(glue)}${finalGlue}${array.slice(-1)}`;
1988
- }
1989
-
1990
- // src/constant.ts
1991
- init_cjs_shims();
1992
- var VERSION_REG = /^v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?/;
1993
- var VERSION_REG_OF_MARKDOWN = /## \[v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?]/g;
1994
- var VERSION_WITH_RELEASE = /release\sv\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?/;
1995
-
1996
- // src/git.ts
1997
- async function getTotalGitTags() {
1998
- const tagStr = await execCommand("git", ["--no-pager", "tag", "-l", "--sort=v:refname"]);
1999
- const tags = tagStr.split("\n");
2000
- const filtered = tags.filter((tag) => VERSION_REG.test(tag));
2001
- return import_semver.default.sort(filtered);
2002
- }
2003
- async function getTagDateMap() {
2004
- const tagDateStr = await execCommand("git", [
2005
- "--no-pager",
2006
- "log",
2007
- "--tags",
2008
- "--simplify-by-decoration",
2009
- "--pretty=format:%ci %d"
2010
- ]);
2011
- const TAG_MARK = "tag: ";
2012
- const map = /* @__PURE__ */ new Map();
2013
- const dates = tagDateStr.split("\n").filter((item) => item.includes(TAG_MARK));
2014
- dates.forEach((item) => {
2015
- var _a8;
2016
- const [dateStr, tagStr] = item.split(TAG_MARK);
2017
- const date = (0, import_dayjs.default)(dateStr).format("YYYY-MM-DD");
2018
- const tag = (_a8 = tagStr.match(VERSION_REG)) == null ? void 0 : _a8[0];
2019
- if (tag && date) {
2020
- map.set(tag.trim(), date);
2021
- }
2022
- });
2023
- return map;
2024
- }
2025
- function getFromToTags(tags) {
2026
- const result = [];
2027
- if (tags.length < 2) {
2028
- return result;
2029
- }
2030
- const releaseTags = tags.filter((tag) => !isPrerelease(tag));
2031
- const reversedTags = [...tags].reverse();
2032
- reversedTags.forEach((tag, index) => {
2033
- if (index < reversedTags.length - 1) {
2034
- const to = tag;
2035
- let from = reversedTags[index + 1];
2036
- if (!isPrerelease(to)) {
2037
- const toIndex = releaseTags.indexOf(to);
2038
- from = releaseTags[toIndex - 1];
2039
- }
2040
- result.push({ from, to });
2041
- }
2042
- });
2043
- return result.reverse();
2044
- }
2045
- async function getGitMainBranchName() {
2046
- const main = await execCommand("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
2047
- return main;
2048
- }
2049
- async function getCurrentGitBranch() {
2050
- const tag = await execCommand("git", ["tag", "--points-at", "HEAD"]);
2051
- const main = getGitMainBranchName();
2052
- return tag || main;
2053
- }
2054
- async function getGitHubRepo() {
2055
- const url = await execCommand("git", ["config", "--get", "remote.origin.url"]);
2056
- const match = url.match(/github\.com[/:]([\w\d._-]+?)\/([\w\d._-]+?)(\.git)?$/i);
2057
- if (!match) {
2058
- throw new Error(`Can not parse GitHub repo from url ${url}`);
2059
- }
2060
- return `${match[1]}/${match[2]}`;
2061
- }
2062
- function isPrerelease(version) {
2063
- const REG = /^[^.]*[\d.]+$/;
2064
- return !REG.test(version);
2065
- }
2066
- function getFirstGitCommit() {
2067
- return execCommand("git", ["rev-list", "--max-parents=0", "HEAD"]);
2068
- }
2069
- async function getGitDiff(from, to = "HEAD") {
2070
- const rawGit = await execCommand("git", [
2071
- "--no-pager",
2072
- "log",
2073
- `${from ? `${from}...` : ""}${to}`,
2074
- '--pretty="----%n%s|%h|%an|%ae%n%b"',
2075
- "--name-status"
2076
- ]);
2077
- const rwaGitLines = rawGit.split("----\n").splice(1);
2078
- const gitCommits = rwaGitLines.map((line) => {
2079
- const [firstLine, ...body] = line.split("\n");
2080
- const [message, shortHash, authorName, authorEmail] = firstLine.split("|");
2081
- const gitCommit = {
2082
- message,
2083
- shortHash,
2084
- author: { name: authorName, email: authorEmail },
2085
- body: body.join("\n")
2086
- };
2087
- return gitCommit;
2088
- });
2089
- return gitCommits;
2090
- }
2091
- function parseGitCommit(commit) {
2092
- const ConventionalCommitRegex = /(?<type>[a-z]+)(\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i;
2093
- const CoAuthoredByRegex = /co-authored-by:\s*(?<name>.+)(<(?<email>.+)>)/gim;
2094
- const PullRequestRE = /\([a-z]*(#\d+)\s*\)/gm;
2095
- const IssueRE = /(#\d+)/gm;
2096
- const match = commit.message.match(ConventionalCommitRegex);
2097
- if (!(match == null ? void 0 : match.groups)) {
2098
- return null;
2099
- }
2100
- const type = match.groups.type;
2101
- const scope = match.groups.scope || "";
2102
- const isBreaking = Boolean(match.groups.breaking);
2103
- let description = match.groups.description;
2104
- const references = [];
2105
- for (const m2 of description.matchAll(PullRequestRE)) {
2106
- references.push({ type: "pull-request", value: m2[1] });
2107
- }
2108
- for (const m2 of description.matchAll(IssueRE)) {
2109
- if (!references.some((i2) => i2.value === m2[1])) {
2110
- references.push({ type: "issue", value: m2[1] });
2111
- }
2112
- }
2113
- references.push({ value: commit.shortHash, type: "hash" });
2114
- description = description.replace(PullRequestRE, "").trim();
2115
- const authors = [commit.author];
2116
- const matches = commit.body.matchAll(CoAuthoredByRegex);
2117
- for (const $match of matches) {
2118
- const { name = "", email = "" } = $match.groups || {};
2119
- const author = {
2120
- name: name.trim(),
2121
- email: email.trim()
2122
- };
2123
- authors.push(author);
2124
- }
2125
- return {
2126
- ...commit,
2127
- authors,
2128
- resolvedAuthors: [],
2129
- description,
2130
- type,
2131
- scope,
2132
- references,
2133
- isBreaking
2134
- };
2135
- }
2136
- async function getGitCommits(from, to = "HEAD") {
2137
- const rwaGitCommits = await getGitDiff(from, to);
2138
- const commits = rwaGitCommits.map((commit) => parseGitCommit(commit)).filter(notNullish);
2139
- return commits;
2140
- }
2141
- function getHeaders(githubToken) {
2142
- return {
2143
- accept: "application/vnd.github.v3+json",
2144
- authorization: `token ${githubToken}`
2145
- };
2146
- }
2147
- async function getResolvedAuthorLogin(github, commitHashes, email) {
2148
- var _a8, _b5;
2149
- let login = "";
2150
- try {
2151
- const data = await (0, import_ofetch.ofetch)(`https://ungh.cc/users/find/${email}`);
2152
- login = ((_a8 = data == null ? void 0 : data.user) == null ? void 0 : _a8.username) || "";
2153
- } catch (e2) {
2154
- consola.log("e: ", e2);
2155
- }
2156
- if (login) {
2157
- return login;
2158
- }
2159
- const { repo, token } = github;
2160
- if (!token) {
2161
- return login;
2162
- }
2163
- if (commitHashes.length) {
2164
- try {
2165
- const data = await (0, import_ofetch.ofetch)(`https://api.github.com/repos/${repo}/commits/${commitHashes[0]}`, {
2166
- headers: getHeaders(token)
2167
- });
2168
- login = ((_b5 = data == null ? void 0 : data.author) == null ? void 0 : _b5.login) || "";
2169
- } catch (e2) {
2170
- consola.log("e: ", e2);
2171
- }
2172
- }
2173
- if (login) {
2174
- return login;
2175
- }
2176
- try {
2177
- const data = await (0, import_ofetch.ofetch)(`https://api.github.com/search/users?q=${encodeURIComponent(email)}`, {
2178
- headers: getHeaders(token)
2179
- });
2180
- login = data.items[0].login;
2181
- } catch (e2) {
2182
- consola.log("e: ", e2);
2183
- }
2184
- return login;
2185
- }
2186
- async function getGitCommitsAndResolvedAuthors(commits, github, resolvedLogins) {
2187
- const resultCommits = [];
2188
- const map = /* @__PURE__ */ new Map();
2189
- for await (const commit of commits) {
2190
- const resolvedAuthors = [];
2191
- for await (const [index, author] of commit.authors.entries()) {
2192
- const { email, name } = author;
2193
- if (email && name) {
2194
- const commitHashes = [];
2195
- if (index === 0) {
2196
- commitHashes.push(commit.shortHash);
2197
- }
2198
- const resolvedAuthor = {
2199
- name,
2200
- email,
2201
- commits: commitHashes,
2202
- login: ""
2203
- };
2204
- if (!(resolvedLogins == null ? void 0 : resolvedLogins.has(email))) {
2205
- const login = await getResolvedAuthorLogin(github, commitHashes, email);
2206
- resolvedAuthor.login = login;
2207
- resolvedLogins == null ? void 0 : resolvedLogins.set(email, login);
2208
- } else {
2209
- const login = (resolvedLogins == null ? void 0 : resolvedLogins.get(email)) || "";
2210
- resolvedAuthor.login = login;
2211
- }
2212
- resolvedAuthors.push(resolvedAuthor);
2213
- if (!map.has(email)) {
2214
- map.set(email, resolvedAuthor);
2215
- }
2216
- }
2217
- }
2218
- const resultCommit = { ...commit, resolvedAuthors };
2219
- resultCommits.push(resultCommit);
2220
- }
2221
- return {
2222
- commits: resultCommits,
2223
- contributors: Array.from(map.values())
2224
- };
2225
- }
2226
-
2227
- // src/options.ts
2228
- function createDefaultOptions() {
2229
- const cwd = import_node_process3.default.cwd();
2230
- const options = {
2231
- cwd,
2232
- types: {
2233
- feat: "\u{1F680} Features",
2234
- fix: "\u{1F41E} Bug Fixes",
2235
- perf: "\u{1F525} Performance",
2236
- optimize: "\u{1F6E0} Optimizations",
2237
- refactor: "\u{1F485} Refactors",
2238
- docs: "\u{1F4D6} Documentation",
2239
- build: "\u{1F4E6} Build",
2240
- types: "\u{1F30A} Types",
2241
- chore: "\u{1F3E1} Chore",
2242
- examples: "\u{1F3C0} Examples",
2243
- test: "\u2705 Tests",
2244
- style: "\u{1F3A8} Styles",
2245
- ci: "\u{1F916} CI"
2246
- },
2247
- github: {
2248
- repo: "",
2249
- token: import_node_process3.default.env.GITHUB_TOKEN || ""
2250
- },
2251
- from: "",
2252
- to: "",
2253
- tags: [],
2254
- tagDateMap: /* @__PURE__ */ new Map(),
2255
- capitalize: false,
2256
- emoji: true,
2257
- titles: {
2258
- breakingChanges: "\u{1F6A8} Breaking Changes"
2259
- },
2260
- output: "CHANGELOG.md",
2261
- regenerate: false
2262
- };
2263
- return options;
2264
- }
2265
- async function getVersionFromPkgJson(cwd) {
2266
- let newVersion = "";
2267
- try {
2268
- const pkgJson = await (0, import_promises.readFile)(`${cwd}/package.json`, "utf-8");
2269
- const pkg = JSON.parse(pkgJson);
2270
- newVersion = (pkg == null ? void 0 : pkg.version) || "";
2271
- } catch {
2272
- }
2273
- return {
2274
- newVersion
2275
- };
2276
- }
2277
- async function createOptions(options) {
2278
- var _a8;
2279
- const opts = createDefaultOptions();
2280
- Object.assign(opts, options);
2281
- const { newVersion } = await getVersionFromPkgJson(opts.cwd);
2282
- (_a8 = opts.github).repo || (_a8.repo = await getGitHubRepo());
2283
- const tags = await getTotalGitTags();
2284
- opts.tags = tags;
2285
- opts.from || (opts.from = tags[tags.length - 1]);
2286
- opts.to || (opts.to = `v${newVersion}`);
2287
- if (opts.to === opts.from) {
2288
- const lastTag = tags[tags.length - 2];
2289
- const firstCommit = await getFirstGitCommit();
2290
- opts.from = lastTag || firstCommit;
2291
- }
2292
- opts.tagDateMap = await getTagDateMap();
2293
- opts.prerelease || (opts.prerelease = isPrerelease(opts.to));
2294
- const isFromPrerelease = isPrerelease(opts.from);
2295
- if (!isPrerelease(newVersion) && isFromPrerelease) {
2296
- const allReleaseTags = opts.tags.filter((tag) => !isPrerelease(tag) && tag !== opts.to);
2297
- opts.from = allReleaseTags[allReleaseTags.length - 1];
2298
- }
2299
- return opts;
2300
- }
2301
-
2302
- // src/markdown.ts
2303
- init_cjs_shims();
2304
- var import_node_fs = require("fs");
2305
- var import_promises2 = require("fs/promises");
2306
- var import_dayjs2 = __toESM(require("dayjs"), 1);
2307
- var import_convert_gitmoji = require("convert-gitmoji");
2308
- function formatReferences(references, githubRepo, type) {
2309
- const refs = references.filter((i2) => {
2310
- if (type === "issues") return i2.type === "issue" || i2.type === "pull-request";
2311
- return i2.type === "hash";
2312
- }).map((ref) => {
2313
- if (!githubRepo) return ref.value;
2314
- if (ref.type === "pull-request" || ref.type === "issue")
2315
- return `https://github.com/${githubRepo}/issues/${ref.value.slice(1)}`;
2316
- return `[<samp>(${ref.value.slice(0, 5)})</samp>](https://github.com/${githubRepo}/commit/${ref.value})`;
2317
- });
2318
- const referencesString = join(refs).trim();
2319
- if (type === "issues") return referencesString && `in ${referencesString}`;
2320
- return referencesString;
2321
- }
2322
- function formatLine(commit, options) {
2323
- const prRefs = formatReferences(commit.references, options.github.repo, "issues");
2324
- const hashRefs = formatReferences(commit.references, options.github.repo, "hash");
2325
- let authors = join([...new Set(commit.resolvedAuthors.map((i2) => i2.login ? `@${i2.login}` : `**${i2.name}**`))]).trim();
2326
- if (authors) {
2327
- authors = `by ${authors}`;
2328
- }
2329
- let refs = [authors, prRefs, hashRefs].filter((i2) => i2 == null ? void 0 : i2.trim()).join(" ");
2330
- if (refs) {
2331
- refs = `&nbsp;-&nbsp; ${refs}`;
2332
- }
2333
- const description = options.capitalize ? capitalize(commit.description) : commit.description;
2334
- return [description, refs].filter((i2) => i2 == null ? void 0 : i2.trim()).join(" ");
2335
- }
2336
- function formatTitle(name, options) {
2337
- const emojisRE = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
2338
- let formatName = name.trim();
2339
- if (!options.emoji) {
2340
- formatName = name.replace(emojisRE, "").trim();
2341
- }
2342
- return `### &nbsp;&nbsp;&nbsp;${formatName}`;
2343
- }
2344
- function formatSection(commits, sectionName, options) {
2345
- if (!commits.length) return [];
2346
- const lines = ["", formatTitle(sectionName, options), ""];
2347
- const scopes = groupBy(commits, "scope");
2348
- let useScopeGroup = true;
2349
- if (!Object.entries(scopes).some(([k2, v2]) => k2 && v2.length > 1)) {
2350
- useScopeGroup = false;
2351
- }
2352
- Object.keys(scopes).sort().forEach((scope) => {
2353
- let padding = "";
2354
- let prefix = "";
2355
- const scopeText = `**${scope}**`;
2356
- if (scope && useScopeGroup) {
2357
- lines.push(`- ${scopeText}:`);
2358
- padding = " ";
2359
- } else if (scope) {
2360
- prefix = `${scopeText}: `;
2361
- }
2362
- lines.push(...scopes[scope].reverse().map((commit) => `${padding}- ${prefix}${formatLine(commit, options)}`));
2363
- });
2364
- return lines;
2365
- }
2366
- function getUserGithub(userName) {
2367
- const githubUrl = `https://github.com/${userName}`;
2368
- return githubUrl;
2369
- }
2370
- function getGitUserAvatar(userName) {
2371
- const githubUrl = getUserGithub(userName);
2372
- const avatarUrl = `${githubUrl}.png?size=48`;
2373
- return avatarUrl;
2374
- }
2375
- function createContributorLine(contributors) {
2376
- let loginLine = "";
2377
- let unLoginLine = "";
2378
- const contributorMap = /* @__PURE__ */ new Map();
2379
- contributors.forEach((contributor) => {
2380
- contributorMap.set(contributor.email, contributor);
2381
- });
2382
- const filteredContributors = Array.from(contributorMap.values());
2383
- filteredContributors.forEach((contributor, index) => {
2384
- const { name, email, login } = contributor;
2385
- if (!login) {
2386
- let line = `[${name}](mailto:${email})`;
2387
- if (index < contributors.length - 1) {
2388
- line += ",&nbsp;";
2389
- }
2390
- unLoginLine += line;
2391
- } else {
2392
- const githubUrl = getUserGithub(login);
2393
- const avatar = getGitUserAvatar(login);
2394
- loginLine += `[![${login}](${avatar})](${githubUrl})&nbsp;&nbsp;`;
2395
- }
2396
- });
2397
- return `${loginLine}
2398
- ${unLoginLine}`;
2399
- }
2400
- function generateMarkdown(params) {
2401
- const { options, showTitle, contributors } = params;
2402
- const commits = params.commits.filter((commit) => commit.description.match(VERSION_WITH_RELEASE) === null);
2403
- const lines = [];
2404
- const url = `https://github.com/${options.github.repo}/compare/${options.from}...${options.to}`;
2405
- if (showTitle) {
2406
- const date = options.tagDateMap.get(options.to) || (0, import_dayjs2.default)().format("YYYY-MM-DD");
2407
- let title = `## [${options.to}](${url})`;
2408
- if (date) {
2409
- title += ` (${date})`;
2410
- }
2411
- lines.push(title);
2412
- }
2413
- const [breaking, changes] = partition(commits, (c3) => c3.isBreaking);
2414
- const group = groupBy(changes, "type");
2415
- lines.push(...formatSection(breaking, options.titles.breakingChanges, options));
2416
- for (const type of Object.keys(options.types)) {
2417
- const items = group[type] || [];
2418
- lines.push(...formatSection(items, options.types[type], options));
2419
- }
2420
- if (!lines.length) {
2421
- lines.push("*No significant changes*");
2422
- }
2423
- if (!showTitle) {
2424
- lines.push("", `##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](${url})`);
2425
- }
2426
- if (showTitle) {
2427
- lines.push("", "### &nbsp;&nbsp;&nbsp;\u2764\uFE0F Contributors", "");
2428
- const contributorLine = createContributorLine(contributors);
2429
- lines.push(contributorLine);
2430
- }
2431
- const md = (0, import_convert_gitmoji.convert)(lines.join("\n").trim(), true);
2432
- return md;
2433
- }
2434
- async function isVersionInMarkdown(newVersion, mdPath) {
2435
- let isIn = false;
2436
- let md = "";
2437
- try {
2438
- md = await (0, import_promises2.readFile)(mdPath, "utf8");
2439
- } catch (error) {
2440
- }
2441
- if (md) {
2442
- const matches = md.match(VERSION_REG_OF_MARKDOWN);
2443
- if (matches == null ? void 0 : matches.length) {
2444
- const versionInMarkdown = `## [${newVersion}]`;
2445
- isIn = matches.includes(versionInMarkdown);
2446
- }
2447
- }
2448
- return isIn;
2449
- }
2450
- async function writeMarkdown(md, mdPath, regenerate = false) {
2451
- let changelogMD = "";
2452
- const changelogPrefix = "# Changelog";
2453
- if (!(0, import_node_fs.existsSync)(mdPath)) {
2454
- await (0, import_promises2.writeFile)(mdPath, `${changelogPrefix}
2455
-
2456
- `, "utf8");
2457
- }
2458
- if (!regenerate) {
2459
- changelogMD = await (0, import_promises2.readFile)(mdPath, "utf8");
2460
- }
2461
- if (!changelogMD.startsWith(changelogPrefix)) {
2462
- changelogMD = `${changelogPrefix}
2463
-
2464
- ${changelogMD}`;
2465
- }
2466
- const lastEntry = changelogMD.match(/^###?\s+.*$/m);
2467
- if (lastEntry) {
2468
- changelogMD = `${changelogMD.slice(0, lastEntry.index) + md}
2469
-
2470
- ${changelogMD.slice(lastEntry.index)}`;
2471
- } else {
2472
- changelogMD += `
2473
- ${md}
2474
-
2475
- `;
2476
- }
2477
- await (0, import_promises2.writeFile)(mdPath, changelogMD);
2478
- }
2479
-
2480
- // src/index.ts
2481
- async function getChangelogMarkdown(options, showTitle = true) {
2482
- const opts = await createOptions(options);
2483
- const current = await getCurrentGitBranch();
2484
- const to = opts.tags.includes(opts.to) ? opts.to : current;
2485
- const gitCommits = await getGitCommits(opts.from, to);
2486
- const resolvedLogins = /* @__PURE__ */ new Map();
2487
- const { commits, contributors } = await getGitCommitsAndResolvedAuthors(gitCommits, opts.github, resolvedLogins);
2488
- const markdown = generateMarkdown({ commits, options: opts, showTitle, contributors });
2489
- return {
2490
- markdown,
2491
- commits,
2492
- options: opts
2493
- };
2494
- }
2495
- async function getTotalChangelogMarkdown(options, showProgress = true) {
2496
- const opts = await createOptions(options);
2497
- let bar = null;
2498
- if (showProgress) {
2499
- bar = new import_cli_progress.SingleBar(
2500
- { format: "generate total changelog: [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}" },
2501
- import_cli_progress.Presets.shades_classic
2502
- );
2503
- }
2504
- const tags = getFromToTags(opts.tags);
2505
- if (tags.length === 0) {
2506
- const { markdown: markdown2 } = await getChangelogMarkdown(opts);
2507
- return markdown2;
2508
- }
2509
- bar == null ? void 0 : bar.start(tags.length, 0);
2510
- let markdown = "";
2511
- const resolvedLogins = /* @__PURE__ */ new Map();
2512
- for await (const [index, tag] of tags.entries()) {
2513
- const { from, to } = tag;
2514
- const gitCommits = await getGitCommits(from, to);
2515
- const { commits, contributors } = await getGitCommitsAndResolvedAuthors(gitCommits, opts.github, resolvedLogins);
2516
- const nextMd = generateMarkdown({ commits, options: { ...opts, from, to }, showTitle: true, contributors });
2517
- markdown = `${nextMd}
2518
-
2519
- ${markdown}`;
2520
- bar == null ? void 0 : bar.update(index + 1);
2521
- }
2522
- bar == null ? void 0 : bar.stop();
2523
- return markdown;
2524
- }
2525
- async function generateChangelog(options) {
2526
- const opts = await createOptions(options);
2527
- const existContent = await isVersionInMarkdown(opts.to, opts.output);
2528
- if (!opts.regenerate && existContent) return;
2529
- const { markdown } = await getChangelogMarkdown(opts);
2530
- await writeMarkdown(markdown, opts.output, opts.regenerate);
2531
- }
2532
- async function generateTotalChangelog(options, showProgress = true) {
2533
- const opts = await createOptions(options);
2534
- const markdown = await getTotalChangelogMarkdown(opts, showProgress);
2535
- await writeMarkdown(markdown, opts.output, true);
2536
- }
2537
- // Annotate the CommonJS export names for ESM import in node:
2538
- 0 && (module.exports = {
2539
- generateChangelog,
2540
- generateTotalChangelog,
2541
- getChangelogMarkdown,
2542
- getTotalChangelogMarkdown
2543
- });