@stacksjs/stx 0.2.92 → 0.2.94

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 (629) hide show
  1. package/dist/a11y.js +1 -1
  2. package/dist/analytics.js +1 -1
  3. package/dist/analyzer.js +1 -1
  4. package/dist/animation.js +1 -1
  5. package/dist/app-shell.js +1 -1
  6. package/dist/app.js +1 -1
  7. package/dist/assets.js +1 -1
  8. package/dist/ast.js +1 -1
  9. package/dist/async-components.js +1 -1
  10. package/dist/auth.js +1 -1
  11. package/dist/broadcasting.js +1 -1
  12. package/dist/browser-composables.js +1 -1
  13. package/dist/build-assets.js +1 -1
  14. package/dist/build-mode-detector.js +1 -1
  15. package/dist/build-optimizer.js +1 -1
  16. package/dist/build-views.js +1 -1
  17. package/dist/build.js +1 -1
  18. package/dist/builtins/drawer.js +1 -1
  19. package/dist/builtins/escape.js +1 -1
  20. package/dist/builtins/icon.js +1 -1
  21. package/dist/builtins/index.js +1 -1
  22. package/dist/builtins/modal.js +1 -1
  23. package/dist/builtins/safe-image.js +1 -1
  24. package/dist/builtins/stx-image.js +1 -1
  25. package/dist/builtins/stx-link.js +1 -1
  26. package/dist/builtins/stx-loading-indicator.js +1 -1
  27. package/dist/builtins/suspense.js +1 -1
  28. package/dist/builtins/toast.js +1 -1
  29. package/dist/builtins/tooltip.js +1 -1
  30. package/dist/builtins/transition-group.js +1 -1
  31. package/dist/bundle-analyzer/collector.js +1 -1
  32. package/dist/bundle-analyzer/index.js +1 -1
  33. package/dist/bundle-analyzer/report.js +1 -1
  34. package/dist/bundle-analyzer/treemap.js +1 -1
  35. package/dist/caching.js +1 -1
  36. package/dist/{chunk-9p45wwff.js → chunk-03c26pjz.js} +1 -1
  37. package/dist/{chunk-4ep9gk7d.js → chunk-04mvcmcr.js} +1 -1
  38. package/dist/{chunk-5e2khb7q.js → chunk-05hgyyqc.js} +2 -2
  39. package/dist/{chunk-j25swncq.js → chunk-095s3972.js} +1 -1
  40. package/dist/{chunk-t1dzvz5z.js → chunk-0dz85jrp.js} +1 -1
  41. package/dist/{chunk-2aydpj2n.js → chunk-0g4gece6.js} +1 -1
  42. package/dist/{chunk-k7yp9h17.js → chunk-0jd0pndq.js} +1 -1
  43. package/dist/{chunk-3whqk46c.js → chunk-0jkwrcwj.js} +1 -1
  44. package/dist/{chunk-jcjzg6r5.js → chunk-0m9tdm7t.js} +1 -1
  45. package/dist/{chunk-9pzdyd8q.js → chunk-0qnz93q2.js} +2 -2
  46. package/dist/{chunk-c9f5k95v.js → chunk-0tatqxj2.js} +2 -2
  47. package/dist/{chunk-wdtanmx1.js → chunk-0wdar532.js} +1 -1
  48. package/dist/{chunk-m911bf2b.js → chunk-13yz561y.js} +2 -2
  49. package/dist/{chunk-646pxdd1.js → chunk-174z0cd0.js} +2 -2
  50. package/dist/{chunk-wbrqpv9f.js → chunk-1mmykse5.js} +2 -2
  51. package/dist/{chunk-xkzz5rb0.js → chunk-1z2yq9em.js} +2 -2
  52. package/dist/{chunk-jmky0qzm.js → chunk-1z5nhbjt.js} +1 -1
  53. package/dist/{chunk-ms9rebfj.js → chunk-25s7bckb.js} +2 -2
  54. package/dist/{chunk-nsrqf0dg.js → chunk-268adc7r.js} +1 -1
  55. package/dist/{chunk-14kfmww0.js → chunk-26r6zh3t.js} +2 -2
  56. package/dist/{chunk-8xbj6dqe.js → chunk-2w3302dh.js} +1 -1
  57. package/dist/{chunk-9ezvda3j.js → chunk-2xen423s.js} +1 -1
  58. package/dist/{chunk-nv3k4bf9.js → chunk-39gm08bn.js} +1 -1
  59. package/dist/{chunk-g3f1xq76.js → chunk-3bjtemm6.js} +1 -1
  60. package/dist/{chunk-6r70w54p.js → chunk-3jm3snz8.js} +1 -1
  61. package/dist/{chunk-9tksycj5.js → chunk-3ngm57nt.js} +2 -2
  62. package/dist/{chunk-hkjq64we.js → chunk-3rh7va1z.js} +1 -1
  63. package/dist/{chunk-r5sggjdv.js → chunk-3yg9hbmb.js} +2 -2
  64. package/dist/{chunk-sk1gmrr8.js → chunk-46mkpbkk.js} +2 -2
  65. package/dist/chunk-48cw2nde.js +2 -0
  66. package/dist/chunk-48r3qe0k.js +3 -0
  67. package/dist/{chunk-19f7xyy7.js → chunk-4bt81cg3.js} +2 -2
  68. package/dist/{chunk-ccgmxmjk.js → chunk-4j188175.js} +1 -1
  69. package/dist/{chunk-t38vt890.js → chunk-4k7d8p8d.js} +1 -1
  70. package/dist/{chunk-91gyjg5c.js → chunk-4qq8ffke.js} +2 -2
  71. package/dist/{chunk-fnqf7293.js → chunk-50vqeesm.js} +2 -2
  72. package/dist/{chunk-8fhv0xaw.js → chunk-52agge4n.js} +2 -2
  73. package/dist/{chunk-1vz36hw3.js → chunk-55yp0q8t.js} +1 -1
  74. package/dist/{chunk-yywc3yge.js → chunk-57p201gb.js} +1 -1
  75. package/dist/{chunk-kqtchwz7.js → chunk-5ggw1dyv.js} +1 -1
  76. package/dist/{chunk-md4j8nch.js → chunk-5kt3ay7x.js} +1 -1
  77. package/dist/{chunk-ds6g241c.js → chunk-5p568px4.js} +1 -1
  78. package/dist/{chunk-6e08xfzp.js → chunk-5ppkfyn2.js} +1 -1
  79. package/dist/{chunk-1htmc8mb.js → chunk-5q87fgkk.js} +2 -2
  80. package/dist/{chunk-ke7rcrfm.js → chunk-5qb761h2.js} +1 -1
  81. package/dist/{chunk-f7f4g33p.js → chunk-5xvbq2gs.js} +2 -2
  82. package/dist/{chunk-tb9c2mq7.js → chunk-647849kf.js} +2 -2
  83. package/dist/{chunk-b37f9ebf.js → chunk-6b5k6w2q.js} +1 -1
  84. package/dist/{chunk-x6n8z1n8.js → chunk-6cr3eeh4.js} +1 -1
  85. package/dist/{chunk-7sd6c9wv.js → chunk-6djgb0hr.js} +1 -1
  86. package/dist/{chunk-f228sm5e.js → chunk-6dqzky7x.js} +1 -1
  87. package/dist/{chunk-knefeadt.js → chunk-6e4c6g46.js} +2 -2
  88. package/dist/{chunk-qhzdkgg3.js → chunk-6w03t7h6.js} +2 -2
  89. package/dist/{chunk-fh1d8bxd.js → chunk-6wn85hn6.js} +1 -1
  90. package/dist/{chunk-w4a3cvtp.js → chunk-6y4gqs1q.js} +1 -1
  91. package/dist/{chunk-8x58wmgs.js → chunk-75rndzbd.js} +2 -2
  92. package/dist/{chunk-eghdf4qq.js → chunk-77tga15w.js} +2 -2
  93. package/dist/{chunk-w3e1fm1q.js → chunk-7a51hkpf.js} +1 -1
  94. package/dist/{chunk-rdaavfsg.js → chunk-7b0xdy5h.js} +1 -1
  95. package/dist/{chunk-5wecgn5n.js → chunk-7cgmq685.js} +1 -1
  96. package/dist/{chunk-0m53nxvy.js → chunk-7dy588as.js} +1 -1
  97. package/dist/{chunk-87rkm7qf.js → chunk-7rvh2wwv.js} +2 -2
  98. package/dist/{chunk-1hyk728h.js → chunk-7sm05m0j.js} +1 -1
  99. package/dist/{chunk-npj33yqb.js → chunk-7xcfy2fn.js} +1 -1
  100. package/dist/{chunk-7aph6rw7.js → chunk-82t27pvd.js} +1 -1
  101. package/dist/{chunk-hdv4tnvh.js → chunk-87kx8byz.js} +2 -2
  102. package/dist/{chunk-a2xzs4kd.js → chunk-8fgwhhb8.js} +2 -2
  103. package/dist/{chunk-bg1xym0q.js → chunk-8qbax8xn.js} +1 -1
  104. package/dist/{chunk-p4wm4a45.js → chunk-91s2hres.js} +2 -2
  105. package/dist/{chunk-7t4hkmxb.js → chunk-94g3cahw.js} +2 -2
  106. package/dist/{chunk-02bd1cng.js → chunk-957amb71.js} +1 -1
  107. package/dist/{chunk-qvmrwh8n.js → chunk-95w08s8v.js} +1 -1
  108. package/dist/{chunk-6zhv4fcq.js → chunk-9agvhp1x.js} +1 -1
  109. package/dist/{chunk-hd27hhzr.js → chunk-9tmbrwwx.js} +1 -1
  110. package/dist/{chunk-dtcj9r7p.js → chunk-9yz5d003.js} +2 -2
  111. package/dist/{chunk-agzvhej1.js → chunk-a3hyn4we.js} +1 -1
  112. package/dist/{chunk-n2wmny2b.js → chunk-a69tvya5.js} +2 -2
  113. package/dist/{chunk-c7zedzbg.js → chunk-adjcg6wa.js} +2 -2
  114. package/dist/{chunk-p5j0686t.js → chunk-adqh2m9z.js} +1 -1
  115. package/dist/{chunk-ddst5g08.js → chunk-asarebzq.js} +1 -1
  116. package/dist/{chunk-z06myqr1.js → chunk-aw3rp9ac.js} +2 -2
  117. package/dist/{chunk-zr8631g4.js → chunk-b0cyc09a.js} +1 -1
  118. package/dist/{chunk-ckz0ppkr.js → chunk-b3kkjcdh.js} +1 -1
  119. package/dist/{chunk-a33kr9b0.js → chunk-b3prs7y0.js} +1 -1
  120. package/dist/{chunk-zhr3za7x.js → chunk-b5zc9y0y.js} +2 -2
  121. package/dist/{chunk-zepv7y44.js → chunk-baa7h4yz.js} +2 -2
  122. package/dist/{chunk-pzc0bs5r.js → chunk-bgec9r1v.js} +2 -2
  123. package/dist/{chunk-mqnymcn5.js → chunk-bjnjpsgn.js} +2 -2
  124. package/dist/{chunk-g22tv0ed.js → chunk-bk8ew8ze.js} +2 -2
  125. package/dist/{chunk-h3mb2q51.js → chunk-bn08k7yy.js} +2 -2
  126. package/dist/{chunk-nacsxc1r.js → chunk-bpgg59wa.js} +1 -1
  127. package/dist/{chunk-9w7021bx.js → chunk-bwxda6n1.js} +2 -2
  128. package/dist/{chunk-9fj7hpwa.js → chunk-bykjk6vj.js} +1 -1
  129. package/dist/{chunk-gapx9vqm.js → chunk-c53hyw5c.js} +1 -1
  130. package/dist/{chunk-0qzxbxgp.js → chunk-c7jg8w13.js} +1 -1
  131. package/dist/{chunk-f9j3mr9z.js → chunk-ca6qd1dx.js} +1 -1
  132. package/dist/{chunk-f6s1jx8c.js → chunk-cdbwprfv.js} +2 -2
  133. package/dist/{chunk-3rgj1qn6.js → chunk-ceg2c2q2.js} +2 -2
  134. package/dist/{chunk-31w1xfs1.js → chunk-cn409b69.js} +1 -1
  135. package/dist/{chunk-c23697dp.js → chunk-cp3kwv17.js} +1 -1
  136. package/dist/{chunk-1k3k1tf8.js → chunk-cpcc11vp.js} +2 -2
  137. package/dist/{chunk-ftzqtv1k.js → chunk-cr3wbrcr.js} +2 -2
  138. package/dist/{chunk-my0qmjw4.js → chunk-cygfdk1n.js} +2 -2
  139. package/dist/{chunk-1bknva4p.js → chunk-cyp4m0vh.js} +1 -1
  140. package/dist/{chunk-jm460jxs.js → chunk-cz25azze.js} +1 -1
  141. package/dist/{chunk-9d0q9k3p.js → chunk-d77yxcds.js} +2 -2
  142. package/dist/{chunk-cf86cs0k.js → chunk-dvfs1h3c.js} +2 -2
  143. package/dist/{chunk-1bzckhs2.js → chunk-dyjnn5k8.js} +2 -2
  144. package/dist/{chunk-sd2c11bp.js → chunk-dzw95th7.js} +2 -2
  145. package/dist/{chunk-88wdr7f3.js → chunk-e0zytzdh.js} +1 -1
  146. package/dist/{chunk-tgvekhwz.js → chunk-e53h9qhd.js} +1 -1
  147. package/dist/{chunk-593x2ccf.js → chunk-eds0f8f1.js} +2 -2
  148. package/dist/{chunk-5y4q9abj.js → chunk-eh8hact1.js} +1 -1
  149. package/dist/{chunk-4ewrwqwn.js → chunk-epj957jf.js} +1 -1
  150. package/dist/{chunk-fcpxs8mm.js → chunk-eqeyaq6g.js} +1 -1
  151. package/dist/{chunk-n7j8tczc.js → chunk-fbxt2mrx.js} +2 -2
  152. package/dist/{chunk-b0w1cm1s.js → chunk-fch9tk1k.js} +1 -1
  153. package/dist/{chunk-8g0jb444.js → chunk-fe7r1mq1.js} +2 -2
  154. package/dist/{chunk-y92w0240.js → chunk-fhawx87n.js} +1 -1
  155. package/dist/{chunk-dgf2g708.js → chunk-fk51yyrw.js} +1 -1
  156. package/dist/{chunk-5tv1swsr.js → chunk-fms20x0n.js} +1 -1
  157. package/dist/{chunk-13mkbvxc.js → chunk-fs0qezn5.js} +1 -1
  158. package/dist/{chunk-acry1mfc.js → chunk-fzm3y0r3.js} +1 -1
  159. package/dist/{chunk-2rd0ykrg.js → chunk-g2hekckm.js} +1 -1
  160. package/dist/{chunk-zxsqbve0.js → chunk-g4ps1dj8.js} +2 -2
  161. package/dist/{chunk-qr72av66.js → chunk-g8b81pzc.js} +1 -1
  162. package/dist/{chunk-rth1890k.js → chunk-ganag9dm.js} +2 -2
  163. package/dist/{chunk-v9199ywv.js → chunk-gc84b1d2.js} +2 -2
  164. package/dist/{chunk-6jhqq7es.js → chunk-gcf5v18y.js} +1 -1
  165. package/dist/{chunk-a50svyjn.js → chunk-ghrx0hn1.js} +1 -1
  166. package/dist/{chunk-nh418dpm.js → chunk-gqpkp459.js} +2 -2
  167. package/dist/chunk-h45py5w5.js +2 -0
  168. package/dist/{chunk-at9v5saf.js → chunk-h5wa62ek.js} +1 -1
  169. package/dist/{chunk-ecabspxs.js → chunk-h82kjdr4.js} +1 -1
  170. package/dist/{chunk-aaaxvn5r.js → chunk-haecq01c.js} +1 -1
  171. package/dist/{chunk-zx43nkm1.js → chunk-hepg894w.js} +2 -2
  172. package/dist/{chunk-rhyxeb33.js → chunk-hjdc99kb.js} +2 -2
  173. package/dist/{chunk-04yrgvdd.js → chunk-hje9v2zh.js} +1 -1
  174. package/dist/{chunk-zxxt0c9q.js → chunk-hke99a0v.js} +2 -2
  175. package/dist/{chunk-r6sb1sm4.js → chunk-hpqr9e3x.js} +2 -2
  176. package/dist/{chunk-pcngkyjr.js → chunk-hq5cem49.js} +2 -2
  177. package/dist/{chunk-yssvz8zs.js → chunk-hrampcrj.js} +1 -1
  178. package/dist/{chunk-pjaa8q7x.js → chunk-ht4j68cs.js} +2 -2
  179. package/dist/{chunk-22xxm2x5.js → chunk-hxx3za24.js} +1 -1
  180. package/dist/{chunk-ms6793rw.js → chunk-j4s5qwd7.js} +2 -2
  181. package/dist/{chunk-ydhza16t.js → chunk-jbejwejg.js} +1 -1
  182. package/dist/{chunk-vwp4dw7e.js → chunk-jc0fc4ht.js} +1 -1
  183. package/dist/{chunk-kemb0fyc.js → chunk-jcs0ymw7.js} +1 -1
  184. package/dist/{chunk-tj9kmtnx.js → chunk-jfm69keq.js} +2 -2
  185. package/dist/chunk-jfrn43vh.js +2 -0
  186. package/dist/{chunk-fnt3srfr.js → chunk-jjamhxpm.js} +1 -1
  187. package/dist/{chunk-gcsqn7x9.js → chunk-jjvp4t5w.js} +2 -2
  188. package/dist/{chunk-e8x46y38.js → chunk-jt44av4j.js} +1 -1
  189. package/dist/{chunk-n3k3e9n5.js → chunk-jt98jhpt.js} +1 -1
  190. package/dist/{chunk-r738cjs3.js → chunk-k8440jxh.js} +2 -2
  191. package/dist/{chunk-v0s45ek4.js → chunk-kdxa9epn.js} +2 -2
  192. package/dist/{chunk-hrgg37a9.js → chunk-kfd2hf6f.js} +2 -2
  193. package/dist/{chunk-jdy93c39.js → chunk-kgym7ch9.js} +1 -1
  194. package/dist/{chunk-ybe2cpx1.js → chunk-kh6rfz2v.js} +1 -1
  195. package/dist/{chunk-j1myedcr.js → chunk-kkp6rs2n.js} +1 -1
  196. package/dist/{chunk-hz7qnpx1.js → chunk-m59y310j.js} +2 -2
  197. package/dist/{chunk-kh976zgv.js → chunk-mgmyr1b9.js} +1 -1
  198. package/dist/{chunk-dkt9p3bk.js → chunk-mqwbpamc.js} +1 -1
  199. package/dist/{chunk-xmjedbkt.js → chunk-mrehzhxv.js} +1 -1
  200. package/dist/{chunk-snj1hfpb.js → chunk-mv03qb75.js} +1 -1
  201. package/dist/chunk-mwbng54r.js +2 -0
  202. package/dist/{chunk-zvyc82ke.js → chunk-n46a5g1g.js} +1 -1
  203. package/dist/{chunk-vawc9ak6.js → chunk-n944baxp.js} +1 -1
  204. package/dist/{chunk-zwdargbj.js → chunk-nanw7yhz.js} +1 -1
  205. package/dist/{chunk-nwfa5766.js → chunk-nap11ntr.js} +2 -2
  206. package/dist/{chunk-r3cxnszy.js → chunk-ncnfa8ae.js} +2 -2
  207. package/dist/{chunk-xm3hz63f.js → chunk-ngxfwzq3.js} +1 -1
  208. package/dist/{chunk-fngb9apr.js → chunk-nvwb4x04.js} +1 -1
  209. package/dist/{chunk-ydhrdatx.js → chunk-nw34xajc.js} +1 -1
  210. package/dist/{chunk-3wth4wa6.js → chunk-payfb24w.js} +1 -1
  211. package/dist/{chunk-r1m8g439.js → chunk-pc31m5x5.js} +1 -1
  212. package/dist/{chunk-xecnz132.js → chunk-pg1fvqb9.js} +1 -1
  213. package/dist/{chunk-h6s1thg6.js → chunk-q60knhjf.js} +1 -1
  214. package/dist/{chunk-0t75nh4z.js → chunk-q6h6yvzb.js} +2 -2
  215. package/dist/{chunk-w719zps0.js → chunk-qd5461tt.js} +1 -1
  216. package/dist/{chunk-exfw0aqe.js → chunk-qdc3aav1.js} +1 -1
  217. package/dist/{chunk-g9gksn68.js → chunk-qfwzdffx.js} +2 -2
  218. package/dist/{chunk-wtgrc6ya.js → chunk-qgxwmagw.js} +1 -1
  219. package/dist/{chunk-vy0k2prz.js → chunk-qhdtssn1.js} +2 -2
  220. package/dist/{chunk-tzehzwyr.js → chunk-qk584whs.js} +1 -1
  221. package/dist/{chunk-wk7mgg5n.js → chunk-qm4yppj5.js} +2 -2
  222. package/dist/chunk-qwyd9a1d.js +2 -0
  223. package/dist/{chunk-kyhq6hzp.js → chunk-qxs6et76.js} +1 -1
  224. package/dist/{chunk-h1035wzj.js → chunk-rb1e4cnb.js} +1 -1
  225. package/dist/{chunk-kpp2baaz.js → chunk-rkffm9sy.js} +1 -1
  226. package/dist/{chunk-xgmza98t.js → chunk-rv002yn0.js} +1 -1
  227. package/dist/{chunk-64bwamng.js → chunk-s6ja2bdg.js} +1 -1
  228. package/dist/chunk-sjagg9qz.js +66 -0
  229. package/dist/{chunk-jtx73fsh.js → chunk-sn07azv3.js} +2 -2
  230. package/dist/{chunk-rqwhb85x.js → chunk-svahbw0w.js} +2 -2
  231. package/dist/{chunk-1qy4gac6.js → chunk-svhtdb0s.js} +2 -2
  232. package/dist/{chunk-rkr7cgs8.js → chunk-t37dp99j.js} +1 -1
  233. package/dist/{chunk-fk0m346m.js → chunk-tj6zfxeb.js} +2 -2
  234. package/dist/{chunk-1yg3x73j.js → chunk-tmgz5t2g.js} +1 -1
  235. package/dist/{chunk-r7d26vjj.js → chunk-tr0z0e1g.js} +1 -1
  236. package/dist/{chunk-zv9jfm2f.js → chunk-tx6br9r4.js} +1 -1
  237. package/dist/{chunk-zwpm1pa8.js → chunk-vcr5pzpx.js} +1 -1
  238. package/dist/{chunk-nqxqy9v2.js → chunk-vdfwv0fp.js} +1 -1
  239. package/dist/{chunk-hkabmxjj.js → chunk-vp2395eb.js} +2 -2
  240. package/dist/{chunk-fbbv5x9m.js → chunk-vpe6napb.js} +2 -2
  241. package/dist/{chunk-1w3354fv.js → chunk-vv9wfz1c.js} +2 -2
  242. package/dist/{chunk-71n355cg.js → chunk-vw6ejgmy.js} +2 -2
  243. package/dist/{chunk-tzd81m7r.js → chunk-w01y57f5.js} +2 -2
  244. package/dist/{chunk-6wqrqn2x.js → chunk-w21mwxdd.js} +2 -2
  245. package/dist/{chunk-qhrcts5t.js → chunk-w4n8fqp7.js} +1 -1
  246. package/dist/{chunk-x4qr3b2z.js → chunk-w959hm8j.js} +1 -1
  247. package/dist/{chunk-bgan5edn.js → chunk-wf7zrjsw.js} +1 -1
  248. package/dist/{chunk-ktvdeqjr.js → chunk-wk07pwtd.js} +1 -1
  249. package/dist/{chunk-mp9dsjrg.js → chunk-wvef3ngh.js} +1 -1
  250. package/dist/{chunk-xw9skf0n.js → chunk-wxvyj65q.js} +1 -1
  251. package/dist/{chunk-ktpc2rc4.js → chunk-x1hjv24z.js} +1 -1
  252. package/dist/{chunk-6sx4d083.js → chunk-x39sfpvm.js} +1 -1
  253. package/dist/{chunk-am5rtv86.js → chunk-x4fze3q2.js} +1 -1
  254. package/dist/{chunk-08ncwhv7.js → chunk-x64kb787.js} +1 -1
  255. package/dist/{chunk-p993psbk.js → chunk-xcb0pbr6.js} +1 -1
  256. package/dist/{chunk-9v7q6xn4.js → chunk-xhkjhxsp.js} +1 -1
  257. package/dist/{chunk-fp417rws.js → chunk-xhnpsngj.js} +2 -2
  258. package/dist/{chunk-6t76k6ry.js → chunk-xsqbk4yk.js} +2 -2
  259. package/dist/{chunk-wntaqqhz.js → chunk-xygc53vr.js} +1 -1
  260. package/dist/{chunk-vg97xcma.js → chunk-y0qg6rrv.js} +1 -1
  261. package/dist/{chunk-tavtph8x.js → chunk-y25pr13j.js} +1 -1
  262. package/dist/{chunk-fyq5573f.js → chunk-y4c744dk.js} +2 -2
  263. package/dist/{chunk-b5xf2v7f.js → chunk-y4md9hp0.js} +1 -1
  264. package/dist/{chunk-sn7pmfn4.js → chunk-y5wazw6j.js} +1 -1
  265. package/dist/{chunk-zasq08k3.js → chunk-y5xz0jc4.js} +1 -1
  266. package/dist/{chunk-7bd8bw2z.js → chunk-y86m1wr4.js} +2 -2
  267. package/dist/{chunk-ewytyv0p.js → chunk-yaan98dd.js} +2 -2
  268. package/dist/{chunk-dnkq5y2j.js → chunk-yach037f.js} +2 -2
  269. package/dist/{chunk-3ewtm19c.js → chunk-yexjrg9d.js} +2 -2
  270. package/dist/{chunk-c03qara0.js → chunk-ygvyc6wv.js} +1 -1
  271. package/dist/{chunk-0fsrhs3d.js → chunk-yj560gp8.js} +1 -1
  272. package/dist/{chunk-pdv5dhen.js → chunk-yn38c15w.js} +1 -1
  273. package/dist/{chunk-a4zj7qpt.js → chunk-yr1gdceh.js} +1 -1
  274. package/dist/{chunk-t7ghqd7e.js → chunk-yw2fzq86.js} +2 -2
  275. package/dist/{chunk-e792k31a.js → chunk-ywkrxp2h.js} +1 -1
  276. package/dist/{chunk-sgsb5xp4.js → chunk-z37xq5rx.js} +2 -2
  277. package/dist/{chunk-2g16stee.js → chunk-z4djtgt0.js} +2 -2
  278. package/dist/{chunk-zmsj7wh8.js → chunk-z8cjr9n9.js} +1 -1
  279. package/dist/{chunk-j6d9ksyj.js → chunk-znxp3zha.js} +1 -1
  280. package/dist/{chunk-dcp0znhd.js → chunk-zt2yag10.js} +1 -1
  281. package/dist/cli.js +10882 -10882
  282. package/dist/client/directive.js +1 -1
  283. package/dist/client/index.js +1 -1
  284. package/dist/client-helpers.js +1 -1
  285. package/dist/client-script-bundler.js +1 -1
  286. package/dist/client-script.js +1 -1
  287. package/dist/client.js +0 -86
  288. package/dist/component-hmr.js +1 -1
  289. package/dist/component-processing.js +1 -1
  290. package/dist/component-registry.js +1 -1
  291. package/dist/component-renderer.js +1 -1
  292. package/dist/components.js +1 -1
  293. package/dist/composables/index.js +1 -1
  294. package/dist/composables/use-battery.js +1 -1
  295. package/dist/composables/use-broadcast-channel.js +1 -1
  296. package/dist/composables/use-channel.js +1 -1
  297. package/dist/composables/use-clipboard.js +1 -1
  298. package/dist/composables/use-color-mode.js +1 -1
  299. package/dist/composables/use-cookie.js +1 -1
  300. package/dist/composables/use-device-orientation.js +1 -1
  301. package/dist/composables/use-event-listener.js +1 -1
  302. package/dist/composables/use-event-source.js +1 -1
  303. package/dist/composables/use-eye-dropper.js +1 -1
  304. package/dist/composables/use-fetch.js +1 -1
  305. package/dist/composables/use-fullscreen.js +1 -1
  306. package/dist/composables/use-geolocation.js +1 -1
  307. package/dist/composables/use-idle.js +1 -1
  308. package/dist/composables/use-intersection-observer.js +1 -1
  309. package/dist/composables/use-keyboard.js +1 -1
  310. package/dist/composables/use-media-query.js +1 -1
  311. package/dist/composables/use-meta.js +1 -1
  312. package/dist/composables/use-mouse.js +1 -1
  313. package/dist/composables/use-mutation-observer.js +1 -1
  314. package/dist/composables/use-network.js +1 -1
  315. package/dist/composables/use-notification.js +1 -1
  316. package/dist/composables/use-permissions.js +1 -1
  317. package/dist/composables/use-resize-observer.js +1 -1
  318. package/dist/composables/use-router.js +1 -1
  319. package/dist/composables/use-share.js +1 -1
  320. package/dist/composables/use-speech.js +1 -1
  321. package/dist/composables/use-storage.js +1 -1
  322. package/dist/composables/use-text-selection.js +3 -1
  323. package/dist/composables/use-timer.js +1 -1
  324. package/dist/composables/use-utilities.js +1 -1
  325. package/dist/composables/use-wake-lock.js +1 -1
  326. package/dist/composables/use-websocket.js +1 -1
  327. package/dist/composables/use-window.js +1 -1
  328. package/dist/composables.js +1 -1
  329. package/dist/composition-api.js +1 -1
  330. package/dist/computed.js +1 -1
  331. package/dist/conditionals.js +1 -1
  332. package/dist/config.js +1 -1
  333. package/dist/craft-bridge.js +1 -1
  334. package/dist/craft-compiler.js +1 -1
  335. package/dist/craft-components.js +1 -1
  336. package/dist/craft-entry.js +1 -1
  337. package/dist/craft-ssr.js +1 -1
  338. package/dist/csp.js +1 -1
  339. package/dist/csrf.js +1 -1
  340. package/dist/custom-directives.js +1 -1
  341. package/dist/defer.js +1 -1
  342. package/dist/deploy/config-generators.js +1 -1
  343. package/dist/deploy/index.js +1 -1
  344. package/dist/deploy/netlify.js +1 -1
  345. package/dist/dev-server/crosswind.js +1 -1
  346. package/dist/dev-server/index.js +1 -1
  347. package/dist/dev-server/keyboard-shortcuts.js +1 -1
  348. package/dist/dev-server/native-window.js +1 -1
  349. package/dist/dev-server/port-utils.js +1 -1
  350. package/dist/dev-server/serve-app.js +6 -1
  351. package/dist/dev-server/serve-file.js +6 -1
  352. package/dist/dev-server/serve-markdown.js +1 -1
  353. package/dist/dev-server/serve-multi.js +171 -1
  354. package/dist/dev-server/terminal-colors.js +1 -1
  355. package/dist/dev-server/theme-selector.js +1 -1
  356. package/dist/dev-server/types.js +1 -1
  357. package/dist/dev-server.js +1 -1
  358. package/dist/devtools.js +1 -1
  359. package/dist/directive-api.js +1 -1
  360. package/dist/docs.js +1 -1
  361. package/dist/doctor.js +1 -1
  362. package/dist/document-shell.js +1 -1
  363. package/dist/dynamic-components.js +1 -1
  364. package/dist/edge-runtime.js +1 -1
  365. package/dist/env.js +1 -1
  366. package/dist/error-boundaries.js +1 -1
  367. package/dist/error-handling.js +1 -1
  368. package/dist/errors/codes.js +1 -1
  369. package/dist/errors/formatter.js +1 -1
  370. package/dist/errors/index.js +1 -1
  371. package/dist/errors/logger.js +1 -1
  372. package/dist/errors/sanitizer.js +1 -1
  373. package/dist/errors/types.js +1 -1
  374. package/dist/events.js +1 -1
  375. package/dist/expressions.js +1 -1
  376. package/dist/formatter.js +1 -1
  377. package/dist/forms-validation.js +1 -1
  378. package/dist/forms.js +1 -1
  379. package/dist/head.js +1 -1
  380. package/dist/heatmap.js +1 -1
  381. package/dist/hot-reload.js +1 -1
  382. package/dist/html-masking.js +1 -1
  383. package/dist/hydration-runtime.js +1 -1
  384. package/dist/hydration.js +1 -1
  385. package/dist/i18n.js +1 -1
  386. package/dist/image-optimization/auto-sibling.js +1 -1
  387. package/dist/image-optimization/build-plugin.js +1 -1
  388. package/dist/image-optimization/component.js +1 -1
  389. package/dist/image-optimization/directive.js +1 -1
  390. package/dist/image-optimization/index.js +1 -1
  391. package/dist/image-optimization/processor.js +1 -1
  392. package/dist/image-optimization/serve.js +1 -1
  393. package/dist/includes.js +1 -1
  394. package/dist/index.js +1 -1
  395. package/dist/init.js +1 -1
  396. package/dist/inline-assets.js +1 -1
  397. package/dist/interactive.js +1 -1
  398. package/dist/internal-markdown.js +1 -1
  399. package/dist/island-chunking.js +1 -1
  400. package/dist/js-ts.js +1 -1
  401. package/dist/jsx-runtime.js +1 -1
  402. package/dist/keep-alive.js +1 -1
  403. package/dist/lazy-loader.js +1 -1
  404. package/dist/loading-indicator.js +1 -1
  405. package/dist/loops.js +1 -1
  406. package/dist/manifest.js +1 -1
  407. package/dist/markdown.js +1 -1
  408. package/dist/media/client/blur-up.js +1 -1
  409. package/dist/media/client/index.js +1 -1
  410. package/dist/media/client/lazy-load.js +1 -1
  411. package/dist/media/client/upload-handler.js +1 -1
  412. package/dist/media/image/component.js +1 -1
  413. package/dist/media/image/directive.js +1 -1
  414. package/dist/media/image/editing.js +1 -1
  415. package/dist/media/image/index.js +1 -1
  416. package/dist/media/image/placeholder.js +1 -1
  417. package/dist/media/image/processor/cache.js +1 -1
  418. package/dist/media/image/processor/index.js +1 -1
  419. package/dist/media/image/processor/optimizer.js +1 -1
  420. package/dist/media/image/processor/responsive.js +1 -1
  421. package/dist/media/image/srcset.js +1 -1
  422. package/dist/media/index.js +1 -1
  423. package/dist/media/manager/embed.js +1 -1
  424. package/dist/media/protected/component.js +1 -1
  425. package/dist/media/protected/index.js +1 -1
  426. package/dist/media/protected/signature.js +1 -1
  427. package/dist/media/shared/cache.js +1 -1
  428. package/dist/media/shared/hash.js +1 -1
  429. package/dist/media/shared/index.js +1 -1
  430. package/dist/media/upload/component.js +1 -1
  431. package/dist/media/upload/index.js +1 -1
  432. package/dist/media/video/directive.js +1 -1
  433. package/dist/media/video/index.js +1 -1
  434. package/dist/media/video/processor/cache.js +1 -1
  435. package/dist/media/video/processor/index.js +1 -1
  436. package/dist/media/video/processor/streaming.js +1 -1
  437. package/dist/media/video/processor/thumbnail.js +1 -1
  438. package/dist/media/video/processor/transcoder.js +1 -1
  439. package/dist/method-spoofing.js +1 -1
  440. package/dist/middleware.js +1 -1
  441. package/dist/misc-directives.js +1 -1
  442. package/dist/native-build.js +1 -1
  443. package/dist/parser/directive-parser.js +1 -1
  444. package/dist/parser/expression-parser.js +1 -1
  445. package/dist/parser/index.js +1 -1
  446. package/dist/parser/tokenizer.js +1 -1
  447. package/dist/partial-hydration.js +1 -1
  448. package/dist/performance-utils.js +1 -1
  449. package/dist/placeholder.js +1 -1
  450. package/dist/plugin-system.js +1 -1
  451. package/dist/plugin.js +1 -1
  452. package/dist/precompiler.js +1 -1
  453. package/dist/process.js +1 -1
  454. package/dist/production-build.js +1 -1
  455. package/dist/production-builder.js +1 -1
  456. package/dist/production-server.js +1 -1
  457. package/dist/props.js +1 -1
  458. package/dist/public-env.js +1 -1
  459. package/dist/pwa/audit.js +1 -1
  460. package/dist/pwa/directives.js +1 -1
  461. package/dist/pwa/icons.js +1 -1
  462. package/dist/pwa/index.js +1 -1
  463. package/dist/pwa/inject.js +1 -1
  464. package/dist/pwa/manifest.js +1 -1
  465. package/dist/pwa/offline.js +1 -1
  466. package/dist/pwa/precache.js +1 -1
  467. package/dist/pwa/service-worker.js +1 -1
  468. package/dist/pwa/workbox-strategies.js +1 -1
  469. package/dist/pwa/workbox.js +1 -1
  470. package/dist/pwa.js +426 -426
  471. package/dist/reactive-bindings.js +1 -1
  472. package/dist/reactive.js +1 -1
  473. package/dist/reactivity.js +1 -1
  474. package/dist/release.js +1 -1
  475. package/dist/render.js +1 -1
  476. package/dist/route-middleware.js +1 -1
  477. package/dist/router.js +1 -1
  478. package/dist/routes.js +1 -1
  479. package/dist/runtime-injection.js +1 -1
  480. package/dist/runtime.js +1 -1
  481. package/dist/safe-evaluator.js +1 -1
  482. package/dist/scaffolding.js +1 -1
  483. package/dist/screenshot.js +1 -1
  484. package/dist/script-classifier.js +1 -1
  485. package/dist/script-validation.js +1 -1
  486. package/dist/seo.js +1 -1
  487. package/dist/serve.js +1 -1
  488. package/dist/server-bindings.js +1 -1
  489. package/dist/server-components.js +1 -1
  490. package/dist/signal-processing.js +1 -1
  491. package/dist/signals-api.js +1 -1
  492. package/dist/signals.js +1 -1
  493. package/dist/site-builder/build.js +1 -1
  494. package/dist/site-builder/i18n.js +1 -1
  495. package/dist/site-builder/index.js +1 -1
  496. package/dist/site-builder/robots.js +1 -1
  497. package/dist/site-builder/router.js +1 -1
  498. package/dist/site-builder/seo.js +1 -1
  499. package/dist/site-builder/sitemap.js +1 -1
  500. package/dist/site-builder/theme.js +1 -1
  501. package/dist/slots.js +1 -1
  502. package/dist/source-maps.js +1 -1
  503. package/dist/spa-shell.js +1 -1
  504. package/dist/ssg.js +388 -388
  505. package/dist/ssr.js +1 -1
  506. package/dist/state-management.js +1 -1
  507. package/dist/store-imports.js +1 -1
  508. package/dist/store-loader.js +1 -1
  509. package/dist/stores-client.js +1 -1
  510. package/dist/story/addons.js +1 -1
  511. package/dist/story/analytics.js +1 -1
  512. package/dist/story/auto-stories.js +1 -1
  513. package/dist/story/bookmarks.js +1 -1
  514. package/dist/story/bun-test.js +1 -1
  515. package/dist/story/cli.js +1 -1
  516. package/dist/story/collect/analyzer.js +1 -1
  517. package/dist/story/collect/index.js +1 -1
  518. package/dist/story/collect/parser.js +1 -1
  519. package/dist/story/collect/scanner.js +1 -1
  520. package/dist/story/collect/tree.js +1 -1
  521. package/dist/story/commands/build.js +1 -1
  522. package/dist/story/commands/dev.js +1 -1
  523. package/dist/story/commands/index.js +1 -1
  524. package/dist/story/commands/preview.js +1 -1
  525. package/dist/story/compiled-output.js +1 -1
  526. package/dist/story/composition.js +1 -1
  527. package/dist/story/config-watcher.js +1 -1
  528. package/dist/story/config.js +1 -1
  529. package/dist/story/context.js +1 -1
  530. package/dist/story/controls/index.js +1 -1
  531. package/dist/story/crosswind.js +1 -1
  532. package/dist/story/desktop-preview.js +1 -1
  533. package/dist/story/docs-generator.js +1 -1
  534. package/dist/story/errors.js +1 -1
  535. package/dist/story/figma-export.js +1 -1
  536. package/dist/story/generator.js +1 -1
  537. package/dist/story/hmr.js +1 -1
  538. package/dist/story/hot-swap.js +1 -1
  539. package/dist/story/index.js +1 -1
  540. package/dist/story/interactions.js +1 -1
  541. package/dist/story/keyboard-shortcuts.js +1 -1
  542. package/dist/story/output.js +1 -1
  543. package/dist/story/performance.js +1 -1
  544. package/dist/story/presets.js +1 -1
  545. package/dist/story/props-validation.js +1 -1
  546. package/dist/story/renderer.js +1 -1
  547. package/dist/story/search-index.js +1 -1
  548. package/dist/story/search.js +1 -1
  549. package/dist/story/server.js +1 -1
  550. package/dist/story/setup.js +1 -1
  551. package/dist/story/snapshots.js +1 -1
  552. package/dist/story/testing.js +1 -1
  553. package/dist/story/theme.js +1 -1
  554. package/dist/story/ui/code-panel.js +1 -1
  555. package/dist/story/ui/controls-panel.js +1 -1
  556. package/dist/story/ui/index.js +1 -1
  557. package/dist/story/ui/navigation.js +1 -1
  558. package/dist/story/ui/preview.js +1 -1
  559. package/dist/story/visual-testing.js +1 -1
  560. package/dist/streaming.js +1 -1
  561. package/dist/strict-lint.js +1 -1
  562. package/dist/style-scoping.js +1 -1
  563. package/dist/suspense.js +1 -1
  564. package/dist/teleport.js +1 -1
  565. package/dist/template-compiler.js +1 -1
  566. package/dist/template-hydrator.js +1 -1
  567. package/dist/template-tag-balance.js +1 -1
  568. package/dist/testing.js +1 -1
  569. package/dist/transitions.js +1 -1
  570. package/dist/type-checker.js +1 -1
  571. package/dist/types/directive-types.js +1 -1
  572. package/dist/types/index.js +1 -1
  573. package/dist/types.js +1 -1
  574. package/dist/typescript-templates.js +1 -1
  575. package/dist/utils.js +1 -1
  576. package/dist/validator.js +1 -1
  577. package/dist/variable-extractor.js +1 -1
  578. package/dist/view-composers.js +1 -1
  579. package/dist/virtual-scrolling.js +1 -1
  580. package/dist/visual-editor.js +1 -1
  581. package/dist/vue-template.js +1 -1
  582. package/dist/web-components/css-scoping.js +1 -1
  583. package/dist/web-components/index.js +1 -1
  584. package/dist/web-components/reactive-generator.js +418 -1
  585. package/dist/web-components.js +1 -1
  586. package/dist/x-element.js +1 -1
  587. package/package.json +8 -7
  588. package/dist/chunk-0fmsckh1.js +0 -420
  589. package/dist/chunk-2t4gywvz.js +0 -3
  590. package/dist/chunk-2yw4e0h0.js +0 -3
  591. package/dist/chunk-32ka7sdc.js +0 -1
  592. package/dist/chunk-36jjen8k.js +0 -3
  593. package/dist/chunk-37q6x951.js +0 -3
  594. package/dist/chunk-3c7q2vbq.js +0 -3
  595. package/dist/chunk-3tk0sr6m.js +0 -3
  596. package/dist/chunk-5kjk30re.js +0 -3
  597. package/dist/chunk-6x5p7rhz.js +0 -3
  598. package/dist/chunk-73x9a59t.js +0 -3
  599. package/dist/chunk-9a7ce9v1.js +0 -3
  600. package/dist/chunk-9njgv29x.js +0 -3
  601. package/dist/chunk-9zkb2dsx.js +0 -3
  602. package/dist/chunk-bs7qttx8.js +0 -3
  603. package/dist/chunk-bxp8ps0f.js +0 -5
  604. package/dist/chunk-cnchhkk2.js +0 -3
  605. package/dist/chunk-cwjdwzn3.js +0 -3
  606. package/dist/chunk-d3at6tp3.js +0 -1
  607. package/dist/chunk-egn85zmj.js +0 -3
  608. package/dist/chunk-fcrwjh47.js +0 -3
  609. package/dist/chunk-ftq6q3nx.js +0 -3
  610. package/dist/chunk-fxfmwbny.js +0 -3
  611. package/dist/chunk-gfsk93gv.js +0 -246
  612. package/dist/chunk-h4k5wnbf.js +0 -3
  613. package/dist/chunk-kde1c2d4.js +0 -3
  614. package/dist/chunk-mf35r5h2.js +0 -3
  615. package/dist/chunk-mz4petzg.js +0 -3
  616. package/dist/chunk-qpg9jdqb.js +0 -3
  617. package/dist/chunk-r5rx348z.js +0 -3
  618. package/dist/chunk-rs2ejj8f.js +0 -3
  619. package/dist/chunk-s7fg0jy2.js +0 -3
  620. package/dist/chunk-s9hpp0gd.js +0 -3
  621. package/dist/chunk-sajzecge.js +0 -3
  622. package/dist/chunk-sfp05afy.js +0 -3
  623. package/dist/chunk-srq3dkj8.js +0 -3
  624. package/dist/chunk-sydw4nm4.js +0 -3
  625. package/dist/chunk-t6z4b0x6.js +0 -3
  626. package/dist/chunk-wh2szb9t.js +0 -3
  627. package/dist/chunk-xqq1vxb6.js +0 -1
  628. package/dist/chunk-xzjrrd36.js +0 -1
  629. package/dist/chunk-zx35qm5v.js +0 -3
