@styleframe/core 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/constants.d.ts +2 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/defaults.d.ts +11 -0
  5. package/dist/defaults.d.ts.map +1 -0
  6. package/dist/defaults.test.d.ts +2 -0
  7. package/dist/defaults.test.d.ts.map +1 -0
  8. package/dist/index.d.ts +7 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/styleframe.d.ts +20 -646
  11. package/dist/styleframe.d.ts.map +1 -0
  12. package/dist/styleframe.js +815 -988
  13. package/dist/styleframe.umd.cjs +1 -1
  14. package/dist/tokens/atRule.d.ts +5 -0
  15. package/dist/tokens/atRule.d.ts.map +1 -0
  16. package/dist/tokens/atRule.test.d.ts +2 -0
  17. package/dist/tokens/atRule.test.d.ts.map +1 -0
  18. package/dist/tokens/css.d.ts +3 -0
  19. package/dist/tokens/css.d.ts.map +1 -0
  20. package/dist/tokens/css.test.d.ts +2 -0
  21. package/dist/tokens/css.test.d.ts.map +1 -0
  22. package/dist/tokens/declarations.d.ts +4 -0
  23. package/dist/tokens/declarations.d.ts.map +1 -0
  24. package/dist/tokens/declarations.test.d.ts +2 -0
  25. package/dist/tokens/declarations.test.d.ts.map +1 -0
  26. package/dist/tokens/index.d.ts +13 -0
  27. package/dist/tokens/index.d.ts.map +1 -0
  28. package/dist/tokens/modifier.d.ts +4 -0
  29. package/dist/tokens/modifier.d.ts.map +1 -0
  30. package/dist/tokens/modifier.test.d.ts +2 -0
  31. package/dist/tokens/modifier.test.d.ts.map +1 -0
  32. package/dist/tokens/recipe.d.ts +208 -0
  33. package/dist/tokens/recipe.d.ts.map +1 -0
  34. package/dist/tokens/recipe.test.d.ts +2 -0
  35. package/dist/tokens/recipe.test.d.ts.map +1 -0
  36. package/dist/tokens/ref.d.ts +3 -0
  37. package/dist/tokens/ref.d.ts.map +1 -0
  38. package/dist/tokens/ref.test.d.ts +2 -0
  39. package/dist/tokens/ref.test.d.ts.map +1 -0
  40. package/dist/tokens/resolve.d.ts +28 -0
  41. package/dist/tokens/resolve.d.ts.map +1 -0
  42. package/dist/tokens/resolve.test.d.ts +2 -0
  43. package/dist/tokens/resolve.test.d.ts.map +1 -0
  44. package/dist/tokens/root.d.ts +3 -0
  45. package/dist/tokens/root.d.ts.map +1 -0
  46. package/dist/tokens/root.test.d.ts +2 -0
  47. package/dist/tokens/root.test.d.ts.map +1 -0
  48. package/dist/tokens/root.usage.test.d.ts +2 -0
  49. package/dist/tokens/root.usage.test.d.ts.map +1 -0
  50. package/dist/tokens/selector.d.ts +3 -0
  51. package/dist/tokens/selector.d.ts.map +1 -0
  52. package/dist/tokens/selector.test.d.ts +2 -0
  53. package/dist/tokens/selector.test.d.ts.map +1 -0
  54. package/dist/tokens/theme.d.ts +3 -0
  55. package/dist/tokens/theme.d.ts.map +1 -0
  56. package/dist/tokens/theme.test.d.ts +2 -0
  57. package/dist/tokens/theme.test.d.ts.map +1 -0
  58. package/dist/tokens/utility.d.ts +6 -0
  59. package/dist/tokens/utility.d.ts.map +1 -0
  60. package/dist/tokens/utility.test.d.ts +2 -0
  61. package/dist/tokens/utility.test.d.ts.map +1 -0
  62. package/dist/tokens/variable.d.ts +5 -0
  63. package/dist/tokens/variable.d.ts.map +1 -0
  64. package/dist/tokens/variable.test.d.ts +2 -0
  65. package/dist/tokens/variable.test.d.ts.map +1 -0
  66. package/dist/typeGuards.d.ts +24 -0
  67. package/dist/typeGuards.d.ts.map +1 -0
  68. package/dist/typeGuards.test.d.ts +2 -0
  69. package/dist/typeGuards.test.d.ts.map +1 -0
  70. package/dist/types/declarations.d.ts +21 -0
  71. package/dist/types/declarations.d.ts.map +1 -0
  72. package/dist/types/index.d.ts +5 -0
  73. package/dist/types/index.d.ts.map +1 -0
  74. package/dist/types/minify.d.ts +9 -0
  75. package/dist/types/minify.d.ts.map +1 -0
  76. package/dist/types/options.d.ts +25 -0
  77. package/dist/types/options.d.ts.map +1 -0
  78. package/dist/types/tokens.d.ts +156 -0
  79. package/dist/types/tokens.d.ts.map +1 -0
  80. package/dist/utils/capitalizeFirst.d.ts +6 -0
  81. package/dist/utils/capitalizeFirst.d.ts.map +1 -0
  82. package/dist/utils/cssSelector.d.ts +6 -0
  83. package/dist/utils/cssSelector.d.ts.map +1 -0
  84. package/dist/utils/cssSelector.test.d.ts +2 -0
  85. package/dist/utils/cssSelector.test.d.ts.map +1 -0
  86. package/dist/utils/deepClone.d.ts +23 -0
  87. package/dist/utils/deepClone.d.ts.map +1 -0
  88. package/dist/utils/generateRandomId.d.ts +9 -0
  89. package/dist/utils/generateRandomId.d.ts.map +1 -0
  90. package/dist/utils/getters.d.ts +5 -0
  91. package/dist/utils/getters.d.ts.map +1 -0
  92. package/dist/utils/getters.test.d.ts +2 -0
  93. package/dist/utils/getters.test.d.ts.map +1 -0
  94. package/dist/utils/hash.d.ts +9 -0
  95. package/dist/utils/hash.d.ts.map +1 -0
  96. package/dist/utils/hash.test.d.ts +2 -0
  97. package/dist/utils/hash.test.d.ts.map +1 -0
  98. package/dist/utils/index.d.ts +9 -0
  99. package/dist/utils/index.d.ts.map +1 -0
  100. package/dist/utils/isTokenEqual.d.ts +3 -0
  101. package/dist/utils/isTokenEqual.d.ts.map +1 -0
  102. package/dist/utils/isTokenEqual.test.d.ts +2 -0
  103. package/dist/utils/isTokenEqual.test.d.ts.map +1 -0
  104. package/dist/utils/merge.d.ts +8 -0
  105. package/dist/utils/merge.d.ts.map +1 -0
  106. package/dist/utils/merge.test.d.ts +2 -0
  107. package/dist/utils/merge.test.d.ts.map +1 -0
  108. package/package.json +8 -11
