@bamboocss/node 1.11.1 → 1.11.2

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.js DELETED
@@ -1,2984 +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 __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
- // If the importer is in node compatibility mode or this is not an ESM
28
- // file that has been converted to a CommonJS file using a Babel-
29
- // compatible transform (i.e. "__esModule" has not been set), then set
30
- // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
33
- ));
34
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
-
36
- // ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.3_@swc+helpers@0.5.17__jiti@2.7.0_postcss@8.5.14_tsx@4.20.6_typescript@6.0.2_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
37
- var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.3_@swc+helpers@0.5.17__jiti@2.7.0_postcss@8.5.14_tsx@4.20.6_typescript@6.0.2_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
39
- "use strict";
40
- }
41
- });
42
-
43
- // ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
44
- var require_boxes = __commonJS({
45
- "../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json"(exports2, module2) {
46
- module2.exports = {
47
- single: {
48
- topLeft: "\u250C",
49
- top: "\u2500",
50
- topRight: "\u2510",
51
- right: "\u2502",
52
- bottomRight: "\u2518",
53
- bottom: "\u2500",
54
- bottomLeft: "\u2514",
55
- left: "\u2502"
56
- },
57
- double: {
58
- topLeft: "\u2554",
59
- top: "\u2550",
60
- topRight: "\u2557",
61
- right: "\u2551",
62
- bottomRight: "\u255D",
63
- bottom: "\u2550",
64
- bottomLeft: "\u255A",
65
- left: "\u2551"
66
- },
67
- round: {
68
- topLeft: "\u256D",
69
- top: "\u2500",
70
- topRight: "\u256E",
71
- right: "\u2502",
72
- bottomRight: "\u256F",
73
- bottom: "\u2500",
74
- bottomLeft: "\u2570",
75
- left: "\u2502"
76
- },
77
- bold: {
78
- topLeft: "\u250F",
79
- top: "\u2501",
80
- topRight: "\u2513",
81
- right: "\u2503",
82
- bottomRight: "\u251B",
83
- bottom: "\u2501",
84
- bottomLeft: "\u2517",
85
- left: "\u2503"
86
- },
87
- singleDouble: {
88
- topLeft: "\u2553",
89
- top: "\u2500",
90
- topRight: "\u2556",
91
- right: "\u2551",
92
- bottomRight: "\u255C",
93
- bottom: "\u2500",
94
- bottomLeft: "\u2559",
95
- left: "\u2551"
96
- },
97
- doubleSingle: {
98
- topLeft: "\u2552",
99
- top: "\u2550",
100
- topRight: "\u2555",
101
- right: "\u2502",
102
- bottomRight: "\u255B",
103
- bottom: "\u2550",
104
- bottomLeft: "\u2558",
105
- left: "\u2502"
106
- },
107
- classic: {
108
- topLeft: "+",
109
- top: "-",
110
- topRight: "+",
111
- right: "|",
112
- bottomRight: "+",
113
- bottom: "-",
114
- bottomLeft: "+",
115
- left: "|"
116
- },
117
- arrow: {
118
- topLeft: "\u2198",
119
- top: "\u2193",
120
- topRight: "\u2199",
121
- right: "\u2190",
122
- bottomRight: "\u2196",
123
- bottom: "\u2191",
124
- bottomLeft: "\u2197",
125
- left: "\u2192"
126
- }
127
- };
128
- }
129
- });
130
-
131
- // ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js
132
- var require_cli_boxes = __commonJS({
133
- "../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js"(exports2, module2) {
134
- "use strict";
135
- init_cjs_shims();
136
- var cliBoxes2 = require_boxes();
137
- module2.exports = cliBoxes2;
138
- module2.exports.default = cliBoxes2;
139
- }
140
- });
141
-
142
- // ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
143
- var require_ansi_regex = __commonJS({
144
- "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports2, module2) {
145
- "use strict";
146
- init_cjs_shims();
147
- module2.exports = ({ onlyFirst = false } = {}) => {
148
- const pattern = [
149
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
150
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
151
- ].join("|");
152
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
153
- };
154
- }
155
- });
156
-
157
- // ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
158
- var require_strip_ansi = __commonJS({
159
- "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports2, module2) {
160
- "use strict";
161
- init_cjs_shims();
162
- var ansiRegex2 = require_ansi_regex();
163
- module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
164
- }
165
- });
166
-
167
- // ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
168
- var require_is_fullwidth_code_point = __commonJS({
169
- "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports2, module2) {
170
- "use strict";
171
- init_cjs_shims();
172
- var isFullwidthCodePoint = (codePoint) => {
173
- if (Number.isNaN(codePoint)) {
174
- return false;
175
- }
176
- if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
177
- codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
178
- codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
179
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
180
- 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
181
- 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
182
- 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
183
- 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
184
- 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
185
- 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
186
- 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
187
- 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
188
- 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
189
- 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
190
- 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
191
- 131072 <= codePoint && codePoint <= 262141)) {
192
- return true;
193
- }
194
- return false;
195
- };
196
- module2.exports = isFullwidthCodePoint;
197
- module2.exports.default = isFullwidthCodePoint;
198
- }
199
- });
200
-
201
- // ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
202
- var require_emoji_regex = __commonJS({
203
- "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports2, module2) {
204
- "use strict";
205
- init_cjs_shims();
206
- module2.exports = function() {
207
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
208
- };
209
- }
210
- });
211
-
212
- // ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
213
- var require_string_width = __commonJS({
214
- "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports2, module2) {
215
- "use strict";
216
- init_cjs_shims();
217
- var stripAnsi2 = require_strip_ansi();
218
- var isFullwidthCodePoint = require_is_fullwidth_code_point();
219
- var emojiRegex = require_emoji_regex();
220
- var stringWidth2 = (string) => {
221
- if (typeof string !== "string" || string.length === 0) {
222
- return 0;
223
- }
224
- string = stripAnsi2(string);
225
- if (string.length === 0) {
226
- return 0;
227
- }
228
- string = string.replace(emojiRegex(), " ");
229
- let width = 0;
230
- for (let i = 0; i < string.length; i++) {
231
- const code = string.codePointAt(i);
232
- if (code <= 31 || code >= 127 && code <= 159) {
233
- continue;
234
- }
235
- if (code >= 768 && code <= 879) {
236
- continue;
237
- }
238
- if (code > 65535) {
239
- i++;
240
- }
241
- width += isFullwidthCodePoint(code) ? 2 : 1;
242
- }
243
- return width;
244
- };
245
- module2.exports = stringWidth2;
246
- module2.exports.default = stringWidth2;
247
- }
248
- });
249
-
250
- // ../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js
251
- var require_ansi_align = __commonJS({
252
- "../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js"(exports2, module2) {
253
- "use strict";
254
- init_cjs_shims();
255
- var stringWidth2 = require_string_width();
256
- function ansiAlign2(text, opts) {
257
- if (!text) return text;
258
- opts = opts || {};
259
- const align = opts.align || "center";
260
- if (align === "left") return text;
261
- const split = opts.split || "\n";
262
- const pad = opts.pad || " ";
263
- const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
264
- let returnString = false;
265
- if (!Array.isArray(text)) {
266
- returnString = true;
267
- text = String(text).split(split);
268
- }
269
- let width;
270
- let maxWidth = 0;
271
- text = text.map(function(str) {
272
- str = String(str);
273
- width = stringWidth2(str);
274
- maxWidth = Math.max(width, maxWidth);
275
- return {
276
- str,
277
- width
278
- };
279
- }).map(function(obj) {
280
- return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str;
281
- });
282
- return returnString ? text.join(split) : text;
283
- }
284
- ansiAlign2.left = function left(text) {
285
- return ansiAlign2(text, { align: "left" });
286
- };
287
- ansiAlign2.center = function center(text) {
288
- return ansiAlign2(text, { align: "center" });
289
- };
290
- ansiAlign2.right = function right(text) {
291
- return ansiAlign2(text, { align: "right" });
292
- };
293
- module2.exports = ansiAlign2;
294
- function halfDiff(maxWidth, curWidth) {
295
- return Math.floor((maxWidth - curWidth) / 2);
296
- }
297
- function fullDiff(maxWidth, curWidth) {
298
- return maxWidth - curWidth;
299
- }
300
- }
301
- });
302
-
303
- // src/index.ts
304
- var index_exports = {};
305
- __export(index_exports, {
306
- BambooContext: () => BambooContext,
307
- Builder: () => Builder,
308
- analyze: () => analyze,
309
- buildInfo: () => buildInfo,
310
- codegen: () => codegen,
311
- cssgen: () => cssgen,
312
- debug: () => debug,
313
- generate: () => generate,
314
- loadConfigAndCreateContext: () => loadConfigAndCreateContext,
315
- parseDependency: () => parseDependency,
316
- setLogStream: () => setLogStream,
317
- setupConfig: () => setupConfig,
318
- setupGitIgnore: () => setupGitIgnore,
319
- setupPostcss: () => setupPostcss,
320
- spec: () => spec,
321
- startProfiling: () => startProfiling
322
- });
323
- module.exports = __toCommonJS(index_exports);
324
- init_cjs_shims();
325
-
326
- // src/analyze.ts
327
- init_cjs_shims();
328
- var import_reporter = require("@bamboocss/reporter");
329
- function analyze(ctx, options = {}) {
330
- const reporter = new import_reporter.Reporter(ctx, {
331
- project: ctx.project,
332
- getRelativePath: ctx.runtime.path.relative,
333
- getFiles: ctx.getFiles,
334
- ...options
335
- });
336
- reporter.init();
337
- return {
338
- getRecipeReport(format = "table") {
339
- const report = reporter.getRecipeReport();
340
- return { report, formatted: (0, import_reporter.formatRecipeReport)(report, format) };
341
- },
342
- getTokenReport(format = "table") {
343
- const report = reporter.getTokenReport();
344
- return { report, formatted: (0, import_reporter.formatTokenReport)(report.getSummary(), format) };
345
- },
346
- writeReport(filePath) {
347
- const dirname2 = ctx.runtime.path.dirname(filePath);
348
- ctx.runtime.fs.ensureDirSync(dirname2);
349
- const str = JSON.stringify(reporter.report, replacer, 2);
350
- return ctx.runtime.fs.writeFile(filePath, str);
351
- }
352
- };
353
- }
354
- function replacer(_, value) {
355
- if (value instanceof Set) return Array.from(value);
356
- if (value instanceof Map) return Object.fromEntries(value);
357
- return value;
358
- }
359
-
360
- // src/build-info.ts
361
- init_cjs_shims();
362
- var import_logger = require("@bamboocss/logger");
363
- async function buildInfo(ctx, outfile) {
364
- const { filesWithCss, files } = ctx.parseFiles();
365
- import_logger.logger.info("cli", `Found ${import_logger.colors.bold(`${filesWithCss.length}/${files.length}`)} files using Bamboo`);
366
- const { minify, staticCss } = ctx.config;
367
- import_logger.logger.info("cli", `Writing ${minify ? "[min] " : " "}${import_logger.colors.bold(outfile)}`);
368
- if (staticCss) {
369
- import_logger.logger.info("cli", "Adding staticCss definitions...");
370
- ctx.staticCss.process(staticCss);
371
- }
372
- const output = JSON.stringify(ctx.encoder.toJSON(), null, minify ? 0 : 2);
373
- ctx.output.ensure(outfile, process.cwd());
374
- await ctx.runtime.fs.writeFile(outfile, output);
375
- import_logger.logger.info("cli", "Done!");
376
- }
377
-
378
- // src/builder.ts
379
- init_cjs_shims();
380
- var import_config4 = require("@bamboocss/config");
381
- var import_logger5 = require("@bamboocss/logger");
382
- var import_shared2 = require("@bamboocss/shared");
383
- var import_fs = require("fs");
384
- var import_path4 = require("path");
385
-
386
- // src/codegen.ts
387
- init_cjs_shims();
388
- async function codegen(ctx, ids) {
389
- const { default: pLimit } = await import("p-limit");
390
- const limit = pLimit(20);
391
- if (ctx.config.clean) ctx.output.empty();
392
- let artifacts = ctx.getArtifacts(ids);
393
- if (ctx.hooks["codegen:prepare"]) {
394
- const results = await ctx.hooks["codegen:prepare"]?.({ changed: ids, artifacts });
395
- if (results) artifacts = results;
396
- }
397
- const promises = artifacts.map((artifact) => limit(() => ctx.output.write(artifact)));
398
- await Promise.allSettled(promises);
399
- await ctx.hooks["codegen:done"]?.({ changed: ids });
400
- return {
401
- box: ctx.initMessage(),
402
- msg: ctx.messages.artifactsGenerated()
403
- };
404
- }
405
-
406
- // src/config.ts
407
- init_cjs_shims();
408
- var import_config3 = require("@bamboocss/config");
409
- var import_plugin_lightningcss = require("@bamboocss/plugin-lightningcss");
410
- var import_plugin_svelte = require("@bamboocss/plugin-svelte");
411
- var import_plugin_vue = require("@bamboocss/plugin-vue");
412
- var import_browserslist = __toESM(require("browserslist"));
413
-
414
- // src/create-context.ts
415
- init_cjs_shims();
416
- var import_generator2 = require("@bamboocss/generator");
417
- var import_logger4 = require("@bamboocss/logger");
418
- var import_parser = require("@bamboocss/parser");
419
- var import_shared = require("@bamboocss/shared");
420
- var import_perfect_debounce = require("perfect-debounce");
421
-
422
- // src/cli-box.ts
423
- init_cjs_shims();
424
-
425
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
426
- init_cjs_shims();
427
- var import_node_process2 = __toESM(require("process"), 1);
428
-
429
- // ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
430
- init_cjs_shims();
431
-
432
- // ../../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
433
- init_cjs_shims();
434
-
435
- // ../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
436
- init_cjs_shims();
437
- function ansiRegex({ onlyFirst = false } = {}) {
438
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
439
- const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
440
- const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
441
- const pattern = `${osc}|${csi}`;
442
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
443
- }
444
-
445
- // ../../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
446
- var regex = ansiRegex();
447
- function stripAnsi(string) {
448
- if (typeof string !== "string") {
449
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
450
- }
451
- return string.replace(regex, "");
452
- }
453
-
454
- // ../../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js
455
- init_cjs_shims();
456
-
457
- // ../../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/lookup.js
458
- init_cjs_shims();
459
- function isAmbiguous(x) {
460
- 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;
461
- }
462
- function isFullWidth(x) {
463
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
464
- }
465
- function isWide(x) {
466
- 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 <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || 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 <= 128728 || 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 <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
467
- }
468
-
469
- // ../../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js
470
- function validate(codePoint) {
471
- if (!Number.isSafeInteger(codePoint)) {
472
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
473
- }
474
- }
475
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
476
- validate(codePoint);
477
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
478
- return 2;
479
- }
480
- return 1;
481
- }
482
-
483
- // ../../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.mjs
484
- init_cjs_shims();
485
- var emoji_regex_default = () => {
486
- 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-\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-\uDED8\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\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\uDD3C-\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\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\uDE70]|\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\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;
487
- };
488
-
489
- // ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
490
- var segmenter = new Intl.Segmenter();
491
- var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
492
- function stringWidth(string, options = {}) {
493
- if (typeof string !== "string" || string.length === 0) {
494
- return 0;
495
- }
496
- const {
497
- ambiguousIsNarrow = true,
498
- countAnsiEscapeCodes = false
499
- } = options;
500
- if (!countAnsiEscapeCodes) {
501
- string = stripAnsi(string);
502
- }
503
- if (string.length === 0) {
504
- return 0;
505
- }
506
- let width = 0;
507
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
508
- for (const { segment: character } of segmenter.segment(string)) {
509
- const codePoint = character.codePointAt(0);
510
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
511
- continue;
512
- }
513
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
514
- continue;
515
- }
516
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
517
- continue;
518
- }
519
- if (codePoint >= 55296 && codePoint <= 57343) {
520
- continue;
521
- }
522
- if (codePoint >= 65024 && codePoint <= 65039) {
523
- continue;
524
- }
525
- if (defaultIgnorableCodePointRegex.test(character)) {
526
- continue;
527
- }
528
- if (emoji_regex_default().test(character)) {
529
- width += 2;
530
- continue;
531
- }
532
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
533
- }
534
- return width;
535
- }
536
-
537
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
538
- init_cjs_shims();
539
-
540
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
541
- init_cjs_shims();
542
- var ANSI_BACKGROUND_OFFSET = 10;
543
- var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
544
- var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
545
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
546
- var styles = {
547
- modifier: {
548
- reset: [0, 0],
549
- // 21 isn't widely supported and 22 does the same thing
550
- bold: [1, 22],
551
- dim: [2, 22],
552
- italic: [3, 23],
553
- underline: [4, 24],
554
- overline: [53, 55],
555
- inverse: [7, 27],
556
- hidden: [8, 28],
557
- strikethrough: [9, 29]
558
- },
559
- color: {
560
- black: [30, 39],
561
- red: [31, 39],
562
- green: [32, 39],
563
- yellow: [33, 39],
564
- blue: [34, 39],
565
- magenta: [35, 39],
566
- cyan: [36, 39],
567
- white: [37, 39],
568
- // Bright color
569
- blackBright: [90, 39],
570
- gray: [90, 39],
571
- // Alias of `blackBright`
572
- grey: [90, 39],
573
- // Alias of `blackBright`
574
- redBright: [91, 39],
575
- greenBright: [92, 39],
576
- yellowBright: [93, 39],
577
- blueBright: [94, 39],
578
- magentaBright: [95, 39],
579
- cyanBright: [96, 39],
580
- whiteBright: [97, 39]
581
- },
582
- bgColor: {
583
- bgBlack: [40, 49],
584
- bgRed: [41, 49],
585
- bgGreen: [42, 49],
586
- bgYellow: [43, 49],
587
- bgBlue: [44, 49],
588
- bgMagenta: [45, 49],
589
- bgCyan: [46, 49],
590
- bgWhite: [47, 49],
591
- // Bright color
592
- bgBlackBright: [100, 49],
593
- bgGray: [100, 49],
594
- // Alias of `bgBlackBright`
595
- bgGrey: [100, 49],
596
- // Alias of `bgBlackBright`
597
- bgRedBright: [101, 49],
598
- bgGreenBright: [102, 49],
599
- bgYellowBright: [103, 49],
600
- bgBlueBright: [104, 49],
601
- bgMagentaBright: [105, 49],
602
- bgCyanBright: [106, 49],
603
- bgWhiteBright: [107, 49]
604
- }
605
- };
606
- var modifierNames = Object.keys(styles.modifier);
607
- var foregroundColorNames = Object.keys(styles.color);
608
- var backgroundColorNames = Object.keys(styles.bgColor);
609
- var colorNames = [...foregroundColorNames, ...backgroundColorNames];
610
- function assembleStyles() {
611
- const codes = /* @__PURE__ */ new Map();
612
- for (const [groupName, group] of Object.entries(styles)) {
613
- for (const [styleName, style] of Object.entries(group)) {
614
- styles[styleName] = {
615
- open: `\x1B[${style[0]}m`,
616
- close: `\x1B[${style[1]}m`
617
- };
618
- group[styleName] = styles[styleName];
619
- codes.set(style[0], style[1]);
620
- }
621
- Object.defineProperty(styles, groupName, {
622
- value: group,
623
- enumerable: false
624
- });
625
- }
626
- Object.defineProperty(styles, "codes", {
627
- value: codes,
628
- enumerable: false
629
- });
630
- styles.color.close = "\x1B[39m";
631
- styles.bgColor.close = "\x1B[49m";
632
- styles.color.ansi = wrapAnsi16();
633
- styles.color.ansi256 = wrapAnsi256();
634
- styles.color.ansi16m = wrapAnsi16m();
635
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
636
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
637
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
638
- Object.defineProperties(styles, {
639
- rgbToAnsi256: {
640
- value(red, green, blue) {
641
- if (red === green && green === blue) {
642
- if (red < 8) {
643
- return 16;
644
- }
645
- if (red > 248) {
646
- return 231;
647
- }
648
- return Math.round((red - 8) / 247 * 24) + 232;
649
- }
650
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
651
- },
652
- enumerable: false
653
- },
654
- hexToRgb: {
655
- value(hex) {
656
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
657
- if (!matches) {
658
- return [0, 0, 0];
659
- }
660
- let [colorString] = matches;
661
- if (colorString.length === 3) {
662
- colorString = [...colorString].map((character) => character + character).join("");
663
- }
664
- const integer = Number.parseInt(colorString, 16);
665
- return [
666
- /* eslint-disable no-bitwise */
667
- integer >> 16 & 255,
668
- integer >> 8 & 255,
669
- integer & 255
670
- /* eslint-enable no-bitwise */
671
- ];
672
- },
673
- enumerable: false
674
- },
675
- hexToAnsi256: {
676
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
677
- enumerable: false
678
- },
679
- ansi256ToAnsi: {
680
- value(code) {
681
- if (code < 8) {
682
- return 30 + code;
683
- }
684
- if (code < 16) {
685
- return 90 + (code - 8);
686
- }
687
- let red;
688
- let green;
689
- let blue;
690
- if (code >= 232) {
691
- red = ((code - 232) * 10 + 8) / 255;
692
- green = red;
693
- blue = red;
694
- } else {
695
- code -= 16;
696
- const remainder = code % 36;
697
- red = Math.floor(code / 36) / 5;
698
- green = Math.floor(remainder / 6) / 5;
699
- blue = remainder % 6 / 5;
700
- }
701
- const value = Math.max(red, green, blue) * 2;
702
- if (value === 0) {
703
- return 30;
704
- }
705
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
706
- if (value === 2) {
707
- result += 60;
708
- }
709
- return result;
710
- },
711
- enumerable: false
712
- },
713
- rgbToAnsi: {
714
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
715
- enumerable: false
716
- },
717
- hexToAnsi: {
718
- value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
719
- enumerable: false
720
- }
721
- });
722
- return styles;
723
- }
724
- var ansiStyles = assembleStyles();
725
- var ansi_styles_default = ansiStyles;
726
-
727
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
728
- init_cjs_shims();
729
- var import_node_process = __toESM(require("process"), 1);
730
- var import_node_os = __toESM(require("os"), 1);
731
- var import_node_tty = __toESM(require("tty"), 1);
732
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
733
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
734
- const position = argv.indexOf(prefix + flag);
735
- const terminatorPosition = argv.indexOf("--");
736
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
737
- }
738
- var { env } = import_node_process.default;
739
- var flagForceColor;
740
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
741
- flagForceColor = 0;
742
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
743
- flagForceColor = 1;
744
- }
745
- function envForceColor() {
746
- if ("FORCE_COLOR" in env) {
747
- if (env.FORCE_COLOR === "true") {
748
- return 1;
749
- }
750
- if (env.FORCE_COLOR === "false") {
751
- return 0;
752
- }
753
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
754
- }
755
- }
756
- function translateLevel(level) {
757
- if (level === 0) {
758
- return false;
759
- }
760
- return {
761
- level,
762
- hasBasic: true,
763
- has256: level >= 2,
764
- has16m: level >= 3
765
- };
766
- }
767
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
768
- const noFlagForceColor = envForceColor();
769
- if (noFlagForceColor !== void 0) {
770
- flagForceColor = noFlagForceColor;
771
- }
772
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
773
- if (forceColor === 0) {
774
- return 0;
775
- }
776
- if (sniffFlags) {
777
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
778
- return 3;
779
- }
780
- if (hasFlag("color=256")) {
781
- return 2;
782
- }
783
- }
784
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
785
- return 1;
786
- }
787
- if (haveStream && !streamIsTTY && forceColor === void 0) {
788
- return 0;
789
- }
790
- const min = forceColor || 0;
791
- if (env.TERM === "dumb") {
792
- return min;
793
- }
794
- if (import_node_process.default.platform === "win32") {
795
- const osRelease = import_node_os.default.release().split(".");
796
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
797
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
798
- }
799
- return 1;
800
- }
801
- if ("CI" in env) {
802
- if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
803
- return 3;
804
- }
805
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
806
- return 1;
807
- }
808
- return min;
809
- }
810
- if ("TEAMCITY_VERSION" in env) {
811
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
812
- }
813
- if (env.COLORTERM === "truecolor") {
814
- return 3;
815
- }
816
- if (env.TERM === "xterm-kitty") {
817
- return 3;
818
- }
819
- if (env.TERM === "xterm-ghostty") {
820
- return 3;
821
- }
822
- if (env.TERM === "wezterm") {
823
- return 3;
824
- }
825
- if ("TERM_PROGRAM" in env) {
826
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
827
- switch (env.TERM_PROGRAM) {
828
- case "iTerm.app": {
829
- return version >= 3 ? 3 : 2;
830
- }
831
- case "Apple_Terminal": {
832
- return 2;
833
- }
834
- }
835
- }
836
- if (/-256(color)?$/i.test(env.TERM)) {
837
- return 2;
838
- }
839
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
840
- return 1;
841
- }
842
- if ("COLORTERM" in env) {
843
- return 1;
844
- }
845
- return min;
846
- }
847
- function createSupportsColor(stream, options = {}) {
848
- const level = _supportsColor(stream, {
849
- streamIsTTY: stream && stream.isTTY,
850
- ...options
851
- });
852
- return translateLevel(level);
853
- }
854
- var supportsColor = {
855
- stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
856
- stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
857
- };
858
- var supports_color_default = supportsColor;
859
-
860
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
861
- init_cjs_shims();
862
- function stringReplaceAll(string, substring, replacer2) {
863
- let index = string.indexOf(substring);
864
- if (index === -1) {
865
- return string;
866
- }
867
- const substringLength = substring.length;
868
- let endIndex = 0;
869
- let returnValue = "";
870
- do {
871
- returnValue += string.slice(endIndex, index) + substring + replacer2;
872
- endIndex = index + substringLength;
873
- index = string.indexOf(substring, endIndex);
874
- } while (index !== -1);
875
- returnValue += string.slice(endIndex);
876
- return returnValue;
877
- }
878
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
879
- let endIndex = 0;
880
- let returnValue = "";
881
- do {
882
- const gotCR = string[index - 1] === "\r";
883
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
884
- endIndex = index + 1;
885
- index = string.indexOf("\n", endIndex);
886
- } while (index !== -1);
887
- returnValue += string.slice(endIndex);
888
- return returnValue;
889
- }
890
-
891
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
892
- var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
893
- var GENERATOR = Symbol("GENERATOR");
894
- var STYLER = Symbol("STYLER");
895
- var IS_EMPTY = Symbol("IS_EMPTY");
896
- var levelMapping = [
897
- "ansi",
898
- "ansi",
899
- "ansi256",
900
- "ansi16m"
901
- ];
902
- var styles2 = /* @__PURE__ */ Object.create(null);
903
- var applyOptions = (object, options = {}) => {
904
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
905
- throw new Error("The `level` option should be an integer from 0 to 3");
906
- }
907
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
908
- object.level = options.level === void 0 ? colorLevel : options.level;
909
- };
910
- var chalkFactory = (options) => {
911
- const chalk2 = (...strings) => strings.join(" ");
912
- applyOptions(chalk2, options);
913
- Object.setPrototypeOf(chalk2, createChalk.prototype);
914
- return chalk2;
915
- };
916
- function createChalk(options) {
917
- return chalkFactory(options);
918
- }
919
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
920
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
921
- styles2[styleName] = {
922
- get() {
923
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
924
- Object.defineProperty(this, styleName, { value: builder });
925
- return builder;
926
- }
927
- };
928
- }
929
- styles2.visible = {
930
- get() {
931
- const builder = createBuilder(this, this[STYLER], true);
932
- Object.defineProperty(this, "visible", { value: builder });
933
- return builder;
934
- }
935
- };
936
- var getModelAnsi = (model, level, type, ...arguments_) => {
937
- if (model === "rgb") {
938
- if (level === "ansi16m") {
939
- return ansi_styles_default[type].ansi16m(...arguments_);
940
- }
941
- if (level === "ansi256") {
942
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
943
- }
944
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
945
- }
946
- if (model === "hex") {
947
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
948
- }
949
- return ansi_styles_default[type][model](...arguments_);
950
- };
951
- var usedModels = ["rgb", "hex", "ansi256"];
952
- for (const model of usedModels) {
953
- styles2[model] = {
954
- get() {
955
- const { level } = this;
956
- return function(...arguments_) {
957
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
958
- return createBuilder(this, styler, this[IS_EMPTY]);
959
- };
960
- }
961
- };
962
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
963
- styles2[bgModel] = {
964
- get() {
965
- const { level } = this;
966
- return function(...arguments_) {
967
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
968
- return createBuilder(this, styler, this[IS_EMPTY]);
969
- };
970
- }
971
- };
972
- }
973
- var proto = Object.defineProperties(() => {
974
- }, {
975
- ...styles2,
976
- level: {
977
- enumerable: true,
978
- get() {
979
- return this[GENERATOR].level;
980
- },
981
- set(level) {
982
- this[GENERATOR].level = level;
983
- }
984
- }
985
- });
986
- var createStyler = (open, close, parent) => {
987
- let openAll;
988
- let closeAll;
989
- if (parent === void 0) {
990
- openAll = open;
991
- closeAll = close;
992
- } else {
993
- openAll = parent.openAll + open;
994
- closeAll = close + parent.closeAll;
995
- }
996
- return {
997
- open,
998
- close,
999
- openAll,
1000
- closeAll,
1001
- parent
1002
- };
1003
- };
1004
- var createBuilder = (self, _styler, _isEmpty) => {
1005
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1006
- Object.setPrototypeOf(builder, proto);
1007
- builder[GENERATOR] = self;
1008
- builder[STYLER] = _styler;
1009
- builder[IS_EMPTY] = _isEmpty;
1010
- return builder;
1011
- };
1012
- var applyStyle = (self, string) => {
1013
- if (self.level <= 0 || !string) {
1014
- return self[IS_EMPTY] ? "" : string;
1015
- }
1016
- let styler = self[STYLER];
1017
- if (styler === void 0) {
1018
- return string;
1019
- }
1020
- const { openAll, closeAll } = styler;
1021
- if (string.includes("\x1B")) {
1022
- while (styler !== void 0) {
1023
- string = stringReplaceAll(string, styler.close, styler.open);
1024
- styler = styler.parent;
1025
- }
1026
- }
1027
- const lfIndex = string.indexOf("\n");
1028
- if (lfIndex !== -1) {
1029
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1030
- }
1031
- return openAll + string + closeAll;
1032
- };
1033
- Object.defineProperties(createChalk.prototype, styles2);
1034
- var chalk = createChalk();
1035
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1036
- var source_default = chalk;
1037
-
1038
- // ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
1039
- init_cjs_shims();
1040
- function widestLine(string) {
1041
- let lineWidth = 0;
1042
- for (const line of string.split("\n")) {
1043
- lineWidth = Math.max(lineWidth, stringWidth(line));
1044
- }
1045
- return lineWidth;
1046
- }
1047
-
1048
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1049
- var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1050
-
1051
- // ../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js
1052
- init_cjs_shims();
1053
- var UPPERCASE = /[\p{Lu}]/u;
1054
- var LOWERCASE = /[\p{Ll}]/u;
1055
- var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
1056
- var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
1057
- var SEPARATORS = /[_.\- ]+/;
1058
- var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
1059
- var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
1060
- var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
1061
- var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
1062
- let isLastCharLower = false;
1063
- let isLastCharUpper = false;
1064
- let isLastLastCharUpper = false;
1065
- let isLastLastCharPreserved = false;
1066
- for (let index = 0; index < string.length; index++) {
1067
- const character = string[index];
1068
- isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
1069
- if (isLastCharLower && UPPERCASE.test(character)) {
1070
- string = string.slice(0, index) + "-" + string.slice(index);
1071
- isLastCharLower = false;
1072
- isLastLastCharUpper = isLastCharUpper;
1073
- isLastCharUpper = true;
1074
- index++;
1075
- } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
1076
- string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
1077
- isLastLastCharUpper = isLastCharUpper;
1078
- isLastCharUpper = false;
1079
- isLastCharLower = true;
1080
- } else {
1081
- isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
1082
- isLastLastCharUpper = isLastCharUpper;
1083
- isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
1084
- }
1085
- }
1086
- return string;
1087
- };
1088
- var preserveConsecutiveUppercase = (input, toLowerCase) => {
1089
- LEADING_CAPITAL.lastIndex = 0;
1090
- return input.replaceAll(LEADING_CAPITAL, (match) => toLowerCase(match));
1091
- };
1092
- var postProcess = (input, toUpperCase) => {
1093
- SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
1094
- NUMBERS_AND_IDENTIFIER.lastIndex = 0;
1095
- return input.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
1096
- };
1097
- function camelCase(input, options) {
1098
- if (!(typeof input === "string" || Array.isArray(input))) {
1099
- throw new TypeError("Expected the input to be `string | string[]`");
1100
- }
1101
- options = {
1102
- pascalCase: false,
1103
- preserveConsecutiveUppercase: false,
1104
- ...options
1105
- };
1106
- if (Array.isArray(input)) {
1107
- input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
1108
- } else {
1109
- input = input.trim();
1110
- }
1111
- if (input.length === 0) {
1112
- return "";
1113
- }
1114
- const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
1115
- const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
1116
- if (input.length === 1) {
1117
- if (SEPARATORS.test(input)) {
1118
- return "";
1119
- }
1120
- return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
1121
- }
1122
- const hasUpperCase = input !== toLowerCase(input);
1123
- if (hasUpperCase) {
1124
- input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
1125
- }
1126
- input = input.replace(LEADING_SEPARATORS, "");
1127
- input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
1128
- if (options.pascalCase) {
1129
- input = toUpperCase(input.charAt(0)) + input.slice(1);
1130
- }
1131
- return postProcess(input, toUpperCase);
1132
- }
1133
-
1134
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1135
- var import_ansi_align = __toESM(require_ansi_align(), 1);
1136
-
1137
- // ../../node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js
1138
- init_cjs_shims();
1139
-
1140
- // ../../node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
1141
- init_cjs_shims();
1142
- var ANSI_BACKGROUND_OFFSET2 = 10;
1143
- var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
1144
- var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
1145
- var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
1146
- var styles3 = {
1147
- modifier: {
1148
- reset: [0, 0],
1149
- // 21 isn't widely supported and 22 does the same thing
1150
- bold: [1, 22],
1151
- dim: [2, 22],
1152
- italic: [3, 23],
1153
- underline: [4, 24],
1154
- overline: [53, 55],
1155
- inverse: [7, 27],
1156
- hidden: [8, 28],
1157
- strikethrough: [9, 29]
1158
- },
1159
- color: {
1160
- black: [30, 39],
1161
- red: [31, 39],
1162
- green: [32, 39],
1163
- yellow: [33, 39],
1164
- blue: [34, 39],
1165
- magenta: [35, 39],
1166
- cyan: [36, 39],
1167
- white: [37, 39],
1168
- // Bright color
1169
- blackBright: [90, 39],
1170
- gray: [90, 39],
1171
- // Alias of `blackBright`
1172
- grey: [90, 39],
1173
- // Alias of `blackBright`
1174
- redBright: [91, 39],
1175
- greenBright: [92, 39],
1176
- yellowBright: [93, 39],
1177
- blueBright: [94, 39],
1178
- magentaBright: [95, 39],
1179
- cyanBright: [96, 39],
1180
- whiteBright: [97, 39]
1181
- },
1182
- bgColor: {
1183
- bgBlack: [40, 49],
1184
- bgRed: [41, 49],
1185
- bgGreen: [42, 49],
1186
- bgYellow: [43, 49],
1187
- bgBlue: [44, 49],
1188
- bgMagenta: [45, 49],
1189
- bgCyan: [46, 49],
1190
- bgWhite: [47, 49],
1191
- // Bright color
1192
- bgBlackBright: [100, 49],
1193
- bgGray: [100, 49],
1194
- // Alias of `bgBlackBright`
1195
- bgGrey: [100, 49],
1196
- // Alias of `bgBlackBright`
1197
- bgRedBright: [101, 49],
1198
- bgGreenBright: [102, 49],
1199
- bgYellowBright: [103, 49],
1200
- bgBlueBright: [104, 49],
1201
- bgMagentaBright: [105, 49],
1202
- bgCyanBright: [106, 49],
1203
- bgWhiteBright: [107, 49]
1204
- }
1205
- };
1206
- var modifierNames2 = Object.keys(styles3.modifier);
1207
- var foregroundColorNames2 = Object.keys(styles3.color);
1208
- var backgroundColorNames2 = Object.keys(styles3.bgColor);
1209
- var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
1210
- function assembleStyles2() {
1211
- const codes = /* @__PURE__ */ new Map();
1212
- for (const [groupName, group] of Object.entries(styles3)) {
1213
- for (const [styleName, style] of Object.entries(group)) {
1214
- styles3[styleName] = {
1215
- open: `\x1B[${style[0]}m`,
1216
- close: `\x1B[${style[1]}m`
1217
- };
1218
- group[styleName] = styles3[styleName];
1219
- codes.set(style[0], style[1]);
1220
- }
1221
- Object.defineProperty(styles3, groupName, {
1222
- value: group,
1223
- enumerable: false
1224
- });
1225
- }
1226
- Object.defineProperty(styles3, "codes", {
1227
- value: codes,
1228
- enumerable: false
1229
- });
1230
- styles3.color.close = "\x1B[39m";
1231
- styles3.bgColor.close = "\x1B[49m";
1232
- styles3.color.ansi = wrapAnsi162();
1233
- styles3.color.ansi256 = wrapAnsi2562();
1234
- styles3.color.ansi16m = wrapAnsi16m2();
1235
- styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
1236
- styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
1237
- styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
1238
- Object.defineProperties(styles3, {
1239
- rgbToAnsi256: {
1240
- value(red, green, blue) {
1241
- if (red === green && green === blue) {
1242
- if (red < 8) {
1243
- return 16;
1244
- }
1245
- if (red > 248) {
1246
- return 231;
1247
- }
1248
- return Math.round((red - 8) / 247 * 24) + 232;
1249
- }
1250
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1251
- },
1252
- enumerable: false
1253
- },
1254
- hexToRgb: {
1255
- value(hex) {
1256
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1257
- if (!matches) {
1258
- return [0, 0, 0];
1259
- }
1260
- let [colorString] = matches;
1261
- if (colorString.length === 3) {
1262
- colorString = [...colorString].map((character) => character + character).join("");
1263
- }
1264
- const integer = Number.parseInt(colorString, 16);
1265
- return [
1266
- /* eslint-disable no-bitwise */
1267
- integer >> 16 & 255,
1268
- integer >> 8 & 255,
1269
- integer & 255
1270
- /* eslint-enable no-bitwise */
1271
- ];
1272
- },
1273
- enumerable: false
1274
- },
1275
- hexToAnsi256: {
1276
- value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
1277
- enumerable: false
1278
- },
1279
- ansi256ToAnsi: {
1280
- value(code) {
1281
- if (code < 8) {
1282
- return 30 + code;
1283
- }
1284
- if (code < 16) {
1285
- return 90 + (code - 8);
1286
- }
1287
- let red;
1288
- let green;
1289
- let blue;
1290
- if (code >= 232) {
1291
- red = ((code - 232) * 10 + 8) / 255;
1292
- green = red;
1293
- blue = red;
1294
- } else {
1295
- code -= 16;
1296
- const remainder = code % 36;
1297
- red = Math.floor(code / 36) / 5;
1298
- green = Math.floor(remainder / 6) / 5;
1299
- blue = remainder % 6 / 5;
1300
- }
1301
- const value = Math.max(red, green, blue) * 2;
1302
- if (value === 0) {
1303
- return 30;
1304
- }
1305
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1306
- if (value === 2) {
1307
- result += 60;
1308
- }
1309
- return result;
1310
- },
1311
- enumerable: false
1312
- },
1313
- rgbToAnsi: {
1314
- value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
1315
- enumerable: false
1316
- },
1317
- hexToAnsi: {
1318
- value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
1319
- enumerable: false
1320
- }
1321
- });
1322
- return styles3;
1323
- }
1324
- var ansiStyles2 = assembleStyles2();
1325
- var ansi_styles_default2 = ansiStyles2;
1326
-
1327
- // ../../node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js
1328
- var ESCAPES = /* @__PURE__ */ new Set([
1329
- "\x1B",
1330
- "\x9B"
1331
- ]);
1332
- var END_CODE = 39;
1333
- var ANSI_ESCAPE_BELL = "\x07";
1334
- var ANSI_CSI = "[";
1335
- var ANSI_OSC = "]";
1336
- var ANSI_SGR_TERMINATOR = "m";
1337
- var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
1338
- var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
1339
- var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
1340
- var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
1341
- var wrapWord = (rows, word, columns) => {
1342
- const characters = [...word];
1343
- let isInsideEscape = false;
1344
- let isInsideLinkEscape = false;
1345
- let visible = stringWidth(stripAnsi(rows.at(-1)));
1346
- for (const [index, character] of characters.entries()) {
1347
- const characterLength = stringWidth(character);
1348
- if (visible + characterLength <= columns) {
1349
- rows[rows.length - 1] += character;
1350
- } else {
1351
- rows.push(character);
1352
- visible = 0;
1353
- }
1354
- if (ESCAPES.has(character)) {
1355
- isInsideEscape = true;
1356
- const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
1357
- isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
1358
- }
1359
- if (isInsideEscape) {
1360
- if (isInsideLinkEscape) {
1361
- if (character === ANSI_ESCAPE_BELL) {
1362
- isInsideEscape = false;
1363
- isInsideLinkEscape = false;
1364
- }
1365
- } else if (character === ANSI_SGR_TERMINATOR) {
1366
- isInsideEscape = false;
1367
- }
1368
- continue;
1369
- }
1370
- visible += characterLength;
1371
- if (visible === columns && index < characters.length - 1) {
1372
- rows.push("");
1373
- visible = 0;
1374
- }
1375
- }
1376
- if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
1377
- rows[rows.length - 2] += rows.pop();
1378
- }
1379
- };
1380
- var stringVisibleTrimSpacesRight = (string) => {
1381
- const words = string.split(" ");
1382
- let last = words.length;
1383
- while (last > 0) {
1384
- if (stringWidth(words[last - 1]) > 0) {
1385
- break;
1386
- }
1387
- last--;
1388
- }
1389
- if (last === words.length) {
1390
- return string;
1391
- }
1392
- return words.slice(0, last).join(" ") + words.slice(last).join("");
1393
- };
1394
- var exec = (string, columns, options = {}) => {
1395
- if (options.trim !== false && string.trim() === "") {
1396
- return "";
1397
- }
1398
- let returnValue = "";
1399
- let escapeCode;
1400
- let escapeUrl;
1401
- const lengths = wordLengths(string);
1402
- let rows = [""];
1403
- for (const [index, word] of string.split(" ").entries()) {
1404
- if (options.trim !== false) {
1405
- rows[rows.length - 1] = rows.at(-1).trimStart();
1406
- }
1407
- let rowLength = stringWidth(rows.at(-1));
1408
- if (index !== 0) {
1409
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1410
- rows.push("");
1411
- rowLength = 0;
1412
- }
1413
- if (rowLength > 0 || options.trim === false) {
1414
- rows[rows.length - 1] += " ";
1415
- rowLength++;
1416
- }
1417
- }
1418
- if (options.hard && lengths[index] > columns) {
1419
- const remainingColumns = columns - rowLength;
1420
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
1421
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
1422
- if (breaksStartingNextLine < breaksStartingThisLine) {
1423
- rows.push("");
1424
- }
1425
- wrapWord(rows, word, columns);
1426
- continue;
1427
- }
1428
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
1429
- if (options.wordWrap === false && rowLength < columns) {
1430
- wrapWord(rows, word, columns);
1431
- continue;
1432
- }
1433
- rows.push("");
1434
- }
1435
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
1436
- wrapWord(rows, word, columns);
1437
- continue;
1438
- }
1439
- rows[rows.length - 1] += word;
1440
- }
1441
- if (options.trim !== false) {
1442
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1443
- }
1444
- const preString = rows.join("\n");
1445
- const pre = [...preString];
1446
- let preStringIndex = 0;
1447
- for (const [index, character] of pre.entries()) {
1448
- returnValue += character;
1449
- if (ESCAPES.has(character)) {
1450
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
1451
- if (groups.code !== void 0) {
1452
- const code2 = Number.parseFloat(groups.code);
1453
- escapeCode = code2 === END_CODE ? void 0 : code2;
1454
- } else if (groups.uri !== void 0) {
1455
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
1456
- }
1457
- }
1458
- const code = ansi_styles_default2.codes.get(Number(escapeCode));
1459
- if (pre[index + 1] === "\n") {
1460
- if (escapeUrl) {
1461
- returnValue += wrapAnsiHyperlink("");
1462
- }
1463
- if (escapeCode && code) {
1464
- returnValue += wrapAnsiCode(code);
1465
- }
1466
- } else if (character === "\n") {
1467
- if (escapeCode && code) {
1468
- returnValue += wrapAnsiCode(escapeCode);
1469
- }
1470
- if (escapeUrl) {
1471
- returnValue += wrapAnsiHyperlink(escapeUrl);
1472
- }
1473
- }
1474
- preStringIndex += character.length;
1475
- }
1476
- return returnValue;
1477
- };
1478
- function wrapAnsi(string, columns, options) {
1479
- return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
1480
- }
1481
-
1482
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1483
- var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
1484
- var NEWLINE = "\n";
1485
- var PAD = " ";
1486
- var NONE = "none";
1487
- var terminalColumns = () => {
1488
- const { env: env2, stdout, stderr } = import_node_process2.default;
1489
- if (stdout?.columns) {
1490
- return stdout.columns;
1491
- }
1492
- if (stderr?.columns) {
1493
- return stderr.columns;
1494
- }
1495
- if (env2.COLUMNS) {
1496
- return Number.parseInt(env2.COLUMNS, 10);
1497
- }
1498
- return 80;
1499
- };
1500
- var getObject = (detail) => typeof detail === "number" ? {
1501
- top: detail,
1502
- right: detail * 3,
1503
- bottom: detail,
1504
- left: detail * 3
1505
- } : {
1506
- top: 0,
1507
- right: 0,
1508
- bottom: 0,
1509
- left: 0,
1510
- ...detail
1511
- };
1512
- var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
1513
- var getBorderChars = (borderStyle) => {
1514
- const sides = [
1515
- "topLeft",
1516
- "topRight",
1517
- "bottomRight",
1518
- "bottomLeft",
1519
- "left",
1520
- "right",
1521
- "top",
1522
- "bottom"
1523
- ];
1524
- let characters;
1525
- if (borderStyle === NONE) {
1526
- borderStyle = {};
1527
- for (const side of sides) {
1528
- borderStyle[side] = "";
1529
- }
1530
- }
1531
- if (typeof borderStyle === "string") {
1532
- characters = import_cli_boxes.default[borderStyle];
1533
- if (!characters) {
1534
- throw new TypeError(`Invalid border style: ${borderStyle}`);
1535
- }
1536
- } else {
1537
- if (typeof borderStyle?.vertical === "string") {
1538
- borderStyle.left = borderStyle.vertical;
1539
- borderStyle.right = borderStyle.vertical;
1540
- }
1541
- if (typeof borderStyle?.horizontal === "string") {
1542
- borderStyle.top = borderStyle.horizontal;
1543
- borderStyle.bottom = borderStyle.horizontal;
1544
- }
1545
- for (const side of sides) {
1546
- if (borderStyle[side] === null || typeof borderStyle[side] !== "string") {
1547
- throw new TypeError(`Invalid border style: ${side}`);
1548
- }
1549
- }
1550
- characters = borderStyle;
1551
- }
1552
- return characters;
1553
- };
1554
- var makeTitle = (text, horizontal, alignment) => {
1555
- let title = "";
1556
- const textWidth = stringWidth(text);
1557
- switch (alignment) {
1558
- case "left": {
1559
- title = text + horizontal.slice(textWidth);
1560
- break;
1561
- }
1562
- case "right": {
1563
- title = horizontal.slice(textWidth) + text;
1564
- break;
1565
- }
1566
- default: {
1567
- horizontal = horizontal.slice(textWidth);
1568
- if (horizontal.length % 2 === 1) {
1569
- horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
1570
- title = horizontal.slice(1) + text + horizontal;
1571
- } else {
1572
- horizontal = horizontal.slice(horizontal.length / 2);
1573
- title = horizontal + text + horizontal;
1574
- }
1575
- break;
1576
- }
1577
- }
1578
- return title;
1579
- };
1580
- var makeContentText = (text, { padding, width, textAlignment, height }) => {
1581
- text = (0, import_ansi_align.default)(text, { align: textAlignment });
1582
- let lines = text.split(NEWLINE);
1583
- const textWidth = widestLine(text);
1584
- const max = width - padding.left - padding.right;
1585
- if (textWidth > max) {
1586
- const newLines = [];
1587
- for (const line of lines) {
1588
- const createdLines = wrapAnsi(line, max, { hard: true });
1589
- const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
1590
- const alignedLinesArray = alignedLines.split("\n");
1591
- const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
1592
- for (const alignedLine of alignedLinesArray) {
1593
- let paddedLine;
1594
- switch (textAlignment) {
1595
- case "center": {
1596
- paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
1597
- break;
1598
- }
1599
- case "right": {
1600
- paddedLine = PAD.repeat(max - longestLength) + alignedLine;
1601
- break;
1602
- }
1603
- default: {
1604
- paddedLine = alignedLine;
1605
- break;
1606
- }
1607
- }
1608
- newLines.push(paddedLine);
1609
- }
1610
- }
1611
- lines = newLines;
1612
- }
1613
- if (textAlignment === "center" && textWidth < max) {
1614
- lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
1615
- } else if (textAlignment === "right" && textWidth < max) {
1616
- lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
1617
- }
1618
- const paddingLeft = PAD.repeat(padding.left);
1619
- const paddingRight = PAD.repeat(padding.right);
1620
- lines = lines.map((line) => {
1621
- const newLine = paddingLeft + line + paddingRight;
1622
- return newLine + PAD.repeat(width - stringWidth(newLine));
1623
- });
1624
- if (padding.top > 0) {
1625
- lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
1626
- }
1627
- if (padding.bottom > 0) {
1628
- lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
1629
- }
1630
- if (height && lines.length > height) {
1631
- lines = lines.slice(0, height);
1632
- } else if (height && lines.length < height) {
1633
- lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
1634
- }
1635
- return lines.join(NEWLINE);
1636
- };
1637
- var boxContent = (content, contentWidth, options) => {
1638
- const colorizeBorder = (border) => {
1639
- const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
1640
- return options.dimBorder ? source_default.dim(newBorder) : newBorder;
1641
- };
1642
- const colorizeContent = (content2) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content2) : content2;
1643
- const chars = getBorderChars(options.borderStyle);
1644
- const columns = terminalColumns();
1645
- let marginLeft = PAD.repeat(options.margin.left);
1646
- if (options.float === "center") {
1647
- const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
1648
- marginLeft = PAD.repeat(marginWidth);
1649
- } else if (options.float === "right") {
1650
- const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
1651
- marginLeft = PAD.repeat(marginWidth);
1652
- }
1653
- let result = "";
1654
- if (options.margin.top) {
1655
- result += NEWLINE.repeat(options.margin.top);
1656
- }
1657
- if (options.borderStyle !== NONE || options.title) {
1658
- result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
1659
- }
1660
- const lines = content.split(NEWLINE);
1661
- result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
1662
- if (options.borderStyle !== NONE) {
1663
- result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
1664
- }
1665
- if (options.margin.bottom) {
1666
- result += NEWLINE.repeat(options.margin.bottom);
1667
- }
1668
- return result;
1669
- };
1670
- var sanitizeOptions = (options) => {
1671
- if (options.fullscreen && import_node_process2.default?.stdout) {
1672
- let newDimensions = [import_node_process2.default.stdout.columns, import_node_process2.default.stdout.rows];
1673
- if (typeof options.fullscreen === "function") {
1674
- newDimensions = options.fullscreen(...newDimensions);
1675
- }
1676
- options.width ||= newDimensions[0];
1677
- options.height ||= newDimensions[1];
1678
- }
1679
- options.width &&= Math.max(1, options.width - getBorderWidth(options.borderStyle));
1680
- options.height &&= Math.max(1, options.height - getBorderWidth(options.borderStyle));
1681
- return options;
1682
- };
1683
- var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
1684
- var determineDimensions = (text, options) => {
1685
- options = sanitizeOptions(options);
1686
- const widthOverride = options.width !== void 0;
1687
- const columns = terminalColumns();
1688
- const borderWidth = getBorderWidth(options.borderStyle);
1689
- const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
1690
- const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
1691
- if (options.title && widthOverride) {
1692
- options.title = options.title.slice(0, Math.max(0, options.width - 2));
1693
- options.title &&= formatTitle(options.title, options.borderStyle);
1694
- } else if (options.title) {
1695
- options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
1696
- if (options.title) {
1697
- options.title = formatTitle(options.title, options.borderStyle);
1698
- if (stringWidth(options.title) > widest) {
1699
- options.width = stringWidth(options.title);
1700
- }
1701
- }
1702
- }
1703
- options.width ||= widest;
1704
- if (!widthOverride) {
1705
- if (options.margin.left && options.margin.right && options.width > maxWidth) {
1706
- const spaceForMargins = columns - options.width - borderWidth;
1707
- const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
1708
- options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
1709
- options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
1710
- }
1711
- options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
1712
- }
1713
- if (options.width - (options.padding.left + options.padding.right) <= 0) {
1714
- options.padding.left = 0;
1715
- options.padding.right = 0;
1716
- }
1717
- if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
1718
- options.padding.top = 0;
1719
- options.padding.bottom = 0;
1720
- }
1721
- return options;
1722
- };
1723
- var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
1724
- var isColorValid = (color) => typeof color === "string" && (source_default[color] ?? isHex(color));
1725
- var getColorFunction = (color) => isHex(color) ? source_default.hex(color) : source_default[color];
1726
- var getBGColorFunction = (color) => isHex(color) ? source_default.bgHex(color) : source_default[camelCase(["bg", color])];
1727
- function boxen(text, options) {
1728
- options = {
1729
- padding: 0,
1730
- borderStyle: "single",
1731
- dimBorder: false,
1732
- textAlignment: "left",
1733
- float: "left",
1734
- titleAlignment: "left",
1735
- ...options
1736
- };
1737
- if (options.align) {
1738
- options.textAlignment = options.align;
1739
- }
1740
- if (options.borderColor && !isColorValid(options.borderColor)) {
1741
- throw new Error(`${options.borderColor} is not a valid borderColor`);
1742
- }
1743
- if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
1744
- throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
1745
- }
1746
- options.padding = getObject(options.padding);
1747
- options.margin = getObject(options.margin);
1748
- options = determineDimensions(text, options);
1749
- text = makeContentText(text, options);
1750
- return boxContent(text, options.width, options);
1751
- }
1752
-
1753
- // src/cli-box.ts
1754
- var createBox = (options) => boxen(options.content, {
1755
- padding: { left: 3, right: 3, top: 1, bottom: 1 },
1756
- borderColor: "magenta",
1757
- borderStyle: "round",
1758
- title: options.title,
1759
- titleAlignment: "center"
1760
- });
1761
-
1762
- // src/diff-engine.ts
1763
- init_cjs_shims();
1764
- var import_config = require("@bamboocss/config");
1765
- var import_generator = require("@bamboocss/generator");
1766
- var DiffEngine = class {
1767
- constructor(ctx) {
1768
- this.ctx = ctx;
1769
- this.prevConfig = ctx.conf.deserialize();
1770
- }
1771
- prevConfig;
1772
- /**
1773
- * Reload config from disk and refresh the context
1774
- */
1775
- async reloadConfigAndRefreshContext(fn) {
1776
- const conf = await (0, import_config.loadConfig)({ cwd: this.ctx.config.cwd, file: this.ctx.conf.path });
1777
- const { tsconfig, tsconfigFile, tsOptions } = this.ctx.conf;
1778
- Object.assign(conf, { tsconfig, tsconfigFile, tsOptions });
1779
- return this.refresh(conf, fn);
1780
- }
1781
- /**
1782
- * Update the context from the refreshed config
1783
- * then persist the changes on each affected engines
1784
- * Returns the list of affected artifacts/engines
1785
- */
1786
- refresh(conf, fn) {
1787
- const affected = (0, import_config.diffConfigs)(() => conf.deserialize(), this.prevConfig);
1788
- if (!affected.hasConfigChanged || !this.prevConfig) return affected;
1789
- fn?.(conf);
1790
- this.prevConfig = conf.deserialize();
1791
- return affected;
1792
- }
1793
- };
1794
-
1795
- // src/node-runtime.ts
1796
- init_cjs_shims();
1797
- var import_logger2 = require("@bamboocss/logger");
1798
- var import_chokidar = __toESM(require("chokidar"));
1799
- var import_fast_glob = __toESM(require("fast-glob"));
1800
- var import_fs_extra = __toESM(require("fs-extra"));
1801
- var import_path2 = require("path");
1802
- var import_picomatch2 = __toESM(require("picomatch"));
1803
-
1804
- // src/glob-dirname.ts
1805
- init_cjs_shims();
1806
- var import_path = require("path");
1807
- var import_picomatch = __toESM(require("picomatch"));
1808
- function globDirname(globs) {
1809
- const rootDirs = /* @__PURE__ */ new Set();
1810
- for (const glob2 of globs) {
1811
- const scan = import_picomatch.default.scan(glob2, { tokens: true });
1812
- if (!scan.isGlob) {
1813
- rootDirs.add(glob2);
1814
- continue;
1815
- }
1816
- const nonGlobTokens = scan.tokens?.filter((token) => !token.isPrefix && !token.isGlob);
1817
- if (nonGlobTokens?.length) {
1818
- rootDirs.add((0, import_path.join)(...nonGlobTokens.map((token) => token.value)));
1819
- }
1820
- }
1821
- if (rootDirs.size === 0) {
1822
- return ["."];
1823
- }
1824
- return Array.from(rootDirs);
1825
- }
1826
-
1827
- // src/node-runtime.ts
1828
- var nodeRuntime = {
1829
- cwd() {
1830
- return process.cwd();
1831
- },
1832
- env(name) {
1833
- return process.env[name];
1834
- },
1835
- path: {
1836
- join: import_path2.join,
1837
- relative: import_path2.relative,
1838
- dirname: import_path2.dirname,
1839
- extname: import_path2.extname,
1840
- isAbsolute: import_path2.isAbsolute,
1841
- sep: import_path2.sep,
1842
- resolve: import_path2.resolve,
1843
- abs(cwd, str) {
1844
- return (0, import_path2.isAbsolute)(str) ? str : (0, import_path2.join)(cwd, str);
1845
- }
1846
- },
1847
- fs: {
1848
- existsSync: import_fs_extra.default.existsSync,
1849
- readFileSync(filePath) {
1850
- return import_fs_extra.default.readFileSync(filePath, "utf8");
1851
- },
1852
- glob(opts) {
1853
- if (!opts.include) return [];
1854
- const ignore = opts.exclude ?? [];
1855
- if (!ignore.length) {
1856
- ignore.push("**/*.d.ts");
1857
- }
1858
- return import_fast_glob.default.sync(opts.include, { cwd: opts.cwd, ignore, absolute: true });
1859
- },
1860
- writeFile: import_fs_extra.default.writeFile,
1861
- writeFileSync: import_fs_extra.default.writeFileSync,
1862
- readDirSync: import_fs_extra.default.readdirSync,
1863
- rmDirSync: import_fs_extra.default.emptyDirSync,
1864
- rmFileSync: import_fs_extra.default.removeSync,
1865
- ensureDirSync(path5) {
1866
- return import_fs_extra.default.ensureDirSync(path5);
1867
- },
1868
- watch(options) {
1869
- const { include, exclude, cwd, poll } = options;
1870
- const coalesce = poll || process.platform === "win32";
1871
- const dirnames = globDirname(include);
1872
- const isValidPath = (0, import_picomatch2.default)(include, { cwd, ignore: exclude });
1873
- const workingDir = cwd || process.cwd();
1874
- const watcher = import_chokidar.default.watch(dirnames, {
1875
- usePolling: poll,
1876
- cwd,
1877
- ignored(path5, stats) {
1878
- const relativePath = (0, import_path2.relative)(workingDir, path5);
1879
- return !!stats?.isFile() && !isValidPath(relativePath);
1880
- },
1881
- ignoreInitial: true,
1882
- ignorePermissionErrors: true,
1883
- awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
1884
- });
1885
- import_logger2.logger.debug("watch:file", `Watching [ ${dirnames.join(", ")} ]`);
1886
- process.once("SIGINT", async () => {
1887
- await watcher.close();
1888
- });
1889
- return watcher;
1890
- }
1891
- }
1892
- };
1893
- process.setMaxListeners(Infinity);
1894
- process.on("unhandledRejection", (reason) => {
1895
- import_logger2.logger.caughtError("process", "Unhandled rejection", reason);
1896
- });
1897
- process.on("uncaughtException", (error) => {
1898
- import_logger2.logger.caughtError("process", "Uncaught exception", error);
1899
- });
1900
-
1901
- // src/output-engine.ts
1902
- init_cjs_shims();
1903
- var import_logger3 = require("@bamboocss/logger");
1904
- var OutputEngine = class {
1905
- paths;
1906
- fs;
1907
- path;
1908
- constructor(options) {
1909
- const { paths, runtime } = options;
1910
- this.paths = paths;
1911
- this.fs = runtime.fs;
1912
- this.path = runtime.path;
1913
- }
1914
- empty = () => {
1915
- this.fs.rmDirSync(this.path.join(...this.paths.root));
1916
- };
1917
- ensure = (file, cwd) => {
1918
- const outPath = this.path.resolve(cwd, file);
1919
- const dirname2 = this.path.dirname(outPath);
1920
- this.fs.ensureDirSync(dirname2);
1921
- return outPath;
1922
- };
1923
- write = (output) => {
1924
- if (!output) return;
1925
- const { dir = this.paths.root, files } = output;
1926
- this.fs.ensureDirSync(this.path.join(...dir));
1927
- return Promise.allSettled(
1928
- files.map(async (artifact) => {
1929
- if (!artifact?.code) return;
1930
- const { file, code } = artifact;
1931
- const absPath = this.path.join(...dir, file);
1932
- import_logger3.logger.debug("write:file", dir.slice(-1).concat(file).join("/"));
1933
- return this.fs.writeFile(absPath, code);
1934
- })
1935
- );
1936
- };
1937
- };
1938
-
1939
- // src/create-context.ts
1940
- var BambooContext = class extends import_generator2.Generator {
1941
- runtime;
1942
- project;
1943
- output;
1944
- diff;
1945
- explicitDeps = [];
1946
- constructor(conf) {
1947
- super(conf);
1948
- const config = conf.config;
1949
- this.runtime = nodeRuntime;
1950
- config.cwd ||= this.runtime.cwd();
1951
- if (config.logLevel) {
1952
- import_logger4.logger.level = config.logLevel;
1953
- }
1954
- this.project = new import_parser.Project({
1955
- ...conf.tsconfig,
1956
- getFiles: this.getFiles.bind(this),
1957
- readFile: this.runtime.fs.readFileSync.bind(this),
1958
- hooks: conf.hooks,
1959
- parserOptions: {
1960
- ...this.parserOptions,
1961
- join: this.runtime.path.join || this.parserOptions.join
1962
- }
1963
- });
1964
- this.output = new OutputEngine(this);
1965
- this.diff = new DiffEngine(this);
1966
- this.explicitDeps = this.getExplicitDependencies();
1967
- }
1968
- getExplicitDependencies = () => {
1969
- const { cwd, dependencies } = this.config;
1970
- if (!dependencies) return [];
1971
- return this.runtime.fs.glob({ include: dependencies, cwd });
1972
- };
1973
- initMessage = () => {
1974
- return createBox({
1975
- content: this.messages.codegenComplete(),
1976
- title: this.messages.exclamation()
1977
- });
1978
- };
1979
- getFiles = () => {
1980
- const { include, exclude, cwd } = this.config;
1981
- return this.runtime.fs.glob({ include, exclude, cwd });
1982
- };
1983
- parseFile = (filePath, styleEncoder) => {
1984
- const file = this.runtime.path.abs(this.config.cwd, filePath);
1985
- import_logger4.logger.debug("file:extract", file);
1986
- const measure = import_logger4.logger.time.debug(`Parsed ${file}`);
1987
- let result;
1988
- try {
1989
- const encoder = styleEncoder || this.parserOptions.encoder;
1990
- result = this.project.parseSourceFile(file, encoder);
1991
- } catch (error) {
1992
- import_logger4.logger.caughtError("file:extract", `Failed to parse ${file}`, error);
1993
- }
1994
- measure();
1995
- return result;
1996
- };
1997
- parseFiles = (styleEncoder) => {
1998
- const encoder = styleEncoder || this.parserOptions.encoder;
1999
- const files = this.getFiles();
2000
- const filesWithCss = [];
2001
- const results = [];
2002
- files.forEach((file) => {
2003
- const measure = import_logger4.logger.time.debug(`Parsed ${file}`);
2004
- const result = this.project.parseSourceFile(file, encoder);
2005
- measure();
2006
- if (!result || result.isEmpty() || encoder.isEmpty()) return;
2007
- filesWithCss.push(file);
2008
- results.push(result);
2009
- });
2010
- return {
2011
- filesWithCss,
2012
- files,
2013
- results
2014
- };
2015
- };
2016
- writeCss = (sheet) => {
2017
- import_logger4.logger.info("css", this.runtime.path.join(...this.paths.root, "styles.css"));
2018
- return this.output.write({
2019
- id: "styles.css",
2020
- dir: this.paths.root,
2021
- files: [{ file: "styles.css", code: this.getCss(sheet) }]
2022
- });
2023
- };
2024
- writeSplitCss = async (sheet) => {
2025
- const { path: pathUtil, fs: fs4 } = this.runtime;
2026
- const rootDir = this.paths.root;
2027
- const stylesDir = [...rootDir, "styles"];
2028
- const artifacts = this.getSplitCssArtifacts(sheet);
2029
- const subDirs = new Set([...artifacts.recipes, ...artifacts.themes].map((a) => a.dir).filter(Boolean));
2030
- fs4.ensureDirSync(pathUtil.join(...stylesDir));
2031
- subDirs.forEach((dir) => fs4.ensureDirSync(pathUtil.join(...stylesDir, dir)));
2032
- const styleFiles = [];
2033
- for (const layer of artifacts.layers) {
2034
- styleFiles.push({ file: layer.file, code: layer.code });
2035
- import_logger4.logger.info("css", pathUtil.join(...stylesDir, layer.file));
2036
- }
2037
- for (const recipe of artifacts.recipes) {
2038
- styleFiles.push({ file: `${recipe.dir}/${recipe.file}`, code: recipe.code });
2039
- import_logger4.logger.info("css", pathUtil.join(...stylesDir, recipe.dir, recipe.file));
2040
- }
2041
- if (artifacts.recipes.length) {
2042
- styleFiles.push({ file: "recipes.css", code: artifacts.recipesIndex });
2043
- import_logger4.logger.info("css", pathUtil.join(...stylesDir, "recipes.css"));
2044
- }
2045
- for (const theme of artifacts.themes) {
2046
- styleFiles.push({ file: `${theme.dir}/${theme.file}`, code: theme.code });
2047
- import_logger4.logger.info("css", pathUtil.join(...stylesDir, theme.dir, theme.file));
2048
- }
2049
- await this.output.write({
2050
- id: "styles",
2051
- dir: stylesDir,
2052
- files: styleFiles
2053
- });
2054
- import_logger4.logger.info("css", pathUtil.join(...rootDir, "styles.css"));
2055
- await this.output.write({
2056
- id: "styles.css",
2057
- dir: rootDir,
2058
- files: [{ file: "styles.css", code: artifacts.index }]
2059
- });
2060
- };
2061
- watchConfig = (cb, opts) => {
2062
- const { cwd, poll, exclude } = opts ?? {};
2063
- import_logger4.logger.info("ctx:watch", this.messages.configWatch());
2064
- const watcher = this.runtime.fs.watch({
2065
- include: (0, import_shared.uniq)([...this.explicitDeps, ...this.conf.dependencies]),
2066
- exclude,
2067
- cwd,
2068
- poll
2069
- });
2070
- watcher.on(
2071
- "change",
2072
- (0, import_perfect_debounce.debounce)(async (file) => {
2073
- import_logger4.logger.info("ctx:change", "config changed, rebuilding...");
2074
- await cb(file);
2075
- })
2076
- );
2077
- };
2078
- watchFiles = (cb, opts) => {
2079
- const { include, exclude, poll, cwd } = this.config;
2080
- import_logger4.logger.info("ctx:watch", this.messages.watch());
2081
- const watcher = this.runtime.fs.watch({
2082
- ...opts,
2083
- include,
2084
- exclude,
2085
- poll,
2086
- cwd
2087
- });
2088
- watcher.on(
2089
- "all",
2090
- (0, import_perfect_debounce.debounce)(async (event, file) => {
2091
- import_logger4.logger.info(`file:${event}`, file);
2092
- await cb(event, file);
2093
- })
2094
- );
2095
- };
2096
- };
2097
-
2098
- // src/load-tsconfig.ts
2099
- init_cjs_shims();
2100
- var import_config2 = require("@bamboocss/config");
2101
- var import_node_path2 = __toESM(require("path"));
2102
-
2103
- // src/tsconfig-utils.ts
2104
- init_cjs_shims();
2105
- var import_node_fs = require("fs");
2106
- var import_node_path = __toESM(require("path"));
2107
- async function resolveDirectTsconfigJson(filename) {
2108
- if (import_node_path.default.extname(filename) !== ".json") return null;
2109
- const resolved = import_node_path.default.resolve(filename);
2110
- try {
2111
- const stat = await import_node_fs.promises.stat(resolved);
2112
- if (stat.isFile() || stat.isFIFO()) return resolved;
2113
- throw new Error(`${filename} exists but is not a regular file.`);
2114
- } catch (e) {
2115
- if (e && typeof e === "object" && "code" in e && e.code === "ENOENT") {
2116
- return null;
2117
- }
2118
- throw e;
2119
- }
2120
- }
2121
- async function findClosestTsconfig(filename, root, configName = "tsconfig.json") {
2122
- const resolvedRoot = import_node_path.default.resolve(root);
2123
- let dir = import_node_path.default.dirname(import_node_path.default.resolve(filename));
2124
- for (; ; ) {
2125
- const candidate = import_node_path.default.join(dir, configName);
2126
- try {
2127
- const stat = await import_node_fs.promises.stat(candidate);
2128
- if (stat.isFile() || stat.isFIFO()) {
2129
- return candidate;
2130
- }
2131
- } catch {
2132
- }
2133
- if (dir === resolvedRoot || import_node_path.default.dirname(dir) === dir) {
2134
- return null;
2135
- }
2136
- dir = import_node_path.default.dirname(dir);
2137
- }
2138
- }
2139
- function resolveBaseUrlForCompilerOptions(baseUrl, tsconfigFile, cwd) {
2140
- if (baseUrl == null) return cwd;
2141
- if (baseUrl.startsWith("${")) return baseUrl;
2142
- if (import_node_path.default.isAbsolute(baseUrl)) return baseUrl;
2143
- return import_node_path.default.resolve(import_node_path.default.dirname(tsconfigFile), baseUrl);
2144
- }
2145
- var SOURCE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
2146
- function resolveReferencedTsconfigPath(refPath, fromDir, configName = "tsconfig.json") {
2147
- const p = refPath.endsWith(".json") ? refPath : import_node_path.default.join(refPath, configName);
2148
- return import_node_path.default.resolve(fromDir, p);
2149
- }
2150
- async function resolveSolutionTsconfigForFile(absoluteFilename, rootTsconfigPath, rootParsed, getTsconfigModule) {
2151
- const { parseTsconfig } = getTsconfigModule;
2152
- if (isSourceFileIncludedInTsconfig(absoluteFilename, rootTsconfigPath, rootParsed)) {
2153
- return { tsconfig: rootParsed, tsconfigFile: rootTsconfigPath };
2154
- }
2155
- const refs = rootParsed.references;
2156
- if (!refs?.length) {
2157
- return { tsconfig: rootParsed, tsconfigFile: rootTsconfigPath };
2158
- }
2159
- if (!SOURCE_EXTENSIONS.some((ext) => absoluteFilename.endsWith(ext))) {
2160
- return { tsconfig: rootParsed, tsconfigFile: rootTsconfigPath };
2161
- }
2162
- const rootDir = import_node_path.default.dirname(rootTsconfigPath);
2163
- for (const ref of refs) {
2164
- const refPath = resolveReferencedTsconfigPath(ref.path, rootDir);
2165
- try {
2166
- await import_node_fs.promises.access(refPath);
2167
- } catch {
2168
- continue;
2169
- }
2170
- const childParsed = parseTsconfig(refPath);
2171
- if (isSourceFileIncludedInTsconfig(absoluteFilename, refPath, childParsed)) {
2172
- return { tsconfig: childParsed, tsconfigFile: refPath };
2173
- }
2174
- }
2175
- return { tsconfig: rootParsed, tsconfigFile: rootTsconfigPath };
2176
- }
2177
- var POSIX_SEP_RE = new RegExp("\\" + import_node_path.default.posix.sep, "g");
2178
- var NATIVE_SEP_RE = new RegExp("\\" + import_node_path.default.sep, "g");
2179
- var PATTERN_REGEX_CACHE = /* @__PURE__ */ new Map();
2180
- var GLOB_ALL_PATTERN = `**/*`;
2181
- var TS_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
2182
- var JS_EXTENSIONS = [".js", ".jsx", ".mjs", ".cjs"];
2183
- var TSJS_EXTENSIONS = TS_EXTENSIONS.concat(JS_EXTENSIONS);
2184
- var TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.slice(1)).join("|")})`;
2185
- var TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.slice(1)).join("|")})`;
2186
- var IS_POSIX = import_node_path.default.posix.sep === import_node_path.default.sep;
2187
- var native2posix = IS_POSIX ? (filename) => filename : (filename) => filename.replace(NATIVE_SEP_RE, import_node_path.default.posix.sep);
2188
- var resolve2posix = IS_POSIX ? (dir, filename) => dir ? import_node_path.default.resolve(dir, filename) : import_node_path.default.resolve(filename) : (dir, filename) => {
2189
- const posix2native = (f) => f.replace(POSIX_SEP_RE, import_node_path.default.sep);
2190
- return native2posix(
2191
- dir ? import_node_path.default.resolve(posix2native(dir), posix2native(filename)) : import_node_path.default.resolve(posix2native(filename))
2192
- );
2193
- };
2194
- function isGlobMatch(filename, dir, patterns, allowJs) {
2195
- const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS;
2196
- return patterns.some((patternArg) => {
2197
- let pattern = patternArg;
2198
- let lastWildcardIndex = pattern.length;
2199
- let hasWildcard = false;
2200
- let hasExtension = false;
2201
- let hasSlash = false;
2202
- let lastSlashIndex = -1;
2203
- for (let i = pattern.length - 1; i > -1; i--) {
2204
- const c = pattern[i];
2205
- if (!hasWildcard) {
2206
- if (c === "*" || c === "?") {
2207
- lastWildcardIndex = i;
2208
- hasWildcard = true;
2209
- }
2210
- }
2211
- if (!hasSlash) {
2212
- if (c === ".") {
2213
- hasExtension = true;
2214
- } else if (c === "/") {
2215
- lastSlashIndex = i;
2216
- hasSlash = true;
2217
- }
2218
- }
2219
- if (hasWildcard && hasSlash) {
2220
- break;
2221
- }
2222
- }
2223
- if (!hasExtension && (!hasWildcard || lastWildcardIndex < lastSlashIndex)) {
2224
- pattern += `${pattern.endsWith("/") ? "" : "/"}${GLOB_ALL_PATTERN}`;
2225
- lastWildcardIndex = pattern.length - 1;
2226
- hasWildcard = true;
2227
- }
2228
- if (lastWildcardIndex < pattern.length - 1 && !filename.endsWith(pattern.slice(lastWildcardIndex + 1))) {
2229
- return false;
2230
- }
2231
- if (pattern.endsWith("*") && !extensions.some((ext) => filename.endsWith(ext))) {
2232
- return false;
2233
- }
2234
- if (pattern === GLOB_ALL_PATTERN) {
2235
- return filename.startsWith(`${dir}/`);
2236
- }
2237
- const resolvedPattern = resolve2posix(dir, pattern);
2238
- let firstWildcardIndex = -1;
2239
- for (let i = 0; i < resolvedPattern.length; i++) {
2240
- if (resolvedPattern[i] === "*" || resolvedPattern[i] === "?") {
2241
- firstWildcardIndex = i;
2242
- hasWildcard = true;
2243
- break;
2244
- }
2245
- }
2246
- if (firstWildcardIndex > 1 && !filename.startsWith(resolvedPattern.slice(0, firstWildcardIndex - 1))) {
2247
- return false;
2248
- }
2249
- if (!hasWildcard) {
2250
- return filename === resolvedPattern;
2251
- }
2252
- if (firstWildcardIndex + GLOB_ALL_PATTERN.length === resolvedPattern.length - (pattern.length - 1 - lastWildcardIndex) && resolvedPattern.slice(firstWildcardIndex, firstWildcardIndex + GLOB_ALL_PATTERN.length) === GLOB_ALL_PATTERN) {
2253
- return true;
2254
- }
2255
- if (PATTERN_REGEX_CACHE.has(resolvedPattern)) {
2256
- return PATTERN_REGEX_CACHE.get(resolvedPattern).test(filename);
2257
- }
2258
- const regex2 = pattern2regex(resolvedPattern, allowJs);
2259
- PATTERN_REGEX_CACHE.set(resolvedPattern, regex2);
2260
- return regex2.test(filename);
2261
- });
2262
- }
2263
- function pattern2regex(resolvedPattern, allowJs) {
2264
- let regexStr = "^";
2265
- for (let i = 0; i < resolvedPattern.length; i++) {
2266
- const char = resolvedPattern[i];
2267
- if (char === "?") {
2268
- regexStr += "[^\\/]";
2269
- continue;
2270
- }
2271
- if (char === "*") {
2272
- if (resolvedPattern[i + 1] === "*" && resolvedPattern[i + 2] === "/") {
2273
- i += 2;
2274
- regexStr += "(?:[^\\/]*\\/)*";
2275
- continue;
2276
- }
2277
- regexStr += "[^\\/]*";
2278
- continue;
2279
- }
2280
- if ("/.+^${}()|[]\\".includes(char)) {
2281
- regexStr += "\\";
2282
- }
2283
- regexStr += char;
2284
- }
2285
- if (resolvedPattern.endsWith("*")) {
2286
- regexStr += allowJs ? TSJS_EXTENSIONS_RE_GROUP : TS_EXTENSIONS_RE_GROUP;
2287
- }
2288
- regexStr += "$";
2289
- return new RegExp(regexStr);
2290
- }
2291
- function isIncluded(filename, tsconfigFile, tsconfig) {
2292
- const dir = native2posix(import_node_path.default.dirname(tsconfigFile));
2293
- const files = (tsconfig.files || []).map((file) => resolve2posix(dir, file));
2294
- const absoluteFilename = resolve2posix(null, filename);
2295
- if (files.includes(filename)) {
2296
- return true;
2297
- }
2298
- const allowJs = tsconfig.compilerOptions?.allowJs;
2299
- const included = isGlobMatch(
2300
- absoluteFilename,
2301
- dir,
2302
- tsconfig.include || (tsconfig.files ? [] : [GLOB_ALL_PATTERN]),
2303
- allowJs
2304
- );
2305
- if (included) {
2306
- const excluded = isGlobMatch(absoluteFilename, dir, tsconfig.exclude || [], allowJs);
2307
- return !excluded;
2308
- }
2309
- return false;
2310
- }
2311
- function isSourceFileIncludedInTsconfig(absoluteFilename, tsconfigFile, tsconfig) {
2312
- return isIncluded(absoluteFilename, tsconfigFile, tsconfig);
2313
- }
2314
-
2315
- // src/load-tsconfig.ts
2316
- async function loadTsConfig(conf, cwd) {
2317
- const root = cwd;
2318
- let tsconfigFile = await resolveDirectTsconfigJson(conf.path);
2319
- if (!tsconfigFile) {
2320
- tsconfigFile = await findClosestTsconfig(conf.path, root, "tsconfig.json");
2321
- }
2322
- if (!tsconfigFile) {
2323
- return {
2324
- tsconfig: {},
2325
- tsconfigFile: void 0
2326
- };
2327
- }
2328
- const gtc = await import("get-tsconfig");
2329
- const rootParsed = gtc.parseTsconfig(tsconfigFile);
2330
- const { tsconfig, tsconfigFile: effectiveTsconfigPath } = await resolveSolutionTsconfigForFile(
2331
- import_node_path2.default.resolve(conf.path),
2332
- tsconfigFile,
2333
- rootParsed,
2334
- gtc
2335
- );
2336
- const compilerOptions = tsconfig?.compilerOptions;
2337
- const result = {
2338
- tsconfig,
2339
- tsconfigFile: effectiveTsconfigPath
2340
- };
2341
- if (compilerOptions?.paths) {
2342
- const baseUrl = compilerOptions.baseUrl;
2343
- result.tsOptions = {
2344
- baseUrl,
2345
- pathMappings: (0, import_config2.convertTsPathsToRegexes)(
2346
- compilerOptions.paths,
2347
- resolveBaseUrlForCompilerOptions(baseUrl, effectiveTsconfigPath, cwd)
2348
- )
2349
- };
2350
- }
2351
- return result;
2352
- }
2353
-
2354
- // src/config.ts
2355
- var RESOLVED_HOOKS_NAME = "__resolved__";
2356
- function getAutoPlugins(config) {
2357
- const plugins = [(0, import_plugin_vue.pluginVue)(), (0, import_plugin_svelte.pluginSvelte)()];
2358
- if (config.lightningcss) {
2359
- plugins.push((0, import_plugin_lightningcss.pluginLightningcss)());
2360
- }
2361
- return plugins;
2362
- }
2363
- async function loadConfigAndCreateContext(options = {}) {
2364
- const { config, configPath } = options;
2365
- const cwd = options.cwd ?? options?.config?.cwd ?? process.cwd();
2366
- const conf = await (0, import_config3.loadConfig)({ cwd, file: configPath });
2367
- if (config) {
2368
- Object.assign(conf.config, config);
2369
- }
2370
- if (options.cwd) {
2371
- conf.config.cwd = options.cwd;
2372
- }
2373
- if (conf.config.lightningcss && !conf.config.browserslist) {
2374
- conf.config.browserslist ||= import_browserslist.default.findConfig(cwd)?.defaults;
2375
- }
2376
- const autoPlugins = getAutoPlugins(conf.config);
2377
- conf.hooks = (0, import_config3.mergeHooks)([...autoPlugins, { name: RESOLVED_HOOKS_NAME, hooks: conf.hooks }]);
2378
- conf.config.plugins = [...autoPlugins, ...conf.config.plugins ?? []];
2379
- const tsConfResult = await loadTsConfig(conf, cwd);
2380
- if (tsConfResult) {
2381
- Object.assign(conf, tsConfResult);
2382
- }
2383
- return new BambooContext(conf);
2384
- }
2385
-
2386
- // src/parse-dependency.ts
2387
- init_cjs_shims();
2388
- var import_is_glob = __toESM(require("is-glob"));
2389
- var import_path3 = require("path");
2390
-
2391
- // src/parse-glob.ts
2392
- init_cjs_shims();
2393
- var import_glob_parent = __toESM(require("glob-parent"));
2394
- function parseGlob(pattern) {
2395
- let glob2 = pattern;
2396
- const base = (0, import_glob_parent.default)(pattern);
2397
- if (base !== ".") {
2398
- glob2 = pattern.substring(base.length);
2399
- if (glob2.charAt(0) === "/") {
2400
- glob2 = glob2.substring(1);
2401
- }
2402
- }
2403
- if (glob2.substring(0, 2) === "./") {
2404
- glob2 = glob2.substring(2);
2405
- }
2406
- if (glob2.charAt(0) === "/") {
2407
- glob2 = glob2.substring(1);
2408
- }
2409
- return { base, glob: glob2 };
2410
- }
2411
-
2412
- // src/parse-dependency.ts
2413
- function parseDependency(fileOrGlob) {
2414
- if (fileOrGlob.startsWith("!")) {
2415
- return null;
2416
- }
2417
- let message = null;
2418
- if ((0, import_is_glob.default)(fileOrGlob)) {
2419
- const { base, glob: glob2 } = parseGlob(fileOrGlob);
2420
- message = { type: "dir-dependency", dir: (0, import_path3.normalize)((0, import_path3.resolve)(base)), glob: glob2 };
2421
- } else {
2422
- message = { type: "dependency", file: (0, import_path3.normalize)((0, import_path3.resolve)(fileOrGlob)) };
2423
- }
2424
- if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
2425
- message = { type: "dependency", file: (0, import_path3.normalize)((0, import_path3.resolve)(message.dir)) };
2426
- }
2427
- return message;
2428
- }
2429
-
2430
- // src/builder.ts
2431
- var fileModifiedMap = /* @__PURE__ */ new Map();
2432
- var Builder = class {
2433
- /**
2434
- * The current bamboo context
2435
- */
2436
- context;
2437
- hasEmitted = false;
2438
- filesMeta;
2439
- explicitDepsMeta;
2440
- affecteds;
2441
- configDependencies = /* @__PURE__ */ new Set();
2442
- setConfigDependencies(options) {
2443
- const tsOptions = this.context?.conf.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
2444
- const compilerOptions = this.context?.conf.tsconfig?.compilerOptions ?? {};
2445
- const { deps: foundDeps } = (0, import_config4.getConfigDependencies)(options.configPath, tsOptions, compilerOptions);
2446
- const cwd = options?.cwd ?? this.context?.config.cwd ?? process.cwd();
2447
- const configDeps = /* @__PURE__ */ new Set([
2448
- ...foundDeps,
2449
- ...(this.context?.conf.dependencies ?? []).map((file) => (0, import_path4.resolve)(cwd, file))
2450
- ]);
2451
- configDeps.forEach((file) => {
2452
- this.configDependencies.add(file);
2453
- });
2454
- import_logger5.logger.debug("builder", "Config dependencies");
2455
- import_logger5.logger.debug("builder", configDeps);
2456
- }
2457
- setup = async (options = {}) => {
2458
- import_logger5.logger.debug("builder", "\u{1F6A7} Setup");
2459
- const configPath = options.configPath ?? (0, import_config4.findConfig)({ cwd: options.cwd });
2460
- this.setConfigDependencies({ configPath, cwd: options.cwd });
2461
- if (!this.context) {
2462
- return this.setupContext({ configPath, cwd: options.cwd });
2463
- }
2464
- const ctx = this.getContextOrThrow();
2465
- this.affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
2466
- this.context = new BambooContext(conf);
2467
- });
2468
- import_logger5.logger.debug("builder", this.affecteds);
2469
- this.explicitDepsMeta = this.checkFilesChanged(this.context.explicitDeps);
2470
- if (this.explicitDepsMeta.hasFilesChanged) {
2471
- this.explicitDepsMeta.changes.forEach((meta, file) => {
2472
- fileModifiedMap.set(file, meta.mtime);
2473
- });
2474
- import_logger5.logger.debug("builder", "\u2699\uFE0F Explicit config dependencies changed");
2475
- this.affecteds.hasConfigChanged = true;
2476
- }
2477
- if (this.affecteds.hasConfigChanged) {
2478
- import_logger5.logger.debug("builder", "\u2699\uFE0F Config changed, reloading");
2479
- await ctx.hooks["config:change"]?.({ config: ctx.config, changes: this.affecteds });
2480
- return;
2481
- }
2482
- this.filesMeta = this.checkFilesChanged(ctx.getFiles());
2483
- if (this.filesMeta.hasFilesChanged) {
2484
- import_logger5.logger.debug("builder", "Files changed, invalidating them");
2485
- ctx.project.reloadSourceFiles();
2486
- }
2487
- };
2488
- async emit() {
2489
- if (this.hasEmitted && this.affecteds?.hasConfigChanged) {
2490
- import_logger5.logger.debug("builder", "Emit artifacts after config change");
2491
- await codegen(this.getContextOrThrow(), Array.from(this.affecteds.artifacts));
2492
- }
2493
- this.hasEmitted = true;
2494
- }
2495
- setupContext = async (options) => {
2496
- const { configPath, cwd } = options;
2497
- const ctx = await loadConfigAndCreateContext({ configPath, cwd });
2498
- const configDeps = (0, import_shared2.uniq)([...ctx.conf.dependencies, ...ctx.explicitDeps]);
2499
- configDeps.forEach((file) => {
2500
- this.configDependencies.add((0, import_path4.resolve)(cwd || ctx.conf.config.cwd, file));
2501
- });
2502
- this.context = ctx;
2503
- return ctx;
2504
- };
2505
- getContextOrThrow = () => {
2506
- if (!this.context) {
2507
- throw new import_shared2.BambooError("NO_CONTEXT", "context not loaded");
2508
- }
2509
- return this.context;
2510
- };
2511
- getFileMeta = (file) => {
2512
- const mtime = (0, import_fs.existsSync)(file) ? (0, import_fs.statSync)(file).mtimeMs : -Infinity;
2513
- const isUnchanged = fileModifiedMap.has(file) && mtime === fileModifiedMap.get(file);
2514
- return { mtime, isUnchanged };
2515
- };
2516
- checkFilesChanged(files) {
2517
- const changes = /* @__PURE__ */ new Map();
2518
- let hasFilesChanged = false;
2519
- for (const file of files) {
2520
- const meta = this.getFileMeta(file);
2521
- changes.set(file, meta);
2522
- if (!meta.isUnchanged) {
2523
- hasFilesChanged = true;
2524
- }
2525
- }
2526
- return { changes, hasFilesChanged };
2527
- }
2528
- extractFile = (ctx, file) => {
2529
- const meta = this.filesMeta?.changes.get(file) ?? this.getFileMeta(file);
2530
- const hasConfigChanged = this.affecteds ? this.affecteds.hasConfigChanged : true;
2531
- if (meta.isUnchanged && !hasConfigChanged) return;
2532
- const parserResult = ctx.parseFile(file);
2533
- fileModifiedMap.set(file, meta.mtime);
2534
- return parserResult;
2535
- };
2536
- extract = () => {
2537
- const hasConfigChanged = this.affecteds ? this.affecteds.hasConfigChanged : true;
2538
- if (!this.filesMeta && !hasConfigChanged) {
2539
- import_logger5.logger.debug("builder", "No files or config changed, skipping extract");
2540
- return;
2541
- }
2542
- const ctx = this.getContextOrThrow();
2543
- const files = ctx.getFiles();
2544
- const done = import_logger5.logger.time.info("Extracted in");
2545
- files.map((file) => this.extractFile(ctx, file));
2546
- done();
2547
- };
2548
- isValidRoot = (root) => {
2549
- const ctx = this.getContextOrThrow();
2550
- let valid = false;
2551
- root.walkAtRules("layer", (rule) => {
2552
- if (ctx.isValidLayerParams(rule.params)) {
2553
- valid = true;
2554
- }
2555
- });
2556
- return valid;
2557
- };
2558
- write = (root) => {
2559
- const ctx = this.getContextOrThrow();
2560
- const sheet = ctx.createSheet();
2561
- ctx.appendBaselineCss(sheet);
2562
- const css = ctx.getCss(sheet);
2563
- root.append(css);
2564
- };
2565
- registerDependency = (fn) => {
2566
- const ctx = this.getContextOrThrow();
2567
- for (const fileOrGlob of ctx.config.include) {
2568
- const dependency = parseDependency(fileOrGlob);
2569
- if (dependency) fn(dependency);
2570
- }
2571
- for (const file of this.configDependencies) {
2572
- fn({ type: "dependency", file: (0, import_path4.normalize)((0, import_path4.resolve)(file)) });
2573
- }
2574
- };
2575
- };
2576
-
2577
- // src/cpu-profile.ts
2578
- init_cjs_shims();
2579
- var import_logger6 = require("@bamboocss/logger");
2580
- var import_node_fs2 = __toESM(require("fs"));
2581
- var import_node_path3 = __toESM(require("path"));
2582
- var import_node_readline = __toESM(require("readline"));
2583
- var startProfiling = async (cwd, prefix, isWatching) => {
2584
- const inspector = await import("inspector").then((r) => r.default);
2585
- const session = new inspector.Session();
2586
- session.connect();
2587
- let state = "idle";
2588
- const setState = (s) => {
2589
- state = s;
2590
- };
2591
- await new Promise((resolve4) => {
2592
- session.post("Profiler.enable", () => {
2593
- session.post("Profiler.start", () => {
2594
- setState("profiling");
2595
- resolve4();
2596
- });
2597
- });
2598
- });
2599
- const toggleProfiler = () => {
2600
- if (state === "idle") {
2601
- console.log("Starting CPU profiling...");
2602
- setState("starting");
2603
- session.post("Profiler.start", () => {
2604
- setState("profiling");
2605
- console.log("Press 'p' to stop profiling...");
2606
- });
2607
- } else if (state === "profiling") {
2608
- console.log("Stopping CPU profiling...");
2609
- stopProfiling();
2610
- }
2611
- };
2612
- if (isWatching) {
2613
- import_node_readline.default.emitKeypressEvents(process.stdin);
2614
- if (process.stdin.isTTY) process.stdin.setRawMode(true);
2615
- console.log("Press 'p' to stop profiling...");
2616
- process.stdin.on("keypress", (str, key) => {
2617
- if (key.name === "p") {
2618
- toggleProfiler();
2619
- }
2620
- if (key.ctrl && key.name === "c") {
2621
- stopProfiling(() => process.exit());
2622
- }
2623
- });
2624
- }
2625
- const stopProfiling = (cb) => {
2626
- if (state !== "profiling") {
2627
- cb?.();
2628
- return;
2629
- }
2630
- setState("stopping");
2631
- session.post("Profiler.stop", (err, params) => {
2632
- setState("idle");
2633
- if (err) {
2634
- import_logger6.logger.error("cpu-prof", err);
2635
- cb?.();
2636
- return;
2637
- }
2638
- if (!params?.profile) {
2639
- cb?.();
2640
- return;
2641
- }
2642
- const date = /* @__PURE__ */ new Date();
2643
- const timestamp = date.toISOString().replace(/[-:.]/g, "");
2644
- const title = `bamboo-${prefix}-${timestamp}`;
2645
- const outfile = import_node_path3.default.join(cwd, `${title}.cpuprofile`);
2646
- import_node_fs2.default.writeFileSync(outfile, JSON.stringify(params.profile));
2647
- import_logger6.logger.info("cpu-prof", outfile);
2648
- cb?.();
2649
- });
2650
- };
2651
- return stopProfiling;
2652
- };
2653
-
2654
- // src/cssgen.ts
2655
- init_cjs_shims();
2656
- var import_logger7 = require("@bamboocss/logger");
2657
- var cssgen = async (ctx, options) => {
2658
- const { outfile, type, minimal, splitting } = options;
2659
- const sheet = ctx.createSheet();
2660
- if (type) {
2661
- const done = import_logger7.logger.time.info(ctx.messages.cssArtifactComplete(type));
2662
- ctx.appendCssOfType(type, sheet);
2663
- if (outfile) {
2664
- const css = ctx.getCss(sheet);
2665
- import_logger7.logger.info("css", ctx.runtime.path.resolve(outfile));
2666
- await ctx.runtime.fs.writeFile(outfile, css);
2667
- } else {
2668
- await ctx.writeCss(sheet);
2669
- }
2670
- done();
2671
- } else {
2672
- const { files } = ctx.parseFiles();
2673
- const done = import_logger7.logger.time.info(ctx.messages.buildComplete(files.length));
2674
- if (!minimal) {
2675
- ctx.appendLayerParams(sheet);
2676
- ctx.appendBaselineCss(sheet);
2677
- }
2678
- ctx.appendParserCss(sheet);
2679
- if (splitting) {
2680
- await ctx.writeSplitCss(sheet);
2681
- } else if (outfile) {
2682
- const css = ctx.getCss(sheet);
2683
- import_logger7.logger.info("css", ctx.runtime.path.resolve(outfile));
2684
- await ctx.runtime.fs.writeFile(outfile, css);
2685
- } else {
2686
- await ctx.writeCss(sheet);
2687
- }
2688
- done();
2689
- }
2690
- };
2691
-
2692
- // src/debug.ts
2693
- init_cjs_shims();
2694
- var import_logger8 = require("@bamboocss/logger");
2695
- var import_path5 = require("path");
2696
- async function debug(ctx, options) {
2697
- const files = ctx.getFiles();
2698
- const measureTotal = import_logger8.logger.time.debug(`Done parsing ${files.length} files`);
2699
- ctx.config.minify = false;
2700
- const { fs: fs4, path: path5 } = ctx.runtime;
2701
- const outdir = options.outdir;
2702
- if (!options.dry && outdir) {
2703
- fs4.ensureDirSync(outdir);
2704
- import_logger8.logger.info("cli", `Writing ${import_logger8.colors.bold(`${outdir}/config.json`)}`);
2705
- await fs4.writeFile(`${outdir}/config.json`, JSON.stringify(ctx.config, null, 2));
2706
- }
2707
- if (options.onlyConfig) {
2708
- measureTotal();
2709
- return;
2710
- }
2711
- const filesWithCss = [];
2712
- files.map((file) => {
2713
- const measure = import_logger8.logger.time.debug(`Parsed ${file}`);
2714
- const encoder = ctx.encoder.clone();
2715
- const result = ctx.project.parseSourceFile(file, encoder);
2716
- measure();
2717
- if (!result || result.isEmpty() || encoder.isEmpty()) return;
2718
- const styles4 = ctx.decoder.clone().collect(encoder);
2719
- const css = ctx.getParserCss(styles4);
2720
- if (!css) return;
2721
- if (options.dry) {
2722
- console.log({ path: file, ast: result, code: css });
2723
- return;
2724
- }
2725
- if (outdir) {
2726
- filesWithCss.push(file);
2727
- const parsedPath = (0, import_path5.parse)(file);
2728
- const relative2 = path5.relative(ctx.config.cwd, parsedPath.dir);
2729
- const astJsonPath = `${relative2}${path5.sep}${parsedPath.name}.ast.json`.replaceAll(path5.sep, "__");
2730
- const cssPath = `${relative2}${path5.sep}${parsedPath.name}.css`.replaceAll(path5.sep, "__");
2731
- import_logger8.logger.info("cli", `Writing ${import_logger8.colors.bold(`${outdir}/${astJsonPath}`)}`);
2732
- import_logger8.logger.info("cli", `Writing ${import_logger8.colors.bold(`${outdir}/${cssPath}`)}`);
2733
- return Promise.allSettled([
2734
- fs4.writeFile(`${outdir}${path5.sep}${astJsonPath}`, JSON.stringify(result.toJSON(), null, 2)),
2735
- fs4.writeFile(`${outdir}${path5.sep}${cssPath}`, css)
2736
- ]);
2737
- }
2738
- });
2739
- import_logger8.logger.info("cli", `Found ${import_logger8.colors.bold(`${filesWithCss.length}/${files.length}`)} files using Bamboo`);
2740
- measureTotal();
2741
- }
2742
-
2743
- // src/generate.ts
2744
- init_cjs_shims();
2745
- var import_logger9 = require("@bamboocss/logger");
2746
- async function build(ctx, artifactIds) {
2747
- await codegen(ctx, artifactIds);
2748
- if (ctx.config.emitTokensOnly) {
2749
- return import_logger9.logger.info("css:emit", "Successfully rebuilt the css variables and js function to query your tokens \u2728");
2750
- }
2751
- const done = import_logger9.logger.time.info("");
2752
- const sheet = ctx.createSheet();
2753
- ctx.appendLayerParams(sheet);
2754
- ctx.appendBaselineCss(sheet);
2755
- const parsed = ctx.parseFiles();
2756
- ctx.appendParserCss(sheet);
2757
- await ctx.writeCss(sheet);
2758
- done(ctx.messages.buildComplete(parsed.files.length));
2759
- }
2760
- async function generate(config, configPath) {
2761
- let ctx = await loadConfigAndCreateContext({ config, configPath });
2762
- await build(ctx);
2763
- const { cwd, watch, poll } = ctx.config;
2764
- if (watch) {
2765
- ctx.watchConfig(
2766
- async () => {
2767
- const affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
2768
- ctx = new BambooContext(conf);
2769
- });
2770
- import_logger9.logger.info("ctx:updated", "config rebuilt \u2705");
2771
- await ctx.hooks["config:change"]?.({ config: ctx.config, changes: affecteds });
2772
- return build(ctx, Array.from(affecteds.artifacts));
2773
- },
2774
- { cwd, poll }
2775
- );
2776
- const bundleStyles = async (ctx2, changedFilePath) => {
2777
- const outfile = ctx2.runtime.path.join(...ctx2.paths.root, "styles.css");
2778
- const parserResult = ctx2.project.parseSourceFile(changedFilePath);
2779
- if (parserResult) {
2780
- const done = import_logger9.logger.time.info(ctx2.messages.buildComplete(1));
2781
- const sheet = ctx2.createSheet();
2782
- ctx2.appendLayerParams(sheet);
2783
- ctx2.appendBaselineCss(sheet);
2784
- ctx2.appendParserCss(sheet);
2785
- const css = ctx2.getCss(sheet);
2786
- await ctx2.runtime.fs.writeFile(outfile, css);
2787
- done();
2788
- }
2789
- };
2790
- ctx.watchFiles(async (event, file) => {
2791
- const filePath = ctx.runtime.path.abs(cwd, file);
2792
- if (event === "unlink") {
2793
- ctx.project.removeSourceFile(filePath);
2794
- } else if (event === "change") {
2795
- ctx.project.reloadSourceFile(file);
2796
- await bundleStyles(ctx, filePath);
2797
- } else if (event === "add") {
2798
- ctx.project.createSourceFile(file);
2799
- await bundleStyles(ctx, filePath);
2800
- }
2801
- });
2802
- }
2803
- }
2804
-
2805
- // src/git-ignore.ts
2806
- init_cjs_shims();
2807
- var import_fs2 = require("fs");
2808
- var import_look_it_up = require("look-it-up");
2809
- var import_outdent = __toESM(require("outdent"));
2810
- function setupGitIgnore(ctx) {
2811
- const { outdir, gitignore } = ctx.config;
2812
- if (!gitignore) return;
2813
- const txt = import_outdent.default`
2814
-
2815
- ## Bamboo
2816
- ${outdir}
2817
- ${ctx.studio.outdir}
2818
- `;
2819
- const file = (0, import_look_it_up.lookItUpSync)(".gitignore");
2820
- if (!file) {
2821
- return (0, import_fs2.writeFileSync)(".gitignore", txt);
2822
- }
2823
- const content = (0, import_fs2.readFileSync)(file, "utf-8");
2824
- if (!content.includes(outdir)) {
2825
- (0, import_fs2.appendFileSync)(file, txt);
2826
- }
2827
- }
2828
-
2829
- // src/logstream.ts
2830
- init_cjs_shims();
2831
- var import_logger10 = require("@bamboocss/logger");
2832
- var import_node_fs3 = __toESM(require("fs"));
2833
- var import_node_path4 = __toESM(require("path"));
2834
- var setLogStream = (options) => {
2835
- const { cwd = process.cwd() } = options;
2836
- let stream;
2837
- if (options.logfile) {
2838
- const outPath = import_node_path4.default.resolve(cwd, options.logfile);
2839
- ensure(outPath);
2840
- import_logger10.logger.info("logfile", outPath);
2841
- stream = import_node_fs3.default.createWriteStream(outPath, { flags: "a" });
2842
- import_logger10.logger.onLog = (entry) => {
2843
- stream?.write(JSON.stringify(entry) + "\n");
2844
- };
2845
- }
2846
- process.once("SIGINT", () => {
2847
- stream?.end();
2848
- });
2849
- return {
2850
- end() {
2851
- stream?.end();
2852
- },
2853
- [Symbol.dispose]: () => {
2854
- stream?.end();
2855
- }
2856
- };
2857
- };
2858
- var ensure = (outPath) => {
2859
- const dirname2 = import_node_path4.default.dirname(outPath);
2860
- import_node_fs3.default.mkdirSync(dirname2, { recursive: true });
2861
- return outPath;
2862
- };
2863
-
2864
- // src/setup-config.ts
2865
- init_cjs_shims();
2866
- var import_config7 = require("@bamboocss/config");
2867
- var import_core = require("@bamboocss/core");
2868
- var import_logger11 = require("@bamboocss/logger");
2869
- var import_shared3 = require("@bamboocss/shared");
2870
- var import_fs_extra2 = __toESM(require("fs-extra"));
2871
- var import_look_it_up2 = require("look-it-up");
2872
- var import_outdent2 = require("outdent");
2873
- var import_path6 = require("path");
2874
- var import_child_process = require("child_process");
2875
- async function setupConfig(cwd, opts = {}) {
2876
- const { force, outExtension, jsxFramework, syntax, outdir = "styled-system" } = opts;
2877
- let configFile;
2878
- try {
2879
- configFile = (0, import_config7.findConfig)({ cwd });
2880
- } catch (err) {
2881
- if (!(err instanceof import_shared3.BambooError)) {
2882
- throw err;
2883
- }
2884
- }
2885
- const { detect } = await import("package-manager-detector");
2886
- const pmResult = await detect({ cwd });
2887
- const pm = (pmResult?.agent ?? "npm").split("@")[0];
2888
- const cmd = pm === "npm" ? "npm run" : pm;
2889
- const isTs = (0, import_look_it_up2.lookItUpSync)("tsconfig.json", cwd);
2890
- const file = isTs ? "bamboo.config.ts" : "bamboo.config.mjs";
2891
- import_logger11.logger.info("init:config", `creating bamboo config file: ${(0, import_logger11.quote)(file)}`);
2892
- if (!force && configFile) {
2893
- import_logger11.logger.warn("init:config", import_core.messages.configExists(cmd));
2894
- } else {
2895
- const content = import_outdent2.outdent`
2896
- import { defineConfig } from "@bamboocss/dev"
2897
-
2898
- export default defineConfig({
2899
- // Whether to use css reset
2900
- preflight: true,
2901
- ${outExtension ? `
2902
- // The extension for the emitted JavaScript files
2903
- outExtension: '${outExtension}',` : ""}
2904
- // Where to look for your css declarations
2905
- include: ["./src/**/*.{js,jsx,ts,tsx}", "./pages/**/*.{js,jsx,ts,tsx}"],
2906
-
2907
- // Files to exclude
2908
- exclude: [],
2909
-
2910
- // Useful for theme customization
2911
- theme: {
2912
- extend: {}
2913
- },
2914
-
2915
- // The output directory for your css system
2916
- outdir: ${JSON.stringify(outdir)},
2917
- ${jsxFramework ? `
2918
- // The JSX framework to use
2919
- jsxFramework: '${jsxFramework}',` : ""}
2920
- ${syntax ? `
2921
- // The CSS Syntax to use to use
2922
- syntax: '${syntax}'` : ""}
2923
- })
2924
- `;
2925
- const filePath = (0, import_path6.join)(cwd, file);
2926
- await import_fs_extra2.default.writeFile(filePath, content);
2927
- try {
2928
- (0, import_child_process.execFileSync)("oxfmt", [filePath], { stdio: "ignore" });
2929
- } catch {
2930
- }
2931
- import_logger11.logger.log(import_core.messages.thankYou());
2932
- }
2933
- }
2934
- async function setupPostcss(cwd) {
2935
- import_logger11.logger.info("init:postcss", `creating postcss config file: ${(0, import_logger11.quote)("postcss.config.cjs")}`);
2936
- const content = import_outdent2.outdent`
2937
- module.exports = {
2938
- plugins: {
2939
- '@bamboocss/dev/postcss': {},
2940
- },
2941
- }
2942
- `;
2943
- await import_fs_extra2.default.writeFile((0, import_path6.join)(cwd, "postcss.config.cjs"), content);
2944
- }
2945
-
2946
- // src/spec.ts
2947
- init_cjs_shims();
2948
- var import_logger12 = require("@bamboocss/logger");
2949
- async function spec(ctx, options) {
2950
- const { outdir } = options;
2951
- const specs = ctx.getSpec();
2952
- const specDir = outdir ? [ctx.config.cwd, outdir] : ctx.paths.specs;
2953
- const specDirPath = ctx.runtime.path.join(...specDir);
2954
- const writeSpec = async (spec2) => {
2955
- await ctx.output.write({
2956
- id: `spec-${spec2.type}`,
2957
- dir: specDir,
2958
- files: [{ file: `${spec2.type}.json`, code: JSON.stringify(spec2, null, 2) }]
2959
- });
2960
- };
2961
- await Promise.all(specs.map(writeSpec));
2962
- const specTypes = specs.map((s) => s.type);
2963
- import_logger12.logger.info("spec", `Generated ${specTypes.length} spec file(s) \u2192 ${specDirPath}`);
2964
- return specs;
2965
- }
2966
- // Annotate the CommonJS export names for ESM import in node:
2967
- 0 && (module.exports = {
2968
- BambooContext,
2969
- Builder,
2970
- analyze,
2971
- buildInfo,
2972
- codegen,
2973
- cssgen,
2974
- debug,
2975
- generate,
2976
- loadConfigAndCreateContext,
2977
- parseDependency,
2978
- setLogStream,
2979
- setupConfig,
2980
- setupGitIgnore,
2981
- setupPostcss,
2982
- spec,
2983
- startProfiling
2984
- });