@@ -3,4 +3,4 @@ import{existsSync as _,readFileSync as $}from"fs";var A={strict:!1,allowAny:!0,c
3
3
  `),H=this.getLineNumber(j);for(let B=0;B<q.length;B++){let D=q[B],G=H+B;this.extractTypedVariables(D,G),this.extractInterfaces(D,q,B,G),this.extractTypeAliases(D,G)}}extractTypedVariables(z,j){let q=z.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*:\s*([^=]+?)\s*=/);if(q){let[,D,G]=q,J=this.parseTypeAnnotation(G.trim());this.variables.set(D,J);return}let H=z.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=\s*(.+)/);if(H){let[,D,G]=H,J=this.inferType(G.trim());this.variables.set(D,J);return}let B=z.match(/(?:export\s+)?function\s+(\w+)\s*\(([^)]*)\)(?:\s*:\s*(\w+))?/);if(B){let[,D,G,J]=B,K=this.parseParams(G),Q=J?this.parseTypeAnnotation(J):{kind:"primitive",value:"any"};this.variables.set(D,{kind:"function",params:K,returnType:Q})}}extractInterfaces(z,j,q,H){let B=z.match(/(?:export\s+)?interface\s+(\w+)\s*\{/);if(B){let[,D]=B,G={},J=1,K=q+1;while(K<j.length&&J>0){let Q=j[K].trim();if(Q.includes("{"))J++;if(Q.includes("}"))J--;let U=Q.match(/(\w+)\??\s*:\s*([^;]+)/);if(U&&J>0){let[,W,V]=U;G[W]=this.parseTypeAnnotation(V.trim())}K++}this.variables.set(D,{kind:"object",name:D,properties:G})}}extractTypeAliases(z,j){let q=z.match(/(?:export\s+)?type\s+(\w+)\s*=\s*(.+)/);if(q){let[,H,B]=q,D=this.parseTypeAnnotation(B.trim());D.name=H,this.variables.set(H,D)}}parseTypeAnnotation(z){let j=z.trim();if(j.includes("|"))return{kind:"union",types:j.split("|").map((D)=>this.parseTypeAnnotation(D.trim()))};if(j.includes("&"))return{kind:"intersection",types:j.split("&").map((D)=>this.parseTypeAnnotation(D.trim()))};if(j.endsWith("[]"))return{kind:"array",elementType:this.parseTypeAnnotation(j.slice(0,-2))};let q=j.match(/^Array<(.+)>$/);if(q)return{kind:"array",elementType:this.parseTypeAnnotation(q[1])};if(j.startsWith("{")&&j.endsWith("}")){let B={},D=j.slice(1,-1).trim();if(D){let G=this.splitByComma(D);for(let J of G){let K=J.match(/(\w+)\??\s*:\s*(.+)/);if(K){let[,Q,U]=K;B[Q]=this.parseTypeAnnotation(U.trim())}}}return{kind:"object",properties:B}}if(j.startsWith('"')||j.startsWith("'"))return{kind:"literal",value:j.slice(1,-1)};if(/^\d+$/.test(j))return{kind:"literal",value:j};if(j==="true"||j==="false")return{kind:"literal",value:j};if(["string","number","boolean","null","undefined","any","unknown","void","never"].includes(j))return{kind:"primitive",value:j};if(this.variables.has(j))return this.variables.get(j);return{kind:"primitive",value:"any"}}inferType(z){let j=z.trim().replace(/;$/,"");if(j.startsWith('"')&&j.endsWith('"')||j.startsWith("'")&&j.endsWith("'")||j.startsWith("`")&&j.endsWith("`"))return{kind:"primitive",value:"string"};if(/^-?\d+(\.\d+)?$/.test(j))return{kind:"primitive",value:"number"};if(j==="true"||j==="false")return{kind:"primitive",value:"boolean"};if(j==="null")return{kind:"primitive",value:"null"};if(j==="undefined")return{kind:"primitive",value:"undefined"};if(j.startsWith("[")){let q=j.slice(1,-1).trim();if(q){let H=this.splitByComma(q)[0];if(H)return{kind:"array",elementType:this.inferType(H.trim())}}return{kind:"array",elementType:{kind:"primitive",value:"any"}}}if(j.startsWith("{")){let q={},H=this.extractObjectLiteral(j);for(let[B,D]of Object.entries(H))q[B]=this.inferType(D);return{kind:"object",properties:q}}if(j.includes("=>")){let q=j.match(/^\(([^)]*)\)\s*(?::\s*(\w+))?\s*=>/);if(q){let H=this.parseParams(q[1]),B=q[2]?this.parseTypeAnnotation(q[2]):{kind:"primitive",value:"any"};return{kind:"function",params:H,returnType:B}}}if(/^\w+$/.test(j)&&this.variables.has(j))return this.variables.get(j);if(j.includes("."))return this.resolvePropertyAccess(j);if(j.includes("(")){let q=j.split("(")[0],H=this.variables.get(q);if(H?.kind==="function"&&H.returnType)return H.returnType}return{kind:"primitive",value:"any"}}parseParams(z){if(!z.trim())return[];let j=[],q=this.splitByComma(z);for(let H of q){let B=H.trim(),D=B.includes("?"),G=B.match(/(\w+)\??\s*(?::\s*([^=]+))?(?:\s*=)?/);if(G){let[,J,K]=G,Q=K?this.parseTypeAnnotation(K.trim()):{kind:"primitive",value:"any"};j.push({name:J,type:Q,optional:D})}}return j}checkExpressions(z){let j=/\{\{([\s\S]*?)\}\}/g,q;while((q=j.exec(z))!==null){let B=q[1].trim(),D=q.index,G=this.getLineNumber(D,z),J=this.getColumn(D,z);if(!B)continue;if(B.startsWith("!")||B.endsWith("!"))continue;this.checkExpression(B,G,J)}let H=/\{!!([\s\S]*?)!!\}/g;while((q=H.exec(z))!==null){let B=q[1].trim(),D=q.index,G=this.getLineNumber(D,z),J=this.getColumn(D,z);if(!B)continue;this.checkExpression(B,G,J)}}checkExpression(z,j,q){if(z.includes("?")&&z.includes(":")){let D=z.split("?");this.checkExpression(D[0].trim(),j,q);let G=D.slice(1).join("?").split(":");if(G.length>=2)this.checkExpression(G[0].trim(),j,q),this.checkExpression(G.slice(1).join(":").trim(),j,q);return}for(let D of["&&","||","??"])if(z.includes(D)){z.split(D).forEach((J)=>this.checkExpression(J.trim(),j,q));return}for(let D of["===","!==","==","!=",">=","<=",">","<"])if(z.includes(D)){z.split(D).forEach((J)=>this.checkExpression(J.trim(),j,q));return}if(z.startsWith("!")){this.checkExpression(z.slice(1).trim(),j,q);return}if(this.isLiteral(z))return;let H=z.match(/^(\w+(?:\.\w+)*)\s*\(/);if(H){let D=H[1],G=this.resolvePropertyAccess(D);if(G.kind!=="function"&&G.value!=="any")this.addWarning(`'${D}' is not a function`,j,q,z);return}if(z.includes(".")){if(this.resolvePropertyAccess(z).value==="undefined"&&this.options.checkPropertyAccess)this.addWarning(`Property access '${z}' may be undefined`,j,q,z);return}let B=z.match(/^\w+/)?.[0];if(B&&!this.variables.has(B))this.addError(`Variable '${B}' is not defined`,j,q,z)}checkDirectives(z){let j=/@if\s*\(([^)]+)\)/g,q;while((q=j.exec(z))!==null){let G=q[1].trim(),J=q.index,K=this.getLineNumber(J,z),Q=this.getColumn(J,z);this.checkExpression(G,K,Q)}let H=/@foreach\s*\((\w+)\s+(?:as|in)\s+(\w+)(?:\s*,\s*(\w+))?\)/g;while((q=H.exec(z))!==null){let[,G,J,K]=q,Q=q.index,U=this.getLineNumber(Q,z),W=this.getColumn(Q,z);if(!this.variables.has(G))this.addError(`Collection '${G}' is not defined`,U,W,q[0]);else{let V=this.variables.get(G);if(V.kind==="array"&&V.elementType)this.variables.set(J,V.elementType);else this.variables.set(J,{kind:"primitive",value:"any"});if(K)this.variables.set(K,{kind:"primitive",value:"number"})}}let B=/@unless\s*\(([^)]+)\)/g;while((q=B.exec(z))!==null){let G=q[1].trim(),J=q.index,K=this.getLineNumber(J,z),Q=this.getColumn(J,z);this.checkExpression(G,K,Q)}let D=/@switch\s*\(([^)]+)\)/g;while((q=D.exec(z))!==null){let G=q[1].trim(),J=q.index,K=this.getLineNumber(J,z),Q=this.getColumn(J,z);this.checkExpression(G,K,Q)}}resolvePropertyAccess(z){let j=z.split("."),q=this.variables.get(j[0])||{kind:"primitive",value:"any"};for(let H=1;H<j.length;H++){let B=j[H].replace(/\(\)$/,"");if(q.kind==="object"&&q.properties)if(q.properties[B])q=q.properties[B];else if(!this.options.allowAny)return{kind:"primitive",value:"undefined"};else q={kind:"primitive",value:"any"};else if(q.kind==="array"&&q.elementType)if(["length"].includes(B))q={kind:"primitive",value:"number"};else if(["map","filter","find","forEach","some","every","reduce"].includes(B))q={kind:"function",returnType:{kind:"primitive",value:"any"}};else if(["join"].includes(B))q={kind:"function",returnType:{kind:"primitive",value:"string"}};else q={kind:"primitive",value:"any"};else if(q.kind==="primitive"&&q.value==="string")if(["length"].includes(B))q={kind:"primitive",value:"number"};else if(["toUpperCase","toLowerCase","trim","slice","substring"].includes(B))q={kind:"function",returnType:{kind:"primitive",value:"string"}};else if(["split"].includes(B))q={kind:"function",returnType:{kind:"array",elementType:{kind:"primitive",value:"string"}}};else q={kind:"primitive",value:"any"};else q={kind:"primitive",value:"any"}}return q}isLiteral(z){let j=z.trim();if(j.startsWith('"')&&j.endsWith('"')||j.startsWith("'")&&j.endsWith("'")||j.startsWith("`")&&j.endsWith("`"))return!0;if(/^-?\d+(\.\d+)?$/.test(j))return!0;if(j==="true"||j==="false")return!0;if(j==="null"||j==="undefined")return!0;return!1}extractObjectLiteral(z){let j={},q=z.slice(1,-1).trim();if(!q)return j;let H=this.splitByComma(q);for(let B of H){let D=B.indexOf(":");if(D>0){let G=B.slice(0,D).trim(),J=B.slice(D+1).trim();j[G]=J}}return j}splitByComma(z){let j=[],q="",H=0,B=null;for(let D=0;D<z.length;D++){let G=z[D],J=D>0?z[D-1]:"";if((G==='"'||G==="'"||G==="`")&&J!=="\\"){if(B===G)B=null;else if(!B)B=G}if(!B){if(G==="{"||G==="["||G==="(")H++;if(G==="}"||G==="]"||G===")")H--;if(G===","&&H===0){j.push(q.trim()),q="";continue}}q+=G}if(q.trim())j.push(q.trim());return j}getLineNumber(z,j){return((j||"").slice(0,z).match(/\n/g)||[]).length+1}getColumn(z,j){let H=j.slice(0,z).lastIndexOf(`
4
4
  `);return z-H}addError(z,j,q,H,B,D){this.errors.push({message:z,file:this.currentFile,line:j,column:q,expression:H,expected:B,received:D,severity:"error"})}addWarning(z,j,q,H,B,D){let G={message:z,file:this.currentFile,line:j,column:q,expression:H,expected:B,received:D,severity:"warning"};if(this.options.strict)this.errors.push(G);else this.warnings.push(G)}getResult(){return{valid:this.errors.length===0,errors:this.errors,warnings:this.warnings,variables:new Map(this.variables)}}addVariable(z,j){this.variables.set(z,j)}reset(){if(this.errors=[],this.warnings=[],this.variables.clear(),this.options.includeBuiltins)Object.entries(X).forEach(([z,j])=>{this.variables.set(z,j)})}}function Z(z){return new Y(z)}function E(z,j){return Z(j).checkFile(z)}function I(z,j){return Z(j).checkTemplate(z)}function L(z){let j=[];for(let q of z.errors){if(j.push(`\x1B[31merror\x1B[0m: ${q.message}`),j.push(` --> ${q.file}:${q.line}:${q.column}`),q.expression)j.push(" |"),j.push(` | ${q.expression}`),j.push(" |");if(q.expected&&q.received)j.push(` expected: ${q.expected}`),j.push(` received: ${q.received}`);j.push("")}for(let q of z.warnings){if(j.push(`\x1B[33mwarning\x1B[0m: ${q.message}`),j.push(` --> ${q.file}:${q.line}:${q.column}`),q.expression)j.push(" |"),j.push(` | ${q.expression}`),j.push(" |");j.push("")}if(z.valid)j.push("\x1B[32m\u2713 No type errors found\x1B[0m");else j.push(`\x1B[31m\u2717 Found ${z.errors.length} error(s) and ${z.warnings.length} warning(s)\x1B[0m`);return j.join(`
5
5
  `)}
6
- export{Y as Hf,Z as If,E as Jf,I as Kf,L as Lf};
6
+ export{Y as Af,Z as Bf,E as Cf,I as Df,L as Ef};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function D(j){return j}class F{plugins=new Map;sortedPlugins=[];initialized=!1;async register(j,q){if(this.plugins.has(j.name))throw Error(`Plugin "${j.name}" is already registered`);if(j.dependencies){for(let w of j.dependencies)if(!this.plugins.has(w))throw Error(`Plugin "${j.name}" depends on "${w}" which is not registered`)}if(this.plugins.set(j.name,j),j.onRegister)await j.onRegister(q);this.sortPlugins()}async unregister(j){let q=this.plugins.get(j);if(!q)return!1;for(let[w,z]of this.plugins)if(z.dependencies?.includes(j))throw Error(`Cannot unregister "${j}" because "${w}" depends on it`);if(q.onUnregister)await q.onUnregister();return this.plugins.delete(j),this.sortPlugins(),!0}get(j){return this.plugins.get(j)}has(j){return this.plugins.has(j)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let j=[];for(let q of this.sortedPlugins)if(q.registerDirectives)j.push(...q.registerDirectives());return j}getAllFilters(){let j={};for(let q of this.sortedPlugins)if(q.registerFilters)Object.assign(j,q.registerFilters());return j}async runBeforeProcess(j){return this.runHooks("beforeProcess",j)}async runAfterParse(j){return this.runHooks("afterParse",j)}async runBeforeDirective(j,q){return this.runDirectiveHooks("beforeDirective",j,q)}async runAfterDirective(j,q){return this.runDirectiveHooks("afterDirective",j,q)}async runBeforeRender(j){return this.runHooks("beforeRender",j)}async runAfterRender(j){return this.runHooks("afterRender",j)}async runOnError(j){for(let q of this.sortedPlugins)if(q.onError)try{let w=await q.onError(j);if(w){if(w.template!==void 0)j.template=w.template;if(w.context)j.context={...j.context,...w.context};if(w.metadata)j.metadata={...j.metadata,...w.metadata};if(w.skip)return j}}catch(w){console.error(`Error in plugin "${q.name}" onError hook:`,w)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((j,q)=>(j.priority??100)-(q.priority??100))}async runHooks(j,q){let w={...q};for(let z of this.sortedPlugins){let B=z[j];if(B)try{let y=await B(w);if(y){if(y.template!==void 0)w.template=y.template;if(y.context)w.context={...w.context,...y.context};if(y.metadata)w.metadata={...w.metadata,...y.metadata};if(y.skip)break}}catch(y){console.error(`Error in plugin "${z.name}" ${j} hook:`,y)}}return w}async runDirectiveHooks(j,q,w){let z={...w};for(let B of this.sortedPlugins){let y=B[j];if(y)try{let A=await y(q,z);if(A){if(A.template!==void 0)z.template=A.template;if(A.context)z.context={...z.context,...A.context};if(A.metadata)z.metadata={...z.metadata,...A.metadata};if(A.skip)break}}catch(A){console.error(`Error in plugin "${B.name}" ${j} hook:`,A)}}return z}}var G=new F;function H(j,q,w={}){return{name:j,...w,registerDirectives:()=>q}}function I(j,q,w={}){return{name:j,...w,registerFilters:()=>q}}var J=D({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(j){console.log("[stx-debug] beforeProcess:",j.filePath)},afterParse(j){console.log("[stx-debug] afterParse:",j.template.length,"chars")},beforeDirective(j,q){console.log("[stx-debug] beforeDirective:",j)},afterDirective(j,q){console.log("[stx-debug] afterDirective:",j)},beforeRender(j){console.log("[stx-debug] beforeRender")},afterRender(j){console.log("[stx-debug] afterRender:",j.template.length,"chars")},onError(j){console.error("[stx-debug] onError:",j.error.message,"in phase:",j.phase)}}),K=D({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(j){j.metadata.startTime=performance.now()},afterRender(j){let q=j.metadata.startTime;if(q){let w=performance.now()-q;console.log(`[stx-timing] Processing took ${w.toFixed(2)}ms`)}}});function L(j){return D({name:"stx-variables",version:"1.0.0",description:"Adds predefined variables to template context",beforeProcess(q){return{context:{...q.context,...j}}}})}
3
- export{D as rj,F as sj,G as tj,H as uj,I as vj,J as wj,K as xj,L as yj};
3
+ export{D as lj,F as mj,G as nj,H as oj,I as pj,J as qj,K as rj,L as sj};
@@ -2,4 +2,4 @@
2
2
  class J{source;pos=0;line=1;column=0;tokens=[];constructor(b){this.source=b}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let b=this.nextToken();if(b)this.tokens.push(b)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let b=this.pos,w=this.line,j=this.column,v=this.source[this.pos];if(/\s/.test(v))return this.readWhitespace(b,w,j);if(v==="/"&&this.peek(1)==="/")return this.readLineComment(b,w,j);if(v==="/"&&this.peek(1)==="*")return this.readBlockComment(b,w,j);if(v==='"'||v==="'")return this.readString(v,b,w,j);if(v==="`")return this.readTemplateString(b,w,j);if(/\d/.test(v)||v==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(b,w,j);if(/[a-z_$]/i.test(v))return this.readIdentifier(b,w,j);if(v==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:b,end:this.pos,line:w,column:j}}if(v==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:b,end:this.pos,line:w,column:j}}if(v==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:b,end:this.pos,line:w,column:j};if(v==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(b,w,j);let z=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let B of z)if(this.source.slice(this.pos,this.pos+B.length)===B)return this.advance(B.length),{type:"OPERATOR",value:B,start:b,end:this.pos,line:w,column:j};if(/[+\-*/%<>=!&|^~?:]/.test(v))return this.advance(),{type:"OPERATOR",value:v,start:b,end:this.pos,line:w,column:j};if(/[()[\]{},;.]/.test(v))return this.advance(),{type:"PUNCTUATION",value:v,start:b,end:this.pos,line:w,column:j};return this.advance(),{type:"PUNCTUATION",value:v,start:b,end:this.pos,line:w,column:j}}readWhitespace(b,w,j){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readLineComment(b,w,j){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3
3
  `)this.advance();return{type:"COMMENT",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readBlockComment(b,w,j){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readString(b,w,j,v){this.advance();while(this.pos<this.source.length){let z=this.source[this.pos];if(z==="\\"){this.advance(2);continue}if(z===b){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(w,this.pos),start:w,end:this.pos,line:j,column:v}}readTemplateString(b,w,j){this.advance();let v=0,z=256;while(this.pos<this.source.length){let B=this.source[this.pos];if(B==="\\"){this.advance(2);continue}if(B==="$"&&this.peek(1)==="{"){if(v>=z){this.pos=this.source.length;break}this.advance(2),v++;continue}if(B==="{"&&v>0){v++,this.advance();continue}if(B==="}"&&v>0){v--,this.advance();continue}if(B==="`"&&v===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readNumber(b,w,j){if(this.source[this.pos]==="0"){let v=this.peek(1)?.toLowerCase();if(v==="x"||v==="o"||v==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readIdentifier(b,w,j){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readDirective(b,w,j){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}advance(b=1){for(let w=0;w<b&&this.pos<this.source.length;w++){if(this.source[this.pos]===`
4
4
  `)this.line++,this.column=0;else this.column++;this.pos++}}peek(b){return this.source[this.pos+b]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(b){this.pos=b.pos,this.line=b.line,this.column=b.column}}function K(b,w,j,v=0){let z=0,B=v,y=null,D=0,H=!1;while(B<b.length){let F=b[B];if(y&&H){H=!1,B++;continue}if(y&&F==="\\"){H=!0,B++;continue}if(H=!1,(F==='"'||F==="'"||F==="`")&&!y){y=F,B++;continue}if(F===y&&y!=="`"){y=null,B++;continue}if(y==="`"&&F==="$"&&b[B+1]==="{"){D++,B+=2;continue}if(D>0&&F==="}"){D--,B++;continue}if(F==="`"&&y==="`"&&D===0){y=null,B++;continue}if(y){B++;continue}if(F===w)z++;else if(F===j){if(z--,z===0)return B}B++}return-1}function O(b,w){let j=w,v={paren:0,bracket:0,brace:0},z=null,B=0;while(j<b.length){let y=b[j];if((j>0?b[j-1]:"")==="\\"&&z){j++;continue}if((y==='"'||y==="'")&&!z){z=y,j++;continue}if(y===z&&z!=="`"){z=null,j++;continue}if(y==="`"&&!z){z="`",j++;continue}if(y==="`"&&z==="`"&&B===0){z=null,j++;continue}if(z==="`"&&y==="$"&&b[j+1]==="{"){B++,j+=2;continue}if(B>0){if(y==="{")B++;else if(y==="}")B--;j++;continue}if(z){j++;continue}if(v.paren===0&&v.bracket===0&&v.brace===0){if(b.slice(j,j+2)==="}}"||b.slice(j,j+3)==="!!}")break;if(y===","||y===";")break}if(y==="(")v.paren++;else if(y===")"){if(v.paren--,v.paren<0)break}else if(y==="[")v.bracket++;else if(y==="]"){if(v.bracket--,v.bracket<0)break}else if(y==="{")v.brace++;else if(y==="}"){if(v.brace--,v.brace<0)break}j++}return{expression:b.slice(w,j),endPos:j}}function Q(b){let w=[],j="",v={paren:0,bracket:0,brace:0},z=null,B=0;for(let y=0;y<b.length;y++){let D=b[y];if((y>0?b[y-1]:"")==="\\"&&z){j+=D;continue}if((D==='"'||D==="'")&&!z){z=D,j+=D;continue}if(D===z&&z!=="`"){z=null,j+=D;continue}if(D==="`"&&!z){z="`",j+=D;continue}if(D==="`"&&z==="`"&&B===0){z=null,j+=D;continue}if(z==="`"&&D==="$"&&b[y+1]==="{"){B++,j+=D+b[y+1],y++;continue}if(B>0&&D==="{"){B++,j+=D;continue}if(B>0&&D==="}"){B--,j+=D;continue}if(z){j+=D;continue}if(D==="(")v.paren++;else if(D===")")v.paren--;else if(D==="[")v.bracket++;else if(D==="]")v.bracket--;else if(D==="{")v.brace++;else if(D==="}")v.brace--;if(D==="|"&&b[y+1]!=="|"&&(y===0||b[y-1]!=="|")&&b[y-1]!=="\\"&&v.paren===0&&v.bracket===0&&v.brace===0){w.push(j.trim()),j="";continue}if(D==="|"&&b[y-1]==="\\"&&!z){j=j.slice(0,-1)+D;continue}j+=D}if(j.trim())w.push(j.trim());return w}
5
- export{J as _A,K as $A,O as aB,Q as bB};
5
+ export{J as gy,K as hy,O as iy,Q as jy};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import y from"net";async function z(j){return new Promise((q)=>{let k=y.createServer();k.once("error",()=>q(!1)),k.once("listening",()=>{k.close(()=>q(!0))}),k.listen(j,"0.0.0.0")})}async function B(j){return new Promise((q)=>{let k=y.createServer();k.once("error",()=>q(!1)),k.once("listening",()=>{k.close(()=>q(!0))}),k.listen(j,"::")})}async function C(j){if(!await z(j))return!1;return await B(j)}async function D(j,q=20){j=Number(j);for(let k=0;k<q;k++){let u=j+k;if(await C(u))return u}throw Error(`Could not find an available port between ${j} and ${j+q-1}`)}var H=3000;async function J(j){let q=j.end-j.start+1;return D(j.start,q)}
3
- export{C as lo,D as mo,H as no,J as oo};
3
+ export{C as jo,D as ko,H as lo,J as mo};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ export{g as Vx};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function u(b,...x){for(let j of x){if(b.serverDynamic[j]!==void 0)return String(b.serverDynamic[j]);let q=b.static[j];if(typeof q==="string")return q}return}var E={name:"TransitionGroup",aliases:["transition-group"],render(b,x,j){let q=(u(b,"name")||"v").replace(/["'<>]/g,""),z=(u(b,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",A=u(b,"class"),B=u(b,"id"),D=[`data-stx-transition-group="${q}"`,A?`class="${A}"`:"",B?`id="${B}"`:""].filter(Boolean).join(" ");return`<${z} ${D}>${x}</${z}>`}};
3
- export{E as XB};
3
+ export{E as dz};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import G from"path";var L=new Set([".jpg",".jpeg",".png",".gif"]),O=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function M(j,z){let H=z.formats??O;if(!z.publicDir)return j;let C=N(j),J=[],Y=/<img\b[^>]*?>/gi,K=[],Q;while((Q=Y.exec(j))!==null){let q=Q[0],y=q.match(/\bsrc=["']([^"']+)["']/i);if(!y)continue;if(_(Q.index,C))continue;K.push({idx:Q.index,length:q.length,src:y[1],raw:q})}if(K.length===0)return j;let Z=await Promise.all(K.map(async(q)=>{let y=await X(q.src,z.publicDir,H);return{match:q,sources:y}}));for(let{match:q,sources:y}of Z){if(y.length===0)continue;let I=`<picture>${y.map(($)=>`<source type="${$.mime}" srcset="${w($.url)}">`).join("")}${q.raw}</picture>`;J.push({start:q.idx,end:q.idx+q.length,replacement:I})}if(J.length===0)return j;let V="",W=0;for(let q of J)V+=j.slice(W,q.start),V+=q.replacement,W=q.end;return V+=j.slice(W),V}async function X(j,z,H){if(!F(j))return[];let C=G.extname(j).toLowerCase();if(!L.has(C))return[];if(!j.startsWith("/"))return[];let J=G.join(z,j.slice(1)),Y=G.dirname(J),K=G.basename(J,C),Q=G.resolve(Y),Z=G.resolve(z);if(!Q.startsWith(Z))return[];let V=G.posix.dirname(j),W=H.map(async(y)=>{let k=G.join(Y,`${K}${y.ext}`);if(!await Bun.file(k).exists())return null;return{url:G.posix.join(V,`${K}${y.ext}`),mime:y.mime}});return(await Promise.all(W)).filter((y)=>y!==null)}function F(j){if(!j)return!1;if(j.startsWith("http://")||j.startsWith("https://"))return!1;if(j.startsWith("//"))return!1;if(j.startsWith("data:"))return!1;return!0}function N(j){let z=[],H=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,C;while((C=H.exec(j))!==null)z.push([C.index,C.index+C[0].length]);return z}function _(j,z){for(let[H,C]of z)if(j>=H&&j<C)return!0;return!1}function w(j){return j.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
- export{M as Gm};
3
+ export{M as Am};
@@ -11,4 +11,4 @@ ${z}
11
11
  </head>`);return q+j;case"body-start":if(j.includes("<body"))return j.replace(/(<body[^>]*>)/,`$1
12
12
  ${q}`);return q+j;case"body-end":{let F=j.lastIndexOf("</body>");if(F!==-1)return j.slice(0,F)+q+`
13
13
  `+j.slice(F);return j+q}default:return j}}function A(j){return j.trim()}
14
- export{w as gw,K as hw,W as iw,B as jw,A as kw};
14
+ export{w as nt,K as ot,W as pt,B as qt,A as rt};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Vy as s,Yy as a,Zy as i}from"./chunk-9fj7hpwa.js";import{$A as I}from"./chunk-xmjedbkt.js";import{NB as c}from"./chunk-h6s1thg6.js";import{jC as v}from"./chunk-p5j0686t.js";import{jE as f}from"./chunk-6r70w54p.js";import k from"path";import y from"process";function NQ(H){let Q=[],Z=0,z=H.split(`
2
+ import{aw as s,dw as a,ew as i}from"./chunk-bykjk6vj.js";import{hy as I}from"./chunk-mrehzhxv.js";import{Vy as c}from"./chunk-q60knhjf.js";import{rz as v}from"./chunk-adqh2m9z.js";import{rB as f}from"./chunk-3jm3snz8.js";import k from"path";import y from"process";function NQ(H){let Q=[],Z=0,z=H.split(`
3
3
  `);for(let X of z){let Y=Z,$=null,_=!1;for(let J=0;J<X.length;J++){let G=X[J];if(_){_=!1;continue}if(G==="\\"){_=!0;continue}if($){if(G===$)$=null;continue}if(G==="'"||G==='"'||G==="`"){$=G;continue}if(G==="/"&&J+1<X.length&&X[J+1]==="/")break;if(G==="{")Z++;else if(G==="}")Z--}if(Y===0){let J=X.match(/(?:const|let|var)\s+(\w+)\s*=/);if(J)Q.push(J[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(X)){let G=X.match(/(?:const|let|var)\s+(\w+)/);if(G)Q.push(G[1])}else{let G=X.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(G){let B=G[1].slice(1,-1).split(",").map((R)=>{let F=R.split(":");return(F.length>1?F[1]:F[0]).trim()}).filter((R)=>/^\w+$/.test(R));Q.push(...B)}}}}return[...new Set(Q)]}function EQ(H){let Q=H;Q=Q.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Q=Q.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Q=Q.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Q=Q.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Q=Q.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function Z(z){if(!z.includes(":"))return z;let X=[],Y="",$=0,_=0,J=null;for(let G=0;G<z.length;G++){let W=z[G];if(J){if(Y+=W,W===J)J=null;continue}if(W==='"'||W==="'"||W==="`"){J=W,Y+=W;continue}if(W==="<")$++;else if(W===">"&&$>0)$--;else if(W==="(")_++;else if(W===")")_--;if(W===","&&$===0&&_===0){X.push(Y),Y="";continue}Y+=W}if(Y)X.push(Y);return X.map((G)=>{let W=G.trim(),B=W.startsWith("..."),R=B?W.slice(3):W,F=-1,q=0;for(let N=0;N<R.length;N++)if(R[N]==="<")q++;else if(R[N]===">")q--;else if(R[N]===":"&&q===0){F=N;break}if(F===-1)return G;let M=R.substring(0,F).trim().replace(/\?$/,""),V=R.substring(F+1),b=-1,L=0;for(let N=0;N<V.length;N++)if(V[N]==="<")L++;else if(V[N]===">")L--;else if(V[N]==="="&&L===0){b=N;break}let D=B?"...":"";if(b!==-1)return`${D}${M} = ${V.substring(b+1).trim()}`;return`${D}${M}`}).join(", ")}Q=Q.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(z,X,Y)=>{if(!Y.includes(":"))return z;return`${X}(${Z(Y)})`});{let z=/\b(function\s+\w*\s*)\(/g,X,Y=[];while((X=z.exec(Q))!==null){let $=X.index+X[0].length-1,_=1,J=$+1,G=0,W=null;while(J<Q.length&&_>0){let F=Q[J];if(W){if(F===W)W=null;J++;continue}if(F==='"'||F==="'"||F==="`"){W=F,J++;continue}if(F==="<")G++;else if(F===">"&&G>0)G--;else if(G===0){if(F==="(")_++;else if(F===")")_--}if(_>0)J++}if(_!==0)continue;let B=Q.substring($+1,J);if(!B.includes(":"))continue;let R=Z(B);Y.push({start:$+1,end:J,replacement:R})}for(let $=Y.length-1;$>=0;$--){let{start:_,end:J,replacement:G}=Y[$];Q=Q.substring(0,_)+G+Q.substring(J)}}return Q=Q.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(z,X)=>{if(!X.includes(":"))return z;if(X.includes("{")||X.includes("}"))return z;return`(${X.split(",").map(($)=>{let[_,...J]=$.split("="),G=_.split(":")[0].trim();if(J.length>0)return`${G} = ${J.join("=").trim()}`;return G}).join(", ")}) =>`}),Q=Q.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Q=Q.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Q=Q.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Q=Q.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Q=Q.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Q=Q.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Q=Q.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Q=Q.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Q=Q.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Q=Q.replace(/\n\s*\n\s*\n/g,`
4
4
 
5
5
  `),Q}async function xQ(H,Q,Z,z={}){if(!H.trim())return;let X;try{let U=new Bun.Transpiler({loader:"ts",target:"browser",define:c()}),A=H.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");A=A.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),X=U.transformSync(A)}catch{X=EQ(H)}let Y={exports:{}},$=Y.exports,_=y.cwd(),J={},G=[...X.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((U)=>U[1]).filter((U)=>!U.startsWith("node:")&&!U.startsWith(".")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(U));for(let U of G)try{let A=k.resolve(_,"node_modules",U),O=k.join(A,"package.json"),T=JSON.parse(f("fs").readFileSync(O,"utf8")),w=T.main||"index.js";if(T.exports){let j=typeof T.exports==="string"?T.exports:T.exports["."];if(typeof j==="string")w=j;else if(j?.bun)w=j.bun;else if(j?.import)w=j.import;else if(j?.default)w=j.default}J[U]=await import(k.resolve(A,w))}catch{}let W=(U)=>{if(J[U])return J[U];return f(U)},B=Q.props||{},R=(U)=>{if(!U)return B;let A={};for(let[O,T]of Object.entries(U)){let w=B[O];if(w!==void 0)A[O]=w;else if(typeof T==="function")A[O]=T();else A[O]=T}return A};for(let[U,A]of Object.entries(B))Object.defineProperty(R,U,{value:A,enumerable:!0,configurable:!0,writable:!0});let F=(U)=>{if(!U)return B;let A={...B};for(let[O,T]of Object.entries(U)){let w=T&&typeof T==="object"&&!Array.isArray(T)?T:{type:T};if(A[O]===void 0&&w.default!==void 0)A[O]=typeof w.default==="function"?w.default():w.default}return A},q=()=>Q.slots||{},E=(U,A)=>{let O={...U};for(let[T,w]of Object.entries(A))if(O[T]===void 0)if(typeof w==="function")O[T]=w();else O[T]=w;return O},M=(U)=>{let A=()=>U;return A.set=(O)=>{},A.update=(O)=>{},A},V=(U)=>{let A,O=!1;return()=>{if(!O)try{A=U(),O=!0}catch{A=void 0}return A}},b=(U)=>{},L=(U)=>U(),D=(U)=>{},N=(U)=>{},S=(U)=>{},e=()=>{let U=Q.__stxServeContext,A=Q.__stxServeSearch??U?.search??"",O=U?.path??"";return{params:Q.params??{},query:Object.fromEntries(new URLSearchParams(A)),path:O,name:"",fullPath:O+A,hash:"",matched:[]}},QQ=()=>({push:(U)=>{},replace:(U)=>{},back:()=>{},forward:()=>{},go:(U)=>{}}),XQ=(U)=>{a(U);let A=Q.__stx_runtime_head||{},O=U||{};Q.__stx_runtime_head={...A,...O.title&&{title:O.title},meta:[...A.meta||[],...O.meta||[]],link:[...A.link||[],...O.link||[]],script:[...A.script||[],...O.script||[]],htmlAttrs:{...A.htmlAttrs||{},...O.htmlAttrs||{}},bodyAttrs:{...A.bodyAttrs||{},...O.bodyAttrs||{}}}},YQ=(U)=>{i(U);let A=s();Q.__stx_runtime_head={...Q.__stx_runtime_head||{},...A.title&&{title:A.title},meta:A.meta?[...A.meta]:[]}},ZQ=(U)=>({value:U}),zQ=(U)=>U,GQ=(U)=>({value:typeof U==="function"?U():U}),$Q=(U,A)=>{},HQ=(U)=>{},UQ=(U)=>{},_Q=(U)=>U?U():Promise.resolve(),JQ=(U)=>(A,...O)=>{},WQ=(U)=>{},AQ=(U,A)=>{},BQ=(U,A)=>A,FQ=()=>({value:"light"}),OQ=()=>({value:!1}),C={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},RQ=new Proxy(C,{get(U,A){if(A in U)return U[A];return},set(U,A,O){return U[A]=O,!0}}),KQ={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},qQ=console;try{let U=MQ(X,Z),A=new Set(Object.keys(B)),O=Object.keys(Q).filter((K)=>!A.has(K)&&K!=="props"),T=O.map((K)=>Q[K]),w=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","let","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","await","async","module","exports","require","params","window","document","console","state","derived","effect"]),j=[],x=[];for(let[K,P]of Object.entries(B)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(K))continue;if(w.has(K))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${K}\\b`).test(U))continue;j.push(K),x.push(P)}let TQ=NQ(U).map((K)=>`module.exports.${K} = typeof ${K} !== 'undefined' ? ${K} : module.exports.${K};`).join(`
@@ -18,4 +18,4 @@ ${H[J]}`,J++;else break}return _=_.trim().replace(/;$/,""),{type:X,name:Y,value:
18
18
  ${Y}`,X++}while(X<H.length){let Y=H[X].trim();if(Y.startsWith(".")||Y.startsWith("?."))z+=`
19
19
  ${H[X]}`,X++;else break}return{value:z,nextIndex:X}}function LQ(H,Q,Z){let z=Z,X=Q+1;while(X<H.length){let Y=z.indexOf("{");if(Y!==-1){if(I(z,"{","}",Y)!==-1)break}let $=H[X];z+=`
20
20
  ${$}`,X++}return{functionCode:z,nextIndex:X}}function o(H,Q){let Z=v(H,Q)??v(`(${H})`,Q);if(Z!==void 0)return Z;if(!/\bprocess\b/.test(H))return;let z={...Q,process:Object.freeze({env:{...y.env}})};try{return Function(...Object.keys(z),`'use strict'; return (${H});`)(...Object.values(z))}catch{try{return Function(...Object.keys(z),`'use strict'; return ${H};`)(...Object.values(z))}catch{return}}}async function DQ(H,Q,Z){let z=H.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Y of z){let[,,$,_]=Y;try{let J=_.trim().replace(/;$/,""),G=o(J,Q);if(G!==void 0)Q[$]=G}catch(J){console.warn(`Failed to parse export ${$} in fallback:`,J)}}let X=H.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Y of X){let[,,$,_]=Y;if(!($ in Q))try{let J=_.trim().replace(/;$/,""),G=o(J,Q);if(G!==void 0)Q[$]=G}catch{}}}function hQ(H){let Q=H.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),Z=Q?Q[1]:"",z=Q?H.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):H;return{scriptContent:Z,templateWithoutScript:z}}function mQ(H){let Q=H.trim();if(!Q)return!1;return/(?:const|let|var|function)\s+\w+/.test(Q)}
21
- export{EQ as Yv,xQ as Zv,MQ as _v,hQ as $v,mQ as aw};
21
+ export{EQ as dt,xQ as et,MQ as ft,hQ as gt,mQ as ht};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Kt as E}from"./chunk-7sd6c9wv.js";import{jE as f}from"./chunk-6r70w54p.js";import D from"path";import{extractLayoutMetadata as p}from"stx-router/layout-metadata";var P="stx-page-head:",R=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,H=null;function M(){if(H!==null)return H;try{let{getRouterScript:z}=f("stx-router");H=`<script>${z()}</script>`}catch{H=""}return H}async function x(z,X){if(X===!1)return null;if(X&&typeof X==="string"){let J=D.resolve(z,X);if(await Bun.file(J).exists())return J;return null}let w=D.join(z,"app.stx");if(await Bun.file(w).exists())return w;return null}async function y(z,X){try{let w=await Bun.file(z).text(),J=w,Y=w.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(Y)J=Y[1].trim();let N=E(w),V=[...N.client.map((Q)=>Q.fullTag),...N.signals.map((Q)=>Q.fullTag)],F=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,$;while(($=Z.exec(w))!==null)F.push($[0]);let B=J;for(let Q of N.server)B=B.replace(Q.fullTag,"");for(let Q of N.client)B=B.replace(Q.fullTag,"");B=B.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let j="<!--__STX_PAGE_SLOT__-->";if(B=B.replace(/<slot\s*\/>/gi,j).replace(/<slot\s*>\s*<\/slot>/gi,j),!B.includes(j))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:I,defaultConfig:W,loadStxConfig:K}=await import("././index.js"),A=await K(),q={__filename:z,__dirname:D.dirname(z)};for(let Q of V){let k=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(k&&!Q.includes("client")&&!Q.includes('type="module"'))await I(k[1],q,z)}let U=await G(B,q,z,{...W,...A,...X},new Set),v=U.indexOf(j);if(v===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:U.substring(0,v),afterSlot:U.substring(v+j.length),filePath:z,shellScripts:V,shellStyles:F}}catch(w){return console.error(`[stx] Error processing shell ${z}:`,w),null}}function S(z,X,w){let J,Y="",N=X.match(R);if(N){X=X.replace(N[0],"");try{let B=Buffer.from(N[1],"base64").toString("utf8"),j=B.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(j)J=j[1].trim();Y=B.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let V=w||J||"stx App",F=M(),Z="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{Rq as E}from"./chunk-6djgb0hr.js";import{rB as f}from"./chunk-3jm3snz8.js";import D from"path";import{extractLayoutMetadata as p}from"stx-router/layout-metadata";var P="stx-page-head:",R=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,H=null;function M(){if(H!==null)return H;try{let{getRouterScript:z}=f("stx-router");H=`<script>${z()}</script>`}catch{H=""}return H}async function x(z,X){if(X===!1)return null;if(X&&typeof X==="string"){let J=D.resolve(z,X);if(await Bun.file(J).exists())return J;return null}let w=D.join(z,"app.stx");if(await Bun.file(w).exists())return w;return null}async function y(z,X){try{let w=await Bun.file(z).text(),J=w,Y=w.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(Y)J=Y[1].trim();let N=E(w),V=[...N.client.map((Q)=>Q.fullTag),...N.signals.map((Q)=>Q.fullTag)],F=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,$;while(($=Z.exec(w))!==null)F.push($[0]);let B=J;for(let Q of N.server)B=B.replace(Q.fullTag,"");for(let Q of N.client)B=B.replace(Q.fullTag,"");B=B.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let j="<!--__STX_PAGE_SLOT__-->";if(B=B.replace(/<slot\s*\/>/gi,j).replace(/<slot\s*>\s*<\/slot>/gi,j),!B.includes(j))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:I,defaultConfig:W,loadStxConfig:K}=await import("././index.js"),A=await K(),q={__filename:z,__dirname:D.dirname(z)};for(let Q of V){let k=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(k&&!Q.includes("client")&&!Q.includes('type="module"'))await I(k[1],q,z)}let U=await G(B,q,z,{...W,...A,...X},new Set),v=U.indexOf(j);if(v===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:U.substring(0,v),afterSlot:U.substring(v+j.length),filePath:z,shellScripts:V,shellStyles:F}}catch(w){return console.error(`[stx] Error processing shell ${z}:`,w),null}}function S(z,X,w){let J,Y="",N=X.match(R);if(N){X=X.replace(N[0],"");try{let B=Buffer.from(N[1],"base64").toString("utf8"),j=B.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(j)J=j[1].trim();Y=B.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let V=w||J||"stx App",F=M(),Z="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -26,4 +26,4 @@ ${F}
26
26
  `));if(W.length>0)q.push(W.join(`
27
27
  `));return q.push(I),q.join(`
28
28
  `)}
29
- export{x as Ct,y as Dt,S as Et,b as Ft,C as Gt,g as Ht,p as It};
29
+ export{x as Jq,y as Kq,S as Lq,b as Mq,C as Nq,g as Oq,p as Pq};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var j=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],q=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],w={file:"title",order:"asc",groups:[]},z={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:w,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:j,backgroundPresets:q,autoApplyContrastColor:!1,port:6006};function D(A){let b={...z,...A};return{enabled:b.enabled??!0,outDir:b.outDir??".stx/dist/story",storyMatch:b.storyMatch??["**/*.story.stx"],storyIgnored:b.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...w,...b.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...b.theme},responsivePresets:b.responsivePresets??j,backgroundPresets:b.backgroundPresets??q,autoApplyContrastColor:b.autoApplyContrastColor??!1,setupFile:b.setupFile,port:b.port??6006}}function E(){return{...z}}
3
- export{j as me,q as ne,w as oe,z as pe,D as qe,E as re};
3
+ export{j as ie,q as je,w as ke,z as le,D as me,E as ne};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import E from"fs";async function j(B){let q=await E.promises.readFile(B,"utf-8");return F(q,B)}function F(B,q){let H=B.match(/<Story\s+([^>]*)>([\s\S]*?)<\/Story>/i);if(!H)return null;let G=H[1],J=H[2],Q=K(G,"title")||V(q),U=z(Q),W=K(G,"group"),Y=K(G,"icon"),Z=K(G,"icon-color")||K(G,"iconColor"),_=K(G,"docs-only")==="true"||K(G,"docsOnly")==="true",X=w(G),$=T(J);return{id:U,title:Q,group:W,variants:$,layout:X,icon:Y,iconColor:Z,docsOnly:_}}function T(B){let q=[],H=/<Variant\s+([^>]*)>([\s\S]*?)<\/Variant>/gi,G=H.exec(B);while(G!==null){let J=G[1],Q=G[2],U=K(J,"title")||"Default",W=z(U),Y=K(J,"icon"),Z=K(J,"icon-color")||K(J,"iconColor"),_=K(J,"responsive-disabled")==="true",X=K(J,":init-state")||K(J,"init-state"),$=X?I(B,X):{},D=O(Q);q.push({id:W,title:U,icon:Y,iconColor:Z,state:$,source:D,responsiveDisabled:_}),G=H.exec(B)}if(q.length===0)q.push({id:"default",title:"Default",state:{}});return q}function K(B,q){let H=[new RegExp(`:${q}\\s*=\\s*["']([^"']+)["']`,"i"),new RegExp(`${q}\\s*=\\s*["']([^"']+)["']`,"i"),new RegExp(`:${q}\\s*=\\s*"([^"]+)"`,"i"),new RegExp(`${q}\\s*=\\s*"([^"]+)"`,"i")];for(let G of H){let J=B.match(G);if(J)return J[1]}return}function w(B){let q=K(B,":layout")||K(B,"layout");if(!q)return;try{let H=q.replace(/'/g,'"').replace(/(\w+):/g,'"$1":');return JSON.parse(H)}catch{return{type:"single"}}}function I(B,q){let H=B.match(/<script[^>]*>([\s\S]*?)<\/script>/i);if(!H)return{};let G=H[1],J=new RegExp(`function\\s+${q}\\s*\\(\\)\\s*\\{([\\s\\S]*?)\\breturn\\s*\\{([\\s\\S]*?)\\}`,"i"),Q=G.match(J);if(!Q){let U=new RegExp(`(?:const|let|var)\\s+${q}\\s*=\\s*\\(\\)\\s*=>\\s*\\(\\{([\\s\\S]*?)\\}\\)`,"i"),W=G.match(U);if(W)return k(W[1]);return{}}return k(Q[2])}function k(B){let q={},H=/(\w+)\s*:\s*([^,\n]+)/g,G=H.exec(B);while(G!==null){let J=G[1],Q=G[2].trim();q[J]=L(Q),G=H.exec(B)}return q}function L(B){let q=B.trim();if(q==="true")return!0;if(q==="false")return!1;if(q==="null")return null;if(q==="undefined")return;if(/^-?\d+(?:\.\d+)?$/.test(q))return Number(q);if(/^['"].*['"]$/.test(q))return q.slice(1,-1);return q}function O(B){let q=B;return q=q.replace(/<template\s+#default[^>]*>([\s\S]*?)<\/template>/gi,"$1"),q=q.replace(/<template\s+#controls[^>]*>[\s\S]*?<\/template>/gi,""),q=q.trim(),q}function V(B){return(B.split("/").pop()||B).replace(/\.story\.stx$/i,"").replace(/([A-Z])/g," $1").trim()}function z(B){return B.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function R(B){let q=B.match(/<script[^>]*>([\s\S]*?)<\/script>/i);return q?q[1]:""}function C(B){return B.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").trim()}
3
- export{j as zb,F as Ab,R as Bb,C as Cb};
3
+ export{j as vb,F as wb,R as xb,C as yb};
@@ -5,4 +5,4 @@ import Q from"fs";import U from"path";function W(H){let v=[],j=H.pwa;if(v.push({
5
5
  `);let J=["required","recommended","optional"];for(let L of J){let N=H.checks.filter((K)=>K.category===L);if(N.length===0)continue;v.push(`
6
6
  ${L.toUpperCase()}:`);for(let K of N){let T=K.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(v.push(` ${T} ${K.name}: ${K.message}`),K.details)v.push(` ${K.details}`)}}return v.push(""),v.join(`
7
7
  `)}
8
- export{W as Ae,X as Be,Y as Ce,A as De,B as Ee};
8
+ export{W as we,X as xe,Y as ye,A as ze,B as Ae};
@@ -204,4 +204,4 @@ function N(){return{viewportWidth:null,viewportHeight:null,zoom:1,background:"#f
204
204
  cursor: col-resize;
205
205
  }
206
206
  `}function R(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
207
- export{N as B,Q as C,Y as D,_ as E,$ as F,b as G,k as H,E as I};
207
+ export{N as x,Q as y,Y as z,_ as A,$ as B,b as C,k as D,E};
@@ -395,4 +395,4 @@ else {
395
395
  }
396
396
  };
397
397
  </script>`}function l(z){let j=z.customDirectives||[];return j.push(b),j.push(P),j.push(x),j.push(E),j.push(k),j.push(h),j.push(v),{...z,customDirectives:j}}
398
- export{_ as hD,$ as iD,F as jD,W as kD,b as lD,E as mD,P as nD,x as oD,T as pD,Z as qD,k as rD,h as sD,v as tD,f as uD,g as vD,d as wD,y as xD,l as yD};
398
+ export{_ as pA,$ as qA,F as rA,W as sA,b as tA,E as uA,P as vA,x as wA,T as xA,Z as yA,k as zA,h as AA,v as BA,f as CA,g as DA,d as EA,y as FA,l as GA};
@@ -164,4 +164,4 @@ window.addCurrentBookmark = window.__stxBookmarks.addCurrentBookmark.bind(window
164
164
  window.deleteBookmark = window.__stxBookmarks.deleteBookmark.bind(window.__stxBookmarks);
165
165
  </script>
166
166
  `}
167
- export{Y as Yd,B as Zd,F as _d,L as $d};
167
+ export{Y as Ud,B as Vd,F as Wd,L as Xd};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import D from"process";function F(B="STX_PUBLIC_"){let q={},A={};for(let[z,C]of Object.entries(D.env)){if(!z.startsWith(B)||C===void 0)continue;q[`import.meta.env.${z}`]=JSON.stringify(C),A[z]=C}return q["import.meta.env"]=JSON.stringify(A),q}function H(B="STX_PUBLIC_"){let q={};for(let[A,z]of Object.entries(D.env))if(A.startsWith(B)&&z!==void 0)q[A]=z;return q}
3
- export{F as NB,H as OB};
3
+ export{F as Vy,H as Wy};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Mz as Q}from"./chunk-exfw0aqe.js";import{jE as r}from"./chunk-6r70w54p.js";import k from"fs";import J from"path";var b=null,w=!1,W=null,M="",A=!1,o=256,N=new Map,E=null,x=null;function m(q){return Bun.hash(q).toString(16).padStart(16,"0").slice(0,16)}function y(q,z){if(N.has(q))N.delete(q);else if(N.size>=o)N.delete(N.keys().next().value);N.set(q,z)}async function e(q){if(!E)return null;try{let z=Bun.file(J.join(E,`cw-${m(q)}.css`));if(!await z.exists())return null;return await z.text()}catch{return null}}async function t(q,z){if(!E)return;try{if(!k.existsSync(E))k.mkdirSync(E,{recursive:!0});await Bun.write(J.join(E,`cw-${m(q)}.css`),z)}catch{}}async function i(q){try{let z=await import(q);if(z&&z.CSSGenerator)return{CSSGenerator:z.CSSGenerator,config:z.config,build:z.build,defaultConfig:z.defaultConfig}}catch{}return null}function s(){let q=[],z=process.env.HOME||process.env.USERPROFILE||"",G=process.cwd();while(G!==J.dirname(G))q.push(J.join(G,"node_modules","@cwcss","crosswind","dist","index.js")),q.push(J.join(G,"node_modules","@cwcss","crosswind","src","index.ts")),q.push(J.join(G,"pantry","@cwcss","crosswind","dist","index.js")),q.push(J.join(G,"pantry","@cwcss","crosswind","src","index.ts")),q.push(J.join(G,"node_modules","@stacksjs","crosswind","dist","index.js")),q.push(J.join(G,"pantry","@stacksjs","crosswind","dist","index.js")),G=J.dirname(G);if(z){let O=[J.join(z,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),J.join(z,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),J.join(z,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),J.join(z,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),J.join(z,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),J.join(z,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];q.push(...O)}return q.push(J.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),q.push(J.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),q}async function a(){if(w)return b;w=!0;try{let q=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let G of q){let O=await i(G);if(O){if(b=O,!process.env.STACKS_DEV_QUIET)console.log(`${Q.green}[Crosswind]${Q.reset} CSS engine loaded`);return b}}let z=s();for(let G of z)if(await Bun.file(G).exists()){let O=await i(G);if(O){if(b=O,!process.env.STACKS_DEV_QUIET)console.log(`${Q.green}[Crosswind]${Q.reset} CSS engine loaded from ${J.dirname(J.dirname(G))}`);return b}}throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${Q.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${Q.reset}`),console.warn(`${Q.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${Q.reset}`),null}}function Zq(){N.clear()}function $q(){b=null,w=!1,W=null,M="",N.clear(),x=null}async function n(q){try{let{loadConfigWithResult:z}=await import("bunfig"),G=await z({name:"crosswind",cwd:q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!G?.path||!G.config||Object.keys(G.config).length===0)return null;let O=J.relative(q,G.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${Q.green}[Crosswind]${Q.reset} Loaded config from ${O||G.path}`);return G.config}catch(z){if(z instanceof Error&&z.name==="ConfigNotFoundError")return null;return console.warn(`${Q.yellow}[Crosswind]${Q.reset} Failed to load crosswind config:`,z instanceof Error?z.message:z),null}}async function qq(q){if(A)return M;A=!0;try{let z=await a();if(!z||!z.build)return A=!1,"";if(!W)W=await n(q);if(!W)return A=!1,"";let G=z.defaultConfig?.theme||{},O=W.theme||{},V={...z.defaultConfig,...W,theme:{...G,...O,extend:{...G.extend||{},...O.extend||{}}}},X=performance.now(),Y=await z.build(V),j=performance.now()-X;if(M=Y.css,console.log(`${Q.cyan}[Crosswind]${Q.reset} Built ${Y.classes.size} classes in ${j.toFixed(1)}ms`),V.output){let _=J.isAbsolute(V.output)?V.output:J.join(q,V.output),H=J.dirname(_);if(!k.existsSync(H))k.mkdirSync(H,{recursive:!0});await Bun.write(_,Y.css)}return A=!1,Y.css}catch(z){return console.error(`${Q.red}[Crosswind]${Q.reset} Build error:`,z),A=!1,M}}async function Wq(q){W=null,await qq(q)}function Xq(){return M}function zq(q){let z=new Set,G=/class\s*=\s*["']([^"']+)["']/gi,O=G.exec(q);while(O!==null){for(let Y of O[1].split(/\s+/))if(Y.trim())z.add(Y.trim());O=G.exec(q)}let V=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,X=V.exec(q);while(X!==null){let Y=X[1].match(/'([^']+)'/g);if(Y){for(let j of Y)for(let _ of j.slice(1,-1).split(/\s+/))if(_.trim())z.add(_.trim())}X=V.exec(q)}return z}async function Gq(q,z){try{let G=await a();if(!G)return"";let O=zq(q);if(O.size===0)return"";let V=z?J.resolve(z):process.cwd();if(!E)E=J.join(V,".stx/cache");let X=[...O].sort().join(" "),Y=`${x||"default"}::${X}`,j=N.get(Y);if(j!==void 0)return y(Y,j),j;let _=await e(Y);if(_!==null)return y(Y,_),_;if(!W){let Z=null;try{let{loadStxConfig:T}=await import("././config.js"),U=await T(V);if(U.css)if(typeof U.css==="string"){let $=J.isAbsolute(U.css)?U.css:J.resolve(V,U.css);if(await Bun.file($).exists()){let I=await import($);Z=I.default||I,console.log(`${Q.green}[Crosswind]${Q.reset} Loaded config from stx.config.ts \u2192 ${U.css}`)}}else{if(Z={...U.css,content:U.css.content||[],preflight:U.css.preflight??!0,minify:U.css.minify??!1},U.css.config){let $=J.isAbsolute(U.css.config)?U.css.config:J.resolve(V,U.css.config);if(await Bun.file($).exists()){let I=await import($);Z={...I.default||I,...Z}}}console.log(`${Q.green}[Crosswind]${Q.reset} Using inline CSS config from stx.config.ts`)}}catch{}W=Z||await n(V);try{x=m(JSON.stringify(W??{}))}catch{x="unhashable"}}let H=G.defaultConfig||G.config,L=W||{},c=H.theme||{},u=(L.theme||{}).extend||{},f={...c};if(Object.keys(u).length>0)f.extend=u;let B=[...H.safelist||[],...L.safelist||[]],p={...H,...L,content:[],output:"",preflight:!0,minify:!1,theme:f,safelist:B},K=new G.CSSGenerator(p);for(let Z of B)K.generate(Z);for(let Z of O)K.generate(Z);let F=K.toCSS(!0,!1),g=p.shortcuts||L.shortcuts||{};for(let[Z,T]of Object.entries(g)){if(!O.has(Z)&&!B.includes(Z))continue;let U=T.split(/\s+/).filter(Boolean);for(let $ of U)K.generate($)}F=K.toCSS(!0,!1);let v=F.split(`
2
+ import{Tw as Q}from"./chunk-qdc3aav1.js";import{rB as r}from"./chunk-3jm3snz8.js";import k from"fs";import J from"path";var b=null,w=!1,W=null,M="",A=!1,o=256,N=new Map,E=null,x=null;function m(q){return Bun.hash(q).toString(16).padStart(16,"0").slice(0,16)}function y(q,z){if(N.has(q))N.delete(q);else if(N.size>=o)N.delete(N.keys().next().value);N.set(q,z)}async function e(q){if(!E)return null;try{let z=Bun.file(J.join(E,`cw-${m(q)}.css`));if(!await z.exists())return null;return await z.text()}catch{return null}}async function t(q,z){if(!E)return;try{if(!k.existsSync(E))k.mkdirSync(E,{recursive:!0});await Bun.write(J.join(E,`cw-${m(q)}.css`),z)}catch{}}async function i(q){try{let z=await import(q);if(z&&z.CSSGenerator)return{CSSGenerator:z.CSSGenerator,config:z.config,build:z.build,defaultConfig:z.defaultConfig}}catch{}return null}function s(){let q=[],z=process.env.HOME||process.env.USERPROFILE||"",G=process.cwd();while(G!==J.dirname(G))q.push(J.join(G,"node_modules","@cwcss","crosswind","dist","index.js")),q.push(J.join(G,"node_modules","@cwcss","crosswind","src","index.ts")),q.push(J.join(G,"pantry","@cwcss","crosswind","dist","index.js")),q.push(J.join(G,"pantry","@cwcss","crosswind","src","index.ts")),q.push(J.join(G,"node_modules","@stacksjs","crosswind","dist","index.js")),q.push(J.join(G,"pantry","@stacksjs","crosswind","dist","index.js")),G=J.dirname(G);if(z){let O=[J.join(z,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),J.join(z,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),J.join(z,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),J.join(z,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),J.join(z,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),J.join(z,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];q.push(...O)}return q.push(J.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),q.push(J.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),q}async function a(){if(w)return b;w=!0;try{let q=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let G of q){let O=await i(G);if(O){if(b=O,!process.env.STACKS_DEV_QUIET)console.log(`${Q.green}[Crosswind]${Q.reset} CSS engine loaded`);return b}}let z=s();for(let G of z)if(await Bun.file(G).exists()){let O=await i(G);if(O){if(b=O,!process.env.STACKS_DEV_QUIET)console.log(`${Q.green}[Crosswind]${Q.reset} CSS engine loaded from ${J.dirname(J.dirname(G))}`);return b}}throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${Q.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${Q.reset}`),console.warn(`${Q.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${Q.reset}`),null}}function Zq(){N.clear()}function $q(){b=null,w=!1,W=null,M="",N.clear(),x=null}async function n(q){try{let{loadConfigWithResult:z}=await import("bunfig"),G=await z({name:"crosswind",cwd:q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!G?.path||!G.config||Object.keys(G.config).length===0)return null;let O=J.relative(q,G.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${Q.green}[Crosswind]${Q.reset} Loaded config from ${O||G.path}`);return G.config}catch(z){if(z instanceof Error&&z.name==="ConfigNotFoundError")return null;return console.warn(`${Q.yellow}[Crosswind]${Q.reset} Failed to load crosswind config:`,z instanceof Error?z.message:z),null}}async function qq(q){if(A)return M;A=!0;try{let z=await a();if(!z||!z.build)return A=!1,"";if(!W)W=await n(q);if(!W)return A=!1,"";let G=z.defaultConfig?.theme||{},O=W.theme||{},V={...z.defaultConfig,...W,theme:{...G,...O,extend:{...G.extend||{},...O.extend||{}}}},X=performance.now(),Y=await z.build(V),j=performance.now()-X;if(M=Y.css,console.log(`${Q.cyan}[Crosswind]${Q.reset} Built ${Y.classes.size} classes in ${j.toFixed(1)}ms`),V.output){let _=J.isAbsolute(V.output)?V.output:J.join(q,V.output),H=J.dirname(_);if(!k.existsSync(H))k.mkdirSync(H,{recursive:!0});await Bun.write(_,Y.css)}return A=!1,Y.css}catch(z){return console.error(`${Q.red}[Crosswind]${Q.reset} Build error:`,z),A=!1,M}}async function Wq(q){W=null,await qq(q)}function Xq(){return M}function zq(q){let z=new Set,G=/class\s*=\s*["']([^"']+)["']/gi,O=G.exec(q);while(O!==null){for(let Y of O[1].split(/\s+/))if(Y.trim())z.add(Y.trim());O=G.exec(q)}let V=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,X=V.exec(q);while(X!==null){let Y=X[1].match(/'([^']+)'/g);if(Y){for(let j of Y)for(let _ of j.slice(1,-1).split(/\s+/))if(_.trim())z.add(_.trim())}X=V.exec(q)}return z}async function Gq(q,z){try{let G=await a();if(!G)return"";let O=zq(q);if(O.size===0)return"";let V=z?J.resolve(z):process.cwd();if(!E)E=J.join(V,".stx/cache");let X=[...O].sort().join(" "),Y=`${x||"default"}::${X}`,j=N.get(Y);if(j!==void 0)return y(Y,j),j;let _=await e(Y);if(_!==null)return y(Y,_),_;if(!W){let Z=null;try{let{loadStxConfig:T}=await import("././config.js"),U=await T(V);if(U.css)if(typeof U.css==="string"){let $=J.isAbsolute(U.css)?U.css:J.resolve(V,U.css);if(await Bun.file($).exists()){let I=await import($);Z=I.default||I,console.log(`${Q.green}[Crosswind]${Q.reset} Loaded config from stx.config.ts \u2192 ${U.css}`)}}else{if(Z={...U.css,content:U.css.content||[],preflight:U.css.preflight??!0,minify:U.css.minify??!1},U.css.config){let $=J.isAbsolute(U.css.config)?U.css.config:J.resolve(V,U.css.config);if(await Bun.file($).exists()){let I=await import($);Z={...I.default||I,...Z}}}console.log(`${Q.green}[Crosswind]${Q.reset} Using inline CSS config from stx.config.ts`)}}catch{}W=Z||await n(V);try{x=m(JSON.stringify(W??{}))}catch{x="unhashable"}}let H=G.defaultConfig||G.config,L=W||{},c=H.theme||{},u=(L.theme||{}).extend||{},f={...c};if(Object.keys(u).length>0)f.extend=u;let B=[...H.safelist||[],...L.safelist||[]],p={...H,...L,content:[],output:"",preflight:!0,minify:!1,theme:f,safelist:B},K=new G.CSSGenerator(p);for(let Z of B)K.generate(Z);for(let Z of O)K.generate(Z);let F=K.toCSS(!0,!1),g=p.shortcuts||L.shortcuts||{};for(let[Z,T]of Object.entries(g)){if(!O.has(Z)&&!B.includes(Z))continue;let U=T.split(/\s+/).filter(Boolean);for(let $ of U)K.generate($)}F=K.toCSS(!0,!1);let v=F.split(`
3
3
  `);for(let[Z,T]of Object.entries(g)){if(!O.has(Z)&&!B.includes(Z))continue;let U=T.split(/\s+/).filter(Boolean),$=[],I=[];for(let P of U){let d=P.startsWith("dark:"),C=`.${(d?P.slice(5):P).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let R=0;R<v.length;R++){let h=v[R].trim();if(h===`${C} {`||h.startsWith(`${C} {`)){let S=R,l="";while(S<v.length){if(l+=v[S],v[S].includes("}"))break;S++}let D=l.match(/\{([^}]+)\}/);if(D)if(d)I.push(D[1].trim());else $.push(D[1].trim());break}}}if($.length)F+=`
4
4
  .${Z} { ${$.join(" ")} }`;if(I.length)F+=`
5
5
  @media (prefers-color-scheme: dark) { .dark .${Z} { ${I.join(" ")} } }`}return y(Y,F),t(Y,F),F}catch(G){return console.warn("Failed to generate Crosswind CSS:",G),""}}async function _q(q,z){let G=await Gq(q,z);if(!G)return q;let O=`<style data-crosswind="generated">
@@ -7,4 +7,4 @@ ${G}
7
7
  </style>`,V=/<style data-crosswind="generated">[\s\S]*?<\/style>/g;if(V.test(q)){let X=!1;return q.replace(V,()=>{if(X)return"";return X=!0,O})}if(q.includes("</head>"))return q.replace("</head>",`${O}
8
8
  </head>`);if(q.includes("<body"))return q.replace(/<body([^>]*)>/,`<body$1>
9
9
  ${O}`);return O+q}
10
- export{a as Cz,Zq as Dz,$q as Ez,n as Fz,qq as Gz,Wq as Hz,Xq as Iz,zq as Jz,Gq as Kz,_q as Lz};
10
+ export{a as Jw,Zq as Kw,$q as Lw,n as Mw,qq as Nw,Wq as Ow,Xq as Pw,zq as Qw,Gq as Rw,_q as Sw};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import{Buffer as R}from"buffer";import S from"crypto";var W=40,V="_token",w=null;function X(j=W){let q=S.randomBytes(Math.ceil(j/2)).toString("hex").slice(0,j);return w=q,q}function Y(){if(!w)X();return w}function v(){w=null}function G(j){w=j}function Z(j=V){let q=Y();return`<input type="hidden" name="${j}" value="${q}">`}function H(j){return j.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(q,J,z)=>{return Z(z||V)})}function K(j,q){let J=q??w;if(!J)return!1;let z=R.from(j),Q=R.from(J);if(z.length!==Q.length)return!1;return S.timingSafeEqual(z,Q)}
3
- export{X as mA,Y as nA,v as oA,G as pA,Z as qA,H as rA,K as sA};
3
+ export{X as tx,Y as ux,v as vx,G as wx,Z as xx,H as yx,K as zx};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var h={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"};function f(b,j){return`${h[j]}${b}${h.reset}`}function k(b){return f(b,"green")}function n(b){return f(b,"yellow")}function p(b){return f(b,"red")}function q(b){return f(b,"cyan")}function v(b){return f(b,"gray")}
3
- export{h as Mz,f as Nz,k as Oz,n as Pz,p as Qz,q as Rz,v as Sz};
3
+ export{h as Tw,f as Uw,k as Vw,n as Ww,p as Xw,q as Yw,v as Zw};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{nu as U,tu as W}from"./chunk-tzd81m7r.js";import{Zv as X}from"./chunk-nwfa5766.js";import{Zw as R,_w as O}from"./chunk-r7d26vjj.js";import{jE as Q}from"./chunk-6r70w54p.js";async function F(j,N={}){return(await _(j,N)).html}async function V(j,N={}){let{html:J,context:A}=await _(j,N),{extractStreamBoundaries:G}=await import("././streaming.js"),z=G(A),w=j.streamTemplates;if(w&&Object.keys(w).length>0){let{processDirectives:$}=await import("././process.js"),{defaultConfig:D}=await import("././config.js"),Y=A.streamBoundaries||{},I={...D,autoShell:!1},Z=Object.keys(w).map((K)=>({id:K,render:async()=>{let M=typeof Y[K]==="function"?await Y[K]():void 0;return $(w[K],{...A,$boundary:M},j.sourceFile,I,new Set)}})),L=new Set(Z.map((K)=>K.id));z=[...(z||[]).filter((K)=>!L.has(K.id)),...Z]}return{html:J,boundaries:z&&z.length>0?z:void 0}}async function _(j,N){let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};if(!j.hasServerScripts&&!O(j.html))return{html:j.html,context:J};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.html))return{html:j.html,context:J};let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return{html:R(j.html,A),context:J}}async function y(j,N={}){if(!j.hasServerScripts&&!O(j.fragment))return j.fragment;let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.fragment))return j.fragment;let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return R(j.fragment,A)}
3
- export{F as Ri,V as Si,y as Ti};
2
+ import{Ar as W,ur as U}from"./chunk-w01y57f5.js";import{et as X}from"./chunk-nap11ntr.js";import{eu as R,fu as O}from"./chunk-tr0z0e1g.js";import{rB as Q}from"./chunk-3jm3snz8.js";async function F(j,N={}){return(await _(j,N)).html}async function V(j,N={}){let{html:J,context:A}=await _(j,N),{extractStreamBoundaries:G}=await import("././streaming.js"),z=G(A),w=j.streamTemplates;if(w&&Object.keys(w).length>0){let{processDirectives:$}=await import("././process.js"),{defaultConfig:D}=await import("././config.js"),Y=A.streamBoundaries||{},I={...D,autoShell:!1},Z=Object.keys(w).map((K)=>({id:K,render:async()=>{let M=typeof Y[K]==="function"?await Y[K]():void 0;return $(w[K],{...A,$boundary:M},j.sourceFile,I,new Set)}})),L=new Set(Z.map((K)=>K.id));z=[...(z||[]).filter((K)=>!L.has(K.id)),...Z]}return{html:J,boundaries:z&&z.length>0?z:void 0}}async function _(j,N){let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};if(!j.hasServerScripts&&!O(j.html))return{html:j.html,context:J};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.html))return{html:j.html,context:J};let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return{html:R(j.html,A),context:J}}async function y(j,N={}){if(!j.hasServerScripts&&!O(j.fragment))return j.fragment;let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.fragment))return j.fragment;let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return R(j.fragment,A)}
3
+ export{F as Li,V as Mi,y as Ni};
@@ -131,4 +131,4 @@ else {
131
131
  }