@@ -1,1016 +1,843 @@
1
- function x(e) {
2
- return typeof e == "object" && e !== null;
1
+ //#region src/typeGuards.ts
2
+ function e(e) {
3
+ return typeof e == "object" && !!e;
3
4
  }
4
- function b(e, t) {
5
- return x(e) && "type" in e && e.type === t;
5
+ function t(t, n) {
6
+ return e(t) && "type" in t && t.type === n;
6
7
  }
7
- function H(e) {
8
- return b(e, "variable");
8
+ function n(e) {
9
+ return t(e, "variable");
9
10
  }
10
- function g(e) {
11
- return b(e, "reference");
11
+ function r(e) {
12
+ return t(e, "reference");
12
13
  }
13
- function Oe(e) {
14
- return b(e, "selector");
14
+ function i(e) {
15
+ return t(e, "selector");
15
16
  }
16
- function te(e) {
17
- return b(e, "at-rule");
17
+ function a(e) {
18
+ return t(e, "at-rule");
18
19
  }
19
- function Se(e) {
20
- return b(e, "utility");
20
+ function o(e) {
21
+ return t(e, "utility");
21
22
  }
22
- function ne(e) {
23
- return b(e, "modifier");
23
+ function s(e) {
24
+ return t(e, "modifier");
24
25
  }
25
- function $(e) {
26
- return b(e, "css");
26
+ function c(e) {
27
+ return t(e, "css");
27
28
  }
28
- function Te(e) {
29
- return b(e, "theme");
29
+ function l(e) {
30
+ return t(e, "theme");
30
31
  }
31
- function M(e) {
32
- return b(e, "root");
32
+ function u(e) {
33
+ return t(e, "root");
33
34
  }
34
- function Be(e) {
35
- return b(e, "recipe");
35
+ function d(e) {
36
+ return t(e, "recipe");
36
37
  }
37
- function re(e) {
38
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
38
+ function f(e) {
39
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
39
40
  }
40
- function B(e) {
41
- return re(e) || g(e) || $(e) || Array.isArray(e) && e.every(B);
41
+ function p(e) {
42
+ return f(e) || r(e) || c(e) || Array.isArray(e) && e.every(p);
42
43
  }
43
- function Pe(e) {
44
- return x(e) && "id" in e && "children" in e && "declarations" in e && "variables" in e;
44
+ function m(t) {
45
+ return e(t) && "id" in t && "children" in t && "declarations" in t && "variables" in t;
45
46
  }
46
- function L(e) {
47
- return x(e) && "children" in e && "declarations" in e && "variables" in e;
47
+ function h(t) {
48
+ return e(t) && "children" in t && "declarations" in t && "variables" in t;
48
49
  }
49
- function ie(e) {
50
- return typeof e == "string" && e.startsWith("@");
51
- }
52
- function Ue(e) {
53
- return x(e) && "id" in e && "root" in e && "variable" in e && "selector" in e && "recipe" in e && typeof e.id == "string" && M(e.root);
54
- }
55
- function se(e) {
56
- let t = 5381;
57
- for (let r = 0; r < e.length; r++)
58
- t = (t << 5) + t + e.charCodeAt(r) & 4294967295;
59
- return (t >>> 0).toString(16).padStart(7, "0").slice(0, 7);
60
- }
61
- function G(e) {
62
- const t = typeof e == "function" ? { replacer: e } : e ?? {}, { replacer: r = (c) => c, namespace: n } = t, s = Array.isArray(n) ? n : n ? [n] : [];
63
- return (c) => {
64
- let i = c, a;
65
- if (typeof i == "string" && i[0] === "@") {
66
- const o = i.slice(1), f = s.find(
67
- (d) => o === d || o.startsWith(`${d}.`)
68
- );
69
- let l, u;
70
- f ? (l = o, u = o.startsWith(`${f}.`) ? o.slice(f.length + 1) : o) : s.length > 0 ? (l = `${s[0]}.${o}`, u = o) : (l = o, u = o), a = r(u), i = {
71
- type: "reference",
72
- name: l
73
- };
74
- } else if (g(i)) {
75
- let o = i.name;
76
- for (const f of s)
77
- if (o.startsWith(`${f}.`)) {
78
- o = o.slice(f.length + 1);
79
- break;
80
- }
81
- a = r(o);
82
- } else {
83
- const o = String(c).trim();
84
- /\s/.test(o) ? a = se(o) : a = `[${o}]`;
85
- }
86
- return {
87
- [a]: i
88
- };
89
- };
90
- }
91
- const ce = ({
92
- name: e,
93
- value: t,
94
- modifiers: r
95
- }) => `_${[
96
- ...r,
97
- e,
98
- ...t === "default" ? [] : [t]
50
+ function g(e) {
51
+ return typeof e == "string" && e.startsWith("@");
52
+ }
53
+ function ee(t) {
54
+ return e(t) && "id" in t && "root" in t && "variable" in t && "selector" in t && "recipe" in t && typeof t.id == "string" && u(t.root);
55
+ }
56
+ //#endregion
57
+ //#region src/utils/hash.ts
58
+ function _(e) {
59
+ let t = 5381;
60
+ for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n) & 4294967295;
61
+ return (t >>> 0).toString(16).padStart(7, "0").slice(0, 7);
62
+ }
63
+ //#endregion
64
+ //#region src/defaults.ts
65
+ function v(e) {
66
+ let { replacer: t = (e) => e, namespace: n } = typeof e == "function" ? { replacer: e } : e ?? {}, i = Array.isArray(n) ? n : n ? [n] : [];
67
+ return (e) => {
68
+ let n = e, a;
69
+ if (typeof n == "string" && n[0] === "@") {
70
+ let e = n.slice(1), r = i.find((t) => e === t || e.startsWith(`${t}.`)), o, s;
71
+ r ? (o = e, s = e.startsWith(`${r}.`) ? e.slice(r.length + 1) : e) : i.length > 0 ? (o = `${i[0]}.${e}`, s = e) : (o = e, s = e), a = t(s), n = {
72
+ type: "reference",
73
+ name: o
74
+ };
75
+ } else if (r(n)) {
76
+ let e = n.name;
77
+ for (let t of i) if (e.startsWith(`${t}.`)) {
78
+ e = e.slice(t.length + 1);
79
+ break;
80
+ }
81
+ a = t(e);
82
+ } else {
83
+ let t = String(e).trim();
84
+ a = /\s/.test(t) ? _(t) : `[${t}]`;
85
+ }
86
+ return { [a]: n };
87
+ };
88
+ }
89
+ var te = ({ name: e, value: t, modifiers: n }) => `_${[
90
+ ...n,
91
+ e,
92
+ ...t === "default" ? [] : [t]
99
93
  ].filter(Boolean).join(":")}`;
100
- function oe(e, t) {
101
- if (g(t)) {
102
- e._usage.variables.add(t.name);
103
- return;
104
- }
105
- if ($(t))
106
- for (const r of t.value)
107
- g(r) && e._usage.variables.add(r.name);
108
- }
109
- const N = /@([\w.-]+)/g;
110
- function z(e) {
111
- const t = [];
112
- let r = 0, n;
113
- for (N.lastIndex = 0; (n = N.exec(e)) !== null; ) {
114
- const c = e.slice(r, n.index);
115
- c !== "" && t.push(c), t.push({ type: "reference", name: n[1] }), r = N.lastIndex;
116
- }
117
- const s = e.slice(r);
118
- return s !== "" && t.push(s), t;
119
- }
120
- function ae(e, t, r) {
121
- let n = t;
122
- for (; n; ) {
123
- if (n.variables.some((s) => s.name === e))
124
- return !0;
125
- if (n.parentId)
126
- n = r._registry.get(n.parentId);
127
- else
128
- break;
129
- }
130
- return !1;
131
- }
132
- function fe(e, t, r) {
133
- if (!ae(e, t, r))
134
- throw new Error(
135
- `[styleframe] Variable "${e}" is not defined. Check that the variable exists before referencing it with "@${e}".`
136
- );
137
- }
138
- function C(e, t) {
139
- return function(n) {
140
- if (typeof n != "string" || !n.includes("@"))
141
- return n;
142
- if (ie(n) && /^@[\w.-]+$/.test(n)) {
143
- const i = n.slice(1);
144
- return fe(i, e, t), t._usage.variables.add(i), { type: "reference", name: i };
145
- }
146
- const s = z(n);
147
- if (s.some((i) => g(i))) {
148
- for (const i of s)
149
- g(i) && t._usage.variables.add(i.name);
150
- return { type: "css", value: s };
151
- }
152
- return n;
153
- };
94
+ //#endregion
95
+ //#region src/tokens/resolve.ts
96
+ function y(e, t) {
97
+ if (r(t)) {
98
+ e._usage.variables.add(t.name);
99
+ return;
100
+ }
101
+ if (c(t)) for (let n of t.value) r(n) && e._usage.variables.add(n.name);
102
+ }
103
+ var b = /@([\w.-]+)/g;
104
+ function x(e) {
105
+ let t = [], n = 0, r;
106
+ for (b.lastIndex = 0; (r = b.exec(e)) !== null;) {
107
+ let i = e.slice(n, r.index);
108
+ i !== "" && t.push(i), t.push({
109
+ type: "reference",
110
+ name: r[1]
111
+ }), n = b.lastIndex;
112
+ }
113
+ let i = e.slice(n);
114
+ return i !== "" && t.push(i), t;
115
+ }
116
+ function S(e, t, n) {
117
+ let r = t;
118
+ for (; r;) {
119
+ if (r.variables.some((t) => t.name === e)) return !0;
120
+ if (r.parentId) r = n._registry.get(r.parentId);
121
+ else break;
122
+ }
123
+ return !1;
124
+ }
125
+ function C(e, t, n) {
126
+ if (!S(e, t, n)) throw Error(`[styleframe] Variable "${e}" is not defined. Check that the variable exists before referencing it with "@${e}".`);
154
127
  }
155
- function q(e, t) {
156
- return function(n, s) {
157
- const c = C(e, t), i = s != null ? c(s) : s;
158
- if (H(n))
159
- return t._usage.variables.add(n.name), {
160
- type: "reference",
161
- name: n.name,
162
- fallback: i
163
- };
164
- if (n == null)
165
- throw new Error(
166
- `[styleframe] ref() received ${String(n)}. This usually means you're referencing a variable that doesn't exist.`
167
- );
168
- return t._usage.variables.add(n), {
169
- type: "reference",
170
- name: n,
171
- fallback: i
172
- };
173
- };
174
- }
175
- function ue(e, t) {
176
- const r = q(e, t), n = (s) => {
177
- const c = z(s);
178
- for (const i of c)
179
- g(i) && t._usage.variables.add(i.name);
180
- return c;
181
- };
182
- return function(c, ...i) {
183
- return {
184
- type: "css",
185
- value: c.reduce((o, f, l) => {
186
- if (o.push(...n(f)), l < i.length) {
187
- const u = i[l];
188
- H(u) ? o.push(r(u)) : te(u) ? o.push(u.rule) : typeof u == "string" && u.includes("@") ? o.push(...n(u)) : o.push(u);
189
- }
190
- return o;
191
- }, [])
192
- };
193
- };
194
- }
195
- function De(e) {
196
- return e.charAt(0).toUpperCase() + e.slice(1);
197
- }
198
- function Ce(e) {
199
- return `.${e.replace(/[[\].#()%,:/]/g, "\\$&")}`;
128
+ function w(e, t) {
129
+ return function(n) {
130
+ if (typeof n != "string" || !n.includes("@")) return n;
131
+ if (g(n) && /^@[\w.-]+$/.test(n)) {
132
+ let r = n.slice(1);
133
+ return C(r, e, t), t._usage.variables.add(r), {
134
+ type: "reference",
135
+ name: r
136
+ };
137
+ }
138
+ let i = x(n);
139
+ if (i.some((e) => r(e))) {
140
+ for (let e of i) r(e) && t._usage.variables.add(e.name);
141
+ return {
142
+ type: "css",
143
+ value: i
144
+ };
145
+ }
146
+ return n;
147
+ };
148
+ }
149
+ //#endregion
150
+ //#region src/tokens/ref.ts
151
+ function T(e, t) {
152
+ return function(r, i) {
153
+ let a = w(e, t), o = i == null ? i : a(i);
154
+ if (n(r)) return t._usage.variables.add(r.name), {
155
+ type: "reference",
156
+ name: r.name,
157
+ fallback: o
158
+ };
159
+ if (r == null) throw Error(`[styleframe] ref() received ${String(r)}. This usually means you're referencing a variable that doesn't exist.`);
160
+ return t._usage.variables.add(r), {
161
+ type: "reference",
162
+ name: r,
163
+ fallback: o
164
+ };
165
+ };
166
+ }
167
+ //#endregion
168
+ //#region src/tokens/css.ts
169
+ function ne(e, t) {
170
+ let i = T(e, t), o = (e) => {
171
+ let n = x(e);
172
+ for (let e of n) r(e) && t._usage.variables.add(e.name);
173
+ return n;
174
+ };
175
+ return function(e, ...t) {
176
+ return {
177
+ type: "css",
178
+ value: e.reduce((e, r, s) => {
179
+ if (e.push(...o(r)), s < t.length) {
180
+ let r = t[s];
181
+ n(r) ? e.push(i(r)) : a(r) ? e.push(r.rule) : typeof r == "string" && r.includes("@") ? e.push(...o(r)) : e.push(r);
182
+ }
183
+ return e;
184
+ }, [])
185
+ };
186
+ };
187
+ }
188
+ //#endregion
189
+ //#region src/utils/capitalizeFirst.ts
190
+ function re(e) {
191
+ return e.charAt(0).toUpperCase() + e.slice(1);
200
192
  }
201
- function j(e) {
202
- if (e instanceof Buffer)
203
- return Buffer.from(e);
204
- const t = e.constructor;
205
- return new t(
206
- e.buffer.slice(0),
207
- e.byteOffset,
208
- e.byteLength / e.BYTES_PER_ELEMENT || 1
209
- );
210
- }
211
- function le(e) {
212
- if (e = e || {}, e.circular)
213
- return de(e);
214
- const t = /* @__PURE__ */ new Map();
215
- if (t.set(Date, (i) => new Date(i)), t.set(
216
- Map,
217
- (i, a) => new Map(n(Array.from(i), a))
218
- ), t.set(
219
- Set,
220
- (i, a) => new Set(n(Array.from(i), a))
221
- ), e.constructorHandlers)
222
- for (const i of e.constructorHandlers)
223
- t.set(i[0], i[1]);
224
- let r;
225
- return e.proto ? c : s;
226
- function n(i, a) {
227
- const o = Object.keys(i), f = Array.from({ length: o.length });
228
- for (let l = 0; l < o.length; l++) {
229
- const u = o[l], d = i[u];
230
- typeof d != "object" || d === null ? f[u] = d : d.constructor !== Object && (r = t.get(d.constructor)) ? f[u] = r(d, a) : ArrayBuffer.isView(d) ? f[u] = j(d) : f[u] = a(d);
231
- }
232
- return f;
233
- }
234
- function s(i) {
235
- if (typeof i != "object" || i === null) return i;
236
- if (Array.isArray(i)) return n(i, s);
237
- if (i.constructor !== Object && (r = t.get(i.constructor)))
238
- return r(i, s);
239
- const a = {};
240
- for (const o in i) {
241
- if (Object.hasOwnProperty.call(i, o) === !1) continue;
242
- const f = i[o];
243
- typeof f != "object" || f === null ? a[o] = f : f.constructor !== Object && (r = t.get(f.constructor)) ? a[o] = r(f, s) : ArrayBuffer.isView(f) ? a[o] = j(f) : a[o] = s(f);
244
- }
245
- return a;
246
- }
247
- function c(i) {
248
- if (typeof i != "object" || i === null) return i;
249
- if (Array.isArray(i)) return n(i, c);
250
- if (i.constructor !== Object && (r = t.get(i.constructor)))
251
- return r(i, c);
252
- const a = {};
253
- for (const o in i) {
254
- const f = i[o];
255
- typeof f != "object" || f === null ? a[o] = f : f.constructor !== Object && (r = t.get(f.constructor)) ? a[o] = r(f, c) : ArrayBuffer.isView(f) ? a[o] = j(f) : a[o] = c(f);
256
- }
257
- return a;
258
- }
259
- }
260
- function de(e) {
261
- const t = [], r = [], n = /* @__PURE__ */ new Map();
262
- if (n.set(Date, (o) => new Date(o)), n.set(
263
- Map,
264
- (o, f) => new Map(c(Array.from(o), f))
265
- ), n.set(
266
- Set,
267
- (o, f) => new Set(c(Array.from(o), f))
268
- ), e.constructorHandlers)
269
- for (const o of e.constructorHandlers)
270
- n.set(o[0], o[1]);
271
- let s;
272
- return e.proto ? a : i;
273
- function c(o, f) {
274
- const l = Object.keys(o), u = Array.from({ length: l.length });
275
- for (let d = 0; d < l.length; d++) {
276
- const y = l[d], m = o[y];
277
- if (typeof m != "object" || m === null)
278
- u[y] = m;
279
- else if (m.constructor !== Object && (s = n.get(m.constructor)))
280
- u[y] = s(m, f);
281
- else if (ArrayBuffer.isView(m))
282
- u[y] = j(m);
283
- else {
284
- const h = t.indexOf(m);
285
- h !== -1 ? u[y] = r[h] : u[y] = f(m);
286
- }
287
- }
288
- return u;
289
- }
290
- function i(o) {
291
- if (typeof o != "object" || o === null) return o;
292
- if (Array.isArray(o)) return c(o, i);
293
- if (o.constructor !== Object && (s = n.get(o.constructor)))
294
- return s(o, i);
295
- const f = {};
296
- t.push(o), r.push(f);
297
- for (const l in o) {
298
- if (Object.hasOwnProperty.call(o, l) === !1) continue;
299
- const u = o[l];
300
- if (typeof u != "object" || u === null)
301
- f[l] = u;
302
- else if (u.constructor !== Object && (s = n.get(u.constructor)))
303
- f[l] = s(u, i);
304
- else if (ArrayBuffer.isView(u))
305
- f[l] = j(u);
306
- else {
307
- const d = t.indexOf(u);
308
- d !== -1 ? f[l] = r[d] : f[l] = i(u);
309
- }
310
- }
311
- return t.pop(), r.pop(), f;
312
- }
313
- function a(o) {
314
- if (typeof o != "object" || o === null) return o;
315
- if (Array.isArray(o)) return c(o, a);
316
- if (o.constructor !== Object && (s = n.get(o.constructor)))
317
- return s(o, a);
318
- const f = {};
319
- t.push(o), r.push(f);
320
- for (const l in o) {
321
- const u = o[l];
322
- if (typeof u != "object" || u === null)
323
- f[l] = u;
324
- else if (u.constructor !== Object && (s = n.get(u.constructor)))
325
- f[l] = s(u, a);
326
- else if (ArrayBuffer.isView(u))
327
- f[l] = j(u);
328
- else {
329
- const d = t.indexOf(u);
330
- d !== -1 ? f[l] = r[d] : f[l] = a(u);
331
- }
332
- }
333
- return t.pop(), r.pop(), f;
334
- }
335
- }
336
- const R = le();
337
- function v(e, t = 8) {
338
- const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
339
- let n = "";
340
- for (let s = 0; s < t; s++) {
341
- const c = Math.floor(Math.random() * r.length);
342
- n += r[c];
343
- }
344
- return e ? `${e}${n}` : n;
345
- }
346
- function Ie(e, t) {
347
- const r = e.variables.find((n) => n.name === t);
348
- if (!r)
349
- throw new Error(`Variable "${t}" not found`);
350
- return r;
351
- }
352
- function Ke(e, t) {
353
- const r = e.utilities.find((n) => n.name === t);
354
- if (!r)
355
- throw new Error(`Utility "${t}" not found`);
356
- return r;
357
- }
358
- function ye(e, t) {
359
- const r = e.modifiers.find(
360
- (n) => n.key.includes(t)
361
- );
362
- if (!r)
363
- throw new Error(`Modifier "${t}" not found`);
364
- return r;
365
- }
366
- function O(e, t) {
367
- if (e === t) return !0;
368
- if (typeof e != typeof t) return !1;
369
- if (e === null || t === null) return e === t;
370
- if (typeof e != "object" || typeof t != "object") return !1;
371
- if (Array.isArray(e) && Array.isArray(t))
372
- return e.length !== t.length ? !1 : e.every((r, n) => O(r, t[n]));
373
- if ("type" in e && "type" in t) {
374
- if (e.type !== t.type) return !1;
375
- if (g(e) && g(t))
376
- return e.name === t.name && O(e.fallback, t.fallback);
377
- if ($(e) && $(t))
378
- return O(e.value, t.value);
379
- }
380
- return !1;
381
- }
382
- const X = "__licenseRequired";
383
- function me(e) {
384
- P(e) || Object.defineProperty(e, X, {
385
- value: !0,
386
- writable: !1,
387
- configurable: !1,
388
- enumerable: !0
389
- });
390
- }
391
- function P(e) {
392
- return Object.prototype.hasOwnProperty.call(e, X);
393
- }
394
- function pe(e, t) {
395
- const r = [...e];
396
- for (const n of t) {
397
- const s = r.find(
398
- (c) => c.name === n.name
399
- );
400
- s ? s.value = n.value : r.push(n);
401
- }
402
- return r;
193
+ //#endregion
194
+ //#region src/utils/cssSelector.ts
195
+ function ie(e) {
196
+ return `.${e.replace(/[[\].#()%,:/]/g, "\\$&")}`;
197
+ }
198
+ //#endregion
199
+ //#region src/utils/deepClone.ts
200
+ function E(e) {
201
+ if (e instanceof Buffer) return Buffer.from(e);
202
+ let t = e.constructor;
203
+ return new t(e.buffer.slice(0), e.byteOffset, e.byteLength / e.BYTES_PER_ELEMENT || 1);
204
+ }
205
+ function ae(e) {
206
+ if (e ||= {}, e.circular) return oe(e);
207
+ let t = /* @__PURE__ */ new Map();
208
+ if (t.set(Date, (e) => new Date(e)), t.set(Map, (e, t) => new Map(r(Array.from(e), t))), t.set(Set, (e, t) => new Set(r(Array.from(e), t))), e.constructorHandlers) for (let n of e.constructorHandlers) t.set(n[0], n[1]);
209
+ let n;
210
+ return e.proto ? a : i;
211
+ function r(e, r) {
212
+ let i = Object.keys(e), a = Array.from({ length: i.length });
213
+ for (let o = 0; o < i.length; o++) {
214
+ let s = i[o], c = e[s];
215
+ typeof c != "object" || !c ? a[s] = c : c.constructor !== Object && (n = t.get(c.constructor)) ? a[s] = n(c, r) : ArrayBuffer.isView(c) ? a[s] = E(c) : a[s] = r(c);
216
+ }
217
+ return a;
218
+ }
219
+ function i(e) {
220
+ if (typeof e != "object" || !e) return e;
221
+ if (Array.isArray(e)) return r(e, i);
222
+ if (e.constructor !== Object && (n = t.get(e.constructor))) return n(e, i);
223
+ let a = {};
224
+ for (let r in e) {
225
+ if (Object.hasOwnProperty.call(e, r) === !1) continue;
226
+ let o = e[r];
227
+ typeof o != "object" || !o ? a[r] = o : o.constructor !== Object && (n = t.get(o.constructor)) ? a[r] = n(o, i) : ArrayBuffer.isView(o) ? a[r] = E(o) : a[r] = i(o);
228
+ }
229
+ return a;
230
+ }
231
+ function a(e) {
232
+ if (typeof e != "object" || !e) return e;
233
+ if (Array.isArray(e)) return r(e, a);
234
+ if (e.constructor !== Object && (n = t.get(e.constructor))) return n(e, a);
235
+ let i = {};
236
+ for (let r in e) {
237
+ let o = e[r];
238
+ typeof o != "object" || !o ? i[r] = o : o.constructor !== Object && (n = t.get(o.constructor)) ? i[r] = n(o, a) : ArrayBuffer.isView(o) ? i[r] = E(o) : i[r] = a(o);
239
+ }
240
+ return i;
241
+ }
242
+ }
243
+ function oe(e) {
244
+ let t = [], n = [], r = /* @__PURE__ */ new Map();
245
+ if (r.set(Date, (e) => new Date(e)), r.set(Map, (e, t) => new Map(a(Array.from(e), t))), r.set(Set, (e, t) => new Set(a(Array.from(e), t))), e.constructorHandlers) for (let t of e.constructorHandlers) r.set(t[0], t[1]);
246
+ let i;
247
+ return e.proto ? s : o;
248
+ function a(e, a) {
249
+ let o = Object.keys(e), s = Array.from({ length: o.length });
250
+ for (let c = 0; c < o.length; c++) {
251
+ let l = o[c], u = e[l];
252
+ if (typeof u != "object" || !u) s[l] = u;
253
+ else if (u.constructor !== Object && (i = r.get(u.constructor))) s[l] = i(u, a);
254
+ else if (ArrayBuffer.isView(u)) s[l] = E(u);
255
+ else {
256
+ let e = t.indexOf(u);
257
+ e === -1 ? s[l] = a(u) : s[l] = n[e];
258
+ }
259
+ }
260
+ return s;
261
+ }
262
+ function o(e) {
263
+ if (typeof e != "object" || !e) return e;
264
+ if (Array.isArray(e)) return a(e, o);
265
+ if (e.constructor !== Object && (i = r.get(e.constructor))) return i(e, o);
266
+ let s = {};
267
+ t.push(e), n.push(s);
268
+ for (let a in e) {
269
+ if (Object.hasOwnProperty.call(e, a) === !1) continue;
270
+ let c = e[a];
271
+ if (typeof c != "object" || !c) s[a] = c;
272
+ else if (c.constructor !== Object && (i = r.get(c.constructor))) s[a] = i(c, o);
273
+ else if (ArrayBuffer.isView(c)) s[a] = E(c);
274
+ else {
275
+ let e = t.indexOf(c);
276
+ e === -1 ? s[a] = o(c) : s[a] = n[e];
277
+ }
278
+ }
279
+ return t.pop(), n.pop(), s;
280
+ }
281
+ function s(e) {
282
+ if (typeof e != "object" || !e) return e;
283
+ if (Array.isArray(e)) return a(e, s);
284
+ if (e.constructor !== Object && (i = r.get(e.constructor))) return i(e, s);
285
+ let o = {};
286
+ t.push(e), n.push(o);
287
+ for (let a in e) {
288
+ let c = e[a];
289
+ if (typeof c != "object" || !c) o[a] = c;
290
+ else if (c.constructor !== Object && (i = r.get(c.constructor))) o[a] = i(c, s);
291
+ else if (ArrayBuffer.isView(c)) o[a] = E(c);
292
+ else {
293
+ let e = t.indexOf(c);
294
+ e === -1 ? o[a] = s(c) : o[a] = n[e];
295
+ }
296
+ }
297
+ return t.pop(), n.pop(), o;
298
+ }
299
+ }
300
+ var D = ae();
301
+ //#endregion
302
+ //#region src/utils/generateRandomId.ts
303
+ function O(e, t = 8) {
304
+ let n = "";
305
+ for (let e = 0; e < t; e++) {
306
+ let e = Math.floor(Math.random() * 62);
307
+ n += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[e];
308
+ }
309
+ return e ? `${e}${n}` : n;
310
+ }
311
+ //#endregion
312
+ //#region src/utils/getters.ts
313
+ function se(e, t) {
314
+ let n = e.variables.find((e) => e.name === t);
315
+ if (!n) throw Error(`Variable "${t}" not found`);
316
+ return n;
317
+ }
318
+ function ce(e, t) {
319
+ let n = e.utilities.find((e) => e.name === t);
320
+ if (!n) throw Error(`Utility "${t}" not found`);
321
+ return n;
322
+ }
323
+ function k(e, t) {
324
+ let n = e.modifiers.find((e) => e.key.includes(t));
325
+ if (!n) throw Error(`Modifier "${t}" not found`);
326
+ return n;
327
+ }
328
+ //#endregion
329
+ //#region src/utils/isTokenEqual.ts
330
+ function A(e, t) {
331
+ if (e === t) return !0;
332
+ if (typeof e != typeof t) return !1;
333
+ if (e === null || t === null) return e === t;
334
+ if (typeof e != "object" || typeof t != "object") return !1;
335
+ if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length ? e.every((e, n) => A(e, t[n])) : !1;
336
+ if ("type" in e && "type" in t) {
337
+ if (e.type !== t.type) return !1;
338
+ if (r(e) && r(t)) return e.name === t.name && A(e.fallback, t.fallback);
339
+ if (c(e) && c(t)) return A(e.value, t.value);
340
+ }
341
+ return !1;
342
+ }
343
+ //#endregion
344
+ //#region ../../node_modules/.pnpm/@styleframe+license@2.0.2/node_modules/@styleframe/license/dist/license.js
345
+ var le = "__licenseRequired";
346
+ function ue(e) {
347
+ j(e) || Object.defineProperty(e, "__licenseRequired", {
348
+ value: !0,
349
+ writable: !1,
350
+ configurable: !1,
351
+ enumerable: !0
352
+ });
403
353
  }
404
- function he(e, t) {
405
- const r = [...e];
406
- for (const n of t) {
407
- const s = r.find(
408
- (c) => c.name === n.name
409
- );
410
- s ? Object.assign(
411
- s,
412
- Y(s, n)
413
- ) : r.push(n);
414
- }
415
- return r;
354
+ function j(e) {
355
+ return Object.prototype.hasOwnProperty.call(e, le);
356
+ }
357
+ //#endregion
358
+ //#region src/utils/merge.ts
359
+ function M(e, t) {
360
+ let n = [...e];
361
+ for (let e of t) {
362
+ let t = n.find((t) => t.name === e.name);
363
+ t ? t.value = e.value : n.push(e);
364
+ }
365
+ return n;
366
+ }
367
+ function N(e, t) {
368
+ let n = [...e];
369
+ for (let e of t) {
370
+ let t = n.find((t) => t.name === e.name);
371
+ t ? Object.assign(t, P(t, e)) : n.push(e);
372
+ }
373
+ return n;
374
+ }
375
+ function P(e, t) {
376
+ return Object.keys(e).reduce((n, r) => (r === "variables" ? n.variables = M(e.variables, t.variables) : r === "declarations" ? n.declarations = {
377
+ ...e.declarations,
378
+ ...t.declarations
379
+ } : r === "themes" && u(n) && u(e) && u(t) ? n.themes = N(e.themes, t.themes) : Array.isArray(e[r]) && (n[r] = e[r].concat(t[r])), n), {
380
+ ...e,
381
+ ...t
382
+ });
383
+ }
384
+ function F(e, t) {
385
+ for (let n of e) "id" in n && typeof n.id == "string" && (t._registry.set(n.id, n), "children" in n && F(n.children, t));
386
+ }
387
+ function I(e) {
388
+ e._registry = /* @__PURE__ */ new Map(), e._registry.set(e.id, e), F(e.children, e);
389
+ for (let t of e.themes) e._registry.set(t.id, t), F(t.children, e);
390
+ }
391
+ function de(e, ...t) {
392
+ return t.reduce((e, t) => {
393
+ let n = {
394
+ ...e,
395
+ root: P(e.root, t.root)
396
+ };
397
+ return I(n.root), (j(e) || j(t)) && ue(n), n;
398
+ }, e);
399
+ }
400
+ //#endregion
401
+ //#region src/tokens/atRule.ts
402
+ function L(e, t) {
403
+ return function(n, r, i) {
404
+ let a = {
405
+ type: "at-rule",
406
+ id: O("ar-"),
407
+ parentId: e.id,
408
+ identifier: n,
409
+ rule: r,
410
+ declarations: {},
411
+ variables: [],
412
+ children: []
413
+ };
414
+ t._registry.set(a.id, a);
415
+ let o = H(a, t);
416
+ return typeof i == "function" ? a.declarations = i(o) ?? {} : h(i) ? (a.variables = i.variables, a.declarations = i.declarations, a.children = i.children) : i && (a.declarations = i), U(a.declarations, o, a, t), e.children.push(a), a;
417
+ };
418
+ }
419
+ function R(e, t) {
420
+ let n = L(e, t);
421
+ return function(e, t) {
422
+ return n("media", e, t);
423
+ };
424
+ }
425
+ function z(e, t) {
426
+ let n = L(e, t);
427
+ return function(e, t) {
428
+ return n("keyframes", e, t);
429
+ };
430
+ }
431
+ //#endregion
432
+ //#region src/tokens/selector.ts
433
+ function B(e, t) {
434
+ return function(n, r) {
435
+ let i = {
436
+ type: "selector",
437
+ id: O("sel-"),
438
+ parentId: e.id,
439
+ query: n,
440
+ declarations: {},
441
+ variables: [],
442
+ children: []
443
+ };
444
+ t._registry.set(i.id, i);
445
+ let a = H(i, t);
446
+ return typeof r == "function" ? i.declarations = r(a) ?? {} : h(r) ? (i.variables = r.variables, i.declarations = r.declarations, i.children = r.children) : i.declarations = r, U(i.declarations, a, i, t), e.children.push(i), i;
447
+ };
448
+ }
449
+ //#endregion
450
+ //#region src/tokens/variable.ts
451
+ function V(e, t) {
452
+ return function(n, r, i = { default: !1 }) {
453
+ let a = typeof n == "string" ? n : n.name, o = w(e, t)(r), s = e.variables.find((e) => e.name === a);
454
+ if (i.default && s) return s;
455
+ if (s) return s.value = o, s;
456
+ let c = {
457
+ type: "variable",
458
+ id: O("var-"),
459
+ parentId: e.id,
460
+ name: a,
461
+ value: o
462
+ };
463
+ return e.variables.push(c), c;
464
+ };
465
+ }
466
+ //#endregion
467
+ //#region src/tokens/declarations.ts
468
+ function H(e, t) {
469
+ let n = V(e, t), r = B(e, t), i = L(e, t);
470
+ return {
471
+ variable: n,
472
+ selector: r,
473
+ keyframes: z(t, t),
474
+ atRule: i,
475
+ media: R(e, t),
476
+ ref: T(t, t),
477
+ css: ne(t, t)
478
+ };
479
+ }
480
+ function U(e, t, n, r) {
481
+ for (let n in e) if (n.startsWith("@")) {
482
+ let r = e[n];
483
+ if (typeof r == "object" && r && !p(r)) {
484
+ let i = n.replace(/^@(\w+).*/, "$1"), a = n.replace(`@${i}`, "").trim();
485
+ t.atRule(i, a, r), delete e[n];
486
+ }
487
+ } else if (/^[.&:]/.test(n) || /^(\d+%|from|to)(\s*,\s*(\d+%|from|to))*$/.test(n)) {
488
+ let r = e[n];
489
+ typeof r == "object" && (t.selector(n, r), delete e[n]);
490
+ }
491
+ let i = w(n, r);
492
+ for (let t in e) {
493
+ let n = e[t];
494
+ if (p(n)) {
495
+ let r = i(n);
496
+ r !== n && (e[t] = r);
497
+ }
498
+ }
499
+ return e;
500
+ }
501
+ //#endregion
502
+ //#region src/tokens/modifier.ts
503
+ function W(e, t, n) {
504
+ let r = {
505
+ ...e,
506
+ id: O("ut-"),
507
+ parentId: e.parentId,
508
+ declarations: { ...e.declarations },
509
+ variables: [...e.variables],
510
+ children: [...e.children],
511
+ modifiers: [...n.keys()]
512
+ };
513
+ if (t._registry.set(r.id, r), n.size > 0) {
514
+ let i = [...n.values()], a = D(e.declarations);
515
+ r.declarations = {}, r.variables = [], r.children = [];
516
+ for (let n = i.length - 1; n >= 0; n--) {
517
+ let o = H(r, t), s = i[n]?.factory({
518
+ ...o,
519
+ declarations: D(a),
520
+ variables: D(e.variables),
521
+ children: D(e.children)
522
+ });
523
+ s && (a = s);
524
+ }
525
+ r.declarations = a;
526
+ let o = H(r, t);
527
+ U(r.declarations, o, r, t);
528
+ }
529
+ return r;
530
+ }
531
+ function G(e, t) {
532
+ return function(e, n) {
533
+ let r = {
534
+ type: "modifier",
535
+ key: Array.isArray(e) ? e : [e],
536
+ factory: n
537
+ };
538
+ return t.modifiers.push(r), r;
539
+ };
540
+ }
541
+ //#endregion
542
+ //#region src/tokens/root.ts
543
+ function K() {
544
+ let e = {
545
+ type: "root",
546
+ id: O("rt-"),
547
+ declarations: {},
548
+ utilities: [],
549
+ modifiers: [],
550
+ recipes: [],
551
+ variables: [],
552
+ children: [],
553
+ themes: [],
554
+ _registry: /* @__PURE__ */ new Map(),
555
+ _usage: {
556
+ variables: /* @__PURE__ */ new Set(),
557
+ utilities: /* @__PURE__ */ new Set(),
558
+ recipes: /* @__PURE__ */ new Set(),
559
+ recipeUtilities: /* @__PURE__ */ new Map()
560
+ }
561
+ };
562
+ return e._registry.set(e.id, e), e;
563
+ }
564
+ //#endregion
565
+ //#region src/tokens/utility.ts
566
+ function fe(e, t) {
567
+ let n = v({ namespace: e });
568
+ return (r) => {
569
+ if (typeof r == "string" && r[0] === "@") {
570
+ let i = r.slice(1), a = e.find((e) => i === e || i.startsWith(`${e}.`));
571
+ if (a) {
572
+ let e = i.slice(a.length + 1) || i;
573
+ if (t.variables.some((e) => e.name === i)) return t._usage.variables.add(i), { [e]: {
574
+ type: "reference",
575
+ name: i
576
+ } };
577
+ } else {
578
+ for (let n of e) {
579
+ let e = `${n}.${i}`;
580
+ if (t.variables.some((t) => t.name === e)) return t._usage.variables.add(e), { [i]: {
581
+ type: "reference",
582
+ name: e
583
+ } };
584
+ }
585
+ if (t.variables.some((e) => e.name === i)) return t._usage.variables.add(i), { [i]: {
586
+ type: "reference",
587
+ name: i
588
+ } };
589
+ }
590
+ return n(r);
591
+ }
592
+ return n(r);
593
+ };
594
+ }
595
+ function pe(e) {
596
+ let t = [/* @__PURE__ */ new Map()];
597
+ for (let n of e) {
598
+ if (!s(n)) continue;
599
+ let e = [];
600
+ for (let r of n.key) for (let i of t) {
601
+ let t = new Map(i);
602
+ t.set(r, n), e.push(t);
603
+ }
604
+ t = e;
605
+ }
606
+ return t.filter((e) => e.size > 0);
416
607
  }
608
+ function q(e, t) {
609
+ return function(n, i, a = {}) {
610
+ let o = t.utilities.find((e) => e.name === n);
611
+ if (o) return o.create;
612
+ let s = {
613
+ type: "utility",
614
+ name: n,
615
+ factory: i,
616
+ values: [],
617
+ autogenerate: a.autogenerate ?? (Array.isArray(a.namespace) ? fe(a.namespace, t) : v(a.namespace ? { namespace: a.namespace } : void 0)),
618
+ namespace: a.namespace,
619
+ create: (a, o = []) => {
620
+ let c = a;
621
+ if (Array.isArray(a)) {
622
+ c = {};
623
+ for (let e of a) {
624
+ let n = s.autogenerate(e);
625
+ for (let e of Object.values(n)) y(t, e);
626
+ c = {
627
+ ...c,
628
+ ...n
629
+ };
630
+ }
631
+ }
632
+ for (let [a, l] of Object.entries(c)) {
633
+ let u = l;
634
+ if (typeof l == "string" && l[0] === "@") {
635
+ let e = l.slice(1);
636
+ !Array.isArray(c) && e in c && (u = c[e]);
637
+ }
638
+ if (s.namespace && r(l)) if (t.variables.some((e) => e.name === l.name)) u = l, t._usage.variables.add(l.name);
639
+ else {
640
+ let e = Array.isArray(s.namespace) ? s.namespace : [s.namespace], n = !1;
641
+ for (let r of e) {
642
+ let e = `${r}.${a}`;
643
+ if (e !== l.name && t.variables.some((t) => t.name === e)) {
644
+ u = {
645
+ type: "reference",
646
+ name: e
647
+ }, t._usage.variables.add(e), n = !0;
648
+ break;
649
+ }
650
+ }
651
+ n || (t.variables.some((e) => e.name === a) ? (u = {
652
+ type: "reference",
653
+ name: a
654
+ }, t._usage.variables.add(a)) : u = a);
655
+ }
656
+ let d = s.values.find((e) => e.key === a && e.modifiers.length === 0), f = {
657
+ type: "utility",
658
+ id: O("ut-"),
659
+ parentId: e.id,
660
+ name: n,
661
+ value: a,
662
+ declarations: {},
663
+ variables: [],
664
+ children: [],
665
+ modifiers: []
666
+ };
667
+ t._registry.set(f.id, f);
668
+ let p = H(f, t);
669
+ if (f.declarations = i({
670
+ ...p,
671
+ value: u
672
+ }) ?? {}, U(f.declarations, p, f, t), d || (s.values.push({
673
+ key: a,
674
+ value: u,
675
+ modifiers: []
676
+ }), e.children.push(f)), o && o.length > 0) for (let n of o) {
677
+ let r = pe(Array.isArray(n) ? n : [n]);
678
+ for (let n of r) {
679
+ let r = [...n.keys()];
680
+ s.values.find((e) => e.key === a && e.modifiers.length === r.length && e.modifiers.every((e, t) => e === r[t])) || (s.values.push({
681
+ key: a,
682
+ value: u,
683
+ modifiers: r
684
+ }), e.children.push(W(f, t, n)));
685
+ }
686
+ }
687
+ }
688
+ }
689
+ };
690
+ return t.utilities.push(s), s.create;
691
+ };
692
+ }
693
+ //#endregion
694
+ //#region src/tokens/theme.ts
695
+ function J(e, t) {
696
+ return function(e, n) {
697
+ let r = t.themes.find((t) => t.name === e), i = r ?? {
698
+ type: "theme",
699
+ id: O("th-"),
700
+ parentId: t.id,
701
+ name: e,
702
+ declarations: {},
703
+ variables: [],
704
+ children: []
705
+ };
706
+ r || (t._registry.set(i.id, i), t.themes.push(i));
707
+ let a = H(i, t);
708
+ return n && n(a), i;
709
+ };
710
+ }
711
+ //#endregion
712
+ //#region src/tokens/recipe.ts
417
713
  function Y(e, t) {
418
- return Object.keys(e).reduce(
419
- (r, n) => (n === "variables" ? r.variables = pe(e.variables, t.variables) : n === "declarations" ? r.declarations = { ...e.declarations, ...t.declarations } : n === "themes" && M(r) && M(e) && M(t) ? r.themes = he(e.themes, t.themes) : Array.isArray(e[n]) && (r[n] = e[n].concat(
420
- t[n]
421
- )), r),
422
- {
423
- ...e,
424
- ...t
425
- }
426
- );
427
- }
428
- function U(e, t) {
429
- for (const r of e)
430
- "id" in r && typeof r.id == "string" && (t._registry.set(r.id, r), "children" in r && U(r.children, t));
714
+ return function(e) {
715
+ let n = {
716
+ type: "recipe",
717
+ ...e
718
+ };
719
+ return n._runtime = he(n, t), _e(n, t), t.recipes.push(n), n;
720
+ };
721
+ }
722
+ function me(e, t) {
723
+ let n = e.autogenerate(t);
724
+ return Object.keys(n)[0] ?? "default";
725
+ }
726
+ function X(e, t) {
727
+ let n = {};
728
+ for (let [r, i] of Object.entries(e)) if (Z(i)) {
729
+ let e = {};
730
+ for (let [n, r] of Object.entries(i)) {
731
+ let i = $(t, n);
732
+ if (!i) throw Error(`[styleframe] Utility "${n}" not found in registry. Make sure the utility is registered before using it in a recipe.`);
733
+ e[n] = me(i, r);
734
+ }
735
+ n[ge(r)] = e;
736
+ } else if (typeof i == "boolean") n[r] = i;
737
+ else {
738
+ let e = $(t, r);
739
+ if (!e) throw Error(`[styleframe] Utility "${r}" not found in registry. Make sure the utility is registered before using it in a recipe.`);
740
+ n[r] = me(e, i);
741
+ }
742
+ return n;
431
743
  }
432
- function ge(e) {
433
- e._registry = /* @__PURE__ */ new Map(), e._registry.set(e.id, e), U(e.children, e);
434
- for (const t of e.themes)
435
- e._registry.set(t.id, t), U(t.children, e);
436
- }
437
- function We(e, ...t) {
438
- return t.reduce((r, n) => {
439
- const s = {
440
- ...r,
441
- root: Y(r.root, n.root)
442
- };
443
- return ge(s.root), (P(r) || P(n)) && me(s), s;
444
- }, e);
445
- }
446
- function I(e, t) {
447
- return function(n, s, c) {
448
- const i = {
449
- type: "at-rule",
450
- id: v("ar-"),
451
- parentId: e.id,
452
- identifier: n,
453
- rule: s,
454
- declarations: {},
455
- variables: [],
456
- children: []
457
- };
458
- t._registry.set(i.id, i);
459
- const a = w(i, t);
460
- return typeof c == "function" ? i.declarations = c(a) ?? {} : L(c) ? (i.variables = c.variables, i.declarations = c.declarations, i.children = c.children) : c && (i.declarations = c), E(
461
- i.declarations,
462
- a,
463
- i,
464
- t
465
- ), e.children.push(i), i;
466
- };
467
- }
468
- function be(e, t) {
469
- const r = I(e, t);
470
- return function(s, c) {
471
- return r("media", s, c);
472
- };
744
+ function he(e, t) {
745
+ let n = {};
746
+ if (e.base && (n.base = X(e.base, t)), e.variants) {
747
+ let r = {};
748
+ for (let [n, i] of Object.entries(e.variants)) {
749
+ let e = {};
750
+ for (let [n, r] of Object.entries(i)) r == null ? e[n] = null : e[n] = X(r, t);
751
+ r[n] = e;
752
+ }
753
+ n.variants = r;
754
+ }
755
+ return e.defaultVariants && (n.defaultVariants = { ...e.defaultVariants }), e.compoundVariants && (n.compoundVariants = e.compoundVariants.map((e) => ({
756
+ match: { ...e.match },
757
+ ...e.css ? { css: X(e.css, t) } : {},
758
+ ...e.className ? { className: e.className } : {}
759
+ }))), n;
473
760
  }
474
- function ve(e, t) {
475
- const r = I(e, t);
476
- return function(s, c) {
477
- return r("keyframes", s, c);
478
- };
479
- }
480
- function Ae(e, t) {
481
- return function(n, s) {
482
- const c = {
483
- type: "selector",
484
- id: v("sel-"),
485
- parentId: e.id,
486
- query: n,
487
- declarations: {},
488
- variables: [],
489
- children: []
490
- };
491
- t._registry.set(c.id, c);
492
- const i = w(c, t);
493
- return typeof s == "function" ? c.declarations = s(i) ?? {} : L(s) ? (c.variables = s.variables, c.declarations = s.declarations, c.children = s.children) : c.declarations = s, E(
494
- c.declarations,
495
- i,
496
- c,
497
- t
498
- ), e.children.push(c), c;
499
- };
500
- }
501
- function we(e, t) {
502
- return function(n, s, c = {
503
- default: !1
504
- }) {
505
- const i = typeof n == "string" ? n : n.name, o = C(e, t)(s), f = e.variables.find(
506
- (u) => u.name === i
507
- );
508
- if (c.default && f)
509
- return f;
510
- if (f)
511
- return f.value = o, f;
512
- const l = {
513
- type: "variable",
514
- id: v("var-"),
515
- parentId: e.id,
516
- name: i,
517
- value: o
518
- };
519
- return e.variables.push(l), l;
520
- };
761
+ function Z(e) {
762
+ return !r(e) && typeof e == "object" && !!e;
521
763
  }
522
- function w(e, t) {
523
- const r = we(e, t), n = Ae(e, t), s = I(e, t), c = ve(t, t), i = be(e, t), a = q(t, t), o = ue(t, t);
524
- return {
525
- variable: r,
526
- selector: n,
527
- keyframes: c,
528
- atRule: s,
529
- media: i,
530
- ref: a,
531
- css: o
532
- };
533
- }
534
- function E(e, t, r, n) {
535
- for (const c in e)
536
- if (c.startsWith("@")) {
537
- const i = e[c];
538
- if (typeof i == "object" && i !== null && !B(i)) {
539
- const a = c.replace(/^@(\w+).*/, "$1"), o = c.replace(`@${a}`, "").trim();
540
- t.atRule(a, o, i), delete e[c];
541
- }
542
- } else if (/^[.&:]/.test(c) || /^(\d+%|from|to)(\s*,\s*(\d+%|from|to))*$/.test(c)) {
543
- const i = e[c];
544
- typeof i == "object" && (t.selector(c, i), delete e[c]);
545
- }
546
- const s = C(r, n);
547
- for (const c in e) {
548
- const i = e[c];
549
- if (B(i)) {
550
- const a = s(i);
551
- a !== i && (e[c] = a);
552
- }
553
- }
554
- return e;
555
- }
556
- function je(e, t, r) {
557
- const n = {
558
- ...e,
559
- id: v("ut-"),
560
- parentId: e.parentId,
561
- declarations: { ...e.declarations },
562
- variables: [...e.variables],
563
- children: [...e.children],
564
- modifiers: [...r.keys()]
565
- };
566
- if (t._registry.set(n.id, n), r.size > 0) {
567
- const s = [...r.values()];
568
- let c = R(e.declarations);
569
- n.declarations = {}, n.variables = [], n.children = [];
570
- for (let a = s.length - 1; a >= 0; a--) {
571
- const o = w(n, t), f = s[a]?.factory({
572
- ...o,
573
- declarations: R(c),
574
- variables: R(e.variables),
575
- children: R(e.children)
576
- });
577
- f && (c = f);
578
- }
579
- n.declarations = c;
580
- const i = w(n, t);
581
- E(
582
- n.declarations,
583
- i,
584
- n,
585
- t
586
- );
587
- }
588
- return n;
589
- }
590
- function Ve(e, t) {
591
- return function(n, s) {
592
- const c = {
593
- type: "modifier",
594
- key: Array.isArray(n) ? n : [n],
595
- factory: s
596
- };
597
- return t.modifiers.push(c), c;
598
- };
599
- }
600
- function ke() {
601
- const e = {
602
- type: "root",
603
- id: v("rt-"),
604
- declarations: {},
605
- utilities: [],
606
- modifiers: [],
607
- recipes: [],
608
- variables: [],
609
- children: [],
610
- themes: [],
611
- _registry: /* @__PURE__ */ new Map(),
612
- _usage: {
613
- variables: /* @__PURE__ */ new Set(),
614
- utilities: /* @__PURE__ */ new Set()
615
- }
616
- };
617
- return e._registry.set(e.id, e), e;
764
+ function ge(e) {
765
+ return e.startsWith("&::") ? e.slice(3) : e.startsWith("&:") ? e.slice(2) : e;
766
+ }
767
+ function Q(e, t) {
768
+ let n = (e, n, r) => {
769
+ let i = t.get(e);
770
+ i || (i = [], t.set(e, i)), i.push({
771
+ value: n,
772
+ modifiers: r
773
+ });
774
+ };
775
+ for (let [t, r] of Object.entries(e)) if (Z(r)) {
776
+ let e = ge(t).split(":");
777
+ for (let [t, i] of Object.entries(r)) n(t, i, e);
778
+ } else n(t, r, []);
779
+ }
780
+ function $(e, t) {
781
+ let n = e.utilities.find((e) => e.name === t);
782
+ if (n) return n;
783
+ let r = t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
784
+ return e.utilities.find((e) => e.name === r);
618
785
  }
619
786
  function _e(e, t) {
620
- const r = G({ namespace: e });
621
- return (n) => {
622
- if (typeof n == "string" && n[0] === "@") {
623
- const s = n.slice(1), c = e.find(
624
- (i) => s === i || s.startsWith(`${i}.`)
625
- );
626
- if (c) {
627
- const i = s.slice(c.length + 1) || s;
628
- if (t.variables.some((a) => a.name === s))
629
- return t._usage.variables.add(s), {
630
- [i]: {
631
- type: "reference",
632
- name: s
633
- }
634
- };
635
- } else {
636
- for (const i of e) {
637
- const a = `${i}.${s}`;
638
- if (t.variables.some((o) => o.name === a))
639
- return t._usage.variables.add(a), {
640
- [s]: {
641
- type: "reference",
642
- name: a
643
- }
644
- };
645
- }
646
- if (t.variables.some((i) => i.name === s))
647
- return t._usage.variables.add(s), {
648
- [s]: {
649
- type: "reference",
650
- name: s
651
- }
652
- };
653
- }
654
- return r(n);
655
- }
656
- return r(n);
657
- };
658
- }
659
- function Re(e) {
660
- let t = [/* @__PURE__ */ new Map()];
661
- for (const r of e) {
662
- if (!ne(r)) continue;
663
- const n = [];
664
- for (const s of r.key)
665
- for (const c of t) {
666
- const i = new Map(c);
667
- i.set(s, r), n.push(i);
668
- }
669
- t = n;
670
- }
671
- return t.filter((r) => r.size > 0);
672
- }
673
- function Me(e, t) {
674
- return function(n, s, c = {}) {
675
- const i = t.utilities.find((o) => o.name === n);
676
- if (i)
677
- return i.create;
678
- const a = {
679
- type: "utility",
680
- name: n,
681
- factory: s,
682
- values: [],
683
- autogenerate: c.autogenerate ?? (Array.isArray(c.namespace) ? _e(c.namespace, t) : G(
684
- c.namespace ? { namespace: c.namespace } : void 0
685
- )),
686
- namespace: c.namespace,
687
- create: (o, f = []) => {
688
- let l = o;
689
- if (Array.isArray(o)) {
690
- l = {};
691
- for (const u of o) {
692
- const d = a.autogenerate(u);
693
- for (const y of Object.values(d))
694
- oe(t, y);
695
- l = {
696
- ...l,
697
- ...d
698
- };
699
- }
700
- }
701
- for (const [u, d] of Object.entries(l)) {
702
- let y = d;
703
- if (typeof d == "string" && d[0] === "@") {
704
- const p = d.slice(1);
705
- !Array.isArray(l) && p in l && (y = l[p]);
706
- }
707
- if (a.namespace && g(d))
708
- if (t.variables.some((p) => p.name === d.name))
709
- y = d, t._usage.variables.add(d.name);
710
- else {
711
- const p = Array.isArray(a.namespace) ? a.namespace : [a.namespace];
712
- let _ = !1;
713
- for (const V of p) {
714
- const A = `${V}.${u}`;
715
- if (A !== d.name && t.variables.some((k) => k.name === A)) {
716
- y = {
717
- type: "reference",
718
- name: A
719
- }, t._usage.variables.add(A), _ = !0;
720
- break;
721
- }
722
- }
723
- _ || (t.variables.some((V) => V.name === u) ? (y = {
724
- type: "reference",
725
- name: u
726
- }, t._usage.variables.add(u)) : y = u);
727
- }
728
- const m = a.values.find(
729
- (p) => p.key === u && p.modifiers.length === 0
730
- ), h = {
731
- type: "utility",
732
- id: v("ut-"),
733
- parentId: e.id,
734
- name: n,
735
- value: u,
736
- declarations: {},
737
- variables: [],
738
- children: [],
739
- modifiers: []
740
- };
741
- t._registry.set(h.id, h);
742
- const K = w(
743
- h,
744
- t
745
- );
746
- if (h.declarations = s({
747
- ...K,
748
- value: y
749
- }) ?? {}, E(
750
- h.declarations,
751
- K,
752
- h,
753
- t
754
- ), m || (a.values.push({
755
- key: u,
756
- value: y,
757
- modifiers: []
758
- }), e.children.push(h)), f && f.length > 0)
759
- for (const p of f) {
760
- const _ = Array.isArray(p) ? p : [p], V = Re(_);
761
- for (const A of V) {
762
- const k = [...A.keys()];
763
- a.values.find(
764
- (F) => F.key === u && F.modifiers.length === k.length && F.modifiers.every(
765
- (Q, ee) => Q === k[ee]
766
- )
767
- ) || (a.values.push({
768
- key: u,
769
- value: y,
770
- modifiers: k
771
- }), e.children.push(
772
- je(h, t, A)
773
- ));
774
- }
775
- }
776
- }
777
- }
778
- };
779
- return t.utilities.push(a), a.create;
780
- };
781
- }
782
- function $e(e, t) {
783
- return function(n, s) {
784
- const c = t.themes.find((o) => o.name === n), i = c ?? {
785
- type: "theme",
786
- id: v("th-"),
787
- parentId: t.id,
788
- name: n,
789
- declarations: {},
790
- variables: [],
791
- children: []
792
- };
793
- c || (t._registry.set(i.id, i), t.themes.push(i));
794
- const a = w(i, t);
795
- return s && s(a), i;
796
- };
797
- }
798
- function xe(e, t) {
799
- return function(n) {
800
- const s = {
801
- type: "recipe",
802
- ...n
803
- };
804
- return s._runtime = Ee(s, t), Fe(s, t), t.recipes.push(s), s;
805
- };
806
- }
807
- function W(e, t) {
808
- const r = e.autogenerate(t);
809
- return Object.keys(r)[0] ?? "default";
810
- }
811
- function S(e, t) {
812
- const r = {};
813
- for (const [n, s] of Object.entries(e))
814
- if (Z(s)) {
815
- const c = {};
816
- for (const [i, a] of Object.entries(s)) {
817
- const o = D(t, i);
818
- if (!o)
819
- throw new Error(
820
- `[styleframe] Utility "${i}" not found in registry. Make sure the utility is registered before using it in a recipe.`
821
- );
822
- c[i] = W(
823
- o,
824
- a
825
- );
826
- }
827
- r[J(n)] = c;
828
- } else if (typeof s == "boolean")
829
- r[n] = s;
830
- else {
831
- const c = D(t, n);
832
- if (!c)
833
- throw new Error(
834
- `[styleframe] Utility "${n}" not found in registry. Make sure the utility is registered before using it in a recipe.`
835
- );
836
- r[n] = W(c, s);
837
- }
838
- return r;
839
- }
840
- function Ee(e, t) {
841
- const r = {};
842
- if (e.base && (r.base = S(e.base, t)), e.variants) {
843
- const n = {};
844
- for (const [s, c] of Object.entries(e.variants)) {
845
- const i = {};
846
- for (const [a, o] of Object.entries(
847
- c
848
- ))
849
- o == null ? i[a] = null : i[a] = S(
850
- o,
851
- t
852
- );
853
- n[s] = i;
854
- }
855
- r.variants = n;
856
- }
857
- return e.defaultVariants && (r.defaultVariants = { ...e.defaultVariants }), e.compoundVariants && (r.compoundVariants = e.compoundVariants.map((n) => ({
858
- match: { ...n.match },
859
- ...n.css ? { css: S(n.css, t) } : {},
860
- ...n.className ? { className: n.className } : {}
861
- }))), r;
862
- }
863
- function Z(e) {
864
- return !g(e) && typeof e == "object" && e !== null;
787
+ let n = /* @__PURE__ */ new Map();
788
+ if (e.base && Q(e.base, n), e.variants) for (let t of Object.values(e.variants)) for (let e of Object.values(t)) Q(e, n);
789
+ if (e.compoundVariants) for (let t of e.compoundVariants) t.css && Q(t.css, n);
790
+ let r = /* @__PURE__ */ new Map();
791
+ for (let [i, a] of n) {
792
+ let n = $(t, i);
793
+ if (!n) throw Error(`[styleframe] Utility "${i}" not found in registry. Make sure the utility is registered before using it in a recipe.`);
794
+ for (let i of a) {
795
+ let a = [];
796
+ for (let e of i.modifiers) {
797
+ if (!r.has(e)) try {
798
+ r.set(e, k(t, e));
799
+ } catch {
800
+ throw Error(`[styleframe] Modifier "${e}" not found in registry. Make sure the modifier is registered before using it in a recipe.`);
801
+ }
802
+ let n = r.get(e);
803
+ n && a.push(n);
804
+ }
805
+ let o = n.autogenerate(i.value);
806
+ for (let r of Object.keys(o)) {
807
+ let a = te({
808
+ name: n.name,
809
+ value: r,
810
+ modifiers: i.modifiers
811
+ }), o = t._usage.recipeUtilities.get(e.name);
812
+ o || (o = /* @__PURE__ */ new Set(), t._usage.recipeUtilities.set(e.name, o)), o.add(a);
813
+ }
814
+ n.create([i.value], a.length > 0 ? a.length > 1 ? [a] : a : void 0);
815
+ }
816
+ }
865
817
  }
866
- function J(e) {
867
- return e.startsWith("&::") ? e.slice(3) : e.startsWith("&:") ? e.slice(2) : e;
868
- }
869
- function T(e, t) {
870
- const r = (n, s, c) => {
871
- let i = t.get(n);
872
- i || (i = [], t.set(n, i)), i.push({ value: s, modifiers: c });
873
- };
874
- for (const [n, s] of Object.entries(e))
875
- if (Z(s)) {
876
- const c = J(n).split(":");
877
- for (const [i, a] of Object.entries(s))
878
- r(i, a, c);
879
- } else
880
- r(n, s, []);
881
- }
882
- function D(e, t) {
883
- const r = e.utilities.find((s) => s.name === t);
884
- if (r)
885
- return r;
886
- const n = t.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`);
887
- return e.utilities.find((s) => s.name === n);
888
- }
889
- function Fe(e, t) {
890
- const r = /* @__PURE__ */ new Map();
891
- if (e.base && T(e.base, r), e.variants)
892
- for (const s of Object.values(e.variants))
893
- for (const c of Object.values(s))
894
- T(
895
- c,
896
- r
897
- );
898
- if (e.compoundVariants)
899
- for (const s of e.compoundVariants)
900
- s.css && T(s.css, r);
901
- const n = /* @__PURE__ */ new Map();
902
- for (const [s, c] of r) {
903
- const i = D(t, s);
904
- if (!i)
905
- throw new Error(
906
- `[styleframe] Utility "${s}" not found in registry. Make sure the utility is registered before using it in a recipe.`
907
- );
908
- for (const a of c) {
909
- const o = [];
910
- for (const l of a.modifiers) {
911
- if (!n.has(l))
912
- try {
913
- n.set(l, ye(t, l));
914
- } catch {
915
- throw new Error(
916
- `[styleframe] Modifier "${l}" not found in registry. Make sure the modifier is registered before using it in a recipe.`
917
- );
918
- }
919
- const u = n.get(l);
920
- u && o.push(u);
921
- }
922
- const f = i.autogenerate(a.value);
923
- for (const l of Object.keys(f))
924
- t._usage.utilities.add(
925
- ce({
926
- name: i.name,
927
- value: l,
928
- modifiers: a.modifiers
929
- })
930
- );
931
- i.create(
932
- [a.value],
933
- o.length > 0 ? o.length > 1 ? [o] : o : void 0
934
- );
935
- }
936
- }
937
- }
938
- function He(e) {
939
- const t = v("sf-"), r = ke(), n = { ...e }, s = Me(r, r), c = Ve(r, r), i = xe(r, r), a = $e(r, r), { variable: o, selector: f, atRule: l, keyframes: u, media: d, ref: y, css: m } = w(r, r);
940
- return {
941
- id: t,
942
- root: r,
943
- variable: o,
944
- selector: f,
945
- utility: s,
946
- modifier: c,
947
- recipe: i,
948
- theme: a,
949
- atRule: l,
950
- keyframes: u,
951
- media: d,
952
- ref: y,
953
- css: m,
954
- options: n
955
- };
956
- }
957
- export {
958
- je as applyModifiers,
959
- De as capitalizeFirst,
960
- Ce as classNameToCssSelector,
961
- I as createAtRuleFunction,
962
- ue as createCssFunction,
963
- w as createDeclarationsCallbackContext,
964
- ve as createKeyframesFunction,
965
- be as createMediaFunction,
966
- Ve as createModifierFunction,
967
- C as createPropertyValueResolver,
968
- xe as createRecipeFunction,
969
- q as createRefFunction,
970
- ke as createRoot,
971
- Ae as createSelectorFunction,
972
- $e as createThemeFunction,
973
- Me as createUtilityFunction,
974
- we as createVariableFunction,
975
- R as deepClone,
976
- ce as defaultUtilitySelectorFn,
977
- ae as findVariableInScope,
978
- v as generateRandomId,
979
- Ee as generateRecipeRuntime,
980
- ye as getModifier,
981
- Ke as getUtility,
982
- Ie as getVariable,
983
- se as hashValue,
984
- te as isAtRule,
985
- $ as isCSS,
986
- Pe as isContainer,
987
- L as isContainerInput,
988
- ie as isKeyReferenceValue,
989
- ne as isModifier,
990
- x as isObject,
991
- re as isPrimitiveTokenValue,
992
- Be as isRecipe,
993
- g as isRef,
994
- M as isRoot,
995
- Oe as isSelector,
996
- Ue as isStyleframe,
997
- Te as isTheme,
998
- b as isToken,
999
- O as isTokenEqual,
1000
- B as isTokenValue,
1001
- Se as isUtility,
1002
- H as isVariable,
1003
- We as merge,
1004
- Y as mergeContainers,
1005
- he as mergeThemesArray,
1006
- pe as mergeVariablesArray,
1007
- z as parseAtReferences,
1008
- E as parseDeclarationsBlock,
1009
- Fe as processRecipeUtilities,
1010
- ge as rebuildRegistry,
1011
- le as rfdc,
1012
- He as styleframe,
1013
- oe as trackReferenceUsage,
1014
- G as transformUtilityKey,
1015
- fe as validateReference
1016
- };
818
+ function ve(e, t) {
819
+ for (let [n, r] of e._usage.recipeUtilities) if (!t || t.has(n)) for (let t of r) e._usage.utilities.add(t);
820
+ }
821
+ //#endregion
822
+ //#region src/styleframe.ts
823
+ function ye(e) {
824
+ let t = O("sf-"), n = K(), r = { ...e }, i = q(n, n), a = G(n, n), o = Y(n, n), s = J(n, n), { variable: c, selector: l, atRule: u, keyframes: d, media: f, ref: p, css: m } = H(n, n);
825
+ return {
826
+ id: t,
827
+ root: n,
828
+ variable: c,
829
+ selector: l,
830
+ utility: i,
831
+ modifier: a,
832
+ recipe: o,
833
+ theme: s,
834
+ atRule: u,
835
+ keyframes: d,
836
+ media: f,
837
+ ref: p,
838
+ css: m,
839
+ options: r
840
+ };
841
+ }
842
+ //#endregion
843
+ export { W as applyModifiers, re as capitalizeFirst, ie as classNameToCssSelector, L as createAtRuleFunction, ne as createCssFunction, H as createDeclarationsCallbackContext, z as createKeyframesFunction, R as createMediaFunction, G as createModifierFunction, w as createPropertyValueResolver, Y as createRecipeFunction, T as createRefFunction, K as createRoot, B as createSelectorFunction, J as createThemeFunction, q as createUtilityFunction, V as createVariableFunction, D as deepClone, te as defaultUtilitySelectorFn, S as findVariableInScope, O as generateRandomId, he as generateRecipeRuntime, k as getModifier, ce as getUtility, se as getVariable, _ as hashValue, a as isAtRule, c as isCSS, m as isContainer, h as isContainerInput, g as isKeyReferenceValue, s as isModifier, e as isObject, f as isPrimitiveTokenValue, d as isRecipe, r as isRef, u as isRoot, i as isSelector, ee as isStyleframe, l as isTheme, t as isToken, A as isTokenEqual, p as isTokenValue, o as isUtility, n as isVariable, de as merge, P as mergeContainers, N as mergeThemesArray, M as mergeVariablesArray, x as parseAtReferences, U as parseDeclarationsBlock, _e as processRecipeUtilities, I as rebuildRegistry, ve as registerRecipeUtilities, ae as rfdc, ye as styleframe, y as trackReferenceUsage, v as transformUtilityKey, C as validateReference };