@samva/markup 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/AGENTS.md +11 -4
  2. package/CHANGELOG.md +36 -0
  3. package/README.md +89 -5
  4. package/dist/assets-BSpgZOSR.js +61 -0
  5. package/dist/assets-k7_v3IOJ.d.ts +39 -0
  6. package/dist/{assets-CS5Xa_mr.d.ts → brand-Bxb6Sm7y.d.ts} +34 -41
  7. package/dist/brand.d.ts +2 -2
  8. package/dist/brand.js +3 -3
  9. package/dist/compatibility.d.ts +15 -5
  10. package/dist/compatibility.js +48 -5
  11. package/dist/compile-C1GWLQ5C.js +490 -0
  12. package/dist/compile-CIeuGmP-.d.ts +98 -0
  13. package/dist/{compiled-template-Bc4Dq9zy.d.ts → compiled-template-CPDHvFlt.d.ts} +157 -6
  14. package/dist/compiler.d.ts +4 -89
  15. package/dist/compiler.js +8 -486
  16. package/dist/components-DNBCz20_.js +3267 -0
  17. package/dist/{css-color-DLM12Osu.js → dark-scheme-BGDCCaUq.js} +12 -1
  18. package/dist/{diagnostic-codes-DZKb0Xcg.js → diagnostic-codes-BCwfUgnF.js} +33 -36
  19. package/dist/diagnostic-model-DJtqbETd.js +36 -0
  20. package/dist/{diagnostics-D4vSLQrO.d.ts → diagnostics-C3TSx6SU.d.ts} +22 -2
  21. package/dist/diagnostics.d.ts +33 -1
  22. package/dist/diagnostics.js +2 -1
  23. package/dist/edit.d.ts +15 -4
  24. package/dist/edit.js +67 -4
  25. package/dist/email/jsx-dev-runtime.d.ts +2 -2
  26. package/dist/email/jsx-runtime.d.ts +1 -1
  27. package/dist/email.d.ts +6 -2
  28. package/dist/email.js +6 -2
  29. package/dist/index.d.ts +1 -1
  30. package/dist/{jsx-runtime-DL8NVF1f.d.ts → jsx-runtime-HHfrVZEf.d.ts} +1 -2
  31. package/dist/markdown.d.ts +69 -0
  32. package/dist/markdown.js +95 -0
  33. package/dist/parse-Bex7QFqj.js +921 -0
  34. package/dist/{preview-rNoJBEIY.d.ts → preview-DRLWgmfg.d.ts} +3 -3
  35. package/dist/profile-DFk4gs7o.js +56 -0
  36. package/dist/{profile-JTvgCD6X.js → project-B6D64SZS.js} +497 -234
  37. package/dist/render.d.ts +8 -8
  38. package/dist/render.js +1 -2
  39. package/dist/{css-B_aVKrDo.js → selectors-CKGuc9MO.js} +158 -4
  40. package/dist/sms.d.ts +1 -1
  41. package/dist/{template-DmNcoH4Q.d.ts → template-4Dse7_OC.d.ts} +1 -1
  42. package/dist/{theme-css-P9F5S7Ic.js → theme-css-BujDuuEA.js} +1 -2
  43. package/dist/whatsapp.d.ts +1 -1
  44. package/generated/contract.json +41 -1
  45. package/generated/reference.md +97 -89
  46. package/package.json +15 -4
  47. package/dist/brand-CIiEqkU7.js +0 -193
  48. package/dist/brand-plugin-Dj9SMpfS.d.ts +0 -33
  49. package/dist/components-C5850-Qg.js +0 -409
  50. package/dist/dark-scheme-CbCwGDWH.js +0 -12
  51. package/dist/html-DJUK2YJF.js +0 -483
  52. package/dist/render-template-DwPDm3Hq.js +0 -1226
  53. package/dist/selectors-CYWCoxZr.js +0 -157
  54. package/dist/source-locations-C8wCsiAy.d.ts +0 -22
