@better-svelte-email/server 2.0.0-beta.0 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,3074 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ let svelte_server = require("svelte/server");
25
+ let parse5 = require("parse5");
26
+ let postcss = require("postcss");
27
+ postcss = __toESM(postcss);
28
+ let tailwindcss = require("tailwindcss");
29
+ let postcss_value_parser = require("postcss-value-parser");
30
+ postcss_value_parser = __toESM(postcss_value_parser);
31
+ let html_to_text = require("html-to-text");
32
+ //#region src/utils/html/walk.ts
33
+ /**
34
+ * Walk through an HTML AST and transform nodes using a callback function.
35
+ *
36
+ * @param ast - The root node to start walking from
37
+ * @param callback - A function that receives each node and returns either:
38
+ * - The same node (no change)
39
+ * - A modified node (replace)
40
+ * - null (remove the node)
41
+ * @returns The transformed AST
42
+ */
43
+ function walk(ast, callback) {
44
+ if (!("childNodes" in ast) || !ast.childNodes) return ast;
45
+ for (let i = ast.childNodes.length - 1; i >= 0; i--) {
46
+ const node = ast.childNodes[i];
47
+ const newNode = callback(node);
48
+ if (newNode === null) ast.childNodes.splice(i, 1);
49
+ else {
50
+ ast.childNodes[i] = newNode;
51
+ if ("childNodes" in newNode && Array.isArray(newNode.childNodes) && newNode.childNodes.length > 0) walk(newNode, callback);
52
+ }
53
+ }
54
+ return ast;
55
+ }
56
+ //#endregion
57
+ //#region src/utils/tailwindcss/tailwind-stylesheets/index.ts
58
+ const css$3 = `
59
+ @layer theme, base, components, utilities;
60
+
61
+ @layer theme {
62
+ @theme default {
63
+ --font-sans:
64
+ ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
65
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
66
+ --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
67
+ --font-mono:
68
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
69
+ "Courier New", monospace;
70
+
71
+ --color-red-50: oklch(97.1% 0.013 17.38);
72
+ --color-red-100: oklch(93.6% 0.032 17.717);
73
+ --color-red-200: oklch(88.5% 0.062 18.334);
74
+ --color-red-300: oklch(80.8% 0.114 19.571);
75
+ --color-red-400: oklch(70.4% 0.191 22.216);
76
+ --color-red-500: oklch(63.7% 0.237 25.331);
77
+ --color-red-600: oklch(57.7% 0.245 27.325);
78
+ --color-red-700: oklch(50.5% 0.213 27.518);
79
+ --color-red-800: oklch(44.4% 0.177 26.899);
80
+ --color-red-900: oklch(39.6% 0.141 25.723);
81
+ --color-red-950: oklch(25.8% 0.092 26.042);
82
+
83
+ --color-orange-50: oklch(98% 0.016 73.684);
84
+ --color-orange-100: oklch(95.4% 0.038 75.164);
85
+ --color-orange-200: oklch(90.1% 0.076 70.697);
86
+ --color-orange-300: oklch(83.7% 0.128 66.29);
87
+ --color-orange-400: oklch(75% 0.183 55.934);
88
+ --color-orange-500: oklch(70.5% 0.213 47.604);
89
+ --color-orange-600: oklch(64.6% 0.222 41.116);
90
+ --color-orange-700: oklch(55.3% 0.195 38.402);
91
+ --color-orange-800: oklch(47% 0.157 37.304);
92
+ --color-orange-900: oklch(40.8% 0.123 38.172);
93
+ --color-orange-950: oklch(26.6% 0.079 36.259);
94
+
95
+ --color-amber-50: oklch(98.7% 0.022 95.277);
96
+ --color-amber-100: oklch(96.2% 0.059 95.617);
97
+ --color-amber-200: oklch(92.4% 0.12 95.746);
98
+ --color-amber-300: oklch(87.9% 0.169 91.605);
99
+ --color-amber-400: oklch(82.8% 0.189 84.429);
100
+ --color-amber-500: oklch(76.9% 0.188 70.08);
101
+ --color-amber-600: oklch(66.6% 0.179 58.318);
102
+ --color-amber-700: oklch(55.5% 0.163 48.998);
103
+ --color-amber-800: oklch(47.3% 0.137 46.201);
104
+ --color-amber-900: oklch(41.4% 0.112 45.904);
105
+ --color-amber-950: oklch(27.9% 0.077 45.635);
106
+
107
+ --color-yellow-50: oklch(98.7% 0.026 102.212);
108
+ --color-yellow-100: oklch(97.3% 0.071 103.193);
109
+ --color-yellow-200: oklch(94.5% 0.129 101.54);
110
+ --color-yellow-300: oklch(90.5% 0.182 98.111);
111
+ --color-yellow-400: oklch(85.2% 0.199 91.936);
112
+ --color-yellow-500: oklch(79.5% 0.184 86.047);
113
+ --color-yellow-600: oklch(68.1% 0.162 75.834);
114
+ --color-yellow-700: oklch(55.4% 0.135 66.442);
115
+ --color-yellow-800: oklch(47.6% 0.114 61.907);
116
+ --color-yellow-900: oklch(42.1% 0.095 57.708);
117
+ --color-yellow-950: oklch(28.6% 0.066 53.813);
118
+
119
+ --color-lime-50: oklch(98.6% 0.031 120.757);
120
+ --color-lime-100: oklch(96.7% 0.067 122.328);
121
+ --color-lime-200: oklch(93.8% 0.127 124.321);
122
+ --color-lime-300: oklch(89.7% 0.196 126.665);
123
+ --color-lime-400: oklch(84.1% 0.238 128.85);
124
+ --color-lime-500: oklch(76.8% 0.233 130.85);
125
+ --color-lime-600: oklch(64.8% 0.2 131.684);
126
+ --color-lime-700: oklch(53.2% 0.157 131.589);
127
+ --color-lime-800: oklch(45.3% 0.124 130.933);
128
+ --color-lime-900: oklch(40.5% 0.101 131.063);
129
+ --color-lime-950: oklch(27.4% 0.072 132.109);
130
+
131
+ --color-green-50: oklch(98.2% 0.018 155.826);
132
+ --color-green-100: oklch(96.2% 0.044 156.743);
133
+ --color-green-200: oklch(92.5% 0.084 155.995);
134
+ --color-green-300: oklch(87.1% 0.15 154.449);
135
+ --color-green-400: oklch(79.2% 0.209 151.711);
136
+ --color-green-500: oklch(72.3% 0.219 149.579);
137
+ --color-green-600: oklch(62.7% 0.194 149.214);
138
+ --color-green-700: oklch(52.7% 0.154 150.069);
139
+ --color-green-800: oklch(44.8% 0.119 151.328);
140
+ --color-green-900: oklch(39.3% 0.095 152.535);
141
+ --color-green-950: oklch(26.6% 0.065 152.934);
142
+
143
+ --color-emerald-50: oklch(97.9% 0.021 166.113);
144
+ --color-emerald-100: oklch(95% 0.052 163.051);
145
+ --color-emerald-200: oklch(90.5% 0.093 164.15);
146
+ --color-emerald-300: oklch(84.5% 0.143 164.978);
147
+ --color-emerald-400: oklch(76.5% 0.177 163.223);
148
+ --color-emerald-500: oklch(69.6% 0.17 162.48);
149
+ --color-emerald-600: oklch(59.6% 0.145 163.225);
150
+ --color-emerald-700: oklch(50.8% 0.118 165.612);
151
+ --color-emerald-800: oklch(43.2% 0.095 166.913);
152
+ --color-emerald-900: oklch(37.8% 0.077 168.94);
153
+ --color-emerald-950: oklch(26.2% 0.051 172.552);
154
+
155
+ --color-teal-50: oklch(98.4% 0.014 180.72);
156
+ --color-teal-100: oklch(95.3% 0.051 180.801);
157
+ --color-teal-200: oklch(91% 0.096 180.426);
158
+ --color-teal-300: oklch(85.5% 0.138 181.071);
159
+ --color-teal-400: oklch(77.7% 0.152 181.912);
160
+ --color-teal-500: oklch(70.4% 0.14 182.503);
161
+ --color-teal-600: oklch(60% 0.118 184.704);
162
+ --color-teal-700: oklch(51.1% 0.096 186.391);
163
+ --color-teal-800: oklch(43.7% 0.078 188.216);
164
+ --color-teal-900: oklch(38.6% 0.063 188.416);
165
+ --color-teal-950: oklch(27.7% 0.046 192.524);
166
+
167
+ --color-cyan-50: oklch(98.4% 0.019 200.873);
168
+ --color-cyan-100: oklch(95.6% 0.045 203.388);
169
+ --color-cyan-200: oklch(91.7% 0.08 205.041);
170
+ --color-cyan-300: oklch(86.5% 0.127 207.078);
171
+ --color-cyan-400: oklch(78.9% 0.154 211.53);
172
+ --color-cyan-500: oklch(71.5% 0.143 215.221);
173
+ --color-cyan-600: oklch(60.9% 0.126 221.723);
174
+ --color-cyan-700: oklch(52% 0.105 223.128);
175
+ --color-cyan-800: oklch(45% 0.085 224.283);
176
+ --color-cyan-900: oklch(39.8% 0.07 227.392);
177
+ --color-cyan-950: oklch(30.2% 0.056 229.695);
178
+
179
+ --color-sky-50: oklch(97.7% 0.013 236.62);
180
+ --color-sky-100: oklch(95.1% 0.026 236.824);
181
+ --color-sky-200: oklch(90.1% 0.058 230.902);
182
+ --color-sky-300: oklch(82.8% 0.111 230.318);
183
+ --color-sky-400: oklch(74.6% 0.16 232.661);
184
+ --color-sky-500: oklch(68.5% 0.169 237.323);
185
+ --color-sky-600: oklch(58.8% 0.158 241.966);
186
+ --color-sky-700: oklch(50% 0.134 242.749);
187
+ --color-sky-800: oklch(44.3% 0.11 240.79);
188
+ --color-sky-900: oklch(39.1% 0.09 240.876);
189
+ --color-sky-950: oklch(29.3% 0.066 243.157);
190
+
191
+ --color-blue-50: oklch(97% 0.014 254.604);
192
+ --color-blue-100: oklch(93.2% 0.032 255.585);
193
+ --color-blue-200: oklch(88.2% 0.059 254.128);
194
+ --color-blue-300: oklch(80.9% 0.105 251.813);
195
+ --color-blue-400: oklch(70.7% 0.165 254.624);
196
+ --color-blue-500: oklch(62.3% 0.214 259.815);
197
+ --color-blue-600: oklch(54.6% 0.245 262.881);
198
+ --color-blue-700: oklch(48.8% 0.243 264.376);
199
+ --color-blue-800: oklch(42.4% 0.199 265.638);
200
+ --color-blue-900: oklch(37.9% 0.146 265.522);
201
+ --color-blue-950: oklch(28.2% 0.091 267.935);
202
+
203
+ --color-indigo-50: oklch(96.2% 0.018 272.314);
204
+ --color-indigo-100: oklch(93% 0.034 272.788);
205
+ --color-indigo-200: oklch(87% 0.065 274.039);
206
+ --color-indigo-300: oklch(78.5% 0.115 274.713);
207
+ --color-indigo-400: oklch(67.3% 0.182 276.935);
208
+ --color-indigo-500: oklch(58.5% 0.233 277.117);
209
+ --color-indigo-600: oklch(51.1% 0.262 276.966);
210
+ --color-indigo-700: oklch(45.7% 0.24 277.023);
211
+ --color-indigo-800: oklch(39.8% 0.195 277.366);
212
+ --color-indigo-900: oklch(35.9% 0.144 278.697);
213
+ --color-indigo-950: oklch(25.7% 0.09 281.288);
214
+
215
+ --color-violet-50: oklch(96.9% 0.016 293.756);
216
+ --color-violet-100: oklch(94.3% 0.029 294.588);
217
+ --color-violet-200: oklch(89.4% 0.057 293.283);
218
+ --color-violet-300: oklch(81.1% 0.111 293.571);
219
+ --color-violet-400: oklch(70.2% 0.183 293.541);
220
+ --color-violet-500: oklch(60.6% 0.25 292.717);
221
+ --color-violet-600: oklch(54.1% 0.281 293.009);
222
+ --color-violet-700: oklch(49.1% 0.27 292.581);
223
+ --color-violet-800: oklch(43.2% 0.232 292.759);
224
+ --color-violet-900: oklch(38% 0.189 293.745);
225
+ --color-violet-950: oklch(28.3% 0.141 291.089);
226
+
227
+ --color-purple-50: oklch(97.7% 0.014 308.299);
228
+ --color-purple-100: oklch(94.6% 0.033 307.174);
229
+ --color-purple-200: oklch(90.2% 0.063 306.703);
230
+ --color-purple-300: oklch(82.7% 0.119 306.383);
231
+ --color-purple-400: oklch(71.4% 0.203 305.504);
232
+ --color-purple-500: oklch(62.7% 0.265 303.9);
233
+ --color-purple-600: oklch(55.8% 0.288 302.321);
234
+ --color-purple-700: oklch(49.6% 0.265 301.924);
235
+ --color-purple-800: oklch(43.8% 0.218 303.724);
236
+ --color-purple-900: oklch(38.1% 0.176 304.987);
237
+ --color-purple-950: oklch(29.1% 0.149 302.717);
238
+
239
+ --color-fuchsia-50: oklch(97.7% 0.017 320.058);
240
+ --color-fuchsia-100: oklch(95.2% 0.037 318.852);
241
+ --color-fuchsia-200: oklch(90.3% 0.076 319.62);
242
+ --color-fuchsia-300: oklch(83.3% 0.145 321.434);
243
+ --color-fuchsia-400: oklch(74% 0.238 322.16);
244
+ --color-fuchsia-500: oklch(66.7% 0.295 322.15);
245
+ --color-fuchsia-600: oklch(59.1% 0.293 322.896);
246
+ --color-fuchsia-700: oklch(51.8% 0.253 323.949);
247
+ --color-fuchsia-800: oklch(45.2% 0.211 324.591);
248
+ --color-fuchsia-900: oklch(40.1% 0.17 325.612);
249
+ --color-fuchsia-950: oklch(29.3% 0.136 325.661);
250
+
251
+ --color-pink-50: oklch(97.1% 0.014 343.198);
252
+ --color-pink-100: oklch(94.8% 0.028 342.258);
253
+ --color-pink-200: oklch(89.9% 0.061 343.231);
254
+ --color-pink-300: oklch(82.3% 0.12 346.018);
255
+ --color-pink-400: oklch(71.8% 0.202 349.761);
256
+ --color-pink-500: oklch(65.6% 0.241 354.308);
257
+ --color-pink-600: oklch(59.2% 0.249 0.584);
258
+ --color-pink-700: oklch(52.5% 0.223 3.958);
259
+ --color-pink-800: oklch(45.9% 0.187 3.815);
260
+ --color-pink-900: oklch(40.8% 0.153 2.432);
261
+ --color-pink-950: oklch(28.4% 0.109 3.907);
262
+
263
+ --color-rose-50: oklch(96.9% 0.015 12.422);
264
+ --color-rose-100: oklch(94.1% 0.03 12.58);
265
+ --color-rose-200: oklch(89.2% 0.058 10.001);
266
+ --color-rose-300: oklch(81% 0.117 11.638);
267
+ --color-rose-400: oklch(71.2% 0.194 13.428);
268
+ --color-rose-500: oklch(64.5% 0.246 16.439);
269
+ --color-rose-600: oklch(58.6% 0.253 17.585);
270
+ --color-rose-700: oklch(51.4% 0.222 16.935);
271
+ --color-rose-800: oklch(45.5% 0.188 13.697);
272
+ --color-rose-900: oklch(41% 0.159 10.272);
273
+ --color-rose-950: oklch(27.1% 0.105 12.094);
274
+
275
+ --color-slate-50: oklch(98.4% 0.003 247.858);
276
+ --color-slate-100: oklch(96.8% 0.007 247.896);
277
+ --color-slate-200: oklch(92.9% 0.013 255.508);
278
+ --color-slate-300: oklch(86.9% 0.022 252.894);
279
+ --color-slate-400: oklch(70.4% 0.04 256.788);
280
+ --color-slate-500: oklch(55.4% 0.046 257.417);
281
+ --color-slate-600: oklch(44.6% 0.043 257.281);
282
+ --color-slate-700: oklch(37.2% 0.044 257.287);
283
+ --color-slate-800: oklch(27.9% 0.041 260.031);
284
+ --color-slate-900: oklch(20.8% 0.042 265.755);
285
+ --color-slate-950: oklch(12.9% 0.042 264.695);
286
+
287
+ --color-gray-50: oklch(98.5% 0.002 247.839);
288
+ --color-gray-100: oklch(96.7% 0.003 264.542);
289
+ --color-gray-200: oklch(92.8% 0.006 264.531);
290
+ --color-gray-300: oklch(87.2% 0.01 258.338);
291
+ --color-gray-400: oklch(70.7% 0.022 261.325);
292
+ --color-gray-500: oklch(55.1% 0.027 264.364);
293
+ --color-gray-600: oklch(44.6% 0.03 256.802);
294
+ --color-gray-700: oklch(37.3% 0.034 259.733);
295
+ --color-gray-800: oklch(27.8% 0.033 256.848);
296
+ --color-gray-900: oklch(21% 0.034 264.665);
297
+ --color-gray-950: oklch(13% 0.028 261.692);
298
+
299
+ --color-zinc-50: oklch(98.5% 0 0);
300
+ --color-zinc-100: oklch(96.7% 0.001 286.375);
301
+ --color-zinc-200: oklch(92% 0.004 286.32);
302
+ --color-zinc-300: oklch(87.1% 0.006 286.286);
303
+ --color-zinc-400: oklch(70.5% 0.015 286.067);
304
+ --color-zinc-500: oklch(55.2% 0.016 285.938);
305
+ --color-zinc-600: oklch(44.2% 0.017 285.786);
306
+ --color-zinc-700: oklch(37% 0.013 285.805);
307
+ --color-zinc-800: oklch(27.4% 0.006 286.033);
308
+ --color-zinc-900: oklch(21% 0.006 285.885);
309
+ --color-zinc-950: oklch(14.1% 0.005 285.823);
310
+
311
+ --color-neutral-50: oklch(98.5% 0 0);
312
+ --color-neutral-100: oklch(97% 0 0);
313
+ --color-neutral-200: oklch(92.2% 0 0);
314
+ --color-neutral-300: oklch(87% 0 0);
315
+ --color-neutral-400: oklch(70.8% 0 0);
316
+ --color-neutral-500: oklch(55.6% 0 0);
317
+ --color-neutral-600: oklch(43.9% 0 0);
318
+ --color-neutral-700: oklch(37.1% 0 0);
319
+ --color-neutral-800: oklch(26.9% 0 0);
320
+ --color-neutral-900: oklch(20.5% 0 0);
321
+ --color-neutral-950: oklch(14.5% 0 0);
322
+
323
+ --color-stone-50: oklch(98.5% 0.001 106.423);
324
+ --color-stone-100: oklch(97% 0.001 106.424);
325
+ --color-stone-200: oklch(92.3% 0.003 48.717);
326
+ --color-stone-300: oklch(86.9% 0.005 56.366);
327
+ --color-stone-400: oklch(70.9% 0.01 56.259);
328
+ --color-stone-500: oklch(55.3% 0.013 58.071);
329
+ --color-stone-600: oklch(44.4% 0.011 73.639);
330
+ --color-stone-700: oklch(37.4% 0.01 67.558);
331
+ --color-stone-800: oklch(26.8% 0.007 34.298);
332
+ --color-stone-900: oklch(21.6% 0.006 56.043);
333
+ --color-stone-950: oklch(14.7% 0.004 49.25);
334
+
335
+ --color-black: #000;
336
+ --color-white: #fff;
337
+
338
+ --spacing: 0.25rem;
339
+
340
+ --breakpoint-sm: 40rem;
341
+ --breakpoint-md: 48rem;
342
+ --breakpoint-lg: 64rem;
343
+ --breakpoint-xl: 80rem;
344
+ --breakpoint-2xl: 96rem;
345
+
346
+ --container-3xs: 16rem;
347
+ --container-2xs: 18rem;
348
+ --container-xs: 20rem;
349
+ --container-sm: 24rem;
350
+ --container-md: 28rem;
351
+ --container-lg: 32rem;
352
+ --container-xl: 36rem;
353
+ --container-2xl: 42rem;
354
+ --container-3xl: 48rem;
355
+ --container-4xl: 56rem;
356
+ --container-5xl: 64rem;
357
+ --container-6xl: 72rem;
358
+ --container-7xl: 80rem;
359
+
360
+ --text-xs: 0.75rem;
361
+ --text-xs--line-height: calc(1 / 0.75);
362
+ --text-sm: 0.875rem;
363
+ --text-sm--line-height: calc(1.25 / 0.875);
364
+ --text-base: 1rem;
365
+ --text-base--line-height: calc(1.5 / 1);
366
+ --text-lg: 1.125rem;
367
+ --text-lg--line-height: calc(1.75 / 1.125);
368
+ --text-xl: 1.25rem;
369
+ --text-xl--line-height: calc(1.75 / 1.25);
370
+ --text-2xl: 1.5rem;
371
+ --text-2xl--line-height: calc(2 / 1.5);
372
+ --text-3xl: 1.875rem;
373
+ --text-3xl--line-height: calc(2.25 / 1.875);
374
+ --text-4xl: 2.25rem;
375
+ --text-4xl--line-height: calc(2.5 / 2.25);
376
+ --text-5xl: 3rem;
377
+ --text-5xl--line-height: 1;
378
+ --text-6xl: 3.75rem;
379
+ --text-6xl--line-height: 1;
380
+ --text-7xl: 4.5rem;
381
+ --text-7xl--line-height: 1;
382
+ --text-8xl: 6rem;
383
+ --text-8xl--line-height: 1;
384
+ --text-9xl: 8rem;
385
+ --text-9xl--line-height: 1;
386
+
387
+ --font-weight-thin: 100;
388
+ --font-weight-extralight: 200;
389
+ --font-weight-light: 300;
390
+ --font-weight-normal: 400;
391
+ --font-weight-medium: 500;
392
+ --font-weight-semibold: 600;
393
+ --font-weight-bold: 700;
394
+ --font-weight-extrabold: 800;
395
+ --font-weight-black: 900;
396
+
397
+ --tracking-tighter: -0.05em;
398
+ --tracking-tight: -0.025em;
399
+ --tracking-normal: 0em;
400
+ --tracking-wide: 0.025em;
401
+ --tracking-wider: 0.05em;
402
+ --tracking-widest: 0.1em;
403
+
404
+ --leading-tight: 1.25;
405
+ --leading-snug: 1.375;
406
+ --leading-normal: 1.5;
407
+ --leading-relaxed: 1.625;
408
+ --leading-loose: 2;
409
+
410
+ --radius-xs: 0.125rem;
411
+ --radius-sm: 0.25rem;
412
+ --radius-md: 0.375rem;
413
+ --radius-lg: 0.5rem;
414
+ --radius-xl: 0.75rem;
415
+ --radius-2xl: 1rem;
416
+ --radius-3xl: 1.5rem;
417
+ --radius-4xl: 2rem;
418
+
419
+ --shadow-2xs: 0 1px rgb(0 0 0 / 0.05);
420
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
421
+ --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
422
+ --shadow-md:
423
+ 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
424
+ --shadow-lg:
425
+ 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
426
+ --shadow-xl:
427
+ 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
428
+ --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
429
+
430
+ --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);
431
+ --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05);
432
+ --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);
433
+
434
+ --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);
435
+ --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);
436
+ --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);
437
+ --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);
438
+ --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);
439
+ --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
440
+
441
+ --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15);
442
+ --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2);
443
+ --text-shadow-sm:
444
+ 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075),
445
+ 0px 2px 2px rgb(0 0 0 / 0.075);
446
+ --text-shadow-md:
447
+ 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1),
448
+ 0px 2px 4px rgb(0 0 0 / 0.1);
449
+ --text-shadow-lg:
450
+ 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1),
451
+ 0px 4px 8px rgb(0 0 0 / 0.1);
452
+
453
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
454
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
455
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
456
+
457
+ --animate-spin: spin 1s linear infinite;
458
+ --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
459
+ --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
460
+ --animate-bounce: bounce 1s infinite;
461
+
462
+ @keyframes spin {
463
+ to {
464
+ transform: rotate(360deg);
465
+ }
466
+ }
467
+
468
+ @keyframes ping {
469
+ 75%,
470
+ 100% {
471
+ transform: scale(2);
472
+ opacity: 0;
473
+ }
474
+ }
475
+
476
+ @keyframes pulse {
477
+ 50% {
478
+ opacity: 0.5;
479
+ }
480
+ }
481
+
482
+ @keyframes bounce {
483
+ 0%,
484
+ 100% {
485
+ transform: translateY(-25%);
486
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
487
+ }
488
+
489
+ 50% {
490
+ transform: none;
491
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
492
+ }
493
+ }
494
+
495
+ --blur-xs: 4px;
496
+ --blur-sm: 8px;
497
+ --blur-md: 12px;
498
+ --blur-lg: 16px;
499
+ --blur-xl: 24px;
500
+ --blur-2xl: 40px;
501
+ --blur-3xl: 64px;
502
+
503
+ --perspective-dramatic: 100px;
504
+ --perspective-near: 300px;
505
+ --perspective-normal: 500px;
506
+ --perspective-midrange: 800px;
507
+ --perspective-distant: 1200px;
508
+
509
+ --aspect-video: 16 / 9;
510
+
511
+ --default-transition-duration: 150ms;
512
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
513
+ --default-font-family: --theme(--font-sans, initial);
514
+ --default-font-feature-settings: --theme(
515
+ --font-sans--font-feature-settings,
516
+ initial
517
+ );
518
+ --default-font-variation-settings: --theme(
519
+ --font-sans--font-variation-settings,
520
+ initial
521
+ );
522
+ --default-mono-font-family: --theme(--font-mono, initial);
523
+ --default-mono-font-feature-settings: --theme(
524
+ --font-mono--font-feature-settings,
525
+ initial
526
+ );
527
+ --default-mono-font-variation-settings: --theme(
528
+ --font-mono--font-variation-settings,
529
+ initial
530
+ );
531
+ }
532
+
533
+ /* Deprecated */
534
+ @theme default inline reference {
535
+ --blur: 8px;
536
+ --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
537
+ --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
538
+ --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);
539
+ --radius: 0.25rem;
540
+ --max-width-prose: 65ch;
541
+ }
542
+ }
543
+
544
+ @layer base {
545
+ /*
546
+ 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
547
+ 2. Remove default margins and padding
548
+ 3. Reset all borders.
549
+ */
550
+
551
+ *,
552
+ ::after,
553
+ ::before,
554
+ ::backdrop,
555
+ ::file-selector-button {
556
+ box-sizing: border-box; /* 1 */
557
+ margin: 0; /* 2 */
558
+ padding: 0; /* 2 */
559
+ border: 0 solid; /* 3 */
560
+ }
561
+
562
+ /*
563
+ 1. Use a consistent sensible line-height in all browsers.
564
+ 2. Prevent adjustments of font size after orientation changes in iOS.
565
+ 3. Use a more readable tab size.
566
+ 4. Use the user's configured \`sans\` font-family by default.
567
+ 5. Use the user's configured \`sans\` font-feature-settings by default.
568
+ 6. Use the user's configured \`sans\` font-variation-settings by default.
569
+ 7. Disable tap highlights on iOS.
570
+ */
571
+
572
+ html,
573
+ :host {
574
+ line-height: 1.5; /* 1 */
575
+ -webkit-text-size-adjust: 100%; /* 2 */
576
+ tab-size: 4; /* 3 */
577
+ font-family: --theme(
578
+ --default-font-family,
579
+ ui-sans-serif,
580
+ system-ui,
581
+ sans-serif,
582
+ "Apple Color Emoji",
583
+ "Segoe UI Emoji",
584
+ "Segoe UI Symbol",
585
+ "Noto Color Emoji"
586
+ ); /* 4 */
587
+ font-feature-settings: --theme(
588
+ --default-font-feature-settings,
589
+ normal
590
+ ); /* 5 */
591
+ font-variation-settings: --theme(
592
+ --default-font-variation-settings,
593
+ normal
594
+ ); /* 6 */
595
+ -webkit-tap-highlight-color: transparent; /* 7 */
596
+ }
597
+
598
+ /*
599
+ 1. Add the correct height in Firefox.
600
+ 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
601
+ 3. Reset the default border style to a 1px solid border.
602
+ */
603
+
604
+ hr {
605
+ height: 0; /* 1 */
606
+ color: inherit; /* 2 */
607
+ border-top-width: 1px; /* 3 */
608
+ }
609
+
610
+ /*
611
+ Add the correct text decoration in Chrome, Edge, and Safari.
612
+ */
613
+
614
+ abbr:where([title]) {
615
+ -webkit-text-decoration: underline dotted;
616
+ text-decoration: underline dotted;
617
+ }
618
+
619
+ /*
620
+ Remove the default font size and weight for headings.
621
+ */
622
+
623
+ h1,
624
+ h2,
625
+ h3,
626
+ h4,
627
+ h5,
628
+ h6 {
629
+ font-size: inherit;
630
+ font-weight: inherit;
631
+ }
632
+
633
+ /*
634
+ Reset links to optimize for opt-in styling instead of opt-out.
635
+ */
636
+
637
+ a {
638
+ color: inherit;
639
+ -webkit-text-decoration: inherit;
640
+ text-decoration: inherit;
641
+ }
642
+
643
+ /*
644
+ Add the correct font weight in Edge and Safari.
645
+ */
646
+
647
+ b,
648
+ strong {
649
+ font-weight: bolder;
650
+ }
651
+
652
+ /*
653
+ 1. Use the user's configured \`mono\` font-family by default.
654
+ 2. Use the user's configured \`mono\` font-feature-settings by default.
655
+ 3. Use the user's configured \`mono\` font-variation-settings by default.
656
+ 4. Correct the odd \`em\` font sizing in all browsers.
657
+ */
658
+
659
+ code,
660
+ kbd,
661
+ samp,
662
+ pre {
663
+ font-family: --theme(
664
+ --default-mono-font-family,
665
+ ui-monospace,
666
+ SFMono-Regular,
667
+ Menlo,
668
+ Monaco,
669
+ Consolas,
670
+ "Liberation Mono",
671
+ "Courier New",
672
+ monospace
673
+ ); /* 1 */
674
+ font-feature-settings: --theme(
675
+ --default-mono-font-feature-settings,
676
+ normal
677
+ ); /* 2 */
678
+ font-variation-settings: --theme(
679
+ --default-mono-font-variation-settings,
680
+ normal
681
+ ); /* 3 */
682
+ font-size: 1em; /* 4 */
683
+ }
684
+
685
+ /*
686
+ Add the correct font size in all browsers.
687
+ */
688
+
689
+ small {
690
+ font-size: 80%;
691
+ }
692
+
693
+ /*
694
+ Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.
695
+ */
696
+
697
+ sub,
698
+ sup {
699
+ font-size: 75%;
700
+ line-height: 0;
701
+ position: relative;
702
+ vertical-align: baseline;
703
+ }
704
+
705
+ sub {
706
+ bottom: -0.25em;
707
+ }
708
+
709
+ sup {
710
+ top: -0.5em;
711
+ }
712
+
713
+ /*
714
+ 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
715
+ 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
716
+ 3. Remove gaps between table borders by default.
717
+ */
718
+
719
+ table {
720
+ text-indent: 0; /* 1 */
721
+ border-color: inherit; /* 2 */
722
+ border-collapse: collapse; /* 3 */
723
+ }
724
+
725
+ /*
726
+ Use the modern Firefox focus style for all focusable elements.
727
+ */
728
+
729
+ :-moz-focusring {
730
+ outline: auto;
731
+ }
732
+
733
+ /*
734
+ Add the correct vertical alignment in Chrome and Firefox.
735
+ */
736
+
737
+ progress {
738
+ vertical-align: baseline;
739
+ }
740
+
741
+ /*
742
+ Add the correct display in Chrome and Safari.
743
+ */
744
+
745
+ summary {
746
+ display: list-item;
747
+ }
748
+
749
+ /*
750
+ Make lists unstyled by default.
751
+ */
752
+
753
+ ol,
754
+ ul,
755
+ menu {
756
+ list-style: none;
757
+ }
758
+
759
+ /*
760
+ 1. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
761
+ 2. Add \`vertical - align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
762
+ This can trigger a poorly considered lint error in some tools but is included by design.
763
+ */
764
+
765
+ img,
766
+ svg,
767
+ video,
768
+ canvas,
769
+ audio,
770
+ iframe,
771
+ embed,
772
+ object {
773
+ display: block; /* 1 */
774
+ vertical-align: middle; /* 2 */
775
+ }
776
+
777
+ /*
778
+ Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
779
+ */
780
+
781
+ img,
782
+ video {
783
+ max-width: 100%;
784
+ height: auto;
785
+ }
786
+
787
+ /*
788
+ 1. Inherit font styles in all browsers.
789
+ 2. Remove border radius in all browsers.
790
+ 3. Remove background color in all browsers.
791
+ 4. Ensure consistent opacity for disabled states in all browsers.
792
+ */
793
+
794
+ button,
795
+ input,
796
+ select,
797
+ optgroup,
798
+ textarea,
799
+ ::file-selector-button {
800
+ font: inherit; /* 1 */
801
+ font-feature-settings: inherit; /* 1 */
802
+ font-variation-settings: inherit; /* 1 */
803
+ letter-spacing: inherit; /* 1 */
804
+ color: inherit; /* 1 */
805
+ border-radius: 0; /* 2 */
806
+ background-color: transparent; /* 3 */
807
+ opacity: 1; /* 4 */
808
+ }
809
+
810
+ /*
811
+ Restore default font weight.
812
+ */
813
+
814
+ :where(select:is([multiple], [size])) optgroup {
815
+ font-weight: bolder;
816
+ }
817
+
818
+ /*
819
+ Restore indentation.
820
+ */
821
+
822
+ :where(select:is([multiple], [size])) optgroup option {
823
+ padding-inline-start: 20px;
824
+ }
825
+
826
+ /*
827
+ Restore space after button.
828
+ */
829
+
830
+ ::file-selector-button {
831
+ margin-inline-end: 4px;
832
+ }
833
+
834
+ /*
835
+ Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
836
+ */
837
+
838
+ ::placeholder {
839
+ opacity: 1;
840
+ }
841
+
842
+ /*
843
+ Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not
844
+ crash when using \`color - mix(…)\` with \`currentcolor\`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)
845
+ */
846
+
847
+ @supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or
848
+ (contain-intrinsic-size: 1px) /* Safari 17+ */ {
849
+ ::placeholder {
850
+ color: color-mix(in oklab, currentcolor 50%, transparent);
851
+ }
852
+ }
853
+
854
+ /*
855
+ Prevent resizing textareas horizontally by default.
856
+ */
857
+
858
+ textarea {
859
+ resize: vertical;
860
+ }
861
+
862
+ /*
863
+ Remove the inner padding in Chrome and Safari on macOS.
864
+ */
865
+
866
+ ::-webkit-search-decoration {
867
+ -webkit-appearance: none;
868
+ }
869
+
870
+ /*
871
+ 1. Ensure date/time inputs have the same height when empty in iOS Safari.
872
+ 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
873
+ */
874
+
875
+ ::-webkit-date-and-time-value {
876
+ min-height: 1lh; /* 1 */
877
+ text-align: inherit; /* 2 */
878
+ }
879
+
880
+ /*
881
+ Prevent height from changing on date/time inputs in macOS Safari when the input is set to \`display: block\`.
882
+ */
883
+
884
+ ::-webkit-datetime-edit {
885
+ display: inline-flex;
886
+ }
887
+
888
+ /*
889
+ Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
890
+ */
891
+
892
+ ::-webkit-datetime-edit-fields-wrapper {
893
+ padding: 0;
894
+ }
895
+
896
+ ::-webkit-datetime-edit,
897
+ ::-webkit-datetime-edit-year-field,
898
+ ::-webkit-datetime-edit-month-field,
899
+ ::-webkit-datetime-edit-day-field,
900
+ ::-webkit-datetime-edit-hour-field,
901
+ ::-webkit-datetime-edit-minute-field,
902
+ ::-webkit-datetime-edit-second-field,
903
+ ::-webkit-datetime-edit-millisecond-field,
904
+ ::-webkit-datetime-edit-meridiem-field {
905
+ padding-block: 0;
906
+ }
907
+
908
+ /*
909
+ Center dropdown marker shown on inputs with paired \`<datalist>\`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)
910
+ */
911
+
912
+ ::-webkit-calendar-picker-indicator {
913
+ line-height: 1;
914
+ }
915
+
916
+ /*
917
+ Remove the additional \`: invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
918
+ */
919
+
920
+ :-moz-ui-invalid {
921
+ box-shadow: none;
922
+ }
923
+
924
+ /*
925
+ Correct the inability to style the border radius in iOS Safari.
926
+ */
927
+
928
+ button,
929
+ input:where([type="button"], [type="reset"], [type="submit"]),
930
+ ::file-selector-button {
931
+ appearance: button;
932
+ }
933
+
934
+ /*
935
+ Correct the cursor style of increment and decrement buttons in Safari.
936
+ */
937
+
938
+ ::-webkit-inner-spin-button,
939
+ ::-webkit-outer-spin-button {
940
+ height: auto;
941
+ }
942
+
943
+ /*
944
+ Make elements with the HTML hidden attribute stay hidden by default.
945
+ */
946
+
947
+ [hidden]:where(:not([hidden="until-found"])) {
948
+ display: none !important;
949
+ }
950
+ }
951
+
952
+ @layer utilities {
953
+ @tailwind utilities;
954
+ }
955
+ `;
956
+ //#endregion
957
+ //#region src/utils/tailwindcss/tailwind-stylesheets/preflight.ts
958
+ const css$2 = `
959
+ /*
960
+ 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
961
+ 2. Remove default margins and padding
962
+ 3. Reset all borders.
963
+ */
964
+
965
+ *,
966
+ ::after,
967
+ ::before,
968
+ ::backdrop,
969
+ ::file-selector-button {
970
+ box-sizing: border-box; /* 1 */
971
+ margin: 0; /* 2 */
972
+ padding: 0; /* 2 */
973
+ border: 0 solid; /* 3 */
974
+ }
975
+
976
+ /*
977
+ 1. Use a consistent sensible line-height in all browsers.
978
+ 2. Prevent adjustments of font size after orientation changes in iOS.
979
+ 3. Use a more readable tab size.
980
+ 4. Use the user's configured \`sans\` font-family by default.
981
+ 5. Use the user's configured \`sans\` font-feature-settings by default.
982
+ 6. Use the user's configured \`sans\` font-variation-settings by default.
983
+ 7. Disable tap highlights on iOS.
984
+ */
985
+
986
+ html,
987
+ :host {
988
+ line-height: 1.5; /* 1 */
989
+ -webkit-text-size-adjust: 100%; /* 2 */
990
+ tab-size: 4; /* 3 */
991
+ font-family: --theme(
992
+ --default-font-family,
993
+ ui-sans-serif,
994
+ system-ui,
995
+ sans-serif,
996
+ 'Apple Color Emoji',
997
+ 'Segoe UI Emoji',
998
+ 'Segoe UI Symbol',
999
+ 'Noto Color Emoji'
1000
+ ); /* 4 */
1001
+ font-feature-settings: --theme(--default-font-feature-settings, normal); /* 5 */
1002
+ font-variation-settings: --theme(--default-font-variation-settings, normal); /* 6 */
1003
+ -webkit-tap-highlight-color: transparent; /* 7 */
1004
+ }
1005
+
1006
+ /*
1007
+ 1. Add the correct height in Firefox.
1008
+ 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
1009
+ 3. Reset the default border style to a 1px solid border.
1010
+ */
1011
+
1012
+ hr {
1013
+ height: 0; /* 1 */
1014
+ color: inherit; /* 2 */
1015
+ border-top-width: 1px; /* 3 */
1016
+ }
1017
+
1018
+ /*
1019
+ Add the correct text decoration in Chrome, Edge, and Safari.
1020
+ */
1021
+
1022
+ abbr:where([title]) {
1023
+ -webkit-text-decoration: underline dotted;
1024
+ text-decoration: underline dotted;
1025
+ }
1026
+
1027
+ /*
1028
+ Remove the default font size and weight for headings.
1029
+ */
1030
+
1031
+ h1,
1032
+ h2,
1033
+ h3,
1034
+ h4,
1035
+ h5,
1036
+ h6 {
1037
+ font-size: inherit;
1038
+ font-weight: inherit;
1039
+ }
1040
+
1041
+ /*
1042
+ Reset links to optimize for opt-in styling instead of opt-out.
1043
+ */
1044
+
1045
+ a {
1046
+ color: inherit;
1047
+ -webkit-text-decoration: inherit;
1048
+ text-decoration: inherit;
1049
+ }
1050
+
1051
+ /*
1052
+ Add the correct font weight in Edge and Safari.
1053
+ */
1054
+
1055
+ b,
1056
+ strong {
1057
+ font-weight: bolder;
1058
+ }
1059
+
1060
+ /*
1061
+ 1. Use the user's configured \`mono\` font-family by default.
1062
+ 2. Use the user's configured \`mono\` font-feature-settings by default.
1063
+ 3. Use the user's configured \`mono\` font-variation-settings by default.
1064
+ 4. Correct the odd \`em\` font sizing in all browsers.
1065
+ */
1066
+
1067
+ code,
1068
+ kbd,
1069
+ samp,
1070
+ pre {
1071
+ font-family: --theme(
1072
+ --default-mono-font-family,
1073
+ ui-monospace,
1074
+ SFMono-Regular,
1075
+ Menlo,
1076
+ Monaco,
1077
+ Consolas,
1078
+ 'Liberation Mono',
1079
+ 'Courier New',
1080
+ monospace
1081
+ ); /* 1 */
1082
+ font-feature-settings: --theme(--default-mono-font-feature-settings, normal); /* 2 */
1083
+ font-variation-settings: --theme(--default-mono-font-variation-settings, normal); /* 3 */
1084
+ font-size: 1em; /* 4 */
1085
+ }
1086
+
1087
+ /*
1088
+ Add the correct font size in all browsers.
1089
+ */
1090
+
1091
+ small {
1092
+ font-size: 80%;
1093
+ }
1094
+
1095
+ /*
1096
+ Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.
1097
+ */
1098
+
1099
+ sub,
1100
+ sup {
1101
+ font-size: 75%;
1102
+ line-height: 0;
1103
+ position: relative;
1104
+ vertical-align: baseline;
1105
+ }
1106
+
1107
+ sub {
1108
+ bottom: -0.25em;
1109
+ }
1110
+
1111
+ sup {
1112
+ top: -0.5em;
1113
+ }
1114
+
1115
+ /*
1116
+ 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
1117
+ 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
1118
+ 3. Remove gaps between table borders by default.
1119
+ */
1120
+
1121
+ table {
1122
+ text-indent: 0; /* 1 */
1123
+ border-color: inherit; /* 2 */
1124
+ border-collapse: collapse; /* 3 */
1125
+ }
1126
+
1127
+ /*
1128
+ Use the modern Firefox focus style for all focusable elements.
1129
+ */
1130
+
1131
+ :-moz-focusring {
1132
+ outline: auto;
1133
+ }
1134
+
1135
+ /*
1136
+ Add the correct vertical alignment in Chrome and Firefox.
1137
+ */
1138
+
1139
+ progress {
1140
+ vertical-align: baseline;
1141
+ }
1142
+
1143
+ /*
1144
+ Add the correct display in Chrome and Safari.
1145
+ */
1146
+
1147
+ summary {
1148
+ display: list-item;
1149
+ }
1150
+
1151
+ /*
1152
+ Make lists unstyled by default.
1153
+ */
1154
+
1155
+ ol,
1156
+ ul,
1157
+ menu {
1158
+ list-style: none;
1159
+ }
1160
+
1161
+ /*
1162
+ 1. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
1163
+ 2. Add \`vertical-align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
1164
+ This can trigger a poorly considered lint error in some tools but is included by design.
1165
+ */
1166
+
1167
+ img,
1168
+ svg,
1169
+ video,
1170
+ canvas,
1171
+ audio,
1172
+ iframe,
1173
+ embed,
1174
+ object {
1175
+ display: block; /* 1 */
1176
+ vertical-align: middle; /* 2 */
1177
+ }
1178
+
1179
+ /*
1180
+ Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
1181
+ */
1182
+
1183
+ img,
1184
+ video {
1185
+ max-width: 100%;
1186
+ height: auto;
1187
+ }
1188
+
1189
+ /*
1190
+ 1. Inherit font styles in all browsers.
1191
+ 2. Remove border radius in all browsers.
1192
+ 3. Remove background color in all browsers.
1193
+ 4. Ensure consistent opacity for disabled states in all browsers.
1194
+ */
1195
+
1196
+ button,
1197
+ input,
1198
+ select,
1199
+ optgroup,
1200
+ textarea,
1201
+ ::file-selector-button {
1202
+ font: inherit; /* 1 */
1203
+ font-feature-settings: inherit; /* 1 */
1204
+ font-variation-settings: inherit; /* 1 */
1205
+ letter-spacing: inherit; /* 1 */
1206
+ color: inherit; /* 1 */
1207
+ border-radius: 0; /* 2 */
1208
+ background-color: transparent; /* 3 */
1209
+ opacity: 1; /* 4 */
1210
+ }
1211
+
1212
+ /*
1213
+ Restore default font weight.
1214
+ */
1215
+
1216
+ :where(select:is([multiple], [size])) optgroup {
1217
+ font-weight: bolder;
1218
+ }
1219
+
1220
+ /*
1221
+ Restore indentation.
1222
+ */
1223
+
1224
+ :where(select:is([multiple], [size])) optgroup option {
1225
+ padding-inline-start: 20px;
1226
+ }
1227
+
1228
+ /*
1229
+ Restore space after button.
1230
+ */
1231
+
1232
+ ::file-selector-button {
1233
+ margin-inline-end: 4px;
1234
+ }
1235
+
1236
+ /*
1237
+ Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
1238
+ */
1239
+
1240
+ ::placeholder {
1241
+ opacity: 1;
1242
+ }
1243
+
1244
+ /*
1245
+ Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not
1246
+ crash when using \`color-mix(…)\` with \`currentcolor\`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)
1247
+ */
1248
+
1249
+ @supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or
1250
+ (contain-intrinsic-size: 1px) /* Safari 17+ */ {
1251
+ ::placeholder {
1252
+ color: color-mix(in oklab, currentcolor 50%, transparent);
1253
+ }
1254
+ }
1255
+
1256
+ /*
1257
+ Prevent resizing textareas horizontally by default.
1258
+ */
1259
+
1260
+ textarea {
1261
+ resize: vertical;
1262
+ }
1263
+
1264
+ /*
1265
+ Remove the inner padding in Chrome and Safari on macOS.
1266
+ */
1267
+
1268
+ ::-webkit-search-decoration {
1269
+ -webkit-appearance: none;
1270
+ }
1271
+
1272
+ /*
1273
+ 1. Ensure date/time inputs have the same height when empty in iOS Safari.
1274
+ 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
1275
+ */
1276
+
1277
+ ::-webkit-date-and-time-value {
1278
+ min-height: 1lh; /* 1 */
1279
+ text-align: inherit; /* 2 */
1280
+ }
1281
+
1282
+ /*
1283
+ Prevent height from changing on date/time inputs in macOS Safari when the input is set to \`display: block\`.
1284
+ */
1285
+
1286
+ ::-webkit-datetime-edit {
1287
+ display: inline-flex;
1288
+ }
1289
+
1290
+ /*
1291
+ Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
1292
+ */
1293
+
1294
+ ::-webkit-datetime-edit-fields-wrapper {
1295
+ padding: 0;
1296
+ }
1297
+
1298
+ ::-webkit-datetime-edit,
1299
+ ::-webkit-datetime-edit-year-field,
1300
+ ::-webkit-datetime-edit-month-field,
1301
+ ::-webkit-datetime-edit-day-field,
1302
+ ::-webkit-datetime-edit-hour-field,
1303
+ ::-webkit-datetime-edit-minute-field,
1304
+ ::-webkit-datetime-edit-second-field,
1305
+ ::-webkit-datetime-edit-millisecond-field,
1306
+ ::-webkit-datetime-edit-meridiem-field {
1307
+ padding-block: 0;
1308
+ }
1309
+
1310
+ /*
1311
+ Center dropdown marker shown on inputs with paired \`<datalist>\`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)
1312
+ */
1313
+
1314
+ ::-webkit-calendar-picker-indicator {
1315
+ line-height: 1;
1316
+ }
1317
+
1318
+ /*
1319
+ Remove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
1320
+ */
1321
+
1322
+ :-moz-ui-invalid {
1323
+ box-shadow: none;
1324
+ }
1325
+
1326
+ /*
1327
+ Correct the inability to style the border radius in iOS Safari.
1328
+ */
1329
+
1330
+ button,
1331
+ input:where([type='button'], [type='reset'], [type='submit']),
1332
+ ::file-selector-button {
1333
+ appearance: button;
1334
+ }
1335
+
1336
+ /*
1337
+ Correct the cursor style of increment and decrement buttons in Safari.
1338
+ */
1339
+
1340
+ ::-webkit-inner-spin-button,
1341
+ ::-webkit-outer-spin-button {
1342
+ height: auto;
1343
+ }
1344
+
1345
+ /*
1346
+ Make elements with the HTML hidden attribute stay hidden by default.
1347
+ */
1348
+
1349
+ [hidden]:where(:not([hidden='until-found'])) {
1350
+ display: none !important;
1351
+ }
1352
+ `;
1353
+ //#endregion
1354
+ //#region src/utils/tailwindcss/tailwind-stylesheets/theme.ts
1355
+ const css$1 = `
1356
+ @theme default {
1357
+ --font-sans:
1358
+ ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
1359
+ 'Noto Color Emoji';
1360
+ --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
1361
+ --font-mono:
1362
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
1363
+ monospace;
1364
+
1365
+ --color-red-50: oklch(97.1% 0.013 17.38);
1366
+ --color-red-100: oklch(93.6% 0.032 17.717);
1367
+ --color-red-200: oklch(88.5% 0.062 18.334);
1368
+ --color-red-300: oklch(80.8% 0.114 19.571);
1369
+ --color-red-400: oklch(70.4% 0.191 22.216);
1370
+ --color-red-500: oklch(63.7% 0.237 25.331);
1371
+ --color-red-600: oklch(57.7% 0.245 27.325);
1372
+ --color-red-700: oklch(50.5% 0.213 27.518);
1373
+ --color-red-800: oklch(44.4% 0.177 26.899);
1374
+ --color-red-900: oklch(39.6% 0.141 25.723);
1375
+ --color-red-950: oklch(25.8% 0.092 26.042);
1376
+
1377
+ --color-orange-50: oklch(98% 0.016 73.684);
1378
+ --color-orange-100: oklch(95.4% 0.038 75.164);
1379
+ --color-orange-200: oklch(90.1% 0.076 70.697);
1380
+ --color-orange-300: oklch(83.7% 0.128 66.29);
1381
+ --color-orange-400: oklch(75% 0.183 55.934);
1382
+ --color-orange-500: oklch(70.5% 0.213 47.604);
1383
+ --color-orange-600: oklch(64.6% 0.222 41.116);
1384
+ --color-orange-700: oklch(55.3% 0.195 38.402);
1385
+ --color-orange-800: oklch(47% 0.157 37.304);
1386
+ --color-orange-900: oklch(40.8% 0.123 38.172);
1387
+ --color-orange-950: oklch(26.6% 0.079 36.259);
1388
+
1389
+ --color-amber-50: oklch(98.7% 0.022 95.277);
1390
+ --color-amber-100: oklch(96.2% 0.059 95.617);
1391
+ --color-amber-200: oklch(92.4% 0.12 95.746);
1392
+ --color-amber-300: oklch(87.9% 0.169 91.605);
1393
+ --color-amber-400: oklch(82.8% 0.189 84.429);
1394
+ --color-amber-500: oklch(76.9% 0.188 70.08);
1395
+ --color-amber-600: oklch(66.6% 0.179 58.318);
1396
+ --color-amber-700: oklch(55.5% 0.163 48.998);
1397
+ --color-amber-800: oklch(47.3% 0.137 46.201);
1398
+ --color-amber-900: oklch(41.4% 0.112 45.904);
1399
+ --color-amber-950: oklch(27.9% 0.077 45.635);
1400
+
1401
+ --color-yellow-50: oklch(98.7% 0.026 102.212);
1402
+ --color-yellow-100: oklch(97.3% 0.071 103.193);
1403
+ --color-yellow-200: oklch(94.5% 0.129 101.54);
1404
+ --color-yellow-300: oklch(90.5% 0.182 98.111);
1405
+ --color-yellow-400: oklch(85.2% 0.199 91.936);
1406
+ --color-yellow-500: oklch(79.5% 0.184 86.047);
1407
+ --color-yellow-600: oklch(68.1% 0.162 75.834);
1408
+ --color-yellow-700: oklch(55.4% 0.135 66.442);
1409
+ --color-yellow-800: oklch(47.6% 0.114 61.907);
1410
+ --color-yellow-900: oklch(42.1% 0.095 57.708);
1411
+ --color-yellow-950: oklch(28.6% 0.066 53.813);
1412
+
1413
+ --color-lime-50: oklch(98.6% 0.031 120.757);
1414
+ --color-lime-100: oklch(96.7% 0.067 122.328);
1415
+ --color-lime-200: oklch(93.8% 0.127 124.321);
1416
+ --color-lime-300: oklch(89.7% 0.196 126.665);
1417
+ --color-lime-400: oklch(84.1% 0.238 128.85);
1418
+ --color-lime-500: oklch(76.8% 0.233 130.85);
1419
+ --color-lime-600: oklch(64.8% 0.2 131.684);
1420
+ --color-lime-700: oklch(53.2% 0.157 131.589);
1421
+ --color-lime-800: oklch(45.3% 0.124 130.933);
1422
+ --color-lime-900: oklch(40.5% 0.101 131.063);
1423
+ --color-lime-950: oklch(27.4% 0.072 132.109);
1424
+
1425
+ --color-green-50: oklch(98.2% 0.018 155.826);
1426
+ --color-green-100: oklch(96.2% 0.044 156.743);
1427
+ --color-green-200: oklch(92.5% 0.084 155.995);
1428
+ --color-green-300: oklch(87.1% 0.15 154.449);
1429
+ --color-green-400: oklch(79.2% 0.209 151.711);
1430
+ --color-green-500: oklch(72.3% 0.219 149.579);
1431
+ --color-green-600: oklch(62.7% 0.194 149.214);
1432
+ --color-green-700: oklch(52.7% 0.154 150.069);
1433
+ --color-green-800: oklch(44.8% 0.119 151.328);
1434
+ --color-green-900: oklch(39.3% 0.095 152.535);
1435
+ --color-green-950: oklch(26.6% 0.065 152.934);
1436
+
1437
+ --color-emerald-50: oklch(97.9% 0.021 166.113);
1438
+ --color-emerald-100: oklch(95% 0.052 163.051);
1439
+ --color-emerald-200: oklch(90.5% 0.093 164.15);
1440
+ --color-emerald-300: oklch(84.5% 0.143 164.978);
1441
+ --color-emerald-400: oklch(76.5% 0.177 163.223);
1442
+ --color-emerald-500: oklch(69.6% 0.17 162.48);
1443
+ --color-emerald-600: oklch(59.6% 0.145 163.225);
1444
+ --color-emerald-700: oklch(50.8% 0.118 165.612);
1445
+ --color-emerald-800: oklch(43.2% 0.095 166.913);
1446
+ --color-emerald-900: oklch(37.8% 0.077 168.94);
1447
+ --color-emerald-950: oklch(26.2% 0.051 172.552);
1448
+
1449
+ --color-teal-50: oklch(98.4% 0.014 180.72);
1450
+ --color-teal-100: oklch(95.3% 0.051 180.801);
1451
+ --color-teal-200: oklch(91% 0.096 180.426);
1452
+ --color-teal-300: oklch(85.5% 0.138 181.071);
1453
+ --color-teal-400: oklch(77.7% 0.152 181.912);
1454
+ --color-teal-500: oklch(70.4% 0.14 182.503);
1455
+ --color-teal-600: oklch(60% 0.118 184.704);
1456
+ --color-teal-700: oklch(51.1% 0.096 186.391);
1457
+ --color-teal-800: oklch(43.7% 0.078 188.216);
1458
+ --color-teal-900: oklch(38.6% 0.063 188.416);
1459
+ --color-teal-950: oklch(27.7% 0.046 192.524);
1460
+
1461
+ --color-cyan-50: oklch(98.4% 0.019 200.873);
1462
+ --color-cyan-100: oklch(95.6% 0.045 203.388);
1463
+ --color-cyan-200: oklch(91.7% 0.08 205.041);
1464
+ --color-cyan-300: oklch(86.5% 0.127 207.078);
1465
+ --color-cyan-400: oklch(78.9% 0.154 211.53);
1466
+ --color-cyan-500: oklch(71.5% 0.143 215.221);
1467
+ --color-cyan-600: oklch(60.9% 0.126 221.723);
1468
+ --color-cyan-700: oklch(52% 0.105 223.128);
1469
+ --color-cyan-800: oklch(45% 0.085 224.283);
1470
+ --color-cyan-900: oklch(39.8% 0.07 227.392);
1471
+ --color-cyan-950: oklch(30.2% 0.056 229.695);
1472
+
1473
+ --color-sky-50: oklch(97.7% 0.013 236.62);
1474
+ --color-sky-100: oklch(95.1% 0.026 236.824);
1475
+ --color-sky-200: oklch(90.1% 0.058 230.902);
1476
+ --color-sky-300: oklch(82.8% 0.111 230.318);
1477
+ --color-sky-400: oklch(74.6% 0.16 232.661);
1478
+ --color-sky-500: oklch(68.5% 0.169 237.323);
1479
+ --color-sky-600: oklch(58.8% 0.158 241.966);
1480
+ --color-sky-700: oklch(50% 0.134 242.749);
1481
+ --color-sky-800: oklch(44.3% 0.11 240.79);
1482
+ --color-sky-900: oklch(39.1% 0.09 240.876);
1483
+ --color-sky-950: oklch(29.3% 0.066 243.157);
1484
+
1485
+ --color-blue-50: oklch(97% 0.014 254.604);
1486
+ --color-blue-100: oklch(93.2% 0.032 255.585);
1487
+ --color-blue-200: oklch(88.2% 0.059 254.128);
1488
+ --color-blue-300: oklch(80.9% 0.105 251.813);
1489
+ --color-blue-400: oklch(70.7% 0.165 254.624);
1490
+ --color-blue-500: oklch(62.3% 0.214 259.815);
1491
+ --color-blue-600: oklch(54.6% 0.245 262.881);
1492
+ --color-blue-700: oklch(48.8% 0.243 264.376);
1493
+ --color-blue-800: oklch(42.4% 0.199 265.638);
1494
+ --color-blue-900: oklch(37.9% 0.146 265.522);
1495
+ --color-blue-950: oklch(28.2% 0.091 267.935);
1496
+
1497
+ --color-indigo-50: oklch(96.2% 0.018 272.314);
1498
+ --color-indigo-100: oklch(93% 0.034 272.788);
1499
+ --color-indigo-200: oklch(87% 0.065 274.039);
1500
+ --color-indigo-300: oklch(78.5% 0.115 274.713);
1501
+ --color-indigo-400: oklch(67.3% 0.182 276.935);
1502
+ --color-indigo-500: oklch(58.5% 0.233 277.117);
1503
+ --color-indigo-600: oklch(51.1% 0.262 276.966);
1504
+ --color-indigo-700: oklch(45.7% 0.24 277.023);
1505
+ --color-indigo-800: oklch(39.8% 0.195 277.366);
1506
+ --color-indigo-900: oklch(35.9% 0.144 278.697);
1507
+ --color-indigo-950: oklch(25.7% 0.09 281.288);
1508
+
1509
+ --color-violet-50: oklch(96.9% 0.016 293.756);
1510
+ --color-violet-100: oklch(94.3% 0.029 294.588);
1511
+ --color-violet-200: oklch(89.4% 0.057 293.283);
1512
+ --color-violet-300: oklch(81.1% 0.111 293.571);
1513
+ --color-violet-400: oklch(70.2% 0.183 293.541);
1514
+ --color-violet-500: oklch(60.6% 0.25 292.717);
1515
+ --color-violet-600: oklch(54.1% 0.281 293.009);
1516
+ --color-violet-700: oklch(49.1% 0.27 292.581);
1517
+ --color-violet-800: oklch(43.2% 0.232 292.759);
1518
+ --color-violet-900: oklch(38% 0.189 293.745);
1519
+ --color-violet-950: oklch(28.3% 0.141 291.089);
1520
+
1521
+ --color-purple-50: oklch(97.7% 0.014 308.299);
1522
+ --color-purple-100: oklch(94.6% 0.033 307.174);
1523
+ --color-purple-200: oklch(90.2% 0.063 306.703);
1524
+ --color-purple-300: oklch(82.7% 0.119 306.383);
1525
+ --color-purple-400: oklch(71.4% 0.203 305.504);
1526
+ --color-purple-500: oklch(62.7% 0.265 303.9);
1527
+ --color-purple-600: oklch(55.8% 0.288 302.321);
1528
+ --color-purple-700: oklch(49.6% 0.265 301.924);
1529
+ --color-purple-800: oklch(43.8% 0.218 303.724);
1530
+ --color-purple-900: oklch(38.1% 0.176 304.987);
1531
+ --color-purple-950: oklch(29.1% 0.149 302.717);
1532
+
1533
+ --color-fuchsia-50: oklch(97.7% 0.017 320.058);
1534
+ --color-fuchsia-100: oklch(95.2% 0.037 318.852);
1535
+ --color-fuchsia-200: oklch(90.3% 0.076 319.62);
1536
+ --color-fuchsia-300: oklch(83.3% 0.145 321.434);
1537
+ --color-fuchsia-400: oklch(74% 0.238 322.16);
1538
+ --color-fuchsia-500: oklch(66.7% 0.295 322.15);
1539
+ --color-fuchsia-600: oklch(59.1% 0.293 322.896);
1540
+ --color-fuchsia-700: oklch(51.8% 0.253 323.949);
1541
+ --color-fuchsia-800: oklch(45.2% 0.211 324.591);
1542
+ --color-fuchsia-900: oklch(40.1% 0.17 325.612);
1543
+ --color-fuchsia-950: oklch(29.3% 0.136 325.661);
1544
+
1545
+ --color-pink-50: oklch(97.1% 0.014 343.198);
1546
+ --color-pink-100: oklch(94.8% 0.028 342.258);
1547
+ --color-pink-200: oklch(89.9% 0.061 343.231);
1548
+ --color-pink-300: oklch(82.3% 0.12 346.018);
1549
+ --color-pink-400: oklch(71.8% 0.202 349.761);
1550
+ --color-pink-500: oklch(65.6% 0.241 354.308);
1551
+ --color-pink-600: oklch(59.2% 0.249 0.584);
1552
+ --color-pink-700: oklch(52.5% 0.223 3.958);
1553
+ --color-pink-800: oklch(45.9% 0.187 3.815);
1554
+ --color-pink-900: oklch(40.8% 0.153 2.432);
1555
+ --color-pink-950: oklch(28.4% 0.109 3.907);
1556
+
1557
+ --color-rose-50: oklch(96.9% 0.015 12.422);
1558
+ --color-rose-100: oklch(94.1% 0.03 12.58);
1559
+ --color-rose-200: oklch(89.2% 0.058 10.001);
1560
+ --color-rose-300: oklch(81% 0.117 11.638);
1561
+ --color-rose-400: oklch(71.2% 0.194 13.428);
1562
+ --color-rose-500: oklch(64.5% 0.246 16.439);
1563
+ --color-rose-600: oklch(58.6% 0.253 17.585);
1564
+ --color-rose-700: oklch(51.4% 0.222 16.935);
1565
+ --color-rose-800: oklch(45.5% 0.188 13.697);
1566
+ --color-rose-900: oklch(41% 0.159 10.272);
1567
+ --color-rose-950: oklch(27.1% 0.105 12.094);
1568
+
1569
+ --color-slate-50: oklch(98.4% 0.003 247.858);
1570
+ --color-slate-100: oklch(96.8% 0.007 247.896);
1571
+ --color-slate-200: oklch(92.9% 0.013 255.508);
1572
+ --color-slate-300: oklch(86.9% 0.022 252.894);
1573
+ --color-slate-400: oklch(70.4% 0.04 256.788);
1574
+ --color-slate-500: oklch(55.4% 0.046 257.417);
1575
+ --color-slate-600: oklch(44.6% 0.043 257.281);
1576
+ --color-slate-700: oklch(37.2% 0.044 257.287);
1577
+ --color-slate-800: oklch(27.9% 0.041 260.031);
1578
+ --color-slate-900: oklch(20.8% 0.042 265.755);
1579
+ --color-slate-950: oklch(12.9% 0.042 264.695);
1580
+
1581
+ --color-gray-50: oklch(98.5% 0.002 247.839);
1582
+ --color-gray-100: oklch(96.7% 0.003 264.542);
1583
+ --color-gray-200: oklch(92.8% 0.006 264.531);
1584
+ --color-gray-300: oklch(87.2% 0.01 258.338);
1585
+ --color-gray-400: oklch(70.7% 0.022 261.325);
1586
+ --color-gray-500: oklch(55.1% 0.027 264.364);
1587
+ --color-gray-600: oklch(44.6% 0.03 256.802);
1588
+ --color-gray-700: oklch(37.3% 0.034 259.733);
1589
+ --color-gray-800: oklch(27.8% 0.033 256.848);
1590
+ --color-gray-900: oklch(21% 0.034 264.665);
1591
+ --color-gray-950: oklch(13% 0.028 261.692);
1592
+
1593
+ --color-zinc-50: oklch(98.5% 0 0);
1594
+ --color-zinc-100: oklch(96.7% 0.001 286.375);
1595
+ --color-zinc-200: oklch(92% 0.004 286.32);
1596
+ --color-zinc-300: oklch(87.1% 0.006 286.286);
1597
+ --color-zinc-400: oklch(70.5% 0.015 286.067);
1598
+ --color-zinc-500: oklch(55.2% 0.016 285.938);
1599
+ --color-zinc-600: oklch(44.2% 0.017 285.786);
1600
+ --color-zinc-700: oklch(37% 0.013 285.805);
1601
+ --color-zinc-800: oklch(27.4% 0.006 286.033);
1602
+ --color-zinc-900: oklch(21% 0.006 285.885);
1603
+ --color-zinc-950: oklch(14.1% 0.005 285.823);
1604
+
1605
+ --color-neutral-50: oklch(98.5% 0 0);
1606
+ --color-neutral-100: oklch(97% 0 0);
1607
+ --color-neutral-200: oklch(92.2% 0 0);
1608
+ --color-neutral-300: oklch(87% 0 0);
1609
+ --color-neutral-400: oklch(70.8% 0 0);
1610
+ --color-neutral-500: oklch(55.6% 0 0);
1611
+ --color-neutral-600: oklch(43.9% 0 0);
1612
+ --color-neutral-700: oklch(37.1% 0 0);
1613
+ --color-neutral-800: oklch(26.9% 0 0);
1614
+ --color-neutral-900: oklch(20.5% 0 0);
1615
+ --color-neutral-950: oklch(14.5% 0 0);
1616
+
1617
+ --color-stone-50: oklch(98.5% 0.001 106.423);
1618
+ --color-stone-100: oklch(97% 0.001 106.424);
1619
+ --color-stone-200: oklch(92.3% 0.003 48.717);
1620
+ --color-stone-300: oklch(86.9% 0.005 56.366);
1621
+ --color-stone-400: oklch(70.9% 0.01 56.259);
1622
+ --color-stone-500: oklch(55.3% 0.013 58.071);
1623
+ --color-stone-600: oklch(44.4% 0.011 73.639);
1624
+ --color-stone-700: oklch(37.4% 0.01 67.558);
1625
+ --color-stone-800: oklch(26.8% 0.007 34.298);
1626
+ --color-stone-900: oklch(21.6% 0.006 56.043);
1627
+ --color-stone-950: oklch(14.7% 0.004 49.25);
1628
+
1629
+ --color-black: #000;
1630
+ --color-white: #fff;
1631
+
1632
+ --spacing: 0.25rem;
1633
+
1634
+ --breakpoint-sm: 40rem;
1635
+ --breakpoint-md: 48rem;
1636
+ --breakpoint-lg: 64rem;
1637
+ --breakpoint-xl: 80rem;
1638
+ --breakpoint-2xl: 96rem;
1639
+
1640
+ --container-3xs: 16rem;
1641
+ --container-2xs: 18rem;
1642
+ --container-xs: 20rem;
1643
+ --container-sm: 24rem;
1644
+ --container-md: 28rem;
1645
+ --container-lg: 32rem;
1646
+ --container-xl: 36rem;
1647
+ --container-2xl: 42rem;
1648
+ --container-3xl: 48rem;
1649
+ --container-4xl: 56rem;
1650
+ --container-5xl: 64rem;
1651
+ --container-6xl: 72rem;
1652
+ --container-7xl: 80rem;
1653
+
1654
+ --text-xs: 0.75rem;
1655
+ --text-xs--line-height: calc(1 / 0.75);
1656
+ --text-sm: 0.875rem;
1657
+ --text-sm--line-height: calc(1.25 / 0.875);
1658
+ --text-base: 1rem;
1659
+ --text-base--line-height: calc(1.5 / 1);
1660
+ --text-lg: 1.125rem;
1661
+ --text-lg--line-height: calc(1.75 / 1.125);
1662
+ --text-xl: 1.25rem;
1663
+ --text-xl--line-height: calc(1.75 / 1.25);
1664
+ --text-2xl: 1.5rem;
1665
+ --text-2xl--line-height: calc(2 / 1.5);
1666
+ --text-3xl: 1.875rem;
1667
+ --text-3xl--line-height: calc(2.25 / 1.875);
1668
+ --text-4xl: 2.25rem;
1669
+ --text-4xl--line-height: calc(2.5 / 2.25);
1670
+ --text-5xl: 3rem;
1671
+ --text-5xl--line-height: 1;
1672
+ --text-6xl: 3.75rem;
1673
+ --text-6xl--line-height: 1;
1674
+ --text-7xl: 4.5rem;
1675
+ --text-7xl--line-height: 1;
1676
+ --text-8xl: 6rem;
1677
+ --text-8xl--line-height: 1;
1678
+ --text-9xl: 8rem;
1679
+ --text-9xl--line-height: 1;
1680
+
1681
+ --font-weight-thin: 100;
1682
+ --font-weight-extralight: 200;
1683
+ --font-weight-light: 300;
1684
+ --font-weight-normal: 400;
1685
+ --font-weight-medium: 500;
1686
+ --font-weight-semibold: 600;
1687
+ --font-weight-bold: 700;
1688
+ --font-weight-extrabold: 800;
1689
+ --font-weight-black: 900;
1690
+
1691
+ --tracking-tighter: -0.05em;
1692
+ --tracking-tight: -0.025em;
1693
+ --tracking-normal: 0em;
1694
+ --tracking-wide: 0.025em;
1695
+ --tracking-wider: 0.05em;
1696
+ --tracking-widest: 0.1em;
1697
+
1698
+ --leading-tight: 1.25;
1699
+ --leading-snug: 1.375;
1700
+ --leading-normal: 1.5;
1701
+ --leading-relaxed: 1.625;
1702
+ --leading-loose: 2;
1703
+
1704
+ --radius-xs: 0.125rem;
1705
+ --radius-sm: 0.25rem;
1706
+ --radius-md: 0.375rem;
1707
+ --radius-lg: 0.5rem;
1708
+ --radius-xl: 0.75rem;
1709
+ --radius-2xl: 1rem;
1710
+ --radius-3xl: 1.5rem;
1711
+ --radius-4xl: 2rem;
1712
+
1713
+ --shadow-2xs: 0 1px rgb(0 0 0 / 0.05);
1714
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
1715
+ --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
1716
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
1717
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
1718
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
1719
+ --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
1720
+
1721
+ --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);
1722
+ --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05);
1723
+ --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);
1724
+
1725
+ --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);
1726
+ --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);
1727
+ --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);
1728
+ --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);
1729
+ --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);
1730
+ --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
1731
+
1732
+ --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15);
1733
+ --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2);
1734
+ --text-shadow-sm:
1735
+ 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075);
1736
+ --text-shadow-md:
1737
+ 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1);
1738
+ --text-shadow-lg:
1739
+ 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1);
1740
+
1741
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
1742
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
1743
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
1744
+
1745
+ --animate-spin: spin 1s linear infinite;
1746
+ --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
1747
+ --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
1748
+ --animate-bounce: bounce 1s infinite;
1749
+
1750
+ @keyframes spin {
1751
+ to {
1752
+ transform: rotate(360deg);
1753
+ }
1754
+ }
1755
+
1756
+ @keyframes ping {
1757
+ 75%,
1758
+ 100% {
1759
+ transform: scale(2);
1760
+ opacity: 0;
1761
+ }
1762
+ }
1763
+
1764
+ @keyframes pulse {
1765
+ 50% {
1766
+ opacity: 0.5;
1767
+ }
1768
+ }
1769
+
1770
+ @keyframes bounce {
1771
+ 0%,
1772
+ 100% {
1773
+ transform: translateY(-25%);
1774
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
1775
+ }
1776
+
1777
+ 50% {
1778
+ transform: none;
1779
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
1780
+ }
1781
+ }
1782
+
1783
+ --blur-xs: 4px;
1784
+ --blur-sm: 8px;
1785
+ --blur-md: 12px;
1786
+ --blur-lg: 16px;
1787
+ --blur-xl: 24px;
1788
+ --blur-2xl: 40px;
1789
+ --blur-3xl: 64px;
1790
+
1791
+ --perspective-dramatic: 100px;
1792
+ --perspective-near: 300px;
1793
+ --perspective-normal: 500px;
1794
+ --perspective-midrange: 800px;
1795
+ --perspective-distant: 1200px;
1796
+
1797
+ --aspect-video: 16 / 9;
1798
+
1799
+ --default-transition-duration: 150ms;
1800
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1801
+ --default-font-family: --theme(--font-sans, initial);
1802
+ --default-font-feature-settings: --theme(--font-sans--font-feature-settings, initial);
1803
+ --default-font-variation-settings: --theme(--font-sans--font-variation-settings, initial);
1804
+ --default-mono-font-family: --theme(--font-mono, initial);
1805
+ --default-mono-font-feature-settings: --theme(--font-mono--font-feature-settings, initial);
1806
+ --default-mono-font-variation-settings: --theme(--font-mono--font-variation-settings, initial);
1807
+ }
1808
+
1809
+ /* Deprecated */
1810
+ @theme default inline reference {
1811
+ --blur: 8px;
1812
+ --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
1813
+ --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
1814
+ --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);
1815
+ --radius: 0.25rem;
1816
+ --max-width-prose: 65ch;
1817
+ }
1818
+ `;
1819
+ //#endregion
1820
+ //#region src/utils/tailwindcss/tailwind-stylesheets/utilities.ts
1821
+ const css = `
1822
+ @tailwind utilities;
1823
+ `;
1824
+ //#endregion
1825
+ //#region src/utils/tailwindcss/sanitize-custom-css.ts
1826
+ function sanitizeCustomCss(css) {
1827
+ const root = postcss.default.parse(css);
1828
+ root.walkAtRules((atRule) => {
1829
+ if (atRule.name === "import" || atRule.name === "plugin" || atRule.name === "source") atRule.remove();
1830
+ });
1831
+ return root.toString();
1832
+ }
1833
+ //#endregion
1834
+ //#region src/utils/tailwindcss/setup-tailwind.ts
1835
+ /**
1836
+ * Set up Tailwind CSS compiler with optional custom CSS injection
1837
+ * @param config - Tailwind configuration
1838
+ * @param customCSS - Optional custom CSS string to inject (e.g., your theme CSS variables)
1839
+ */
1840
+ async function setupTailwind(config, customCSS) {
1841
+ const baseCss = `
1842
+ @layer theme, base, components, utilities;
1843
+ /* @import "tailwindcss/preflight.css" layer(base); */
1844
+ @import "tailwindcss/theme.css" layer(theme);
1845
+ @import "tailwindcss/utilities.css" layer(utilities);
1846
+ ${customCSS ? sanitizeCustomCss(customCSS) : ""}
1847
+ @config;
1848
+ `;
1849
+ const compiler = await (0, tailwindcss.compile)(baseCss, {
1850
+ async loadModule(id, base, resourceHint) {
1851
+ if (resourceHint === "config") return {
1852
+ path: id,
1853
+ base,
1854
+ module: config
1855
+ };
1856
+ throw new Error(`NO-OP: should we implement support for ${resourceHint}: ${id}?`);
1857
+ },
1858
+ polyfills: 0,
1859
+ async loadStylesheet(id, base) {
1860
+ if (id === "tailwindcss") return {
1861
+ base,
1862
+ path: "tailwindcss/index.css",
1863
+ content: css$3
1864
+ };
1865
+ if (id === "tailwindcss/preflight.css") return {
1866
+ base,
1867
+ path: id,
1868
+ content: css$2
1869
+ };
1870
+ if (id === "tailwindcss/theme.css") return {
1871
+ base,
1872
+ path: id,
1873
+ content: css$1
1874
+ };
1875
+ if (id === "tailwindcss/utilities.css") return {
1876
+ base,
1877
+ path: id,
1878
+ content: css
1879
+ };
1880
+ throw new Error("stylesheet not supported, you can only import the ones from tailwindcss");
1881
+ }
1882
+ });
1883
+ let css$4 = baseCss;
1884
+ return {
1885
+ addUtilities: function addUtilities(candidates) {
1886
+ css$4 = compiler.build(candidates);
1887
+ },
1888
+ getStyleSheet: function getStyleSheet() {
1889
+ return postcss.default.parse(css$4);
1890
+ }
1891
+ };
1892
+ }
1893
+ //#endregion
1894
+ //#region src/utils/css/resolve-all-css-variables.ts
1895
+ const MAX_CSS_VARIABLE_RESOLUTION_ITERATIONS = 10;
1896
+ function getSelector(decl) {
1897
+ const parent = decl.parent;
1898
+ if (parent?.type === "rule") return parent.selector;
1899
+ return "*";
1900
+ }
1901
+ function getAtRuleSelector(decl) {
1902
+ let parent = decl.parent;
1903
+ while (parent) {
1904
+ if (parent.type === "atrule") {
1905
+ const atRuleParent = parent.parent;
1906
+ if (atRuleParent?.type === "rule") return atRuleParent.selector;
1907
+ }
1908
+ if (parent.type === "rule") return parent.selector;
1909
+ parent = parent.parent;
1910
+ }
1911
+ }
1912
+ function isInAtRule(decl) {
1913
+ let parent = decl.parent;
1914
+ while (parent) {
1915
+ if (parent.type === "atrule") return true;
1916
+ parent = parent.parent;
1917
+ }
1918
+ return false;
1919
+ }
1920
+ function isInPropertiesLayer(decl) {
1921
+ let parent = decl.parent;
1922
+ while (parent) {
1923
+ if (parent.type === "atrule") {
1924
+ const atRule = parent;
1925
+ if (atRule.name === "layer" && atRule.params?.includes("properties")) return true;
1926
+ }
1927
+ parent = parent.parent;
1928
+ }
1929
+ return false;
1930
+ }
1931
+ function doSelectorsIntersect(first, second) {
1932
+ if (first === second) return true;
1933
+ if (first.includes(":root") || second.includes(":root")) return true;
1934
+ if (first === "*" || second === "*") return true;
1935
+ return false;
1936
+ }
1937
+ function resolveAllCssVariables(root) {
1938
+ let iteration = 0;
1939
+ while (iteration < MAX_CSS_VARIABLE_RESOLUTION_ITERATIONS) {
1940
+ const variableDefinitions = /* @__PURE__ */ new Set();
1941
+ const variableUses = [];
1942
+ root.walkDecls((decl) => {
1943
+ if (isInPropertiesLayer(decl)) return;
1944
+ if (decl.prop.startsWith("--")) variableDefinitions.add({
1945
+ declaration: decl,
1946
+ selector: getSelector(decl),
1947
+ variableName: decl.prop
1948
+ });
1949
+ if (decl.value.includes("var(")) {
1950
+ const parseVariableUses = (value) => {
1951
+ (0, postcss_value_parser.default)(value).walk((node) => {
1952
+ if (node.type === "function" && node.value === "var") {
1953
+ const varNameNode = node.nodes[0];
1954
+ const varName = varNameNode ? postcss_value_parser.default.stringify(varNameNode).trim() : "";
1955
+ let fallback;
1956
+ const commaIndex = node.nodes.findIndex((n) => n.type === "div" && n.value === ",");
1957
+ if (commaIndex !== -1) fallback = postcss_value_parser.default.stringify(node.nodes.slice(commaIndex + 1)).trim();
1958
+ const raw = postcss_value_parser.default.stringify(node);
1959
+ variableUses.push({
1960
+ declaration: decl,
1961
+ selector: getSelector(decl),
1962
+ inAtRule: isInAtRule(decl),
1963
+ atRuleSelector: getAtRuleSelector(decl),
1964
+ fallback,
1965
+ variableName: varName,
1966
+ raw
1967
+ });
1968
+ if (fallback?.includes("var(")) parseVariableUses(fallback);
1969
+ }
1970
+ });
1971
+ };
1972
+ parseVariableUses(decl.value);
1973
+ }
1974
+ });
1975
+ if (variableUses.length === 0) break;
1976
+ let replacedInThisIteration = false;
1977
+ for (const use of variableUses) {
1978
+ let hasReplaced = false;
1979
+ for (const definition of variableDefinitions) {
1980
+ if (use.variableName !== definition.variableName) continue;
1981
+ if (use.inAtRule && use.atRuleSelector && doSelectorsIntersect(use.atRuleSelector, definition.selector)) {
1982
+ use.declaration.value = use.declaration.value.replaceAll(use.raw, definition.declaration.value);
1983
+ hasReplaced = true;
1984
+ replacedInThisIteration = true;
1985
+ break;
1986
+ }
1987
+ if (use.inAtRule && !use.atRuleSelector && (definition.selector.includes(":root") || definition.selector === "*")) {
1988
+ use.declaration.value = use.declaration.value.replaceAll(use.raw, definition.declaration.value);
1989
+ hasReplaced = true;
1990
+ replacedInThisIteration = true;
1991
+ break;
1992
+ }
1993
+ if (!use.inAtRule && doSelectorsIntersect(use.selector, definition.selector)) {
1994
+ use.declaration.value = use.declaration.value.replaceAll(use.raw, definition.declaration.value);
1995
+ hasReplaced = true;
1996
+ replacedInThisIteration = true;
1997
+ break;
1998
+ }
1999
+ }
2000
+ if (!hasReplaced && use.fallback) {
2001
+ use.declaration.value = use.declaration.value.replaceAll(use.raw, use.fallback);
2002
+ replacedInThisIteration = true;
2003
+ }
2004
+ }
2005
+ if (!replacedInThisIteration) break;
2006
+ iteration++;
2007
+ }
2008
+ if (iteration === MAX_CSS_VARIABLE_RESOLUTION_ITERATIONS) console.warn(`[better-svelte-email] CSS variable resolution hit maximum iterations (${MAX_CSS_VARIABLE_RESOLUTION_ITERATIONS}). This may indicate circular variable references.`);
2009
+ }
2010
+ //#endregion
2011
+ //#region src/utils/css/resolve-calc-expressions.ts
2012
+ function parseValue(str) {
2013
+ const match = str.match(/^(-?[\d.]+)(%|[a-z]+)?$/i);
2014
+ if (match) {
2015
+ const value = parseFloat(match[1]);
2016
+ const unit = match[2] || "";
2017
+ return {
2018
+ value,
2019
+ unit,
2020
+ type: unit === "%" ? "percentage" : unit ? "dimension" : "number"
2021
+ };
2022
+ }
2023
+ return null;
2024
+ }
2025
+ function formatValue(parsed) {
2026
+ return `${parsed.value}${parsed.unit}`;
2027
+ }
2028
+ /**
2029
+ * Converts a CSS length value to pixels.
2030
+ * Returns null for units that cannot be converted (%, vw, vh, ch, ex, etc.)
2031
+ */
2032
+ function toPixels$1(value, unit, baseFontSize) {
2033
+ switch (unit.toLowerCase()) {
2034
+ case "px":
2035
+ case "": return value;
2036
+ case "rem":
2037
+ case "em": return value * baseFontSize;
2038
+ case "pt": return value * (96 / 72);
2039
+ case "pc": return value * 16;
2040
+ case "in": return value * 96;
2041
+ case "cm": return value * (96 / 2.54);
2042
+ case "mm": return value * (96 / 25.4);
2043
+ default: return null;
2044
+ }
2045
+ }
2046
+ /**
2047
+ * Checks if a unit can be converted to pixels.
2048
+ */
2049
+ function isConvertibleUnit(unit) {
2050
+ return [
2051
+ "px",
2052
+ "rem",
2053
+ "em",
2054
+ "pt",
2055
+ "pc",
2056
+ "in",
2057
+ "cm",
2058
+ "mm",
2059
+ ""
2060
+ ].includes(unit.toLowerCase());
2061
+ }
2062
+ /**
2063
+ * Splits a calc expression string into tokens (values and operators)
2064
+ * Handles both space-separated and non-space-separated expressions
2065
+ */
2066
+ function tokenizeCalcExpression(expr) {
2067
+ const tokens = [];
2068
+ let current = "";
2069
+ for (let i = 0; i < expr.length; i++) {
2070
+ const char = expr[i];
2071
+ if (char === "*" || char === "/") {
2072
+ if (current.trim()) tokens.push(current.trim());
2073
+ tokens.push(char);
2074
+ current = "";
2075
+ } else if (char === "+" || char === "-") if (current.trim() && !/[eE]$/.test(current.trim())) {
2076
+ tokens.push(current.trim());
2077
+ tokens.push(char);
2078
+ current = "";
2079
+ } else current += char;
2080
+ else if (char === " ") {
2081
+ if (current.trim()) {
2082
+ let nextNonSpace = i + 1;
2083
+ while (nextNonSpace < expr.length && expr[nextNonSpace] === " ") nextNonSpace++;
2084
+ const nextChar = expr[nextNonSpace];
2085
+ if (nextChar !== "*" && nextChar !== "/" && nextChar !== "+" && nextChar !== "-") {
2086
+ tokens.push(current.trim());
2087
+ current = "";
2088
+ }
2089
+ }
2090
+ } else current += char;
2091
+ }
2092
+ if (current.trim()) tokens.push(current.trim());
2093
+ return tokens;
2094
+ }
2095
+ /**
2096
+ * Resolves calc expressions including `*`, `/`, `+`, and `-` operations.
2097
+ * For `+` and `-` with mixed units, converts to pixels using the baseFontSize.
2098
+ *
2099
+ * Limitations:
2100
+ * - Parenthesized sub-expressions like `calc((10px + 5px) * 2)` are not supported.
2101
+ * - em units are treated as rem and converted to pixels using baseFontSize.
2102
+ * - Non-convertible units (%, vw, vh, etc.) will leave the calc() unresolved.
2103
+ */
2104
+ function evaluateCalcExpression(expr, baseFontSize) {
2105
+ const tokens = tokenizeCalcExpression(expr);
2106
+ if (tokens.length === 0) return null;
2107
+ if (tokens.length === 1) {
2108
+ const parsed = parseValue(tokens[0]);
2109
+ return parsed ? formatValue(parsed) : null;
2110
+ }
2111
+ let i = 0;
2112
+ while (i < tokens.length) {
2113
+ const token = tokens[i];
2114
+ if (token === "*" || token === "/") {
2115
+ const left = parseValue(tokens[i - 1]);
2116
+ const right = parseValue(tokens[i + 1]);
2117
+ if (left && right) {
2118
+ let resultValue;
2119
+ if (token === "*") resultValue = left.value * right.value;
2120
+ else if (right.value === 0) resultValue = 0;
2121
+ else resultValue = left.value / right.value;
2122
+ let resultUnit = "";
2123
+ let resultType = "number";
2124
+ if (left.type === "dimension" && right.type === "number") {
2125
+ resultUnit = left.unit;
2126
+ resultType = "dimension";
2127
+ } else if (left.type === "number" && right.type === "dimension") {
2128
+ resultUnit = right.unit;
2129
+ resultType = "dimension";
2130
+ } else if (left.type === "dimension" && right.type === "dimension") if (token === "/") resultType = "number";
2131
+ else {
2132
+ resultUnit = left.unit;
2133
+ resultType = "dimension";
2134
+ }
2135
+ else if (left.type === "percentage" || right.type === "percentage") if (token === "/" && left.type === "percentage" && right.type === "percentage") resultType = "number";
2136
+ else {
2137
+ resultUnit = "%";
2138
+ resultType = "percentage";
2139
+ }
2140
+ const result = formatValue({
2141
+ value: resultValue,
2142
+ unit: resultUnit,
2143
+ type: resultType
2144
+ });
2145
+ tokens.splice(i - 1, 3, result);
2146
+ i = Math.max(0, i - 1);
2147
+ continue;
2148
+ }
2149
+ }
2150
+ i++;
2151
+ }
2152
+ if (tokens.length === 1) return tokens[0];
2153
+ i = 0;
2154
+ while (i < tokens.length) {
2155
+ const token = tokens[i];
2156
+ if ((token === "+" || token === "-") && i > 0 && i < tokens.length - 1) {
2157
+ const left = parseValue(tokens[i - 1]);
2158
+ const right = parseValue(tokens[i + 1]);
2159
+ if (left && right) {
2160
+ if (left.unit.toLowerCase() === right.unit.toLowerCase()) {
2161
+ const result = formatValue({
2162
+ value: token === "+" ? left.value + right.value : left.value - right.value,
2163
+ unit: left.unit,
2164
+ type: left.type
2165
+ });
2166
+ tokens.splice(i - 1, 3, result);
2167
+ i = Math.max(0, i - 1);
2168
+ continue;
2169
+ }
2170
+ if (isConvertibleUnit(left.unit) && isConvertibleUnit(right.unit)) {
2171
+ const leftPx = toPixels$1(left.value, left.unit, baseFontSize);
2172
+ const rightPx = toPixels$1(right.value, right.unit, baseFontSize);
2173
+ if (leftPx !== null && rightPx !== null) {
2174
+ const result = formatValue({
2175
+ value: token === "+" ? leftPx + rightPx : leftPx - rightPx,
2176
+ unit: "px",
2177
+ type: "dimension"
2178
+ });
2179
+ tokens.splice(i - 1, 3, result);
2180
+ i = Math.max(0, i - 1);
2181
+ continue;
2182
+ }
2183
+ }
2184
+ }
2185
+ }
2186
+ i++;
2187
+ }
2188
+ if (tokens.length === 1) return tokens[0];
2189
+ return null;
2190
+ }
2191
+ function resolveCalcExpressions(root, config) {
2192
+ const baseFontSize = config?.baseFontSize ?? 16;
2193
+ root.walkDecls((decl) => {
2194
+ if (!decl.value.includes("calc(")) return;
2195
+ const parsed = (0, postcss_value_parser.default)(decl.value);
2196
+ parsed.walk((node) => {
2197
+ if (node.type === "function" && node.value === "calc") {
2198
+ const result = evaluateCalcExpression(postcss_value_parser.default.stringify(node.nodes), baseFontSize);
2199
+ if (result) {
2200
+ node.type = "word";
2201
+ node.value = result;
2202
+ node.nodes = [];
2203
+ }
2204
+ }
2205
+ });
2206
+ decl.value = postcss_value_parser.default.stringify(parsed.nodes);
2207
+ });
2208
+ }
2209
+ //#endregion
2210
+ //#region src/utils/css/sanitize-declarations.ts
2211
+ /**
2212
+ * Converts a CSS length value to pixels.
2213
+ * Returns null for units that cannot be converted (%, vw, vh, ch, ex, etc.)
2214
+ */
2215
+ function toPixels(value, unit, baseFontSize) {
2216
+ switch (unit.toLowerCase()) {
2217
+ case "px": return value;
2218
+ case "rem":
2219
+ case "em": return value * baseFontSize;
2220
+ case "pt": return value * (96 / 72);
2221
+ case "pc": return value * 16;
2222
+ case "in": return value * 96;
2223
+ case "cm": return value * (96 / 2.54);
2224
+ case "mm": return value * (96 / 25.4);
2225
+ default: return null;
2226
+ }
2227
+ }
2228
+ const LAB_TO_LMS = {
2229
+ l: [.3963377773761749, .2158037573099136],
2230
+ m: [-.1055613458156586, -.0638541728258133],
2231
+ s: [-.0894841775298119, -1.2914855480194092]
2232
+ };
2233
+ const LSM_TO_RGB = {
2234
+ r: [
2235
+ 4.076741636075958,
2236
+ -3.307711539258063,
2237
+ .2309699031821043
2238
+ ],
2239
+ g: [
2240
+ -1.2684379732850315,
2241
+ 2.609757349287688,
2242
+ -.341319376002657
2243
+ ],
2244
+ b: [
2245
+ -.0041960761386756,
2246
+ -.7034186179359362,
2247
+ 1.7076146940746117
2248
+ ]
2249
+ };
2250
+ function lrgbToRgb(input) {
2251
+ const absoluteNumber = Math.abs(input);
2252
+ const sign = input < 0 ? -1 : 1;
2253
+ if (absoluteNumber > .0031308) return sign * (absoluteNumber ** (1 / 2.4) * 1.055 - .055);
2254
+ return input * 12.92;
2255
+ }
2256
+ function clamp(value, min, max) {
2257
+ return Math.min(Math.max(value, min), max);
2258
+ }
2259
+ function oklchToOklab(oklch) {
2260
+ return {
2261
+ l: oklch.l,
2262
+ a: oklch.c * Math.cos(oklch.h / 180 * Math.PI),
2263
+ b: oklch.c * Math.sin(oklch.h / 180 * Math.PI)
2264
+ };
2265
+ }
2266
+ /** Convert oklch to RGB */
2267
+ function oklchToRgb(oklch) {
2268
+ const oklab = oklchToOklab(oklch);
2269
+ const l = (oklab.l + LAB_TO_LMS.l[0] * oklab.a + LAB_TO_LMS.l[1] * oklab.b) ** 3;
2270
+ const m = (oklab.l + LAB_TO_LMS.m[0] * oklab.a + LAB_TO_LMS.m[1] * oklab.b) ** 3;
2271
+ const s = (oklab.l + LAB_TO_LMS.s[0] * oklab.a + LAB_TO_LMS.s[1] * oklab.b) ** 3;
2272
+ const r = 255 * lrgbToRgb(LSM_TO_RGB.r[0] * l + LSM_TO_RGB.r[1] * m + LSM_TO_RGB.r[2] * s);
2273
+ const g = 255 * lrgbToRgb(LSM_TO_RGB.g[0] * l + LSM_TO_RGB.g[1] * m + LSM_TO_RGB.g[2] * s);
2274
+ const b = 255 * lrgbToRgb(LSM_TO_RGB.b[0] * l + LSM_TO_RGB.b[1] * m + LSM_TO_RGB.b[2] * s);
2275
+ return {
2276
+ r: clamp(r, 0, 255),
2277
+ g: clamp(g, 0, 255),
2278
+ b: clamp(b, 0, 255)
2279
+ };
2280
+ }
2281
+ function formatRgb(r, g, b, a) {
2282
+ const rInt = Math.round(r);
2283
+ const gInt = Math.round(g);
2284
+ const bInt = Math.round(b);
2285
+ if (a !== void 0 && a !== 1) return `rgb(${rInt}, ${gInt}, ${bInt}, ${a})`;
2286
+ return `rgb(${rInt}, ${gInt}, ${bInt})`;
2287
+ }
2288
+ function hexToRgb(hex) {
2289
+ hex = hex.replace("#", "");
2290
+ if (hex.length === 3) return {
2291
+ r: parseInt(hex[0] + hex[0], 16),
2292
+ g: parseInt(hex[1] + hex[1], 16),
2293
+ b: parseInt(hex[2] + hex[2], 16)
2294
+ };
2295
+ if (hex.length === 4) return {
2296
+ r: parseInt(hex[0] + hex[0], 16),
2297
+ g: parseInt(hex[1] + hex[1], 16),
2298
+ b: parseInt(hex[2] + hex[2], 16),
2299
+ a: parseInt(hex[3] + hex[3], 16) / 255
2300
+ };
2301
+ if (hex.length === 5) return {
2302
+ r: parseInt(hex.slice(0, 2), 16),
2303
+ g: parseInt(hex[2] + hex[2], 16),
2304
+ b: parseInt(hex[3] + hex[3], 16),
2305
+ a: parseInt(hex[4] + hex[4], 16) / 255
2306
+ };
2307
+ if (hex.length === 6) return {
2308
+ r: parseInt(hex.slice(0, 2), 16),
2309
+ g: parseInt(hex.slice(2, 4), 16),
2310
+ b: parseInt(hex.slice(4, 6), 16)
2311
+ };
2312
+ if (hex.length === 7) return {
2313
+ r: parseInt(hex.slice(0, 2), 16),
2314
+ g: parseInt(hex.slice(2, 4), 16),
2315
+ b: parseInt(hex.slice(4, 6), 16),
2316
+ a: parseInt(hex[6] + hex[6], 16) / 255
2317
+ };
2318
+ return {
2319
+ r: parseInt(hex.slice(0, 2), 16),
2320
+ g: parseInt(hex.slice(2, 4), 16),
2321
+ b: parseInt(hex.slice(4, 6), 16),
2322
+ a: parseInt(hex.slice(6, 8), 16) / 255
2323
+ };
2324
+ }
2325
+ function parseOklchValues(nodes) {
2326
+ const result = {};
2327
+ for (const node of nodes) if (node.type === "word") {
2328
+ const numMatch = node.value.match(/^(-?[\d.]+)(%|deg)?$/i);
2329
+ if (numMatch) {
2330
+ const value = parseFloat(numMatch[1]);
2331
+ const unit = numMatch[2]?.toLowerCase();
2332
+ if (unit === "%") {
2333
+ if (result.l === void 0) result.l = value / 100;
2334
+ else if (result.a === void 0) result.a = value / 100;
2335
+ } else if (unit === "deg") {
2336
+ if (result.h === void 0) result.h = value;
2337
+ } else if (result.l === void 0) result.l = value;
2338
+ else if (result.c === void 0) result.c = value;
2339
+ else if (result.h === void 0) result.h = value;
2340
+ else if (result.a === void 0) result.a = value;
2341
+ }
2342
+ }
2343
+ return result;
2344
+ }
2345
+ function parseRgbValues(nodes) {
2346
+ const result = {};
2347
+ for (const node of nodes) if (node.type === "word") {
2348
+ const numMatch = node.value.match(/^(-?[\d.]+)(%)?$/);
2349
+ if (numMatch) {
2350
+ const value = parseFloat(numMatch[1]);
2351
+ const isPercent = numMatch[2] === "%";
2352
+ if (result.r === void 0) result.r = isPercent ? value * 255 / 100 : value;
2353
+ else if (result.g === void 0) result.g = isPercent ? value * 255 / 100 : value;
2354
+ else if (result.b === void 0) result.b = isPercent ? value * 255 / 100 : value;
2355
+ else if (result.a === void 0) result.a = isPercent ? value / 100 : value;
2356
+ }
2357
+ }
2358
+ return result;
2359
+ }
2360
+ function transformColorMix(node) {
2361
+ const lastNode = node.nodes[node.nodes.length - 1];
2362
+ if (lastNode?.type !== "word" || lastNode.value !== "transparent") return null;
2363
+ let colorFunc = null;
2364
+ let colorHex = null;
2365
+ let percentage = null;
2366
+ for (const child of node.nodes) {
2367
+ if (child.type === "function" && (child.value === "rgb" || child.value === "oklch")) colorFunc = child;
2368
+ if (child.type === "word" && child.value.startsWith("#")) colorHex = child.value;
2369
+ if (child.type === "word" && child.value.endsWith("%")) percentage = parseFloat(child.value) / 100;
2370
+ }
2371
+ let rgb = null;
2372
+ if (colorFunc) {
2373
+ if (colorFunc.value === "rgb") {
2374
+ const rgbValues = parseRgbValues(colorFunc.nodes);
2375
+ if (rgbValues.r !== void 0 && rgbValues.g !== void 0 && rgbValues.b !== void 0) rgb = {
2376
+ r: rgbValues.r,
2377
+ g: rgbValues.g,
2378
+ b: rgbValues.b,
2379
+ a: rgbValues.a
2380
+ };
2381
+ } else if (colorFunc.value === "oklch") {
2382
+ const oklchValues = parseOklchValues(colorFunc.nodes);
2383
+ if (oklchValues.l !== void 0 && oklchValues.c !== void 0 && oklchValues.h !== void 0) {
2384
+ const convertedRgb = oklchToRgb({
2385
+ l: oklchValues.l,
2386
+ c: oklchValues.c,
2387
+ h: oklchValues.h
2388
+ });
2389
+ rgb = {
2390
+ r: convertedRgb.r,
2391
+ g: convertedRgb.g,
2392
+ b: convertedRgb.b,
2393
+ a: oklchValues.a
2394
+ };
2395
+ }
2396
+ }
2397
+ } else if (colorHex) rgb = hexToRgb(colorHex);
2398
+ if (rgb && percentage !== null) return formatRgb(rgb.r * percentage + 255 * (1 - percentage), rgb.g * percentage + 255 * (1 - percentage), rgb.b * percentage + 255 * (1 - percentage));
2399
+ return null;
2400
+ }
2401
+ /**
2402
+ * Meant to do all the things necessary, in a per-declaration basis, to have the best email client
2403
+ * support possible.
2404
+ *
2405
+ * Here's the transformations it does so far:
2406
+ * - convert relative units (rem, em, pt, pc, in, cm, mm) to px for better email client support;
2407
+ * - convert all `rgb` with space-based syntax into a comma based one;
2408
+ * - convert all `oklch` values into `rgb`;
2409
+ * - convert all hex values into `rgb`;
2410
+ * - convert `padding-inline` into `padding-left` and `padding-right`;
2411
+ * - convert `padding-block` into `padding-top` and `padding-bottom`;
2412
+ * - convert `margin-inline` into `margin-left` and `margin-right`;
2413
+ * - convert `margin-block` into `margin-top` and `margin-bottom`.
2414
+ */
2415
+ function sanitizeDeclarations(root, config) {
2416
+ const baseFontSize = config?.baseFontSize ?? 16;
2417
+ root.walkDecls((decl) => {
2418
+ if (decl.prop === "border-radius" && /calc\s*\(\s*infinity\s*\*\s*1px\s*\)/i.test(decl.value)) decl.value = "9999px";
2419
+ if (decl.prop === "padding-inline") {
2420
+ const values = decl.value.split(/\s+/).filter(Boolean);
2421
+ decl.prop = "padding-left";
2422
+ decl.value = values[0];
2423
+ decl.cloneAfter({
2424
+ prop: "padding-right",
2425
+ value: values[1] || values[0]
2426
+ });
2427
+ }
2428
+ if (decl.prop === "padding-block") {
2429
+ const values = decl.value.split(/\s+/).filter(Boolean);
2430
+ decl.prop = "padding-top";
2431
+ decl.value = values[0];
2432
+ decl.cloneAfter({
2433
+ prop: "padding-bottom",
2434
+ value: values[1] || values[0]
2435
+ });
2436
+ }
2437
+ if (decl.prop === "margin-inline") {
2438
+ const values = decl.value.split(/\s+/).filter(Boolean);
2439
+ decl.prop = "margin-left";
2440
+ decl.value = values[0];
2441
+ decl.cloneAfter({
2442
+ prop: "margin-right",
2443
+ value: values[1] || values[0]
2444
+ });
2445
+ }
2446
+ if (decl.prop === "margin-block") {
2447
+ const values = decl.value.split(/\s+/).filter(Boolean);
2448
+ decl.prop = "margin-top";
2449
+ decl.value = values[0];
2450
+ decl.cloneAfter({
2451
+ prop: "margin-bottom",
2452
+ value: values[1] || values[0]
2453
+ });
2454
+ }
2455
+ if (/\d+(rem|em|pt|pc|in|cm|mm)\b/i.test(decl.value)) {
2456
+ const parsed = (0, postcss_value_parser.default)(decl.value);
2457
+ parsed.walk((node) => {
2458
+ if (node.type === "word") {
2459
+ const match = node.value.match(/^(-?[\d.]+)(rem|em|pt|pc|in|cm|mm)$/i);
2460
+ if (match) {
2461
+ const numValue = parseFloat(match[1]);
2462
+ const unit = match[2];
2463
+ const pxValue = toPixels(numValue, unit, baseFontSize);
2464
+ if (pxValue !== null) node.value = `${Math.round(pxValue * 1e3) / 1e3}px`;
2465
+ }
2466
+ }
2467
+ });
2468
+ decl.value = postcss_value_parser.default.stringify(parsed.nodes);
2469
+ }
2470
+ if (decl.value.includes("oklch(") || decl.value.includes("rgb(") || decl.value.includes("#") || decl.value.includes("color-mix(")) {
2471
+ const parsed = (0, postcss_value_parser.default)(decl.value);
2472
+ parsed.walk((node) => {
2473
+ if (node.type === "function" && node.value === "oklch") {
2474
+ const oklchValues = parseOklchValues(node.nodes);
2475
+ if (oklchValues.l === void 0 || oklchValues.c === void 0 || oklchValues.h === void 0) throw new Error("Could not determine the parameters of an oklch() function.", { cause: decl });
2476
+ const rgb = oklchToRgb({
2477
+ l: oklchValues.l,
2478
+ c: oklchValues.c,
2479
+ h: oklchValues.h
2480
+ });
2481
+ node.type = "word";
2482
+ node.value = formatRgb(rgb.r, rgb.g, rgb.b, oklchValues.a);
2483
+ node.nodes = [];
2484
+ }
2485
+ if (node.type === "function" && node.value === "rgb") {
2486
+ const rgbValues = parseRgbValues(node.nodes);
2487
+ if (rgbValues.r === void 0 || rgbValues.g === void 0 || rgbValues.b === void 0) throw new Error("Could not determine the parameters of an rgb() function.", { cause: decl });
2488
+ node.type = "word";
2489
+ node.value = formatRgb(rgbValues.r, rgbValues.g, rgbValues.b, rgbValues.a);
2490
+ node.nodes = [];
2491
+ }
2492
+ if (node.type === "function" && node.value === "color-mix") {
2493
+ const result = transformColorMix(node);
2494
+ if (result) {
2495
+ node.type = "word";
2496
+ node.value = result;
2497
+ node.nodes = [];
2498
+ }
2499
+ }
2500
+ if (node.type === "word" && node.value.startsWith("#")) {
2501
+ const rgb = hexToRgb(node.value);
2502
+ node.value = formatRgb(rgb.r, rgb.g, rgb.b, rgb.a);
2503
+ }
2504
+ });
2505
+ decl.value = postcss_value_parser.default.stringify(parsed.nodes);
2506
+ }
2507
+ });
2508
+ }
2509
+ //#endregion
2510
+ //#region src/utils/css/sanitize-stylesheet.ts
2511
+ function sanitizeStyleSheet(root, config) {
2512
+ resolveAllCssVariables(root);
2513
+ resolveCalcExpressions(root, config);
2514
+ sanitizeDeclarations(root, config);
2515
+ }
2516
+ //#endregion
2517
+ //#region src/utils/css/is-rule-inlinable.ts
2518
+ const NON_INLINABLE_AT_RULES = new Set([
2519
+ "media",
2520
+ "supports",
2521
+ "container",
2522
+ "document"
2523
+ ]);
2524
+ function isRuleInlinable(rule) {
2525
+ let hasAtRuleInside = false;
2526
+ rule.walk((node) => {
2527
+ if (node.type === "atrule") {
2528
+ hasAtRuleInside = true;
2529
+ return false;
2530
+ }
2531
+ });
2532
+ if (hasAtRuleInside) return false;
2533
+ let parent = rule.parent;
2534
+ while (parent && parent.type !== "root") {
2535
+ if (parent.type === "atrule") {
2536
+ const atRule = parent;
2537
+ if (NON_INLINABLE_AT_RULES.has(atRule.name)) return false;
2538
+ }
2539
+ parent = parent.parent;
2540
+ }
2541
+ return !/::?[\w-]+(\([^)]*\))?/.test(rule.selector);
2542
+ }
2543
+ //#endregion
2544
+ //#region src/utils/css/extract-rules-per-class.ts
2545
+ function unescapeClassName(name) {
2546
+ return name.replace(/\\(.)/g, "$1");
2547
+ }
2548
+ function extractRulesPerClass(root, classes) {
2549
+ const classSet = new Set(classes);
2550
+ const inlinableRules = /* @__PURE__ */ new Map();
2551
+ const nonInlinableRules = /* @__PURE__ */ new Map();
2552
+ root.walkRules((rule) => {
2553
+ const selectorClasses = [...rule.selector.matchAll(/\.((?:\\.|[^\s.:>+~[#,])+)/g)].map((m) => unescapeClassName(m[1]));
2554
+ const targetMap = isRuleInlinable(rule) ? inlinableRules : nonInlinableRules;
2555
+ for (const className of selectorClasses) if (classSet.has(className)) targetMap.set(className, rule);
2556
+ });
2557
+ return {
2558
+ inlinable: inlinableRules,
2559
+ nonInlinable: nonInlinableRules
2560
+ };
2561
+ }
2562
+ //#endregion
2563
+ //#region src/utils/css/split-selector-list.ts
2564
+ /**
2565
+ * Splits a CSS selector list by commas, respecting parentheses and brackets.
2566
+ * e.g., "*, ::before, ::after" → ["*", "::before", "::after"]
2567
+ * e.g., ":is(div, p), span" → [":is(div, p)", "span"]
2568
+ */
2569
+ function splitSelectorList(selector) {
2570
+ const result = [];
2571
+ let current = "";
2572
+ let parenDepth = 0;
2573
+ let bracketDepth = 0;
2574
+ let inString = null;
2575
+ for (let i = 0; i < selector.length; i++) {
2576
+ const char = selector[i];
2577
+ if ((char === "\"" || char === "'") && !inString) inString = char;
2578
+ else if (char === inString) inString = null;
2579
+ if (!inString) {
2580
+ if (char === "(") parenDepth++;
2581
+ if (char === ")") parenDepth--;
2582
+ if (char === "[") bracketDepth++;
2583
+ if (char === "]") bracketDepth--;
2584
+ if (char === "," && parenDepth === 0 && bracketDepth === 0) {
2585
+ result.push(current.trim());
2586
+ current = "";
2587
+ continue;
2588
+ }
2589
+ }
2590
+ current += char;
2591
+ }
2592
+ result.push(current.trim());
2593
+ return result;
2594
+ }
2595
+ //#endregion
2596
+ //#region src/utils/css/extract-global-rules.ts
2597
+ /**
2598
+ * Checks if a selector string contains pseudo-classes or pseudo-elements.
2599
+ * e.g., :hover, ::before, :nth-child()
2600
+ */
2601
+ function hasPseudoSelector(selector) {
2602
+ return /::?[\w-]+(\([^)]*\))?/.test(selector);
2603
+ }
2604
+ /**
2605
+ * Extracts global CSS rules (non-class selectors) from a PostCSS Root.
2606
+ * These include universal (*), element (div, p, etc.), and :root selectors.
2607
+ *
2608
+ * Handles comma-separated selector lists by splitting them and extracting
2609
+ * only the inlinable parts. e.g., "*, ::before, ::after" extracts just "*".
2610
+ *
2611
+ * Only extracts inlinable rules (not in media queries, no pseudo-classes).
2612
+ */
2613
+ function extractGlobalRules(root) {
2614
+ const result = {
2615
+ universal: [],
2616
+ element: /* @__PURE__ */ new Map(),
2617
+ root: []
2618
+ };
2619
+ root.walkRules((rule) => {
2620
+ const inMediaQuery = isRuleInMediaQuery(rule);
2621
+ const selectors = splitSelectorList(rule.selector);
2622
+ for (const rawSelector of selectors) {
2623
+ const selector = rawSelector.trim();
2624
+ if (!selector) continue;
2625
+ if (selector === ":root") {
2626
+ if (!inMediaQuery) {
2627
+ const cloned = rule.clone();
2628
+ cloned.selector = selector;
2629
+ result.root.push(cloned);
2630
+ }
2631
+ continue;
2632
+ }
2633
+ if (hasPseudoSelector(selector)) continue;
2634
+ if (inMediaQuery) continue;
2635
+ if (selector.includes(".")) continue;
2636
+ if (selector.includes("[")) continue;
2637
+ if (selector.includes("#")) continue;
2638
+ if (/[>\s+~]/.test(selector) && selector !== "*") continue;
2639
+ const cloned = rule.clone();
2640
+ cloned.selector = selector;
2641
+ if (selector === "*") {
2642
+ result.universal.push(cloned);
2643
+ continue;
2644
+ }
2645
+ if (/^[a-z][a-z0-9-]*$/i.test(selector)) {
2646
+ const elementName = selector.toLowerCase();
2647
+ if (!result.element.has(elementName)) result.element.set(elementName, []);
2648
+ result.element.get(elementName).push(cloned);
2649
+ }
2650
+ }
2651
+ });
2652
+ return result;
2653
+ }
2654
+ /**
2655
+ * Checks if a rule is inside a media query or other non-inlinable at-rule.
2656
+ */
2657
+ function isRuleInMediaQuery(rule) {
2658
+ const NON_INLINABLE_AT_RULES = new Set([
2659
+ "media",
2660
+ "supports",
2661
+ "container",
2662
+ "document"
2663
+ ]);
2664
+ let parent = rule.parent;
2665
+ while (parent && parent.type !== "root") {
2666
+ if (parent.type === "atrule") {
2667
+ const atRule = parent;
2668
+ if (NON_INLINABLE_AT_RULES.has(atRule.name)) return true;
2669
+ }
2670
+ parent = parent.parent;
2671
+ }
2672
+ return false;
2673
+ }
2674
+ //#endregion
2675
+ //#region src/utils/css/get-custom-properties.ts
2676
+ function getCustomProperties(root) {
2677
+ const customProperties = /* @__PURE__ */ new Map();
2678
+ root.walkAtRules("property", (atRule) => {
2679
+ const propertyName = atRule.params.trim();
2680
+ if (propertyName.startsWith("--")) {
2681
+ const prop = {};
2682
+ atRule.walkDecls((decl) => {
2683
+ if (decl.prop === "syntax") prop.syntax = decl;
2684
+ if (decl.prop === "inherits") prop.inherits = decl;
2685
+ if (decl.prop === "initial-value") prop.initialValue = decl;
2686
+ });
2687
+ customProperties.set(propertyName, prop);
2688
+ }
2689
+ });
2690
+ return customProperties;
2691
+ }
2692
+ //#endregion
2693
+ //#region src/utils/compatibility/sanitize-class-name.ts
2694
+ const digitToNameMap = {
2695
+ "0": "zero",
2696
+ "1": "one",
2697
+ "2": "two",
2698
+ "3": "three",
2699
+ "4": "four",
2700
+ "5": "five",
2701
+ "6": "six",
2702
+ "7": "seven",
2703
+ "8": "eight",
2704
+ "9": "nine"
2705
+ };
2706
+ /**
2707
+ * Replaces special characters to avoid problems on email clients.
2708
+ *
2709
+ * @param className - This should not come with any escaped charcters, it should come the same
2710
+ * as is on the `className` attribute on React elements.
2711
+ */
2712
+ function sanitizeClassName(className) {
2713
+ return className.replaceAll("+", "plus").replaceAll("[", "").replaceAll("%", "pc").replaceAll("]", "").replaceAll("(", "").replaceAll(")", "").replaceAll("!", "imprtnt").replaceAll(">", "gt").replaceAll("<", "lt").replaceAll("=", "eq").replace(/^[0-9]/, (digit) => {
2714
+ return digitToNameMap[digit];
2715
+ }).replace(/[^a-zA-Z0-9\-_]/g, "_");
2716
+ }
2717
+ //#endregion
2718
+ //#region src/utils/css/sanitize-non-inlinable-rules.ts
2719
+ /**
2720
+ * This function goes through a few steps to ensure the best email client support and
2721
+ * to ensure that media queries and pseudo classes are applied correctly alongside
2722
+ * the inline styles.
2723
+ *
2724
+ * What it does:
2725
+ * 1. Converts all declarations in all rules into important ones
2726
+ * 2. Sanitizes class selectors of all non-inlinable rules
2727
+ */
2728
+ function sanitizeNonInlinableRules(root) {
2729
+ root.walkRules((rule) => {
2730
+ if (!isRuleInlinable(rule)) {
2731
+ rule.selector = rule.selector.replace(/\.((?:\\.|[^\s.:>+~[#,])+)/g, (match, className) => {
2732
+ return "." + sanitizeClassName(className.replace(/\\(.)/g, "$1"));
2733
+ });
2734
+ rule.walkDecls((decl) => {
2735
+ decl.important = true;
2736
+ });
2737
+ }
2738
+ });
2739
+ }
2740
+ //#endregion
2741
+ //#region src/utils/css/make-inline-styles-for.ts
2742
+ function makeInlineStylesFor(inlinableRules, customProperties) {
2743
+ let styles = "";
2744
+ const localVariableDeclarations = /* @__PURE__ */ new Map();
2745
+ for (const rule of inlinableRules) rule.walkDecls((decl) => {
2746
+ if (decl.prop.startsWith("--")) localVariableDeclarations.set(decl.prop, decl);
2747
+ });
2748
+ for (const rule of inlinableRules) rule.walkDecls((decl) => {
2749
+ if (decl.prop.startsWith("--")) return;
2750
+ let value = decl.value;
2751
+ if (value.includes("var(")) {
2752
+ const parsed = (0, postcss_value_parser.default)(value);
2753
+ parsed.walk((node) => {
2754
+ if (node.type === "function" && node.value === "var") {
2755
+ const varNameNode = node.nodes[0];
2756
+ const variableName = varNameNode ? postcss_value_parser.default.stringify(varNameNode).trim() : "";
2757
+ if (variableName) {
2758
+ const localDef = localVariableDeclarations.get(variableName);
2759
+ if (localDef) {
2760
+ node.type = "word";
2761
+ node.value = localDef.value;
2762
+ node.nodes = [];
2763
+ } else {
2764
+ const customProp = customProperties.get(variableName);
2765
+ if (customProp?.initialValue) {
2766
+ node.type = "word";
2767
+ node.value = customProp.initialValue.value;
2768
+ node.nodes = [];
2769
+ }
2770
+ }
2771
+ }
2772
+ }
2773
+ });
2774
+ value = postcss_value_parser.default.stringify(parsed.nodes);
2775
+ }
2776
+ const important = decl.important ? " !important" : "";
2777
+ styles += `${decl.prop}:${value}${important};`;
2778
+ });
2779
+ return styles;
2780
+ }
2781
+ //#endregion
2782
+ //#region src/utils/css/get-matching-global-rules-for-element.ts
2783
+ const ALWAYS_APPLY_PROPS = ["box-sizing", "margin"];
2784
+ const CONDITIONAL_PROPS_PATTERN = /(border|outline)-color/g;
2785
+ function getMatchingGlobalRulesForElement(rules, element) {
2786
+ const matchingRules = [];
2787
+ for (const rule of rules) {
2788
+ const matchingDecls = [];
2789
+ for (const node of rule.nodes) {
2790
+ if (node.type !== "decl") continue;
2791
+ const decl = node;
2792
+ if (ALWAYS_APPLY_PROPS.includes(decl.prop)) {
2793
+ matchingDecls.push(decl);
2794
+ continue;
2795
+ }
2796
+ if (decl.prop.match(CONDITIONAL_PROPS_PATTERN)) {
2797
+ const key = decl.prop.match(/(border|outline)-color/)?.[1];
2798
+ if (!key) continue;
2799
+ if (element.attrs?.find((attr) => attr.name === "class" && attr.value?.match(key))) matchingDecls.push(decl);
2800
+ }
2801
+ }
2802
+ if (matchingDecls.length > 0) {
2803
+ const clonedRule = rule.clone();
2804
+ clonedRule.nodes = matchingDecls;
2805
+ matchingRules.push(clonedRule);
2806
+ }
2807
+ }
2808
+ return matchingRules;
2809
+ }
2810
+ //#endregion
2811
+ //#region src/utils/tailwindcss/add-inlined-styles-to-element.ts
2812
+ /**
2813
+ * Gets global styles for an element based on its tag name.
2814
+ * Applies rules in specificity order: universal (*) -> element -> :root (for html only)
2815
+ */
2816
+ function getGlobalStylesForElement(element, globalRules, customProperties) {
2817
+ const rules = [];
2818
+ const tagName = element.tagName.toLowerCase();
2819
+ const matchingGlobalRules = getMatchingGlobalRulesForElement(globalRules.universal, element);
2820
+ if (matchingGlobalRules.length > 0) rules.push(...matchingGlobalRules);
2821
+ const elementRules = globalRules.element.get(tagName);
2822
+ if (elementRules) rules.push(...elementRules);
2823
+ if (tagName === "html") rules.push(...globalRules.root);
2824
+ if (rules.length === 0) return "";
2825
+ return makeInlineStylesFor(rules, customProperties);
2826
+ }
2827
+ function addInlinedStylesToElement(element, inlinableRules, nonInlinableRules, customProperties, unknownClasses, globalRules) {
2828
+ const globalStyles = globalRules ? getGlobalStylesForElement(element, globalRules, customProperties) : "";
2829
+ const classAttr = element.attrs?.find((attr) => attr.name === "class");
2830
+ const styleAttr = element.attrs?.find((attr) => attr.name === "style");
2831
+ const existingStyles = styleAttr?.value ?? "";
2832
+ if (classAttr && classAttr.value) {
2833
+ const classes = classAttr.value.split(/\s+/).filter(Boolean);
2834
+ const residualClasses = [];
2835
+ const rules = [];
2836
+ for (const className of classes) {
2837
+ const rule = inlinableRules.get(className);
2838
+ if (rule) rules.push(rule);
2839
+ else residualClasses.push(className);
2840
+ }
2841
+ const newStyles = combineStyles(globalStyles, existingStyles, makeInlineStylesFor(rules, customProperties));
2842
+ if (newStyles) if (styleAttr) element.attrs = element.attrs?.map((attr) => {
2843
+ if (attr.name === "style") return {
2844
+ ...attr,
2845
+ value: newStyles
2846
+ };
2847
+ return attr;
2848
+ });
2849
+ else element.attrs = [...element.attrs, {
2850
+ name: "style",
2851
+ value: newStyles
2852
+ }];
2853
+ if (residualClasses.length > 0) element.attrs = element.attrs?.map((attr) => {
2854
+ if (attr.name === "class") return {
2855
+ ...attr,
2856
+ value: residualClasses.map((className) => {
2857
+ if (nonInlinableRules.has(className)) return sanitizeClassName(className);
2858
+ else {
2859
+ if (!unknownClasses.includes(className)) unknownClasses.push(className);
2860
+ return className;
2861
+ }
2862
+ }).join(" ")
2863
+ };
2864
+ return attr;
2865
+ });
2866
+ else element.attrs = element.attrs?.filter((attr) => attr.name !== "class");
2867
+ } else if (globalStyles) {
2868
+ const newStyles = combineStyles(globalStyles, existingStyles);
2869
+ if (newStyles) if (styleAttr) element.attrs = element.attrs?.map((attr) => {
2870
+ if (attr.name === "style") return {
2871
+ ...attr,
2872
+ value: newStyles
2873
+ };
2874
+ return attr;
2875
+ });
2876
+ else element.attrs = [...element.attrs || [], {
2877
+ name: "style",
2878
+ value: newStyles
2879
+ }];
2880
+ }
2881
+ return element;
2882
+ }
2883
+ function combineStyles(...styles) {
2884
+ return styles.filter(Boolean).map((style) => style?.split(";").map((entry) => entry.trim()).filter(Boolean)).flat().join(";");
2885
+ }
2886
+ //#endregion
2887
+ //#region src/utils/html/is-valid-node.ts
2888
+ function isValidNode(node) {
2889
+ return !node.nodeName.startsWith("#");
2890
+ }
2891
+ //#endregion
2892
+ //#region src/utils/html/remove-attributes-functions.ts
2893
+ function removeAttributesFunctions(ast) {
2894
+ return walk(ast, (node) => {
2895
+ if (isValidNode(node)) node.attrs = node.attrs?.filter((attr) => !["onload", "onerror"].includes(attr.name)) ?? [];
2896
+ return node;
2897
+ });
2898
+ }
2899
+ //#endregion
2900
+ //#region src/utils/tailwindcss/pixel-based-preset.ts
2901
+ const pixelBasedPreset = { theme: { extend: {
2902
+ fontSize: {
2903
+ xs: ["12px", { lineHeight: "16px" }],
2904
+ sm: ["14px", { lineHeight: "20px" }],
2905
+ base: ["16px", { lineHeight: "24px" }],
2906
+ lg: ["18px", { lineHeight: "28px" }],
2907
+ xl: ["20px", { lineHeight: "28px" }],
2908
+ "2xl": ["24px", { lineHeight: "32px" }],
2909
+ "3xl": ["30px", { lineHeight: "36px" }],
2910
+ "4xl": ["36px", { lineHeight: "36px" }],
2911
+ "5xl": ["48px", { lineHeight: "1" }],
2912
+ "6xl": ["60px", { lineHeight: "1" }],
2913
+ "7xl": ["72px", { lineHeight: "1" }],
2914
+ "8xl": ["96px", { lineHeight: "1" }],
2915
+ "9xl": ["144px", { lineHeight: "1" }]
2916
+ },
2917
+ spacing: {
2918
+ px: "1px",
2919
+ 0: "0",
2920
+ .5: "2px",
2921
+ 1: "4px",
2922
+ 1.5: "6px",
2923
+ 2: "8px",
2924
+ 2.5: "10px",
2925
+ 3: "12px",
2926
+ 3.5: "14px",
2927
+ 4: "16px",
2928
+ 5: "20px",
2929
+ 6: "24px",
2930
+ 7: "28px",
2931
+ 8: "32px",
2932
+ 9: "36px",
2933
+ 10: "40px",
2934
+ 11: "44px",
2935
+ 12: "48px",
2936
+ 14: "56px",
2937
+ 16: "64px",
2938
+ 20: "80px",
2939
+ 24: "96px",
2940
+ 28: "112px",
2941
+ 32: "128px",
2942
+ 36: "144px",
2943
+ 40: "160px",
2944
+ 44: "176px",
2945
+ 48: "192px",
2946
+ 52: "208px",
2947
+ 56: "224px",
2948
+ 60: "240px",
2949
+ 64: "256px",
2950
+ 72: "288px",
2951
+ 80: "320px",
2952
+ 96: "384px"
2953
+ }
2954
+ } } };
2955
+ //#endregion
2956
+ //#region src/index.ts
2957
+ /**
2958
+ * Email renderer that converts Svelte components to email-safe HTML with inlined Tailwind styles.
2959
+ *
2960
+ * @example
2961
+ * ```ts
2962
+ * import { Renderer } from 'better-svelte-email/renderer';
2963
+ * import EmailComponent from '$lib/emails/email.svelte';
2964
+ * import layoutStyles from 'src/routes/layout.css?raw';
2965
+ *
2966
+ * const renderer = new Renderer({
2967
+ * // Inject custom CSS such as app theme variables
2968
+ * customCSS: layoutStyles,
2969
+ * // Or provide a tailwind v3 config to extend the default theme
2970
+ * tailwindConfig: {
2971
+ * theme: {
2972
+ * extend: {
2973
+ * colors: {
2974
+ * brand: '#FF3E00'
2975
+ * }
2976
+ * }
2977
+ * }
2978
+ * }
2979
+ * });
2980
+ *
2981
+ * const html = await renderer.render(EmailComponent, {
2982
+ * props: { name: 'John' }
2983
+ * });
2984
+ * ```
2985
+ */
2986
+ function isRendererOptions(obj) {
2987
+ return typeof obj === "object" && obj !== null && ("tailwindConfig" in obj || "customCSS" in obj || "baseFontSize" in obj);
2988
+ }
2989
+ var Renderer = class {
2990
+ constructor(optionsOrConfig = {}) {
2991
+ this.render = async (component, options) => {
2992
+ const { body } = (0, svelte_server.render)(component, options);
2993
+ let ast = (0, parse5.parse)(body);
2994
+ ast = removeAttributesFunctions(ast);
2995
+ let classesUsed = [];
2996
+ const tailwindSetup = await setupTailwind(this.tailwindConfig, this.customCSS);
2997
+ walk(ast, (node) => {
2998
+ if (isValidNode(node)) {
2999
+ const classAttr = node.attrs?.find((attr) => attr.name === "class");
3000
+ if (classAttr && classAttr.value) {
3001
+ const classes = classAttr.value.split(/\s+/).filter(Boolean);
3002
+ classesUsed = [...classesUsed, ...classes];
3003
+ tailwindSetup.addUtilities(classes);
3004
+ }
3005
+ }
3006
+ return node;
3007
+ });
3008
+ const styleSheet = tailwindSetup.getStyleSheet();
3009
+ sanitizeStyleSheet(styleSheet, { baseFontSize: this.baseFontSize });
3010
+ const globalRules = extractGlobalRules(styleSheet);
3011
+ const { inlinable: inlinableRules, nonInlinable: nonInlinableRules } = extractRulesPerClass(styleSheet, classesUsed);
3012
+ const customProperties = getCustomProperties(styleSheet);
3013
+ const nonInlineStyles = postcss.default.root();
3014
+ for (const rule of nonInlinableRules.values()) nonInlineStyles.append(rule.clone());
3015
+ sanitizeNonInlinableRules(nonInlineStyles);
3016
+ const hasNonInlineStylesToApply = nonInlinableRules.size > 0;
3017
+ let appliedNonInlineStyles = false;
3018
+ let hasHead = false;
3019
+ const unknownClasses = [];
3020
+ ast = walk(ast, (node) => {
3021
+ if (isValidNode(node)) {
3022
+ const elementWithInlinedStyles = addInlinedStylesToElement(node, inlinableRules, nonInlinableRules, customProperties, unknownClasses, globalRules);
3023
+ if (node.nodeName === "head") hasHead = true;
3024
+ return elementWithInlinedStyles;
3025
+ }
3026
+ return node;
3027
+ });
3028
+ let serialized = (0, parse5.serialize)(ast);
3029
+ if (unknownClasses.length > 0) console.warn(`[better-svelte-email] You are using the following classes that were not recognized: ${unknownClasses.join(" ")}.`);
3030
+ if (hasHead && hasNonInlineStylesToApply) {
3031
+ appliedNonInlineStyles = true;
3032
+ serialized = serialized.replace(/<head([^>]*)>/, "<head$1><style>" + nonInlineStyles.toString() + "</style>");
3033
+ }
3034
+ if (hasNonInlineStylesToApply && !appliedNonInlineStyles) throw new Error(`You are trying to use the following Tailwind classes that cannot be inlined: ${Array.from(nonInlinableRules.keys()).join(" ")}.
3035
+ For the media queries to work properly on rendering, they need to be added into a <style> tag inside of a <head> tag,
3036
+ the render function tried finding a <head> element but just wasn't able to find it.
3037
+
3038
+ Make sure that you have a <head> element at any depth.
3039
+ This can also be our <Head> component.
3040
+
3041
+ If you do already have a <head> element at some depth,
3042
+ please file a bug https://github.com/Konixy/better-svelte-email/issues/new?assignees=&labels=bug&projects=.`);
3043
+ serialized = serialized.replace(/<!DOCTYPE\s+html[^>]*>/i, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
3044
+ return serialized;
3045
+ };
3046
+ if (isRendererOptions(optionsOrConfig)) {
3047
+ this.tailwindConfig = optionsOrConfig.tailwindConfig || {};
3048
+ this.customCSS = optionsOrConfig.customCSS;
3049
+ this.baseFontSize = optionsOrConfig.baseFontSize ?? 16;
3050
+ } else {
3051
+ this.tailwindConfig = optionsOrConfig || {};
3052
+ this.customCSS = void 0;
3053
+ this.baseFontSize = 16;
3054
+ }
3055
+ }
3056
+ };
3057
+ /**
3058
+ * Render HTML as plain text
3059
+ * @param markup - HTML string
3060
+ * @returns Plain text string
3061
+ */
3062
+ const toPlainText = (markup) => {
3063
+ return (0, html_to_text.convert)(markup, { selectors: [{
3064
+ selector: "img",
3065
+ format: "skip"
3066
+ }, {
3067
+ selector: "#__better-svelte-email-preview",
3068
+ format: "skip"
3069
+ }] });
3070
+ };
3071
+ //#endregion
3072
+ exports.Renderer = Renderer;
3073
+ exports.pixelBasedPreset = pixelBasedPreset;
3074
+ exports.toPlainText = toPlainText;