@stacksjs/stx 0.2.897 → 0.2.899

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 (230) hide show
  1. package/dist/{chunk-qe0t0m38.js → chunk-0b57fgpn.js} +4 -4
  2. package/dist/chunk-0f2d61b3.js +2 -0
  3. package/dist/{chunk-pjj54ddk.js → chunk-0gc1hez6.js} +3 -3
  4. package/dist/chunk-0ht6exrv.js +2 -0
  5. package/dist/{chunk-t3zmfh8w.js → chunk-150cz8qq.js} +7 -7
  6. package/dist/chunk-1pbghytr.js +2 -0
  7. package/dist/chunk-1tb18a92.js +2 -0
  8. package/dist/{chunk-dvjv4c3a.js → chunk-2sz1kh9m.js} +1 -1
  9. package/dist/chunk-2vqamyay.js +2 -0
  10. package/dist/chunk-36mz0nwv.js +2 -0
  11. package/dist/{chunk-3fnb12nh.js → chunk-3k4rteax.js} +13 -13
  12. package/dist/chunk-3m37fzvh.js +2 -0
  13. package/dist/chunk-3my2eef2.js +2 -0
  14. package/dist/{chunk-5qv5v8kc.js → chunk-40fpt0r6.js} +10 -10
  15. package/dist/{chunk-khm56bfm.js → chunk-46khhke2.js} +1 -1
  16. package/dist/{chunk-6g5z6r27.js → chunk-472w7t7p.js} +2 -2
  17. package/dist/{chunk-mjj36awr.js → chunk-4e28p8vf.js} +6 -6
  18. package/dist/{chunk-bgfs3mbg.js → chunk-4hk1mjtv.js} +5 -5
  19. package/dist/chunk-4jtewn1v.js +2 -0
  20. package/dist/chunk-4s6w89m2.js +2 -0
  21. package/dist/{chunk-dtpxzcrw.js → chunk-4wd5sn16.js} +7 -7
  22. package/dist/{chunk-1bft48gk.js → chunk-50wjk5ap.js} +2 -2
  23. package/dist/{chunk-ch9028z3.js → chunk-54x7h3sb.js} +1 -1
  24. package/dist/chunk-5astk182.js +2 -0
  25. package/dist/{chunk-3b3mkgpj.js → chunk-5g5khx0m.js} +2 -2
  26. package/dist/{chunk-zf68afyh.js → chunk-5gnt3qtn.js} +3 -3
  27. package/dist/{chunk-80ky40mm.js → chunk-5jrpzepc.js} +2 -2
  28. package/dist/{chunk-q0y8gv18.js → chunk-5mrt1enm.js} +2 -2
  29. package/dist/{chunk-wg6fmren.js → chunk-5tm1pvt3.js} +2 -2
  30. package/dist/chunk-5tvse0vw.js +2 -0
  31. package/dist/{chunk-ytjn0gq2.js → chunk-5yvgzh6n.js} +2 -2
  32. package/dist/{chunk-n6q1d66k.js → chunk-65g78sge.js} +1 -1
  33. package/dist/chunk-65rx54n6.js +2 -0
  34. package/dist/{chunk-x5bn2svk.js → chunk-67pq803s.js} +2 -2
  35. package/dist/{chunk-neg6ckjg.js → chunk-68r2zs20.js} +4 -4
  36. package/dist/{chunk-h0stypkf.js → chunk-6hjcqaqr.js} +2 -2
  37. package/dist/chunk-70ez3njv.js +2 -0
  38. package/dist/chunk-726w7fm2.js +2 -0
  39. package/dist/{chunk-xy8smv5e.js → chunk-73ebyhqq.js} +2 -2
  40. package/dist/chunk-73nazfe5.js +2 -0
  41. package/dist/{chunk-vk2jy6mn.js → chunk-7b3dqeyr.js} +2 -2
  42. package/dist/{chunk-whcrca58.js → chunk-7nn5s0c3.js} +30 -30
  43. package/dist/{chunk-062qfv99.js → chunk-7pfhr4nk.js} +2 -2
  44. package/dist/chunk-7r294vc9.js +2 -0
  45. package/dist/chunk-7rn7w53f.js +2 -0
  46. package/dist/{chunk-qnz406aa.js → chunk-7z1hqp86.js} +4 -4
  47. package/dist/chunk-81qvg3yd.js +2 -0
  48. package/dist/{chunk-e16ef18k.js → chunk-83hs9905.js} +2 -2
  49. package/dist/chunk-8a9gmbxa.js +2 -0
  50. package/dist/chunk-8jvwapq3.js +2 -0
  51. package/dist/{chunk-jdpzwv1t.js → chunk-8rgy17fj.js} +8 -8
  52. package/dist/{chunk-2g7cs1n8.js → chunk-8v2hsn4d.js} +3 -3
  53. package/dist/{chunk-y1d3j2j7.js → chunk-8xb09hnn.js} +4 -4
  54. package/dist/{chunk-xmg6bmh6.js → chunk-945zygwa.js} +13 -13
  55. package/dist/{chunk-pvm48tse.js → chunk-9ejk9mwk.js} +2 -2
  56. package/dist/{chunk-bw2m1e7g.js → chunk-9hwg13ec.js} +5 -5
  57. package/dist/{chunk-b8zrn7k4.js → chunk-9jpsxqaf.js} +1 -1
  58. package/dist/{chunk-d6ghx785.js → chunk-9m45t60c.js} +80 -80
  59. package/dist/{chunk-hj98d829.js → chunk-9n5san33.js} +14 -14
  60. package/dist/chunk-9vafweyd.js +3 -0
  61. package/dist/{chunk-zwqkbk2m.js → chunk-9w7whtbx.js} +2 -2
  62. package/dist/{chunk-1ph2yhfn.js → chunk-arfpzf17.js} +2 -2
  63. package/dist/chunk-avqxkbrd.js +2 -0
  64. package/dist/{chunk-htx5yezj.js → chunk-ayady5ws.js} +2 -2
  65. package/dist/{chunk-3xkrnf5m.js → chunk-b6ctdvdf.js} +6 -6
  66. package/dist/{chunk-tkjjyh6k.js → chunk-becs8132.js} +5 -5
  67. package/dist/chunk-bmwcgmev.js +2 -0
  68. package/dist/{chunk-67j2m620.js → chunk-bzd387yx.js} +4 -4
  69. package/dist/{chunk-mhrnjaka.js → chunk-c0x9wyj7.js} +4 -4
  70. package/dist/chunk-cgqpn3e2.js +2 -0
  71. package/dist/chunk-cp82351f.js +2 -0
  72. package/dist/chunk-cvxg2rc1.js +2 -0
  73. package/dist/{chunk-jxydtkdw.js → chunk-d1bwb2kz.js} +3 -3
  74. package/dist/{chunk-05x1rd86.js → chunk-de61k0ab.js} +2 -2
  75. package/dist/chunk-dj8fyaea.js +2 -0
  76. package/dist/chunk-dmc91qke.js +2 -0
  77. package/dist/{chunk-gdyjd163.js → chunk-e0bwzxfd.js} +6 -6
  78. package/dist/{chunk-2hpkr84c.js → chunk-e4xd1ca7.js} +1 -1
  79. package/dist/{chunk-j1npj5xc.js → chunk-e5q1ammf.js} +3 -3
  80. package/dist/{chunk-xvncq3m5.js → chunk-eb5cma4b.js} +2 -2
  81. package/dist/{chunk-3bsz7zj3.js → chunk-eb5v9npc.js} +2 -2
  82. package/dist/{chunk-aj5tsksz.js → chunk-edpsk4bg.js} +5 -5
  83. package/dist/{chunk-xqb0rzk1.js → chunk-eka2e4cm.js} +4 -4
  84. package/dist/{chunk-pnmafbv5.js → chunk-ern5hyvr.js} +1 -1
  85. package/dist/{chunk-41z7f41b.js → chunk-esm0pnpz.js} +2 -2
  86. package/dist/chunk-fe1wmmr5.js +2 -0
  87. package/dist/{chunk-r5ecgcx2.js → chunk-ffytbb4x.js} +5 -5
  88. package/dist/{chunk-vf4ejngv.js → chunk-fksmr50h.js} +6 -6
  89. package/dist/{chunk-dt80hbq8.js → chunk-fsxk5fsh.js} +8 -8
  90. package/dist/{chunk-2bnsxgfe.js → chunk-ft9h5qbs.js} +4 -4
  91. package/dist/chunk-fznzn35q.js +2 -0
  92. package/dist/{chunk-6xaeq730.js → chunk-g065d7p7.js} +2 -2
  93. package/dist/{chunk-rf0smj4c.js → chunk-g32hc78c.js} +2 -2
  94. package/dist/{chunk-nq60tjkz.js → chunk-gnf1e5q7.js} +2 -2
  95. package/dist/{chunk-x89k2af8.js → chunk-gq3gttt5.js} +21 -21
  96. package/dist/chunk-h2gnz7ja.js +2 -0
  97. package/dist/chunk-hc8ks7y3.js +2 -0
  98. package/dist/{chunk-cphc60zw.js → chunk-hdfhaddy.js} +2 -2
  99. package/dist/{chunk-t0ttxayz.js → chunk-hnjeqxqy.js} +2 -2
  100. package/dist/chunk-hpqvq1r9.js +2 -0
  101. package/dist/chunk-hs2a040z.js +2 -0
  102. package/dist/{chunk-9d578fvc.js → chunk-javb4e3b.js} +5 -5
  103. package/dist/chunk-jq49238b.js +2 -0
  104. package/dist/chunk-jr3fmkq7.js +2 -0
  105. package/dist/chunk-k2fw6paw.js +2 -0
  106. package/dist/chunk-k352spys.js +2 -0
  107. package/dist/{chunk-1knk403z.js → chunk-k3566kgd.js} +2 -2
  108. package/dist/{chunk-cmg9x1ka.js → chunk-k3ytyhkr.js} +3 -3
  109. package/dist/chunk-k79dvx67.js +2 -0
  110. package/dist/chunk-km1k3c4e.js +2 -0
  111. package/dist/chunk-kvjbpbmw.js +2 -0
  112. package/dist/chunk-mhv84p0x.js +2 -0
  113. package/dist/{chunk-vx1s055y.js → chunk-mjqsz20a.js} +2 -2
  114. package/dist/chunk-mmtyp5z4.js +2 -0
  115. package/dist/{chunk-8hwfdwgn.js → chunk-mry67rsk.js} +6 -6
  116. package/dist/{chunk-ksmn19qw.js → chunk-n3fgrsva.js} +2 -2
  117. package/dist/{chunk-bzpxjvcq.js → chunk-n8xjqsze.js} +3 -3
  118. package/dist/{chunk-p3hbsrk9.js → chunk-nc5d3a5r.js} +5 -5
  119. package/dist/chunk-p4hm5srd.js +2 -0
  120. package/dist/{chunk-0jkj8thz.js → chunk-p89rpak1.js} +1 -1
  121. package/dist/{chunk-hxws025y.js → chunk-p92272k0.js} +2 -2
  122. package/dist/{chunk-at8dv8dn.js → chunk-pd31ge72.js} +6 -6
  123. package/dist/chunk-pjpy86c3.js +3 -0
  124. package/dist/chunk-psyqrxg0.js +2 -0
  125. package/dist/chunk-q4yq72wh.js +2 -0
  126. package/dist/{chunk-s557tht3.js → chunk-q6p96qq7.js} +7 -7
  127. package/dist/{chunk-115bb91s.js → chunk-qs0zk04y.js} +2 -2
  128. package/dist/{chunk-ta07gj66.js → chunk-qt2mr3f0.js} +31 -16
  129. package/dist/{chunk-a0aqs5a8.js → chunk-qykbjg3z.js} +2 -2
  130. package/dist/chunk-qzx6h6af.js +2 -0
  131. package/dist/{chunk-g5nfqzfh.js → chunk-r0az4z6d.js} +2 -2
  132. package/dist/{chunk-txegy370.js → chunk-r9n86na1.js} +41 -41
  133. package/dist/{chunk-bgggjcwt.js → chunk-rapr0m13.js} +3 -3
  134. package/dist/{chunk-gm48z1nk.js → chunk-rrpfn9rr.js} +1 -1
  135. package/dist/chunk-ryp47rwp.js +2 -0
  136. package/dist/{chunk-3qk8vf9m.js → chunk-t14bn66j.js} +3 -3
  137. package/dist/chunk-t9j000tb.js +2 -0
  138. package/dist/{chunk-yfqrwazc.js → chunk-tga3nrn6.js} +5 -5
  139. package/dist/chunk-tgwwa872.js +2 -0
  140. package/dist/chunk-v0r6zb87.js +2 -0
  141. package/dist/{chunk-18dv485d.js → chunk-v5v6w6rn.js} +2 -2
  142. package/dist/{chunk-9rjgq8k4.js → chunk-vbmvft7g.js} +1 -1
  143. package/dist/{chunk-kk2p2tgv.js → chunk-vfctk20v.js} +3 -3
  144. package/dist/{chunk-8jb5fsnf.js → chunk-vgvxs1ag.js} +2 -2
  145. package/dist/{chunk-rb2zbdqd.js → chunk-vw7crz0z.js} +4 -4
  146. package/dist/chunk-vxtna1b1.js +2 -0
  147. package/dist/chunk-x43x2c6v.js +2 -0
  148. package/dist/chunk-xqx8t9w5.js +2 -0
  149. package/dist/{chunk-sh7a0g09.js → chunk-xr1s56k5.js} +3 -3
  150. package/dist/chunk-y10eaxgc.js +2 -0
  151. package/dist/chunk-ytk4f2j9.js +2 -0
  152. package/dist/chunk-z33r3pzy.js +2 -0
  153. package/dist/chunk-zcys6b06.js +2 -0
  154. package/dist/chunk-zkr42285.js +2 -0
  155. package/dist/chunk-zpwh9bpc.js +2 -0
  156. package/dist/chunk-zrs22j09.js +2 -0
  157. package/dist/chunk-zw6tgr0s.js +2 -0
  158. package/dist/cli.js +19 -19
  159. package/dist/client/signals-scope-disposal-runtime.js +18 -3
  160. package/dist/craft-entry.js +2 -2
  161. package/dist/craft.js +2 -2
  162. package/dist/dynamic-components.js +47 -25
  163. package/dist/offline/app-service-worker.js +2 -2
  164. package/dist/pwa.js +3 -3
  165. package/dist/ssg.js +4 -4
  166. package/package.json +5 -5
  167. package/dist/chunk-02qhay07.js +0 -2
  168. package/dist/chunk-04x7mp45.js +0 -2
  169. package/dist/chunk-0k437z3q.js +0 -2
  170. package/dist/chunk-1a7a8cjs.js +0 -2
  171. package/dist/chunk-1p4q6t48.js +0 -2
  172. package/dist/chunk-1z6pqvmf.js +0 -2
  173. package/dist/chunk-2nqmw4dv.js +0 -2
  174. package/dist/chunk-35j7gaj5.js +0 -2
  175. package/dist/chunk-4akw3bym.js +0 -2
  176. package/dist/chunk-4azhfxrm.js +0 -2
  177. package/dist/chunk-4d85str1.js +0 -2
  178. package/dist/chunk-4s2x5p6r.js +0 -2
  179. package/dist/chunk-53kcqdjj.js +0 -2
  180. package/dist/chunk-5eq2e6p3.js +0 -2
  181. package/dist/chunk-5y4q7k3j.js +0 -2
  182. package/dist/chunk-690518hw.js +0 -2
  183. package/dist/chunk-732gb689.js +0 -2
  184. package/dist/chunk-7wj6yx6f.js +0 -2
  185. package/dist/chunk-80xzjxah.js +0 -2
  186. package/dist/chunk-87tmvvvp.js +0 -2
  187. package/dist/chunk-9afkttvz.js +0 -2
  188. package/dist/chunk-a27xsdp6.js +0 -2
  189. package/dist/chunk-ah8az9vv.js +0 -2
  190. package/dist/chunk-arr79m90.js +0 -2
  191. package/dist/chunk-at843zxh.js +0 -2
  192. package/dist/chunk-awb046ct.js +0 -2
  193. package/dist/chunk-b5njp1ef.js +0 -2
  194. package/dist/chunk-cjxfc5j5.js +0 -2
  195. package/dist/chunk-cp5x6kx1.js +0 -2
  196. package/dist/chunk-d2whsv81.js +0 -2
  197. package/dist/chunk-dr6fqa3x.js +0 -2
  198. package/dist/chunk-e28czxw3.js +0 -2
  199. package/dist/chunk-e8szp5wa.js +0 -2
  200. package/dist/chunk-essd43ad.js +0 -2
  201. package/dist/chunk-f60k8j9m.js +0 -2
  202. package/dist/chunk-ffkhg23t.js +0 -2
  203. package/dist/chunk-fsk3rk2x.js +0 -2
  204. package/dist/chunk-gz7egees.js +0 -2
  205. package/dist/chunk-hk241gt2.js +0 -2
  206. package/dist/chunk-j9kejcrx.js +0 -2
  207. package/dist/chunk-jc3zrmpz.js +0 -2
  208. package/dist/chunk-jhbz5w30.js +0 -2
  209. package/dist/chunk-jk6yg125.js +0 -2
  210. package/dist/chunk-k4x680e3.js +0 -2
  211. package/dist/chunk-kfdmm240.js +0 -2
  212. package/dist/chunk-n5ypn9nh.js +0 -2
  213. package/dist/chunk-pyqacq37.js +0 -2
  214. package/dist/chunk-rc12m1j7.js +0 -2
  215. package/dist/chunk-ry7nh392.js +0 -2
  216. package/dist/chunk-sccjcyb9.js +0 -2
  217. package/dist/chunk-sezkn93y.js +0 -2
  218. package/dist/chunk-snkbn5y8.js +0 -2
  219. package/dist/chunk-sw0gme6q.js +0 -2
  220. package/dist/chunk-tbh7r1wh.js +0 -2
  221. package/dist/chunk-v3jyb8k6.js +0 -2
  222. package/dist/chunk-w6r18he3.js +0 -2
  223. package/dist/chunk-wg2n94gf.js +0 -3
  224. package/dist/chunk-wkk0gska.js +0 -2
  225. package/dist/chunk-x6565mhk.js +0 -2
  226. package/dist/chunk-xfjezd96.js +0 -2
  227. package/dist/chunk-xwgdcc7w.js +0 -2
  228. package/dist/chunk-z4tdnfxd.js +0 -2
  229. package/dist/chunk-zn5dcfhc.js +0 -2
  230. package/dist/chunk-zxjdfgdx.js +0 -3
