@palantir/pack.sdkgen.pack-template 0.0.1-beta.1

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.
@@ -0,0 +1,1164 @@
1
+ import { spawnSync } from 'child_process';
2
+ import { formatWithOptions } from 'util';
3
+ import path, { sep } from 'path';
4
+ import g$1 from 'process';
5
+ import * as tty from 'tty';
6
+ import fs from 'fs-extra';
7
+
8
+ // src/config.ts
9
+ var config = {
10
+ name: "@palantir/pack.sdkgen.pack-template",
11
+ description: "PACK SDK template for generating types and Zod schemas from YAML",
12
+ templateFiles: ["**/*.ejs"],
13
+ staticFiles: ["**/*", "!**/*.ejs", "_gitignore"],
14
+ prompts: [{
15
+ type: "input",
16
+ name: "description",
17
+ message: "SDK description:",
18
+ default: "Generated SDK from schema"
19
+ }, {
20
+ type: "input",
21
+ name: "author",
22
+ message: "Author:",
23
+ default: ""
24
+ }, {
25
+ type: "input",
26
+ name: "schemaDir",
27
+ message: "Directory containing YAML schema files:",
28
+ default: "schema"
29
+ }],
30
+ transformers: {
31
+ default: "./build/esm/transformer.js"
32
+ },
33
+ hooks: {
34
+ afterGenerate: "./build/esm/hooks/afterGenerate.js"
35
+ },
36
+ utils: ["camelCase", "pascalCase", "kebabCase", "upperCase", "lowerCase"]
37
+ };
38
+
39
+ // ../../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
40
+ var LogLevels = {
41
+ fatal: 0,
42
+ error: 0,
43
+ warn: 1,
44
+ log: 2,
45
+ info: 3,
46
+ success: 3,
47
+ fail: 3,
48
+ debug: 4,
49
+ trace: 5,
50
+ verbose: Number.POSITIVE_INFINITY
51
+ };
52
+ var LogTypes = {
53
+ // Silent
54
+ silent: {
55
+ level: -1
56
+ },
57
+ // Level 0
58
+ fatal: {
59
+ level: LogLevels.fatal
60
+ },
61
+ error: {
62
+ level: LogLevels.error
63
+ },
64
+ // Level 1
65
+ warn: {
66
+ level: LogLevels.warn
67
+ },
68
+ // Level 2
69
+ log: {
70
+ level: LogLevels.log
71
+ },
72
+ // Level 3
73
+ info: {
74
+ level: LogLevels.info
75
+ },
76
+ success: {
77
+ level: LogLevels.success
78
+ },
79
+ fail: {
80
+ level: LogLevels.fail
81
+ },
82
+ ready: {
83
+ level: LogLevels.info
84
+ },
85
+ start: {
86
+ level: LogLevels.info
87
+ },
88
+ box: {
89
+ level: LogLevels.info
90
+ },
91
+ // Level 4
92
+ debug: {
93
+ level: LogLevels.debug
94
+ },
95
+ // Level 5
96
+ trace: {
97
+ level: LogLevels.trace
98
+ },
99
+ // Verbose
100
+ verbose: {
101
+ level: LogLevels.verbose
102
+ }
103
+ };
104
+ function isPlainObject$1(value) {
105
+ if (value === null || typeof value !== "object") {
106
+ return false;
107
+ }
108
+ const prototype = Object.getPrototypeOf(value);
109
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
110
+ return false;
111
+ }
112
+ if (Symbol.iterator in value) {
113
+ return false;
114
+ }
115
+ if (Symbol.toStringTag in value) {
116
+ return Object.prototype.toString.call(value) === "[object Module]";
117
+ }
118
+ return true;
119
+ }
120
+ function _defu(baseObject, defaults, namespace = ".", merger) {
121
+ if (!isPlainObject$1(defaults)) {
122
+ return _defu(baseObject, {}, namespace);
123
+ }
124
+ const object = Object.assign({}, defaults);
125
+ for (const key in baseObject) {
126
+ if (key === "__proto__" || key === "constructor") {
127
+ continue;
128
+ }
129
+ const value = baseObject[key];
130
+ if (value === null || value === void 0) {
131
+ continue;
132
+ }
133
+ if (Array.isArray(value) && Array.isArray(object[key])) {
134
+ object[key] = [...value, ...object[key]];
135
+ } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
136
+ object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString());
137
+ } else {
138
+ object[key] = value;
139
+ }
140
+ }
141
+ return object;
142
+ }
143
+ function createDefu(merger) {
144
+ return (...arguments_) => (
145
+ // eslint-disable-next-line unicorn/no-array-reduce
146
+ arguments_.reduce((p, c2) => _defu(p, c2, ""), {})
147
+ );
148
+ }
149
+ var defu = createDefu();
150
+ function isPlainObject(obj) {
151
+ return Object.prototype.toString.call(obj) === "[object Object]";
152
+ }
153
+ function isLogObj(arg) {
154
+ if (!isPlainObject(arg)) {
155
+ return false;
156
+ }
157
+ if (!arg.message && !arg.args) {
158
+ return false;
159
+ }
160
+ if (arg.stack) {
161
+ return false;
162
+ }
163
+ return true;
164
+ }
165
+ var paused = false;
166
+ var queue = [];
167
+ var Consola = class _Consola {
168
+ options;
169
+ _lastLog;
170
+ _mockFn;
171
+ /**
172
+ * Creates an instance of Consola with specified options or defaults.
173
+ *
174
+ * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
175
+ */
176
+ constructor(options = {}) {
177
+ const types = options.types || LogTypes;
178
+ this.options = defu({
179
+ ...options,
180
+ defaults: {
181
+ ...options.defaults
182
+ },
183
+ level: _normalizeLogLevel(options.level, types),
184
+ reporters: [...options.reporters || []]
185
+ }, {
186
+ types: LogTypes,
187
+ throttle: 1e3,
188
+ throttleMin: 5,
189
+ formatOptions: {
190
+ date: true,
191
+ colors: false,
192
+ compact: true
193
+ }
194
+ });
195
+ for (const type in types) {
196
+ const defaults = {
197
+ type,
198
+ ...this.options.defaults,
199
+ ...types[type]
200
+ };
201
+ this[type] = this._wrapLogFn(defaults);
202
+ this[type].raw = this._wrapLogFn(defaults, true);
203
+ }
204
+ if (this.options.mockFn) {
205
+ this.mockTypes();
206
+ }
207
+ this._lastLog = {};
208
+ }
209
+ /**
210
+ * Gets the current log level of the Consola instance.
211
+ *
212
+ * @returns {number} The current log level.
213
+ */
214
+ get level() {
215
+ return this.options.level;
216
+ }
217
+ /**
218
+ * Sets the minimum log level that will be output by the instance.
219
+ *
220
+ * @param {number} level - The new log level to set.
221
+ */
222
+ set level(level) {
223
+ this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
224
+ }
225
+ /**
226
+ * Displays a prompt to the user and returns the response.
227
+ * Throw an error if `prompt` is not supported by the current configuration.
228
+ *
229
+ * @template T
230
+ * @param {string} message - The message to display in the prompt.
231
+ * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
232
+ * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
233
+ */
234
+ prompt(message, opts) {
235
+ if (!this.options.prompt) {
236
+ throw new Error("prompt is not supported!");
237
+ }
238
+ return this.options.prompt(message, opts);
239
+ }
240
+ /**
241
+ * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
242
+ *
243
+ * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
244
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
245
+ */
246
+ create(options) {
247
+ const instance = new _Consola({
248
+ ...this.options,
249
+ ...options
250
+ });
251
+ if (this._mockFn) {
252
+ instance.mockTypes(this._mockFn);
253
+ }
254
+ return instance;
255
+ }
256
+ /**
257
+ * Creates a new Consola instance with the specified default log object properties.
258
+ *
259
+ * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
260
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
261
+ */
262
+ withDefaults(defaults) {
263
+ return this.create({
264
+ ...this.options,
265
+ defaults: {
266
+ ...this.options.defaults,
267
+ ...defaults
268
+ }
269
+ });
270
+ }
271
+ /**
272
+ * Creates a new Consola instance with a specified tag, which will be included in every log.
273
+ *
274
+ * @param {string} tag - The tag to include in each log of the new instance.
275
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
276
+ */
277
+ withTag(tag) {
278
+ return this.withDefaults({
279
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
280
+ });
281
+ }
282
+ /**
283
+ * Adds a custom reporter to the Consola instance.
284
+ * Reporters will be called for each log message, depending on their implementation and log level.
285
+ *
286
+ * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
287
+ * @returns {Consola} The current Consola instance.
288
+ */
289
+ addReporter(reporter) {
290
+ this.options.reporters.push(reporter);
291
+ return this;
292
+ }
293
+ /**
294
+ * Removes a custom reporter from the Consola instance.
295
+ * If no reporter is specified, all reporters will be removed.
296
+ *
297
+ * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
298
+ * @returns {Consola} The current Consola instance.
299
+ */
300
+ removeReporter(reporter) {
301
+ if (reporter) {
302
+ const i2 = this.options.reporters.indexOf(reporter);
303
+ if (i2 !== -1) {
304
+ return this.options.reporters.splice(i2, 1);
305
+ }
306
+ } else {
307
+ this.options.reporters.splice(0);
308
+ }
309
+ return this;
310
+ }
311
+ /**
312
+ * Replaces all reporters of the Consola instance with the specified array of reporters.
313
+ *
314
+ * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
315
+ * @returns {Consola} The current Consola instance.
316
+ */
317
+ setReporters(reporters) {
318
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
319
+ return this;
320
+ }
321
+ wrapAll() {
322
+ this.wrapConsole();
323
+ this.wrapStd();
324
+ }
325
+ restoreAll() {
326
+ this.restoreConsole();
327
+ this.restoreStd();
328
+ }
329
+ /**
330
+ * Overrides console methods with Consola logging methods for consistent logging.
331
+ */
332
+ wrapConsole() {
333
+ for (const type in this.options.types) {
334
+ if (!console["__" + type]) {
335
+ console["__" + type] = console[type];
336
+ }
337
+ console[type] = this[type].raw;
338
+ }
339
+ }
340
+ /**
341
+ * Restores the original console methods, removing Consola overrides.
342
+ */
343
+ restoreConsole() {
344
+ for (const type in this.options.types) {
345
+ if (console["__" + type]) {
346
+ console[type] = console["__" + type];
347
+ delete console["__" + type];
348
+ }
349
+ }
350
+ }
351
+ /**
352
+ * Overrides standard output and error streams to redirect them through Consola.
353
+ */
354
+ wrapStd() {
355
+ this._wrapStream(this.options.stdout, "log");
356
+ this._wrapStream(this.options.stderr, "log");
357
+ }
358
+ _wrapStream(stream, type) {
359
+ if (!stream) {
360
+ return;
361
+ }
362
+ if (!stream.__write) {
363
+ stream.__write = stream.write;
364
+ }
365
+ stream.write = (data) => {
366
+ this[type].raw(String(data).trim());
367
+ };
368
+ }
369
+ /**
370
+ * Restores the original standard output and error streams, removing the Consola redirection.
371
+ */
372
+ restoreStd() {
373
+ this._restoreStream(this.options.stdout);
374
+ this._restoreStream(this.options.stderr);
375
+ }
376
+ _restoreStream(stream) {
377
+ if (!stream) {
378
+ return;
379
+ }
380
+ if (stream.__write) {
381
+ stream.write = stream.__write;
382
+ delete stream.__write;
383
+ }
384
+ }
385
+ /**
386
+ * Pauses logging, queues incoming logs until resumed.
387
+ */
388
+ pauseLogs() {
389
+ paused = true;
390
+ }
391
+ /**
392
+ * Resumes logging, processing any queued logs.
393
+ */
394
+ resumeLogs() {
395
+ paused = false;
396
+ const _queue = queue.splice(0);
397
+ for (const item of _queue) {
398
+ item[0]._logFn(item[1], item[2]);
399
+ }
400
+ }
401
+ /**
402
+ * Replaces logging methods with mocks if a mock function is provided.
403
+ *
404
+ * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
405
+ */
406
+ mockTypes(mockFn) {
407
+ const _mockFn = mockFn || this.options.mockFn;
408
+ this._mockFn = _mockFn;
409
+ if (typeof _mockFn !== "function") {
410
+ return;
411
+ }
412
+ for (const type in this.options.types) {
413
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
414
+ this[type].raw = this[type];
415
+ }
416
+ }
417
+ _wrapLogFn(defaults, isRaw) {
418
+ return (...args) => {
419
+ if (paused) {
420
+ queue.push([this, defaults, args, isRaw]);
421
+ return;
422
+ }
423
+ return this._logFn(defaults, args, isRaw);
424
+ };
425
+ }
426
+ _logFn(defaults, args, isRaw) {
427
+ if ((defaults.level || 0) > this.level) {
428
+ return false;
429
+ }
430
+ const logObj = {
431
+ date: /* @__PURE__ */ new Date(),
432
+ args: [],
433
+ ...defaults,
434
+ level: _normalizeLogLevel(defaults.level, this.options.types)
435
+ };
436
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
437
+ Object.assign(logObj, args[0]);
438
+ } else {
439
+ logObj.args = [...args];
440
+ }
441
+ if (logObj.message) {
442
+ logObj.args.unshift(logObj.message);
443
+ delete logObj.message;
444
+ }
445
+ if (logObj.additional) {
446
+ if (!Array.isArray(logObj.additional)) {
447
+ logObj.additional = logObj.additional.split("\n");
448
+ }
449
+ logObj.args.push("\n" + logObj.additional.join("\n"));
450
+ delete logObj.additional;
451
+ }
452
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
453
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
454
+ const resolveLog = (newLog = false) => {
455
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
456
+ if (this._lastLog.object && repeated > 0) {
457
+ const args2 = [...this._lastLog.object.args];
458
+ if (repeated > 1) {
459
+ args2.push(`(repeated ${repeated} times)`);
460
+ }
461
+ this._log({
462
+ ...this._lastLog.object,
463
+ args: args2
464
+ });
465
+ this._lastLog.count = 1;
466
+ }
467
+ if (newLog) {
468
+ this._lastLog.object = logObj;
469
+ this._log(logObj);
470
+ }
471
+ };
472
+ clearTimeout(this._lastLog.timeout);
473
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
474
+ this._lastLog.time = logObj.date;
475
+ if (diffTime < this.options.throttle) {
476
+ try {
477
+ const serializedLog = JSON.stringify([logObj.type, logObj.tag, logObj.args]);
478
+ const isSameLog = this._lastLog.serialized === serializedLog;
479
+ this._lastLog.serialized = serializedLog;
480
+ if (isSameLog) {
481
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
482
+ if (this._lastLog.count > this.options.throttleMin) {
483
+ this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
484
+ return;
485
+ }
486
+ }
487
+ } catch {
488
+ }
489
+ }
490
+ resolveLog(true);
491
+ }
492
+ _log(logObj) {
493
+ for (const reporter of this.options.reporters) {
494
+ reporter.log(logObj, {
495
+ options: this.options
496
+ });
497
+ }
498
+ }
499
+ };
500
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
501
+ if (input === void 0) {
502
+ return defaultLevel;
503
+ }
504
+ if (typeof input === "number") {
505
+ return input;
506
+ }
507
+ if (types[input] && types[input].level !== void 0) {
508
+ return types[input].level;
509
+ }
510
+ return defaultLevel;
511
+ }
512
+ Consola.prototype.add = Consola.prototype.addReporter;
513
+ Consola.prototype.remove = Consola.prototype.removeReporter;
514
+ Consola.prototype.clear = Consola.prototype.removeReporter;
515
+ Consola.prototype.withScope = Consola.prototype.withTag;
516
+ Consola.prototype.mock = Consola.prototype.mockTypes;
517
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
518
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
519
+ function createConsola(options = {}) {
520
+ return new Consola(options);
521
+ }
522
+ function parseStack(stack, message) {
523
+ const cwd = process.cwd() + sep;
524
+ const lines = stack.split("\n").splice(message.split("\n").length).map((l2) => l2.trim().replace("file://", "").replace(cwd, ""));
525
+ return lines;
526
+ }
527
+ function writeStream(data, stream) {
528
+ const write = stream.__write || stream.write;
529
+ return write.call(stream, data);
530
+ }
531
+ var bracket = (x) => x ? `[${x}]` : "";
532
+ var BasicReporter = class {
533
+ formatStack(stack, message, opts) {
534
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
535
+ return indent + parseStack(stack, message).join(`
536
+ ${indent}`);
537
+ }
538
+ formatError(err, opts) {
539
+ const message = err.message ?? formatWithOptions(opts, err);
540
+ const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
541
+ const level = opts?.errorLevel || 0;
542
+ const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
543
+ const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
544
+ ...opts,
545
+ errorLevel: level + 1
546
+ }) : "";
547
+ return causedPrefix + message + "\n" + stack + causedError;
548
+ }
549
+ formatArgs(args, opts) {
550
+ const _args = args.map((arg) => {
551
+ if (arg && typeof arg.stack === "string") {
552
+ return this.formatError(arg, opts);
553
+ }
554
+ return arg;
555
+ });
556
+ return formatWithOptions(opts, ..._args);
557
+ }
558
+ formatDate(date, opts) {
559
+ return opts.date ? date.toLocaleTimeString() : "";
560
+ }
561
+ filterAndJoin(arr) {
562
+ return arr.filter(Boolean).join(" ");
563
+ }
564
+ formatLogObj(logObj, opts) {
565
+ const message = this.formatArgs(logObj.args, opts);
566
+ if (logObj.type === "box") {
567
+ return "\n" + [bracket(logObj.tag), logObj.title && logObj.title, ...message.split("\n")].filter(Boolean).map((l2) => " > " + l2).join("\n") + "\n";
568
+ }
569
+ return this.filterAndJoin([bracket(logObj.type), bracket(logObj.tag), message]);
570
+ }
571
+ log(logObj, ctx) {
572
+ const line = this.formatLogObj(logObj, {
573
+ columns: ctx.options.stdout.columns || 0,
574
+ ...ctx.options.formatOptions
575
+ });
576
+ return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
577
+ }
578
+ };
579
+ var {
580
+ env = {},
581
+ argv = [],
582
+ platform = ""
583
+ } = typeof process === "undefined" ? {} : process;
584
+ var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
585
+ var isForced = "FORCE_COLOR" in env || argv.includes("--color");
586
+ var isWindows = platform === "win32";
587
+ var isDumbTerminal = env.TERM === "dumb";
588
+ var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
589
+ var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
590
+ var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
591
+ 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)) {
592
+ return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
593
+ }
594
+ function clearBleed(index, string, open, close, replace) {
595
+ return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
596
+ }
597
+ function filterEmpty(open, close, replace = open, at = open.length + 1) {
598
+ return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
599
+ }
600
+ function init(open, close, replace) {
601
+ return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
602
+ }
603
+ var colorDefs = {
604
+ reset: init(0, 0),
605
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
606
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
607
+ italic: init(3, 23),
608
+ underline: init(4, 24),
609
+ inverse: init(7, 27),
610
+ hidden: init(8, 28),
611
+ strikethrough: init(9, 29),
612
+ black: init(30, 39),
613
+ red: init(31, 39),
614
+ green: init(32, 39),
615
+ yellow: init(33, 39),
616
+ blue: init(34, 39),
617
+ magenta: init(35, 39),
618
+ cyan: init(36, 39),
619
+ white: init(37, 39),
620
+ gray: init(90, 39),
621
+ bgBlack: init(40, 49),
622
+ bgRed: init(41, 49),
623
+ bgGreen: init(42, 49),
624
+ bgYellow: init(43, 49),
625
+ bgBlue: init(44, 49),
626
+ bgMagenta: init(45, 49),
627
+ bgCyan: init(46, 49),
628
+ bgWhite: init(47, 49),
629
+ blackBright: init(90, 39),
630
+ redBright: init(91, 39),
631
+ greenBright: init(92, 39),
632
+ yellowBright: init(93, 39),
633
+ blueBright: init(94, 39),
634
+ magentaBright: init(95, 39),
635
+ cyanBright: init(96, 39),
636
+ whiteBright: init(97, 39),
637
+ bgBlackBright: init(100, 49),
638
+ bgRedBright: init(101, 49),
639
+ bgGreenBright: init(102, 49),
640
+ bgYellowBright: init(103, 49),
641
+ bgBlueBright: init(104, 49),
642
+ bgMagentaBright: init(105, 49),
643
+ bgCyanBright: init(106, 49),
644
+ bgWhiteBright: init(107, 49)
645
+ };
646
+ function createColors(useColor = isColorSupported) {
647
+ return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
648
+ }
649
+ var colors = createColors();
650
+ function getColor(color, fallback = "reset") {
651
+ return colors[color] || colors[fallback];
652
+ }
653
+ var ansiRegex = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
654
+ function stripAnsi(text) {
655
+ return text.replace(new RegExp(ansiRegex, "g"), "");
656
+ }
657
+ var boxStylePresets = {
658
+ solid: {
659
+ tl: "\u250C",
660
+ tr: "\u2510",
661
+ bl: "\u2514",
662
+ br: "\u2518",
663
+ h: "\u2500",
664
+ v: "\u2502"
665
+ },
666
+ double: {
667
+ tl: "\u2554",
668
+ tr: "\u2557",
669
+ bl: "\u255A",
670
+ br: "\u255D",
671
+ h: "\u2550",
672
+ v: "\u2551"
673
+ },
674
+ doubleSingle: {
675
+ tl: "\u2553",
676
+ tr: "\u2556",
677
+ bl: "\u2559",
678
+ br: "\u255C",
679
+ h: "\u2500",
680
+ v: "\u2551"
681
+ },
682
+ doubleSingleRounded: {
683
+ tl: "\u256D",
684
+ tr: "\u256E",
685
+ bl: "\u2570",
686
+ br: "\u256F",
687
+ h: "\u2500",
688
+ v: "\u2551"
689
+ },
690
+ singleThick: {
691
+ tl: "\u250F",
692
+ tr: "\u2513",
693
+ bl: "\u2517",
694
+ br: "\u251B",
695
+ h: "\u2501",
696
+ v: "\u2503"
697
+ },
698
+ singleDouble: {
699
+ tl: "\u2552",
700
+ tr: "\u2555",
701
+ bl: "\u2558",
702
+ br: "\u255B",
703
+ h: "\u2550",
704
+ v: "\u2502"
705
+ },
706
+ singleDoubleRounded: {
707
+ tl: "\u256D",
708
+ tr: "\u256E",
709
+ bl: "\u2570",
710
+ br: "\u256F",
711
+ h: "\u2550",
712
+ v: "\u2502"
713
+ },
714
+ rounded: {
715
+ tl: "\u256D",
716
+ tr: "\u256E",
717
+ bl: "\u2570",
718
+ br: "\u256F",
719
+ h: "\u2500",
720
+ v: "\u2502"
721
+ }
722
+ };
723
+ var defaultStyle = {
724
+ borderColor: "white",
725
+ borderStyle: "rounded",
726
+ valign: "center",
727
+ padding: 2,
728
+ marginLeft: 1,
729
+ marginTop: 1,
730
+ marginBottom: 1
731
+ };
732
+ function box(text, _opts = {}) {
733
+ const opts = {
734
+ ..._opts,
735
+ style: {
736
+ ...defaultStyle,
737
+ ..._opts.style
738
+ }
739
+ };
740
+ const textLines = text.split("\n");
741
+ const boxLines = [];
742
+ const _color = getColor(opts.style.borderColor);
743
+ const borderStyle = {
744
+ ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
745
+ };
746
+ if (_color) {
747
+ for (const key in borderStyle) {
748
+ borderStyle[key] = _color(borderStyle[key]);
749
+ }
750
+ }
751
+ const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
752
+ const height = textLines.length + paddingOffset;
753
+ const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
754
+ const widthOffset = width + paddingOffset;
755
+ const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
756
+ if (opts.style.marginTop > 0) {
757
+ boxLines.push("".repeat(opts.style.marginTop));
758
+ }
759
+ if (opts.title) {
760
+ const title = _color ? _color(opts.title) : opts.title;
761
+ const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
762
+ const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
763
+ boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
764
+ } else {
765
+ boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
766
+ }
767
+ const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
768
+ for (let i2 = 0; i2 < height; i2++) {
769
+ if (i2 < valignOffset || i2 >= valignOffset + textLines.length) {
770
+ boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
771
+ } else {
772
+ const line = textLines[i2 - valignOffset];
773
+ const left = " ".repeat(paddingOffset);
774
+ const right = " ".repeat(width - stripAnsi(line).length);
775
+ boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
776
+ }
777
+ }
778
+ boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
779
+ if (opts.style.marginBottom > 0) {
780
+ boxLines.push("".repeat(opts.style.marginBottom));
781
+ }
782
+ return boxLines.join("\n");
783
+ }
784
+ var r = /* @__PURE__ */ Object.create(null);
785
+ var i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis);
786
+ var o = new Proxy(r, {
787
+ get(e, s2) {
788
+ return i()[s2] ?? r[s2];
789
+ },
790
+ has(e, s2) {
791
+ const E = i();
792
+ return s2 in E || s2 in r;
793
+ },
794
+ set(e, s2, E) {
795
+ const B = i(true);
796
+ return B[s2] = E, true;
797
+ },
798
+ deleteProperty(e, s2) {
799
+ if (!s2) return false;
800
+ const E = i(true);
801
+ return delete E[s2], true;
802
+ },
803
+ ownKeys() {
804
+ const e = i(true);
805
+ return Object.keys(e);
806
+ }
807
+ });
808
+ var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
809
+ var f = [["APPVEYOR"], ["AWS_AMPLIFY", "AWS_APP_ID", {
810
+ ci: true
811
+ }], ["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", {
812
+ ci: true
813
+ }], ["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", {
814
+ ci: false
815
+ }], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["VERCEL", "VERCEL", {
816
+ ci: false
817
+ }], ["VERCEL", "VERCEL_ENV", {
818
+ ci: false
819
+ }], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", {
820
+ ci: false
821
+ }], ["CODESANDBOX", "CODESANDBOX_HOST", {
822
+ ci: false
823
+ }], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"], ["ZEABUR"], ["CODESPHERE", "CODESPHERE_APP_ID", {
824
+ ci: true
825
+ }], ["RAILWAY", "RAILWAY_PROJECT_ID"], ["RAILWAY", "RAILWAY_SERVICE_ID"], ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"], ["FIREBASE_APP_HOSTING", "FIREBASE_APP_HOSTING", {
826
+ ci: true
827
+ }]];
828
+ function b() {
829
+ if (globalThis.process?.env) for (const e of f) {
830
+ const s2 = e[1] || e[0];
831
+ if (globalThis.process?.env[s2]) return {
832
+ name: e[0].toLowerCase(),
833
+ ...e[2]
834
+ };
835
+ }
836
+ return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
837
+ name: "stackblitz",
838
+ ci: false
839
+ } : {
840
+ name: "",
841
+ ci: false
842
+ };
843
+ }
844
+ var l = b();
845
+ l.name;
846
+ function n(e) {
847
+ return e ? e !== "false" : false;
848
+ }
849
+ var I = globalThis.process?.platform || "";
850
+ var T = n(o.CI) || l.ci !== false;
851
+ var a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
852
+ var g = n(o.DEBUG);
853
+ var R = t === "test" || n(o.TEST);
854
+ n(o.MINIMAL) || T || R || !a;
855
+ var A = /^win/i.test(I);
856
+ !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM !== "dumb" || T);
857
+ var C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
858
+ Number(C?.split(".")[0]) || null;
859
+ var y = globalThis.process || /* @__PURE__ */ Object.create(null);
860
+ var _ = {
861
+ versions: {}
862
+ };
863
+ new Proxy(y, {
864
+ get(e, s2) {
865
+ if (s2 === "env") return o;
866
+ if (s2 in e) return e[s2];
867
+ if (s2 in _) return _[s2];
868
+ }
869
+ });
870
+ var c = globalThis.process?.release?.name === "node";
871
+ var O = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
872
+ var D = !!globalThis.Deno;
873
+ var L = !!globalThis.fastly;
874
+ var S = !!globalThis.Netlify;
875
+ var u = !!globalThis.EdgeRuntime;
876
+ var N = globalThis.navigator?.userAgent === "Cloudflare-Workers";
877
+ var F = [[S, "netlify"], [u, "edge-light"], [N, "workerd"], [L, "fastly"], [D, "deno"], [O, "bun"], [c, "node"]];
878
+ function G() {
879
+ const e = F.find((s2) => s2[0]);
880
+ if (e) return {
881
+ name: e[1]
882
+ };
883
+ }
884
+ var P = G();
885
+ P?.name || "";
886
+ function ansiRegex2({
887
+ onlyFirst = false
888
+ } = {}) {
889
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
890
+ const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
891
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
892
+ }
893
+ var regex = ansiRegex2();
894
+ function stripAnsi2(string) {
895
+ if (typeof string !== "string") {
896
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
897
+ }
898
+ return string.replace(regex, "");
899
+ }
900
+ function isAmbiguous(x) {
901
+ return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
902
+ }
903
+ function isFullWidth(x) {
904
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
905
+ }
906
+ function isWide(x) {
907
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
908
+ }
909
+ function validate(codePoint) {
910
+ if (!Number.isSafeInteger(codePoint)) {
911
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
912
+ }
913
+ }
914
+ function eastAsianWidth(codePoint, {
915
+ ambiguousAsWide = false
916
+ } = {}) {
917
+ validate(codePoint);
918
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
919
+ return 2;
920
+ }
921
+ return 1;
922
+ }
923
+ var emojiRegex = () => {
924
+ 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;
925
+ };
926
+ var segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : {
927
+ segment: (str) => str.split("")
928
+ };
929
+ var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
930
+ function stringWidth$1(string, options = {}) {
931
+ if (typeof string !== "string" || string.length === 0) {
932
+ return 0;
933
+ }
934
+ const {
935
+ ambiguousIsNarrow = true,
936
+ countAnsiEscapeCodes = false
937
+ } = options;
938
+ if (!countAnsiEscapeCodes) {
939
+ string = stripAnsi2(string);
940
+ }
941
+ if (string.length === 0) {
942
+ return 0;
943
+ }
944
+ let width = 0;
945
+ const eastAsianWidthOptions = {
946
+ ambiguousAsWide: !ambiguousIsNarrow
947
+ };
948
+ for (const {
949
+ segment: character
950
+ } of segmenter.segment(string)) {
951
+ const codePoint = character.codePointAt(0);
952
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
953
+ continue;
954
+ }
955
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
956
+ continue;
957
+ }
958
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
959
+ continue;
960
+ }
961
+ if (codePoint >= 55296 && codePoint <= 57343) {
962
+ continue;
963
+ }
964
+ if (codePoint >= 65024 && codePoint <= 65039) {
965
+ continue;
966
+ }
967
+ if (defaultIgnorableCodePointRegex.test(character)) {
968
+ continue;
969
+ }
970
+ if (emojiRegex().test(character)) {
971
+ width += 2;
972
+ continue;
973
+ }
974
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
975
+ }
976
+ return width;
977
+ }
978
+ function isUnicodeSupported() {
979
+ const {
980
+ env: env2
981
+ } = g$1;
982
+ const {
983
+ TERM,
984
+ TERM_PROGRAM
985
+ } = env2;
986
+ if (g$1.platform !== "win32") {
987
+ return TERM !== "linux";
988
+ }
989
+ 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";
990
+ }
991
+ var TYPE_COLOR_MAP = {
992
+ info: "cyan",
993
+ fail: "red",
994
+ success: "green",
995
+ ready: "green",
996
+ start: "magenta"
997
+ };
998
+ var LEVEL_COLOR_MAP = {
999
+ 0: "red",
1000
+ 1: "yellow"
1001
+ };
1002
+ var unicode = isUnicodeSupported();
1003
+ var s = (c2, fallback) => unicode ? c2 : fallback;
1004
+ var TYPE_ICONS = {
1005
+ error: s("\u2716", "\xD7"),
1006
+ fatal: s("\u2716", "\xD7"),
1007
+ ready: s("\u2714", "\u221A"),
1008
+ warn: s("\u26A0", "\u203C"),
1009
+ info: s("\u2139", "i"),
1010
+ success: s("\u2714", "\u221A"),
1011
+ debug: s("\u2699", "D"),
1012
+ trace: s("\u2192", "\u2192"),
1013
+ fail: s("\u2716", "\xD7"),
1014
+ start: s("\u25D0", "o"),
1015
+ log: ""
1016
+ };
1017
+ function stringWidth(str) {
1018
+ const hasICU = typeof Intl === "object";
1019
+ if (!hasICU || !Intl.Segmenter) {
1020
+ return stripAnsi(str).length;
1021
+ }
1022
+ return stringWidth$1(str);
1023
+ }
1024
+ var FancyReporter = class extends BasicReporter {
1025
+ formatStack(stack, message, opts) {
1026
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
1027
+ return `
1028
+ ${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_2, m) => `(${colors.cyan(m)})`)).join(`
1029
+ ${indent}`);
1030
+ }
1031
+ formatType(logObj, isBadge, opts) {
1032
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1033
+ if (isBadge) {
1034
+ return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
1035
+ }
1036
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1037
+ return _type ? getColor2(typeColor)(_type) : "";
1038
+ }
1039
+ formatLogObj(logObj, opts) {
1040
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
1041
+ if (logObj.type === "box") {
1042
+ return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
1043
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
1044
+ style: logObj.style
1045
+ });
1046
+ }
1047
+ const date = this.formatDate(logObj.date, opts);
1048
+ const coloredDate = date && colors.gray(date);
1049
+ const isBadge = logObj.badge ?? logObj.level < 2;
1050
+ const type = this.formatType(logObj, isBadge, opts);
1051
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1052
+ let line;
1053
+ const left = this.filterAndJoin([type, characterFormat(message)]);
1054
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1055
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1056
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1057
+ line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
1058
+ if (logObj.type === "trace") {
1059
+ const _err = new Error("Trace: " + logObj.message);
1060
+ line += this.formatStack(_err.stack || "", _err.message);
1061
+ }
1062
+ return isBadge ? "\n" + line + "\n" : line;
1063
+ }
1064
+ };
1065
+ function characterFormat(str) {
1066
+ return str.replace(/`([^`]+)`/gm, (_2, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_2, m) => ` ${colors.underline(m)} `);
1067
+ }
1068
+ function getColor2(color = "white") {
1069
+ return colors[color] || colors.white;
1070
+ }
1071
+ function getBgColor(color = "bgWhite") {
1072
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1073
+ }
1074
+ function createConsola2(options = {}) {
1075
+ let level = _getDefaultLogLevel();
1076
+ if (process.env.CONSOLA_LEVEL) {
1077
+ level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1078
+ }
1079
+ const consola2 = createConsola({
1080
+ level,
1081
+ defaults: {
1082
+ level
1083
+ },
1084
+ stdout: process.stdout,
1085
+ stderr: process.stderr,
1086
+ prompt: (...args) => import('./prompt-6ZJZATIW.js').then((m) => m.prompt(...args)),
1087
+ reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
1088
+ ...options
1089
+ });
1090
+ return consola2;
1091
+ }
1092
+ function _getDefaultLogLevel() {
1093
+ if (g) {
1094
+ return LogLevels.debug;
1095
+ }
1096
+ if (R) {
1097
+ return LogLevels.warn;
1098
+ }
1099
+ return LogLevels.info;
1100
+ }
1101
+ var consola = createConsola2();
1102
+ async function afterGenerate(context) {
1103
+ const {
1104
+ outputPath,
1105
+ schemaPath,
1106
+ options
1107
+ } = context;
1108
+ if (!options.dryRun && schemaPath) {
1109
+ const copiedSchemaPath = path.join(outputPath, "schema");
1110
+ if (await fs.pathExists(copiedSchemaPath)) {
1111
+ try {
1112
+ consola.log("Generating TypeScript types from YAML schema...");
1113
+ const yamlFiles = await fs.readdir(copiedSchemaPath);
1114
+ const yamlFile = yamlFiles.find((f2) => f2.endsWith(".yaml") || f2.endsWith(".yml"));
1115
+ if (yamlFile) {
1116
+ const schemaFile = path.join(copiedSchemaPath, yamlFile);
1117
+ const typesResult = spawnSync("pnpm", ["exec", "type-gen", "steps", "types", "-i", copiedSchemaPath, "-o", path.join(outputPath, "src", "types.ts")], {
1118
+ stdio: "inherit",
1119
+ cwd: outputPath
1120
+ });
1121
+ if (typesResult.status !== 0) {
1122
+ throw new Error(`Type generation failed with exit code ${typesResult.status ?? "unknown"}`);
1123
+ }
1124
+ consola.log("Generating Zod schemas from YAML schema...");
1125
+ const zodResult = spawnSync("pnpm", ["exec", "type-gen", "steps", "zod", "--type-import-path", "./types.js", "-i", schemaFile, "-o", path.join(outputPath, "src", "schema.ts")], {
1126
+ stdio: "inherit",
1127
+ cwd: outputPath
1128
+ });
1129
+ if (zodResult.status !== 0) {
1130
+ throw new Error(`Zod schema generation failed with exit code ${zodResult.status}`);
1131
+ }
1132
+ consola.log("Generating Model constants from YAML schema...");
1133
+ const modelsResult = spawnSync("pnpm", ["exec", "type-gen", "steps", "models", "--type-import-path", "./types.js", "--schema-import-path", "./schema.js", "-i", schemaFile, "-o", path.join(outputPath, "src", "models.ts")], {
1134
+ stdio: "inherit",
1135
+ cwd: outputPath
1136
+ });
1137
+ if (modelsResult.status !== 0) {
1138
+ throw new Error(`Model constants generation failed with exit code ${modelsResult.status}`);
1139
+ }
1140
+ } else {
1141
+ consola.log("No YAML schema files found in schema directory");
1142
+ }
1143
+ consola.log("Type, Zod schema, and Model constants generation complete!");
1144
+ } catch (error) {
1145
+ consola.error(`Could not generate types: ${error instanceof Error ? error.message : String(error)}`);
1146
+ }
1147
+ }
1148
+ }
1149
+ }
1150
+
1151
+ // src/transformer.ts
1152
+ function transformer(schema, context) {
1153
+ const {
1154
+ answers
1155
+ } = context;
1156
+ return {
1157
+ ...typeof schema === "object" && schema != null ? schema : {},
1158
+ schemaDir: answers.schemaDir || "schema"
1159
+ };
1160
+ }
1161
+
1162
+ export { afterGenerate, config, transformer };
1163
+ //# sourceMappingURL=index.js.map
1164
+ //# sourceMappingURL=index.js.map