@@ -0,0 +1,490 @@
1
+ import { n as isObject } from "./guards-eV1qLbf2.js";
2
+ import { Q as parseBrandSpecifier, R as PRIMITIVE_CSS, Z as brandSpecifierPattern, et as samvaBrandPlugin, z as BRAND_COMPONENT_CLASSES } from "./components-DNBCz20_.js";
3
+ import { a as isAssetPath, i as checkAssetBase, n as assetEntry, r as assetUrl } from "./assets-BSpgZOSR.js";
4
+ import { t as EmailCompileError } from "./diagnostics-C0Tr8-eQ.js";
5
+ import { i as lineColumn, t as buildLineMap } from "./diagnostic-model-DJtqbETd.js";
6
+ import { r as isDarkSchemeQuery, t as DARK_SCHEME_MEDIA } from "./dark-scheme-BGDCCaUq.js";
7
+ import { c as foregroundDefaults, l as parseBrandCss, n as DEFAULT_THEME_CSS, u as printBrandCss } from "./theme-css-BujDuuEA.js";
8
+ import { r as parseStylesheet } from "./selectors-CKGuc9MO.js";
9
+ import { d as projectDirectory, f as resolveFromDirectory, l as issueClasses, n as completed, p as resolveThemeImports, r as lowerProject, t as loadProject, u as Findings } from "./project-B6D64SZS.js";
10
+ import { parse } from "css-tree";
11
+ import { parse as parse$1 } from "@babel/parser";
12
+ import { compile } from "tailwindcss";
13
+ //#region src/email/tailwind-stylesheets.gen.ts
14
+ /** The exact Tailwind release the compiler runs, recorded in every build manifest. */
15
+ const TAILWIND_VERSION = "4.3.3";
16
+ //#endregion
17
+ //#region src/email/tailwind.ts
18
+ const STYLESHEETS = {
19
+ tailwindcss: `@layer theme, base, components, utilities;\n@import "tailwindcss/theme.css" layer(theme);\n@import "tailwindcss/utilities.css" layer(utilities);`,
20
+ "tailwindcss/theme.css": "@theme default {\n --font-sans:\n -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial,\n sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\n --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;\n --font-mono:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\n monospace;\n\n --color-red-50: oklch(97.1% 0.013 17.38);\n --color-red-100: oklch(93.6% 0.032 17.717);\n --color-red-200: oklch(88.5% 0.062 18.334);\n --color-red-300: oklch(80.8% 0.114 19.571);\n --color-red-400: oklch(70.4% 0.191 22.216);\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-red-600: oklch(57.7% 0.245 27.325);\n --color-red-700: oklch(50.5% 0.213 27.518);\n --color-red-800: oklch(44.4% 0.177 26.899);\n --color-red-900: oklch(39.6% 0.141 25.723);\n --color-red-950: oklch(25.8% 0.092 26.042);\n\n --color-orange-50: oklch(98% 0.016 73.684);\n --color-orange-100: oklch(95.4% 0.038 75.164);\n --color-orange-200: oklch(90.1% 0.076 70.697);\n --color-orange-300: oklch(83.7% 0.128 66.29);\n --color-orange-400: oklch(75% 0.183 55.934);\n --color-orange-500: oklch(70.5% 0.213 47.604);\n --color-orange-600: oklch(64.6% 0.222 41.116);\n --color-orange-700: oklch(55.3% 0.195 38.402);\n --color-orange-800: oklch(47% 0.157 37.304);\n --color-orange-900: oklch(40.8% 0.123 38.172);\n --color-orange-950: oklch(26.6% 0.079 36.259);\n\n --color-amber-50: oklch(98.7% 0.022 95.277);\n --color-amber-100: oklch(96.2% 0.059 95.617);\n --color-amber-200: oklch(92.4% 0.12 95.746);\n --color-amber-300: oklch(87.9% 0.169 91.605);\n --color-amber-400: oklch(82.8% 0.189 84.429);\n --color-amber-500: oklch(76.9% 0.188 70.08);\n --color-amber-600: oklch(66.6% 0.179 58.318);\n --color-amber-700: oklch(55.5% 0.163 48.998);\n --color-amber-800: oklch(47.3% 0.137 46.201);\n --color-amber-900: oklch(41.4% 0.112 45.904);\n --color-amber-950: oklch(27.9% 0.077 45.635);\n\n --color-yellow-50: oklch(98.7% 0.026 102.212);\n --color-yellow-100: oklch(97.3% 0.071 103.193);\n --color-yellow-200: oklch(94.5% 0.129 101.54);\n --color-yellow-300: oklch(90.5% 0.182 98.111);\n --color-yellow-400: oklch(85.2% 0.199 91.936);\n --color-yellow-500: oklch(79.5% 0.184 86.047);\n --color-yellow-600: oklch(68.1% 0.162 75.834);\n --color-yellow-700: oklch(55.4% 0.135 66.442);\n --color-yellow-800: oklch(47.6% 0.114 61.907);\n --color-yellow-900: oklch(42.1% 0.095 57.708);\n --color-yellow-950: oklch(28.6% 0.066 53.813);\n\n --color-lime-50: oklch(98.6% 0.031 120.757);\n --color-lime-100: oklch(96.7% 0.067 122.328);\n --color-lime-200: oklch(93.8% 0.127 124.321);\n --color-lime-300: oklch(89.7% 0.196 126.665);\n --color-lime-400: oklch(84.1% 0.238 128.85);\n --color-lime-500: oklch(76.8% 0.233 130.85);\n --color-lime-600: oklch(64.8% 0.2 131.684);\n --color-lime-700: oklch(53.2% 0.157 131.589);\n --color-lime-800: oklch(45.3% 0.124 130.933);\n --color-lime-900: oklch(40.5% 0.101 131.063);\n --color-lime-950: oklch(27.4% 0.072 132.109);\n\n --color-green-50: oklch(98.2% 0.018 155.826);\n --color-green-100: oklch(96.2% 0.044 156.743);\n --color-green-200: oklch(92.5% 0.084 155.995);\n --color-green-300: oklch(87.1% 0.15 154.449);\n --color-green-400: oklch(79.2% 0.209 151.711);\n --color-green-500: oklch(72.3% 0.219 149.579);\n --color-green-600: oklch(62.7% 0.194 149.214);\n --color-green-700: oklch(52.7% 0.154 150.069);\n --color-green-800: oklch(44.8% 0.119 151.328);\n --color-green-900: oklch(39.3% 0.095 152.535);\n --color-green-950: oklch(26.6% 0.065 152.934);\n\n --color-emerald-50: oklch(97.9% 0.021 166.113);\n --color-emerald-100: oklch(95% 0.052 163.051);\n --color-emerald-200: oklch(90.5% 0.093 164.15);\n --color-emerald-300: oklch(84.5% 0.143 164.978);\n --color-emerald-400: oklch(76.5% 0.177 163.223);\n --color-emerald-500: oklch(69.6% 0.17 162.48);\n --color-emerald-600: oklch(59.6% 0.145 163.225);\n --color-emerald-700: oklch(50.8% 0.118 165.612);\n --color-emerald-800: oklch(43.2% 0.095 166.913);\n --color-emerald-900: oklch(37.8% 0.077 168.94);\n --color-emerald-950: oklch(26.2% 0.051 172.552);\n\n --color-teal-50: oklch(98.4% 0.014 180.72);\n --color-teal-100: oklch(95.3% 0.051 180.801);\n --color-teal-200: oklch(91% 0.096 180.426);\n --color-teal-300: oklch(85.5% 0.138 181.071);\n --color-teal-400: oklch(77.7% 0.152 181.912);\n --color-teal-500: oklch(70.4% 0.14 182.503);\n --color-teal-600: oklch(60% 0.118 184.704);\n --color-teal-700: oklch(51.1% 0.096 186.391);\n --color-teal-800: oklch(43.7% 0.078 188.216);\n --color-teal-900: oklch(38.6% 0.063 188.416);\n --color-teal-950: oklch(27.7% 0.046 192.524);\n\n --color-cyan-50: oklch(98.4% 0.019 200.873);\n --color-cyan-100: oklch(95.6% 0.045 203.388);\n --color-cyan-200: oklch(91.7% 0.08 205.041);\n --color-cyan-300: oklch(86.5% 0.127 207.078);\n --color-cyan-400: oklch(78.9% 0.154 211.53);\n --color-cyan-500: oklch(71.5% 0.143 215.221);\n --color-cyan-600: oklch(60.9% 0.126 221.723);\n --color-cyan-700: oklch(52% 0.105 223.128);\n --color-cyan-800: oklch(45% 0.085 224.283);\n --color-cyan-900: oklch(39.8% 0.07 227.392);\n --color-cyan-950: oklch(30.2% 0.056 229.695);\n\n --color-sky-50: oklch(97.7% 0.013 236.62);\n --color-sky-100: oklch(95.1% 0.026 236.824);\n --color-sky-200: oklch(90.1% 0.058 230.902);\n --color-sky-300: oklch(82.8% 0.111 230.318);\n --color-sky-400: oklch(74.6% 0.16 232.661);\n --color-sky-500: oklch(68.5% 0.169 237.323);\n --color-sky-600: oklch(58.8% 0.158 241.966);\n --color-sky-700: oklch(50% 0.134 242.749);\n --color-sky-800: oklch(44.3% 0.11 240.79);\n --color-sky-900: oklch(39.1% 0.09 240.876);\n --color-sky-950: oklch(29.3% 0.066 243.157);\n\n --color-blue-50: oklch(97% 0.014 254.604);\n --color-blue-100: oklch(93.2% 0.032 255.585);\n --color-blue-200: oklch(88.2% 0.059 254.128);\n --color-blue-300: oklch(80.9% 0.105 251.813);\n --color-blue-400: oklch(70.7% 0.165 254.624);\n --color-blue-500: oklch(62.3% 0.214 259.815);\n --color-blue-600: oklch(54.6% 0.245 262.881);\n --color-blue-700: oklch(48.8% 0.243 264.376);\n --color-blue-800: oklch(42.4% 0.199 265.638);\n --color-blue-900: oklch(37.9% 0.146 265.522);\n --color-blue-950: oklch(28.2% 0.091 267.935);\n\n --color-indigo-50: oklch(96.2% 0.018 272.314);\n --color-indigo-100: oklch(93% 0.034 272.788);\n --color-indigo-200: oklch(87% 0.065 274.039);\n --color-indigo-300: oklch(78.5% 0.115 274.713);\n --color-indigo-400: oklch(67.3% 0.182 276.935);\n --color-indigo-500: oklch(58.5% 0.233 277.117);\n --color-indigo-600: oklch(51.1% 0.262 276.966);\n --color-indigo-700: oklch(45.7% 0.24 277.023);\n --color-indigo-800: oklch(39.8% 0.195 277.366);\n --color-indigo-900: oklch(35.9% 0.144 278.697);\n --color-indigo-950: oklch(25.7% 0.09 281.288);\n\n --color-violet-50: oklch(96.9% 0.016 293.756);\n --color-violet-100: oklch(94.3% 0.029 294.588);\n --color-violet-200: oklch(89.4% 0.057 293.283);\n --color-violet-300: oklch(81.1% 0.111 293.571);\n --color-violet-400: oklch(70.2% 0.183 293.541);\n --color-violet-500: oklch(60.6% 0.25 292.717);\n --color-violet-600: oklch(54.1% 0.281 293.009);\n --color-violet-700: oklch(49.1% 0.27 292.581);\n --color-violet-800: oklch(43.2% 0.232 292.759);\n --color-violet-900: oklch(38% 0.189 293.745);\n --color-violet-950: oklch(28.3% 0.141 291.089);\n\n --color-purple-50: oklch(97.7% 0.014 308.299);\n --color-purple-100: oklch(94.6% 0.033 307.174);\n --color-purple-200: oklch(90.2% 0.063 306.703);\n --color-purple-300: oklch(82.7% 0.119 306.383);\n --color-purple-400: oklch(71.4% 0.203 305.504);\n --color-purple-500: oklch(62.7% 0.265 303.9);\n --color-purple-600: oklch(55.8% 0.288 302.321);\n --color-purple-700: oklch(49.6% 0.265 301.924);\n --color-purple-800: oklch(43.8% 0.218 303.724);\n --color-purple-900: oklch(38.1% 0.176 304.987);\n --color-purple-950: oklch(29.1% 0.149 302.717);\n\n --color-fuchsia-50: oklch(97.7% 0.017 320.058);\n --color-fuchsia-100: oklch(95.2% 0.037 318.852);\n --color-fuchsia-200: oklch(90.3% 0.076 319.62);\n --color-fuchsia-300: oklch(83.3% 0.145 321.434);\n --color-fuchsia-400: oklch(74% 0.238 322.16);\n --color-fuchsia-500: oklch(66.7% 0.295 322.15);\n --color-fuchsia-600: oklch(59.1% 0.293 322.896);\n --color-fuchsia-700: oklch(51.8% 0.253 323.949);\n --color-fuchsia-800: oklch(45.2% 0.211 324.591);\n --color-fuchsia-900: oklch(40.1% 0.17 325.612);\n --color-fuchsia-950: oklch(29.3% 0.136 325.661);\n\n --color-pink-50: oklch(97.1% 0.014 343.198);\n --color-pink-100: oklch(94.8% 0.028 342.258);\n --color-pink-200: oklch(89.9% 0.061 343.231);\n --color-pink-300: oklch(82.3% 0.12 346.018);\n --color-pink-400: oklch(71.8% 0.202 349.761);\n --color-pink-500: oklch(65.6% 0.241 354.308);\n --color-pink-600: oklch(59.2% 0.249 0.584);\n --color-pink-700: oklch(52.5% 0.223 3.958);\n --color-pink-800: oklch(45.9% 0.187 3.815);\n --color-pink-900: oklch(40.8% 0.153 2.432);\n --color-pink-950: oklch(28.4% 0.109 3.907);\n\n --color-rose-50: oklch(96.9% 0.015 12.422);\n --color-rose-100: oklch(94.1% 0.03 12.58);\n --color-rose-200: oklch(89.2% 0.058 10.001);\n --color-rose-300: oklch(81% 0.117 11.638);\n --color-rose-400: oklch(71.2% 0.194 13.428);\n --color-rose-500: oklch(64.5% 0.246 16.439);\n --color-rose-600: oklch(58.6% 0.253 17.585);\n --color-rose-700: oklch(51.4% 0.222 16.935);\n --color-rose-800: oklch(45.5% 0.188 13.697);\n --color-rose-900: oklch(41% 0.159 10.272);\n --color-rose-950: oklch(27.1% 0.105 12.094);\n\n --color-slate-50: oklch(98.4% 0.003 247.858);\n --color-slate-100: oklch(96.8% 0.007 247.896);\n --color-slate-200: oklch(92.9% 0.013 255.508);\n --color-slate-300: oklch(86.9% 0.022 252.894);\n --color-slate-400: oklch(70.4% 0.04 256.788);\n --color-slate-500: oklch(55.4% 0.046 257.417);\n --color-slate-600: oklch(44.6% 0.043 257.281);\n --color-slate-700: oklch(37.2% 0.044 257.287);\n --color-slate-800: oklch(27.9% 0.041 260.031);\n --color-slate-900: oklch(20.8% 0.042 265.755);\n --color-slate-950: oklch(12.9% 0.042 264.695);\n\n --color-gray-50: oklch(98.5% 0.002 247.839);\n --color-gray-100: oklch(96.7% 0.003 264.542);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-300: oklch(87.2% 0.01 258.338);\n --color-gray-400: oklch(70.7% 0.022 261.325);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-gray-600: oklch(44.6% 0.03 256.802);\n --color-gray-700: oklch(37.3% 0.034 259.733);\n --color-gray-800: oklch(27.8% 0.033 256.848);\n --color-gray-900: oklch(21% 0.034 264.665);\n --color-gray-950: oklch(13% 0.028 261.692);\n\n --color-zinc-50: oklch(98.5% 0 none);\n --color-zinc-100: oklch(96.7% 0.001 286.375);\n --color-zinc-200: oklch(92% 0.004 286.32);\n --color-zinc-300: oklch(87.1% 0.006 286.286);\n --color-zinc-400: oklch(70.5% 0.015 286.067);\n --color-zinc-500: oklch(55.2% 0.016 285.938);\n --color-zinc-600: oklch(44.2% 0.017 285.786);\n --color-zinc-700: oklch(37% 0.013 285.805);\n --color-zinc-800: oklch(27.4% 0.006 286.033);\n --color-zinc-900: oklch(21% 0.006 285.885);\n --color-zinc-950: oklch(14.1% 0.005 285.823);\n\n --color-neutral-50: oklch(98.5% 0 none);\n --color-neutral-100: oklch(97% 0 none);\n --color-neutral-200: oklch(92.2% 0 none);\n --color-neutral-300: oklch(87% 0 none);\n --color-neutral-400: oklch(70.8% 0 none);\n --color-neutral-500: oklch(55.6% 0 none);\n --color-neutral-600: oklch(43.9% 0 none);\n --color-neutral-700: oklch(37.1% 0 none);\n --color-neutral-800: oklch(26.9% 0 none);\n --color-neutral-900: oklch(20.5% 0 none);\n --color-neutral-950: oklch(14.5% 0 none);\n\n --color-stone-50: oklch(98.5% 0.001 106.423);\n --color-stone-100: oklch(97% 0.001 106.424);\n --color-stone-200: oklch(92.3% 0.003 48.717);\n --color-stone-300: oklch(86.9% 0.005 56.366);\n --color-stone-400: oklch(70.9% 0.01 56.259);\n --color-stone-500: oklch(55.3% 0.013 58.071);\n --color-stone-600: oklch(44.4% 0.011 73.639);\n --color-stone-700: oklch(37.4% 0.01 67.558);\n --color-stone-800: oklch(26.8% 0.007 34.298);\n --color-stone-900: oklch(21.6% 0.006 56.043);\n --color-stone-950: oklch(14.7% 0.004 49.25);\n\n --color-mauve-50: oklch(98.5% 0 none);\n --color-mauve-100: oklch(96% 0.003 325.6);\n --color-mauve-200: oklch(92.2% 0.005 325.62);\n --color-mauve-300: oklch(86.5% 0.012 325.68);\n --color-mauve-400: oklch(71.1% 0.019 323.02);\n --color-mauve-500: oklch(54.2% 0.034 322.5);\n --color-mauve-600: oklch(43.5% 0.029 321.78);\n --color-mauve-700: oklch(36.4% 0.029 323.89);\n --color-mauve-800: oklch(26.3% 0.024 320.12);\n --color-mauve-900: oklch(21.2% 0.019 322.12);\n --color-mauve-950: oklch(14.5% 0.008 326);\n\n --color-olive-50: oklch(98.8% 0.003 106.5);\n --color-olive-100: oklch(96.6% 0.005 106.5);\n --color-olive-200: oklch(93% 0.007 106.5);\n --color-olive-300: oklch(88% 0.011 106.6);\n --color-olive-400: oklch(73.7% 0.021 106.9);\n --color-olive-500: oklch(58% 0.031 107.3);\n --color-olive-600: oklch(46.6% 0.025 107.3);\n --color-olive-700: oklch(39.4% 0.023 107.4);\n --color-olive-800: oklch(28.6% 0.016 107.4);\n --color-olive-900: oklch(22.8% 0.013 107.4);\n --color-olive-950: oklch(15.3% 0.006 107.1);\n\n --color-mist-50: oklch(98.7% 0.002 197.1);\n --color-mist-100: oklch(96.3% 0.002 197.1);\n --color-mist-200: oklch(92.5% 0.005 214.3);\n --color-mist-300: oklch(87.2% 0.007 219.6);\n --color-mist-400: oklch(72.3% 0.014 214.4);\n --color-mist-500: oklch(56% 0.021 213.5);\n --color-mist-600: oklch(45% 0.017 213.2);\n --color-mist-700: oklch(37.8% 0.015 216);\n --color-mist-800: oklch(27.5% 0.011 216.9);\n --color-mist-900: oklch(21.8% 0.008 223.9);\n --color-mist-950: oklch(14.8% 0.004 228.8);\n\n --color-taupe-50: oklch(98.6% 0.002 67.8);\n --color-taupe-100: oklch(96% 0.002 17.2);\n --color-taupe-200: oklch(92.2% 0.005 34.3);\n --color-taupe-300: oklch(86.8% 0.007 39.5);\n --color-taupe-400: oklch(71.4% 0.014 41.2);\n --color-taupe-500: oklch(54.7% 0.021 43.1);\n --color-taupe-600: oklch(43.8% 0.017 39.3);\n --color-taupe-700: oklch(36.7% 0.016 35.7);\n --color-taupe-800: oklch(26.8% 0.011 36.5);\n --color-taupe-900: oklch(21.4% 0.009 43.1);\n --color-taupe-950: oklch(14.7% 0.004 49.3);\n\n --color-black: #000;\n --color-white: #fff;\n\n --spacing: 0.25rem;\n\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n --container-3xs: 16rem;\n --container-2xs: 18rem;\n --container-xs: 20rem;\n --container-sm: 24rem;\n --container-md: 28rem;\n --container-lg: 32rem;\n --container-xl: 36rem;\n --container-2xl: 42rem;\n --container-3xl: 48rem;\n --container-4xl: 56rem;\n --container-5xl: 64rem;\n --container-6xl: 72rem;\n --container-7xl: 80rem;\n\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --text-3xl: 1.875rem;\n --text-3xl--line-height: calc(2.25 / 1.875);\n --text-4xl: 2.25rem;\n --text-4xl--line-height: calc(2.5 / 2.25);\n --text-5xl: 3rem;\n --text-5xl--line-height: 1;\n --text-6xl: 3.75rem;\n --text-6xl--line-height: 1;\n --text-7xl: 4.5rem;\n --text-7xl--line-height: 1;\n --text-8xl: 6rem;\n --text-8xl--line-height: 1;\n --text-9xl: 8rem;\n --text-9xl--line-height: 1;\n\n --font-weight-thin: 100;\n --font-weight-extralight: 200;\n --font-weight-light: 300;\n --font-weight-normal: 400;\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --font-weight-extrabold: 800;\n --font-weight-black: 900;\n\n --tracking-tighter: -0.05em;\n --tracking-tight: -0.025em;\n --tracking-normal: 0em;\n --tracking-wide: 0.025em;\n --tracking-wider: 0.05em;\n --tracking-widest: 0.1em;\n\n --leading-tight: 1.25;\n --leading-snug: 1.375;\n --leading-normal: 1.5;\n --leading-relaxed: 1.625;\n --leading-loose: 2;\n\n --radius-xs: 0.125rem;\n --radius-sm: 0.25rem;\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n --radius-xl: 0.75rem;\n --radius-2xl: 1rem;\n --radius-3xl: 1.5rem;\n --radius-4xl: 2rem;\n\n --shadow-2xs: 0 1px rgb(0 0 0 / 0.05);\n --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n\n --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);\n --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05);\n --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);\n\n --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);\n --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);\n --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);\n --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);\n --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);\n --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);\n\n --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15);\n --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2);\n --text-shadow-sm:\n 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);\n --text-shadow-md:\n 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);\n --text-shadow-lg:\n 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);\n\n --ease-in: cubic-bezier(0.4, 0, 1, 1);\n --ease-out: cubic-bezier(0, 0, 0.2, 1);\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n\n --animate-spin: spin 1s linear infinite;\n --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --animate-bounce: bounce 1s infinite;\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes ping {\n 75%,\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n\n @keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n }\n\n @keyframes bounce {\n 0%,\n 100% {\n transform: translateY(-25%);\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\n }\n\n 50% {\n transform: none;\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n }\n }\n\n --blur-xs: 4px;\n --blur-sm: 8px;\n --blur-md: 12px;\n --blur-lg: 16px;\n --blur-xl: 24px;\n --blur-2xl: 40px;\n --blur-3xl: 64px;\n\n --perspective-dramatic: 100px;\n --perspective-near: 300px;\n --perspective-normal: 500px;\n --perspective-midrange: 800px;\n --perspective-distant: 1200px;\n\n --aspect-video: 16 / 9;\n\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: --theme(--font-sans, initial);\n --default-font-feature-settings: --theme(--font-sans--font-feature-settings, initial);\n --default-font-variation-settings: --theme(--font-sans--font-variation-settings, initial);\n --default-mono-font-family: --theme(--font-mono, initial);\n --default-mono-font-feature-settings: --theme(--font-mono--font-feature-settings, initial);\n --default-mono-font-variation-settings: --theme(--font-mono--font-variation-settings, initial);\n}\n\n/* Deprecated */\n@theme default inline reference {\n --blur: 8px;\n --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\n --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);\n --radius: 0.25rem;\n --max-width-prose: 65ch;\n}\n",
21
+ "tailwindcss/utilities.css": "@tailwind utilities;\n",
22
+ "tailwindcss/preflight.css": "/*\n 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n 2. Remove default margins and padding\n 3. Reset all borders.\n*/\n\n*,\n::after,\n::before,\n::backdrop,\n::file-selector-button {\n box-sizing: border-box; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 2 */\n border: 0 solid; /* 3 */\n}\n\n/*\n 1. Use a consistent sensible line-height in all browsers.\n 2. Prevent adjustments of font size after orientation changes in iOS.\n 3. Use a more readable tab size.\n 4. Use the user's configured `sans` font-family by default.\n 5. Use the user's configured `sans` font-feature-settings by default.\n 6. Use the user's configured `sans` font-variation-settings by default.\n 7. Disable tap highlights on iOS.\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n tab-size: 4; /* 3 */\n font-family: --theme(\n --default-font-family,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n 'Noto Sans',\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol',\n 'Noto Color Emoji'\n ); /* 4 */\n font-feature-settings: --theme(--default-font-feature-settings, normal); /* 5 */\n font-variation-settings: --theme(--default-font-variation-settings, normal); /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n 1. Add the correct height in Firefox.\n 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n 3. Reset the default border style to a 1px solid border.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\n Add the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\n Remove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\n Reset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n}\n\n/*\n Add the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n 1. Use the user's configured `mono` font-family by default.\n 2. Use the user's configured `mono` font-feature-settings by default.\n 3. Use the user's configured `mono` font-variation-settings by default.\n 4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: --theme(\n --default-mono-font-family,\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n 'Liberation Mono',\n 'Courier New',\n monospace\n ); /* 1 */\n font-feature-settings: --theme(--default-mono-font-feature-settings, normal); /* 2 */\n font-variation-settings: --theme(--default-mono-font-variation-settings, normal); /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\n Add the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\n Prevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n 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)\n 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)\n 3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n Use the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring:where(:not(iframe)) {\n outline: auto;\n}\n\n/*\n Add the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\n Add the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\n Make lists unstyled by default.\n*/\n\nol,\nul,\nmenu {\n list-style: none;\n}\n\n/*\n 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\n Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\n 1. Inherit font styles in all browsers.\n 2. Remove border radius in all browsers.\n 3. Remove background color in all browsers.\n 4. Ensure consistent opacity for disabled states in all browsers.\n*/\n\nbutton,\ninput,\nselect,\noptgroup,\ntextarea,\n::file-selector-button {\n font: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n border-radius: 0; /* 2 */\n background-color: transparent; /* 3 */\n opacity: 1; /* 4 */\n}\n\n/*\n Restore default font weight.\n*/\n\n:where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n}\n\n/*\n Restore indentation.\n*/\n\n:where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n}\n\n/*\n Restore space after button.\n*/\n\n::file-selector-button {\n margin-inline-end: 4px;\n}\n\n/*\n Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n*/\n\n::placeholder {\n opacity: 1;\n}\n\n/*\n Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not\n crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)\n*/\n\n@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or\n (contain-intrinsic-size: 1px) /* Safari 17+ */ {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n}\n\n/*\n Prevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n Remove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n 1. Ensure date/time inputs have the same height when empty in iOS Safari.\n 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.\n*/\n\n::-webkit-date-and-time-value {\n min-height: 1lh; /* 1 */\n text-align: inherit; /* 2 */\n}\n\n/*\n Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.\n*/\n\n::-webkit-datetime-edit {\n display: inline-flex;\n}\n\n/*\n Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.\n*/\n\n::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n}\n\n::-webkit-datetime-edit,\n::-webkit-datetime-edit-year-field,\n::-webkit-datetime-edit-month-field,\n::-webkit-datetime-edit-day-field,\n::-webkit-datetime-edit-hour-field,\n::-webkit-datetime-edit-minute-field,\n::-webkit-datetime-edit-second-field,\n::-webkit-datetime-edit-millisecond-field,\n::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n}\n\n/*\n Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)\n*/\n\n::-webkit-calendar-picker-indicator {\n line-height: 1;\n}\n\n/*\n Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\n Correct the inability to style the border radius in iOS Safari.\n*/\n\nbutton,\ninput:where([type='button'], [type='reset'], [type='submit']),\n::file-selector-button {\n appearance: button;\n}\n\n/*\n Correct the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n Make elements with the HTML hidden attribute stay hidden by default.\n*/\n\n[hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n}\n"
23
+ };
24
+ /**
25
+ * Lower one theme stylesheet for Tailwind and the email cascade.
26
+ *
27
+ * Every `@theme` becomes `static`. Tailwind emits a theme variable only when a
28
+ * utility it generated reads it, but a project's own stylesheets read theme
29
+ * variables too (`color: var(--color-primary)`), and Tailwind never sees those
30
+ * rules. A later layer that redefines a variable replaces its options, so every
31
+ * layer has to carry `static` for the value the cascade settles on to reach the
32
+ * inliner.
33
+ *
34
+ * A dark-mode block, `@media (prefers-color-scheme: dark) { @theme { … } }`,
35
+ * becomes a `:root` rule in that query, which the cascade reads as the dark
36
+ * values of those variables (Tailwind would hoist a nested `@theme` into the
37
+ * light theme). A stylesheet owns each color it sets in both modes: a color its
38
+ * light `@theme` sets and its dark-mode block does not keeps that value in dark
39
+ * mode too, rather than a dark value from a layer beneath it. A fill it sets
40
+ * without a text color gets `foregroundDefaults`.
41
+ */
42
+ const lowerThemeCss = (css) => {
43
+ const ast = parse(css, {
44
+ positions: true,
45
+ parseValue: false,
46
+ parseRulePrelude: false,
47
+ parseCustomProperty: false
48
+ });
49
+ const edits = [];
50
+ const light = {};
51
+ const dark = {};
52
+ const declarations = (node, visit) => {
53
+ if (node.type !== "Atrule" || node.block === null) return;
54
+ for (const child of node.block.children) if (child.type === "Declaration" && child.loc != null && child.value.loc != null) visit(child.property, css.slice(child.value.loc.start.offset, child.value.loc.end.offset));
55
+ };
56
+ const preludeOf = (node) => node.type !== "Atrule" || node.prelude === null || node.prelude.loc == null ? "" : css.slice(node.prelude.loc.start.offset, node.prelude.loc.end.offset);
57
+ const isTheme = (node) => node.type === "Atrule" && node.name.toLowerCase() === "theme" && node.loc != null;
58
+ if (ast.type === "StyleSheet") for (const node of ast.children) {
59
+ if (isTheme(node)) {
60
+ if (!/(?:^|\s)static(?:\s|$)/i.test(preludeOf(node))) edits.push({
61
+ start: node.loc.start.offset + 6,
62
+ end: node.loc.start.offset + 6,
63
+ text: " static"
64
+ });
65
+ declarations(node, (property, value) => {
66
+ if (property.startsWith("--color-")) light[property] = value.trim();
67
+ });
68
+ continue;
69
+ }
70
+ if (node.type !== "Atrule" || node.name.toLowerCase() !== "media" || node.block === null || !isDarkSchemeQuery(preludeOf(node))) continue;
71
+ for (const child of node.block.children) {
72
+ if (!isTheme(child) || child.type !== "Atrule" || child.block?.loc == null) continue;
73
+ edits.push({
74
+ start: child.loc.start.offset,
75
+ end: child.block.loc.start.offset,
76
+ text: ":root"
77
+ });
78
+ declarations(child, (property, value) => {
79
+ dark[property] = value.trim();
80
+ });
81
+ }
82
+ }
83
+ const defaults = foregroundDefaults(light, dark);
84
+ const lightAdded = Object.entries(defaults.light);
85
+ const owned = {
86
+ ...light,
87
+ ...defaults.light
88
+ };
89
+ const darkAdded = [...Object.entries(defaults.dark), ...Object.entries(owned).filter(([property]) => !(property in dark) && !(property in defaults.dark))];
90
+ let output = css;
91
+ for (const edit of edits.sort((left, right) => right.start - left.start)) output = `${output.slice(0, edit.start)}${edit.text}${output.slice(edit.end)}`;
92
+ const block = (entries) => entries.map(([property, value]) => ` ${property}: ${value};`).join("\n");
93
+ return [
94
+ output,
95
+ ...lightAdded.length === 0 ? [] : [`@theme static {\n${block(lightAdded)}\n}`],
96
+ ...darkAdded.length === 0 ? [] : [`${DARK_SCHEME_MEDIA} {\n :root {\n${block(darkAdded)}\n }\n}`]
97
+ ].join("\n");
98
+ };
99
+ /** The default theme, lowered once: the first layer of every project's theme. */
100
+ const DEFAULT_THEME_TAILWIND_CSS = lowerThemeCss(DEFAULT_THEME_CSS);
101
+ /**
102
+ * What every project compiles beneath its own CSS, for a build that compiles no
103
+ * Tailwind: the default theme and the primitives' rules, in Tailwind's layers.
104
+ */
105
+ const BASE_STYLESHEET_CSS = [
106
+ "@layer theme, base, components, utilities;",
107
+ DEFAULT_THEME_TAILWIND_CSS,
108
+ PRIMITIVE_CSS
109
+ ].join("\n");
110
+ /** Compile the discovered class set into CSS with the pinned Tailwind release. */
111
+ const compileTailwind = async (candidates, options = {}, imports = { stylesheets: /* @__PURE__ */ new Map() }) => {
112
+ const entry = [
113
+ "@layer theme, base, components, utilities;",
114
+ "@import \"tailwindcss/theme.css\" layer(theme);",
115
+ ...options.preflight === true ? ["@import \"tailwindcss/preflight.css\" layer(base);"] : [],
116
+ "@import \"tailwindcss/utilities.css\" layer(utilities);",
117
+ DEFAULT_THEME_TAILWIND_CSS,
118
+ PRIMITIVE_CSS,
119
+ lowerThemeCss(options.css ?? "")
120
+ ].join("\n");
121
+ const compiler = await compile(entry, {
122
+ base: projectDirectory(options.cssPath ?? "theme.css"),
123
+ loadStylesheet: (id, base) => {
124
+ const builtIn = STYLESHEETS[id];
125
+ if (builtIn !== void 0) return Promise.resolve({
126
+ path: id,
127
+ base,
128
+ content: builtIn
129
+ });
130
+ if (parseBrandSpecifier(id, { brandPlugin: imports.brandPlugin }) !== void 0) {
131
+ if (imports.brandCss === void 0) throw new TypeError(`${id} has no brand in this build`);
132
+ return Promise.resolve({
133
+ path: id,
134
+ base,
135
+ content: lowerThemeCss(imports.brandCss)
136
+ });
137
+ }
138
+ const path = resolveFromDirectory(base, id.replace(/[?#].*$/, ""));
139
+ const content = path === void 0 ? void 0 : imports.stylesheets.get(path);
140
+ if (path === void 0 || content === void 0) throw new TypeError(`@import ${JSON.stringify(id)} names no project stylesheet`);
141
+ return Promise.resolve({
142
+ path,
143
+ base: projectDirectory(path),
144
+ content: lowerThemeCss(content)
145
+ });
146
+ }
147
+ });
148
+ const all = [.../* @__PURE__ */ new Set([...candidates, ...options.safelist ?? []])].sort();
149
+ const limits = options.limits;
150
+ if (limits !== void 0 && all.length > limits.candidates) throw new TypeError(`Tailwind candidate limit exceeded: ${all.length} classes, limit ${limits.candidates}. Reduce the utility classes this project uses, or its declared safelist.`);
151
+ const css = compiler.build(all);
152
+ const bytes = new TextEncoder().encode(css).length;
153
+ if (limits !== void 0 && bytes > limits.cssBytes) throw new TypeError(`Generated CSS limit exceeded: ${bytes} bytes, limit ${limits.cssBytes}. Reduce the utility classes this project uses, or its declared safelist.`);
154
+ return {
155
+ css,
156
+ version: TAILWIND_VERSION,
157
+ candidates: all
158
+ };
159
+ };
160
+ const isRecord = (value) => isObject(value) && !Array.isArray(value);
161
+ const isAstNode = (value) => isRecord(value) && typeof value.type === "string" && typeof value.start === "number" && typeof value.end === "number";
162
+ const walk$1 = (value, visit) => {
163
+ if (Array.isArray(value)) {
164
+ for (const item of value) walk$1(item, visit);
165
+ return;
166
+ }
167
+ if (!isRecord(value)) return;
168
+ if (isAstNode(value)) visit(value);
169
+ for (const [key, child] of Object.entries(value)) {
170
+ if (key === "loc" || key === "extra" || key === "comments" || key === "tokens") continue;
171
+ walk$1(child, visit);
172
+ }
173
+ };
174
+ const CLASS_KEYS = /* @__PURE__ */ new Set(["class", "className"]);
175
+ const nameOf = (node) => {
176
+ if (!isAstNode(node)) return void 0;
177
+ if (node.type === "JSXIdentifier" || node.type === "Identifier") return typeof node.name === "string" ? node.name : void 0;
178
+ if (node.type === "StringLiteral") return typeof node.value === "string" ? node.value : void 0;
179
+ };
180
+ /**
181
+ * Collect the class names one module states literally, and report the positions
182
+ * where a class is assembled from values the compiler cannot see.
183
+ */
184
+ const discoverClassCandidates = (source, fileName) => {
185
+ let parsed;
186
+ try {
187
+ parsed = parse$1(source, {
188
+ plugins: ["typescript", "jsx"],
189
+ sourceType: "module"
190
+ });
191
+ } catch {
192
+ return {
193
+ candidates: [],
194
+ diagnostics: []
195
+ };
196
+ }
197
+ const lineMap = buildLineMap(source);
198
+ const candidates = /* @__PURE__ */ new Set();
199
+ const diagnostics = [];
200
+ const at = (offset) => {
201
+ const position = lineColumn(lineMap, offset);
202
+ return {
203
+ fileName,
204
+ lineNumber: position.line,
205
+ columnNumber: position.column
206
+ };
207
+ };
208
+ /** Returns true when every class in the expression is statically known. */
209
+ const readValue = (node) => {
210
+ if (!isAstNode(node)) return false;
211
+ switch (node.type) {
212
+ case "StringLiteral":
213
+ if (typeof node.value !== "string") return false;
214
+ for (const name of node.value.split(/\s+/)) if (name !== "") candidates.add(name);
215
+ return true;
216
+ case "TemplateLiteral": {
217
+ const quasis = Array.isArray(node.quasis) ? node.quasis : [];
218
+ for (const quasi of quasis) {
219
+ const cooked = isAstNode(quasi) && isRecord(quasi.value) ? quasi.value.cooked : void 0;
220
+ if (typeof cooked !== "string") continue;
221
+ for (const name of cooked.split(/\s+/)) if (name !== "") candidates.add(name);
222
+ }
223
+ return Array.isArray(node.expressions) && node.expressions.length === 0;
224
+ }
225
+ case "JSXExpressionContainer": return readValue(node.expression);
226
+ case "ConditionalExpression": return [node.consequent, node.alternate].every((branch) => readValue(branch));
227
+ case "LogicalExpression": return readValue(node.right);
228
+ case "BinaryExpression": return node.operator === "+" && [node.left, node.right].every((side) => readValue(side));
229
+ case "ArrayExpression": return Array.isArray(node.elements) && node.elements.every((element) => readValue(element));
230
+ default: return false;
231
+ }
232
+ };
233
+ walk$1(parsed.program, (node) => {
234
+ const isJsxAttribute = node.type === "JSXAttribute";
235
+ const isObjectProperty = node.type === "ObjectProperty";
236
+ if (!isJsxAttribute && !isObjectProperty) return;
237
+ const key = nameOf(isJsxAttribute ? node.name : node.key);
238
+ if (key === void 0 || !CLASS_KEYS.has(key)) return;
239
+ const value = isJsxAttribute ? node.value : node.value;
240
+ if (value === null || value === void 0) return;
241
+ if (readValue(value)) return;
242
+ diagnostics.push({
243
+ code: "tailwind-dynamic-class",
244
+ severity: "warning",
245
+ message: `This ${key} is assembled at run time, so the compiler cannot discover the classes it produces and they will have no styles. Write the classes literally, or declare them in the project's Tailwind safelist.`,
246
+ origins: [at(node.start)]
247
+ });
248
+ });
249
+ return {
250
+ candidates: [...candidates].sort(),
251
+ diagnostics
252
+ };
253
+ };
254
+ //#endregion
255
+ //#region src/email/transform.ts
256
+ const SCRIPT = /\.[cm]?[jt]sx?$/;
257
+ /**
258
+ * The project path a stylesheet URL names, resolved from the stylesheet's own
259
+ * directory (a leading `/` means the project root), or `undefined` when it
260
+ * climbs out of the project.
261
+ */
262
+ const resolveProjectPath = (from, reference) => resolveFromDirectory(projectDirectory(from), reference.replace(/[?#].*$/, ""));
263
+ const readStylesheet = (id, source, options, assets = /* @__PURE__ */ new Map(), themeImports = false) => {
264
+ const sheet = parseStylesheet(source, {
265
+ origin: id,
266
+ themeImports,
267
+ resolveFontFile: (reference) => {
268
+ const path = resolveProjectPath(id, reference);
269
+ const entry = path === void 0 ? void 0 : assets.get(path);
270
+ return entry === void 0 ? void 0 : assetUrl(entry, options.assetBase);
271
+ }
272
+ });
273
+ return {
274
+ sheet: {
275
+ rules: sheet.rules,
276
+ headAtRules: sheet.headAtRules,
277
+ fontFaces: sheet.fontFaces,
278
+ variables: sheet.variables,
279
+ darkVariables: sheet.darkVariables,
280
+ diagnostics: []
281
+ },
282
+ diagnostics: sheet.diagnostics
283
+ };
284
+ };
285
+ /**
286
+ * Read one project file. A stylesheet is parsed, with its `@font-face` sources resolved against
287
+ * `assets`, the project's addressed files by path. An imported binary is content-addressed. A
288
+ * script contributes the utility classes it states literally.
289
+ */
290
+ const readFile = async (id, source, options, assets) => {
291
+ if (isAssetPath(id)) {
292
+ const bytes = typeof source === "string" ? new TextEncoder().encode(source) : source;
293
+ return {
294
+ asset: await assetEntry(id, bytes),
295
+ diagnostics: checkAssetBase(options.assetBase)
296
+ };
297
+ }
298
+ const text = typeof source === "string" ? source : new TextDecoder().decode(source);
299
+ if (id.endsWith(".css")) return readStylesheet(id, text, options, assets);
300
+ if (!SCRIPT.test(id)) return { diagnostics: [] };
301
+ const discovered = options.tailwind === false ? void 0 : discoverClassCandidates(text, id);
302
+ return {
303
+ classes: discovered?.candidates,
304
+ diagnostics: discovered?.diagnostics ?? []
305
+ };
306
+ };
307
+ /** The Tailwind sheet's stylesheet origin. */
308
+ const TAILWIND_ORIGIN = ".samva-tailwind.css";
309
+ /** The brand specifier, bare or with a slug, as a module specifier in an import or export. */
310
+ const brandModuleSpecifier = (plugin) => new RegExp(`(\\b(?:from|import)\\s*\\(?\\s*)(["'])(${brandSpecifierPattern(plugin)})\\2`, "g");
311
+ /** The brand specifiers a script imports, with where it asks for each. */
312
+ const scriptBrandImports = (path, source, plugin) => {
313
+ const lines = buildLineMap(source);
314
+ return [...source.matchAll(brandModuleSpecifier(plugin))].map((match) => {
315
+ const at = lineColumn(lines, match.index + match[1].length);
316
+ return {
317
+ specifier: match[3],
318
+ origin: {
319
+ fileName: path,
320
+ lineNumber: at.line,
321
+ columnNumber: at.column
322
+ }
323
+ };
324
+ });
325
+ };
326
+ /**
327
+ * The brand specifier a project imports — from its theme's `@import`s or its
328
+ * TSX — so a host can fetch that brand before it compiles. `undefined` when
329
+ * the project imports no brand. A project that names two brands gets the
330
+ * first here and a refusal from the compile.
331
+ */
332
+ const projectBrandSpecifier = (files, options = {}) => {
333
+ const themePath = options.themePath ?? "theme.css";
334
+ const brandPlugin = options.brandPlugin ?? samvaBrandPlugin;
335
+ const theme = files[themePath];
336
+ const fromTheme = typeof theme === "string" ? resolveThemeImports(themePath, theme, files, brandPlugin).brandSpecifiers : [];
337
+ const fromScripts = Object.keys(files).sort().filter((path) => SCRIPT.test(path) && typeof files[path] === "string").flatMap((path) => scriptBrandImports(path, files[path], brandPlugin)).map((request) => request.specifier);
338
+ return [...fromTheme, ...fromScripts][0];
339
+ };
340
+ /**
341
+ * The theme stylesheet's `@import` graph and the brand the project reaches,
342
+ * resolved before anything compiles. An import the compiler cannot resolve, a
343
+ * brand the build was not given, two different brands, or a brand theme
344
+ * outside its grammar refuses the whole compile: a theme that silently lost a
345
+ * layer would ship the wrong look.
346
+ */
347
+ const resolveTheme = (files, tailwind, brand, brandPlugin) => {
348
+ const refusals = [];
349
+ const css = tailwind?.css;
350
+ const themePath = tailwind?.cssPath ?? "theme.css";
351
+ const imports = css === void 0 ? void 0 : resolveThemeImports(themePath, css, files, brandPlugin);
352
+ refusals.push(...imports?.diagnostics ?? []);
353
+ const themeOrigin = {
354
+ fileName: themePath,
355
+ lineNumber: 1,
356
+ columnNumber: 1
357
+ };
358
+ const cssRequests = (imports?.brandSpecifiers ?? []).map((specifier) => ({
359
+ specifier,
360
+ origin: themeOrigin
361
+ }));
362
+ const scriptRequests = Object.keys(files).sort().filter((path) => SCRIPT.test(path) && typeof files[path] === "string").flatMap((path) => scriptBrandImports(path, files[path], brandPlugin));
363
+ const requests = [...cssRequests, ...scriptRequests];
364
+ const specifiers = [...new Set(requests.map((request) => request.specifier))];
365
+ if (specifiers.length > 1) refusals.push({
366
+ code: "brand-import-conflict",
367
+ severity: "error",
368
+ message: `The project imports ${specifiers.join(" and ")}; a project compiles against one brand.`,
369
+ origins: requests.map((request) => request.origin)
370
+ });
371
+ else if (specifiers.length === 1) {
372
+ const specifier = specifiers[0];
373
+ const named = parseBrandSpecifier(specifier, { brandPlugin })?.slug;
374
+ const origins = [requests[0].origin];
375
+ if (brand === void 0) refusals.push({
376
+ code: "brand-unavailable",
377
+ severity: "error",
378
+ message: `${origins[0].fileName} imports ${specifier}, but this build has no brand to resolve it.`,
379
+ origins
380
+ });
381
+ else if (named !== void 0 && named !== brand.slug) refusals.push({
382
+ code: "brand-unavailable",
383
+ severity: "error",
384
+ message: `${origins[0].fileName} imports ${specifier}, but this build resolved brand ${brand.slug}.`,
385
+ origins
386
+ });
387
+ }
388
+ let brandCss;
389
+ if (refusals.length === 0 && brand !== void 0 && cssRequests.length > 0) {
390
+ const parsed = parseBrandCss(brand.css);
391
+ if (parsed.isOk()) brandCss = printBrandCss(parsed.value);
392
+ else {
393
+ const lines = buildLineMap(brand.css);
394
+ const specifier = cssRequests[0].specifier;
395
+ for (const finding of parsed.error) {
396
+ const at = lineColumn(lines, finding.span.start);
397
+ refusals.push({
398
+ code: finding.code,
399
+ severity: "error",
400
+ message: `${specifier}: ${finding.message}`,
401
+ origins: [{
402
+ fileName: specifier,
403
+ lineNumber: at.line,
404
+ columnNumber: at.column
405
+ }]
406
+ });
407
+ }
408
+ }
409
+ }
410
+ if (refusals.length > 0) throw new EmailCompileError({ diagnostics: refusals });
411
+ return {
412
+ stylesheets: imports?.stylesheets ?? /* @__PURE__ */ new Map(),
413
+ brandCss,
414
+ brandPlugin,
415
+ brandModule: scriptRequests.length > 0 ? brand : void 0
416
+ };
417
+ };
418
+ /** Read a whole project, then compile the classes its scripts used. */
419
+ const transformProject = async (files, options) => {
420
+ const assets = [];
421
+ const diagnostics = [];
422
+ const stylesheets = /* @__PURE__ */ new Map();
423
+ const classes = /* @__PURE__ */ new Set();
424
+ const wanted = options.tailwind === false ? void 0 : options.tailwind ?? {};
425
+ const theme = resolveTheme(files, wanted, options.brand, options.brandPlugin ?? samvaBrandPlugin);
426
+ if (theme.brandModule !== void 0) for (const name of BRAND_COMPONENT_CLASSES) classes.add(name);
427
+ const paths = Object.keys(files).sort();
428
+ const binaries = new Map(await Promise.all(paths.filter(isAssetPath).map(async (path) => [path, await readFile(path, files[path], options)])));
429
+ const addressed = new Map([...binaries].flatMap(([path, reading]) => reading.asset === void 0 ? [] : [[path, reading.asset]]));
430
+ const readings = await Promise.all(paths.map((path) => binaries.get(path) ?? (theme.stylesheets.has(path) ? readStylesheet(path, theme.stylesheets.get(path), options, addressed, true) : readFile(path, files[path], options, addressed))));
431
+ for (const [index, path] of paths.entries()) {
432
+ const reading = readings[index];
433
+ if (reading.asset !== void 0) assets.push(reading.asset);
434
+ if (reading.sheet !== void 0) stylesheets.set(path, reading.sheet);
435
+ for (const name of reading.classes ?? []) classes.add(name);
436
+ diagnostics.push(...reading.diagnostics);
437
+ }
438
+ if (wanted === void 0) return {
439
+ assets,
440
+ tailwindSheet: readStylesheet(TAILWIND_ORIGIN, BASE_STYLESHEET_CSS, options).sheet,
441
+ stylesheets,
442
+ diagnostics
443
+ };
444
+ const compiled = await compileTailwind(classes, wanted, theme);
445
+ const generated = readStylesheet(TAILWIND_ORIGIN, compiled.css, options, addressed);
446
+ const findingKey = (diagnostic) => `${diagnostic.code}\0${diagnostic.message.slice(diagnostic.message.indexOf(": ") + 2)}`;
447
+ const reported = new Set(diagnostics.map(findingKey));
448
+ for (const diagnostic of generated.diagnostics) if (diagnostic.code.startsWith("email-font-") && !reported.has(findingKey(diagnostic))) diagnostics.push(diagnostic);
449
+ return {
450
+ assets,
451
+ tailwindSheet: generated.sheet,
452
+ stylesheets,
453
+ diagnostics
454
+ };
455
+ };
456
+ //#endregion
457
+ //#region src/sml/compile.ts
458
+ /** Compile a project's entry template without evaluating any of it. */
459
+ const compileTemplate = async (options) => {
460
+ const findings = new Findings();
461
+ const project = loadProject(options.files, options.entry, findings, { brandPlugin: options.brandPlugin ?? samvaBrandPlugin });
462
+ if (project === void 0) return completed(findings, void 0);
463
+ let transformed;
464
+ try {
465
+ transformed = await transformProject(options.files, options.issueContent === void 0 || options.tailwind === false ? options : {
466
+ ...options,
467
+ tailwind: {
468
+ ...options.tailwind,
469
+ safelist: [...options.tailwind?.safelist ?? [], ...issueClasses(options.issueContent.nodes)]
470
+ }
471
+ });
472
+ } catch (error) {
473
+ if (!(error instanceof EmailCompileError)) throw error;
474
+ findings.items.push(...error.diagnostics);
475
+ return completed(findings, void 0);
476
+ }
477
+ findings.items.push(...transformed.diagnostics.filter((item) => item.code !== "tailwind-dynamic-class"));
478
+ const assetsByPath = new Map(transformed.assets.map((asset) => [asset.path, asset]));
479
+ return lowerProject(options, project, findings, {
480
+ assets: transformed.assets,
481
+ stylesheets: transformed.stylesheets,
482
+ tailwindSheet: transformed.tailwindSheet,
483
+ urlFor: (path) => {
484
+ const entry = assetsByPath.get(path);
485
+ return entry === void 0 ? void 0 : assetUrl(entry, options.assetBase);
486
+ }
487
+ });
488
+ };
489
+ //#endregion
490
+ export { projectBrandSpecifier as n, compileTailwind as r, compileTemplate as t };
@@ -0,0 +1,98 @@
1
+ import { a as EmailBrand, m as BrandPlugin } from "./brand-Bxb6Sm7y.js";
2
+ import { i as TemplateDiagnostic } from "./diagnostics-C3TSx6SU.js";
3
+ import { n as AssetEntry } from "./assets-k7_v3IOJ.js";
4
+ import { u as CompiledNode, v as CompiledTemplate } from "./compiled-template-CPDHvFlt.js";
5
+ import "css-tree";
6
+ //#region src/email/tailwind.d.ts
7
+ interface TailwindOptions {
8
+ /**
9
+ * Project CSS appended to the compiled entry: `@theme` overrides, `@utility`
10
+ * definitions and ordinary rules. This is the project's pinned configuration.
11
+ */
12
+ readonly css?: string | undefined;
13
+ /**
14
+ * The project path `css` was read from (`theme.css` by default). Its
15
+ * relative `@import`s resolve from this file's directory.
16
+ */
17
+ readonly cssPath?: string | undefined;
18
+ /** Classes the compiler cannot discover, declared by the project on purpose. */
19
+ readonly safelist?: readonly string[] | undefined;
20
+ /** Tailwind's browser reset is off by default; email clients do not want it. */
21
+ readonly preflight?: boolean | undefined;
22
+ /**
23
+ * Bounds on what the compiler may generate. Class discovery reads authored
24
+ * source, so a project can hand it an unbounded candidate set and get an
25
+ * unbounded stylesheet back — inside a build that has a wall clock and a
26
+ * bundle a Worker then has to load. A host that publishes supplies these.
27
+ */
28
+ readonly limits?: TailwindLimits | undefined;
29
+ }
30
+ interface TailwindLimits {
31
+ /** Distinct classes handed to the compiler. */
32
+ readonly candidates: number;
33
+ /** Bytes of generated CSS. */
34
+ readonly cssBytes: number;
35
+ }
36
+ //#endregion
37
+ //#region src/email/transform.d.ts
38
+ /** Where this build serves assets from, and how Tailwind is configured. */
39
+ interface TransformOptions {
40
+ readonly assetBase: string;
41
+ /** `false` compiles no Tailwind at all. */
42
+ readonly tailwind?: TailwindOptions | false | undefined;
43
+ /**
44
+ * The brand the brand import resolves to, supplied by the host. A project
45
+ * that imports a brand with no brand here fails to compile.
46
+ */
47
+ readonly brand?: EmailBrand | undefined;
48
+ /** Names the brand import and marks the footer `BrandFooter` renders; `samvaBrandPlugin` when omitted. */
49
+ readonly brandPlugin?: BrandPlugin | undefined;
50
+ }
51
+ /**
52
+ * The brand specifier a project imports — from its theme's `@import`s or its
53
+ * TSX — so a host can fetch that brand before it compiles. `undefined` when
54
+ * the project imports no brand. A project that names two brands gets the
55
+ * first here and a refusal from the compile.
56
+ */
57
+ declare const projectBrandSpecifier: (files: Readonly<Record<string, string | Uint8Array>>, options?: {
58
+ readonly themePath?: string | undefined;
59
+ readonly brandPlugin?: BrandPlugin | undefined;
60
+ }) => string | undefined;
61
+ //#endregion
62
+ //#region src/sml/issue-content.d.ts
63
+ /** Static content inserted by the compiler at the layout's IssueContent directive. */
64
+ interface IssueContentInput {
65
+ readonly file: string;
66
+ readonly nodes: readonly CompiledNode[];
67
+ }
68
+ //#endregion
69
+ //#region src/sml/lower-project.d.ts
70
+ interface CompileResult {
71
+ /** The compiled template, or `undefined` when a finding blocks it. */
72
+ readonly template: CompiledTemplate | undefined;
73
+ /** The fixtures read from the entry, with imported assets resolved to their URLs. */
74
+ readonly fixtures: Readonly<Record<string, unknown>>;
75
+ readonly assets: readonly AssetEntry[];
76
+ /** Errors block the template; warnings ride along. */
77
+ readonly diagnostics: readonly TemplateDiagnostic[];
78
+ }
79
+ //#endregion
80
+ //#region src/sml/compile.d.ts
81
+ interface CompileTemplateOptions extends TransformOptions {
82
+ /** Parsed issue content for exactly one static IssueContent slot in an email layout. */
83
+ readonly issueContent?: IssueContentInput | undefined;
84
+ /** The project's files by path. Binary files are addressed as assets. */
85
+ readonly files: Readonly<Record<string, string | Uint8Array>>;
86
+ /** The entry: a `.tsx` file that default-exports `defineTemplate({ ... })`. */
87
+ readonly entry: string;
88
+ /**
89
+ * The portable JSON Schema, for an entry whose `schema` is not a literal `jsonSchema(...)`
90
+ * (a Zod or Effect schema needs a library to become JSON Schema). A host that has evaluated the
91
+ * schema passes its conversion here; a literal schema is read from source and this is ignored.
92
+ */
93
+ readonly schema?: Readonly<Record<string, unknown>> | undefined;
94
+ }
95
+ /** Compile a project's entry template without evaluating any of it. */
96
+ declare const compileTemplate: (options: CompileTemplateOptions) => Promise<CompileResult>;
97
+ //#endregion
98
+ export { TailwindOptions as a, projectBrandSpecifier as i, compileTemplate as n, CompileResult as r, CompileTemplateOptions as t };