132
132
  </style>
133
133
  `}var z={HydrationRuntime:Q,serializeState:V,generateStateScript:X,generateHydrationScript:$,generateHydrationCSS:j,extractState:Y,getHydrationRuntime:Z,hydrate:P};
134
- export{V as wm,X as xm,w as ym,Y as zm,Q as Am,$ as Bm,Z as Cm,P as Dm,j as Em,z as Fm};
134
+ export{V as qm,X as rm,w as sm,Y as tm,Q as um,$ as vm,Z as wm,P as xm,j as ym,z as zm};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ev as T,Ku as E,fu as b,hu as k}from"./chunk-tzd81m7r.js";import{Zv as j}from"./chunk-nwfa5766.js";import{Lw as H}from"./chunk-v0s45ek4.js";import{jE as w}from"./chunk-6r70w54p.js";import{dirname as R,resolve as I}from"path";function y(L){let K=L,z=L.match(/<template\b(?![^>]*(?:\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=|\s#[\w-]|\bv-slot|\bslot\s*=))[^>]*>/i);if(z&&z.index!==void 0){let G=z.index+z[0].length,N=1,Q=G;while(N>0&&Q<L.length){let J=L.indexOf("<template",Q),X=L.indexOf("</template>",Q);if(X===-1)break;if(J!==-1&&J<X){let U=L[J+9];if(U===">"||U===" "||U===`
2
+ import{Ls as T,Rr as E,mr as b,or as k}from"./chunk-w01y57f5.js";import{et as j}from"./chunk-nap11ntr.js";import{St as H}from"./chunk-kdxa9epn.js";import{rB as w}from"./chunk-3jm3snz8.js";import{dirname as R,resolve as I}from"path";function y(L){let K=L,z=L.match(/<template\b(?![^>]*(?:\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=|\s#[\w-]|\bv-slot|\bslot\s*=))[^>]*>/i);if(z&&z.index!==void 0){let G=z.index+z[0].length,N=1,Q=G;while(N>0&&Q<L.length){let J=L.indexOf("<template",Q),X=L.indexOf("</template>",Q);if(X===-1)break;if(J!==-1&&J<X){let U=L[J+9];if(U===">"||U===" "||U===`
3
3
  `||U==="\t")N++;Q=J+9}else{if(N--,N===0){K=L.slice(G,X).trim();break}Q=X+11}}}let A=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y=[],W=[],Z=[],$=(G)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(G),_;while((_=A.exec(L))!==null){let G=_[1],N=_[2],Q=_[0],J=G.includes("server");if($(N))Z.push(Q);else if(J)W.push(N);else Y.push(Q)}let q=K;{let G=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,N,Q=[];while((N=G.exec(q))!==null){let J=N.index+N[0].length,X=1,U=J;while(U<q.length&&X>0){let V=q.indexOf("<script",U),B=q.indexOf("</script>",U);if(B===-1)break;if(V!==-1&&V<B)X++,U=V+7;else{if(X--,X===0){Q.push({start:N.index,end:B+9});break}U=B+9}}}for(let J=Q.length-1;J>=0;J--)q=q.substring(0,Q[J].start)+q.substring(Q[J].end)}for(let G of Y)q=q.replace(G,"");return{templateContent:q,serverScripts:W,clientScripts:Y,signalsScripts:Z}}function D(L,K){return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
@@ -16,4 +16,4 @@ ${W.join(`
16
16
  `);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${J}
17
17
  $1`);else q+=`
18
18
  ${J}`}q=await H(q)}if(z.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=D(q,z.title)}if(z.injectCSS)try{let{injectCrosswindCSS:G}=await import("./dev-server/crosswind.js");q=await G(q)}catch{}return q}
