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