@pandacss/node 0.0.0-dev-20230205182145 → 0.0.0-dev-20230206074851

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/dist/index.d.ts +36 -339
  2. package/dist/index.js +1866 -2256
  3. package/dist/index.mjs +1873 -2236
  4. package/package.json +14 -12
package/dist/index.mjs CHANGED
@@ -1,2223 +1,1896 @@
1
- // src/index.ts
2
- import { discardDuplicate as discardDuplicate2 } from "@pandacss/core";
3
-
4
- // src/chunks.ts
5
- import { Stylesheet } from "@pandacss/core";
6
- import { logger as logger2 } from "@pandacss/logger";
7
-
8
- // src/extract.ts
9
- import { logger, quote } from "@pandacss/logger";
10
- function extractFile(ctx, file) {
11
- logger.debug("file:extract", file);
12
- let data;
13
- let result;
14
- const done = logger.time.debug(`Extracted ${quote(file)}`);
15
- try {
16
- data = ctx.project.parseSourceFile(ctx.absPath(file));
17
- } catch (error) {
18
- logger.error("file:parse", error);
19
- }
20
- if (data) {
21
- result = ctx.getCss(data, file);
22
- }
23
- if (result) {
24
- done();
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __esm = (fn, res) => function __init() {
8
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
+ };
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
18
  }
26
- return result;
27
- }
28
- function extractFiles(ctx) {
29
- return ctx.extract(async (file) => {
30
- const result = extractFile(ctx, file);
31
- if (result) {
32
- await ctx.chunks.write(file, result.css);
33
- return result;
34
- }
35
- });
36
- }
37
- function extractGlobalCss(ctx) {
38
- const css3 = ctx.getGlobalCss();
39
- if (!css3)
40
- return;
41
- return ctx.chunks.write("system/global.css", css3);
42
- }
43
- function extractStaticCss(ctx) {
44
- const css3 = ctx.getStaticCss();
45
- if (!css3)
46
- return;
47
- return ctx.chunks.write("system/static.css", css3);
48
- }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
49
25
 
50
- // src/chunks.ts
51
- async function extractChunks(ctx) {
52
- const sheet = new Stylesheet(ctx.context(), {
53
- content: [
54
- "@layer reset, base, tokens, recipes, utilities;",
55
- "@import './layout-grid.css';",
56
- ctx.preflight && "@import './reset.css';",
57
- !ctx.tokens.isEmpty && "@import './tokens/index.css';",
58
- ctx.theme.keyframes && "@import './tokens/keyframes.css';"
59
- ].filter(Boolean).join("\n\n")
60
- });
61
- const files = ctx.chunks.getFiles();
62
- await Promise.all(
63
- files.map(async (file) => {
64
- const css3 = await ctx.chunks.readFile(file);
65
- sheet.append(css3);
66
- })
67
- );
68
- return sheet.toCss({ minify: ctx.minify });
69
- }
70
- async function bundleChunks(ctx) {
71
- const css3 = await extractChunks(ctx);
72
- await ctx.write(ctx.paths.root, [{ file: "styles.css", code: css3 }]);
73
- }
74
- async function writeFileChunk(ctx, file) {
75
- logger2.info("chunk:change", `File changed: ${file}`);
76
- const result = extractFile(ctx, file);
77
- if (result) {
78
- await ctx.chunks.write(result.file, result.css);
26
+ // ../../node_modules/.pnpm/tsup@6.5.0_typescript@4.9.5/node_modules/tsup/assets/esm_shims.js
27
+ var init_esm_shims = __esm({
28
+ "../../node_modules/.pnpm/tsup@6.5.0_typescript@4.9.5/node_modules/tsup/assets/esm_shims.js"() {
79
29
  }
80
- }
81
-
82
- // src/generators/index.ts
83
- import { readFileSync as readFileSync3 } from "fs";
84
- import outdent24 from "outdent";
30
+ });
85
31
 
86
- // src/generators/conditions.ts
87
- import outdent from "outdent";
88
- function generateConditions(ctx) {
89
- const keys = Object.keys(ctx.conditions.values).concat("base");
90
- return {
91
- js: outdent`
92
- ${ctx.getImport("withoutSpace", "../helpers")}
93
-
94
- const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
95
-
96
- export function isCondition(value){
97
- return conditions.has(value) || /^@|&|&$/.test(value)
32
+ // ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js
33
+ var require_eastasianwidth = __commonJS({
34
+ "../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
35
+ init_esm_shims();
36
+ var eaw = {};
37
+ if ("undefined" == typeof module) {
38
+ window.eastasianwidth = eaw;
39
+ } else {
40
+ module.exports = eaw;
98
41
  }
99
-
100
- export function finalizeConditions(paths){
101
- return paths.map((path) => {
102
- if (conditions.has(path)){
103
- return path.replace(/^_/, '')
104
- }
105
-
106
- if (/&|@/.test(path)){
107
- return \`[\${withoutSpace(path.trim())}]\`
108
- }
109
-
110
- return path
111
- })}
112
-
113
- export function sortConditions(paths){
114
- return paths.sort((a, b) => {
115
- const aa = isCondition(a)
116
- const bb = isCondition(b)
117
- if (aa && !bb) return 1
118
- if (!aa && bb) return -1
119
- return 0
120
- })
42
+ eaw.eastAsianWidth = function(character) {
43
+ var x = character.charCodeAt(0);
44
+ var y = character.length == 2 ? character.charCodeAt(1) : 0;
45
+ var codePoint = x;
46
+ if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
47
+ x &= 1023;
48
+ y &= 1023;
49
+ codePoint = x << 10 | y;
50
+ codePoint += 65536;
51
+ }
52
+ if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
53
+ return "F";
121
54
  }
122
- `,
123
- dts: outdent`
124
- import type { AnySelector, Selectors } from './selectors'
125
-
126
- export type Conditions = {
127
- ${keys.map((key) => ` ${JSON.stringify(key)}: string`).join("\n")}
55
+ if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
56
+ return "H";
57
+ }
58
+ if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
59
+ return "W";
60
+ }
61
+ if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
62
+ return "Na";
63
+ }
64
+ if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
65
+ return "A";
66
+ }
67
+ return "N";
68
+ };
69
+ eaw.characterLength = function(character) {
70
+ var code = this.eastAsianWidth(character);
71
+ if (code == "F" || code == "W" || code == "A") {
72
+ return 2;
73
+ } else {
74
+ return 1;
75
+ }
76
+ };
77
+ function stringToArray(string) {
78
+ return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
128
79
  }
129
-
130
- export type Condition = keyof Conditions
131
-
132
- export type Conditional<V> =
133
- | V
134
- | Array<V | null>
135
- | {
136
- [K in keyof Conditions]?: Conditional<V>
80
+ eaw.length = function(string) {
81
+ var characters = stringToArray(string);
82
+ var len = 0;
83
+ for (var i = 0; i < characters.length; i++) {
84
+ len = len + this.characterLength(characters[i]);
85
+ }
86
+ return len;
87
+ };
88
+ eaw.slice = function(text, start, end) {
89
+ textLen = eaw.length(text);
90
+ start = start ? start : 0;
91
+ end = end ? end : 1;
92
+ if (start < 0) {
93
+ start = textLen + start;
94
+ }
95
+ if (end < 0) {
96
+ end = textLen + end;
97
+ }
98
+ var result = "";
99
+ var eawLen = 0;
100
+ var chars = stringToArray(text);
101
+ for (var i = 0; i < chars.length; i++) {
102
+ var char = chars[i];
103
+ var charLen = eaw.length(char);
104
+ if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
105
+ if (eawLen + charLen <= end) {
106
+ result += char;
107
+ } else {
108
+ break;
109
+ }
137
110
  }
138
-
139
- export type ConditionalValue<T> = Conditional<T>
140
-
141
- export type Nested<P> = P & {
142
- [K in Selectors]?: Nested<P>
143
- } & {
144
- [K in AnySelector]?: Nested<P>
145
- } & {
146
- [K in keyof Conditions]?: Nested<P>
147
- }
148
-
149
- `
150
- };
151
- }
152
-
153
- // src/generators/css-fn.ts
154
- import { outdent as outdent2 } from "outdent";
155
- var stringify = (v) => JSON.stringify(Object.fromEntries(v), null, 2);
156
- function generateCssFn(ctx) {
157
- const { utility, hash, conditions } = ctx;
158
- const { separator } = utility;
159
- return {
160
- dts: outdent2`
161
- import type { SystemStyleObject } from '../types'
162
- export declare function css(styles: SystemStyleObject): string
163
- `,
164
- js: outdent2`
165
- ${ctx.getImport("createCss, createMergeCss, hypenateProperty, withoutSpace", "../helpers")}
166
- ${ctx.getImport("sortConditions, finalizeConditions", "./conditions")}
167
-
168
- const classNameMap = ${stringify(utility.entries())}
169
-
170
- const shorthands = ${stringify(utility.shorthands)}
171
-
172
- const breakpointKeys = ${JSON.stringify(conditions.breakpoints.keys)}
173
-
174
- const hasShorthand = ${utility.hasShorthand ? "true" : "false"}
175
-
176
- const resolveShorthand = (prop) => shorthands[prop] || prop
111
+ eawLen += charLen;
112
+ }
113
+ return result;
114
+ };
115
+ }
116
+ });
177
117
 
178
- function transform(prop, value) {
179
- const key = resolveShorthand(prop)
180
- const propKey = classNameMap[key] || hypenateProperty(key)
181
- const className = \`$\{propKey}${separator}$\{withoutSpace(value)}\`
182
- return { className }
183
- }
118
+ // ../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js
119
+ var require_emoji_regex = __commonJS({
120
+ "../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports, module) {
121
+ "use strict";
122
+ init_esm_shims();
123
+ module.exports = function() {
124
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
125
+ };
126
+ }
127
+ });
184
128
 
185
- const context = {
186
- hash: ${hash ? "true" : "false"},
187
- conditions: {
188
- shift: sortConditions,
189
- finalize: finalizeConditions,
190
- breakpoints: { keys: breakpointKeys }
129
+ // ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
130
+ var require_boxes = __commonJS({
131
+ "../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json"(exports, module) {
132
+ module.exports = {
133
+ single: {
134
+ topLeft: "\u250C",
135
+ top: "\u2500",
136
+ topRight: "\u2510",
137
+ right: "\u2502",
138
+ bottomRight: "\u2518",
139
+ bottom: "\u2500",
140
+ bottomLeft: "\u2514",
141
+ left: "\u2502"
142
+ },
143
+ double: {
144
+ topLeft: "\u2554",
145
+ top: "\u2550",
146
+ topRight: "\u2557",
147
+ right: "\u2551",
148
+ bottomRight: "\u255D",
149
+ bottom: "\u2550",
150
+ bottomLeft: "\u255A",
151
+ left: "\u2551"
152
+ },
153
+ round: {
154
+ topLeft: "\u256D",
155
+ top: "\u2500",
156
+ topRight: "\u256E",
157
+ right: "\u2502",
158
+ bottomRight: "\u256F",
159
+ bottom: "\u2500",
160
+ bottomLeft: "\u2570",
161
+ left: "\u2502"
162
+ },
163
+ bold: {
164
+ topLeft: "\u250F",
165
+ top: "\u2501",
166
+ topRight: "\u2513",
167
+ right: "\u2503",
168
+ bottomRight: "\u251B",
169
+ bottom: "\u2501",
170
+ bottomLeft: "\u2517",
171
+ left: "\u2503"
191
172
  },
192
- utility: {
193
- prefix: ${ctx.prefix ? JSON.stringify(ctx.prefix) : void 0},
194
- transform,
195
- hasShorthand,
196
- resolveShorthand,
173
+ singleDouble: {
174
+ topLeft: "\u2553",
175
+ top: "\u2500",
176
+ topRight: "\u2556",
177
+ right: "\u2551",
178
+ bottomRight: "\u255C",
179
+ bottom: "\u2500",
180
+ bottomLeft: "\u2559",
181
+ left: "\u2551"
182
+ },
183
+ doubleSingle: {
184
+ topLeft: "\u2552",
185
+ top: "\u2550",
186
+ topRight: "\u2555",
187
+ right: "\u2502",
188
+ bottomRight: "\u255B",
189
+ bottom: "\u2550",
190
+ bottomLeft: "\u2558",
191
+ left: "\u2502"
192
+ },
193
+ classic: {
194
+ topLeft: "+",
195
+ top: "-",
196
+ topRight: "+",
197
+ right: "|",
198
+ bottomRight: "+",
199
+ bottom: "-",
200
+ bottomLeft: "+",
201
+ left: "|"
202
+ },
203
+ arrow: {
204
+ topLeft: "\u2198",
205
+ top: "\u2193",
206
+ topRight: "\u2199",
207
+ right: "\u2190",
208
+ bottomRight: "\u2196",
209
+ bottom: "\u2191",
210
+ bottomLeft: "\u2197",
211
+ left: "\u2192"
197
212
  }
198
- }
213
+ };
214
+ }
215
+ });
199
216
 
200
- export const css = createCss(context)
217
+ // ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js
218
+ var require_cli_boxes = __commonJS({
219
+ "../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js"(exports, module) {
220
+ "use strict";
221
+ init_esm_shims();
222
+ var cliBoxes2 = require_boxes();
223
+ module.exports = cliBoxes2;
224
+ module.exports.default = cliBoxes2;
225
+ }
226
+ });
201
227
 
202
- export const { mergeCss, assignCss } = createMergeCss(context)
203
- `
204
- };
205
- }
228
+ // ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
229
+ var require_ansi_regex = __commonJS({
230
+ "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module) {
231
+ "use strict";
232
+ init_esm_shims();
233
+ module.exports = ({ onlyFirst = false } = {}) => {
234
+ const pattern = [
235
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
236
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
237
+ ].join("|");
238
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
239
+ };
240
+ }
241
+ });
206
242
 
207
- // src/generators/cva.ts
208
- import { outdent as outdent3 } from "outdent";
209
- function generateCvaFn(ctx) {
210
- return {
211
- js: outdent3`
212
- ${ctx.getImport("compact", "../helpers")}
213
- ${ctx.getImport("css, mergeCss", "./css")}
214
-
215
- export function cva(config) {
216
- const { base = {}, variants = {}, defaultVariants = {} } = config
217
-
218
- function resolve(props) {
219
- const computedVariants = { ...defaultVariants, ...compact(props) }
220
- let result = { ...base }
221
- for (const [key, value] of Object.entries(computedVariants)) {
222
- if (variants[key]?.[value]) {
223
- result = mergeCss(result, variants[key][value])
224
- }
225
- }
226
- return result
227
- }
243
+ // ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
244
+ var require_strip_ansi = __commonJS({
245
+ "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module) {
246
+ "use strict";
247
+ init_esm_shims();
248
+ var ansiRegex2 = require_ansi_regex();
249
+ module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
250
+ }
251
+ });
228
252
 
229
- function cvaFn(props) {
230
- return css(resolve(props))
253
+ // ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
254
+ var require_is_fullwidth_code_point = __commonJS({
255
+ "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports, module) {
256
+ "use strict";
257
+ init_esm_shims();
258
+ var isFullwidthCodePoint = (codePoint) => {
259
+ if (Number.isNaN(codePoint)) {
260
+ return false;
231
261
  }
262
+ if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) {
263
+ return true;
264
+ }
265
+ return false;
266
+ };
267
+ module.exports = isFullwidthCodePoint;
268
+ module.exports.default = isFullwidthCodePoint;
269
+ }
270
+ });
232
271
 
233
- return Object.assign(cvaFn, {
234
- __cva__: true,
235
- variants: Object.keys(variants),
236
- resolve,
237
- config,
238
- })
239
- }
240
- `,
241
- dts: outdent3`
242
- import type { RecipeCreatorFn } from '../types/recipe'
243
-
244
- export declare const cva: RecipeCreatorFn
245
-
246
- `
247
- };
248
- }
272
+ // ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
273
+ var require_emoji_regex2 = __commonJS({
274
+ "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports, module) {
275
+ "use strict";
276
+ init_esm_shims();
277
+ module.exports = function() {
278
+ 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;
279
+ };
280
+ }
281
+ });
249
282
 
250
- // src/generators/cx.ts
251
- import outdent4 from "outdent";
252
- function generateCx() {
253
- return {
254
- js: outdent4`
255
- function cx() {
256
- let str = '',
257
- i = 0,
258
- arg
259
-
260
- for (; i < arguments.length; ) {
261
- if ((arg = arguments[i++]) && typeof arg === 'string') {
262
- str && (str += ' ')
263
- str += arg
283
+ // ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
284
+ var require_string_width = __commonJS({
285
+ "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module) {
286
+ "use strict";
287
+ init_esm_shims();
288
+ var stripAnsi2 = require_strip_ansi();
289
+ var isFullwidthCodePoint = require_is_fullwidth_code_point();
290
+ var emojiRegex2 = require_emoji_regex2();
291
+ var stringWidth2 = (string) => {
292
+ if (typeof string !== "string" || string.length === 0) {
293
+ return 0;
294
+ }
295
+ string = stripAnsi2(string);
296
+ if (string.length === 0) {
297
+ return 0;
298
+ }
299
+ string = string.replace(emojiRegex2(), " ");
300
+ let width = 0;
301
+ for (let i = 0; i < string.length; i++) {
302
+ const code = string.codePointAt(i);
303
+ if (code <= 31 || code >= 127 && code <= 159) {
304
+ continue;
264
305
  }
306
+ if (code >= 768 && code <= 879) {
307
+ continue;
308
+ }
309
+ if (code > 65535) {
310
+ i++;
311
+ }
312
+ width += isFullwidthCodePoint(code) ? 2 : 1;
265
313
  }
266
- return str
267
- }
268
-
269
- export { cx }
270
- `,
271
- dts: outdent4`
272
- type Argument = string | boolean | null | undefined
273
-
274
- /** Conditionally join classNames into a single string */
275
- export declare function cx(...args: Argument[]): string
276
- `
277
- };
278
- }
279
-
280
- // src/generators/get-entrypoint.ts
281
- import { createRequire } from "module";
282
- import { dirname, join } from "path";
283
- var req = typeof globalThis.require === "function" ? globalThis.require : createRequire(import.meta.url);
284
- function getEntrypoint(pkg, file) {
285
- const { dev, prod = dev } = file;
286
- const entry = req.resolve(pkg);
287
- const isDist = entry.includes("dist");
288
- const isType = pkg.includes("/types");
289
- if (isType) {
290
- return join(dirname(entry), dev);
291
- }
292
- if (!isDist) {
293
- return join(dirname(entry), "src", dev);
294
- }
295
- return join(dirname(entry), prod);
296
- }
297
-
298
- // src/generators/is-valid-prop.ts
299
- import { readFileSync } from "fs";
300
- function generateisValidProp(ctx) {
301
- const filePath = getEntrypoint("@pandacss/is-valid-prop", { dev: "index.ts", prod: "index.mjs" });
302
- let content = readFileSync(filePath, "utf8");
303
- content = content.replace(
304
- "var userGenerated = []",
305
- `var userGenerated = [${ctx.properties.map((key) => JSON.stringify(key)).join(",")}]`
306
- );
307
- return {
308
- js: content
309
- };
310
- }
311
-
312
- // src/generators/jsx/preact-jsx.ts
313
- import { outdent as outdent5 } from "outdent";
314
- function generatePreactJsxFactory(ctx) {
315
- const { name, componentName } = ctx.jsxFactoryDetails;
316
- return {
317
- js: outdent5`
318
- import { h } from 'preact'
319
- import { forwardRef } from 'preact/compat'
320
- import { useMemo } from 'preact/hooks'
321
- ${ctx.getImport("css, cx, assignCss", "../css/index")}
322
- ${ctx.getImport("splitProps, normalizeHTMLProps", "../helpers")}
323
- ${ctx.getImport("isCssProperty", "./is-valid-prop")}
324
-
325
- function styled(Dynamic, configOrCva = {}) {
326
- const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
327
-
328
- const ${componentName} = forwardRef(function ${componentName}(props, ref) {
329
- const { as: Element = Dynamic, ...restProps } = props
314
+ return width;
315
+ };
316
+ module.exports = stringWidth2;
317
+ module.exports.default = stringWidth2;
318
+ }
319
+ });
330
320
 
331
- const [styleProps, variantProps, htmlProps, elementProps] = useMemo(() => {
332
- return splitProps(restProps, isCssProperty, cvaFn.variants, normalizeHTMLProps.keys)
333
- }, [restProps])
334
-
335
- function classes() {
336
- const { css: cssStyles, ...propStyles } = styleProps
337
- const cvaStyles = cvaFn.resolve(variantProps)
338
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
339
- return cx(css(styles), elementProps.className)
340
- }
341
-
342
- return h(Element, {
343
- ...elementProps,
344
- ...normalizeHTMLProps(htmlProps),
345
- ref,
346
- className: classes()
347
- })
348
- })
349
-
350
- ${componentName}.displayName = \`${name}.\${Dynamic}\`
351
- return ${componentName}
321
+ // ../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js
322
+ var require_ansi_align = __commonJS({
323
+ "../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js"(exports, module) {
324
+ "use strict";
325
+ init_esm_shims();
326
+ var stringWidth2 = require_string_width();
327
+ function ansiAlign2(text, opts) {
328
+ if (!text)
329
+ return text;
330
+ opts = opts || {};
331
+ const align = opts.align || "center";
332
+ if (align === "left")
333
+ return text;
334
+ const split = opts.split || "\n";
335
+ const pad = opts.pad || " ";
336
+ const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
337
+ let returnString = false;
338
+ if (!Array.isArray(text)) {
339
+ returnString = true;
340
+ text = String(text).split(split);
341
+ }
342
+ let width;
343
+ let maxWidth = 0;
344
+ text = text.map(function(str) {
345
+ str = String(str);
346
+ width = stringWidth2(str);
347
+ maxWidth = Math.max(width, maxWidth);
348
+ return {
349
+ str,
350
+ width
351
+ };
352
+ }).map(function(obj) {
353
+ return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str;
354
+ });
355
+ return returnString ? text.join(split) : text;
352
356
  }
353
-
354
- function createJsxFactory() {
355
- const cache = new Map()
356
-
357
- return new Proxy(styled, {
358
- apply(_, __, args) {
359
- return styled(...args)
360
- },
361
- get(_, el) {
362
- if (!cache.has(el)) {
363
- cache.set(el, styled(el))
364
- }
365
- return cache.get(el)
366
- },
367
- })
357
+ ansiAlign2.left = function left(text) {
358
+ return ansiAlign2(text, { align: "left" });
359
+ };
360
+ ansiAlign2.center = function center(text) {
361
+ return ansiAlign2(text, { align: "center" });
362
+ };
363
+ ansiAlign2.right = function right(text) {
364
+ return ansiAlign2(text, { align: "right" });
365
+ };
366
+ module.exports = ansiAlign2;
367
+ function halfDiff(maxWidth, curWidth) {
368
+ return Math.floor((maxWidth - curWidth) / 2);
369
+ }
370
+ function fullDiff(maxWidth, curWidth) {
371
+ return maxWidth - curWidth;
368
372
  }
373
+ }
374
+ });
369
375
 
370
- export const ${name} = createJsxFactory()
371
- `
372
- };
373
- }
376
+ // src/index.ts
377
+ init_esm_shims();
378
+ import { discardDuplicate as discardDuplicate2 } from "@pandacss/core";
374
379
 