@@ -1,16 +1,16 @@
1
1
  // @bun
2
- import{k,E,Li,Tn}from"./chunk-d6ghx785.js";import{hi}from"./chunk-6xaeq730.js";import{l}from"./chunk-zxjdfgdx.js";import{L,f}from"./chunk-hxws025y.js";import M from"fs";import d from"path";import{hasLocalConfig as ye}from"bunfig";var It={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function it(n){return`--stx-${n}`}function H(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var Re=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function te(n,t){let s=t.trim();return H(n,s)??(Re.test(s)?s:void 0)}function ne(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!It[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!$e[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!Ve[t]).map((t)=>`density.${t}`)]}function se(n){let t={};for(let[s,r]of Object.entries(It)){let i=H(n,r.light);if(i===void 0)continue;t[s]=`var(${it(s)}, ${i})`}return t}function re(n,t={}){let s=[],r=[];for(let[i,c]of Object.entries(It)){let o=t[i],g=typeof o==="string"?o:o?.light,a=typeof o==="string"?o:o?.dark,u=g&&te(n,g)||H(n,c.light),m=a&&te(n,a)||H(n,c.dark);if(u===void 0)continue;if(s.push(` ${it(i)}: ${u};`),m!==void 0)r.push(` ${it(i)}: ${m};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
2
+ import{k,E,ji,$n}from"./chunk-9m45t60c.js";import{yi}from"./chunk-g065d7p7.js";import{l}from"./chunk-pjpy86c3.js";import{L,f}from"./chunk-p92272k0.js";import M from"fs";import d from"path";import{hasLocalConfig as ye}from"bunfig";var It={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function it(n){return`--stx-${n}`}function H(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var Re=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function te(n,t){let s=t.trim();return H(n,s)??(Re.test(s)?s:void 0)}function ne(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!It[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!$e[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!Ve[t]).map((t)=>`density.${t}`)]}function se(n){let t={};for(let[s,r]of Object.entries(It)){let i=H(n,r.light);if(i===void 0)continue;t[s]=`var(${it(s)}, ${i})`}return t}function re(n,t={}){let s=[],r=[];for(let[i,c]of Object.entries(It)){let o=t[i],g=typeof o==="string"?o:o?.light,a=typeof o==="string"?o:o?.dark,u=g&&te(n,g)||H(n,c.light),m=a&&te(n,a)||H(n,c.dark);if(u===void 0)continue;if(s.push(` ${it(i)}: ${u};`),m!==void 0)r.push(` ${it(i)}: ${m};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
3
3
  `)}var $e={control:{value:"0.375rem",description:"Buttons, inputs, selects \u2014 rounded-md"},panel:{value:"0.5rem",description:"Cards, dialogs, menus \u2014 rounded-lg"},pill:{value:"9999px",description:"Chips and badges, which are pill-shaped by intent"}};function xn(n){return`--stx-radius-${n}`}function ie(){let n={};for(let[t,s]of Object.entries($e))n[t]=`var(${xn(t)}, ${s.value})`;return n}function oe(n={}){return["/* stx shape tokens \u2014 a radius by what the thing is. */",":root {",...Object.entries($e).map(([t,s])=>` ${xn(t)}: ${n[t]??s.value};`),"}",""].join(`
4
- `)}var Ve={"control-px":{value:"1rem",description:"Inline padding of a md text control \u2014 px-4"},"control-py":{value:"0.5rem",description:"Block padding of a md text control \u2014 py-2"},"control-text":{value:"1rem",description:"Font size of a md text control \u2014 text-base"},"control-leading":{value:"1.5rem",description:"Line height of a md text control \u2014 text-base"},"cell-px":{value:"1.5rem",description:"Inline padding of every table cell, header or body \u2014 px-6"},"cell-py":{value:"1rem",description:"Block padding of a body cell \u2014 py-4"},"cell-text":{value:"0.875rem",description:"Font size of a body cell \u2014 text-sm"},"cell-leading":{value:"1.25rem",description:"Line height of a body cell \u2014 text-sm"},"cell-head-py":{value:"0.75rem",description:"Block padding of a header cell \u2014 py-3"},"cell-head-text":{value:"0.75rem",description:"Font size of a header cell \u2014 text-xs"},"cell-head-leading":{value:"1rem",description:"Line height of a header cell \u2014 text-xs"}},yr={"control-x":"control-px","control-y":"control-py","cell-x":"cell-px","cell-y":"cell-py","cell-head-y":"cell-head-py"},br={control:{size:"control-text",leading:"control-leading"},cell:{size:"cell-text",leading:"cell-leading"},"cell-head":{size:"cell-head-text",leading:"cell-head-leading"}};function at(n){return`--stx-${n}`}function Y(n){let t=Ve[n];if(!t)throw Error(`[stx] unknown density token "${n}"`);return`var(${at(n)}, ${t.value})`}function ce(){let n={};for(let[t,s]of Object.entries(yr))n[t]=Y(s);return n}function ae(){let n={};for(let[t,{size:s,leading:r}]of Object.entries(br))n[t]=[Y(s),{lineHeight:Y(r)}];return n}function le(n={}){return["/* stx density tokens \u2014 how much room a control or a table cell takes. */",":root {",...Object.entries(Ve).map(([t,s])=>` ${at(t)}: ${n[t]??s.value};`),"}",""].join(`
4
+ `)}var Ve={"control-px":{value:"1rem",description:"Inline padding of a md text control \u2014 px-4"},"control-py":{value:"0.5rem",description:"Block padding of a md text control \u2014 py-2"},"control-text":{value:"1rem",description:"Font size of a md text control \u2014 text-base"},"control-leading":{value:"1.5rem",description:"Line height of a md text control \u2014 text-base"},"cell-px":{value:"1.5rem",description:"Inline padding of every table cell, header or body \u2014 px-6"},"cell-py":{value:"1rem",description:"Block padding of a body cell \u2014 py-4"},"cell-text":{value:"0.875rem",description:"Font size of a body cell \u2014 text-sm"},"cell-leading":{value:"1.25rem",description:"Line height of a body cell \u2014 text-sm"},"cell-head-py":{value:"0.75rem",description:"Block padding of a header cell \u2014 py-3"},"cell-head-text":{value:"0.75rem",description:"Font size of a header cell \u2014 text-xs"},"cell-head-leading":{value:"1rem",description:"Line height of a header cell \u2014 text-xs"}},br={"control-x":"control-px","control-y":"control-py","cell-x":"cell-px","cell-y":"cell-py","cell-head-y":"cell-head-py"},wr={control:{size:"control-text",leading:"control-leading"},cell:{size:"cell-text",leading:"cell-leading"},"cell-head":{size:"cell-head-text",leading:"cell-head-leading"}};function at(n){return`--stx-${n}`}function Y(n){let t=Ve[n];if(!t)throw Error(`[stx] unknown density token "${n}"`);return`var(${at(n)}, ${t.value})`}function ce(){let n={};for(let[t,s]of Object.entries(br))n[t]=Y(s);return n}function ae(){let n={};for(let[t,{size:s,leading:r}]of Object.entries(wr))n[t]=[Y(s),{lineHeight:Y(r)}];return n}function le(n={}){return["/* stx density tokens \u2014 how much room a control or a table cell takes. */",":root {",...Object.entries(Ve).map(([t,s])=>` ${at(t)}: ${n[t]??s.value};`),"}",""].join(`
5
5
  `)}function de(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function J(n,t){let s={...n};for(let[r,i]of Object.entries(t))s[r]=de(i)&&de(s[r])?J(s[r],i):i;return s}function ge(n,t){if(!t.fonts)return"";let s=new n({...t.config,fonts:t.fonts,cssVariables:!1}).toCSS(!1,t.minify);return s&&!t.minify?`${s}
6
- `:s}function fe(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...c}=r,{extend:o,...g}=s,a=g.colors||{};g.colors={...a,...se(a)};let u=g.borderRadius||{};g.borderRadius={...u,...ie()};let m=g.spacing||{};g.spacing={...m,...ce()};let P=g.fontSize||{};g.fontSize={...P,...ae()};let D=J(g,c),O=J(o||{},i||{});if(Object.keys(O).length>0)D.extend=O;let y=[...n.safelist||[],...t.safelist||[]],I={...n.shortcuts||{},...t.shortcuts||{}},_=[...n.preflights||[],...t.preflights||[]],{fonts:z,...Q}=n,{fonts:N,roles:R,shapes:T,density:A,...w}=t,b={roles:R,shapes:T,density:A},p=N??z;return{config:{...Q,...w,theme:D,safelist:y,shortcuts:I,..._.length>0?{preflights:_}:{},content:[],output:""},safelist:y,shortcuts:I,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:re({...a,...D.colors},R)+oe(T)+le(A),unknownRoles:ne(b),...p?{fonts:p}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import j from"fs";import Te from"path";var je=256,x=new Map,ue=(n)=>Bun.hash(n).toString(16).padStart(16,"0").slice(0,16),pe=(n)=>l(process.cwd(),"css-assets",`${n}.css`);function K(n,t){if(x.delete(n),x.set(n,t),x.size>je)x.delete(x.keys().next().value)}function he(n){let t=ue(n),s=pe(t);if(x.has(s))return K(s,n),t;let r;try{let i;try{i=j.readFileSync(s,"utf8")}catch{}if(i!==n)j.mkdirSync(Te.dirname(s),{recursive:!0}),r=`${s}.${process.pid}.${crypto.randomUUID()}.tmp`,j.writeFileSync(r,n,{flag:"wx"}),j.renameSync(r,s);return K(s,n),t}catch{return}finally{if(r)try{j.unlinkSync(r)}catch{}}}function sg(n){if(!/^[a-f0-9]{16}$/.test(n))return;let t=pe(n),s=x.get(t);if(s!==void 0)return K(t,s),s;try{let r=j.readFileSync(t,"utf8");if(ue(r)!==n)return;return K(t,r),r}catch{return}}function me(){x.clear()}var h=null,U="";function xe(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;U=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{U=n}}var Z=!1,v=null,F="",B=!1,Be=256,Ee="sorted",C=new Map,V=null,we=null,W=new Map,ke=new Set;function ee(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function X(n,t){if(C.has(n))C.delete(n);else if(C.size>=Be)C.delete(C.keys().next().value);C.set(n,t)}async function Pe(n,t=V){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${ee(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function De(n,t,s=V){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${ee(n)}.css`),t)}catch{}}async function Ce(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var Oe=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],Ie=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function Ne(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of Oe)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function Ae(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function Ac(){if(Z)return h;Z=!0;try{let n=async(i)=>{for(let c of i){if(!await Bun.file(c).exists())continue;let o=await Ce(c);if(o){if(xe(c),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(c))}`);return o}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),c=await n([i]);if(!c)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return h=c,h}let t=await n(Ne());if(t)return h=t,h;let s=Ie;for(let i of s){let c=await Ce(i);if(c){h=c;try{xe(import.meta.resolve(i))}catch{U=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return h}}let r=await n(Ae());if(r)return h=r,h;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function ry(){q.clear(),h=null,Z=!1,v=null,F="",C.clear(),me(),we=null,W.clear()}var Se=!1;async function Pc(n){try{let t=ye({name:"css",cwd:n})?"css":ye({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!Se)Se=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function og(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-at843zxh.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let c=await import(i);t=c.default||c,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let c=await import(i);t={...c.default||c,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await Pc(n)}function ig(n){try{let t=new WeakSet;return ee(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function Sn(n){if(B)return F;B=!0;try{let t=await Ac();if(!t||!t.build)return B=!1,"";if(!v)v=await Pc(n);if(!v)return B=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},c=performance.now(),o=await t.build(i),g=performance.now()-c;if(F=o.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${o.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let a=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(a);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(a,o.css)}return B=!1,o.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),B=!1,F}}async function wr(n){v=null,await Sn(n)}function sy(){return F}function ag(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let o of r[1].split(/\s+/))if(o.trim())t.add(o.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,c=i.exec(n);while(c!==null){let o=c[1].match(/'([^']+)'/g);if(o){for(let g of o)for(let a of g.slice(1,-1).split(/\s+/))if(a.trim())t.add(a.trim())}c=i.exec(n)}return t}var q=k(64);async function cg(n,t){let s=()=>W.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=q.get(E(n,t,s()));if(r!==void 0)return r;let i=await Fe(n,t);if(i)q.set(E(n,t,s()),i);return i}function*be(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=hi(r);if(i)yield i}}function oy(n){return[...be(n)].join(`
7
- `)}async function Fe(n,t){try{let s=await Ac();if(!s)return"";let r=new Set;for(let p of be(n)){let G=typeof s.extractClasses==="function"?s.extractClasses(p):ag(p);for(let ve of G)r.add(ve)}if(r.size===0)return"";let i=t?d.resolve(t):process.cwd(),c=l(i,"cache");if(!V)V=c;let o=W.get(i);if(!o){let p=await og(i);o={config:p,fingerprint:ig(p)},W.set(i,o),we=o.fingerprint}let g=[...r].sort(),a=g.join(" "),u=`${Ee}::${U}::${o.fingerprint||"default"}::${a}`,m=C.get(u);if(m!==void 0)return X(u,m),m;let P=await Pe(u,c);if(P!==null)return X(u,P),P;let D=s.defaultConfig||s.config,O=o.config||{},y=fe(D,O),{safelist:I,includePreflight:_,minify:z,tokenCSS:Q}=y;if(y.unknownRoles.length>0&&!ke.has(i))ke.add(i),console.warn(`${e.yellow}[ts-css]${e.reset} No stx role for ${y.unknownRoles.join(", ")} - these keep the stock value. Role names: semanticTokenNames() in @stacksjs/stx/theme-tokens.`);let N=y.config,R=new s.CSSGenerator(N),T=N.shortcuts||O.shortcuts||{},A=Object.keys(T).filter((p)=>r.has(p)||I.includes(p));for(let p of I)if(!T[p])R.generate(p);for(let p of g)if(!T[p])R.generate(p);let w="";if(A.length>0){let p=new s.CSSGenerator(N);for(let G of A)p.generate(G);if(w=p.toCSS(!1,z),w&&!w.endsWith(`
6
+ `:s}function fe(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...c}=r,{extend:o,...g}=s,a=g.colors||{};g.colors={...a,...se(a)};let u=g.borderRadius||{};g.borderRadius={...u,...ie()};let m=g.spacing||{};g.spacing={...m,...ce()};let P=g.fontSize||{};g.fontSize={...P,...ae()};let D=J(g,c),O=J(o||{},i||{});if(Object.keys(O).length>0)D.extend=O;let y=[...n.safelist||[],...t.safelist||[]],I={...n.shortcuts||{},...t.shortcuts||{}},_=[...n.preflights||[],...t.preflights||[]],{fonts:z,...Q}=n,{fonts:N,roles:R,shapes:T,density:A,...w}=t,b={roles:R,shapes:T,density:A},p=N??z;return{config:{...Q,...w,theme:D,safelist:y,shortcuts:I,..._.length>0?{preflights:_}:{},content:[],output:""},safelist:y,shortcuts:I,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:re({...a,...D.colors},R)+oe(T)+le(A),unknownRoles:ne(b),...p?{fonts:p}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import j from"fs";import Te from"path";var je=256,x=new Map,ue=(n)=>Bun.hash(n).toString(16).padStart(16,"0").slice(0,16),pe=(n)=>l(process.cwd(),"css-assets",`${n}.css`);function K(n,t){if(x.delete(n),x.set(n,t),x.size>je)x.delete(x.keys().next().value)}function he(n){let t=ue(n),s=pe(t);if(x.has(s))return K(s,n),t;let r;try{let i;try{i=j.readFileSync(s,"utf8")}catch{}if(i!==n)j.mkdirSync(Te.dirname(s),{recursive:!0}),r=`${s}.${process.pid}.${crypto.randomUUID()}.tmp`,j.writeFileSync(r,n,{flag:"wx"}),j.renameSync(r,s);return K(s,n),t}catch{return}finally{if(r)try{j.unlinkSync(r)}catch{}}}function og(n){if(!/^[a-f0-9]{16}$/.test(n))return;let t=pe(n),s=x.get(t);if(s!==void 0)return K(t,s),s;try{let r=j.readFileSync(t,"utf8");if(ue(r)!==n)return;return K(t,r),r}catch{return}}function me(){x.clear()}var h=null,U="";function xe(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;U=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{U=n}}var Z=!1,v=null,F="",B=!1,Be=256,Ee="sorted",C=new Map,V=null,we=null,W=new Map,ke=new Set;function ee(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function X(n,t){if(C.has(n))C.delete(n);else if(C.size>=Be)C.delete(C.keys().next().value);C.set(n,t)}async function Pe(n,t=V){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${ee(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function De(n,t,s=V){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${ee(n)}.css`),t)}catch{}}async function Ce(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var Oe=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],Ie=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function Ne(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of Oe)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function Ae(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function Pc(){if(Z)return h;Z=!0;try{let n=async(i)=>{for(let c of i){if(!await Bun.file(c).exists())continue;let o=await Ce(c);if(o){if(xe(c),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(c))}`);return o}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),c=await n([i]);if(!c)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return h=c,h}let t=await n(Ne());if(t)return h=t,h;let s=Ie;for(let i of s){let c=await Ce(i);if(c){h=c;try{xe(import.meta.resolve(i))}catch{U=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return h}}let r=await n(Ae());if(r)return h=r,h;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function sy(){q.clear(),h=null,Z=!1,v=null,F="",C.clear(),me(),we=null,W.clear()}var Se=!1;async function Ic(n){try{let t=ye({name:"css",cwd:n})?"css":ye({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!Se)Se=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function ig(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-cgqpn3e2.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let c=await import(i);t=c.default||c,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let c=await import(i);t={...c.default||c,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await Ic(n)}function ag(n){try{let t=new WeakSet;return ee(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function Sn(n){if(B)return F;B=!0;try{let t=await Pc();if(!t||!t.build)return B=!1,"";if(!v)v=await Ic(n);if(!v)return B=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},c=performance.now(),o=await t.build(i),g=performance.now()-c;if(F=o.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${o.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let a=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(a);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(a,o.css)}return B=!1,o.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),B=!1,F}}async function vr(n){v=null,await Sn(n)}function oy(){return F}function cg(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let o of r[1].split(/\s+/))if(o.trim())t.add(o.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,c=i.exec(n);while(c!==null){let o=c[1].match(/'([^']+)'/g);if(o){for(let g of o)for(let a of g.slice(1,-1).split(/\s+/))if(a.trim())t.add(a.trim())}c=i.exec(n)}return t}var q=k(64);async function lg(n,t){let s=()=>W.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=q.get(E(n,t,s()));if(r!==void 0)return r;let i=await Fe(n,t);if(i)q.set(E(n,t,s()),i);return i}function*be(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=yi(r);if(i)yield i}}function iy(n){return[...be(n)].join(`
7
+ `)}async function Fe(n,t){try{let s=await Pc();if(!s)return"";let r=new Set;for(let p of be(n)){let G=typeof s.extractClasses==="function"?s.extractClasses(p):cg(p);for(let ve of G)r.add(ve)}if(r.size===0)return"";let i=t?d.resolve(t):process.cwd(),c=l(i,"cache");if(!V)V=c;let o=W.get(i);if(!o){let p=await ig(i);o={config:p,fingerprint:ag(p)},W.set(i,o),we=o.fingerprint}let g=[...r].sort(),a=g.join(" "),u=`${Ee}::${U}::${o.fingerprint||"default"}::${a}`,m=C.get(u);if(m!==void 0)return X(u,m),m;let P=await Pe(u,c);if(P!==null)return X(u,P),P;let D=s.defaultConfig||s.config,O=o.config||{},y=fe(D,O),{safelist:I,includePreflight:_,minify:z,tokenCSS:Q}=y;if(y.unknownRoles.length>0&&!ke.has(i))ke.add(i),console.warn(`${e.yellow}[ts-css]${e.reset} No stx role for ${y.unknownRoles.join(", ")} - these keep the stock value. Role names: semanticTokenNames() in @stacksjs/stx/theme-tokens.`);let N=y.config,R=new s.CSSGenerator(N),T=N.shortcuts||O.shortcuts||{},A=Object.keys(T).filter((p)=>r.has(p)||I.includes(p));for(let p of I)if(!T[p])R.generate(p);for(let p of g)if(!T[p])R.generate(p);let w="";if(A.length>0){let p=new s.CSSGenerator(N);for(let G of A)p.generate(G);if(w=p.toCSS(!1,z),w&&!w.endsWith(`
8
8
  `))w+=`
9
- `}let b=w+R.toCSS(_,z);return b=ge(s.CSSGenerator,y)+Q+b,X(u,b),De(u,b,c),b}catch(s){return console.warn("Failed to generate Css CSS:",s),""}}async function S(n,t,s=!1,r=!1){let i=await cg(n,t);if(!i)return r?Tn(n):n;let c=s?he(i):void 0,o=c?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${c}.css">`:`<style data-css="generated">
9
+ `}let b=w+R.toCSS(_,z);return b=ge(s.CSSGenerator,y)+Q+b,X(u,b),De(u,b,c),b}catch(s){return console.warn("Failed to generate Css CSS:",s),""}}async function S(n,t,s=!1,r=!1){let i=await lg(n,t);if(!i)return r?$n(n):n;let c=s?he(i):void 0,o=c?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${c}.css">`:`<style data-css="generated">
10
10
  ${i}
11
11
  </style>`;if(r)return Me(n,o);let g=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(g.test(n)){let a=!1;return n.replace(g,()=>{if(a)return"";return a=!0,o})}if(n.includes("</head>"))return f(n,o);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
12
- ${o}`);return o+n}function Me(n,t){let s=Li(n).map((a)=>({...a,replacement:""})),r=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g,i=r.exec(n);if(i!==null){let a=!0;while(i!==null)s.push({start:i.index,end:i.index+i[0].length,replacement:a?t:""}),a=!1,i=r.exec(n)}else{let a=L(n);if(a!==-1)s.push({start:a,end:a,replacement:`${t}
12
+ ${o}`);return o+n}function Me(n,t){let s=ji(n).map((a)=>({...a,replacement:""})),r=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g,i=r.exec(n);if(i!==null){let a=!0;while(i!==null)s.push({start:i.index,end:i.index+i[0].length,replacement:a?t:""}),a=!1,i=r.exec(n)}else{let a=L(n);if(a!==-1)s.push({start:a,end:a,replacement:`${t}
13
13
  `});else{let u=n.match(/<body([^>]*)>/);if(u?.index!==void 0)s.push({start:u.index,end:u.index+u[0].length,replacement:`${u[0]}
14
- ${t}`});else s.push({start:0,end:0,replacement:t})}}s.sort((a,u)=>a.start-u.start||a.end-u.end);for(let a=1;a<s.length;a++)if(s[a].start<s[a-1].end)return _e(Tn(n),t);let c=Array(s.length*2+1),o=0,g=0;for(let a of s)c[g++]=n.slice(o,a.start),c[g++]=a.replacement,o=a.end;return c[g]=n.slice(o),c.join("")}function _e(n,t){let s=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(s.test(n)){let r=!1;return n.replace(s,()=>{if(r)return"";return r=!0,t})}if(n.includes("</head>"))return f(n,t);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
14
+ ${t}`});else s.push({start:0,end:0,replacement:t})}}s.sort((a,u)=>a.start-u.start||a.end-u.end);for(let a=1;a<s.length;a++)if(s[a].start<s[a-1].end)return _e($n(n),t);let c=Array(s.length*2+1),o=0,g=0;for(let a of s)c[g++]=n.slice(o,a.start),c[g++]=a.replacement,o=a.end;return c[g]=n.slice(o),c.join("")}function _e(n,t){let s=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(s.test(n)){let r=!1;return n.replace(s,()=>{if(r)return"";return r=!0,t})}if(n.includes("</head>"))return f(n,t);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
15
15
  ${t}`);return t+n}
16
- export{It,it,$e,xn,Ve,yr,br,at,e,sg,Ac,ry,Pc,og,ig,Sn,wr,sy,ag,cg,oy,S};
16
+ export{It,it,$e,xn,Ve,br,wr,at,e,og,Pc,sy,Ic,ig,ag,Sn,vr,oy,cg,lg,iy,S};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Le}from"./chunk-3b3mkgpj.js";import{C}from"./chunk-cphc60zw.js";import{D,Bn}from"./chunk-vk2jy6mn.js";import{A,ie}from"./chunk-d6ghx785.js";import{a}from"./chunk-5qv5v8kc.js";import{Te,yn,bn,wn}from"./chunk-qnz406aa.js";import{Ot}from"./chunk-jdpzwv1t.js";import{Rt,nr,un,ve}from"./chunk-wg6fmren.js";import{I,tt}from"./chunk-a0aqs5a8.js";import v from"fs";import b from"path";import x from"process";function U(s,o){for(let e of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(e[1])o.add(e[1]);for(let e of s.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let t of(e[1]??"").split(",")){let r=((t.includes(":")?t.split(":").pop():t)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))o.add(r)}for(let e of s.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let t of(e[1]??"").split(",")){let n=t.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}}var h=new Map;async function O(s,o=I()){let e;if(s)e=b.resolve(s);else{let l=await a();e=b.resolve(l.root||x.cwd(),l.storesDir||"stores")}let t=`${e}\x00${bn()}\x00${o?"shared":"inline"}`,n=new Bun.Glob("*.ts"),r=[];try{for await(let l of n.scan({cwd:e,absolute:!0})){let c=b.basename(l,".ts");if(["index","types"].includes(c))continue;if(l.includes(".d.ts"))continue;r.push(l)}}catch{return ve(h,t,"",{chunks:[]}),null}let i=()=>[...new Set([...r,...r.flatMap((l)=>Te(l))])],f=Rt(i()),u=un(h,t,f);if(u!==void 0)return u.chunks.length>0?u:null;if(r.length===0)return ve(h,t,f,{chunks:[]}),null;let m=[];for(let l of r){let c=await Bun.file(l).text();m.push({file:l,hasUseStore:/useStore\s*\(/.test(c)})}m.sort((l,c)=>{if(l.hasUseStore===c.hasUseStore)return 0;return l.hasUseStore?1:-1});let p=m.map((l)=>l.file),g=[],d=ie({loader:"ts",target:"browser",define:A()});for(let l of p)try{let c=await Bun.file(l).text(),k=b.basename(l,".ts"),_=new Set;U(c,_);let y=[...c.matchAll(/\bdefineStore\s*(?:<[^>()]*>)?\(\s*(['"`])([^'"`$\\]+)\1/g)].map((N)=>N[2]),E=c.match(/\bdefineStore\s*(?:<[^>()]*>)?\(/g)?.length??0;if(yn(c))c=await wn(c,l,{projectRoot:x.cwd(),externalizeUserModules:o});c=Ot(c),c=D(c),c=Bn(c),c=c.replace(/^export\s+(default\s+)?/gm,""),c=d.transformSync(c),g.push({name:k,ids:y.length===E?y:[],declared:_,code:`// Store: ${k}
2
+ import{Le}from"./chunk-5g5khx0m.js";import{C}from"./chunk-hdfhaddy.js";import{D,Fn}from"./chunk-7b3dqeyr.js";import{A,ie}from"./chunk-9m45t60c.js";import{a}from"./chunk-40fpt0r6.js";import{Te,yn,bn,wn}from"./chunk-7z1hqp86.js";import{Ot}from"./chunk-8rgy17fj.js";import{Rt,rr,un,ve}from"./chunk-5tm1pvt3.js";import{I,tt}from"./chunk-qykbjg3z.js";import v from"fs";import b from"path";import x from"process";function U(s,o){for(let e of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(e[1])o.add(e[1]);for(let e of s.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let t of(e[1]??"").split(",")){let r=((t.includes(":")?t.split(":").pop():t)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))o.add(r)}for(let e of s.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let t of(e[1]??"").split(",")){let n=t.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}}var h=new Map;async function O(s,o=I()){let e;if(s)e=b.resolve(s);else{let l=await a();e=b.resolve(l.root||x.cwd(),l.storesDir||"stores")}let t=`${e}\x00${bn()}\x00${o?"shared":"inline"}`,n=new Bun.Glob("*.ts"),r=[];try{for await(let l of n.scan({cwd:e,absolute:!0})){let c=b.basename(l,".ts");if(["index","types"].includes(c))continue;if(l.includes(".d.ts"))continue;r.push(l)}}catch{return ve(h,t,"",{chunks:[]}),null}let i=()=>[...new Set([...r,...r.flatMap((l)=>Te(l))])],f=Rt(i()),u=un(h,t,f);if(u!==void 0)return u.chunks.length>0?u:null;if(r.length===0)return ve(h,t,f,{chunks:[]}),null;let m=[];for(let l of r){let c=await Bun.file(l).text();m.push({file:l,hasUseStore:/useStore\s*\(/.test(c)})}m.sort((l,c)=>{if(l.hasUseStore===c.hasUseStore)return 0;return l.hasUseStore?1:-1});let p=m.map((l)=>l.file),g=[],d=ie({loader:"ts",target:"browser",define:A()});for(let l of p)try{let c=await Bun.file(l).text(),k=b.basename(l,".ts"),_=new Set;U(c,_);let y=[...c.matchAll(/\bdefineStore\s*(?:<[^>()]*>)?\(\s*(['"`])([^'"`$\\]+)\1/g)].map((N)=>N[2]),E=c.match(/\bdefineStore\s*(?:<[^>()]*>)?\(/g)?.length??0;if(yn(c))c=await wn(c,l,{projectRoot:x.cwd(),externalizeUserModules:o});c=Ot(c),c=D(c),c=Fn(c),c=c.replace(/^export\s+(default\s+)?/gm,""),c=d.transformSync(c),g.push({name:k,ids:y.length===E?y:[],declared:_,code:`// Store: ${k}
3
3
  ${c.trim()}`})}catch(c){console.warn(`[stx] Failed to load store ${l}:`,c)}if(g.length===0)return ve(h,t,f,{chunks:[]}),null;f=Rt(i());let S={chunks:g};return ve(h,t,f,S),S}function R(s){let o=new Set;for(let r of s)for(let i of r.declared)o.add(i);let e=s.map((r)=>r.code).join(`
4
4
 
5
5
  `),n=`;(function(){
@@ -12,7 +12,7 @@ var __stx = window.stx || {};
12
12
  ${C.filter((i)=>!n.has(i)&&new RegExp(`\\b${i}\\b`).test(e.code)).map((i)=>`var ${i} = __stx[${JSON.stringify(i)}];`).join(`
13
13
  `)}
14
14
  ${e.code}
15
- }`})}var M=new WeakMap;async function Mh(s){let o=await O(s);if(!o)return null;let e=M.get(o);if(e===void 0)e=R(o.chunks),M.set(o,e);return e}function T(s){if(!/\buseStore\b/.test(s))return!1;if(/\buseStore\s+as\s+[A-Za-z_$]/.test(s))return!0;if(/\{[^{}]*\buseStore\s*:\s*[A-Za-z_$[{][^{}]*\}\s*=(?!=)/.test(s))return!0;if(/\[\s*(['"`])useStore\1\s*\]/.test(s.replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ")))return!0;let o=s.replace(/\/\*[\s\S]*?\*\//g," ").replace(/(^|[^:\\'"`])\/\/[^\n]*/g,"$1 ").replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ").replace(/\b(?:const|let|var)\s*\{[^{}]*\}\s*=/g," ").replace(/\bimport\s*(?:type\s+)?\{[^{}]*\}\s*from\b/g," ").replace(/\bexport\s*(?:type\s+)?\{[^{}]*\}/g," ").replace(/\btypeof\s+useStore\b/g," ").replace(/(['"`])useStore\1/g," ");for(let e of o.matchAll(/\buseStore\b/g)){let t=o.slice(Math.max(0,e.index-9),e.index);if(/\bfunction\s*$/.test(t))continue;let n=o.slice(e.index+8).trimStart();if(n.startsWith("(")||n.startsWith("<")||n.startsWith("?.("))continue;if(/^=(?![=>])/.test(n))continue;return!0}return!1}function Bo(...s){let o=new Set,e=!1;for(let t of s){if(!t)continue;if(/__STX_STORES__|\b_stores\b/.test(t))e=!0;if(T(t))e=!0;let n=t.match(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(/g)?.length??0;if(n===0)continue;let r=0;for(let i of t.matchAll(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(\s*(['"`])([^'"`$\\]+)\1\s*[,)]/g))o.add(i[2]),r++;if(r!==n)e=!0}return{names:o,all:e}}var z=new Map;function Dh(s){let o=new Set,e=!1;for(let t of s){if(/\.(?:css|json|svg|wasm|png|jpe?g|gif|webp|avif|woff2?|ttf|txt|md)$/i.test(t))continue;let n;try{let r=v.statSync(t),i=z.get(t);if(i&&i.mtimeMs===r.mtimeMs&&i.size===r.size)n=i.read;else n=Bo(v.readFileSync(t,"utf8")),z.set(t,{mtimeMs:r.mtimeMs,size:r.size,read:n})}catch{n={names:new Set,all:!0}}if(n.all)e=!0;for(let r of n.names)o.add(r)}return{names:o,all:e}}function Lh(s=x.env){return s.STX_PAGE_STORES==="all"}async function jh(s,o,e={}){let t=await O(s,e.sharedModules);if(!t)return null;let{chunks:n}=t,r=Bo(...o);if(e.reads){if(e.reads.all)r.all=!0;for(let u of e.reads.names)r.names.add(u)}let i=e.runOnce?W(t):void 0,f;if(e.all||r.all||n.some((u)=>u.ids.length===0)||i===null)f=n;else{let u=new Map;for(let d of n)for(let S of d.ids)u.set(S,d);let m=new Set,p=[...r.names],g=!1;while(p.length>0&&!g){let d=u.get(p.pop());if(!d||m.has(d))continue;m.add(d);let S=Bo(d.code);if(S.all)g=!0;else p.push(...S.names)}f=g?n:n.filter((d)=>m.has(d))}if(f.length===0)return null;if(i){let u=f.map((d)=>i.get(d)),m=f.map((d)=>d.name),p=F.get(t);if(!p)F.set(t,p=new Map);let g=p.get(m.join("\x00"));if(g===void 0)p.set(m.join("\x00"),g=Z(m,u));return{code:g,stores:m,functions:u}}return{code:R(f),stores:f.map((u)=>u.name),functions:j(f)}}var F=new WeakMap,w=new WeakMap;function W(s){if(w.has(s))return w.get(s);let o=j(s.chunks),e=o?new Map(s.chunks.map((t,n)=>[t,o[n]])):null;return w.set(s,e),e}function Z(s,o){let t=`;(function(){
15
+ }`})}var M=new WeakMap;async function Dh(s){let o=await O(s);if(!o)return null;let e=M.get(o);if(e===void 0)e=R(o.chunks),M.set(o,e);return e}function T(s){if(!/\buseStore\b/.test(s))return!1;if(/\buseStore\s+as\s+[A-Za-z_$]/.test(s))return!0;if(/\{[^{}]*\buseStore\s*:\s*[A-Za-z_$[{][^{}]*\}\s*=(?!=)/.test(s))return!0;if(/\[\s*(['"`])useStore\1\s*\]/.test(s.replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ")))return!0;let o=s.replace(/\/\*[\s\S]*?\*\//g," ").replace(/(^|[^:\\'"`])\/\/[^\n]*/g,"$1 ").replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ").replace(/\b(?:const|let|var)\s*\{[^{}]*\}\s*=/g," ").replace(/\bimport\s*(?:type\s+)?\{[^{}]*\}\s*from\b/g," ").replace(/\bexport\s*(?:type\s+)?\{[^{}]*\}/g," ").replace(/\btypeof\s+useStore\b/g," ").replace(/(['"`])useStore\1/g," ");for(let e of o.matchAll(/\buseStore\b/g)){let t=o.slice(Math.max(0,e.index-9),e.index);if(/\bfunction\s*$/.test(t))continue;let n=o.slice(e.index+8).trimStart();if(n.startsWith("(")||n.startsWith("<")||n.startsWith("?.("))continue;if(/^=(?![=>])/.test(n))continue;return!0}return!1}function Fo(...s){let o=new Set,e=!1;for(let t of s){if(!t)continue;if(/__STX_STORES__|\b_stores\b/.test(t))e=!0;if(T(t))e=!0;let n=t.match(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(/g)?.length??0;if(n===0)continue;let r=0;for(let i of t.matchAll(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(\s*(['"`])([^'"`$\\]+)\1\s*[,)]/g))o.add(i[2]),r++;if(r!==n)e=!0}return{names:o,all:e}}var z=new Map;function Lh(s){let o=new Set,e=!1;for(let t of s){if(/\.(?:css|json|svg|wasm|png|jpe?g|gif|webp|avif|woff2?|ttf|txt|md)$/i.test(t))continue;let n;try{let r=v.statSync(t),i=z.get(t);if(i&&i.mtimeMs===r.mtimeMs&&i.size===r.size)n=i.read;else n=Fo(v.readFileSync(t,"utf8")),z.set(t,{mtimeMs:r.mtimeMs,size:r.size,read:n})}catch{n={names:new Set,all:!0}}if(n.all)e=!0;for(let r of n.names)o.add(r)}return{names:o,all:e}}function jh(s=x.env){return s.STX_PAGE_STORES==="all"}async function Bh(s,o,e={}){let t=await O(s,e.sharedModules);if(!t)return null;let{chunks:n}=t,r=Fo(...o);if(e.reads){if(e.reads.all)r.all=!0;for(let u of e.reads.names)r.names.add(u)}let i=e.runOnce?W(t):void 0,f;if(e.all||r.all||n.some((u)=>u.ids.length===0)||i===null)f=n;else{let u=new Map;for(let d of n)for(let S of d.ids)u.set(S,d);let m=new Set,p=[...r.names],g=!1;while(p.length>0&&!g){let d=u.get(p.pop());if(!d||m.has(d))continue;m.add(d);let S=Fo(d.code);if(S.all)g=!0;else p.push(...S.names)}f=g?n:n.filter((d)=>m.has(d))}if(f.length===0)return null;if(i){let u=f.map((d)=>i.get(d)),m=f.map((d)=>d.name),p=F.get(t);if(!p)F.set(t,p=new Map);let g=p.get(m.join("\x00"));if(g===void 0)p.set(m.join("\x00"),g=Z(m,u));return{code:g,stores:m,functions:u}}return{code:R(f),stores:f.map((u)=>u.name),functions:j(f)}}var F=new WeakMap,w=new WeakMap;function W(s){if(w.has(s))return w.get(s);let o=j(s.chunks),e=o?new Map(s.chunks.map((t,n)=>[t,o[n]])):null;return w.set(s,e),e}function Z(s,o){let t=`;(function(){
16
16
  var ran = window.__stxStoreFiles || (window.__stxStoreFiles = {});
17
17
  function run(name, define) {
18
18
  if (ran[name]) return;
@@ -22,5 +22,5 @@ function run(name, define) {
22
22
  }
23
23
  ${s.map((n,r)=>`run(${JSON.stringify(n)}, ${o[r]})`).join(`;
24
24
  `)};
25
- })();`;return I()?tt(t):t}function Bh(){h.clear(),nr()}
26
- export{Mh,Bo,Dh,Lh,jh,Bh};
25
+ })();`;return I()?tt(t):t}function Fh(){h.clear(),rr()}
26
+ export{Dh,Fo,Lh,jh,Bh,Fh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{za,Ha,Su,ku,_u,Cu,ch}from"./chunk-mry67rsk.js";export{za as createVirtualList,ch as default,Su as generateVirtualListCSS,_u as processInfiniteListDirectives,Cu as processVirtualGridDirectives,Ha as processVirtualListDirectives,ku as useVirtualList};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{nl,s,Ce}from"./chunk-d6ghx785.js";import{gt}from"./chunk-zkwkhesc.js";import{l}from"./chunk-zxjdfgdx.js";import o from"fs";import u from"path";var mg=new Map,m=new Map;async function fy(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(r){n=r;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function gy(e){m.delete(e)}function my(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function hy(e){x=e}async function hg(e=!1){let t=x??await import("./chunk-cp5x6kx1.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function yg(){if(S===null){let{getRouterScript:e}=await import("./chunk-5eq2e6p3.js");S=e()}return S}var y={};async function yy(e,t=!1){let n=e==="runtime"?await hg(t):await yg(),i=e==="runtime"&&t?"runtime-debug":e,r=y[i];if(!r||r.content!==n)r={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=r;return{content:n,hash:r.hash,url:`/_stx/${e}.${r.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function by(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let r=c.keys().next().value;p-=c.get(r).length*2,c.delete(r)}if(!i)try{let r=C(t);if(!o.existsSync(r))o.mkdirSync(u.dirname(r),{recursive:!0}),o.writeFileSync(r,e)}catch{}return`/_stx/modules.${t}.js`}function hi(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function wy(){m.clear(),Ce(),nl(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function _r(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${Ds(e)}.html`),r=u.join(n,`${Ds(e)}.meta.json`);if(!await s(i)||!await s(r))return null;let g=await Bun.file(r).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==gt())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await s(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function Cr(e,t,n,i){try{if(!i.cachePath)return;let r=u.resolve(i.cachePath);await o.promises.mkdir(r,{recursive:!0});let g=u.join(r,`${Ds(e)}.html`),a=u.join(r,`${Ds(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:gt(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),mg.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(r){console.warn(`Failed to cache template ${e}:`,r)}}var _=16;function Ds(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
- export{mg,fy,gy,my,hy,hg,yg,yy,by,hi,wy,_r,Cr,Ds};
2
+ import{rl,s,Ce}from"./chunk-9m45t60c.js";import{gt}from"./chunk-zkwkhesc.js";import{l}from"./chunk-pjpy86c3.js";import o from"fs";import u from"path";var hg=new Map,m=new Map;async function gy(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(r){n=r;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function my(e){m.delete(e)}function hy(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function yy(e){x=e}async function yg(e=!1){let t=x??await import("./chunk-zrs22j09.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function bg(){if(S===null){let{getRouterScript:e}=await import("./chunk-hs2a040z.js");S=e()}return S}var y={};async function by(e,t=!1){let n=e==="runtime"?await yg(t):await bg(),i=e==="runtime"&&t?"runtime-debug":e,r=y[i];if(!r||r.content!==n)r={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=r;return{content:n,hash:r.hash,url:`/_stx/${e}.${r.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function wy(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let r=c.keys().next().value;p-=c.get(r).length*2,c.delete(r)}if(!i)try{let r=C(t);if(!o.existsSync(r))o.mkdirSync(u.dirname(r),{recursive:!0}),o.writeFileSync(r,e)}catch{}return`/_stx/modules.${t}.js`}function yi(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function vy(){m.clear(),Ce(),rl(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function Cr(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${Ls(e)}.html`),r=u.join(n,`${Ls(e)}.meta.json`);if(!await s(i)||!await s(r))return null;let g=await Bun.file(r).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==gt())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await s(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function Er(e,t,n,i){try{if(!i.cachePath)return;let r=u.resolve(i.cachePath);await o.promises.mkdir(r,{recursive:!0});let g=u.join(r,`${Ls(e)}.html`),a=u.join(r,`${Ls(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:gt(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),hg.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(r){console.warn(`Failed to cache template ${e}:`,r)}}var _=16;function Ls(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
+ export{hg,gy,my,hy,yy,yg,bg,by,wy,yi,vy,Cr,Er,Ls};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function Gl(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Xl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Jl(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Zg(n,s){let e=Gl(n),a=s&&d.existsSync(s)?Xl(s):[];return Jl([...e,...a])}function Qg(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function Xl(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Jl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Yl(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Qg(n,s){let e=Xl(n),a=s&&d.existsSync(s)?Jl(s):[];return Yl([...e,...a])}function em(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{Gl,Xl,Jl,Zg,Qg};
8
+ export{Xl,Jl,Yl,Qg,em};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- function c(i){if(!i.startsWith("/")||/[?#\\]/.test(i))throw Error(`Invalid route rule pattern: ${i}`);let t=i==="/"?[]:i.slice(1).split("/");if(t.some((r,e)=>!r||r.includes("*")&&r!=="*"&&r!=="**"||r==="**"&&e!==t.length-1||r.startsWith(":")&&!/^:[\w]+$/.test(r)))throw Error(`Unsupported route rule pattern: ${i}`);return t}function jo(i){for(let[t,r]of Object.entries(i)){if(c(t),!r||typeof r!=="object"||Object.keys(r).some((e)=>e!=="rendering"&&e!=="cache"))throw Error(`Unsupported route rule for ${t}`);if(r.rendering!==void 0&&r.rendering!=="prerender"&&r.rendering!=="dynamic")throw Error(`Unsupported rendering mode for ${t}`);if(r.cache!==void 0&&r.cache!==!1){let e=r.cache;if(!e||e.public!==!0||Object.keys(e).some((n)=>!["public","maxAge","swr"].includes(n))||!Number.isFinite(e.maxAge)||e.maxAge<=0||e.swr!==void 0&&(!Number.isFinite(e.swr)||e.swr<0))throw Error(`Route cache for ${t} requires public: true, maxAge > 0 and swr >= 0`);if(r.rendering==="prerender")throw Error(`Prerendered route ${t} cannot revalidate; use dynamic rendering with cache`)}}}function Gn(i={}){jo(i);let t=(e)=>e==="**"?0:e==="*"?1:e.startsWith(":")?2:3,r=Object.entries(i).map(([e,n])=>({pattern:e,parts:c(e),rule:n}));return r.sort((e,n)=>{for(let o=0;o<Math.max(e.parts.length,n.parts.length);o++){let s=(n.parts[o]===void 0?4:t(n.parts[o]))-(e.parts[o]===void 0?4:t(e.parts[o]));if(s)return s}return e.pattern.localeCompare(n.pattern)}),(e)=>{let n=e==="/"?[]:e.replace(/\/$/,"").slice(1).split("/");return r.find(({parts:o})=>o.every((s,u)=>s==="**"||n[u]!==void 0&&(s==="*"||s.startsWith(":")||s===n[u]))&&(o.at(-1)==="**"||o.length===n.length))?.rule??{}}}
3
- export{jo,Gn};
2
+ function c(i){if(!i.startsWith("/")||/[?#\\]/.test(i))throw Error(`Invalid route rule pattern: ${i}`);let t=i==="/"?[]:i.slice(1).split("/");if(t.some((r,e)=>!r||r.includes("*")&&r!=="*"&&r!=="**"||r==="**"&&e!==t.length-1||r.startsWith(":")&&!/^:[\w]+$/.test(r)))throw Error(`Unsupported route rule pattern: ${i}`);return t}function Bo(i){for(let[t,r]of Object.entries(i)){if(c(t),!r||typeof r!=="object"||Object.keys(r).some((e)=>e!=="rendering"&&e!=="cache"))throw Error(`Unsupported route rule for ${t}`);if(r.rendering!==void 0&&r.rendering!=="prerender"&&r.rendering!=="dynamic")throw Error(`Unsupported rendering mode for ${t}`);if(r.cache!==void 0&&r.cache!==!1){let e=r.cache;if(!e||e.public!==!0||Object.keys(e).some((n)=>!["public","maxAge","swr"].includes(n))||!Number.isFinite(e.maxAge)||e.maxAge<=0||e.swr!==void 0&&(!Number.isFinite(e.swr)||e.swr<0))throw Error(`Route cache for ${t} requires public: true, maxAge > 0 and swr >= 0`);if(r.rendering==="prerender")throw Error(`Prerendered route ${t} cannot revalidate; use dynamic rendering with cache`)}}}function Xn(i={}){Bo(i);let t=(e)=>e==="**"?0:e==="*"?1:e.startsWith(":")?2:3,r=Object.entries(i).map(([e,n])=>({pattern:e,parts:c(e),rule:n}));return r.sort((e,n)=>{for(let o=0;o<Math.max(e.parts.length,n.parts.length);o++){let s=(n.parts[o]===void 0?4:t(n.parts[o]))-(e.parts[o]===void 0?4:t(e.parts[o]));if(s)return s}return e.pattern.localeCompare(n.pattern)}),(e)=>{let n=e==="/"?[]:e.replace(/\/$/,"").slice(1).split("/");return r.find(({parts:o})=>o.every((s,u)=>s==="**"||n[u]!==void 0&&(s==="*"||s.startsWith(":")||s===n[u]))&&(o.at(-1)==="**"||o.length===n.length))?.rule??{}}}
3
+ export{Bo,Xn};