19
- export{x as Bi,m as Ci};
19
+ export{x as vi,m as wi};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var{WebView:A}=globalThis.Bun;import{existsSync as K,mkdirSync as U,readdirSync as E,statSync as V}from"fs";import R from"path";var Z=16384;function O(j){if(/^https?:\/\//.test(j)||j.startsWith("file://"))return j;return`file://${R.resolve(j)}`}function C(j,B,z){return new Promise((L)=>{let P=!1,J=()=>{if(!P)P=!0,L()};j.onNavigated=()=>setTimeout(J,B),setTimeout(J,z)})}async function H(j,B,z){let L=`!!document.querySelector(${JSON.stringify(B)})`,P=Date.now()+z;while(Date.now()<P){try{if(await j.evaluate(L))return}catch{}await new Promise((J)=>setTimeout(J,100))}}async function W(j){try{let B=await j.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof B==="number"&&Number.isFinite(B)&&B>0?Math.min(B,Z):0}catch{return 0}}async function X(j,B,z={}){let L=Math.min(z.width??1440,Z),P=Math.min(z.height??2200,Z),J=z.waitMs??800,G=z.timeoutMs??15000,T=z.format??"png",k=O(j),$=(Y)=>new A({url:k,width:L,height:Y,headless:!0,...z.backend?{backend:z.backend}:{}}),Q=$(P);try{if(await C(Q,J,G),z.waitSelector)await H(Q,z.waitSelector,G);if(z.fullPage){let q=await W(Q);if(q>P){if(Q.close(),Q=$(q),await C(Q,J,G),z.waitSelector)await H(Q,z.waitSelector,G)}}let Y=await Q.screenshot({encoding:"buffer",format:T});U(R.dirname(R.resolve(B)),{recursive:!0}),await Bun.write(B,Y)}finally{Q.close()}if(!K(B))throw Error(`Screenshot was not produced for ${j}`);return{input:j,output:B,bytes:V(B).size}}async function F(j,B,z={}){U(B,{recursive:!0});let L;if(!/^https?:\/\//.test(j)&&K(j)&&V(j).isDirectory())L=E(j).filter((G)=>G.endsWith(".html")).map((G)=>R.join(j,G));else L=[j];let P=z.format??"png",J=[];for(let G of L){let T=/^https?:\/\//.test(G)?new URL(G).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":R.basename(G).replace(/\.html?$/,"");J.push(await X(G,R.join(B,`${T}.${P}`),z))}return J}
3
- export{X as di,F as ei};
3
+ export{X as Zh,F as _h};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Zj as _,_j as M,ck as R}from"./chunk-fcpxs8mm.js";async function y(q){let{src:w,alt:j="",signatureEndpoint:z="/api/sign",signatureConfig:F={},auth:J,fallback:K,oneTimeUse:G=!0}=q,W=q.class,X=q.style;if(J){if(!await _(J)){if(K)return{html:`<img src="${B(K)}" alt="${B(j)}"${W?` class="${B(W)}"`:""}${X?` style="${B(X)}"`:""} />`};return{html:"<!-- Protected content: access denied -->"}}}let $={endpoint:z,oneTimeUse:G,...F,params:J?M(J):F.params},Y=`stx-protected-${Math.random().toString(36).slice(2,8)}`,O=[`id="${Y}"`,`data-protected-src="${B(w)}"`,`data-signature-endpoint="${B(z)}"`,`alt="${B(j)}"`];if(K)O.push(`data-fallback="${B(K)}"`),O.push(`src="${B(K)}"`);else O.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');if(W)O.push(`class="${B(W)}"`);if(X)O.push(`style="${B(X)}"`);let Z=`
2
+ import{Tj as _,Uj as M,Yj as R}from"./chunk-eqeyaq6g.js";async function y(q){let{src:w,alt:j="",signatureEndpoint:z="/api/sign",signatureConfig:F={},auth:J,fallback:K,oneTimeUse:G=!0}=q,W=q.class,X=q.style;if(J){if(!await _(J)){if(K)return{html:`<img src="${B(K)}" alt="${B(j)}"${W?` class="${B(W)}"`:""}${X?` style="${B(X)}"`:""} />`};return{html:"<!-- Protected content: access denied -->"}}}let $={endpoint:z,oneTimeUse:G,...F,params:J?M(J):F.params},Y=`stx-protected-${Math.random().toString(36).slice(2,8)}`,O=[`id="${Y}"`,`data-protected-src="${B(w)}"`,`data-signature-endpoint="${B(z)}"`,`alt="${B(j)}"`];if(K)O.push(`data-fallback="${B(K)}"`),O.push(`src="${B(K)}"`);else O.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');if(W)O.push(`class="${B(W)}"`);if(X)O.push(`style="${B(X)}"`);let Z=`
3
3
  (function() {
4
4
  var el = document.getElementById('${Y}');
5
5
  if (!el) return;
@@ -54,4 +54,4 @@ else if (el.dataset.fallback) {
54
54
  });
55
55
  })();
56
56
  `.trim(),{html:q,script:J}}function E(q,w,j){if(w.src)return{src:String(w.src),alt:String(w.alt||""),signatureEndpoint:String(w.signatureEndpoint||"/api/sign"),auth:w.auth,fallback:w.fallback?String(w.fallback):void 0,oneTimeUse:w.oneTimeUse!==!1};let z=q.trim();if(z.startsWith("@protected(")||z.startsWith("("))z=z.replace(/^@protected\(/,"").replace(/^\(/,"").replace(/\)$/,"");let F=D(z);return{src:L(F[0],j)||"",alt:L(F[1],j)||"",...typeof F[2]==="object"?F[2]:{}}}function D(q){let w=[],j="",z=!1,F="",J=0;for(let K=0;K<q.length;K++){let G=q[K],W=K>0?q[K-1]:"";if((G==='"'||G==="'")&&W!=="\\"){if(!z)z=!0,F=G;else if(G===F)z=!1;else j+=G;continue}if(!z){if(G==="{")J++;if(G==="}")J--;if(G===","&&J===0){w.push(j.trim()),j="";continue}}j+=G}if(j.trim())w.push(j.trim());return w}function L(q,w){if(typeof q!=="string")return q;let j=q.trim();if(j.startsWith('"')&&j.endsWith('"')||j.startsWith("'")&&j.endsWith("'"))return j.slice(1,-1);if(w[j]!==void 0)return w[j];if(j.startsWith("{"))try{return JSON.parse(j)}catch{}return j}function B(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
57
- export{y as Pj,C as Qj,x as Rj,E as Sj};
57
+ export{y as Jj,C as Kj,x as Lj,E as Mj};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ export{o as Zn,p as _n,f as $n,m as ao,i as bo};
@@ -193,4 +193,4 @@ else {
193
193
  })();
194
194
  </script>
195
195
  `}function Q(j,k,B={}){let z=L(k,B),u=j.lastIndexOf("</body>");if(u!==-1)return j.slice(0,u)+z+j.slice(u);if(j.includes("</html>"))return j.replace("</html>",`${z}</html>`);return j+z}function T(j){let k=j.toLowerCase();return k.endsWith(".css")||k.endsWith(".scss")||k.endsWith(".sass")||k.endsWith(".less")}function U(j){let k=j.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((z)=>k.endsWith(z))}function V(j){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((B)=>B.test(j))}var E=null;function W(j){if(!E)E=new G(j);return E}function X(){if(E)E.stop(),E=null}
196
- export{G as km,L as lm,Q as mm,T as nm,U as om,V as pm,W as qm,X as rm};
196
+ export{G as em,L as fm,Q as gm,T as hm,U as im,V as jm,W as km,X as lm};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var M=/<script\b[^>]*>/iy,Q=/<\/script\s*>/ig,U=/<style\b[^>]*>/iy,V=/<\/style\s*>/ig;function J(f,j,w,B){w.lastIndex=j;let z=w.exec(f);if(!z||z.index!==j)return-1;B.lastIndex=w.lastIndex;let v=B.exec(f);if(!v)return-1;return v.index+v[0].length}function W(f,j){return J(f,j,M,Q)}function Z(f,j){return J(f,j,U,V)}function $(f,j){if(!f.startsWith("<!--",j))return-1;let w=f.indexOf("-->",j+4);if(w===-1)return-1;return w+3}function X(f,j,w){let B=[],z="",v=0,K=f.length,H=!1,F=null;while(v<K){let D=f[v];if(H){if(z+=D,F){if(D===F)F=null}else if(D==='"'||D==="'")F=D;else if(D===">")H=!1;v++;continue}if(D==="<"){let G=j(f,v);if(G>v){z+=w(f.slice(v,G),B.length),B.push(f.slice(v,G)),v=G;continue}if(/^<\/?[a-zA-Z]/.test(f.slice(v,v+2)))H=!0;z+=D,v++;continue}z+=D,v++}return{output:z,tokens:B}}function b(f){let{output:j,tokens:w}=X(f,W,(B,z)=>`\x00STX_SCRIPT_${z}\x00`);return{output:j,scripts:w}}function y(f,j){if(j.length===0)return f;return f.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(w,B)=>j[+B]??"")}
3
- export{W as ey,Z as fy,$ as gy,X as hy,b as iy,y as jy};
3
+ export{W as lv,Z as mv,$ as nv,X as ov,b as pv,y as qv};
@@ -125,4 +125,4 @@ ${await X(b,j)}
125
125
  `),v=[],G=!1,B="",K=!1;for(let q of z)if(q.includes("{")){G=!0,B=q;for(let J of j)if(q.includes(`.${J}`)||q.includes(`.${J} `)||q.includes(`.${J},`)||q.includes(`.${J}:`)){K=!0;break}}else if(q.includes("}")){if(K)v.push(B),v.push(q);G=!1,B="",K=!1}else if(G)B+=`