375
- // src/generators/jsx/preact-layout-grid.ts
376
- import { outdent as outdent6 } from "outdent";
377
- function generatePreactLayoutGrid() {
378
- return {
379
- dts: outdent6`
380
- import { FunctionComponent } from 'preact'
380
+ // src/builder.ts
381
+ init_esm_shims();
382
+ import { discardDuplicate, mergeCss as mergeCss2 } from "@pandacss/core";
383
+ import { ConfigNotFoundError } from "@pandacss/error";
384
+ import { logger as logger3 } from "@pandacss/logger";
385
+ import { toHash } from "@pandacss/shared";
386
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
387
+ import { statSync } from "fs-extra";
388
+ import { resolve as resolve2 } from "path";
381
389
 
382
- export type LayoutGridProps = {
383
- count?: number
384
- gutter?: string
385
- maxWidth?: string
386
- margin?: string
387
- outline?: boolean
388
- }
390
+ // src/config.ts
391
+ init_esm_shims();
392
+ import { loadConfigFile } from "@pandacss/config";
393
+ import { lookItUpSync } from "look-it-up";
389
394
 
390
- export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
391
- `,
392
- js: outdent6`
393
- import { h } from 'preact'
395
+ // src/create-context.ts
396
+ init_esm_shims();
397
+ import { createGenerator } from "@pandacss/generator";
398
+ import { createProject } from "@pandacss/parser";
399
+ import { Obj, pipe, tap } from "lil-fp";
400
+
401
+ // src/chunk-engine.ts
402
+ init_esm_shims();
403
+ import { mergeCss } from "@pandacss/core";
404
+ var getChunkEngine = ({ paths, config, runtime: { path, fs } }) => ({
405
+ dir: path.join(...paths.chunk),
406
+ readFile(file) {
407
+ const fileName = path.join(...paths.chunk, this.format(file));
408
+ return fs.existsSync(fileName) ? fs.readFileSync(fileName) : "";
409
+ },
410
+ getFiles() {
411
+ const files = fs.existsSync(this.dir) ? fs.readDirSync(this.dir) : [];
412
+ return files.map((file) => fs.readFileSync(path.join(this.dir, file)));
413
+ },
414
+ format(file) {
415
+ return path.relative(config.cwd, file).replaceAll(path.sep, "__").replace(path.extname(file), ".css");
416
+ },
417
+ getArtifact(file, css) {
418
+ const fileName = this.format(file);
419
+ const newCss = mergeCss(this.readFile(file), css);
420
+ return {
421
+ dir: paths.chunk,
422
+ files: [{ file: fileName, code: newCss }]
423
+ };
424
+ },
425
+ rm(file) {
426
+ return fs.rmFileSync(path.join(...paths.chunk, this.format(file)));
427
+ },
428
+ empty() {
429
+ return fs.rmDirSync(this.dir);
430
+ },
431
+ get glob() {
432
+ return [`${this.dir}/**/*.css`];
433
+ }
434
+ });
394
435
 
395
- export function LayoutGrid(props) {
396
- const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
397
- const hasMaxWidth = maxWidth != null
398
- return h('div', {
399
- className: 'panda-layout-grid',
400
- style: {
401
- '--gutter': gutter,
402
- '--count': count,
403
- '--max-width': hasMaxWidth ? maxWidth : 'initial',
404
- '--margin-x': hasMaxWidth ? 'auto' : undefined,
405
- '--padding-x': !hasMaxWidth ? margin : undefined,
406
- },
407
- children: Array.from({ length: count }).map((_, i) =>
408
- h('span', {
409
- 'data-variant': outline ? 'outline' : 'bg',
410
- key: i,
411
- className: 'panda-layout-grid__item',
412
- }),
413
- ),
436
+ // src/node-runtime.ts
437
+ init_esm_shims();
438
+ import { logger } from "@pandacss/logger";
439
+ import chokidar from "chokidar";
440
+ import glob from "fast-glob";
441
+ import {
442
+ emptyDirSync,
443
+ ensureDirSync,
444
+ existsSync,
445
+ readdirSync,
446
+ readFileSync,
447
+ removeSync,
448
+ writeFile,
449
+ writeFileSync
450
+ } from "fs-extra";
451
+ import { dirname, extname, isAbsolute, join, relative, sep } from "path";
452
+ var nodeRuntime = {
453
+ cwd() {
454
+ return process.cwd();
455
+ },
456
+ env(name) {
457
+ return process.env[name];
458
+ },
459
+ path: {
460
+ join,
461
+ relative,
462
+ dirname,
463
+ extname,
464
+ isAbsolute,
465
+ sep,
466
+ abs(cwd, str) {
467
+ return isAbsolute(str) ? str : join(cwd, str);
468
+ }
469
+ },
470
+ fs: {
471
+ existsSync,
472
+ readFileSync(filePath) {
473
+ return readFileSync(filePath, "utf8");
474
+ },
475
+ glob(opts) {
476
+ if (!opts.include)
477
+ return [];
478
+ return glob.sync(opts.include, { cwd: opts.cwd, ignore: opts.exclude, absolute: true });
479
+ },
480
+ writeFile,
481
+ writeFileSync,
482
+ readDirSync: readdirSync,
483
+ rmDirSync: emptyDirSync,
484
+ rmFileSync: removeSync,
485
+ ensureDirSync(path) {
486
+ return ensureDirSync(path);
487
+ },
488
+ watch(options) {
489
+ const { include, exclude, cwd, poll } = options;
490
+ const coalesce = poll || process.platform === "win32";
491
+ const watcher = chokidar.watch(include, {
492
+ usePolling: poll,
493
+ cwd,
494
+ ignoreInitial: true,
495
+ ignorePermissionErrors: true,
496
+ ignored: exclude,
497
+ awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
414
498
  });
499
+ logger.debug("watch:file", `watching [${include}]`);
500
+ process.once("SIGINT", async () => {
501
+ await watcher.close();
502
+ });
503
+ return watcher;
415
504
  }
416
- `
417
- };
418
- }
419
-
420
- // src/generators/jsx/preact-pattern.ts
421
- import { outdent as outdent7 } from "outdent";
422
- import { match } from "ts-pattern";
423
- function generate(ctx, name, pattern) {
424
- const { upperName, styleFn, dashName, jsxName, props, blocklistType } = ctx.getPatternDetails(name, pattern);
425
- const { typeName } = ctx.jsxFactoryDetails;
426
- return {
427
- name: dashName,
428
- js: outdent7`
429
- import { h } from 'preact'
430
- import { forwardRef } from 'preact/compat'
431
- ${ctx.getImport(ctx.jsxFactory, "./factory")}
432
- ${ctx.getImport(styleFn, `../patterns/${dashName}`)}
505
+ }
506
+ };
507
+ process.setMaxListeners(Infinity);
508
+ process.on("unhandledRejection", (reason) => {
509
+ logger.error("unhandled-rejection", reason);
510
+ });
511
+ process.on("uncaughtException", (reason) => {
512
+ logger.error("uncaught-exception", reason);
513
+ });
433
514
 
434
- export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
435
- ${match(props.length).with(
436
- 0,
437
- () => outdent7`
438
- return h(${ctx.jsxFactory}.div, { ref, ...props })
439
- `
440
- ).otherwise(
441
- () => outdent7`
442
- const { ${props.join(", ")}, ...restProps } = props
443
- const styleProps = ${styleFn}({${props.join(", ")}})
444
- return h(${ctx.jsxFactory}.div, { ref, ...styleProps, ...restProps })
445
- `
446
- )}
447
- })
448
- `,
449
- dts: outdent7`
450
- import type { FunctionComponent } from 'preact'
451
- import type { ${upperName}Properties } from '../patterns/${dashName}'
452
- import type { ${typeName} } from '../types/jsx'
515
+ // src/output-engine.ts
516
+ init_esm_shims();
517
+ var getOutputEngine = ({ paths, runtime: { path, fs } }) => ({
518
+ empty() {
519
+ fs.rmDirSync(path.join(...paths.root));
520
+ },
521
+ async write(output) {
522
+ if (!output)
523
+ return;
524
+ const { dir = paths.root, files } = output;
525
+ fs.ensureDirSync(path.join(...dir));
526
+ return Promise.all(
527
+ files.map(async ({ file, code }) => {
528
+ const absPath = path.join(...dir, file);
529
+ if (code) {
530
+ return fs.writeFile(absPath, code);
531
+ }
532
+ })
533
+ );
534
+ }
535
+ });
453
536
 
454
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
537
+ // src/create-context.ts
538
+ var createContext = (conf) => pipe(
539
+ conf,
540
+ createGenerator,
541
+ Obj.assign({ runtime: nodeRuntime }),
542
+ tap(({ config, runtime }) => {
543
+ config.cwd ||= runtime.cwd();
544
+ }),
545
+ Obj.bind("getFiles", ({ config, runtime: { fs } }) => () => {
546
+ const { include, exclude, cwd } = config;
547
+ return fs.glob({ include, exclude, cwd });
548
+ }),
549
+ Obj.bind("project", ({ getFiles, runtime: { fs }, parserOptions }) => {
550
+ return createProject({
551
+ getFiles,
552
+ readFile: fs.readFileSync,
553
+ parserOptions
554
+ });
555
+ }),
556
+ Obj.bind("chunks", getChunkEngine),
557
+ Obj.bind("output", getOutputEngine)
558
+ );
455
559
 
456
- ${pattern.description ? `/** ${pattern.description} */` : ""}
457
- export declare const ${jsxName}: FunctionComponent<${upperName}Props>
458
- `
459
- };
560
+ // src/config.ts
561
+ var configs = [".ts", ".js", ".mjs", ".cjs"];
562
+ function findConfig() {
563
+ for (const config of configs) {
564
+ const result = lookItUpSync(`panda.config${config}`);
565
+ if (result) {
566
+ return result;
567
+ }
568
+ }
460
569
  }
461
- function generatePreactJsxPattern(ctx) {
462
- return Object.entries(ctx.patterns).map(([name, pattern]) => generate(ctx, name, pattern));
570
+ async function loadConfigAndCreateContext(options = {}) {
571
+ const { cwd = process.cwd(), config, configPath } = options;
572
+ const conf = await loadConfigFile({ cwd, file: configPath });
573
+ if (config) {
574
+ Object.assign(conf.config, config);
575
+ }
576
+ return createContext(conf);
463
577
  }
464
578
 
465
- // src/generators/jsx/preact-types.ts
466
- import { outdent as outdent8 } from "outdent";
467
- function generatePreactJsxTypes(ctx) {
468
- const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
469
- return {
470
- jsxFactory: outdent8`
471
- import type { ${upperName} } from '../types/jsx'
472
- export declare const ${name}: ${upperName}
473
- `,
474
- jsxType: outdent8`
475
- import type { JSX, ComponentProps } from 'preact'
476
- import type { JsxStyleProps, Assign } from '.'
477
- import type { RecipeDefinition, RecipeRuntimeFn, RecipeSelection, RecipeVariantRecord } from './recipe'
579
+ // src/extract.ts
580
+ init_esm_shims();
581
+ import { logger as logger2 } from "@pandacss/logger";
582
+ import { Obj as Obj2, pipe as pipe2, tap as tap2 } from "lil-fp";
478
583
 
479
- type Dict = Record<string, unknown>
480
- type ElementType = keyof JSX.IntrinsicElements
584
+ // src/cli-box.ts
585
+ init_esm_shims();
481
586
 
482
- type HTMLProps = {
483
- htmlSize?: string | number
484
- htmlWidth?: string | number
485
- htmlHeight?: string | number
486
- htmlTranslate?: 'yes' | 'no' | undefined
487
- }
587
+ // ../../node_modules/.pnpm/boxen@7.0.1/node_modules/boxen/index.js
588
+ init_esm_shims();
589
+ import process3 from "node:process";
488
590
 
489
- type Polyfill<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps
591
+ // ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
592
+ init_esm_shims();
490
593
 
491
- type Props<T extends Dict, P extends Dict = {}> = Assign<Polyfill<T>, P>
594
+ // ../../node_modules/.pnpm/strip-ansi@7.0.1/node_modules/strip-ansi/index.js
595
+ init_esm_shims();
492
596
 
493
- export type ${componentName}<T extends ElementType, P extends Dict = {}> = {
494
- (props: Props<ComponentProps<T>, P> & JsxStyleProps): JSX.Element
495
- displayName?: string
597
+ // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
598
+ init_esm_shims();
599
+ function ansiRegex({ onlyFirst = false } = {}) {
600
+ const pattern = [
601
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
602
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
603
+ ].join("|");
604
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
496
605
  }
497
606
 
498
- export type ${upperName} = {
499
- <T extends ElementType, P extends RecipeVariantRecord = {}>(component: T, recipe?: RecipeDefinition<P> | RecipeRuntimeFn<P>): ${componentName}<T, RecipeSelection<P>>
500
- } & { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
501
-
502
- export type ${typeName}<T extends ElementType> = Polyfill<ComponentProps<T>> & JsxStyleProps
503
- `
504
- };
607
+ // ../../node_modules/.pnpm/strip-ansi@7.0.1/node_modules/strip-ansi/index.js
608
+ function stripAnsi(string) {
609
+ if (typeof string !== "string") {
610
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
611
+ }
612
+ return string.replace(ansiRegex(), "");
505
613
  }
506
614
 
507
- // src/generators/jsx/react-jsx.ts
508
- import { outdent as outdent9 } from "outdent";
509
- function generateReactJsxFactory(ctx) {
510
- const { name, componentName } = ctx.jsxFactoryDetails;
511
- return {
512
- js: outdent9`
513
- import { createElement, forwardRef, useMemo } from 'react'
514
- ${ctx.getImport("css, cx, cva, assignCss", "../css/index")}
515
- ${ctx.getImport("splitProps, normalizeHTMLProps", "../helpers")}
516
- ${ctx.getImport("isCssProperty", "./is-valid-prop")}
517
-
518
- function styled(Dynamic, configOrCva = {}) {
519
- const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
520
-
521
- const ${componentName} = forwardRef(function ${componentName}(props, ref) {
522
- const { as: Element = Dynamic, ...restProps } = props
523
-
524
- const [styleProps, variantProps, htmlProps, elementProps] = useMemo(() => {
525
- return splitProps(restProps, isCssProperty, cvaFn.variants, normalizeHTMLProps.keys)
526
- }, [restProps])
527
-
528
- function classes() {
529
- const { css: cssStyles, ...propStyles } = styleProps
530
- const cvaStyles = cvaFn.resolve(variantProps)
531
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
532
- return cx(css(styles), elementProps.className)
533
- }
534
-
535
- return createElement(Element, {
536
- ref,
537
- ...elementProps,
538
- ...normalizeHTMLProps(htmlProps),
539
- className: classes(),
540
- })
541
- })
542
-
543
- ${componentName}.displayName = \`${name}.\${Dynamic}\`
544
- return ${componentName}
615
+ // ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
616
+ var import_eastasianwidth = __toESM(require_eastasianwidth(), 1);
617
+ var import_emoji_regex = __toESM(require_emoji_regex(), 1);
618
+ function stringWidth(string, options = {}) {
619
+ if (typeof string !== "string" || string.length === 0) {
620
+ return 0;
621
+ }
622
+ options = {
623
+ ambiguousIsNarrow: true,
624
+ ...options
625
+ };
626
+ string = stripAnsi(string);
627
+ if (string.length === 0) {
628
+ return 0;
629
+ }
630
+ string = string.replace((0, import_emoji_regex.default)(), " ");
631
+ const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
632
+ let width = 0;
633
+ for (const character of string) {
634
+ const codePoint = character.codePointAt(0);
635
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
636
+ continue;
545
637
  }
546
-
547
- function createJsxFactory() {
548
- const cache = new Map()
549
-
550
- return new Proxy(styled, {
551
- apply(_, __, args) {
552
- return styled(...args)
553
- },
554
- get(_, el) {
555
- if (!cache.has(el)) {
556
- cache.set(el, styled(el))
557
- }
558
- return cache.get(el)
559
- },
560
- })
638
+ if (codePoint >= 768 && codePoint <= 879) {
639
+ continue;
561
640
  }
562
-
563
- export const ${name} = createJsxFactory()
564
-
565
- `
566
- };
567
- }
568
-
569
- // src/generators/jsx/react-layout-grid.ts
570
- import { outdent as outdent10 } from "outdent";
571
- function generateReactLayoutGrid() {
572
- return {
573
- dts: outdent10`
574
- import type { FunctionComponent } from 'react'
575
-
576
- export type LayoutGridProps = {
577
- count?: number
578
- gutter?: string
579
- maxWidth?: string
580
- margin?: string
581
- outline?: boolean
641
+ const code = import_eastasianwidth.default.eastAsianWidth(character);
642
+ switch (code) {
643
+ case "F":
644
+ case "W":
645
+ width += 2;
646
+ break;
647
+ case "A":
648
+ width += ambiguousCharacterWidth;
649
+ break;
650
+ default:
651
+ width += 1;
582
652
  }
583
-
584
- export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
585
- `,
586
- js: outdent10`
587
- import { createElement } from 'react'
588
-
589
- export function LayoutGrid(props) {
590
- const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
591
- const hasMaxWidth = maxWidth != null
592
- return createElement('div', {
593
- className: 'panda-layout-grid',
594
- style: {
595
- '--gutter': gutter,
596
- '--count': count,
597
- '--max-width': hasMaxWidth ? maxWidth : 'initial',
598
- '--margin-x': hasMaxWidth ? 'auto' : undefined,
599
- '--padding-x': !hasMaxWidth ? margin : undefined,
600
- },
601
- children: Array.from({ length: count }).map((_, i) =>
602
- createElement('span', {
603
- 'data-variant': outline ? 'outline' : 'bg',
604
- key: i,
605
- className: 'panda-layout-grid__item',
606
- }),
607
- ),
608
- })
653
+ }
654
+ return width;
655
+ }
656
+
657
+ // ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/index.js
658
+ init_esm_shims();
659
+
660
+ // ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/vendor/ansi-styles/index.js
661
+ init_esm_shims();
662
+ var ANSI_BACKGROUND_OFFSET = 10;
663
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
664
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
665
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
666
+ function assembleStyles() {
667
+ const codes = /* @__PURE__ */ new Map();
668
+ const styles2 = {
669
+ modifier: {
670
+ reset: [0, 0],
671
+ bold: [1, 22],
672
+ dim: [2, 22],
673
+ italic: [3, 23],
674
+ underline: [4, 24],
675
+ overline: [53, 55],
676
+ inverse: [7, 27],
677
+ hidden: [8, 28],
678
+ strikethrough: [9, 29]
679
+ },
680
+ color: {
681
+ black: [30, 39],
682
+ red: [31, 39],
683
+ green: [32, 39],
684
+ yellow: [33, 39],
685
+ blue: [34, 39],
686
+ magenta: [35, 39],
687
+ cyan: [36, 39],
688
+ white: [37, 39],
689
+ blackBright: [90, 39],
690
+ redBright: [91, 39],
691
+ greenBright: [92, 39],
692
+ yellowBright: [93, 39],
693
+ blueBright: [94, 39],
694
+ magentaBright: [95, 39],
695
+ cyanBright: [96, 39],
696
+ whiteBright: [97, 39]
697
+ },
698
+ bgColor: {
699
+ bgBlack: [40, 49],
700
+ bgRed: [41, 49],
701
+ bgGreen: [42, 49],
702
+ bgYellow: [43, 49],
703
+ bgBlue: [44, 49],
704
+ bgMagenta: [45, 49],
705
+ bgCyan: [46, 49],
706
+ bgWhite: [47, 49],
707
+ bgBlackBright: [100, 49],
708
+ bgRedBright: [101, 49],
709
+ bgGreenBright: [102, 49],
710
+ bgYellowBright: [103, 49],
711
+ bgBlueBright: [104, 49],
712
+ bgMagentaBright: [105, 49],
713
+ bgCyanBright: [106, 49],
714
+ bgWhiteBright: [107, 49]
609
715
  }
610
- `
611
716
  };
612
- }
613
-
614
- // src/generators/jsx/react-pattern.ts
615
- import { outdent as outdent11 } from "outdent";
616
- import { match as match2 } from "ts-pattern";
617
- function generate2(ctx, name, pattern) {
618
- const { upperName, styleFn, dashName, jsxName, props, blocklistType } = ctx.getPatternDetails(name, pattern);
619
- const { typeName } = ctx.jsxFactoryDetails;
620
- return {
621
- name: dashName,
622
- js: outdent11`
623
- import { createElement, forwardRef } from 'react'
624
- ${ctx.getImport(ctx.jsxFactory, "./factory")}
625
- ${ctx.getImport(styleFn, `../patterns/${dashName}`)}
626
-
627
- export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
628
- ${match2(props.length).with(
629
- 0,
630
- () => outdent11`
631
- return createElement(${ctx.jsxFactory}.div, { ref, ...props })
632
- `
633
- ).otherwise(
634
- () => outdent11`
635
- const { ${props.join(", ")}, ...restProps } = props
636
- const styleProps = ${styleFn}({${props.join(", ")}})
637
- return createElement(${ctx.jsxFactory}.div, { ref, ...styleProps, ...restProps })
638
- `
639
- )}
640
- })
641
- `,
642
- dts: outdent11`
643
- import type { FunctionComponent } from 'react'
644
- import type { ${upperName}Properties } from '../patterns/${dashName}'
645
- import type { ${typeName} } from '../types/jsx'
646
-
647
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
648
-
649
- ${pattern.description ? `/** ${pattern.description} */` : ""}
650
- export declare const ${jsxName}: FunctionComponent<${upperName}Props>
651
- `
652
- };
653
- }
654
- function generateReactJsxPattern(ctx) {
655
- return Object.entries(ctx.patterns).map(([name, pattern]) => generate2(ctx, name, pattern));
656
- }
657
-
658
- // src/generators/jsx/react-types.ts
659
- import { outdent as outdent12 } from "outdent";
660
- function generateReactJsxTypes(ctx) {
661
- const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
662
- return {
663
- jsxFactory: outdent12`
664
- import { ${upperName} } from '../types/jsx'
665
- export declare const ${name}: ${upperName}
666
- `,
667
- jsxType: outdent12`
668
- import type { ElementType, ComponentProps } from 'react'
669
- import type { JsxStyleProps, Assign } from '.'
670
- import type { RecipeDefinition, RecipeRuntimeFn, RecipeSelection, RecipeVariantRecord } from './recipe'
671
-
672
- type Dict = Record<string, unknown>
673
-
674
- type HTMLProps = {
675
- htmlSize?: string | number
676
- htmlWidth?: string | number
677
- htmlHeight?: string | number
678
- htmlTranslate?: 'yes' | 'no' | undefined
679
- }
680
-
681
- type Polyfill<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps
682
-
683
- type Props<T extends Dict, P extends Dict = {}> = Assign<Polyfill<T>, P>
684
-
685
- export type ${componentName}<T extends ElementType, P extends Dict = {}> = {
686
- (props: Props<ComponentProps<T>, P> & JsxStyleProps): JSX.Element
687
- displayName?: string
688
- }
689
-
690
- export type ${upperName} = {
691
- <T extends ElementType, P extends RecipeVariantRecord = {}>(component: T, recipe?: RecipeDefinition<P> | RecipeRuntimeFn<P>): ${componentName}<T, RecipeSelection<P>>
692
- } & { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
693
-
694
- export type ${typeName}<T extends ElementType> = Polyfill<ComponentProps<T>> & JsxStyleProps
695
- `
696
- };
697
- }
698
-
699
- // src/generators/jsx/solid-jsx.ts
700
- import { outdent as outdent13 } from "outdent";
701
- function generateSolidJsxFactory(ctx) {
702
- const { componentName, name } = ctx.jsxFactoryDetails;
703
- return {
704
- js: outdent13`
705
- import { Dynamic } from 'solid-js/web'
706
- import { mergeProps, splitProps } from 'solid-js'
707
- import { createComponent } from 'solid-js/web'
708
- ${ctx.getImport("css, cx, cva, assignCss", "../css/index")}
709
- ${ctx.getImport("normalizeHTMLProps", "../helpers")}
710
- ${ctx.getImport("allCssProperties", "./is-valid-prop")}
711
-
712
- function styled(element, configOrCva = {}) {
713
- const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
714
-
715
- return function ${componentName}(props) {
716
- const mergedProps = mergeProps({ as: element }, props)
717
-
718
- const [localProps, styleProps, variantProps, htmlProps, elementProps] = splitProps(
719
- mergedProps,
720
- ['as', 'class'],
721
- allCssProperties,
722
- cvaFn.variants,
723
- normalizeHTMLProps.keys
724
- )
725
-
726
- const classes = () => {
727
- const { css: cssStyles, ...propStyles } = styleProps
728
- const cvaStyles = cvaFn.resolve(variantProps)
729
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
730
- return cx(css(styles), localProps.class)
731
- }
732
-
733
- return createComponent(
734
- Dynamic,
735
- mergeProps(
736
- {
737
- get component() {
738
- return localProps.as
739
- },
740
- get class() {
741
- return classes()
742
- }
743
- },
744
- elementProps,
745
- normalizeHTMLProps(htmlProps)
746
- )
747
- )
748
- }
717
+ styles2.color.gray = styles2.color.blackBright;
718
+ styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
719
+ styles2.color.grey = styles2.color.blackBright;
720
+ styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
721
+ for (const [groupName, group] of Object.entries(styles2)) {
722
+ for (const [styleName, style] of Object.entries(group)) {
723
+ styles2[styleName] = {
724
+ open: `\x1B[${style[0]}m`,
725
+ close: `\x1B[${style[1]}m`
726
+ };
727
+ group[styleName] = styles2[styleName];
728
+ codes.set(style[0], style[1]);
749
729
  }
750
-
751
- function createJsxFactory() {
752
- const cache = new Map()
753
-
754
- return new Proxy(styled, {
755
- apply(_, __, args) {
756
- return styled(...args)
757
- },
758
- get(_, el) {
759
- if (!cache.has(el)) {
760
- cache.set(el, styled(el))
730
+ Object.defineProperty(styles2, groupName, {
731
+ value: group,
732
+ enumerable: false
733
+ });
734
+ }
735
+ Object.defineProperty(styles2, "codes", {
736
+ value: codes,
737
+ enumerable: false
738
+ });
739
+ styles2.color.close = "\x1B[39m";
740
+ styles2.bgColor.close = "\x1B[49m";
741
+ styles2.color.ansi = wrapAnsi16();
742
+ styles2.color.ansi256 = wrapAnsi256();
743
+ styles2.color.ansi16m = wrapAnsi16m();
744
+ styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
745
+ styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
746
+ styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
747
+ Object.defineProperties(styles2, {
748
+ rgbToAnsi256: {
749
+ value: (red, green, blue) => {
750
+ if (red === green && green === blue) {
751
+ if (red < 8) {
752
+ return 16;
761
753
  }
762
- return cache.get(el)
763
- },
764
- })
765
- }
766
-
767
- export const ${name} = createJsxFactory()
768
- `
769
- };
770
- }
771
-
772
- // src/generators/jsx/solid-layout-grid.ts
773
- import { outdent as outdent14 } from "outdent";
774
- function generateSolidLayoutGrid() {
775
- return {
776
- dts: outdent14`
777
- import type { ParentProps } from 'solid-js'
778
-
779
- export type LayoutGridProps = {
780
- count?: number
781
- gutter?: string
782
- maxWidth?: string
783
- margin?: string
784
- outline?: boolean
785
- }
786
-
787
- export declare const LayoutGrid: ParentProps<LayoutGridProps>
788
- `,
789
- js: outdent14`
790
- import { createComponent, For } from 'solid-js/web'
791
-
792
- export function LayoutGrid(props) {
793
- const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
794
- const hasMaxWidth = maxWidth != null
795
- return createComponent('div', {
796
- className: 'panda-layout-grid',
797
- style: {
798
- '--gutter': gutter,
799
- '--count': count,
800
- '--max-width': hasMaxWidth ? maxWidth : 'initial',
801
- '--margin-x': hasMaxWidth ? 'auto' : undefined,
802
- '--padding-x': !hasMaxWidth ? margin : undefined,
803
- },
804
- get children() {
805
- return createComponent(For, {
806
- get each() {
807
- return Array.from({ length: count })
808
- },
809
- children: () =>
810
- createComponent('span', {
811
- 'data-variant': outline ? 'outline' : 'bg',
812
- className: 'panda-layout-grid__item',
813
- }),
814
- })
815
- },
816
- })
817
- }
818
-
819
- `
820
- };
821
- }
822
-
823
- // src/generators/jsx/solid-pattern.ts
824
- import { outdent as outdent15 } from "outdent";
825
- import { match as match3 } from "ts-pattern";
826
- function generate3(ctx, name, pattern) {
827
- const { upperName, styleFn, dashName, jsxName, props, blocklistType } = ctx.getPatternDetails(name, pattern);
828
- const { typeName } = ctx.jsxFactoryDetails;
829
- return {
830
- name: dashName,
831
- js: outdent15`
832
- import { splitProps, mergeProps } from 'solid-js'
833
- import { createComponent } from 'solid-js/web'
834
- ${ctx.getImport(ctx.jsxFactory, "./factory")}
835
- ${ctx.getImport(styleFn, `../patterns/${dashName}`)}
836
-
837
- export function ${jsxName}(props) {
838
- ${match3(props.length).with(
839
- 0,
840
- () => outdent15`
841
- return createComponent(${ctx.jsxFactory}.div, props)
842
- `
843
- ).otherwise(
844
- () => outdent15`
845
- const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
846
- const styleProps = ${styleFn}(patternProps)
847
- return createComponent(${ctx.jsxFactory}.div, mergeProps(styleProps, restProps))
848
- `
849
- )}
850
- }
851
- `,
852
- dts: outdent15`
853
- import { Component } from 'solid-js'
854
- import { ${upperName}Properties } from '../patterns/${dashName}'
855
- import { ${typeName} } from '../types/jsx'
856
-
857
- export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'div'>, keyof ${upperName}Properties ${blocklistType}>
858
-
859
- ${pattern.description ? `/** ${pattern.description} */` : ""}
860
- export declare const ${jsxName}: Component<${upperName}Props>
861
- `
862
- };
863
- }
864
- function generateSolidJsxPattern(ctx) {
865
- return Object.entries(ctx.patterns).map(([name, pattern]) => generate3(ctx, name, pattern));
866
- }
867
-
868
- // src/generators/jsx/solid-types.ts
869
- import { outdent as outdent16 } from "outdent";
870
- function generateSolidJsxTypes(ctx) {
871
- const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
872
- return {
873
- jsxFactory: outdent16`
874
- import type { ${upperName} } from '../types/jsx'
875
- export declare const ${name}: ${upperName}
876
- `,
877
- jsxType: outdent16`
878
- import type { JSX, ComponentProps, Component } from 'solid-js'
879
- import type { JsxStyleProps, Assign } from '.'
880
- import type { RecipeDefinition, RecipeRuntimeFn, RecipeSelection, RecipeVariantRecord } from './recipe'
881
-
882
- type Dict = Record<string, unknown>
883
-
884
- type ElementType<P = any> = keyof JSX.IntrinsicElements | Component<P>
885
-
886
- type HTMLProps = {
887
- htmlSize?: string | number
888
- htmlWidth?: string | number
889
- htmlHeight?: string | number
890
- htmlTranslate?: 'yes' | 'no' | undefined
891
- }
892
-
893
- type Polyfill<T> = Omit<T, 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size'> & HTMLProps
894
-
895
- type Props<T extends Dict, P extends Dict = {}> = Assign<Polyfill<T>, P>
896
-
897
- export type ${componentName}<T extends ElementType, P extends Dict = {}> = {
898
- (props: Props<ComponentProps<T>, P> & JsxStyleProps): JSX.Element
899
- displayName?: string
900
- }
901
-
902
- export type ${upperName} = {
903
- <T extends ElementType, P extends RecipeVariantRecord = {}>(component: T, recipe?: RecipeDefinition<P> | RecipeRuntimeFn<P>): ${componentName}<T, RecipeSelection<P>>
904
- } & { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
905
-
906
- export type ${typeName}<T extends ElementType> = Polyfill<ComponentProps<T>> & JsxStyleProps
907
- `
908
- };
909
- }
910
-
911
- // src/generators/jsx/index.ts
912
- var typesMap = {
913
- react: generateReactJsxTypes,
914
- preact: generatePreactJsxTypes,
915
- solid: generateSolidJsxTypes
916
- };
917
- function generateJsxTypes(ctx) {
918
- if (!ctx.jsxFramework)
919
- return;
920
- return typesMap[ctx.jsxFramework](ctx);
921
- }
922
- var factoryMap = {
923
- react: generateReactJsxFactory,
924
- solid: generateSolidJsxFactory,
925
- preact: generatePreactJsxFactory
926
- };
927
- function generateJsxFactory(ctx) {
928
- return factoryMap[ctx.jsxFramework](ctx);
929
- }
930
- var patternMap = {
931
- react: generateReactJsxPattern,
932
- solid: generateSolidJsxPattern,
933
- preact: generatePreactJsxPattern
934
- };
935
- function generateJsxPatterns(ctx) {
936
- if (!ctx.hasPatterns)
937
- return [];
938
- return patternMap[ctx.jsxFramework](ctx);
939
- }
940
- var layoutGridMap = {
941
- react: generateReactLayoutGrid,
942
- preact: generatePreactLayoutGrid,
943
- solid: generateSolidLayoutGrid
944
- };
945
- function generateLayoutGrid(ctx) {
946
- return layoutGridMap[ctx.jsxFramework]();
947
- }
948
-
949
- // src/generators/layout-grid.ts
950
- import { outdent as outdent17 } from "outdent";
951
- var css = (v) => v[0];
952
- var layoutGrid = css`
953
- .panda-layout-grid {
954
- display: grid;
955
- gap: var(--gutter);
956
- grid-template-columns: repeat(var(--count), 1fr);
957
- height: 100%;
958
- width: 100%;
959
- position: absolute;
960
- inset: 0;
961
- pointer-events: none;
962
- max-width: var(--max-width);
963
- margin-inline: var(--margin-x);
964
- padding-inline: var(--padding-x);
965
- }
966
- .panda-layout-grid__item {
967
- display: flex;
968
- --color: rgba(255, 0, 0, 0.1);
969
- height: 100%;
970
- }
971
- .panda-layout-grid__item[data-variant='bg'] {
972
- background: var(--color);
973
- }
974
- .panda-layout-grid__item[data-variant='outline'] {
975
- border-inline: 1px solid var(--color);
976
- }
977
- `;
978
- function generateLayoutGridCss() {
979
- return outdent17`
980
- @layer base {
981
- ${layoutGrid}
982
- }`;
983
- }
984
-
985
- // src/generators/pattern.ts
986
- import { capitalize, dashCase, unionType } from "@pandacss/shared";
987
- import { outdent as outdent18 } from "outdent";
988
- import { stringify as stringify2 } from "javascript-stringify";
989
- import { match as match4 } from "ts-pattern";
990
- function generate4(ctx, name, pattern) {
991
- const { properties, transform, strict, description } = pattern;
992
- const { upperName, styleFn, blocklistType } = ctx.getPatternDetails(name, pattern);
993
- return {
994
- name: dashCase(name),
995
- dts: outdent18`
996
- import type { SystemStyleObject, ConditionalValue } from '../types'
997
- import type { PropertyValue } from '../types/prop-type'
998
- import type { Properties } from '../types/csstype'
999
- import type { Tokens } from '../types/token'
1000
-
1001
- export type ${capitalize(name)}Properties = {
1002
- ${Object.keys(properties ?? {}).map((key) => {
1003
- const value = properties[key];
1004
- return match4(value).with({ type: "property" }, (value2) => {
1005
- return `${key}?: PropertyValue<'${value2.value}'>`;
1006
- }).with({ type: "token" }, (value2) => {
1007
- if (value2.property) {
1008
- return `${key}?: ConditionalValue<Tokens["${value2.value}"] | Properties["${value2.property}"]>`;
754
+ if (red > 248) {
755
+ return 231;
756
+ }
757
+ return Math.round((red - 8) / 247 * 24) + 232;
1009
758
  }
1010
- return `${key}?: ConditionalValue<Tokens["${value2.value}"]>`;
1011
- }).with({ type: "enum" }, (value2) => {
1012
- return `${key}?: ConditionalValue<${unionType(value2.value)}>`;
1013
- }).otherwise(() => {
1014
- return `${key}?: ConditionalValue<${value.type}>`;
1015
- });
1016
- }).join("\n ")}
1017
- }
1018
-
1019
- ${strict ? outdent18`export declare function ${name}(options: ${upperName}Properties): string` : outdent18`
1020
-
1021
- type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
1022
-
1023
- ${description ? `/** ${description} */` : ""}
1024
- export declare function ${name}(options: ${upperName}Options): string
1025
- `}
1026
-
1027
- `,
1028
- js: outdent18`
1029
- ${ctx.getImport("mapObject", "../helpers")}
1030
- ${ctx.getImport("css", "../css/index")}
1031
-
1032
- const config = ${stringify2({ transform })}
1033
-
1034
- export const ${styleFn} = (styles) => config.transform(styles, { map: mapObject })
1035
-
1036
- export const ${name} = (styles) => css(${styleFn}(styles))
1037
- `
1038
- };
1039
- }
1040
- function generatePattern(ctx) {
1041
- if (!ctx.hasPatterns)
1042
- return;
1043
- return Object.entries(ctx.patterns).map(([name, pattern]) => generate4(ctx, name, pattern));
1044
- }
1045
-
1046
- // src/generators/pkg-json.ts
1047
- function generatePackageJSON(ctx) {
1048
- const pkg = {
1049
- name: ctx.outdir,
1050
- description: "This package is auto-generated by CSS Panda",
1051
- version: `0.0.0-${performance.now()}`,
1052
- type: "module",
1053
- exports: {
1054
- "./css": { types: "./css/index.d.ts", import: "./css/index.mjs" },
1055
- "./jsx": { types: "./jsx/index.d.ts", import: "./jsx/index.mjs" },
1056
- "./patterns": { types: "./patterns/index.d.ts", import: "./patterns/index.mjs" },
1057
- "./recipes": { types: "./recipes/index.d.ts", import: "./recipes/index.mjs" },
1058
- "./tokens": { types: "./tokens/index.d.ts", import: "./tokens/index.mjs" },
1059
- "./types": { types: "./types/index.d.ts" },
1060
- "./styles.css": "./styles.css"
1061
- }
1062
- };
1063
- return JSON.stringify(pkg, null, 2);
1064
- }
1065
-
1066
- // src/generators/prop-types.ts
1067
- import { outdent as outdent19 } from "outdent";
1068
- function generatePropTypes(utility, strict) {
1069
- const strictText = `${strict ? "" : " | NativeValue<T>"}`;
1070
- const result = [
1071
- outdent19`
1072
- import type { ConditionalValue } from './conditions';
1073
- import type { Properties as CSSProperties } from './csstype'
1074
- import type { Tokens } from './token'
1075
-
1076
- type PropertyValueTypes = {`
1077
- ];
1078
- const types = utility.getTypes();
1079
- for (const [prop, values] of types.entries()) {
1080
- result.push(` ${prop}: ${values.join(" | ")};`);
1081
- }
1082
- result.push("}", "\n");
1083
- result.push(`
1084
- type NativeValue<T> = T extends keyof CSSProperties ? CSSProperties[T] : never
1085
-
1086
- type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T]${strictText} : NativeValue<T>
1087
-
1088
- export type PropertyTypes = PropertyValueTypes & {
1089
- `);
1090
- utility.shorthands.forEach((value, key) => {
1091
- result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
1092
- });
1093
- result.push("}");
1094
- return outdent19`
1095
- ${result.join("\n")}
1096
-
1097
- export type PropertyValue<T extends string> = T extends keyof PropertyTypes
1098
- ? ConditionalValue<PropertyTypes[T]${strictText}>
1099
- : T extends keyof CSSProperties
1100
- ? ConditionalValue<CSSProperties[T]>
1101
- : ConditionalValue<string | number>
1102
- `;
1103
- }
1104
-
1105
- // src/generators/recipe.ts
1106
- import { capitalize as capitalize2, unionType as unionType2 } from "@pandacss/shared";
1107
- import { outdent as outdent20 } from "outdent";
1108
- function generateRecipes(ctx) {
1109
- const { recipes = {}, hash, hasRecipes, utility } = ctx;
1110
- const { separator } = utility;
1111
- if (!hasRecipes)
1112
- return;
1113
- const js = [
1114
- outdent20`
1115
- ${ctx.getImport("createCss, withoutSpace, compact", "../helpers")}
1116
-
1117
- const createRecipe = (name, defaultVariants) => {
1118
- return (variants) => {
1119
- const transform = (prop, value) => {
1120
- if (value === '__ignore__') {
1121
- return { className: name }
1122
- }
1123
-
1124
- value = withoutSpace(value)
1125
- return { className: \`\${name}--\${prop}${separator}\${value}\` }
1126
- }
1127
-
1128
- const context = {
1129
- hash: ${hash ? "true" : "false"},
1130
- utility: {
1131
- prefix: ${ctx.prefix ? JSON.stringify(ctx.prefix) : void 0},
1132
- transform,
759
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
760
+ },
761
+ enumerable: false
762
+ },
763
+ hexToRgb: {
764
+ value: (hex) => {
765
+ const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
766
+ if (!matches) {
767
+ return [0, 0, 0];
1133
768
  }
1134
- }
1135
-
1136
- const css = createCss(context)
1137
-
1138
- return css({
1139
- [name]: '__ignore__',
1140
- ...defaultVariants,
1141
- ...compact(variants)
1142
- })
1143
- }
1144
- }
1145
- `
1146
- ];
1147
- const dts = [
1148
- outdent20`
1149
- import type { ConditionalValue } from '../types'
1150
- `
1151
- ];
1152
- Object.values(recipes).forEach((recipe) => {
1153
- const { name, description, defaultVariants, variants } = recipe;
1154
- js.push(outdent20`
1155
- export const ${name} = createRecipe('${name}', ${JSON.stringify(defaultVariants ?? {})})
1156
- ${name}.variants = ${JSON.stringify(Object.keys(variants ?? {}))}
1157
- `);
1158
- dts.push(outdent20`
1159
- export type ${capitalize2(name)}Variants = {
1160
- ${Object.keys(variants ?? {}).map((key) => {
1161
- const value = variants[key];
1162
- const keys = Object.keys(value);
1163
- return `${key}?: ConditionalValue<${unionType2(keys)}>`;
1164
- }).join("\n")}
769
+ let { colorString } = matches.groups;
770
+ if (colorString.length === 3) {
771
+ colorString = [...colorString].map((character) => character + character).join("");
772
+ }
773
+ const integer = Number.parseInt(colorString, 16);
774
+ return [
775
+ integer >> 16 & 255,
776
+ integer >> 8 & 255,
777
+ integer & 255
778
+ ];
779
+ },
780
+ enumerable: false
781
+ },
782
+ hexToAnsi256: {
783
+ value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
784
+ enumerable: false
785
+ },
786
+ ansi256ToAnsi: {
787
+ value: (code) => {
788
+ if (code < 8) {
789
+ return 30 + code;
790
+ }
791
+ if (code < 16) {
792
+ return 90 + (code - 8);
793
+ }
794
+ let red;
795
+ let green;
796
+ let blue;
797
+ if (code >= 232) {
798
+ red = ((code - 232) * 10 + 8) / 255;
799
+ green = red;
800
+ blue = red;
801
+ } else {
802
+ code -= 16;
803
+ const remainder = code % 36;
804
+ red = Math.floor(code / 36) / 5;
805
+ green = Math.floor(remainder / 6) / 5;
806
+ blue = remainder % 6 / 5;
807
+ }
808
+ const value = Math.max(red, green, blue) * 2;
809
+ if (value === 0) {
810
+ return 30;
811
+ }
812
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
813
+ if (value === 2) {
814
+ result += 60;
815
+ }
816
+ return result;
817
+ },
818
+ enumerable: false
819
+ },
820
+ rgbToAnsi: {
821
+ value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
822
+ enumerable: false
823
+ },
824
+ hexToAnsi: {
825
+ value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
826
+ enumerable: false
1165
827
  }
1166
-
1167
- ${description ? `/** ${description} */` : ""}
1168
- export declare function ${name}(variants?: ${capitalize2(name)}Variants): string & { variants: string[] }
1169
- `);
1170
828
  });
829
+ return styles2;
830
+ }
831
+ var ansiStyles = assembleStyles();
832
+ var ansi_styles_default = ansiStyles;
833
+
834
+ // ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/vendor/supports-color/index.js
835
+ init_esm_shims();
836
+ import process2 from "node:process";
837
+ import os from "node:os";
838
+ import tty from "node:tty";
839
+ function hasFlag(flag, argv = process2.argv) {
840
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
841
+ const position = argv.indexOf(prefix + flag);
842
+ const terminatorPosition = argv.indexOf("--");
843
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
844
+ }
845
+ var { env } = process2;
846
+ var flagForceColor;
847
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
848
+ flagForceColor = 0;
849
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
850
+ flagForceColor = 1;
851
+ }
852
+ function envForceColor() {
853
+ if ("FORCE_COLOR" in env) {
854
+ if (env.FORCE_COLOR === "true") {
855
+ return 1;
856
+ }
857
+ if (env.FORCE_COLOR === "false") {
858
+ return 0;
859
+ }
860
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
861
+ }
862
+ }
863
+ function translateLevel(level) {
864
+ if (level === 0) {
865
+ return false;
866
+ }
1171
867
  return {
1172
- js: outdent20.string(js.join("\n\n")),
1173
- dts: outdent20.string(dts.join("\n\n"))
868
+ level,
869
+ hasBasic: true,
870
+ has256: level >= 2,
871
+ has16m: level >= 3
1174
872
  };
1175
873
  }
1176
-
1177
- // src/generators/reset.ts
1178
- var css2 = (v) => v[0];
1179
- var reset = css2`
1180
- * {
1181
- margin: 0;
1182
- }
1183
-
1184
- *,
1185
- *::before,
1186
- *::after {
1187
- box-sizing: border-box;
1188
- border-width: 0;
1189
- border-style: solid;
1190
- }
1191
-
1192
- html,
1193
- body {
1194
- height: 100%;
1195
- }
1196
-
1197
- body {
1198
- line-height: 1.5;
1199
- -webkit-text-size-adjust: 100%;
1200
- -webkit-font-smoothing: antialiased;
1201
- }
1202
-
1203
- img {
1204
- border-style: none;
1205
- }
1206
-
1207
- img,
1208
- picture,
1209
- video,
1210
- canvas,
1211
- svg {
1212
- display: block;
1213
- max-width: 100%;
1214
- }
1215
-
1216
- input,
1217
- button,
1218
- textarea,
1219
- select {
1220
- font: inherit;
1221
- }
1222
-
1223
- p,
1224
- h1,
1225
- h2,
1226
- h3,
1227
- h4,
1228
- h5,
1229
- h6 {
1230
- overflow-wrap: break-word;
1231
- }
1232
-
1233
- ::-webkit-search-decoration {
1234
- -webkit-appearance: none;
1235
- appearance: none;
1236
- }
1237
-
1238
- ::-webkit-file-upload-button {
1239
- -webkit-appearance: button;
1240
- appearance: none;
1241
- font: inherit;
874
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
875
+ const noFlagForceColor = envForceColor();
876
+ if (noFlagForceColor !== void 0) {
877
+ flagForceColor = noFlagForceColor;
1242
878
  }
1243
-
1244
- ::-webkit-inner-spin-button,
1245
- ::-webkit-outer-spin-button {
1246
- height: auto;
879
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
880
+ if (forceColor === 0) {
881
+ return 0;
1247
882
  }
1248
-
1249
- code,
1250
- kbd,
1251
- pre,
1252
- samp {
1253
- font-size: 1em;
883
+ if (sniffFlags) {
884
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
885
+ return 3;
886
+ }
887
+ if (hasFlag("color=256")) {
888
+ return 2;
889
+ }
1254
890
  }
1255
-
1256
- table {
1257
- border-collapse: collapse;
891
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
892
+ return 0;
1258
893
  }
1259
-
1260
- textarea {
1261
- resize: vertical;
894
+ const min = forceColor || 0;
895
+ if (env.TERM === "dumb") {
896
+ return min;
1262
897
  }
1263
-
1264
- sub {
1265
- bottom: -0.25em;
898
+ if (process2.platform === "win32") {
899
+ const osRelease = os.release().split(".");
900
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
901
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
902
+ }
903
+ return 1;
1266
904
  }
1267
-
1268
- sup {
1269
- top: -0.5em;
1270
- }
1271
- `;
1272
- function generateResetCss() {
1273
- return `@layer reset {
1274
- ${reset}
1275
- }`;
1276
- }
1277
-
1278
- // src/generators/token-css.ts
1279
- import { expandNestedCss, extractParentSelectors, prettifyCss, toCss, toKeyframeCss } from "@pandacss/core";
1280
- import postcss from "postcss";
1281
- function generateKeyframes(keyframes) {
1282
- if (!keyframes)
1283
- return;
1284
- return toKeyframeCss(keyframes);
1285
- }
1286
- function generateTokenCss(ctx, varRoot) {
1287
- const root = varRoot ?? ctx.cssVarRoot;
1288
- const conditions = ctx.conditions;
1289
- const results = [];
1290
- for (const [key, values] of ctx.tokens.vars.entries()) {
1291
- const varsObj = Object.fromEntries(values);
1292
- if (Object.keys(varsObj).length === 0)
1293
- continue;
1294
- if (key === "base") {
1295
- const { css: css4 } = toCss({ [root]: varsObj });
1296
- results.push(css4);
1297
- } else {
1298
- const keys = key.split(":");
1299
- const { css: css4 } = toCss(varsObj);
1300
- const mapped = keys.map((key2) => conditions.get(key2)).filter(Boolean).map((condition) => {
1301
- const parent = extractParentSelectors(condition);
1302
- return parent ? `&${parent}` : condition;
1303
- });
1304
- const rule = getDeepestRule(root, mapped);
1305
- if (!rule)
1306
- continue;
1307
- getDeepestNode(rule)?.append(css4);
1308
- results.push(expandNestedCss(rule.toString()));
905
+ if ("CI" in env) {
906
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
907
+ return 1;
1309
908
  }
909
+ return min;
1310
910
  }
1311
- const css3 = results.join("\n\n");
1312
- return `@layer tokens {
1313
- ${prettifyCss(cleanupSelectors(css3, root))}
911
+ if ("TEAMCITY_VERSION" in env) {
912
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1314
913
  }
1315
- `;
1316
- }
1317
- function getDeepestRule(root, selectors) {
1318
- const rule = postcss.rule({ selector: "" });
1319
- for (const selector of selectors) {
1320
- const last = getDeepestNode(rule);
1321
- const node = last ?? rule;
1322
- if (selector.startsWith("@")) {
1323
- const atRule = postcss.rule({ selector, nodes: [postcss.rule({ selector: `${root}&` })] });
1324
- node.append(atRule);
1325
- } else {
1326
- node.append(postcss.rule({ selector }));
1327
- }
914
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
915
+ return 1;
1328
916
  }
1329
- return rule;
1330
- }
1331
- function getDeepestNode(node) {
1332
- if (node.nodes && node.nodes.length) {
1333
- return getDeepestNode(node.nodes[node.nodes.length - 1]);
917
+ if (env.COLORTERM === "truecolor") {
918
+ return 3;
1334
919
  }
1335
- return node;
1336
- }
1337
- function cleanupSelectors(css3, varSelector) {
1338
- const root = postcss.parse(css3);
1339
- root.walkRules((rule) => {
1340
- rule.selectors.forEach((selector) => {
1341
- const res = selector.split(varSelector).filter(Boolean);
1342
- if (res.length === 0)
1343
- return;
1344
- rule.selector = res.join(varSelector);
1345
- });
1346
- });
1347
- return root.toString();
1348
- }
1349
-
1350
- // src/generators/token-dts.ts
1351
- import { unionType as unionType3, capitalize as capitalize3 } from "@pandacss/shared";
1352
- import { outdent as outdent21 } from "outdent";
1353
- import pluralize from "pluralize";
1354
- function generateTokenDts(dict) {
1355
- const set = /* @__PURE__ */ new Set();
1356
- set.add(`export type Token = ${dict.isEmpty ? "string" : unionType3(dict.allNames)}`);
1357
- const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
1358
- if (dict.isEmpty) {
1359
- result.add("[token: string]: string");
1360
- } else {
1361
- for (const [key, value] of dict.categoryMap.entries()) {
1362
- const typeName = capitalize3(pluralize.singular(key));
1363
- set.add(`export type ${typeName} = ${unionType3(value.keys())}`);
1364
- set.add(`export type ColorPalette = ${unionType3(Object.keys(dict.colorPalettes))}`);
1365
- result.add(` ${key}: ${typeName}`);
920
+ if ("TERM_PROGRAM" in env) {
921
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
922
+ switch (env.TERM_PROGRAM) {
923
+ case "iTerm.app":
924
+ return version >= 3 ? 3 : 2;
925
+ case "Apple_Terminal":
926
+ return 2;
1366
927
  }
1367
928
  }
1368
- result.add("} & { [token: string]: never }");
1369
- set.add(Array.from(result).join("\n"));
1370
- return outdent21.string(Array.from(set).join("\n\n"));
1371
- }
1372
-
1373
- // src/generators/token-js.ts
1374
- import outdent22 from "outdent";
1375
- function generateTokenJs(dict) {
1376
- const map = /* @__PURE__ */ new Map();
1377
- dict.allTokens.forEach((token) => {
1378
- const { varRef } = token.extensions;
1379
- const value = token.isConditional ? varRef : token.value;
1380
- map.set(token.name, { value, variable: varRef });
1381
- });
1382
- const obj = Object.fromEntries(map);
1383
- return {
1384
- js: outdent22`
1385
- const tokens = ${JSON.stringify(obj, null, 2)}
1386
-
1387
- export function token(path, fallback) {
1388
- return tokens[path]?.value || fallback
929
+ if (/-256(color)?$/i.test(env.TERM)) {
930
+ return 2;
1389
931
  }
1390
-
1391
- function tokenVar(path, fallback) {
1392
- return tokens[path]?.variable || fallback
932
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
933
+ return 1;
1393
934
  }
1394
-
1395
- token.var = tokenVar
1396
- `,
1397
- dts: outdent22`
1398
- import type { Token } from '../types/token'
1399
-
1400
- export declare function token(path: Token, fallback?: string): string & {
1401
- var: (path: Token, fallback?: string) => string
935
+ if ("COLORTERM" in env) {
936
+ return 1;
1402
937
  }
1403
- `
1404
- };
938
+ return min;
1405
939
  }
1406
-
1407
- // src/generators/types.ts
1408
- import { allCssProperties } from "@pandacss/is-valid-prop";
1409
- import { readFileSync as readFileSync2 } from "fs-extra";
1410
- import outdent23 from "outdent";
1411
- function getType(file) {
1412
- const filepath = getEntrypoint("@pandacss/types", { dev: file });
1413
- return readFileSync2(filepath, "utf8");
940
+ function createSupportsColor(stream, options = {}) {
941
+ const level = _supportsColor(stream, {
942
+ streamIsTTY: stream && stream.isTTY,
943
+ ...options
944
+ });
945
+ return translateLevel(level);
1414
946
  }
1415
- function generateCssType(ctx) {
1416
- const propList = new Set(allCssProperties.concat(ctx.utility.keys()));
1417
- return {
1418
- css: getType("csstype.d.ts"),
1419
- system: getType("system-types.d.ts"),
1420
- selectors: getType("selectors.d.ts"),
1421
- recipe: getType("recipe.d.ts"),
1422
- composition: getType("composition.d.ts"),
1423
- global: outdent23`
1424
- import { RecipeVariantRecord, RecipeConfig } from './recipe'
1425
- import { GlobalStyleObject } from './system-types'
1426
- import { CompositionStyles } from './composition'
1427
-
1428
- declare module 'css-panda' {
1429
- export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): RecipeConfig<V>
1430
- export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
1431
- export function defineTextStyles(definition: CompositionStyles['textStyles']): CompositionStyles['textStyles']
1432
- export function defineLayerStyles(definition: CompositionStyles['layerStyles']): CompositionStyles['layerStyles']
1433
- }
1434
- `,
1435
- exported: outdent23`
1436
- import './global'
1437
- export { ConditionalValue } from './conditions'
1438
- export { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
1439
-
1440
- export type Assign<Target, Override> = Omit<Target, keyof Override> & Override
1441
- `,
1442
- styleProps: outdent23`
1443
- import { PropertyValue } from './prop-type'
1444
- import { Token } from './token'
1445
-
1446
- type CssVarProperties = {
1447
- [key in \`--\${string}\`]?: Token | (string & {}) | (number & {})
1448
- }
1449
-
1450
- export type SystemProperties = CssVarProperties & {
1451
- ${Array.from(propList).map((v) => ` ${v}?: PropertyValue<'${v}'>`).join("\n")}
947
+ var supportsColor = {
948
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
949
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
950
+ };
951
+ var supports_color_default = supportsColor;
952
+
953
+ // ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/utilities.js
954
+ init_esm_shims();
955
+ function stringReplaceAll(string, substring, replacer) {
956
+ let index = string.indexOf(substring);
957
+ if (index === -1) {
958
+ return string;
959
+ }
960
+ const substringLength = substring.length;
961
+ let endIndex = 0;
962
+ let returnValue = "";
963
+ do {
964
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
965
+ endIndex = index + substringLength;
966
+ index = string.indexOf(substring, endIndex);
967
+ } while (index !== -1);
968
+ returnValue += string.slice(endIndex);
969
+ return returnValue;
970
+ }
971
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
972
+ let endIndex = 0;
973
+ let returnValue = "";
974
+ do {
975
+ const gotCR = string[index - 1] === "\r";
976
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
977
+ endIndex = index + 1;
978
+ index = string.indexOf("\n", endIndex);
979
+ } while (index !== -1);
980
+ returnValue += string.slice(endIndex);
981
+ return returnValue;
982
+ }
983
+
984
+ // ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/index.js
985
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
986
+ var GENERATOR = Symbol("GENERATOR");
987
+ var STYLER = Symbol("STYLER");
988
+ var IS_EMPTY = Symbol("IS_EMPTY");
989
+ var levelMapping = [
990
+ "ansi",
991
+ "ansi",
992
+ "ansi256",
993
+ "ansi16m"
994
+ ];
995
+ var styles = /* @__PURE__ */ Object.create(null);
996
+ var applyOptions = (object, options = {}) => {
997
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
998
+ throw new Error("The `level` option should be an integer from 0 to 3");
999
+ }
1000
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1001
+ object.level = options.level === void 0 ? colorLevel : options.level;
1002
+ };
1003
+ var chalkFactory = (options) => {
1004
+ const chalk2 = (...strings) => strings.join(" ");
1005
+ applyOptions(chalk2, options);
1006
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
1007
+ return chalk2;
1008
+ };
1009
+ function createChalk(options) {
1010
+ return chalkFactory(options);
1011
+ }
1012
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
1013
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
1014
+ styles[styleName] = {
1015
+ get() {
1016
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
1017
+ Object.defineProperty(this, styleName, { value: builder });
1018
+ return builder;
1452
1019
  }
1453
- `
1454
- };
1455
- }
1456
-
1457
- // src/generators/index.ts
1458
- function setupHelpers(ctx) {
1459
- const sharedMjs = getEntrypoint("@pandacss/shared", { dev: "shared.mjs" });
1460
- const code = readFileSync3(sharedMjs, "utf-8");
1461
- return {
1462
- files: [{ file: ctx.getExt("helpers"), code }]
1463
- };
1464
- }
1465
- function setupKeyframes(ctx) {
1466
- const code = generateKeyframes(ctx.theme.keyframes);
1467
- return {
1468
- dir: ctx.paths.token,
1469
- files: [{ file: "keyframes.css", code }]
1470
- };
1471
- }
1472
- function setupDesignTokens(ctx) {
1473
- if (ctx.tokens.isEmpty)
1474
- return;
1475
- const code = generateTokenJs(ctx.tokens);
1476
- const css3 = generateTokenCss(ctx);
1477
- return {
1478
- dir: ctx.paths.token,
1479
- files: [
1480
- { file: "index.css", code: css3 },
1481
- { file: "index.d.ts", code: code.dts },
1482
- { file: ctx.getExt("index"), code: code.js }
1483
- ]
1484
- };
1485
- }
1486
- function setupTypes(ctx) {
1487
- const types = generateCssType(ctx);
1488
- const conditions = generateConditions(ctx);
1489
- const jsx = generateJsxTypes(ctx);
1490
- return {
1491
- dir: ctx.paths.types,
1492
- files: [
1493
- jsx ? { file: "jsx.d.ts", code: jsx.jsxType } : null,
1494
- { file: "csstype.d.ts", code: types.css },
1495
- { file: "system-types.d.ts", code: types.system },
1496
- { file: "selectors.d.ts", code: types.selectors },
1497
- { file: "composition.d.ts", code: types.composition },
1498
- { file: "global.d.ts", code: types.global },
1499
- { file: "recipe.d.ts", code: types.recipe },
1500
- { file: "index.d.ts", code: types.exported },
1501
- { file: "token.d.ts", code: generateTokenDts(ctx.tokens) },
1502
- { file: "prop-type.d.ts", code: generatePropTypes(ctx.utility) },
1503
- { file: "style-props.d.ts", code: types.styleProps },
1504
- { file: "conditions.d.ts", code: conditions.dts }
1505
- ].filter(Boolean)
1506
- };
1507
- }
1508
- function setupCss(ctx) {
1509
- const code = generateCssFn(ctx);
1510
- const conditions = generateConditions(ctx);
1511
- return {
1512
- dir: ctx.paths.css,
1513
- files: [
1514
- { file: ctx.getExt("conditions"), code: conditions.js },
1515
- { file: ctx.getExt("css"), code: code.js },
1516
- { file: "css.d.ts", code: code.dts }
1517
- ]
1518
- };
1519
- }
1520
- function setupCva(ctx) {
1521
- const code = generateCvaFn(ctx);
1522
- return {
1523
- dir: ctx.paths.css,
1524
- files: [
1525
- { file: ctx.getExt("cva"), code: code.js },
1526
- { file: "cva.d.ts", code: code.dts }
1527
- ]
1528
- };
1529
- }
1530
- function setupCx(ctx) {
1531
- const code = generateCx();
1532
- return {
1533
- dir: ctx.paths.css,
1534
- files: [
1535
- { file: ctx.getExt("cx"), code: code.js },
1536
- { file: "cx.d.ts", code: code.dts }
1537
- ]
1538
- };
1539
- }
1540
- function setupRecipes(ctx) {
1541
- const code = generateRecipes(ctx);
1542
- if (!code)
1543
- return;
1544
- return {
1545
- dir: ctx.paths.recipe,
1546
- files: [
1547
- { file: ctx.getExt("index"), code: code.js },
1548
- { file: "index.d.ts", code: code.dts }
1549
- ]
1550
- };
1551
- }
1552
- function setupPatterns(ctx) {
1553
- const files = generatePattern(ctx);
1554
- if (!files)
1555
- return;
1556
- const index = {
1557
- js: outdent24.string(files.map((file) => ctx.getExport(`./${file.name}`)).join("\n")),
1558
- dts: outdent24.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
1559
- };
1560
- return {
1561
- dir: ctx.paths.pattern,
1562
- files: [
1563
- ...files.map((file) => ({ file: ctx.getExt(file.name), code: file.js })),
1564
- ...files.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
1565
- { file: ctx.getExt("index"), code: index.js },
1566
- { file: "index.d.ts", code: index.dts }
1567
- ]
1568
- };
1569
- }
1570
- function setupJsx(ctx) {
1571
- if (!ctx.jsxFramework)
1572
- return;
1573
- const isValidProp = generateisValidProp(ctx);
1574
- const types = generateJsxTypes(ctx);
1575
- const factory = generateJsxFactory(ctx);
1576
- const patterns = generateJsxPatterns(ctx);
1577
- const layoutGrid2 = generateLayoutGrid(ctx);
1578
- const index = {
1579
- js: outdent24`
1580
- ${ctx.getExport("./factory")}
1581
- ${ctx.getExport("./layout-grid")}
1582
- ${outdent24.string(patterns.map((file) => ctx.getExport(`./${file.name}`)).join("\n"))}
1583
- `,
1584
- dts: outdent24`
1585
- export * from './factory'
1586
- export * from './layout-grid'
1587
- ${outdent24.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
1588
- export type { ${ctx.jsxFactoryDetails.typeName} } from '../types/jsx'
1589
- `
1590
- };
1591
- return {
1592
- dir: ctx.paths.jsx,
1593
- files: [
1594
- ...patterns.map((file) => ({ file: ctx.getExt(file.name), code: file.js })),
1595
- ...patterns.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
1596
- { file: ctx.getExt("layout-grid"), code: layoutGrid2.js },
1597
- { file: "layout-grid.d.ts", code: layoutGrid2.dts },
1598
- { file: ctx.getExt("is-valid-prop"), code: isValidProp.js },
1599
- { file: "factory.d.ts", code: types.jsxFactory },
1600
- { file: ctx.getExt("factory"), code: factory.js },
1601
- { file: "index.d.ts", code: index.dts },
1602
- { file: ctx.getExt("index"), code: index.js }
1603
- ]
1604
- };
1605
- }
1606
- function setupCssIndex(ctx) {
1607
- const index = {
1608
- js: outdent24`
1609
- ${ctx.getExport("./css")}
1610
- ${ctx.getExport("./cx")}
1611
- ${ctx.getExport("./cva")}
1612
- `,
1613
- dts: outdent24`
1614
- export * from './css'
1615
- export * from './cx'
1616
- export * from './cva'
1617
- `
1618
- };
1619
- return {
1620
- dir: ctx.paths.css,
1621
- files: [
1622
- { file: ctx.getExt("index"), code: index.js },
1623
- { file: "index.d.ts", code: index.dts }
1624
- ]
1625
- };
1626
- }
1627
- function setupResetCss(ctx) {
1628
- if (!ctx.preflight)
1629
- return;
1630
- const code = generateResetCss();
1631
- return { files: [{ file: "reset.css", code }] };
1632
- }
1633
- function setupLayoutGridCss() {
1634
- const code = generateLayoutGridCss();
1635
- return { files: [{ file: "layout-grid.css", code }] };
1636
- }
1637
- function setupPackageJson(ctx) {
1638
- if (!ctx.emitPackage)
1639
- return;
1640
- return {
1641
- files: [{ file: "package.json", code: generatePackageJSON(ctx) }]
1642
1020
  };
1643
1021
  }
1644
- function generateSystem(ctx) {
1645
- return [
1646
- setupHelpers(ctx),
1647
- setupDesignTokens(ctx),
1648
- setupKeyframes(ctx),
1649
- setupTypes(ctx),
1650
- setupCva(ctx),
1651
- setupCx(ctx),
1652
- setupCss(ctx),
1653
- setupRecipes(ctx),
1654
- setupPatterns(ctx),
1655
- setupCssIndex(ctx),
1656
- setupJsx(ctx),
1657
- setupResetCss(ctx),
1658
- setupLayoutGridCss(),
1659
- setupPackageJson(ctx)
1660
- ].filter(Boolean);
1661
- }
1662
-
1663
- // src/messages.ts
1664
- import { colors, logger as logger3, quote as quote2 } from "@pandacss/logger";
1665
- import { outdent as outdent25 } from "outdent";
1666
- var tick = colors.green().bold("\u2714\uFE0F");
1667
- function artifactsGeneratedMessage(ctx) {
1668
- return [
1669
- outdent25`
1670
- ${tick} ${quote2(ctx.outdir, "/css")}: the css function to author styles
1671
- `,
1672
- ctx.hasTokens && outdent25`
1673
- ${tick} ${quote2(ctx.outdir, "/tokens")}: the css variables and js function to query your tokens
1674
- `,
1675
- ctx.hasPatterns && outdent25`
1676
- ${tick} ${quote2(ctx.outdir, "/patterns")}: functions to implement common css patterns
1677
- `,
1678
- ctx.hasRecipes && outdent25`
1679
- ${tick} ${quote2(ctx.outdir, "/recipes")}: functions to create multi-variant styles
1680
- `,
1681
- ctx.jsxFramework && outdent25`
1682
- ${tick} ${quote2(ctx.outdir, "/jsx")}: style prop powered elements for ${ctx.jsxFramework}
1683
- `,
1684
- "\n"
1685
- ].filter(Boolean).join("\n");
1686
- }
1687
- function configExistsMessage(cmd) {
1688
- return outdent25`
1689
- \n
1690
- It looks like you already have panda created\`.
1691
-
1692
- You can now run ${quote2(cmd, " panda --watch")}.
1693
-
1694
- `;
1695
- }
1696
- function thankYouMessage() {
1697
- return outdent25`
1698
-
1699
- 🚀 Thanks for choosing ${colors.cyan("Panda")} to write your css.
1700
-
1701
- You are set up to start using Panda!
1702
-
1703
- `;
1704
- }
1705
- var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
1706
- var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
1707
- function scaffoldCompleteMessage() {
1708
- return logger3.box(
1709
- outdent25`
1710
-
1711
- ${colors.bold().cyan("Next steps:")}
1712
-
1713
- [1] Create a ${quote2("index.css")} file in your project that contains:
1714
-
1715
- @layer reset, base, tokens, recipes, utilities;
1716
-
1717
-
1718
- [2] Import the ${quote2("index.css")} file at the root of your project.
1719
-
1720
- `,
1721
- `\u{1F43C} ${pickRandom(randomWords)}! \u2728`
1722
- );
1723
- }
1724
- function watchMessage() {
1725
- return outdent25`
1726
- Watching for file changes...
1727
- `;
1728
- }
1729
- function buildCompleteMessage(ctx) {
1730
- return outdent25`
1731
- Successfully extracted css from ${ctx.files.length} file(s) ✨
1732
- `;
1733
- }
1734
-
1735
- // src/artifacts.ts
1736
- async function emitArtifacts(ctx) {
1737
- if (ctx.clean)
1738
- await ctx.cleanOutdir();
1739
- const tasks = generateSystem(ctx).map((file) => ctx.writeOutput(file));
1740
- await Promise.all(tasks);
1741
- return artifactsGeneratedMessage(ctx) + scaffoldCompleteMessage();
1742
- }
1743
- async function emitAndExtract(ctx) {
1744
- await emitArtifacts(ctx);
1745
- return extractCss(ctx);
1746
- }
1747
- async function extractCss(ctx) {
1748
- await extractGlobalCss(ctx);
1749
- await extractStaticCss(ctx);
1750
- await extractFiles(ctx);
1751
- await bundleChunks(ctx);
1752
- return buildCompleteMessage(ctx);
1753
- }
1754
-
1755
- // src/builder.ts
1756
- import { discardDuplicate, mergeCss as mergeCss2, Stylesheet as Stylesheet3 } from "@pandacss/core";
1757
- import { ConfigNotFoundError } from "@pandacss/error";
1758
- import { logger as logger5 } from "@pandacss/logger";
1759
- import { toHash } from "@pandacss/shared";
1760
- import { existsSync as existsSync2, readFileSync as readFileSync5 } from "fs";
1761
- import { statSync } from "fs-extra";
1762
- import { resolve as resolve3 } from "path";
1763
-
1764
- // src/get-base-css.ts
1765
- function getBaseCss(ctx) {
1766
- const css3 = [
1767
- generateResetCss(),
1768
- generateLayoutGridCss(),
1769
- generateTokenCss(ctx),
1770
- generateKeyframes(ctx.theme.keyframes),
1771
- ctx.getGlobalCss(),
1772
- ctx.getStaticCss()
1773
- ];
1774
- return css3.filter(Boolean).join("\n\n");
1775
- }
1776
-
1777
- // src/config.ts
1778
- import { loadConfigFile } from "@pandacss/config";
1779
- import { lookItUpSync } from "look-it-up";
1780
-
1781
- // src/context.ts
1782
- import {
1783
- assignCompositions,
1784
- Conditions,
1785
- getStaticCss as getStaticCssCore,
1786
- mergeCss,
1787
- Stylesheet as Stylesheet2,
1788
- Utility
1789
- } from "@pandacss/core";
1790
- import { isCssProperty } from "@pandacss/is-valid-prop";
1791
- import { logger as logger4 } from "@pandacss/logger";
1792
- import { createProject } from "@pandacss/parser";
1793
- import { capitalize as capitalize4, compact, dashCase as dashCase2, mapObject, splitProps, uncapitalize } from "@pandacss/shared";
1794
- import { TokenDictionary } from "@pandacss/token-dictionary";
1795
- import glob from "fast-glob";
1796
- import { readdirSync, readFileSync as readFileSync4 } from "fs";
1797
- import { emptyDir, ensureDir, existsSync } from "fs-extra";
1798
- import { readFile, unlink, writeFile } from "fs/promises";
1799
- import { extname, isAbsolute, join as join2, relative, resolve, sep } from "path";
1800
- import postcss2 from "postcss";
1801
- import { match as match5, P } from "ts-pattern";
1802
- var helpers = {
1803
- map: mapObject
1022
+ styles.visible = {
1023
+ get() {
1024
+ const builder = createBuilder(this, this[STYLER], true);
1025
+ Object.defineProperty(this, "visible", { value: builder });
1026
+ return builder;
1027
+ }
1804
1028
  };
1805
- var fileSystem = {
1806
- read: (path) => {
1807
- return readFile(path, "utf-8");
1808
- },
1809
- write: (path, code) => {
1810
- return writeFile(path, code);
1811
- },
1812
- rm: (path) => {
1813
- return unlink(path);
1029
+ var getModelAnsi = (model, level, type, ...arguments_) => {
1030
+ if (model === "rgb") {
1031
+ if (level === "ansi16m") {
1032
+ return ansi_styles_default[type].ansi16m(...arguments_);
1033
+ }
1034
+ if (level === "ansi256") {
1035
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
1036
+ }
1037
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
1814
1038
  }
1039
+ if (model === "hex") {
1040
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
1041
+ }
1042
+ return ansi_styles_default[type][model](...arguments_);
1815
1043
  };
1816
- function createContext(conf, io = fileSystem) {
1817
- const { config } = conf;
1818
- const {
1819
- cwd: cwdProp = process.cwd(),
1820
- conditions: conditionsProp = {},
1821
- prefix,
1822
- cssVarRoot = ":where(:root, :host)",
1823
- outdir,
1824
- exclude: excludeProp = [],
1825
- patterns = {},
1826
- theme = {},
1827
- utilities = {},
1828
- hash,
1829
- jsxFactory = "panda",
1830
- jsxFramework,
1831
- globalCss,
1832
- separator,
1833
- static: staticCss,
1834
- outExtension = "mjs",
1835
- emitPackage
1836
- } = config;
1837
- const {
1838
- breakpoints = {},
1839
- tokens: tokensProp = {},
1840
- semanticTokens = {},
1841
- recipes = {},
1842
- textStyles,
1843
- layerStyles
1844
- } = theme;
1845
- const jsxFactoryDetails = {
1846
- name: jsxFactory,
1847
- upperName: capitalize4(jsxFactory),
1848
- typeName: `HTML${capitalize4(jsxFactory)}Props`,
1849
- componentName: `${capitalize4(jsxFactory)}Component`,
1850
- framework: jsxFramework
1044
+ var usedModels = ["rgb", "hex", "ansi256"];
1045
+ for (const model of usedModels) {
1046
+ styles[model] = {
1047
+ get() {
1048
+ const { level } = this;
1049
+ return function(...arguments_) {
1050
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
1051
+ return createBuilder(this, styler, this[IS_EMPTY]);
1052
+ };
1053
+ }
1851
1054
  };
1852
- const cwd = resolve(cwdProp);
1853
- const exclude = [".git", ".yarn", "node_modules", "test-results"].concat(excludeProp);
1854
- const tokens = new TokenDictionary({
1855
- tokens: tokensProp,
1856
- breakpoints,
1857
- semanticTokens,
1858
- prefix
1859
- });
1860
- const hasTokens = !tokens.isEmpty;
1861
- logger4.debug("ctx:token", tokens.allNames);
1862
- const utility = new Utility({
1863
- prefix,
1864
- tokens,
1865
- config: utilities,
1866
- separator
1867
- });
1868
- const conditions = new Conditions({
1869
- conditions: conditionsProp,
1870
- breakpoints
1871
- });
1872
- logger4.debug("ctx:conditions", conditions);
1873
- assignCompositions(
1874
- { conditions, utility },
1875
- compact({
1876
- textStyle: textStyles,
1877
- layerStyle: layerStyles
1878
- })
1879
- );
1880
- const context = () => ({
1881
- root: postcss2.root(),
1882
- conditions,
1883
- hash,
1884
- helpers,
1885
- utility
1886
- });
1887
- function getPattern(name) {
1888
- return patterns[name];
1055
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1056
+ styles[bgModel] = {
1057
+ get() {
1058
+ const { level } = this;
1059
+ return function(...arguments_) {
1060
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
1061
+ return createBuilder(this, styler, this[IS_EMPTY]);
1062
+ };
1063
+ }
1064
+ };
1065
+ }
1066
+ var proto = Object.defineProperties(() => {
1067
+ }, {
1068
+ ...styles,
1069
+ level: {
1070
+ enumerable: true,
1071
+ get() {
1072
+ return this[GENERATOR].level;
1073
+ },
1074
+ set(level) {
1075
+ this[GENERATOR].level = level;
1076
+ }
1889
1077
  }
1890
- function execPattern(name, data) {
1891
- const pattern = getPattern(name);
1892
- return pattern?.transform?.(data, helpers) ?? {};
1078
+ });
1079
+ var createStyler = (open, close, parent) => {
1080
+ let openAll;
1081
+ let closeAll;
1082
+ if (parent === void 0) {
1083
+ openAll = open;
1084
+ closeAll = close;
1085
+ } else {
1086
+ openAll = parent.openAll + open;
1087
+ closeAll = close + parent.closeAll;
1893
1088
  }
1894
- function getPatternDetails(name, pattern) {
1895
- const upperName = capitalize4(name);
1896
- return {
1897
- name,
1898
- props: Object.keys(pattern?.properties ?? {}),
1899
- dashName: dashCase2(name),
1900
- upperName,
1901
- styleFn: `get${upperName}Style`,
1902
- jsxName: pattern?.jsx ?? upperName,
1903
- blocklistType: pattern?.blocklist ? `| '${pattern.blocklist.join("' | '")}'` : ""
1904
- };
1089
+ return {
1090
+ open,
1091
+ close,
1092
+ openAll,
1093
+ closeAll,
1094
+ parent
1095
+ };
1096
+ };
1097
+ var createBuilder = (self, _styler, _isEmpty) => {
1098
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1099
+ Object.setPrototypeOf(builder, proto);
1100
+ builder[GENERATOR] = self;
1101
+ builder[STYLER] = _styler;
1102
+ builder[IS_EMPTY] = _isEmpty;
1103
+ return builder;
1104
+ };
1105
+ var applyStyle = (self, string) => {
1106
+ if (self.level <= 0 || !string) {
1107
+ return self[IS_EMPTY] ? "" : string;
1108
+ }
1109
+ let styler = self[STYLER];
1110
+ if (styler === void 0) {
1111
+ return string;
1112
+ }
1113
+ const { openAll, closeAll } = styler;
1114
+ if (string.includes("\x1B")) {
1115
+ while (styler !== void 0) {
1116
+ string = stringReplaceAll(string, styler.close, styler.open);
1117
+ styler = styler.parent;
1118
+ }
1119
+ }
1120
+ const lfIndex = string.indexOf("\n");
1121
+ if (lfIndex !== -1) {
1122
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1123
+ }
1124
+ return openAll + string + closeAll;
1125
+ };
1126
+ Object.defineProperties(createChalk.prototype, styles);
1127
+ var chalk = createChalk();
1128
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1129
+ var source_default = chalk;
1130
+
1131
+ // ../../node_modules/.pnpm/widest-line@4.0.1/node_modules/widest-line/index.js
1132
+ init_esm_shims();
1133
+ function widestLine(string) {
1134
+ let lineWidth = 0;
1135
+ for (const line of string.split("\n")) {
1136
+ lineWidth = Math.max(lineWidth, stringWidth(line));
1137
+ }
1138
+ return lineWidth;
1139
+ }
1140
+
1141
+ // ../../node_modules/.pnpm/boxen@7.0.1/node_modules/boxen/index.js
1142
+ var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1143
+
1144
+ // ../../node_modules/.pnpm/camelcase@7.0.0/node_modules/camelcase/index.js
1145
+ init_esm_shims();
1146
+ var UPPERCASE = /[\p{Lu}]/u;
1147
+ var LOWERCASE = /[\p{Ll}]/u;
1148
+ var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
1149
+ var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
1150
+ var SEPARATORS = /[_.\- ]+/;
1151
+ var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
1152
+ var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
1153
+ var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
1154
+ var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
1155
+ let isLastCharLower = false;
1156
+ let isLastCharUpper = false;
1157
+ let isLastLastCharUpper = false;
1158
+ for (let index = 0; index < string.length; index++) {
1159
+ const character = string[index];
1160
+ if (isLastCharLower && UPPERCASE.test(character)) {
1161
+ string = string.slice(0, index) + "-" + string.slice(index);
1162
+ isLastCharLower = false;
1163
+ isLastLastCharUpper = isLastCharUpper;
1164
+ isLastCharUpper = true;
1165
+ index++;
1166
+ } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
1167
+ string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
1168
+ isLastLastCharUpper = isLastCharUpper;
1169
+ isLastCharUpper = false;
1170
+ isLastCharLower = true;
1171
+ } else {
1172
+ isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
1173
+ isLastLastCharUpper = isLastCharUpper;
1174
+ isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
1175
+ }
1905
1176
  }
1906
- const patternNodes = Object.entries(patterns).map(([name, pattern]) => ({
1907
- type: "pattern",
1908
- name: pattern.jsx ?? capitalize4(name),
1909
- props: Object.keys(pattern.properties),
1910
- baseName: name
1911
- }));
1912
- function getPatternFnName(jsx) {
1913
- return patternNodes.find((node) => node.name === jsx)?.baseName ?? uncapitalize(jsx);
1914
- }
1915
- const hasPatterns = Object.keys(patterns).length > 0;
1916
- function getRecipe(name) {
1917
- return recipes[name];
1918
- }
1919
- const recipeNodes = Object.entries(recipes).map(([name, recipe]) => ({
1920
- type: "recipe",
1921
- name: recipe.jsx ?? capitalize4(name),
1922
- props: Object.keys(recipe.variants ?? {}),
1923
- baseName: name
1924
- }));
1925
- function getRecipeFnName(jsx) {
1926
- return recipeNodes.find((node) => node.name === jsx)?.baseName ?? uncapitalize(jsx);
1927
- }
1928
- function splitRecipeProps(name, props) {
1929
- const recipe = recipeNodes.find((node) => node.name === name);
1930
- if (!recipe)
1931
- return [{}, props];
1932
- return splitProps(props, recipe.props);
1933
- }
1934
- function getRecipeDetails() {
1935
- return Object.entries(recipes).map(([name, recipe]) => ({
1936
- [name]: Object.entries(recipe.variants ?? {}).map(([key, value]) => ({
1937
- [key]: Object.keys(value)
1938
- }))
1939
- }));
1940
- }
1941
- const hasRecipes = Object.keys(recipes).length > 0;
1942
- const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
1943
- function isCustomCssProperty(prop) {
1944
- const regex = new RegExp("^(?:" + properties.join("|") + ")$");
1945
- return regex.test(prop);
1946
- }
1947
- function isStyleProp(prop) {
1948
- return isCssProperty(prop) || isCustomCssProperty(prop);
1949
- }
1950
- function getPath(pathLike) {
1951
- const paths2 = [cwd, emitPackage ? "node_modules" : void 0, outdir, pathLike].filter(Boolean);
1952
- return join2(...paths2);
1953
- }
1954
- function absPath(str) {
1955
- return isAbsolute(str) ? str : join2(cwd, str);
1956
- }
1957
- function getExt(file) {
1958
- return `${file}.${outExtension}`;
1959
- }
1960
- function getImport(items, mod) {
1961
- return `import { ${items} } from '${getExt(mod)}';`;
1962
- }
1963
- function getExport(mod) {
1964
- return `export * from '${getExt(mod)}';`;
1965
- }
1966
- const paths = {
1967
- root: getPath(),
1968
- css: getPath("css"),
1969
- token: getPath("tokens"),
1970
- types: getPath("types"),
1971
- recipe: getPath("recipes"),
1972
- pattern: getPath("patterns"),
1973
- chunk: getPath("chunks"),
1974
- outCss: getPath("styles.css"),
1975
- jsx: getPath("jsx")
1177
+ return string;
1178
+ };
1179
+ var preserveConsecutiveUppercase = (input, toLowerCase) => {
1180
+ LEADING_CAPITAL.lastIndex = 0;
1181
+ return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
1182
+ };
1183
+ var postProcess = (input, toUpperCase) => {
1184
+ SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
1185
+ NUMBERS_AND_IDENTIFIER.lastIndex = 0;
1186
+ return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
1187
+ };
1188
+ function camelCase(input, options) {
1189
+ if (!(typeof input === "string" || Array.isArray(input))) {
1190
+ throw new TypeError("Expected the input to be `string | string[]`");
1191
+ }
1192
+ options = {
1193
+ pascalCase: false,
1194
+ preserveConsecutiveUppercase: false,
1195
+ ...options
1976
1196
  };
1977
- async function write(dir, options) {
1978
- await ensureDir(dir);
1979
- return Promise.all(
1980
- options.map(async ({ file, code }) => {
1981
- const absPath2 = join2(dir, file);
1982
- if (code) {
1983
- return io.write(absPath2, code);
1984
- }
1985
- })
1986
- );
1197
+ if (Array.isArray(input)) {
1198
+ input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
1199
+ } else {
1200
+ input = input.trim();
1987
1201
  }
1988
- function cleanOutdir() {
1989
- return emptyDir(paths.root);
1202
+ if (input.length === 0) {
1203
+ return "";
1990
1204
  }
1991
- function writeOutput(output) {
1992
- if (!output)
1993
- return;
1994
- const { dir = paths.root, files: files2 } = output;
1995
- return write(dir, files2);
1996
- }
1997
- const chunks = {
1998
- dir: paths.chunk,
1999
- readFile(file) {
2000
- let fileName = chunks.format(file);
2001
- fileName = join2(paths.chunk, fileName);
2002
- if (!existsSync(fileName)) {
2003
- return Promise.resolve("");
2004
- }
2005
- return io.read(fileName);
1205
+ const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
1206
+ const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
1207
+ if (input.length === 1) {
1208
+ if (SEPARATORS.test(input)) {
1209
+ return "";
1210
+ }
1211
+ return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
1212
+ }
1213
+ const hasUpperCase = input !== toLowerCase(input);
1214
+ if (hasUpperCase) {
1215
+ input = preserveCamelCase(input, toLowerCase, toUpperCase);
1216
+ }
1217
+ input = input.replace(LEADING_SEPARATORS, "");
1218
+ input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
1219
+ if (options.pascalCase) {
1220
+ input = toUpperCase(input.charAt(0)) + input.slice(1);
1221
+ }
1222
+ return postProcess(input, toUpperCase);
1223
+ }
1224
+
1225
+ // ../../node_modules/.pnpm/boxen@7.0.1/node_modules/boxen/index.js
1226
+ var import_ansi_align = __toESM(require_ansi_align(), 1);
1227
+
1228
+ // ../../node_modules/.pnpm/wrap-ansi@8.0.1/node_modules/wrap-ansi/index.js
1229
+ init_esm_shims();
1230
+
1231
+ // ../../node_modules/.pnpm/ansi-styles@6.1.1/node_modules/ansi-styles/index.js
1232
+ init_esm_shims();
1233
+ var ANSI_BACKGROUND_OFFSET2 = 10;
1234
+ var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
1235
+ var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
1236
+ var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
1237
+ function assembleStyles2() {
1238
+ const codes = /* @__PURE__ */ new Map();
1239
+ const styles2 = {
1240
+ modifier: {
1241
+ reset: [0, 0],
1242
+ bold: [1, 22],
1243
+ dim: [2, 22],
1244
+ italic: [3, 23],
1245
+ underline: [4, 24],
1246
+ overline: [53, 55],
1247
+ inverse: [7, 27],
1248
+ hidden: [8, 28],
1249
+ strikethrough: [9, 29]
2006
1250
  },
2007
- getFiles() {
2008
- if (!existsSync(chunks.dir))
2009
- return [];
2010
- return readdirSync(chunks.dir);
1251
+ color: {
1252
+ black: [30, 39],
1253
+ red: [31, 39],
1254
+ green: [32, 39],
1255
+ yellow: [33, 39],
1256
+ blue: [34, 39],
1257
+ magenta: [35, 39],
1258
+ cyan: [36, 39],
1259
+ white: [37, 39],
1260
+ blackBright: [90, 39],
1261
+ redBright: [91, 39],
1262
+ greenBright: [92, 39],
1263
+ yellowBright: [93, 39],
1264
+ blueBright: [94, 39],
1265
+ magentaBright: [95, 39],
1266
+ cyanBright: [96, 39],
1267
+ whiteBright: [97, 39]
2011
1268
  },
2012
- format(file) {
2013
- return relative(cwd, file).replaceAll(sep, "__").replace(extname(file), ".css");
1269
+ bgColor: {
1270
+ bgBlack: [40, 49],
1271
+ bgRed: [41, 49],
1272
+ bgGreen: [42, 49],
1273
+ bgYellow: [43, 49],
1274
+ bgBlue: [44, 49],
1275
+ bgMagenta: [45, 49],
1276
+ bgCyan: [46, 49],
1277
+ bgWhite: [47, 49],
1278
+ bgBlackBright: [100, 49],
1279
+ bgRedBright: [101, 49],
1280
+ bgGreenBright: [102, 49],
1281
+ bgYellowBright: [103, 49],
1282
+ bgBlueBright: [104, 49],
1283
+ bgMagentaBright: [105, 49],
1284
+ bgCyanBright: [106, 49],
1285
+ bgWhiteBright: [107, 49]
1286
+ }
1287
+ };
1288
+ styles2.color.gray = styles2.color.blackBright;
1289
+ styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
1290
+ styles2.color.grey = styles2.color.blackBright;
1291
+ styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
1292
+ for (const [groupName, group] of Object.entries(styles2)) {
1293
+ for (const [styleName, style] of Object.entries(group)) {
1294
+ styles2[styleName] = {
1295
+ open: `\x1B[${style[0]}m`,
1296
+ close: `\x1B[${style[1]}m`
1297
+ };
1298
+ group[styleName] = styles2[styleName];
1299
+ codes.set(style[0], style[1]);
1300
+ }
1301
+ Object.defineProperty(styles2, groupName, {
1302
+ value: group,
1303
+ enumerable: false
1304
+ });
1305
+ }
1306
+ Object.defineProperty(styles2, "codes", {
1307
+ value: codes,
1308
+ enumerable: false
1309
+ });
1310
+ styles2.color.close = "\x1B[39m";
1311
+ styles2.bgColor.close = "\x1B[49m";
1312
+ styles2.color.ansi = wrapAnsi162();
1313
+ styles2.color.ansi256 = wrapAnsi2562();
1314
+ styles2.color.ansi16m = wrapAnsi16m2();
1315
+ styles2.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
1316
+ styles2.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
1317
+ styles2.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
1318
+ Object.defineProperties(styles2, {
1319
+ rgbToAnsi256: {
1320
+ value: (red, green, blue) => {
1321
+ if (red === green && green === blue) {
1322
+ if (red < 8) {
1323
+ return 16;
1324
+ }
1325
+ if (red > 248) {
1326
+ return 231;
1327
+ }
1328
+ return Math.round((red - 8) / 247 * 24) + 232;
1329
+ }
1330
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1331
+ },
1332
+ enumerable: false
2014
1333
  },
2015
- async write(file, css3) {
2016
- const fileName = chunks.format(file);
2017
- const oldCss = await chunks.readFile(file);
2018
- const newCss = mergeCss(oldCss, css3);
2019
- logger4.debug("chunk:write", { file, path: fileName });
2020
- return write(paths.chunk, [{ file: fileName, code: newCss }]);
1334
+ hexToRgb: {
1335
+ value: (hex) => {
1336
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1337
+ if (!matches) {
1338
+ return [0, 0, 0];
1339
+ }
1340
+ let [colorString] = matches;
1341
+ if (colorString.length === 3) {
1342
+ colorString = [...colorString].map((character) => character + character).join("");
1343
+ }
1344
+ const integer = Number.parseInt(colorString, 16);
1345
+ return [
1346
+ integer >> 16 & 255,
1347
+ integer >> 8 & 255,
1348
+ integer & 255
1349
+ ];
1350
+ },
1351
+ enumerable: false
2021
1352
  },
2022
- rm(file) {
2023
- const fileName = chunks.format(file);
2024
- return io.rm(join2(paths.chunk, fileName));
1353
+ hexToAnsi256: {
1354
+ value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
1355
+ enumerable: false
2025
1356
  },
2026
- empty() {
2027
- return emptyDir(paths.chunk);
1357
+ ansi256ToAnsi: {
1358
+ value: (code) => {
1359
+ if (code < 8) {
1360
+ return 30 + code;
1361
+ }
1362
+ if (code < 16) {
1363
+ return 90 + (code - 8);
1364
+ }
1365
+ let red;
1366
+ let green;
1367
+ let blue;
1368
+ if (code >= 232) {
1369
+ red = ((code - 232) * 10 + 8) / 255;
1370
+ green = red;
1371
+ blue = red;
1372
+ } else {
1373
+ code -= 16;
1374
+ const remainder = code % 36;
1375
+ red = Math.floor(code / 36) / 5;
1376
+ green = Math.floor(remainder / 6) / 5;
1377
+ blue = remainder % 6 / 5;
1378
+ }
1379
+ const value = Math.max(red, green, blue) * 2;
1380
+ if (value === 0) {
1381
+ return 30;
1382
+ }
1383
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1384
+ if (value === 2) {
1385
+ result += 60;
1386
+ }
1387
+ return result;
1388
+ },
1389
+ enumerable: false
2028
1390
  },
2029
- glob: [`${paths.chunk}/**/*.css`]
2030
- };
2031
- function getFiles() {
2032
- if (!config.include)
2033
- return [];
2034
- return glob.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
2035
- }
2036
- const files = getFiles();
2037
- logger4.debug("ctx:files", files);
2038
- const importMap = {
2039
- css: `${outdir}/css`,
2040
- recipe: `${outdir}/recipes`,
2041
- pattern: `${outdir}/patterns`,
2042
- jsx: `${outdir}/jsx`
2043
- };
2044
- const project = createProject({
2045
- getFiles,
2046
- readFile(filePath) {
2047
- return readFileSync4(filePath, "utf8");
1391
+ rgbToAnsi: {
1392
+ value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
1393
+ enumerable: false
2048
1394
  },
2049
- parserOptions: {
2050
- importMap,
2051
- jsx: {
2052
- factory: jsxFactory,
2053
- isStyleProp,
2054
- nodes: [...patternNodes, ...recipeNodes]
2055
- }
1395
+ hexToAnsi: {
1396
+ value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
1397
+ enumerable: false
2056
1398
  }
2057
1399
  });
2058
- function getGlobalCss() {
2059
- const sheet = new Stylesheet2(context());
2060
- sheet.processGlobalCss({
2061
- ":root": { "--made-with-panda": `'\u{1F43C}'` }
2062
- });
2063
- if (globalCss) {
2064
- sheet.processGlobalCss(globalCss);
1400
+ return styles2;
1401
+ }
1402
+ var ansiStyles2 = assembleStyles2();
1403
+ var ansi_styles_default2 = ansiStyles2;
1404
+
1405
+ // ../../node_modules/.pnpm/wrap-ansi@8.0.1/node_modules/wrap-ansi/index.js
1406
+ var ESCAPES = /* @__PURE__ */ new Set([
1407
+ "\x1B",
1408
+ "\x9B"
1409
+ ]);
1410
+ var END_CODE = 39;
1411
+ var ANSI_ESCAPE_BELL = "\x07";
1412
+ var ANSI_CSI = "[";
1413
+ var ANSI_OSC = "]";
1414
+ var ANSI_SGR_TERMINATOR = "m";
1415
+ var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
1416
+ var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
1417
+ var wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
1418
+ var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
1419
+ var wrapWord = (rows, word, columns) => {
1420
+ const characters = [...word];
1421
+ let isInsideEscape = false;
1422
+ let isInsideLinkEscape = false;
1423
+ let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
1424
+ for (const [index, character] of characters.entries()) {
1425
+ const characterLength = stringWidth(character);
1426
+ if (visible + characterLength <= columns) {
1427
+ rows[rows.length - 1] += character;
1428
+ } else {
1429
+ rows.push(character);
1430
+ visible = 0;
1431
+ }
1432
+ if (ESCAPES.has(character)) {
1433
+ isInsideEscape = true;
1434
+ isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK);
1435
+ }
1436
+ if (isInsideEscape) {
1437
+ if (isInsideLinkEscape) {
1438
+ if (character === ANSI_ESCAPE_BELL) {
1439
+ isInsideEscape = false;
1440
+ isInsideLinkEscape = false;
1441
+ }
1442
+ } else if (character === ANSI_SGR_TERMINATOR) {
1443
+ isInsideEscape = false;
1444
+ }
1445
+ continue;
1446
+ }
1447
+ visible += characterLength;
1448
+ if (visible === columns && index < characters.length - 1) {
1449
+ rows.push("");
1450
+ visible = 0;
2065
1451
  }
2066
- return sheet.toCss();
2067
1452
  }
2068
- function getStaticCss() {
2069
- if (!staticCss)
2070
- return;
2071
- const sheet = new Stylesheet2(context());
2072
- const recipes2 = getRecipeDetails();
2073
- const getResults = getStaticCssCore(staticCss);
2074
- const results = getResults({
2075
- breakpoints: Object.keys(breakpoints ?? {}),
2076
- getPropertyKeys: utility.getPropertyKeys,
2077
- getRecipeKeys(recipe) {
2078
- return recipes2[recipe];
1453
+ if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
1454
+ rows[rows.length - 2] += rows.pop();
1455
+ }
1456
+ };
1457
+ var stringVisibleTrimSpacesRight = (string) => {
1458
+ const words = string.split(" ");
1459
+ let last = words.length;
1460
+ while (last > 0) {
1461
+ if (stringWidth(words[last - 1]) > 0) {
1462
+ break;
1463
+ }
1464
+ last--;
1465
+ }
1466
+ if (last === words.length) {
1467
+ return string;
1468
+ }
1469
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
1470
+ };
1471
+ var exec = (string, columns, options = {}) => {
1472
+ if (options.trim !== false && string.trim() === "") {
1473
+ return "";
1474
+ }
1475
+ let returnValue = "";
1476
+ let escapeCode;
1477
+ let escapeUrl;
1478
+ const lengths = wordLengths(string);
1479
+ let rows = [""];
1480
+ for (const [index, word] of string.split(" ").entries()) {
1481
+ if (options.trim !== false) {
1482
+ rows[rows.length - 1] = rows[rows.length - 1].trimStart();
1483
+ }
1484
+ let rowLength = stringWidth(rows[rows.length - 1]);
1485
+ if (index !== 0) {
1486
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1487
+ rows.push("");
1488
+ rowLength = 0;
2079
1489
  }
2080
- });
2081
- results.css.forEach((css3) => {
2082
- sheet.processAtomic(css3);
2083
- });
2084
- results.recipes.forEach((result) => {
2085
- Object.entries(result).forEach(([key, value]) => {
2086
- const recipe = getRecipe(key);
2087
- if (!recipe)
2088
- return;
2089
- sheet.processRecipe(recipe, value);
2090
- });
2091
- });
2092
- return sheet.toCss();
1490
+ if (rowLength > 0 || options.trim === false) {
1491
+ rows[rows.length - 1] += " ";
1492
+ rowLength++;
1493
+ }
1494
+ }
1495
+ if (options.hard && lengths[index] > columns) {
1496
+ const remainingColumns = columns - rowLength;
1497
+ const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
1498
+ const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
1499
+ if (breaksStartingNextLine < breaksStartingThisLine) {
1500
+ rows.push("");
1501
+ }
1502
+ wrapWord(rows, word, columns);
1503
+ continue;
1504
+ }
1505
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
1506
+ if (options.wordWrap === false && rowLength < columns) {
1507
+ wrapWord(rows, word, columns);
1508
+ continue;
1509
+ }
1510
+ rows.push("");
1511
+ }
1512
+ if (rowLength + lengths[index] > columns && options.wordWrap === false) {
1513
+ wrapWord(rows, word, columns);
1514
+ continue;
1515
+ }
1516
+ rows[rows.length - 1] += word;
1517
+ }
1518
+ if (options.trim !== false) {
1519
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1520
+ }
1521
+ const pre = [...rows.join("\n")];
1522
+ for (const [index, character] of pre.entries()) {
1523
+ returnValue += character;
1524
+ if (ESCAPES.has(character)) {
1525
+ const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
1526
+ if (groups.code !== void 0) {
1527
+ const code2 = Number.parseFloat(groups.code);
1528
+ escapeCode = code2 === END_CODE ? void 0 : code2;
1529
+ } else if (groups.uri !== void 0) {
1530
+ escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
1531
+ }
1532
+ }
1533
+ const code = ansi_styles_default2.codes.get(Number(escapeCode));
1534
+ if (pre[index + 1] === "\n") {
1535
+ if (escapeUrl) {
1536
+ returnValue += wrapAnsiHyperlink("");
1537
+ }
1538
+ if (escapeCode && code) {
1539
+ returnValue += wrapAnsiCode(code);
1540
+ }
1541
+ } else if (character === "\n") {
1542
+ if (escapeCode && code) {
1543
+ returnValue += wrapAnsiCode(escapeCode);
1544
+ }
1545
+ if (escapeUrl) {
1546
+ returnValue += wrapAnsiHyperlink(escapeUrl);
1547
+ }
1548
+ }
2093
1549
  }
2094
- function getCss(collector, file) {
2095
- const sheet = new Stylesheet2(context());
2096
- collector.css.forEach((result) => {
2097
- sheet.processAtomic(result.data);
2098
- });
2099
- collector.cva.forEach((result) => {
2100
- sheet.processAtomicRecipe(result.data);
2101
- });
2102
- collector.jsx.forEach((result) => {
2103
- const { data, type, name } = result;
2104
- const { css: css3 = {}, ...rest } = data;
2105
- const styles = { ...css3, ...rest };
2106
- match5([name, type]).with([P.string, "pattern"], ([name2]) => {
2107
- collector.setPattern(getPatternFnName(name2), { data: styles });
2108
- }).with([P.string, "recipe"], ([name2]) => {
2109
- const [recipeProps, atomicProps] = splitRecipeProps(name2, styles);
2110
- collector.setRecipe(getRecipeFnName(name2), { data: recipeProps });
2111
- sheet.processAtomic(atomicProps);
2112
- }).otherwise(() => {
2113
- sheet.processAtomic(styles);
2114
- });
2115
- });
2116
- collector.recipe.forEach((result, name) => {
2117
- try {
2118
- for (const item of result) {
2119
- const recipe = getRecipe(name);
2120
- if (!recipe)
2121
- continue;
2122
- sheet.processRecipe(recipe, item.data);
2123
- }
2124
- } catch (error) {
2125
- logger4.error("recipe", error);
1550
+ return returnValue;
1551
+ };
1552
+ function wrapAnsi(string, columns, options) {
1553
+ return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
1554
+ }
1555
+
1556
+ // ../../node_modules/.pnpm/boxen@7.0.1/node_modules/boxen/index.js
1557
+ var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
1558
+ var NEWLINE = "\n";
1559
+ var PAD = " ";
1560
+ var BORDERS_WIDTH = 2;
1561
+ var terminalColumns = () => {
1562
+ const { env: env2, stdout, stderr } = process3;
1563
+ if (stdout?.columns) {
1564
+ return stdout.columns;
1565
+ }
1566
+ if (stderr?.columns) {
1567
+ return stderr.columns;
1568
+ }
1569
+ if (env2.COLUMNS) {
1570
+ return Number.parseInt(env2.COLUMNS, 10);
1571
+ }
1572
+ return 80;
1573
+ };
1574
+ var getObject = (detail) => typeof detail === "number" ? {
1575
+ top: detail,
1576
+ right: detail * 3,
1577
+ bottom: detail,
1578
+ left: detail * 3
1579
+ } : {
1580
+ top: 0,
1581
+ right: 0,
1582
+ bottom: 0,
1583
+ left: 0,
1584
+ ...detail
1585
+ };
1586
+ var getBorderChars = (borderStyle) => {
1587
+ const sides = [
1588
+ "topLeft",
1589
+ "topRight",
1590
+ "bottomRight",
1591
+ "bottomLeft",
1592
+ "left",
1593
+ "right",
1594
+ "top",
1595
+ "bottom"
1596
+ ];
1597
+ let characters;
1598
+ if (typeof borderStyle === "string") {
1599
+ characters = import_cli_boxes.default[borderStyle];
1600
+ if (!characters) {
1601
+ throw new TypeError(`Invalid border style: ${borderStyle}`);
1602
+ }
1603
+ } else {
1604
+ if (typeof borderStyle?.vertical === "string") {
1605
+ borderStyle.left = borderStyle.vertical;
1606
+ borderStyle.right = borderStyle.vertical;
1607
+ }
1608
+ if (typeof borderStyle?.horizontal === "string") {
1609
+ borderStyle.top = borderStyle.horizontal;
1610
+ borderStyle.bottom = borderStyle.horizontal;
1611
+ }
1612
+ for (const side of sides) {
1613
+ if (!borderStyle[side] || typeof borderStyle[side] !== "string") {
1614
+ throw new TypeError(`Invalid border style: ${side}`);
2126
1615
  }
2127
- });
2128
- collector.pattern.forEach((result, name) => {
2129
- try {
2130
- for (const item of result) {
2131
- const styles = execPattern(name, item.data);
2132
- sheet.processAtomic(styles);
1616
+ }
1617
+ characters = borderStyle;
1618
+ }
1619
+ return characters;
1620
+ };
1621
+ var makeTitle = (text, horizontal, alignement) => {
1622
+ let title = "";
1623
+ const textWidth = stringWidth(text);
1624
+ switch (alignement) {
1625
+ case "left":
1626
+ title = text + horizontal.slice(textWidth);
1627
+ break;
1628
+ case "right":
1629
+ title = horizontal.slice(textWidth) + text;
1630
+ break;
1631
+ default:
1632
+ horizontal = horizontal.slice(textWidth);
1633
+ if (horizontal.length % 2 === 1) {
1634
+ horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
1635
+ title = horizontal.slice(1) + text + horizontal;
1636
+ } else {
1637
+ horizontal = horizontal.slice(horizontal.length / 2);
1638
+ title = horizontal + text + horizontal;
1639
+ }
1640
+ break;
1641
+ }
1642
+ return title;
1643
+ };
1644
+ var makeContentText = (text, { padding, width, textAlignment, height }) => {
1645
+ text = (0, import_ansi_align.default)(text, { align: textAlignment });
1646
+ let lines = text.split(NEWLINE);
1647
+ const textWidth = widestLine(text);
1648
+ const max = width - padding.left - padding.right;
1649
+ if (textWidth > max) {
1650
+ const newLines = [];
1651
+ for (const line of lines) {
1652
+ const createdLines = wrapAnsi(line, max, { hard: true });
1653
+ const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
1654
+ const alignedLinesArray = alignedLines.split("\n");
1655
+ const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
1656
+ for (const alignedLine of alignedLinesArray) {
1657
+ let paddedLine;
1658
+ switch (textAlignment) {
1659
+ case "center":
1660
+ paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
1661
+ break;
1662
+ case "right":
1663
+ paddedLine = PAD.repeat(max - longestLength) + alignedLine;
1664
+ break;
1665
+ default:
1666
+ paddedLine = alignedLine;
1667
+ break;
2133
1668
  }
2134
- } catch (error) {
2135
- logger4.error("pattern", error);
1669
+ newLines.push(paddedLine);
2136
1670
  }
2137
- });
2138
- if (collector.isEmpty()) {
2139
- return;
2140
1671
  }
2141
- return {
2142
- css: sheet.toCss({ minify: config.minify }),
2143
- file: chunks.format(file)
2144
- };
1672
+ lines = newLines;
1673
+ }
1674
+ if (textAlignment === "center" && textWidth < max) {
1675
+ lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
1676
+ } else if (textAlignment === "right" && textWidth < max) {
1677
+ lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
1678
+ }
1679
+ const paddingLeft = PAD.repeat(padding.left);
1680
+ const paddingRight = PAD.repeat(padding.right);
1681
+ lines = lines.map((line) => paddingLeft + line + paddingRight);
1682
+ lines = lines.map((line) => {
1683
+ if (width - stringWidth(line) > 0) {
1684
+ switch (textAlignment) {
1685
+ case "center":
1686
+ return line + PAD.repeat(width - stringWidth(line));
1687
+ case "right":
1688
+ return line + PAD.repeat(width - stringWidth(line));
1689
+ default:
1690
+ return line + PAD.repeat(width - stringWidth(line));
1691
+ }
1692
+ }
1693
+ return line;
1694
+ });
1695
+ if (padding.top > 0) {
1696
+ lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
2145
1697
  }
2146
- function extract(fn) {
2147
- return Promise.all(getFiles().map(fn));
1698
+ if (padding.bottom > 0) {
1699
+ lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
2148
1700
  }
2149
- return {
2150
- ...config,
2151
- theme,
2152
- config,
2153
- configPath: conf.path,
2154
- cwd,
2155
- conf,
2156
- chunks,
2157
- files,
2158
- helpers,
2159
- context,
2160
- exclude,
2161
- conditions,
2162
- importMap,
2163
- absPath,
2164
- project,
2165
- getPath,
2166
- paths,
2167
- write,
2168
- writeOutput,
2169
- cleanOutdir,
2170
- getExt,
2171
- getImport,
2172
- getExport,
2173
- cssVarRoot,
2174
- tokens,
2175
- hasTokens,
2176
- utility,
2177
- getCss,
2178
- getGlobalCss,
2179
- getStaticCss,
2180
- patterns,
2181
- hasPatterns,
2182
- getPattern,
2183
- execPattern,
2184
- patternNodes,
2185
- getPatternFnName,
2186
- getPatternDetails,
2187
- recipes,
2188
- getRecipe,
2189
- hasRecipes,
2190
- getRecipeDetails,
2191
- jsxFactory,
2192
- jsxFactoryDetails,
2193
- properties,
2194
- extract
1701
+ if (height && lines.length > height) {
1702
+ lines = lines.slice(0, height);
1703
+ } else if (height && lines.length < height) {
1704
+ lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
1705
+ }
1706
+ return lines.join(NEWLINE);
1707
+ };
1708
+ var boxContent = (content, contentWidth, options) => {
1709
+ const colorizeBorder = (border) => {
1710
+ const newBorder = options.borderColor ? getColorFn(options.borderColor)(border) : border;
1711
+ return options.dimBorder ? source_default.dim(newBorder) : newBorder;
2195
1712
  };
2196
- }
2197
-
2198
- // src/config.ts
2199
- var configs = [".ts", ".js", ".mjs", ".cjs"];
2200
- function findConfig() {
2201
- for (const config of configs) {
2202
- const result = lookItUpSync(`panda.config${config}`);
2203
- if (result) {
2204
- return result;
1713
+ const colorizeContent = (content2) => options.backgroundColor ? getBGColorFn(options.backgroundColor)(content2) : content2;
1714
+ const chars = getBorderChars(options.borderStyle);
1715
+ const columns = terminalColumns();
1716
+ let marginLeft = PAD.repeat(options.margin.left);
1717
+ if (options.float === "center") {
1718
+ const marginWidth = Math.max((columns - contentWidth - BORDERS_WIDTH) / 2, 0);
1719
+ marginLeft = PAD.repeat(marginWidth);
1720
+ } else if (options.float === "right") {
1721
+ const marginWidth = Math.max(columns - contentWidth - options.margin.right - BORDERS_WIDTH, 0);
1722
+ marginLeft = PAD.repeat(marginWidth);
1723
+ }
1724
+ const top = colorizeBorder(NEWLINE.repeat(options.margin.top) + marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight);
1725
+ const bottom = colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight + NEWLINE.repeat(options.margin.bottom));
1726
+ const lines = content.split(NEWLINE);
1727
+ const middle = lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
1728
+ return top + NEWLINE + middle + NEWLINE + bottom;
1729
+ };
1730
+ var sanitizeOptions = (options) => {
1731
+ if (options.fullscreen && process3?.stdout) {
1732
+ let newDimensions = [process3.stdout.columns, process3.stdout.rows];
1733
+ if (typeof options.fullscreen === "function") {
1734
+ newDimensions = options.fullscreen(...newDimensions);
1735
+ }
1736
+ if (!options.width) {
1737
+ options.width = newDimensions[0];
1738
+ }
1739
+ if (!options.height) {
1740
+ options.height = newDimensions[1];
2205
1741
  }
2206
1742
  }
2207
- }
2208
- async function loadConfigAndCreateContext(options = {}) {
2209
- const { cwd = process.cwd(), config, configPath } = options;
2210
- const conf = await loadConfigFile({ cwd, file: configPath });
2211
- if (config) {
2212
- Object.assign(conf.config, config);
1743
+ if (options.width) {
1744
+ options.width = Math.max(1, options.width - BORDERS_WIDTH);
2213
1745
  }
2214
- return createContext(conf);
1746
+ if (options.height) {
1747
+ options.height = Math.max(1, options.height - BORDERS_WIDTH);
1748
+ }
1749
+ return options;
1750
+ };
1751
+ var determineDimensions = (text, options) => {
1752
+ options = sanitizeOptions(options);
1753
+ const widthOverride = options.width !== void 0;
1754
+ const columns = terminalColumns();
1755
+ const maxWidth = columns - options.margin.left - options.margin.right - BORDERS_WIDTH;
1756
+ const widest = widestLine(wrapAnsi(text, columns - BORDERS_WIDTH, { hard: true, trim: false })) + options.padding.left + options.padding.right;
1757
+ if (options.title && widthOverride) {
1758
+ options.title = options.title.slice(0, Math.max(0, options.width - 2));
1759
+ if (options.title) {
1760
+ options.title = ` ${options.title} `;
1761
+ }
1762
+ } else if (options.title) {
1763
+ options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
1764
+ if (options.title) {
1765
+ options.title = ` ${options.title} `;
1766
+ if (stringWidth(options.title) > widest) {
1767
+ options.width = stringWidth(options.title);
1768
+ }
1769
+ }
1770
+ }
1771
+ options.width = options.width ? options.width : widest;
1772
+ if (!widthOverride) {
1773
+ if (options.margin.left && options.margin.right && options.width > maxWidth) {
1774
+ const spaceForMargins = columns - options.width - BORDERS_WIDTH;
1775
+ const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
1776
+ options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
1777
+ options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
1778
+ }
1779
+ options.width = Math.min(options.width, columns - BORDERS_WIDTH - options.margin.left - options.margin.right);
1780
+ }
1781
+ if (options.width - (options.padding.left + options.padding.right) <= 0) {
1782
+ options.padding.left = 0;
1783
+ options.padding.right = 0;
1784
+ }
1785
+ if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
1786
+ options.padding.top = 0;
1787
+ options.padding.bottom = 0;
1788
+ }
1789
+ return options;
1790
+ };
1791
+ var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
1792
+ var isColorValid = (color) => typeof color === "string" && (source_default[color] ?? isHex(color));
1793
+ var getColorFn = (color) => isHex(color) ? source_default.hex(color) : source_default[color];
1794
+ var getBGColorFn = (color) => isHex(color) ? source_default.bgHex(color) : source_default[camelCase(["bg", color])];
1795
+ function boxen(text, options) {
1796
+ options = {
1797
+ padding: 0,
1798
+ borderStyle: "single",
1799
+ dimBorder: false,
1800
+ textAlignment: "left",
1801
+ float: "left",
1802
+ titleAlignment: "left",
1803
+ ...options
1804
+ };
1805
+ if (options.align) {
1806
+ options.textAlignment = options.align;
1807
+ }
1808
+ if (options.borderColor && !isColorValid(options.borderColor)) {
1809
+ throw new Error(`${options.borderColor} is not a valid borderColor`);
1810
+ }
1811
+ if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
1812
+ throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
1813
+ }
1814
+ options.padding = getObject(options.padding);
1815
+ options.margin = getObject(options.margin);
1816
+ options = determineDimensions(text, options);
1817
+ text = makeContentText(text, options);
1818
+ return boxContent(text, options.width, options);
2215
1819
  }
2216
1820
 
2217
- // src/glob.ts
2218
- import globParent from "glob-parent";
1821
+ // src/cli-box.ts
1822
+ var createBox = (options) => boxen(options.content, {
1823
+ padding: { left: 3, right: 3, top: 1, bottom: 1 },
1824
+ borderColor: "magenta",
1825
+ borderStyle: "round",
1826
+ title: options.title,
1827
+ titleAlignment: "center"
1828
+ });
1829
+
1830
+ // src/extract.ts
1831
+ async function bundleChunks(ctx) {
1832
+ const files = ctx.chunks.getFiles();
1833
+ return ctx.output.write({
1834
+ dir: ctx.paths.root,
1835
+ files: [{ file: "styles.css", code: ctx.getCss({ files }) }]
1836
+ });
1837
+ }
1838
+ async function writeFileChunk(ctx, file) {
1839
+ const { path } = ctx.runtime;
1840
+ logger2.debug("chunk:write", `File: ${path.relative(ctx.config.cwd, file)}`);
1841
+ const css = extractFile(ctx, file);
1842
+ if (!css)
1843
+ return;
1844
+ const artifact = ctx.chunks.getArtifact(file, css);
1845
+ return ctx.output.write(artifact);
1846
+ }
1847
+ function extractFile(ctx, file) {
1848
+ const {
1849
+ runtime: { path },
1850
+ config: { cwd }
1851
+ } = ctx;
1852
+ return pipe2(
1853
+ { file: path.abs(cwd, file) },
1854
+ tap2(() => logger2.debug("file:extract", file)),
1855
+ Obj2.bind("measure", () => logger2.time.debug(`Extracted ${file}`)),
1856
+ Obj2.bind("result", ({ file: file2 }) => ctx.project.parseSourceFile(file2)),
1857
+ Obj2.bind("css", ({ result }) => result ? ctx.getParserCss(result) : void 0),
1858
+ tap2(({ measure }) => measure()),
1859
+ ({ css }) => css
1860
+ );
1861
+ }
1862
+ function extractFiles(ctx) {
1863
+ return Promise.all(ctx.getFiles().map((file) => writeFileChunk(ctx, file)));
1864
+ }
1865
+ var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
1866
+ var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
1867
+ async function emitArtifacts(ctx) {
1868
+ if (ctx.config.clean)
1869
+ ctx.output.empty();
1870
+ await Promise.all(ctx.getArtifacts().map(ctx.output.write));
1871
+ return ctx.messages.artifactsGenerated() + createBox({
1872
+ content: ctx.messages.codegenComplete(),
1873
+ title: `\u{1F43C} ${pickRandom(randomWords)}! \u2728`
1874
+ });
1875
+ }
1876
+ async function emitAndExtract(ctx) {
1877
+ await emitArtifacts(ctx);
1878
+ return extractCss(ctx);
1879
+ }
1880
+ async function extractCss(ctx) {
1881
+ await extractFiles(ctx);
1882
+ await bundleChunks(ctx);
1883
+ return ctx.messages.buildComplete(ctx.getFiles().length);
1884
+ }
1885
+
1886
+ // src/parse-dependency.ts
1887
+ init_esm_shims();
2219
1888
  import isGlob from "is-glob";
2220
- import { resolve as resolve2 } from "path";
1889
+ import { resolve } from "path";
1890
+
1891
+ // src/parse-glob.ts
1892
+ init_esm_shims();
1893
+ import globParent from "glob-parent";
2221
1894
  function parseGlob(pattern) {
2222
1895
  let glob2 = pattern;
2223
1896
  const base = globParent(pattern);
@@ -2235,6 +1908,8 @@ function parseGlob(pattern) {
2235
1908
  }
2236
1909
  return { base, glob: glob2 };
2237
1910
  }
1911
+
1912
+ // src/parse-dependency.ts
2238
1913
  function parseDependency(fileOrGlob) {
2239
1914
  if (fileOrGlob.startsWith("!")) {
2240
1915
  return null;
@@ -2242,9 +1917,9 @@ function parseDependency(fileOrGlob) {
2242
1917
  let message = null;
2243
1918
  if (isGlob(fileOrGlob)) {
2244
1919
  const { base, glob: glob2 } = parseGlob(fileOrGlob);
2245
- message = { type: "dir-dependency", dir: resolve2(base), glob: glob2 };
1920
+ message = { type: "dir-dependency", dir: resolve(base), glob: glob2 };
2246
1921
  } else {
2247
- message = { type: "dependency", file: resolve2(fileOrGlob) };
1922
+ message = { type: "dependency", file: resolve(fileOrGlob) };
2248
1923
  }
2249
1924
  if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
2250
1925
  message = { type: "dependency", file: message.dir };
@@ -2260,7 +1935,7 @@ function getConfigHash() {
2260
1935
  if (!file) {
2261
1936
  throw new ConfigNotFoundError();
2262
1937
  }
2263
- return toHash(readFileSync5(file, "utf-8"));
1938
+ return toHash(readFileSync2(file, "utf-8"));
2264
1939
  }
2265
1940
  var setupCount = 0;
2266
1941
  var Builder = class {
@@ -2268,9 +1943,9 @@ var Builder = class {
2268
1943
  fileCssMap = /* @__PURE__ */ new Map();
2269
1944
  context;
2270
1945
  configChanged = true;
2271
- updateFile(file, css3) {
1946
+ writeFile(file, css) {
2272
1947
  const oldCss = this.fileCssMap?.get(file) ?? "";
2273
- const newCss = mergeCss2(oldCss, css3);
1948
+ const newCss = mergeCss2(oldCss, css);
2274
1949
  this.fileCssMap?.set(file, newCss);
2275
1950
  }
2276
1951
  async setup() {
@@ -2286,7 +1961,7 @@ var Builder = class {
2286
1961
  if (setupCount > 0) {
2287
1962
  emitArtifacts(this.context);
2288
1963
  }
2289
- this.fileCssMap = /* @__PURE__ */ new Map([["base.css", getBaseCss(this.context)]]);
1964
+ this.fileCssMap = /* @__PURE__ */ new Map();
2290
1965
  this.fileModifiedMap = /* @__PURE__ */ new Map();
2291
1966
  contextCache.set(configHash, this.context);
2292
1967
  builderCache.set(this.context, { fileCssMap: this.fileCssMap, fileModifiedMap: this.fileModifiedMap });
@@ -2300,27 +1975,29 @@ var Builder = class {
2300
1975
  }
2301
1976
  async extract() {
2302
1977
  const ctx = this.ensure();
2303
- const done = logger5.time.info("Extracted in");
2304
- await ctx.extract(async (file) => {
2305
- const mtime = existsSync2(file) ? statSync(file).mtimeMs : -Infinity;
2306
- const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
2307
- if (isUnchanged)
2308
- return;
2309
- const result = extractFile(ctx, file);
2310
- if (!result)
2311
- return;
2312
- this.fileModifiedMap.set(file, mtime);
2313
- this.updateFile(file, result.css);
2314
- return result;
2315
- });
1978
+ const done = logger3.time.info("Extracted in");
1979
+ await Promise.all(
1980
+ ctx.getFiles().map(async (file) => {
1981
+ const mtime = existsSync2(file) ? statSync(file).mtimeMs : -Infinity;
1982
+ const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
1983
+ if (isUnchanged)
1984
+ return;
1985
+ const css = extractFile(ctx, file);
1986
+ if (!css)
1987
+ return;
1988
+ this.fileModifiedMap.set(file, mtime);
1989
+ this.writeFile(file, css);
1990
+ return css;
1991
+ })
1992
+ );
2316
1993
  done();
2317
1994
  }
2318
1995
  toString() {
2319
1996
  const ctx = this.ensure();
2320
- const sheet = new Stylesheet3(ctx.context());
2321
- const css3 = Array.from(this.fileCssMap.values()).join("\n\n");
2322
- sheet.append(css3);
2323
- return sheet.toCss({ minify: ctx.minify });
1997
+ return ctx.getCss({
1998
+ files: Array.from(this.fileCssMap.values()),
1999
+ resolve: true
2000
+ });
2324
2001
  }
2325
2002
  isValidRoot(root) {
2326
2003
  const params = "reset, base, tokens, recipes, utilities";
@@ -2350,14 +2027,15 @@ var Builder = class {
2350
2027
  fn(dependency);
2351
2028
  }
2352
2029
  }
2353
- for (const file of ctx.conf.dependencies) {
2354
- fn({ type: "dependency", file: resolve3(file) });
2030
+ for (const file of ctx.dependencies) {
2031
+ fn({ type: "dependency", file: resolve2(file) });
2355
2032
  }
2356
2033
  }
2357
2034
  };
2358
2035
 
2359
- // src/exec.ts
2360
- import { logger as logger6 } from "@pandacss/logger";
2036
+ // src/exec-command.ts
2037
+ init_esm_shims();
2038
+ import { logger as logger4 } from "@pandacss/logger";
2361
2039
  import { spawnSync } from "child_process";
2362
2040
  import getPackageManager from "preferred-pm";
2363
2041
  async function execCommand(cmd, cwd) {
@@ -2369,80 +2047,17 @@ async function execCommand(cmd, cwd) {
2369
2047
  }
2370
2048
  const check = spawnSync(pm, args, { cwd, stdio: "pipe" });
2371
2049
  if (check.status !== 0) {
2372
- logger6.error("exec", check.stderr.toString());
2050
+ logger4.error("exec", check.stderr.toString());
2373
2051
  }
2374
2052
  }
2375
2053
 
2376
2054
  // src/generate.ts
2377
- import { logger as logger8 } from "@pandacss/logger";
2378
-
2379
- // src/watch.ts
2380
- import { logger as logger7 } from "@pandacss/logger";
2381
- import chokidar from "chokidar";
2382
- import { match as match6 } from "ts-pattern";
2383
- function createWatcher(files, options = {}) {
2384
- const { ignore, cwd = process.cwd(), poll } = options;
2385
- const coalesce = poll || process.platform === "win32";
2386
- const watcher = chokidar.watch(files, {
2387
- usePolling: poll,
2388
- cwd,
2389
- ignoreInitial: true,
2390
- ignorePermissionErrors: true,
2391
- ignored: ignore,
2392
- awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
2393
- });
2394
- logger7.debug("watch:file", `watching [${files}]`);
2395
- process.once("SIGINT", async () => {
2396
- await watcher.close();
2397
- });
2398
- return watcher;
2399
- }
2400
- async function createConfigWatcher(conf) {
2401
- return createWatcher(conf.dependencies);
2402
- }
2403
- async function createContentWatcher(ctx, callback) {
2404
- const { include, cwd, exclude } = ctx;
2405
- const watcher = createWatcher(include, {
2406
- cwd,
2407
- ignore: exclude
2408
- });
2409
- watcher.on("all", async (event, file) => {
2410
- logger7.debug(`file:${event}`, file);
2411
- match6(event).with("unlink", () => {
2412
- ctx.project.removeSourceFile(ctx.absPath(file));
2413
- ctx.chunks.rm(file);
2414
- }).with("change", async () => {
2415
- ctx.project.reloadSourceFile(file);
2416
- await callback(file);
2417
- }).with("add", async () => {
2418
- ctx.project.createSourceFile(file);
2419
- await callback(file);
2420
- }).otherwise(() => {
2421
- });
2422
- });
2423
- return watcher;
2424
- }
2425
- process.setMaxListeners(Infinity);
2426
- async function watch(ctx, options) {
2427
- await createContentWatcher(ctx, options.onContentChange);
2428
- const configWatcher = await createConfigWatcher(ctx.conf);
2429
- configWatcher.on("change", async () => {
2430
- logger7.info("watch:config", "Config changed, restarting...");
2431
- await options.onConfigChange();
2432
- });
2433
- }
2434
- process.on("unhandledRejection", (reason) => {
2435
- logger7.error("watch:unhandledRejection", reason);
2436
- });
2437
- process.on("uncaughtException", (reason) => {
2438
- logger7.error("watch:uncaughtException", reason);
2439
- });
2055
+ init_esm_shims();
2056
+ import { logger as logger5 } from "@pandacss/logger";
2057
+ import { match } from "ts-pattern";
2440
2058
 
2441
- // src/generate.ts
2442
- async function build(ctx) {
2443
- const msg = await emitAndExtract(ctx);
2444
- logger8.info("css:emit", msg);
2445
- }
2059
+ // src/load-context.ts
2060
+ init_esm_shims();
2446
2061
  var loadContext = async (config, configPath) => {
2447
2062
  const ctxRef = { current: void 0 };
2448
2063
  const load = async () => {
@@ -2452,50 +2067,75 @@ var loadContext = async (config, configPath) => {
2452
2067
  await load();
2453
2068
  return [ctxRef, load];
2454
2069
  };
2455
- async function generate5(config, configPath) {
2070
+
2071
+ // src/generate.ts
2072
+ async function build(ctx) {
2073
+ const msg = await emitAndExtract(ctx);
2074
+ logger5.info("css:emit", msg);
2075
+ }
2076
+ async function generate(config, configPath) {
2456
2077
  const [ctxRef, loadCtx] = await loadContext(config, configPath);
2457
- const initialCtx = ctxRef.current;
2458
- await build(initialCtx);
2459
- if (initialCtx.watch) {
2460
- await watch(initialCtx, {
2461
- onConfigChange: async () => {
2462
- await loadCtx();
2463
- return build(ctxRef.current);
2464
- },
2465
- onContentChange: async (file) => {
2078
+ const ctx = ctxRef.current;
2079
+ await build(ctx);
2080
+ const {
2081
+ runtime: { fs, path },
2082
+ dependencies,
2083
+ config: { cwd }
2084
+ } = ctx;
2085
+ if (ctx.config.watch) {
2086
+ const configWatcher = fs.watch({ include: dependencies });
2087
+ configWatcher.on("change", async () => {
2088
+ logger5.info("config:change", "Config changed, restarting...");
2089
+ await loadCtx();
2090
+ return build(ctxRef.current);
2091
+ });
2092
+ const contentWatcher = fs.watch(ctx.config);
2093
+ contentWatcher.on("all", async (event, file) => {
2094
+ logger5.info(`file:${event}`, file);
2095
+ match(event).with("unlink", () => {
2096
+ ctx.project.removeSourceFile(path.abs(cwd, file));
2097
+ ctx.chunks.rm(file);
2098
+ }).with("change", async () => {
2099
+ ctx.project.reloadSourceFile(file);
2466
2100
  await writeFileChunk(ctxRef.current, file);
2101
+ }).with("add", async () => {
2102
+ ctx.project.createSourceFile(file);
2467
2103
  return bundleChunks(ctxRef.current);
2468
- }
2104
+ }).otherwise(() => {
2105
+ });
2469
2106
  });
2470
- logger8.info("ctx:watch", watchMessage());
2107
+ logger5.info("ctx:watch", ctx.messages.watch());
2471
2108
  }
2472
2109
  }
2473
2110
 
2474
2111
  // src/git-ignore.ts
2475
- import { appendFileSync, readFileSync as readFileSync6, writeFileSync } from "fs";
2112
+ init_esm_shims();
2113
+ import { appendFileSync, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
2476
2114
  import { lookItUpSync as lookItUpSync2 } from "look-it-up";
2477
- import outdent26 from "outdent";
2478
- function setupGitIgnore(ctx) {
2479
- const txt = outdent26`## CSS Panda
2480
- ${ctx.outdir}
2481
- ${ctx.outdir}-static
2115
+ import outdent from "outdent";
2116
+ function setupGitIgnore({ config: { outdir } }) {
2117
+ const txt = outdent`## CSS Panda
2118
+ ${outdir}
2119
+ ${outdir}-static
2482
2120
  `;
2483
2121
  const file = lookItUpSync2(".gitignore");
2484
2122
  if (!file) {
2485
- return writeFileSync(".gitignore", txt);
2123
+ return writeFileSync2(".gitignore", txt);
2486
2124
  }
2487
- const content = readFileSync6(file, "utf-8");
2488
- if (!content.includes(ctx.outdir)) {
2125
+ const content = readFileSync3(file, "utf-8");
2126
+ if (!content.includes(outdir)) {
2489
2127
  appendFileSync(file, txt);
2490
2128
  }
2491
2129
  }
2492
2130
 
2493
- // src/scaffold.ts
2494
- import { logger as logger9, quote as quote3 } from "@pandacss/logger";
2131
+ // src/setup-config.ts
2132
+ init_esm_shims();
2133
+ import { logger as logger6, quote } from "@pandacss/logger";
2134
+ import { messages } from "@pandacss/generator";
2495
2135
  import { writeFile as writeFile2 } from "fs-extra";
2496
2136
  import { lookItUpSync as lookItUpSync3 } from "look-it-up";
2497
- import { outdent as outdent27 } from "outdent";
2498
- import { join as join3 } from "path";
2137
+ import { outdent as outdent2 } from "outdent";
2138
+ import { join as join2 } from "path";
2499
2139
  import getPackageManager2 from "preferred-pm";
2500
2140
  async function setupConfig(cwd, { force }) {
2501
2141
  const configFile = findConfig();
@@ -2504,20 +2144,17 @@ async function setupConfig(cwd, { force }) {
2504
2144
  const cmd = pm === "npm" ? "npm run" : pm;
2505
2145
  const isTs = lookItUpSync3("tsconfig.json", cwd);
2506
2146
  const file = isTs ? "panda.config.ts" : "panda.config.mjs";
2507
- logger9.info("init:config", `creating panda config file: ${quote3(file)}`);
2147
+ logger6.info("init:config", `creating panda config file: ${quote(file)}`);
2508
2148
  if (!force && configFile) {
2509
- logger9.warn("init:config", configExistsMessage(cmd));
2149
+ logger6.warn("init:config", messages.configExists(cmd));
2510
2150
  } else {
2511
- const content = outdent27`
2151
+ const content = outdent2`
2512
2152
  import { defineConfig } from "css-panda"
2513
2153
 
2514
2154
  export default defineConfig({
2515
2155
  // Whether to use css reset
2516
2156
  preflight: true,
2517
2157
 
2518
- // Default preset to use
2519
- presets: ["css-panda/presets"],
2520
-
2521
2158
  // Where to look for your css declarations
2522
2159
  include: ["./src/**/*.{tsx,jsx}", "./pages/**/*.{jsx,tsx}"],
2523
2160
 
@@ -2528,20 +2165,20 @@ async function setupConfig(cwd, { force }) {
2528
2165
  outdir: "design-system",
2529
2166
  })
2530
2167
  `;
2531
- await writeFile2(join3(cwd, file), content);
2532
- logger9.log(thankYouMessage());
2168
+ await writeFile2(join2(cwd, file), content);
2169
+ logger6.log(messages.thankYou());
2533
2170
  }
2534
2171
  }
2535
2172
  async function setupPostcss(cwd) {
2536
- logger9.info("init:postcss", `creating postcss config file: ${quote3("postcss.config.cjs")}`);
2537
- const content = outdent27`
2173
+ logger6.info("init:postcss", `creating postcss config file: ${quote("postcss.config.cjs")}`);
2174
+ const content = outdent2`
2538
2175
  module.exports = {
2539
2176
  plugins: {
2540
2177
  'css-panda/postcss': {},
2541
2178
  },
2542
2179
  }
2543
2180
  `;
2544
- await writeFile2(join3(cwd, "postcss.config.cjs"), content);
2181
+ await writeFile2(join2(cwd, "postcss.config.cjs"), content);
2545
2182
  }
2546
2183
  export {
2547
2184
  Builder,
@@ -2551,7 +2188,7 @@ export {
2551
2188
  emitArtifacts,
2552
2189
  execCommand,
2553
2190
  extractCss,
2554
- generate5 as generate,
2191
+ generate,
2555
2192
  loadConfigAndCreateContext,
2556
2193
  setupConfig,
2557
2194
  setupGitIgnore,