126
126
  ${q}`;else v.push(q);return v.join(`
127
127
  `)}
128
- export{k as ua,X as va,M as wa,w as xa,y as ya};
128
+ export{k as qa,X as ra,M as sa,w as ta,y as ua};
@@ -11,4 +11,4 @@ catch (e) {
11
11
  throw e;
12
12
  }
13
13
  `),N.set(Z,$)}return $(...T)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:O,context:F.slice()});return O}clear(){this.pool.length=0,this.fnCache.clear()}}var S=new L;class W{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(j){this.enabled=j}isEnabled(){return this.enabled}setBudget(j,F){this.budgets.set(j,{warnThreshold:0.8,action:"warn",...F})}setBudgets(j){for(let[F,D]of Object.entries(j))this.setBudget(F,D)}removeBudget(j){this.budgets.delete(j)}getBudgets(){let j={};for(let[F,D]of this.budgets.entries())j[F]=D;return j}onViolation(j){this.violationHandlers.push(j)}offViolation(j){let F=this.violationHandlers.indexOf(j);if(F!==-1)this.violationHandlers.splice(F,1)}time(j,F){if(!this.enabled)return F();let D=performance.now(),J=F(),N=performance.now()-D;return this.recordTime(j,N),this.checkBudget(j,N),J}async timeAsync(j,F){if(!this.enabled)return F();let D=performance.now(),J=await F(),N=performance.now()-D;return this.recordTime(j,N),this.checkBudget(j,N),J}checkBudget(j,F){let D=this.budgets.get(j);if(!D)return;let J=F/D.maxTime*100,N=D.warnThreshold!==void 0?F>=D.maxTime*D.warnThreshold&&F<D.maxTime:!1,Q=F>=D.maxTime;if(!N&&!Q)return;let O={label:j,actualTime:F,budgetTime:D.maxTime,exceedancePercent:J,timestamp:new Date,isWarning:N};this.violations.push(O);while(this.violations.length>this.maxViolations)this.violations.shift();for(let Y of this.violationHandlers)try{Y(O)}catch{}let T=N?`[Performance Warning] "${j}" took ${F.toFixed(2)}ms (${J.toFixed(1)}% of ${D.maxTime}ms budget)`:`[Performance Budget Exceeded] "${j}" took ${F.toFixed(2)}ms (exceeded ${D.maxTime}ms budget by ${(J-100).toFixed(1)}%)`;switch(D.action){case"log":console.log(T);break;case"warn":console.warn(T);break;case"error":console.error(T);break;case"throw":if(Q)throw Error(T);else console.warn(T);break}}recordTime(j,F){let D=this.metrics.get(j);if(D)D.count++,D.totalTime+=F,D.maxTime=Math.max(D.maxTime,F),D.minTime=Math.min(D.minTime,F);else this.metrics.set(j,{count:1,totalTime:F,maxTime:F,minTime:F})}getStats(j){if(j){let D=this.metrics.get(j);if(!D)return{};let J=this.budgets.get(j);return{count:D.count,avgTime:D.totalTime/D.count,totalTime:D.totalTime,maxTime:D.maxTime,minTime:D.minTime,budget:J?.maxTime,budgetUtilization:J?D.totalTime/D.count/J.maxTime*100:void 0}}let F={};for(let[D,J]of this.metrics.entries()){let N=this.budgets.get(D);F[D]={count:J.count,avgTime:J.totalTime/J.count,totalTime:J.totalTime,maxTime:J.maxTime,minTime:J.minTime,budget:N?.maxTime,budgetUtilization:N?J.totalTime/J.count/N.maxTime*100:void 0}}return F}getViolations(j){if(j)return this.violations.filter((F)=>F.label===j);return[...this.violations]}getViolationStats(){let j={},F=0,D=0;for(let J of this.violations)if(j[J.label]=(j[J.label]||0)+1,J.isWarning)F++;else D++;return{total:this.violations.length,byLabel:j,warnings:F,errors:D}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var H={processDirectives:{maxTime:500,warnThreshold:0.8,action:"warn"},processTemplate:{maxTime:200,warnThreshold:0.8,action:"warn"},processIncludes:{maxTime:100,warnThreshold:0.8,action:"warn"},processLoops:{maxTime:50,warnThreshold:0.8,action:"warn"},processConditionals:{maxTime:50,warnThreshold:0.8,action:"warn"},processExpressions:{maxTime:100,warnThreshold:0.8,action:"warn"},renderComponent:{maxTime:150,warnThreshold:0.8,action:"warn"},buildWebComponents:{maxTime:1000,warnThreshold:0.8,action:"warn"}},B=null;function w(){if(!B)B=new W;return B}var _=new Proxy({},{get(j,F){return w()[F]}});function v(j=w()){j.setBudgets(H)}function K(){B=null}
14
- export{I as uA,z as vA,A as wA,G as xA,X as yA,M as zA,P as AA,R as BA,S as CA,W as DA,H as EA,w as FA,_ as GA,v as HA,K as IA};
14
+ export{I as Bx,z as Cx,A as Dx,G as Ex,X as Fx,M as Gx,P as Hx,R as Ix,S as Jx,W as Kx,H as Lx,w as Mx,_ as Nx,v as Ox,K as Px};
@@ -63,4 +63,4 @@ var u=new Set;function x(){return{open(f){u.add(f),f.send(JSON.stringify({type:"
63
63
  })();
64
64
  </script>
65
65
  `}
66
- export{x as sc,q as tc,z as uc,A as vc,B as wc,C as xc,D as yc,E as zc,F as Ac,J as Bc};
66
+ export{x as oc,q as pc,z as qc,A as rc,B as sc,C as tc,D as uc,E as vc,F as wc,J as xc};
@@ -0,0 +1,66 @@
1
+ // @bun
2
+ import{sp as S,tp as g}from"./chunk-m59y310j.js";import{Er as M,Ls as E,Sr as T,ur as Q}from"./chunk-w01y57f5.js";import{et as H}from"./chunk-nap11ntr.js";import{St as b}from"./chunk-kdxa9epn.js";import{Nx as W}from"./chunk-rv002yn0.js";import{vy as O}from"./chunk-jjvp4t5w.js";import{yy as k,zy as v}from"./chunk-94g3cahw.js";import{Gy as A,Iy as F}from"./chunk-ht4j68cs.js";import{Ly as y}from"./chunk-fch9tk1k.js";import{rB as d}from"./chunk-3jm3snz8.js";import Z from"path";var f={name:"bun-plugin-stx",async setup(_){let z={...await T(),..._.config?.stx},w=new Set,x=z.webComponents?.enabled?`./${Z.relative(Z.dirname(_.config?.outdir||"dist"),z.webComponents.outputDir||"dist/web-components")}`:"/web-components",R=[];if(z.webComponents?.enabled)try{let q=await M(z,w);if(R.push(...q),z.debug&&q.length>0)console.log(`Successfully built ${q.length} web components`)}catch(q){console.error("Failed to build web components:",q)}_.onLoad({filter:/\.stx$/},async({path:q})=>{try{let K=new Set;if(z.cache&&z.cachePath){let B=await S(q,z);if(B){if(z.debug)console.log(`Using cached version of ${q}`);return{contents:B,loader:"html"}}}let G=await O(()=>Bun.file(q).text(),"",(B)=>{throw new F(`Failed to read stx file: ${q}`,q,void 0,void 0,`File read error: ${B.message}`)});if(!G)throw new F(`stx file is empty: ${q}`,q);let{scriptContent:U,templateContent:$,allScripts:X}=W.time("script-extraction",()=>{let B=G,N=G.match(/<template\b(?![^>]*(?:\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=|\s#[\w-]|\bv-slot|\bslot\s*=))[^>]*>([\s\S]*?)<\/template>/i);if(N)B=N[1].trim();let Y=G.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],D="",I=[];for(let V of Y){let u=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",L=V.match(/<script\b([^>]*)>/i),P=L?L[1]:"";if(/\bserver\b/i.test(P))D=u;else I.push(V)}let m=B.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:D,templateContent:m,allScripts:I}}),j={__filename:q,__dirname:Z.dirname(q),__stx:{webComponentsPath:x,builtComponents:R}};await O(()=>H(U,j,q),void 0,(B)=>{let N=new A(`Script execution failed in ${q}: ${B.message}`,q,void 0,void 0,U.substring(0,100));if(k.log(N,{filePath:q,scriptContent:U}),z.debug)throw N});let J=await W.timeAsync("directive-processing",async()=>{return await E($,j,q,z,K)});if(X.length>0){let{interpolateScriptsInTemplate:B}=await import("././expressions.js"),N=B(X.join(`
3
+ `),j),Y=J.search(/<\/body>/i);if(Y!==-1)J=J.slice(0,Y)+N+`
4
+ `+J.slice(Y);else J+=`
5
+ ${N}`}if(J=await b(J),K.forEach((B)=>w.add(B)),z.cache&&z.cachePath){if(await g(q,J,K,z),z.debug)console.log(`Cached template ${q} with ${K.size} dependencies`)}return{contents:J,loader:"html"}}catch(K){let G=K instanceof Error?K:new A(`Plugin processing failed: ${String(K)}`,q);if(k.log(G,{filePath:q,buildConfig:_.config}),v.logDetailedError(G,{filePath:q,plugin:"bun-plugin-stx"}),z.debug)console.error("stx Plugin Error:",G);let U=G,$=U.line||null,X=U.context||null;return{contents:z.debug||y()?`<!DOCTYPE html>
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="UTF-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
+ <title>stx Rendering Error</title>
11
+ <style>
12
+ body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; line-height: 1.6; }
13
+ .error-header { color: #dc3545; border-left: 4px solid #dc3545; padding-left: 16px; margin-bottom: 24px; }
14
+ .error-details { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 16px; margin: 16px 0; }
15
+ .error-code { background: #2d3748; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; font-family: 'Monaco', 'Menlo', monospace; font-size: 14px; }
16
+ .help-section { background: #e3f2fd; border-left: 4px solid #2196f3; padding: 16px; margin-top: 24px; }
17
+ .file-path { font-family: monospace; background: #f1f3f4; padding: 2px 6px; border-radius: 4px; }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <div class="error-header">
22
+ <h1>stx Template Error</h1>
23
+ <p>An error occurred while processing your stx template.</p>
24
+ </div>
25
+
26
+ <div class="error-details">
27
+ <h3>Error Details</h3>
28
+ <p><strong>File:</strong> <span class="file-path">${Q(q)}</span></p>
29
+ <p><strong>Error:</strong> ${Q(G.message)}</p>
30
+ ${$?`<p><strong>Line:</strong> ${Q(String($))}</p>`:""}
31
+ ${X?`<p><strong>Context:</strong> ${Q(String(X))}</p>`:""}
32
+ </div>
33
+
34
+ ${G.stack?`
35
+ <div class="error-details">
36
+ <h3>Stack Trace</h3>
37
+ <pre class="error-code">${Q(G.stack)}</pre>
38
+ </div>`:""}
39
+
40
+ <div class="help-section">
41
+ <h3>Troubleshooting Tips</h3>
42
+ <ul>
43
+ <li>Check the syntax of your stx directives (e.g., @if, @foreach)</li>
44
+ <li>Verify that all variables used in the template are properly defined</li>
45
+ <li>Ensure script tags have valid JavaScript/TypeScript syntax</li>
46
+ <li>Run <code>stx debug ${Q(Z.basename(q))}</code> for detailed analysis</li>
47
+ <li>Enable debug mode in your stx config for more detailed error messages</li>
48
+ </ul>
49
+ </div>
50
+ </body>
51
+ </html>`:`<!DOCTYPE html>
52
+ <html lang="en">
53
+ <head>
54
+ <meta charset="UTF-8">
55
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
56
+ <title>Error</title>
57
+ <style>
58
+ body { font-family: system-ui, -apple-system, sans-serif; max-width: 600px; margin: 80px auto; padding: 20px; text-align: center; color: #333; }
59
+ </style>
60
+ </head>
61
+ <body>
62
+ <h1>Something went wrong</h1>
63
+ <p>An internal error occurred. Please try again later.</p>
64
+ </body>
65
+ </html>`,loader:"html"}}})}},t=f;
66
+ export{f as qf,t as rf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Kk as x,Lk as C}from"./chunk-1htmc8mb.js";import{Yk as U,bl as k}from"./chunk-kqtchwz7.js";import{jE as q}from"./chunk-6r70w54p.js";import{resolve as B,basename as F,extname as T,join as z}from"path";import{mkdir as R}from"fs/promises";async function X(){try{return await import("ts-images")}catch{return null}}function A(K){switch(K){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function P(K,L){let N=L?A(L):A("web"),G=K.formatQuality||{};return{jpeg:{...N.jpeg,...G.jpeg},png:{...N.png,...G.png},webp:{...N.webp,...G.webp},avif:{...N.avif,...G.avif}}}async function f(K,L,N){let G=await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:K,processed:!1};let w=await x(K,L,N);if(w)return w;try{let O=B(K);if(!await k(O))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let J=P(N,L.preset),Y=N.outputDir||"dist/images",E=N.baseUrl||"/images";await R(Y,{recursive:!0});let Z=await U(O),H=F(K,T(K)),S=L.outputFormat?[L.outputFormat]:N.defaultFormats||["avif","webp","jpeg"],M={src:K,processed:!0,variants:[],hash:Z},_=null;if(L.transformations&&L.transformations.length>0)_=await d(O,L.transformations,G);for(let V of S){let $=J[V]||{},j=`${H}-${Z}.${V}`,v=z(Y,j);try{let W=await G.optimizeImage({input:_||O,output:v,format:V,quality:$.quality,progressive:$.progressive});if(W){if(M.variants.push({path:v,url:`${E}/${j}`,width:W.width||0,height:W.height||0,format:V,size:W.outputSize||0}),!M.originalWidth&&W.width)M.originalWidth=W.width,M.originalHeight=W.height}}catch(W){M.errors=M.errors||[],M.errors.push(`Failed to optimize ${V}: ${W}`)}}if(L.embedThumbhash||L.placeholder==="thumbhash")try{let V=await G.generateThumbHash(O);M.placeholder=V.dataUrl}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to generate thumbhash: ${V}`)}if(L.useDominantColor)try{let V=await G.generatePlaceholder(O,{strategy:"dominant-color"});M.dominantColor=V.dominantColor}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to extract dominant color: ${V}`)}return await C(K,L,M,N),M}catch(O){return{src:K,processed:!1,errors:[`Processing failed: ${O}`]}}}async function n(K,L,N,G){let w=await X();if(!w)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await w.optimizeImage({input:K,output:G,format:L,quality:N}))?.outputSize}}catch(O){return{success:!1,error:String(O)}}}async function d(K,L,N){let G=N||await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let w=await G.decode(K);for(let O of L){let J=O.options||{};switch(O.type){case"resize":if(J.width||J.height)w=await G.resize(w,{width:J.width,height:J.height,fit:J.fit});break;case"blur":if(J.sigma!==void 0)w=await G.blur(w,J.sigma);break;case"sharpen":if(J.amount!==void 0)w=await G.sharpen(w,J.amount);break;case"grayscale":w=await G.grayscale(w);break;case"rotate":if(J.angle!==void 0)w=await G.rotate(w,J.angle);break;case"flip":w=await G.flip(w);break;case"flop":w=await G.flop(w);break;case"brightness":if(J.value!==void 0)w=await G.brightness(w,J.value);break;case"contrast":if(J.value!==void 0)w=await G.contrast(w,J.value);break;case"saturation":if(J.value!==void 0)w=await G.saturation(w,J.value);break}}return await G.encode(w,"png")}catch(w){return console.error(`[stx-media] Transformation failed: ${w}`),null}}
3
- export{f as Gk,n as Hk,d as Ik};
2
+ import{Ek as x,Fk as C}from"./chunk-5q87fgkk.js";import{Sk as U,Xk as k}from"./chunk-5ggw1dyv.js";import{rB as q}from"./chunk-3jm3snz8.js";import{resolve as B,basename as F,extname as T,join as z}from"path";import{mkdir as R}from"fs/promises";async function X(){try{return await import("ts-images")}catch{return null}}function A(K){switch(K){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function P(K,L){let N=L?A(L):A("web"),G=K.formatQuality||{};return{jpeg:{...N.jpeg,...G.jpeg},png:{...N.png,...G.png},webp:{...N.webp,...G.webp},avif:{...N.avif,...G.avif}}}async function f(K,L,N){let G=await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:K,processed:!1};let w=await x(K,L,N);if(w)return w;try{let O=B(K);if(!await k(O))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let J=P(N,L.preset),Y=N.outputDir||"dist/images",E=N.baseUrl||"/images";await R(Y,{recursive:!0});let Z=await U(O),H=F(K,T(K)),S=L.outputFormat?[L.outputFormat]:N.defaultFormats||["avif","webp","jpeg"],M={src:K,processed:!0,variants:[],hash:Z},_=null;if(L.transformations&&L.transformations.length>0)_=await d(O,L.transformations,G);for(let V of S){let $=J[V]||{},j=`${H}-${Z}.${V}`,v=z(Y,j);try{let W=await G.optimizeImage({input:_||O,output:v,format:V,quality:$.quality,progressive:$.progressive});if(W){if(M.variants.push({path:v,url:`${E}/${j}`,width:W.width||0,height:W.height||0,format:V,size:W.outputSize||0}),!M.originalWidth&&W.width)M.originalWidth=W.width,M.originalHeight=W.height}}catch(W){M.errors=M.errors||[],M.errors.push(`Failed to optimize ${V}: ${W}`)}}if(L.embedThumbhash||L.placeholder==="thumbhash")try{let V=await G.generateThumbHash(O);M.placeholder=V.dataUrl}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to generate thumbhash: ${V}`)}if(L.useDominantColor)try{let V=await G.generatePlaceholder(O,{strategy:"dominant-color"});M.dominantColor=V.dominantColor}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to extract dominant color: ${V}`)}return await C(K,L,M,N),M}catch(O){return{src:K,processed:!1,errors:[`Processing failed: ${O}`]}}}async function n(K,L,N,G){let w=await X();if(!w)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await w.optimizeImage({input:K,output:G,format:L,quality:N}))?.outputSize}}catch(O){return{success:!1,error:String(O)}}}async function d(K,L,N){let G=N||await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let w=await G.decode(K);for(let O of L){let J=O.options||{};switch(O.type){case"resize":if(J.width||J.height)w=await G.resize(w,{width:J.width,height:J.height,fit:J.fit});break;case"blur":if(J.sigma!==void 0)w=await G.blur(w,J.sigma);break;case"sharpen":if(J.amount!==void 0)w=await G.sharpen(w,J.amount);break;case"grayscale":w=await G.grayscale(w);break;case"rotate":if(J.angle!==void 0)w=await G.rotate(w,J.angle);break;case"flip":w=await G.flip(w);break;case"flop":w=await G.flop(w);break;case"brightness":if(J.value!==void 0)w=await G.brightness(w,J.value);break;case"contrast":if(J.value!==void 0)w=await G.contrast(w,J.value);break;case"saturation":if(J.value!==void 0)w=await G.saturation(w,J.value);break}}return await G.encode(w,"png")}catch(w){return console.error(`[stx-media] Transformation failed: ${w}`),null}}
3
+ export{f as Ak,n as Bk,d as Ck};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Pm as O,Qm as U,Rm as V,Tm as k,Um as x,Xm as F,an as w}from"./chunk-my0qmjw4.js";import{rz as C}from"./chunk-e792k31a.js";var R=new Map;function l(){R.clear()}async function D(X,P){let q=`${X}:${JSON.stringify(P)}`;if(R.has(q))return R.get(q);try{let G=await x(X,P);return R.set(q,G),G}catch{return null}}function I(){return C({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(X,P,q)=>{let{src:G,alt:Z,options:J}=f(X,P,q);if(!G)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let $={widths:J.widths||(J.width?[J.width]:O),formats:J.formats||U,quality:J.quality||V,placeholder:(J.placeholder==="color"?"dominant-color":J.placeholder)||"none"};if(!await k())return M(G,Z||"",J);let N=await D(G,$);if(!N)return M(G,Z||"",J);return b(N,Z||"",J)}})}function f(X,P,q){if(P.src)return{src:String(P.src),alt:String(P.alt||""),options:P.options||{}};let Z=X.trim();if(Z.startsWith("@image(")||Z.startsWith("("))Z=Z.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let J=y(Z),$=J[0]||"",B=J[1]||"",N={};if($&&!$.startsWith("/")&&!$.startsWith(".")&&!$.startsWith("http")){let j=q[$];if(typeof j==="string")$=j}if(J[2])try{if(typeof J[2]==="string")N=JSON.parse(J[2]);else N=J[2]}catch{}return{src:$,alt:B,options:N}}function y(X){let P=[],q="",G=!1,Z="",J=0,$=0;for(let B=0;B<X.length;B++){let N=X[B],j=B>0?X[B-1]:"";if((N==='"'||N==="'")&&j!=="\\"){if(!G)G=!0,Z=N;else if(N===Z)G=!1,Z="";else q+=N;continue}if(!G){if(N==="{")J++;if(N==="}")J--;if(N==="[")$++;if(N==="]")$--;if(N===","&&J===0&&$===0){P.push(q.trim()),q="";continue}}q+=N}if(q.trim())P.push(q.trim());return P}function M(X,P,q){let G=[`src="${Y(X)}"`];if(P)G.push(`alt="${Y(P)}"`);if(q.width)G.push(`width="${q.width}"`);if(q.height)G.push(`height="${q.height}"`);if(q.class)G.push(`class="${Y(q.class)}"`);if(q.style)G.push(`style="${Y(q.style)}"`);if(q.lazy!==!1)G.push('loading="lazy"');return G.push('decoding="async"'),`<img ${G.join(" ")} />`}function b(X,P,q){let{variants:G,placeholder:Z,width:J,height:$,aspectRatio:B}=X,N=new Map;for(let H of G){let W=N.get(H.format)||[];W.push(H),N.set(H.format,W)}let j=["avif","webp","jpeg","png"],L=[];for(let H of j){let W=N.get(H);if(W&&W.length>0){let T=F(W),u=w(H),v=q.sizes||"100vw";L.push(` <source type="${u}" srcset="${Y(T)}" sizes="${Y(v)}" />`)}}let _=N.get("jpeg")||[],E=_.length>0?_[Math.floor(_.length/2)]:G[Math.floor(G.length/2)],z=[`src="${E?.url||X.src}"`,`alt="${Y(P)}"`];if(q.width||J)z.push(`width="${q.width||J}"`);if(q.height||$)z.push(`height="${q.height||$}"`);if(q.class)z.push(`class="${Y(q.class)}"`);let K=[];if(B)K.push(`aspect-ratio: ${B.toFixed(4)}`);if(q.style)K.push(q.style);if(K.length>0)z.push(`style="${K.join("; ")}"`);if(q.lazy!==!1&&!q.priority)z.push('loading="lazy"');if(z.push('decoding="async"'),q.priority)z.push('fetchpriority="high"');let Q=`<picture>
2
+ import{Jm as O,Km as U,Lm as V,Nm as k,Om as x,Rm as F,Wm as w}from"./chunk-cygfdk1n.js";import{yw as C}from"./chunk-ywkrxp2h.js";var R=new Map;function l(){R.clear()}async function D(X,P){let q=`${X}:${JSON.stringify(P)}`;if(R.has(q))return R.get(q);try{let G=await x(X,P);return R.set(q,G),G}catch{return null}}function I(){return C({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(X,P,q)=>{let{src:G,alt:Z,options:J}=f(X,P,q);if(!G)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let $={widths:J.widths||(J.width?[J.width]:O),formats:J.formats||U,quality:J.quality||V,placeholder:(J.placeholder==="color"?"dominant-color":J.placeholder)||"none"};if(!await k())return M(G,Z||"",J);let N=await D(G,$);if(!N)return M(G,Z||"",J);return b(N,Z||"",J)}})}function f(X,P,q){if(P.src)return{src:String(P.src),alt:String(P.alt||""),options:P.options||{}};let Z=X.trim();if(Z.startsWith("@image(")||Z.startsWith("("))Z=Z.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let J=y(Z),$=J[0]||"",B=J[1]||"",N={};if($&&!$.startsWith("/")&&!$.startsWith(".")&&!$.startsWith("http")){let j=q[$];if(typeof j==="string")$=j}if(J[2])try{if(typeof J[2]==="string")N=JSON.parse(J[2]);else N=J[2]}catch{}return{src:$,alt:B,options:N}}function y(X){let P=[],q="",G=!1,Z="",J=0,$=0;for(let B=0;B<X.length;B++){let N=X[B],j=B>0?X[B-1]:"";if((N==='"'||N==="'")&&j!=="\\"){if(!G)G=!0,Z=N;else if(N===Z)G=!1,Z="";else q+=N;continue}if(!G){if(N==="{")J++;if(N==="}")J--;if(N==="[")$++;if(N==="]")$--;if(N===","&&J===0&&$===0){P.push(q.trim()),q="";continue}}q+=N}if(q.trim())P.push(q.trim());return P}function M(X,P,q){let G=[`src="${Y(X)}"`];if(P)G.push(`alt="${Y(P)}"`);if(q.width)G.push(`width="${q.width}"`);if(q.height)G.push(`height="${q.height}"`);if(q.class)G.push(`class="${Y(q.class)}"`);if(q.style)G.push(`style="${Y(q.style)}"`);if(q.lazy!==!1)G.push('loading="lazy"');return G.push('decoding="async"'),`<img ${G.join(" ")} />`}function b(X,P,q){let{variants:G,placeholder:Z,width:J,height:$,aspectRatio:B}=X,N=new Map;for(let H of G){let W=N.get(H.format)||[];W.push(H),N.set(H.format,W)}let j=["avif","webp","jpeg","png"],L=[];for(let H of j){let W=N.get(H);if(W&&W.length>0){let T=F(W),u=w(H),v=q.sizes||"100vw";L.push(` <source type="${u}" srcset="${Y(T)}" sizes="${Y(v)}" />`)}}let _=N.get("jpeg")||[],E=_.length>0?_[Math.floor(_.length/2)]:G[Math.floor(G.length/2)],z=[`src="${E?.url||X.src}"`,`alt="${Y(P)}"`];if(q.width||J)z.push(`width="${q.width||J}"`);if(q.height||$)z.push(`height="${q.height||$}"`);if(q.class)z.push(`class="${Y(q.class)}"`);let K=[];if(B)K.push(`aspect-ratio: ${B.toFixed(4)}`);if(q.style)K.push(q.style);if(K.length>0)z.push(`style="${K.join("; ")}"`);if(q.lazy!==!1&&!q.priority)z.push('loading="lazy"');if(z.push('decoding="async"'),q.priority)z.push('fetchpriority="high"');let Q=`<picture>
3
3
  `;if(Q+=L.join(`
4
4
  `)+`
5
5
  `,Q+=` <img ${z.join(" ")} />
@@ -9,4 +9,4 @@ ${Q}
9
9
  ${Q}
10
10
  </div>`}}if(q.priority&&E){let H=w(E.format);Q=`<link rel="preload" as="image" href="${Y(E.url)}" type="${H}" />
11
11
  `+Q}return Q}function Y(X){return X.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var h=I();
12
- export{l as dm,I as em,h as fm};
12
+ export{l as Zl,I as _l,h as $l};