@stacksjs/stx 0.2.94 → 0.2.95

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 (551) 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-eh8hact1.js → chunk-04n64bnt.js} +1 -1
  37. package/dist/{chunk-yexjrg9d.js → chunk-06w68hyg.js} +2 -2
  38. package/dist/{chunk-4j188175.js → chunk-07y6m5xx.js} +1 -1
  39. package/dist/{chunk-b3kkjcdh.js → chunk-09k66d8a.js} +1 -1
  40. package/dist/{chunk-bk8ew8ze.js → chunk-0a61y94n.js} +2 -2
  41. package/dist/{chunk-qdc3aav1.js → chunk-0dx4q6yq.js} +1 -1
  42. package/dist/{chunk-k8440jxh.js → chunk-0p0nyq50.js} +2 -2
  43. package/dist/{chunk-5qb761h2.js → chunk-0p1h3p3w.js} +1 -1
  44. package/dist/{chunk-znxp3zha.js → chunk-10debkj5.js} +1 -1
  45. package/dist/{chunk-bgec9r1v.js → chunk-15nesxgt.js} +2 -2
  46. package/dist/{chunk-mv03qb75.js → chunk-1sr54zp8.js} +1 -1
  47. package/dist/{chunk-0jkwrcwj.js → chunk-1v49fwr5.js} +1 -1
  48. package/dist/{chunk-w01y57f5.js → chunk-1xz0w746.js} +2 -2
  49. package/dist/{chunk-w4n8fqp7.js → chunk-20swzkx3.js} +1 -1
  50. package/dist/{chunk-cz25azze.js → chunk-27zsyhrd.js} +1 -1
  51. package/dist/{chunk-hjdc99kb.js → chunk-29y0hk5z.js} +2 -2
  52. package/dist/{chunk-tx6br9r4.js → chunk-2cdvw21b.js} +1 -1
  53. package/dist/{chunk-g2hekckm.js → chunk-2j21d3ka.js} +1 -1
  54. package/dist/chunk-2jxbwnkz.js +2 -0
  55. package/dist/{chunk-8fgwhhb8.js → chunk-31dr4bys.js} +2 -2
  56. package/dist/{chunk-x64kb787.js → chunk-35faj94w.js} +1 -1
  57. package/dist/{chunk-9yz5d003.js → chunk-3a4qsygv.js} +2 -2
  58. package/dist/{chunk-1z2yq9em.js → chunk-3te20hqw.js} +2 -2
  59. package/dist/{chunk-aw3rp9ac.js → chunk-43t7faps.js} +1 -1
  60. package/dist/{chunk-0m9tdm7t.js → chunk-47kpewks.js} +1 -1
  61. package/dist/{chunk-cygfdk1n.js → chunk-4d2y57k7.js} +2 -2
  62. package/dist/{chunk-0tatqxj2.js → chunk-4deg33rw.js} +2 -2
  63. package/dist/{chunk-a69tvya5.js → chunk-4qcy5tx6.js} +2 -2
  64. package/dist/{chunk-d77yxcds.js → chunk-4x7kae4j.js} +2 -2
  65. package/dist/{chunk-g8b81pzc.js → chunk-55nwdnsd.js} +1 -1
  66. package/dist/{chunk-svahbw0w.js → chunk-5f43yz6z.js} +2 -2
  67. package/dist/{chunk-fch9tk1k.js → chunk-5shey2e4.js} +1 -1
  68. package/dist/{chunk-nanw7yhz.js → chunk-6djzdes9.js} +1 -1
  69. package/dist/{chunk-yj560gp8.js → chunk-6eqbxcrd.js} +1 -1
  70. package/dist/{chunk-03c26pjz.js → chunk-7074g241.js} +1 -1
  71. package/dist/{chunk-e0zytzdh.js → chunk-7b6s3g65.js} +1 -1
  72. package/dist/{chunk-77tga15w.js → chunk-7dkz6z2s.js} +2 -2
  73. package/dist/{chunk-q60knhjf.js → chunk-7ed3tean.js} +1 -1
  74. package/dist/{chunk-b0cyc09a.js → chunk-7gd339hd.js} +1 -1
  75. package/dist/{chunk-xsqbk4yk.js → chunk-7j5e8sdj.js} +2 -2
  76. package/dist/{chunk-52agge4n.js → chunk-7n8g0nfn.js} +1 -1
  77. package/dist/{chunk-cn409b69.js → chunk-80g54ncj.js} +1 -1
  78. package/dist/{chunk-w21mwxdd.js → chunk-8a5bxece.js} +1 -1
  79. package/dist/{chunk-7rvh2wwv.js → chunk-8ahwt6a4.js} +1 -1
  80. package/dist/{chunk-fhawx87n.js → chunk-8b3z0zd5.js} +1 -1
  81. package/dist/{chunk-y86m1wr4.js → chunk-8dhdpa5h.js} +2 -2
  82. package/dist/{chunk-hje9v2zh.js → chunk-8n9nnqr6.js} +1 -1
  83. package/dist/{chunk-rb1e4cnb.js → chunk-8qc1bsym.js} +1 -1
  84. package/dist/{chunk-bwxda6n1.js → chunk-8va64c9n.js} +2 -2
  85. package/dist/{chunk-hrampcrj.js → chunk-8vtm0m84.js} +1 -1
  86. package/dist/{chunk-cp3kwv17.js → chunk-8xj7c3mf.js} +1 -1
  87. package/dist/{chunk-fe7r1mq1.js → chunk-988dw6q3.js} +2 -2
  88. package/dist/{chunk-wk07pwtd.js → chunk-9b6cec0v.js} +1 -1
  89. package/dist/{chunk-13yz561y.js → chunk-9cf97f9p.js} +2 -2
  90. package/dist/{chunk-rv002yn0.js → chunk-9ecv8aqj.js} +1 -1
  91. package/dist/{chunk-jbejwejg.js → chunk-9eq3ht5f.js} +1 -1
  92. package/dist/{chunk-dzw95th7.js → chunk-9jtj77jx.js} +2 -2
  93. package/dist/{chunk-57p201gb.js → chunk-9t14se2t.js} +1 -1
  94. package/dist/{chunk-qd5461tt.js → chunk-9wmq2272.js} +1 -1
  95. package/dist/{chunk-qm4yppj5.js → chunk-9zbk5zx5.js} +2 -2
  96. package/dist/{chunk-7b0xdy5h.js → chunk-a2g2qb2y.js} +1 -1
  97. package/dist/{chunk-26r6zh3t.js → chunk-a87qqft6.js} +2 -2
  98. package/dist/{chunk-5kt3ay7x.js → chunk-ah88wzbg.js} +1 -1
  99. package/dist/{chunk-0wdar532.js → chunk-akf1r75r.js} +1 -1
  100. package/dist/{chunk-wxvyj65q.js → chunk-amaa1bev.js} +1 -1
  101. package/dist/{chunk-ganag9dm.js → chunk-avx8aydt.js} +2 -2
  102. package/dist/{chunk-mgmyr1b9.js → chunk-ay9qf4zj.js} +1 -1
  103. package/dist/{chunk-haecq01c.js → chunk-aywxfqev.js} +1 -1
  104. package/dist/{chunk-4bt81cg3.js → chunk-azkegjd8.js} +1 -1
  105. package/dist/{chunk-e53h9qhd.js → chunk-b77wjyn7.js} +1 -1
  106. package/dist/{chunk-jfm69keq.js → chunk-baf1hfwh.js} +2 -2
  107. package/dist/{chunk-hke99a0v.js → chunk-bdk6g1vj.js} +2 -2
  108. package/dist/{chunk-kkp6rs2n.js → chunk-bhqgmyqw.js} +1 -1
  109. package/dist/{chunk-fs0qezn5.js → chunk-bk3j0n82.js} +1 -1
  110. package/dist/{chunk-sn07azv3.js → chunk-bndmdahk.js} +2 -2
  111. package/dist/{chunk-mrehzhxv.js → chunk-bs3gmfxz.js} +1 -1
  112. package/dist/{chunk-yach037f.js → chunk-bxc7kjsk.js} +1 -1
  113. package/dist/{chunk-gqpkp459.js → chunk-ckxjqqn9.js} +2 -2
  114. package/dist/{chunk-ncnfa8ae.js → chunk-d0zjtdw4.js} +2 -2
  115. package/dist/{chunk-qfwzdffx.js → chunk-d1qh1x2g.js} +2 -2
  116. package/dist/{chunk-gcf5v18y.js → chunk-djddhmcc.js} +1 -1
  117. package/dist/{chunk-fms20x0n.js → chunk-dqn9gyhb.js} +1 -1
  118. package/dist/{chunk-6w03t7h6.js → chunk-drjq2zwg.js} +2 -2
  119. package/dist/{chunk-91s2hres.js → chunk-e2q9c5vq.js} +1 -1
  120. package/dist/{chunk-3ngm57nt.js → chunk-e98v1bc6.js} +2 -2
  121. package/dist/chunk-ejayeex8.js +2 -0
  122. package/dist/{chunk-yr1gdceh.js → chunk-ejh8fyak.js} +1 -1
  123. package/dist/{chunk-6wn85hn6.js → chunk-ek2w6zvy.js} +1 -1
  124. package/dist/{chunk-7dy588as.js → chunk-ewa88139.js} +1 -1
  125. package/dist/{chunk-ht4j68cs.js → chunk-fjk3x41y.js} +2 -2
  126. package/dist/{chunk-x39sfpvm.js → chunk-frg705zq.js} +1 -1
  127. package/dist/{chunk-nap11ntr.js → chunk-g1vt329s.js} +2 -2
  128. package/dist/{chunk-6cr3eeh4.js → chunk-gkzq8zw4.js} +1 -1
  129. package/dist/{chunk-3rh7va1z.js → chunk-gz5fmp3q.js} +1 -1
  130. package/dist/{chunk-asarebzq.js → chunk-h0hjy0kn.js} +1 -1
  131. package/dist/{chunk-ywkrxp2h.js → chunk-h5jxydqq.js} +1 -1
  132. package/dist/{chunk-4qq8ffke.js → chunk-h7aq56qj.js} +1 -1
  133. package/dist/{chunk-hepg894w.js → chunk-hbehnm18.js} +2 -2
  134. package/dist/{chunk-gc84b1d2.js → chunk-hbgxbgam.js} +2 -2
  135. package/dist/{chunk-05hgyyqc.js → chunk-hc2mf5h6.js} +1 -1
  136. package/dist/{chunk-tr0z0e1g.js → chunk-hjm2xab3.js} +1 -1
  137. package/dist/{chunk-50vqeesm.js → chunk-hrnnh4tq.js} +2 -2
  138. package/dist/{chunk-hq5cem49.js → chunk-ht43ds42.js} +1 -1
  139. package/dist/{chunk-vdfwv0fp.js → chunk-hy8820vc.js} +1 -1
  140. package/dist/{chunk-vpe6napb.js → chunk-j447q024.js} +2 -2
  141. package/dist/{chunk-x4fze3q2.js → chunk-j58vh0w6.js} +1 -1
  142. package/dist/{chunk-z37xq5rx.js → chunk-j8tn8enq.js} +2 -2
  143. package/dist/{chunk-m59y310j.js → chunk-jjb05d21.js} +2 -2
  144. package/dist/{chunk-3bjtemm6.js → chunk-jjdq01dv.js} +1 -1
  145. package/dist/{chunk-b3prs7y0.js → chunk-jnmgm2xw.js} +1 -1
  146. package/dist/{chunk-5ggw1dyv.js → chunk-jpndqst5.js} +1 -1
  147. package/dist/{chunk-7sm05m0j.js → chunk-jt0ezawy.js} +1 -1
  148. package/dist/{chunk-6y4gqs1q.js → chunk-jz73j3qs.js} +1 -1
  149. package/dist/{chunk-jt98jhpt.js → chunk-k21df0pg.js} +1 -1
  150. package/dist/{chunk-zt2yag10.js → chunk-k848dzsa.js} +1 -1
  151. package/dist/{chunk-bjnjpsgn.js → chunk-kdfe4t91.js} +2 -2
  152. package/dist/{chunk-82t27pvd.js → chunk-keawsbpn.js} +1 -1
  153. package/dist/{chunk-5q87fgkk.js → chunk-khdn7jwe.js} +2 -2
  154. package/dist/{chunk-ca6qd1dx.js → chunk-km25cwz6.js} +1 -1
  155. package/dist/{chunk-pc31m5x5.js → chunk-knm8a8yx.js} +1 -1
  156. package/dist/{chunk-baa7h4yz.js → chunk-krqn0ddk.js} +2 -2
  157. package/dist/{chunk-0g4gece6.js → chunk-kx6eb6ma.js} +1 -1
  158. package/dist/{chunk-3yg9hbmb.js → chunk-kypas8vy.js} +1 -1
  159. package/dist/{chunk-7xcfy2fn.js → chunk-m167kjhv.js} +1 -1
  160. package/dist/{chunk-w959hm8j.js → chunk-m491r0rj.js} +1 -1
  161. package/dist/{chunk-x1hjv24z.js → chunk-m8448qby.js} +1 -1
  162. package/dist/{chunk-tj6zfxeb.js → chunk-mgj88zeq.js} +2 -2
  163. package/dist/{chunk-6djgb0hr.js → chunk-mhgk632d.js} +1 -1
  164. package/dist/{chunk-y5wazw6j.js → chunk-n5kg7fpx.js} +1 -1
  165. package/dist/{chunk-957amb71.js → chunk-n98x35xd.js} +1 -1
  166. package/dist/{chunk-04mvcmcr.js → chunk-n9dhs1dw.js} +1 -1
  167. package/dist/{chunk-75rndzbd.js → chunk-nd9rmddh.js} +1 -1
  168. package/dist/{chunk-y25pr13j.js → chunk-nhv099jv.js} +1 -1
  169. package/dist/{chunk-cpcc11vp.js → chunk-nm15ccsg.js} +2 -2
  170. package/dist/{chunk-z4djtgt0.js → chunk-npfmdb6y.js} +1 -1
  171. package/dist/{chunk-xhkjhxsp.js → chunk-p077sw22.js} +1 -1
  172. package/dist/{chunk-kfd2hf6f.js → chunk-p1h8065h.js} +2 -2
  173. package/dist/{chunk-647849kf.js → chunk-p3e0cqtt.js} +2 -2
  174. package/dist/{chunk-c53hyw5c.js → chunk-p3fpb79v.js} +1 -1
  175. package/dist/{chunk-adjcg6wa.js → chunk-p52yzjq6.js} +2 -2
  176. package/dist/{chunk-qgxwmagw.js → chunk-p73meypx.js} +1 -1
  177. package/dist/{chunk-bykjk6vj.js → chunk-pa9zb7ty.js} +1 -1
  178. package/dist/{chunk-qk584whs.js → chunk-pcm1vd8w.js} +1 -1
  179. package/dist/{chunk-bn08k7yy.js → chunk-pcntd9h4.js} +2 -2
  180. package/dist/{chunk-87kx8byz.js → chunk-psc3wfcf.js} +1 -1
  181. package/dist/{chunk-svhtdb0s.js → chunk-pznnww6k.js} +1 -1
  182. package/dist/{chunk-5ppkfyn2.js → chunk-q6zhd9yf.js} +1 -1
  183. package/dist/chunk-qa59zejf.js +246 -0
  184. package/dist/{chunk-hpqr9e3x.js → chunk-qvrbjpdc.js} +2 -2
  185. package/dist/{chunk-46mkpbkk.js → chunk-qygvvygy.js} +2 -2
  186. package/dist/{chunk-xygc53vr.js → chunk-r0jcmpv6.js} +1 -1
  187. package/dist/{chunk-yw2fzq86.js → chunk-r5m9xtm7.js} +2 -2
  188. package/dist/{chunk-174z0cd0.js → chunk-rpx5fa65.js} +2 -2
  189. package/dist/{chunk-tmgz5t2g.js → chunk-rqxf5hns.js} +1 -1
  190. package/dist/{chunk-5xvbq2gs.js → chunk-rtr974rc.js} +2 -2
  191. package/dist/{chunk-y4c744dk.js → chunk-rvptcndz.js} +2 -2
  192. package/dist/{chunk-25s7bckb.js → chunk-rw26rpek.js} +2 -2
  193. package/dist/{chunk-qhdtssn1.js → chunk-rw7937v4.js} +2 -2
  194. package/dist/{chunk-n46a5g1g.js → chunk-rwrv9wbf.js} +1 -1
  195. package/dist/{chunk-8qbax8xn.js → chunk-rz2ec6g7.js} +1 -1
  196. package/dist/{chunk-epj957jf.js → chunk-scpkdrdb.js} +1 -1
  197. package/dist/{chunk-q6h6yvzb.js → chunk-shv88d2d.js} +2 -2
  198. package/dist/{chunk-2w3302dh.js → chunk-t0c9wvpr.js} +1 -1
  199. package/dist/{chunk-6dqzky7x.js → chunk-tffh3b1e.js} +1 -1
  200. package/dist/{chunk-ceg2c2q2.js → chunk-tg2f1mzq.js} +2 -2
  201. package/dist/{chunk-eqeyaq6g.js → chunk-trfswy66.js} +1 -1
  202. package/dist/{chunk-t37dp99j.js → chunk-tzwtg722.js} +1 -1
  203. package/dist/{chunk-ghrx0hn1.js → chunk-v7f8jj15.js} +1 -1
  204. package/dist/{chunk-95w08s8v.js → chunk-v8j49spx.js} +1 -1
  205. package/dist/{chunk-yaan98dd.js → chunk-veeerpwa.js} +1 -1
  206. package/dist/{chunk-xcb0pbr6.js → chunk-vg5kt6az.js} +1 -1
  207. package/dist/{chunk-9tmbrwwx.js → chunk-vgv7jvyz.js} +1 -1
  208. package/dist/{chunk-2xen423s.js → chunk-vjbefncc.js} +1 -1
  209. package/dist/{chunk-jt44av4j.js → chunk-vmxjghsm.js} +1 -1
  210. package/dist/{chunk-mqwbpamc.js → chunk-vw7vqd76.js} +1 -1
  211. package/dist/{chunk-adqh2m9z.js → chunk-w3b6m427.js} +1 -1
  212. package/dist/{chunk-eds0f8f1.js → chunk-wazkqv7n.js} +2 -2
  213. package/dist/{chunk-y4md9hp0.js → chunk-wfg2gm11.js} +1 -1
  214. package/dist/{chunk-vv9wfz1c.js → chunk-wg9k6h8w.js} +2 -2
  215. package/dist/{chunk-1mmykse5.js → chunk-wkz2vwkr.js} +1 -1
  216. package/dist/{chunk-7a51hkpf.js → chunk-wvf31nzs.js} +1 -1
  217. package/dist/{chunk-dyjnn5k8.js → chunk-x05nxhyv.js} +2 -2
  218. package/dist/{chunk-kh6rfz2v.js → chunk-x0770gt9.js} +1 -1
  219. package/dist/{chunk-5p568px4.js → chunk-x24s4heg.js} +1 -1
  220. package/dist/{chunk-cdbwprfv.js → chunk-x3r64r0c.js} +2 -2
  221. package/dist/{chunk-fbxt2mrx.js → chunk-x5g9w4hh.js} +2 -2
  222. package/dist/{chunk-268adc7r.js → chunk-xgkv66q5.js} +1 -1
  223. package/dist/chunk-xqq1vxb6.js +1 -0
  224. package/dist/{chunk-qxs6et76.js → chunk-xs03kc1h.js} +1 -1
  225. package/dist/{chunk-3jm3snz8.js → chunk-xv34zbp4.js} +1 -1
  226. package/dist/{chunk-b5zc9y0y.js → chunk-xw36p73h.js} +2 -2
  227. package/dist/{chunk-j4s5qwd7.js → chunk-xyg1r5w0.js} +2 -2
  228. package/dist/{chunk-cyp4m0vh.js → chunk-xys2sxh6.js} +1 -1
  229. package/dist/{chunk-kdxa9epn.js → chunk-y1k17c8b.js} +2 -2
  230. package/dist/{chunk-cr3wbrcr.js → chunk-y6xsqe9a.js} +2 -2
  231. package/dist/{chunk-94g3cahw.js → chunk-yb1t2h8h.js} +2 -2
  232. package/dist/{chunk-vw6ejgmy.js → chunk-yj4x5ehw.js} +1 -1
  233. package/dist/{chunk-fk51yyrw.js → chunk-ynhngsdh.js} +1 -1
  234. package/dist/{chunk-vp2395eb.js → chunk-yrsb6j3z.js} +2 -2
  235. package/dist/chunk-yywfvfph.js +2 -0
  236. package/dist/{chunk-xhnpsngj.js → chunk-zcxzdrn7.js} +2 -2
  237. package/dist/{chunk-jjvp4t5w.js → chunk-zen6ax1y.js} +2 -2
  238. package/dist/{chunk-n944baxp.js → chunk-zf2pek72.js} +1 -1
  239. package/dist/{chunk-z8cjr9n9.js → chunk-zk3d0jjf.js} +1 -1
  240. package/dist/{chunk-9agvhp1x.js → chunk-zy3rp1ab.js} +1 -1
  241. package/dist/cli.js +1 -1
  242. package/dist/client/directive.js +1 -1
  243. package/dist/client/index.js +1 -1
  244. package/dist/client-helpers.js +1 -1
  245. package/dist/client-script-bundler.js +1 -1
  246. package/dist/client-script.js +1 -1
  247. package/dist/component-hmr.js +1 -1
  248. package/dist/component-processing.js +1 -1
  249. package/dist/component-registry.js +1 -1
  250. package/dist/component-renderer.js +1 -1
  251. package/dist/components.js +1 -1
  252. package/dist/composables/index.js +1 -1
  253. package/dist/composables/use-battery.js +1 -1
  254. package/dist/composables/use-broadcast-channel.js +1 -1
  255. package/dist/composables/use-channel.js +1 -1
  256. package/dist/composables/use-clipboard.js +1 -1
  257. package/dist/composables/use-color-mode.js +1 -1
  258. package/dist/composables/use-cookie.js +1 -1
  259. package/dist/composables/use-device-orientation.js +1 -1
  260. package/dist/composables/use-event-listener.js +1 -1
  261. package/dist/composables/use-event-source.js +1 -1
  262. package/dist/composables/use-eye-dropper.js +1 -1
  263. package/dist/composables/use-fetch.js +1 -1
  264. package/dist/composables/use-fullscreen.js +1 -1
  265. package/dist/composables/use-geolocation.js +1 -1
  266. package/dist/composables/use-idle.js +1 -1
  267. package/dist/composables/use-intersection-observer.js +1 -1
  268. package/dist/composables/use-keyboard.js +1 -1
  269. package/dist/composables/use-media-query.js +1 -1
  270. package/dist/composables/use-meta.js +1 -1
  271. package/dist/composables/use-mouse.js +1 -1
  272. package/dist/composables/use-mutation-observer.js +1 -1
  273. package/dist/composables/use-network.js +1 -1
  274. package/dist/composables/use-notification.js +1 -1
  275. package/dist/composables/use-permissions.js +1 -1
  276. package/dist/composables/use-resize-observer.js +1 -1
  277. package/dist/composables/use-router.js +1 -1
  278. package/dist/composables/use-share.js +1 -1
  279. package/dist/composables/use-speech.js +1 -1
  280. package/dist/composables/use-storage.js +1 -1
  281. package/dist/composables/use-text-selection.js +1 -1
  282. package/dist/composables/use-timer.js +1 -1
  283. package/dist/composables/use-utilities.js +1 -1
  284. package/dist/composables/use-wake-lock.js +1 -1
  285. package/dist/composables/use-websocket.js +1 -1
  286. package/dist/composables/use-window.js +1 -1
  287. package/dist/composables.js +1 -1
  288. package/dist/composition-api.js +1 -1
  289. package/dist/computed.js +1 -1
  290. package/dist/conditionals.js +1 -1
  291. package/dist/config.js +1 -1
  292. package/dist/craft-bridge.js +1 -1
  293. package/dist/craft-compiler.js +1 -1
  294. package/dist/craft-components.js +1 -1
  295. package/dist/craft-entry.js +1 -1
  296. package/dist/craft-ssr.js +1 -1
  297. package/dist/csp.js +1 -1
  298. package/dist/csrf.js +1 -1
  299. package/dist/custom-directives.js +1 -1
  300. package/dist/defer.js +1 -1
  301. package/dist/deploy/config-generators.js +1 -1
  302. package/dist/deploy/index.js +1 -1
  303. package/dist/deploy/netlify.js +1 -1
  304. package/dist/dev-server/crosswind.js +1 -1
  305. package/dist/dev-server/index.js +1 -1
  306. package/dist/dev-server/keyboard-shortcuts.js +1 -1
  307. package/dist/dev-server/native-window.js +1 -1
  308. package/dist/dev-server/port-utils.js +1 -1
  309. package/dist/dev-server/serve-app.js +1 -6
  310. package/dist/dev-server/serve-file.js +1 -6
  311. package/dist/dev-server/serve-markdown.js +1 -1
  312. package/dist/dev-server/serve-multi.js +1 -171
  313. package/dist/dev-server/terminal-colors.js +1 -1
  314. package/dist/dev-server/theme-selector.js +1 -1
  315. package/dist/dev-server/types.js +1 -1
  316. package/dist/dev-server.js +1 -1
  317. package/dist/devtools.js +1 -1
  318. package/dist/directive-api.js +1 -1
  319. package/dist/docs.js +1 -1
  320. package/dist/doctor.js +1 -1
  321. package/dist/document-shell.js +1 -1
  322. package/dist/dynamic-components.js +1 -1
  323. package/dist/edge-runtime.js +1 -1
  324. package/dist/env.js +1 -1
  325. package/dist/error-boundaries.js +1 -1
  326. package/dist/error-handling.js +1 -1
  327. package/dist/errors/codes.js +1 -1
  328. package/dist/errors/formatter.js +1 -1
  329. package/dist/errors/index.js +1 -1
  330. package/dist/errors/logger.js +1 -1
  331. package/dist/errors/sanitizer.js +1 -1
  332. package/dist/errors/types.js +1 -1
  333. package/dist/events.js +1 -1
  334. package/dist/expressions.js +1 -1
  335. package/dist/formatter.js +1 -1
  336. package/dist/forms-validation.js +1 -1
  337. package/dist/forms.js +1 -1
  338. package/dist/head.js +1 -1
  339. package/dist/heatmap.js +1 -1
  340. package/dist/hot-reload.js +1 -1
  341. package/dist/html-masking.js +1 -1
  342. package/dist/hydration-runtime.js +1 -1
  343. package/dist/hydration.js +1 -1
  344. package/dist/i18n.js +1 -1
  345. package/dist/image-optimization/auto-sibling.js +1 -1
  346. package/dist/image-optimization/build-plugin.js +1 -1
  347. package/dist/image-optimization/component.js +1 -1
  348. package/dist/image-optimization/directive.js +1 -1
  349. package/dist/image-optimization/index.js +1 -1
  350. package/dist/image-optimization/processor.js +1 -1
  351. package/dist/image-optimization/serve.js +1 -1
  352. package/dist/includes.js +1 -1
  353. package/dist/index.js +1 -1
  354. package/dist/init.js +1 -1
  355. package/dist/inline-assets.js +1 -1
  356. package/dist/interactive.js +1 -1
  357. package/dist/internal-markdown.js +1 -1
  358. package/dist/island-chunking.js +1 -1
  359. package/dist/js-ts.js +1 -1
  360. package/dist/jsx-runtime.js +1 -1
  361. package/dist/keep-alive.js +1 -1
  362. package/dist/lazy-loader.js +1 -1
  363. package/dist/loading-indicator.js +1 -1
  364. package/dist/loops.js +1 -1
  365. package/dist/manifest.js +1 -1
  366. package/dist/markdown.js +1 -1
  367. package/dist/media/client/blur-up.js +1 -1
  368. package/dist/media/client/index.js +1 -1
  369. package/dist/media/client/lazy-load.js +1 -1
  370. package/dist/media/client/upload-handler.js +1 -1
  371. package/dist/media/image/component.js +1 -1
  372. package/dist/media/image/directive.js +1 -1
  373. package/dist/media/image/editing.js +1 -1
  374. package/dist/media/image/index.js +1 -1
  375. package/dist/media/image/placeholder.js +1 -1
  376. package/dist/media/image/processor/cache.js +1 -1
  377. package/dist/media/image/processor/index.js +1 -1
  378. package/dist/media/image/processor/optimizer.js +1 -1
  379. package/dist/media/image/processor/responsive.js +1 -1
  380. package/dist/media/image/srcset.js +1 -1
  381. package/dist/media/index.js +1 -1
  382. package/dist/media/manager/embed.js +1 -1
  383. package/dist/media/protected/component.js +1 -1
  384. package/dist/media/protected/index.js +1 -1
  385. package/dist/media/protected/signature.js +1 -1
  386. package/dist/media/shared/cache.js +1 -1
  387. package/dist/media/shared/hash.js +1 -1
  388. package/dist/media/shared/index.js +1 -1
  389. package/dist/media/upload/component.js +1 -1
  390. package/dist/media/upload/index.js +1 -1
  391. package/dist/media/video/directive.js +1 -1
  392. package/dist/media/video/index.js +1 -1
  393. package/dist/media/video/processor/cache.js +1 -1
  394. package/dist/media/video/processor/index.js +1 -1
  395. package/dist/media/video/processor/streaming.js +1 -1
  396. package/dist/media/video/processor/thumbnail.js +1 -1
  397. package/dist/media/video/processor/transcoder.js +1 -1
  398. package/dist/method-spoofing.js +1 -1
  399. package/dist/middleware.js +1 -1
  400. package/dist/misc-directives.js +1 -1
  401. package/dist/native-build.js +1 -1
  402. package/dist/parser/directive-parser.js +1 -1
  403. package/dist/parser/expression-parser.js +1 -1
  404. package/dist/parser/index.js +1 -1
  405. package/dist/parser/tokenizer.js +1 -1
  406. package/dist/partial-hydration.js +1 -1
  407. package/dist/performance-utils.js +1 -1
  408. package/dist/placeholder.js +1 -1
  409. package/dist/plugin-system.js +1 -1
  410. package/dist/plugin.js +1 -1
  411. package/dist/precompiler.js +1 -1
  412. package/dist/process.js +1 -1
  413. package/dist/production-build.js +1 -1
  414. package/dist/production-builder.js +1 -1
  415. package/dist/production-server.js +1 -1
  416. package/dist/props.js +1 -1
  417. package/dist/public-env.js +1 -1
  418. package/dist/pwa/audit.js +1 -1
  419. package/dist/pwa/directives.js +1 -1
  420. package/dist/pwa/icons.js +1 -1
  421. package/dist/pwa/index.js +1 -1
  422. package/dist/pwa/inject.js +1 -1
  423. package/dist/pwa/manifest.js +1 -1
  424. package/dist/pwa/offline.js +1 -1
  425. package/dist/pwa/precache.js +1 -1
  426. package/dist/pwa/service-worker.js +1 -1
  427. package/dist/pwa/workbox-strategies.js +1 -1
  428. package/dist/pwa/workbox.js +1 -1
  429. package/dist/reactive-bindings.js +1 -1
  430. package/dist/reactive.js +1 -1
  431. package/dist/reactivity.js +1 -1
  432. package/dist/release.js +1 -1
  433. package/dist/render.js +1 -1
  434. package/dist/route-middleware.js +1 -1
  435. package/dist/router.js +1 -1
  436. package/dist/routes.js +1 -1
  437. package/dist/runtime-injection.js +1 -1
  438. package/dist/runtime.js +1 -1
  439. package/dist/safe-evaluator.js +1 -1
  440. package/dist/scaffolding.js +1 -1
  441. package/dist/screenshot.js +1 -1
  442. package/dist/script-classifier.js +1 -1
  443. package/dist/script-validation.js +1 -1
  444. package/dist/seo.js +1 -1
  445. package/dist/serve.js +1 -1
  446. package/dist/server-bindings.js +1 -1
  447. package/dist/server-components.js +1 -1
  448. package/dist/signal-processing.js +1 -1
  449. package/dist/signals-api.js +1 -1
  450. package/dist/signals.js +1 -1
  451. package/dist/site-builder/build.js +1 -1
  452. package/dist/site-builder/i18n.js +1 -1
  453. package/dist/site-builder/index.js +1 -1
  454. package/dist/site-builder/robots.js +1 -1
  455. package/dist/site-builder/router.js +1 -1
  456. package/dist/site-builder/seo.js +1 -1
  457. package/dist/site-builder/sitemap.js +1 -1
  458. package/dist/site-builder/theme.js +1 -1
  459. package/dist/slots.js +1 -1
  460. package/dist/source-maps.js +1 -1
  461. package/dist/spa-shell.js +1 -1
  462. package/dist/ssr.js +1 -1
  463. package/dist/state-management.js +1 -1
  464. package/dist/store-imports.js +1 -1
  465. package/dist/store-loader.js +1 -1
  466. package/dist/stores-client.js +1 -1
  467. package/dist/story/addons.js +1 -1
  468. package/dist/story/analytics.js +1 -1
  469. package/dist/story/auto-stories.js +1 -1
  470. package/dist/story/bookmarks.js +1 -1
  471. package/dist/story/bun-test.js +1 -1
  472. package/dist/story/cli.js +1 -1
  473. package/dist/story/collect/analyzer.js +1 -1
  474. package/dist/story/collect/index.js +1 -1
  475. package/dist/story/collect/parser.js +1 -1
  476. package/dist/story/collect/scanner.js +1 -1
  477. package/dist/story/collect/tree.js +1 -1
  478. package/dist/story/commands/build.js +1 -1
  479. package/dist/story/commands/dev.js +1 -1
  480. package/dist/story/commands/index.js +1 -1
  481. package/dist/story/commands/preview.js +1 -1
  482. package/dist/story/compiled-output.js +1 -1
  483. package/dist/story/composition.js +1 -1
  484. package/dist/story/config-watcher.js +1 -1
  485. package/dist/story/config.js +1 -1
  486. package/dist/story/context.js +1 -1
  487. package/dist/story/controls/index.js +1 -1
  488. package/dist/story/crosswind.js +1 -1
  489. package/dist/story/desktop-preview.js +1 -1
  490. package/dist/story/docs-generator.js +1 -1
  491. package/dist/story/errors.js +1 -1
  492. package/dist/story/figma-export.js +1 -1
  493. package/dist/story/generator.js +1 -1
  494. package/dist/story/hmr.js +1 -1
  495. package/dist/story/hot-swap.js +1 -1
  496. package/dist/story/index.js +1 -1
  497. package/dist/story/interactions.js +1 -1
  498. package/dist/story/keyboard-shortcuts.js +1 -1
  499. package/dist/story/output.js +1 -1
  500. package/dist/story/performance.js +1 -1
  501. package/dist/story/presets.js +1 -1
  502. package/dist/story/props-validation.js +1 -1
  503. package/dist/story/renderer.js +1 -1
  504. package/dist/story/search-index.js +1 -1
  505. package/dist/story/search.js +1 -1
  506. package/dist/story/server.js +1 -1
  507. package/dist/story/setup.js +1 -1
  508. package/dist/story/snapshots.js +1 -1
  509. package/dist/story/testing.js +1 -1
  510. package/dist/story/theme.js +1 -1
  511. package/dist/story/ui/code-panel.js +1 -1
  512. package/dist/story/ui/controls-panel.js +1 -1
  513. package/dist/story/ui/index.js +1 -1
  514. package/dist/story/ui/navigation.js +1 -1
  515. package/dist/story/ui/preview.js +1 -1
  516. package/dist/story/visual-testing.js +1 -1
  517. package/dist/streaming.js +1 -1
  518. package/dist/strict-lint.js +1 -1
  519. package/dist/style-scoping.js +1 -1
  520. package/dist/suspense.js +1 -1
  521. package/dist/teleport.js +1 -1
  522. package/dist/template-compiler.js +1 -1
  523. package/dist/template-hydrator.js +1 -1
  524. package/dist/template-tag-balance.js +1 -1
  525. package/dist/testing.js +1 -1
  526. package/dist/transitions.js +1 -1
  527. package/dist/type-checker.js +1 -1
  528. package/dist/types/directive-types.js +1 -1
  529. package/dist/types/index.js +1 -1
  530. package/dist/types.js +1 -1
  531. package/dist/typescript-templates.js +1 -1
  532. package/dist/utils.js +1 -1
  533. package/dist/validator.js +1 -1
  534. package/dist/variable-extractor.js +1 -1
  535. package/dist/view-composers.js +1 -1
  536. package/dist/virtual-scrolling.js +1 -1
  537. package/dist/visual-editor.js +1 -1
  538. package/dist/vue-template.js +1 -1
  539. package/dist/web-components/css-scoping.js +1 -1
  540. package/dist/web-components/index.js +1 -1
  541. package/dist/web-components/reactive-generator.js +1 -1
  542. package/dist/web-components.js +1 -1
  543. package/dist/x-element.js +1 -1
  544. package/package.json +6 -6
  545. package/dist/chunk-48cw2nde.js +0 -2
  546. package/dist/chunk-48r3qe0k.js +0 -3
  547. package/dist/chunk-h45py5w5.js +0 -2
  548. package/dist/chunk-jfrn43vh.js +0 -2
  549. package/dist/chunk-mwbng54r.js +0 -2
  550. package/dist/chunk-qwyd9a1d.js +0 -2
  551. package/dist/chunk-sjagg9qz.js +0 -66
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_x as Y}from"./chunk-wxvyj65q.js";import $ from"fs";import z from"path";async function v(w){let k=await $.promises.readFile(w,"utf-8"),G=z.basename(w,".stx");return B(k,G,w)}function B(w,k,G){let E=J(w),q=A(w),H=L(w),I=T(w),F=S(w),K=V(w);return{name:k,path:G,description:H,props:E,slots:q,dependencies:I,cssClasses:F,directives:K}}function J(w){let k=[],G=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(!G)return k;let E=G[1];try{let q=Y(E);for(let H of q){if(H.name.startsWith("_"))continue;if(H.type==="function")continue;let I=O(E,H.start),F={name:H.name,type:Z(H.value||"",void 0,I),required:!1,default:H.value?_(H.value):void 0};if(I){let K=I.match(/@type\s+\{([^}]+)\}/i);if(K){if(F.type=K[1].trim(),F.type.includes("|"))F.options=F.type.split("|").map((Q)=>Q.trim().replace(/['"]/g,"")).filter((Q)=>Q!=="")}if(I.match(/@required/i))F.required=!0;let X=I.split(`
2
+ import{Yx as Y}from"./chunk-amaa1bev.js";import $ from"fs";import z from"path";async function v(w){let k=await $.promises.readFile(w,"utf-8"),G=z.basename(w,".stx");return B(k,G,w)}function B(w,k,G){let E=J(w),q=A(w),H=L(w),I=T(w),F=S(w),K=V(w);return{name:k,path:G,description:H,props:E,slots:q,dependencies:I,cssClasses:F,directives:K}}function J(w){let k=[],G=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(!G)return k;let E=G[1];try{let q=Y(E);for(let H of q){if(H.name.startsWith("_"))continue;if(H.type==="function")continue;let I=O(E,H.start),F={name:H.name,type:Z(H.value||"",void 0,I),required:!1,default:H.value?_(H.value):void 0};if(I){let K=I.match(/@type\s+\{([^}]+)\}/i);if(K){if(F.type=K[1].trim(),F.type.includes("|"))F.options=F.type.split("|").map((Q)=>Q.trim().replace(/['"]/g,"")).filter((Q)=>Q!=="")}if(I.match(/@required/i))F.required=!0;let X=I.split(`
3
3
  `).map((Q)=>Q.trim().replace(/^\*\s*/,"")).filter((Q)=>!Q.startsWith("@")&&Q.length>0);if(X.length>0)F.description=X.join(" ").trim()}k.push(F)}}catch{return b(E)}return k}function O(w,k){let E=w.slice(0,k).match(/\/\*\*\s*([\s\S]*?)\s*\*\/\s*$/);return E?E[1]:void 0}function b(w){let k=[],G=/(?:\/\*\*\s*([\s\S]*?)\s*\*\/\s*)?(?:export\s+)?(?:const|let|var)\s+(\w+)\s*(?::\s*([^=]+))?\s*=\s*([^;\n]+)/g,E=G.exec(w);while(E!==null){let[,q,H,I,F]=E;if(H.startsWith("_"))continue;let K={name:H,type:Z(F,I,q),required:!1,default:_(F)};if(q){let W=q.match(/@type\s+\{([^}]+)\}/i);if(W){if(K.type=W[1].trim(),K.type.includes("|"))K.options=K.type.split("|").map((U)=>U.trim().replace(/['"]/g,"")).filter((U)=>U!=="")}if(q.match(/@required/i))K.required=!0;let Q=q.split(`
4
4
  `).map((U)=>U.trim().replace(/^\*\s*/,"")).filter((U)=>!U.startsWith("@")&&U.length>0);if(Q.length>0)K.description=Q.join(" ").trim()}k.push(K),E=G.exec(w)}return k}function Z(w,k,G){if(G){let q=G.match(/@type\s+\{([^}]+)\}/i);if(q)return q[1].trim()}if(k)return k.trim();let E=w.trim();if(E==="true"||E==="false")return"boolean";if(/^['"`]/.test(E))return"string";if(/^-?\d+(?:\.\d+)?$/.test(E))return"number";if(E.startsWith("["))return"array";if(E.startsWith("{"))return"object";if(E==="null")return"null";if(E==="undefined")return"undefined";return"any"}function _(w){let k=w.trim();try{if(k==="true")return!0;if(k==="false")return!1;if(k==="null")return null;if(k==="undefined")return;if(/^-?\d+(?:\.\d+)?$/.test(k))return Number(k);if(/^['"`].*['"`]$/.test(k))return k.slice(1,-1);if(k.startsWith("[")||k.startsWith("{")){let E=k.replace(/'/g,'"');try{return JSON.parse(E)}catch{return k}}return k}catch{return k}}function A(w){let k=[],G=new Set;if(/\{\{\s*slot\s*\}\}/.test(w))k.push({name:"default"}),G.add("default");let E=/<slot\s*(?:name\s*=\s*["']([^"']+)["'])?\s*\/?>/gi,q=E.exec(w);while(q!==null){let H=q[1]||"default";if(!G.has(H))k.push({name:H}),G.add(H);q=E.exec(w)}return k}function L(w){let k=w.match(/^\s*<!--\s*([\s\S]*?)\s*-->/);if(k)return k[1].trim();let G=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(G){let E=G[1].match(/^\s*\/\*\*\s*([\s\S]*?)\s*\*\//);if(E){let q=E[1].split(`
5
5
  `).map((H)=>H.trim().replace(/^\*\s*/,"")).filter((H)=>!H.startsWith("@")&&H.length>0);if(q.length>0)return q.join(" ").trim()}}return}function T(w){let k=[],G=new Set,E=/import\s+(\w+)\s+from\s+['"][^'"]+\.stx['"]/g,q=E.exec(w);while(q!==null){let F=q[1];if(!G.has(F))k.push(F),G.add(F);q=E.exec(w)}let H=/<([A-Z][a-zA-Z0-9]*)\b/g;q=H.exec(w);while(q!==null){let F=q[1];if(!G.has(F))k.push(F),G.add(F);q=H.exec(w)}let I=/@component\s*\(\s*['"]([^'"]+)['"]/g;q=I.exec(w);while(q!==null){let F=q[1];if(!G.has(F))k.push(F),G.add(F);q=I.exec(w)}return k}function S(w){let k=[],G=new Set,E=/class\s*=\s*["']([^"']+)["']/gi,q=E.exec(w);while(q!==null){let H=q[1];for(let I of H.split(/\s+/)){let F=I.trim();if(F&&!F.includes("{{")&&!G.has(F))k.push(F),G.add(F)}q=E.exec(w)}return k}function V(w){let k=new Map,G=["@if","@else","@elseif","@endif","@unless","@endunless","@foreach","@endforeach","@for","@endfor","@while","@endwhile","@switch","@case","@default","@endswitch","@component","@endcomponent","@slot","@endslot","@include","@layout","@extends","@section","@endsection","@yield","@push","@endpush","@stack","@once","@endonce","@auth","@endauth","@guest","@endguest","@can","@endcan","@cannot","@endcannot","@env","@endenv","@production","@endproduction","@js","@endjs","@ts","@endts","@css","@endcss","@json","@class","@style","@checked","@selected","@disabled","@readonly","@required"];for(let q of G){let H=new RegExp(q.replace("@","@"),"gi"),I=w.match(H);if(I&&I.length>0){let F=q.slice(1);if(!F.startsWith("end"))k.set(F,(k.get(F)||0)+I.length)}}let E=[];for(let[q,H]of k)E.push({name:q,count:H});return E.sort((q,H)=>H.count-q.count),E}
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var I=null,N=[],M=!1,P=new Set,X=[],Y=[];function Z(j){let F=j,A=new Set,z=new Set,G=()=>{if(I)z.add(I);return F};return G.set=(H)=>{if(!Object.is(H,F)){let K=F;if(F=H,A.forEach((J)=>J(F,K)),M)z.forEach((J)=>P.add(J));else z.forEach((J)=>J())}},G.update=(H)=>{G.set(H(F))},G.subscribe=(H)=>{return A.add(H),()=>A.delete(H)},Object.defineProperty(G,"_isSignal",{value:!0,writable:!1}),G}function _(j){let F,A=!0,z=new Set,G=()=>{if(!A)if(A=!0,M)z.forEach((K)=>P.add(K));else z.forEach((K)=>K())},H=()=>{if(I)z.add(I);if(A){let K=I;I=G,N.push(G);try{F=j()}finally{N.pop(),I=K}A=!1}return F};return Object.defineProperty(H,"_isDerived",{value:!0,writable:!1}),H}function $(j,F={}){let A,z=!1,G=()=>{if(z)return;if(A)A(),A=void 0;let H=I;I=G,N.push(G);try{A=j()}finally{N.pop(),I=H}};if(F.immediate!==!1)G();return()=>{if(z=!0,A)A()}}function C(j){if(M){j();return}M=!0;try{j()}finally{M=!1,P.forEach((F)=>F()),P.clear()}}function S(j){X.push(j)}function W(j){Y.push(j)}function q(j){return typeof j==="function"&&j._isSignal===!0}function O(j){return typeof j==="function"&&j._isDerived===!0}function w(j){if(q(j)||O(j))return j();return j}function x(j){let F=I;I=null;try{return j()}finally{I=F}}function B(j,F){let A=typeof j==="function"?j:()=>j,z=Z([]),G=_(()=>z().reduce((J,L)=>F(J,L.action),A())),H=!1;return $(()=>{if(A(),!H){H=!0;return}if(x(()=>z().length))z.set([])}),[G,(J,L)=>{let R={action:J};z.set([...z(),R]);let Q=()=>{let T=z().filter((U)=>U!==R);if(T.length!==z().length)z.set(T)};if(L&&typeof L.then==="function")Promise.resolve(L).then(Q,Q);return Q}]}
3
- export{Z as eq,_ as fq,$ as gq,C as hq,S as iq,W as jq,q as kq,O as lq,w as mq,x as nq,B as oq};
3
+ export{Z as dq,_ as eq,$ as fq,C as gq,S as hq,W as iq,q as jq,O as kq,w as lq,x as mq,B as nq};
@@ -0,0 +1,246 @@
1
+ // @bun
2
+ import{Ch as zJ,ph as $J,rh as VJ,sh as KJ,xh as YJ,zh as _J}from"./chunk-ynhngsdh.js";import{Gi as uG,Ii as UJ,Ji as LJ,Mi as pG}from"./chunk-t0c9wvpr.js";import{jm as $G,km as vG,lm as xG,mm as TG,nm as SG,om as EG}from"./chunk-xs03kc1h.js";import{Ln as mG}from"./chunk-rw26rpek.js";import{fo as wG,ho as DG}from"./chunk-x3r64r0c.js";import{jo as IG}from"./chunk-1sr54zp8.js";import{mo as tG,no as eG,oo as GJ,po as JJ}from"./chunk-9t14se2t.js";import{vo as NG}from"./chunk-nm15ccsg.js";import{rp as HJ,sp as AJ}from"./chunk-jjb05d21.js";import{up as QJ}from"./chunk-j58vh0w6.js";import{Iq as kJ,Jq as cG,Kq as RG,Lq as yG,Mq as BJ,Nq as WJ,Oq as OJ}from"./chunk-d0zjtdw4.js";import{Dr as FJ,Ks as MJ,Rr as EJ,Sr as dG,Vs as LG,Yr as oG,ps as UG,tr as BG}from"./chunk-1xz0w746.js";import{dt as qJ}from"./chunk-g1vt329s.js";import{Rt as jJ}from"./chunk-y1k17c8b.js";import{aw as ZJ}from"./chunk-pa9zb7ty.js";import{Mw as jG,Nw as MG,Rw as s}from"./chunk-shv88d2d.js";import{Sw as G}from"./chunk-0dx4q6yq.js";import{Mx as iG}from"./chunk-9ecv8aqj.js";import{ty as aG}from"./chunk-zen6ax1y.js";import{wy as nG,xy as NJ}from"./chunk-yb1t2h8h.js";import{Ey as lG,Gy as sG}from"./chunk-fjk3x41y.js";import{Jy as IJ}from"./chunk-5shey2e4.js";import{pB as m}from"./chunk-xv34zbp4.js";import qG from"path";var{serve:vJ}=globalThis.Bun;import XG from"fs";import i from"path";async function xJ(S,B={}){let I=B.port||3000,y=B.watch!==!1,v=B.hotReload!==!1&&y,j=null,_=B.hmrPort||I+1,X=i.resolve(S);if(!XG.existsSync(X))return console.error(`${G.red}Error: File not found: ${G.bright}${X}${G.reset}`),!1;if(X.endsWith(".md"))return mG(X,B);else if(!X.endsWith(".stx"))return console.error(`${G.red}Error: Unsupported file type: ${G.bright}${X}${G.reset}. Only .stx and .md files are supported.`),!1;let C=i.join(process.cwd(),".stx/output");XG.mkdirSync(C,{recursive:!0}),console.log(`${G.blue}Building ${G.bright}${S}${G.reset}...`);let b=null,f=async()=>{try{let U={name:"public-assets",setup(O){O.onResolve({filter:/^\/(images|fonts|assets|public)\//},(H)=>{return{path:H.path,external:!0}})}},K=await Bun.build({entrypoints:[X],outdir:C,plugins:[U,kG],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...B.stxOptions});if(!K.success)return console.error(`${G.red}Build failed:${G.reset}`,K.logs),!1;let k=K.outputs.find((O)=>O.path.endsWith(".html"));if(!k)return console.error(`${G.red}No HTML output found${G.reset}`),!1;return b=await Bun.file(k.path).text(),!0}catch(U){return console.error(`${G.red}Error building stx file:${G.reset}`,U),!1}};if(!await f())return!1;let l=i.dirname(X);await jG(l);let R=I;try{if(R=await IG(I),R!==I)console.log(`${G.yellow}Port ${I} is busy, using port ${R} instead${G.reset}`)}catch{return console.error(`${G.red}Could not find an available port${G.reset}`),!1}if(v){let U=B.hmrPort||R+1;j=SG({wsPort:U,verbose:!1}),_=j.start(U)}let $={},Z=null;try{let{loadStxConfig:U}=await import("././index.js"),K=await U();if(K?.apiRouter)Z=K?.apiRouter,console.log(`${G.blue}Using custom router for API handling${G.reset}`);if(K?.apiRoutes){$=K.apiRoutes;let k=Object.keys($).length;if(k>0)console.log(`${G.blue}Loaded ${G.bright}${k} API route${k>1?"s":""}${G.reset}`)}if(K?.broadcasting?.enabled)try{let{startBroadcasting:k,loadChannels:Q}=await import("././broadcasting.js"),O=K.broadcasting;await k(O);let H=O.port??6001;console.log(`${G.magenta}Broadcasting on ${G.cyan}ws://localhost:${H}/ws${G.reset}`);let E=i.join(process.cwd(),"channels.ts");if(XG.existsSync(E))try{let V=await Q(E);console.log(`${G.blue}Loaded ${G.bright}${V} broadcast channel${V!==1?"s":""}${G.blue} from channels.ts${G.reset}`)}catch(V){console.warn(`${G.yellow}Failed to load channels.ts: ${V.message}${G.reset}`)}}catch(k){console.warn(`${G.yellow}Broadcasting failed to start: ${k.message}${G.reset}`)}}catch{}if(console.log(`${G.blue}Starting server on ${G.cyan}http://localhost:${R}/${G.reset}...`),v)console.log(`${G.magenta}Hot reload enabled on ws://localhost:${_}${G.reset}`);let M=vJ({port:R,async fetch(U){let K=new URL(U.url);if(Z)try{let E=await Z.handleRequest(U);if(E.status!==404)return E}catch{}if($[K.pathname])try{return await $[K.pathname](U)}catch(E){return new Response(JSON.stringify({error:E.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(K.pathname==="/")return(async()=>{let V=await s(b||"");if(v)V=$G(V,_);if(B.native)if(V.includes("<head>"))V=V.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(V.includes("<html"))V=V.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else V="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+V;if(B.titlebarHidden)if(V.includes("<head>"))V=V.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(V.includes("<html"))V=V.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else V=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${V}`;return V})().then((V)=>new Response(V,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let k=i.join(C,K.pathname);if(XG.existsSync(k)&&XG.statSync(k).isFile()){let E=Bun.file(k),V=i.extname(k).toLowerCase(),Y="text/plain";if(V===".ts"||V===".tsx"){let u=new Bun.Transpiler({loader:V===".tsx"?"tsx":"ts"}),n=await E.text(),WG=u.transformSync(n);return new Response(WG,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(V){case".html":Y="text/html";break;case".css":Y="text/css";break;case".js":Y="text/javascript";break;case".json":Y="application/json";break;case".png":Y="image/png";break;case".jpg":case".jpeg":Y="image/jpeg";break;case".gif":Y="image/gif";break;case".woff":Y="font/woff";break;case".woff2":Y="font/woff2";break;case".ttf":Y="font/ttf";break;case".otf":Y="font/otf";break;case".eot":Y="application/vnd.ms-fontobject";break}return new Response(E,{headers:{"Content-Type":Y}})}let Q=i.dirname(X),O=i.join(Q,K.pathname);if(XG.existsSync(O)&&XG.statSync(O).isFile()){let E=Bun.file(O),V=i.extname(O).toLowerCase(),Y="text/plain";if(V===".ts"||V===".tsx"){let u=new Bun.Transpiler({loader:V===".tsx"?"tsx":"ts"}),n=await E.text(),WG=u.transformSync(n);return new Response(WG,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(V){case".html":Y="text/html";break;case".css":Y="text/css";break;case".js":Y="text/javascript";break;case".json":Y="application/json";break;case".png":Y="image/png";break;case".jpg":case".jpeg":Y="image/jpeg";break;case".gif":Y="image/gif";break;case".svg":Y="image/svg+xml";break;case".ico":Y="image/x-icon";break;case".woff":Y="font/woff";break;case".woff2":Y="font/woff2";break;case".ttf":Y="font/ttf";break;case".otf":Y="font/otf";break;case".eot":Y="application/vnd.ms-fontobject";break}return new Response(E,{headers:{"Content-Type":Y}})}let H=i.join(process.cwd(),"public",K.pathname);if(XG.existsSync(H)&&XG.statSync(H).isFile()){let E=Bun.file(H),V=i.extname(H).toLowerCase(),Y="application/octet-stream";if(V===".ts"||V===".tsx"){let u=new Bun.Transpiler({loader:V===".tsx"?"tsx":"ts"}),n=await E.text(),WG=u.transformSync(n);return new Response(WG,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(V){case".html":Y="text/html";break;case".css":Y="text/css";break;case".js":Y="text/javascript";break;case".json":Y="application/json";break;case".png":Y="image/png";break;case".jpg":case".jpeg":Y="image/jpeg";break;case".gif":Y="image/gif";break;case".svg":Y="image/svg+xml";break;case".ico":Y="image/x-icon";break;case".woff":Y="font/woff";break;case".woff2":Y="font/woff2";break;case".ttf":Y="font/ttf";break;case".otf":Y="font/otf";break;case".eot":Y="application/vnd.ms-fontobject";break}return new Response(E,{headers:{"Content-Type":Y}})}return new Response("Not Found",{status:404})},error(U){return new Response(`<pre>${U}
3
+ ${U.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
4
+ ${G.blue}stx${G.reset} ${G.green}${process.env.stx_VERSION||"v0.0.10"}${G.reset} ${G.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${G.reset}`),console.log(`
5
+ ${G.bright}\u2192 ${G.cyan}http://localhost:${R}/${G.reset}`),console.log(`
6
+ ${G.yellow}Routes:${G.reset}`);let F=i.relative(process.cwd(),X);if(console.log(` ${G.green}\u2514\u2500 /${G.reset} \u2192 ${G.bright}${F}${G.reset}`),console.log(`
7
+ Press ${G.cyan}h${G.reset} + ${G.cyan}Enter${G.reset} to show shortcuts`),NG(M.url.toString(),()=>{if(y)XG.watch(i.dirname(X),{recursive:!0}).close();M.stop()}),B.native){let U=await Bun.file(X).text(),K=DG(U);await wG(R,{title:i.basename(X,".stx"),titlebarHidden:B.titlebarHidden===!0,nativeSidebar:!!K,sidebarConfig:K})}if(y){let U=i.dirname(X);console.log(`${G.blue}Watching ${G.bright}${U}${G.reset} for changes...`);let K=XG.watch(U,{recursive:!0},async(k,Q)=>{if(!Q||TG(Q))return;if(xG(Q)){console.log(`${G.yellow}File ${G.bright}${Q}${G.yellow} changed, rebuilding...${G.reset}`),UG.clear(),LG();let O=await f();if(await MG(l),v&&j)if(O)j.reload(Q);else j.error("Build failed - check console for details")}else if(vG(Q)){if(console.log(`${G.cyan}CSS ${G.bright}${Q}${G.cyan} changed${G.reset}`),v&&j)j.updateCss(Q)}});process.on("SIGINT",()=>{if(K.close(),j)EG();M.stop(),process.exit(0)})}return!0}var{serve:TJ}=globalThis.Bun;import _G from"fs";import d from"path";function XJ(S){if(S.length===0)return"";if(S.length===1)return S[0];let B=S.map((y)=>y.split(d.sep)),I=[];for(let y=0;y<B[0].length;y++){let v=B[0][y];if(B.every((j)=>j[y]===v))I.push(v);else break}return I.join(d.sep)}async function SJ(S,B={}){let I=B.port||3000,y=B.watch!==!1;for(let $ of S){let Z=d.resolve($);if(!_G.existsSync(Z))return console.error(`${G.red}Error: File not found: ${G.bright}${Z}${G.reset}`),!1;if(!Z.endsWith(".stx")&&!Z.endsWith(".md"))return console.error(`${G.red}Error: Unsupported file type: ${G.bright}${Z}${G.reset}. Only .stx and .md files are supported.`),!1}let v=d.join(process.cwd(),".stx/output");_G.mkdirSync(v,{recursive:!0});let j=XJ(S.map(($)=>d.dirname(d.resolve($))));console.log(`${G.blue}Processing ${G.bright}${S.length}${G.reset} files...`);let _={},X=[],C=async()=>{try{for(let $ of S){let Z=d.resolve($);if(Z.endsWith(".md"))try{let{content:F,data:U}=await oG(Z,{markdown:{syntaxHighlighting:{serverSide:!0,enabled:!0,defaultTheme:dG.markdown?.syntaxHighlighting?.defaultTheme||"github-dark",highlightUnknownLanguages:!0}}}),K=B.markdown?.syntaxHighlighting||dG.markdown?.syntaxHighlighting,k=K?.defaultTheme||"github-dark",Q=["github-dark"],O=K?.additionalThemes||[],E=[...new Set([...Q,...O])].map((n)=>`<option value="${n}"${n===k?" selected":""}>${n}</option>`).join(`
8
+ `),V=`
9
+ <!DOCTYPE html>
10
+ <html lang="en">
11
+ <head>
12
+ <meta charset="UTF-8">
13
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
14
+ <title>${U.title||d.basename(Z)}</title>
15
+ <!-- Syntax highlighting styles -->
16
+ <style id="syntax-theme">
17
+ :root {
18
+ --shiki-color-text: #24292e;
19
+ --shiki-color-background: #ffffff;
20
+ --shiki-token-constant: #005cc5;
21
+ --shiki-token-string: #032f62;
22
+ --shiki-token-comment: #6a737d;
23
+ --shiki-token-keyword: #d73a49;
24
+ --shiki-token-parameter: #24292e;
25
+ --shiki-token-function: #6f42c1;
26
+ --shiki-token-string-expression: #032f62;
27
+ --shiki-token-punctuation: #24292e;
28
+ --shiki-token-link: #032f62;
29
+ }
30
+ pre {
31
+ background-color: var(--shiki-color-background);
32
+ padding: 1rem;
33
+ border-radius: 4px;
34
+ }
35
+ code {
36
+ color: var(--shiki-color-text);
37
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
38
+ }
39
+ .dark-mode {
40
+ --shiki-color-text: #e1e4e8;
41
+ --shiki-color-background: #24292e;
42
+ --shiki-token-constant: #79b8ff;
43
+ --shiki-token-string: #9ecbff;
44
+ --shiki-token-comment: #6a737d;
45
+ --shiki-token-keyword: #f97583;
46
+ --shiki-token-parameter: #e1e4e8;
47
+ --shiki-token-function: #b392f0;
48
+ --shiki-token-string-expression: #9ecbff;
49
+ --shiki-token-punctuation: #e1e4e8;
50
+ --shiki-token-link: #9ecbff;
51
+ }
52
+ </style>
53
+ <style>
54
+ body {
55
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
56
+ line-height: 1.6;
57
+ color: #333;
58
+ max-width: 800px;
59
+ margin: 0 auto;
60
+ padding: 2rem;
61
+ }
62
+ pre, code {
63
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
64
+ }
65
+ pre {
66
+ border-radius: 4px;
67
+ padding: 0;
68
+ margin: 1.5rem 0;
69
+ overflow-x: auto;
70
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
71
+ }
72
+ pre code {
73
+ display: block;
74
+ padding: 1rem;
75
+ overflow-x: auto;
76
+ }
77
+ /* Apply background color to code blocks based on theme */
78
+ pre.syntax-highlighter {
79
+ background-color: var(--shiki-color-background) !important;
80
+ }
81
+ .dark-mode pre.syntax-highlighter {
82
+ background-color: var(--shiki-color-background) !important;
83
+ }
84
+ code {
85
+ padding: 0.2rem 0.4rem;
86
+ border-radius: 3px;
87
+ }
88
+ h1, h2, h3, h4 {
89
+ margin-top: 2rem;
90
+ margin-bottom: 1rem;
91
+ }
92
+ h1 { color: #111; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
93
+ h2 { color: #333; border-bottom: 1px solid #f0f0f0; padding-bottom: 0.3rem; }
94
+ h3 { color: #444; }
95
+ img {
96
+ max-width: 100%;
97
+ border-radius: 4px;
98
+ margin: 1rem 0;
99
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
100
+ }
101
+ blockquote {
102
+ border-left: 4px solid #ddd;
103
+ padding-left: 1rem;
104
+ margin-left: 0;
105
+ color: #555;
106
+ background: #f9f9f9;
107
+ padding: 0.5rem 1rem;
108
+ margin: 1.5rem 0;
109
+ }
110
+ table {
111
+ border-collapse: collapse;
112
+ width: 100%;
113
+ margin: 1.5rem 0;
114
+ }
115
+ th, td {
116
+ border: 1px solid #ddd;
117
+ padding: 0.5rem;
118
+ }
119
+ th {
120
+ background: #f0f0f0;
121
+ text-align: left;
122
+ }
123
+ tr:nth-child(even) {
124
+ background-color: #f8f8f8;
125
+ }
126
+ a {
127
+ color: #0066cc;
128
+ text-decoration: none;
129
+ }
130
+ a:hover {
131
+ text-decoration: underline;
132
+ }
133
+ hr {
134
+ border: 0;
135
+ border-top: 1px solid #eee;
136
+ margin: 2rem 0;
137
+ }
138
+ .frontmatter {
139
+ background: #f8f8f8;
140
+ border-radius: 4px;
141
+ padding: 1.5rem;
142
+ margin-bottom: 2rem;
143
+ font-size: 0.9rem;
144
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
145
+ border-left: 4px solid #ddd;
146
+ }
147
+ .frontmatter-item {
148
+ margin-bottom: 0.5rem;
149
+ display: flex;
150
+ }
151
+ .frontmatter-label {
152
+ font-weight: bold;
153
+ min-width: 100px;
154
+ color: #555;
155
+ }
156
+ ${tG()}
157
+ </style>
158
+ </head>
159
+ <body>
160
+ ${JJ(U)}
161
+ ${eG(E)}
162
+
163
+ ${F}
164
+
165
+ <script>
166
+ ${GJ()}
167
+ </script>
168
+ </body>
169
+ </html>
170
+ `,u=`/${d.relative(j,Z).replace(/\.md$/,"")}`;if(u.endsWith("/index"))u=u.slice(0,-6)||"/";_[u||"/"]={filePath:Z,content:V,fileType:"md"}}catch(F){console.error(`${G.red}Error processing Markdown file ${G.bright}${$}${G.reset}:`,F);continue}else{let F={name:"public-assets",setup(H){H.onResolve({filter:/^\/(images|fonts|assets|public)\//},(E)=>{return{path:E.path,external:!0}})}},U=await Bun.build({entrypoints:[Z],outdir:v,plugins:[F,kG],define:{"process.env.NODE_ENV":'"development"'},...B.stxOptions});if(!U.success){console.error(`${G.red}Build failed for ${G.bright}${$}${G.reset}:`,U.logs);continue}let K=U.outputs.find((H)=>H.path.endsWith(".html"));if(!K){console.error(`${G.red}No HTML output found for ${G.bright}${$}${G.reset}`);continue}let k=await Bun.file(K.path).text(),O=`/${d.relative(j,Z).replace(/\.stx$/,"")}`;if(O.endsWith("/index"))O=O.slice(0,-6)||"/";if(O.includes("[")){let H=[...O.matchAll(/\[([^\]]+)\]/g)].map((V)=>V[1]),E=O.replace(/\[([^\]]+)\]/g,"([^/]+)");X.push({pattern:new RegExp(`^${E}$`),paramNames:H,filePath:Z,routeTemplate:O,fileType:"stx"}),_[O]={filePath:Z,content:k,fileType:"stx"}}else _[O||"/"]={filePath:Z,content:k,fileType:"stx"}}}if(Object.keys(_).length===0)return console.error(`${G.red}No files were successfully processed${G.reset}`),!1;return!0}catch($){return console.error(`${G.red}Error processing files:${G.reset}`,$),!1}};if(!await C())return!1;let f=I;try{if(f=await IG(I),f!==I)console.log(`${G.yellow}Port ${I} is busy, using port ${f} instead${G.reset}`)}catch{return console.error(`${G.red}Could not find an available port${G.reset}`),!1}console.log(`${G.blue}Starting server on ${G.cyan}http://localhost:${f}/${G.reset}...`);let h=TJ({port:f,async fetch($){let Z=new URL($.url),M=d.join(process.cwd(),"public",Z.pathname);if(_G.existsSync(M)&&_G.statSync(M).isFile()){let K=Bun.file(M),k=d.extname(M).toLowerCase(),Q="application/octet-stream";if(k===".ts"||k===".tsx"){let O=new Bun.Transpiler({loader:k===".tsx"?"tsx":"ts"}),H=await K.text(),E=O.transformSync(H);return new Response(E,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(k){case".html":Q="text/html";break;case".css":Q="text/css";break;case".js":Q="text/javascript";break;case".json":Q="application/json";break;case".png":Q="image/png";break;case".jpg":case".jpeg":Q="image/jpeg";break;case".gif":Q="image/gif";break;case".svg":Q="image/svg+xml";break;case".ico":Q="image/x-icon";break;case".woff":Q="font/woff";break;case".woff2":Q="font/woff2";break;case".ttf":Q="font/ttf";break;case".otf":Q="font/otf";break;case".eot":Q="application/vnd.ms-fontobject";break}return new Response(K,{headers:{"Content-Type":Q}})}let F=_[Z.pathname];if(!F&&!Z.pathname.endsWith("/"))F=_[`${Z.pathname}/`];if(!F)for(let K of X){let k=Z.pathname.match(K.pattern);if(k){let Q=_[K.routeTemplate];if(Q){let O={};for(let V=0;V<K.paramNames.length;V++)O[K.paramNames[V]]=decodeURIComponent(k[V+1]);let H=Q.content,E=`<script>window.__routeParams = ${JSON.stringify(O)};</script>`;if(H.includes("</head>"))H=H.replace("</head>",`${E}
171
+ </head>`);else H=E+H;F={...Q,content:H}}break}}if(F)return s(F.content).then((K)=>{if(K.includes("</head>"))K=K.replace("</head>",`${QJ}
172
+ </head>`);return new Response(K,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})});let U=d.join(v,Z.pathname);if(_G.existsSync(U)&&_G.statSync(U).isFile()){let K=Bun.file(U),k=d.extname(U).toLowerCase(),Q="text/plain";if(k===".ts"||k===".tsx"){let O=new Bun.Transpiler({loader:k===".tsx"?"tsx":"ts"}),H=await K.text(),E=O.transformSync(H);return new Response(E,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(k){case".html":Q="text/html";break;case".css":Q="text/css";break;case".js":Q="text/javascript";break;case".json":Q="application/json";break;case".png":Q="image/png";break;case".jpg":case".jpeg":Q="image/jpeg";break;case".gif":Q="image/gif";break;case".svg":Q="image/svg+xml";break;case".ico":Q="image/x-icon";break;case".woff":Q="font/woff";break;case".woff2":Q="font/woff2";break;case".ttf":Q="font/ttf";break;case".otf":Q="font/otf";break;case".eot":Q="application/vnd.ms-fontobject";break}return new Response(K,{headers:{"Content-Type":Q}})}if(Z.pathname!=="/"&&_["/"]){let K=$.headers.get("X-STX-Router")==="true";return s(_["/"].content).then((k)=>{if(K){let Q=k.match(/<main[^>]*>([\s\S]*?)<\/main>/i);if(Q){let O=k.match(/<title[^>]*>([\s\S]*?)<\/title>/i),E=`<!DOCTYPE html><html><head><title>${O?O[1]:""}</title></head><body><main>${Q[1]}</main></body></html>`;return new Response(E,{headers:{"Content-Type":"text/html","X-STX-Partial":"true","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})})}return new Response("Not Found",{status:404})},error($){return new Response(`<pre>${$}
173
+ ${$.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
174
+ ${G.blue}stx${G.reset} ${G.green}${process.env.stx_VERSION||"v0.0.10"}${G.reset} ${G.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${G.reset}`),console.log(`
175
+ ${G.bright}\u2192 ${G.cyan}http://localhost:${f}/${G.reset}`),console.log(`
176
+ ${G.yellow}Routes:${G.reset}`);let l=new Set(X.map(($)=>$.routeTemplate)),R=Object.entries(_).filter(([$])=>!l.has($)).sort(([$],[Z])=>$.localeCompare(Z)).map(([$,Z])=>({route:$==="/"?"/":$,filePath:d.relative(process.cwd(),Z.filePath),fileType:Z.fileType}));for(let $ of X){let Z=$.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");R.push({route:Z,filePath:d.relative(process.cwd(),$.filePath),fileType:"stx"})}if(R.sort(($,Z)=>$.route.localeCompare(Z.route)),R.forEach(($,Z)=>{let F=Z===R.length-1?"\u2514\u2500 ":"\u251C\u2500 ",U=$.fileType==="md"?`${G.magenta}(markdown)${G.reset}`:"";console.log(` ${G.green}${F}${$.route}${G.reset} \u2192 ${G.bright}${$.filePath}${G.reset} ${U}`)}),console.log(`
177
+ Press ${G.cyan}h${G.reset} + ${G.cyan}Enter${G.reset} to show shortcuts`),NG(h.url.toString(),()=>{if(y)_G.watch(j,{recursive:!0}).close();h.stop()}),y){console.log(`${G.blue}Watching for changes...${G.reset}`);let $=_G.watch(j,{recursive:!0},async(Z,M)=>{if(!M)return;if(M.endsWith(".stx")||M.endsWith(".js")||M.endsWith(".ts")||M.endsWith(".md"))console.log(`${G.yellow}File ${G.bright}${M}${G.yellow} changed, rebuilding...${G.reset}`),UG.clear(),LG(),await C()});process.on("SIGINT",()=>{$.close(),h.stop(),process.exit(0)})}return!0}var{serve:RJ}=globalThis.Bun;import a from"fs";import D from"path";function hG(S){let B=Bun.file(S),I=D.extname(S).toLowerCase(),y={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},j=[".js",".css",".json"].includes(I)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(B,{headers:{"Content-Type":y[I]||"application/octet-stream",...j}})}async function yJ(S=".",B={}){let I=B.port||3000,y=B.watch!==!1,v=B.hotReload!==!1&&y,j=null,_=B.hmrPort||I+1,X=D.resolve(S),{loadStxConfig:C}=await import("././index.js"),b=await C(X),f=b.root&&b.root!=="."?D.join(X,b.root):X,h=b.pagesDir||"pages",l=D.join(f,h);if(!a.existsSync(l))return console.error(`${G.red}Error: No '${h}' directory found in ${G.bright}${f}${G.reset}`),console.log(`${G.dim}Create a ${h}/ directory with .stx files to define your routes.${G.reset}`),console.log(`${G.dim}Example: ${h}/index.stx for the homepage.${G.reset}`),!1;let R=uG(f);if(R.length===0)return console.error(`${G.red}Error: No page files found in ${G.bright}${l}${G.reset}`),!1;console.log(`${G.blue}Found ${G.bright}${R.length}${G.blue} routes${G.reset}`);let $=b?._pluginPageDirs||[],Z=[];for(let{dir:J,prefix:L}of $)if(a.existsSync(J)){let N=uG(D.dirname(J),{pagesDir:D.basename(J)});for(let A of N){let q=L==="/"?A.pattern:`${L}${A.pattern==="/"?"":A.pattern}`;Z.push({route:{...A,pattern:q},prefix:L})}if(N.length>0)console.log(`${G.blue}Plugin pages: ${G.bright}${N.length}${G.blue} routes at ${G.cyan}${L}${G.reset}`)}let M=new Map,F=null,U=null;if(B.stxOptions?.shell!==!1){if(U=await kJ(X,B.stxOptions?.shell),U){if(F=await cG(U,B.stxOptions||{}),F)console.log(`${G.blue}Using app shell: ${G.bright}${D.relative(X,U)}${G.reset} ${G.dim}(deprecated: use layouts/default.stx instead)${G.reset}`)}}$J(),await _J(X);let K=YJ();if(K.length>0)console.log(`${G.blue}Loaded ${G.bright}${K.length}${G.blue} middleware: ${G.dim}${K.join(", ")}${G.reset}`);let k={},Q=null;try{let{loadStxConfig:J}=await import("././index.js"),L=await J(X);if(L?.apiRouter)Q=L?.apiRouter,console.log(`${G.blue}Using custom router for API handling${G.reset}`);if(L?.apiRoutes){k=L.apiRoutes;let N=Object.keys(k).length;if(N>0)console.log(`${G.blue}Loaded ${G.bright}${N} API route${N>1?"s":""}${G.reset}`)}if(L?.broadcasting?.enabled)try{let{startBroadcasting:N,loadChannels:A}=await import("././broadcasting.js"),q=L.broadcasting;await N(q);let o=q.port??6001;console.log(`${G.magenta}Broadcasting on ${G.cyan}ws://localhost:${o}/ws${G.reset}`);let r=D.join(process.cwd(),"channels.ts");if(a.existsSync(r))try{let VG=await A(r);console.log(`${G.blue}Loaded ${G.bright}${VG} broadcast channel${VG!==1?"s":""}${G.blue} from channels.ts${G.reset}`)}catch(VG){console.warn(`${G.yellow}Failed to load channels.ts: ${VG.message}${G.reset}`)}}catch(N){console.warn(`${G.yellow}Broadcasting failed to start: ${N.message}${G.reset}`)}}catch{}let O=D.join(X,".stx/output");a.mkdirSync(O,{recursive:!0});let H=new Map,E=new Set,V=async(J)=>{let L=UJ(l,J);if(!L)return null;try{let N=await Bun.build({entrypoints:[L],outdir:O,plugins:[kG],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...B.stxOptions});if(!N.success)return null;let A=N.outputs.find((q)=>q.path.endsWith(".html"));if(!A)return null;return await Bun.file(A.path).text()}catch{return null}},Y=async(J,L)=>{try{let{processDirectives:N,extractVariables:A,defaultConfig:q,loadStxConfig:o,injectRouterScript:r}=await import("././index.js"),{checkCache:VG,cacheTemplate:PG,readFileCached:p,templateCache:HG}=await import("././caching.js"),AG=await o(X),W=(x)=>{if(!x)return x;if(D.isAbsolute(x))return x;return D.resolve(X,x)},w={...q,...AG,...B.stxOptions,autoShell:!0};if(B.debugDirectives)w.debug=!0;w.partialsDir=W(w.partialsDir),w.componentsDir=W(w.componentsDir),w.layoutsDir=W(w.layoutsDir),w.storesDir=W(w.storesDir||"stores"),w.cachePath=W(w.cachePath||".stx/cache");let T=!L&&!B.profile,z=w.cache!==!1;if(z&&T){let x=HG.get(J.filePath);if(x)try{if((await a.promises.stat(J.filePath)).mtime.getTime()<=x.mtime){let YG=!0;for(let c of x.dependencies){if(!a.existsSync(c)){YG=!1;break}if((await a.promises.stat(c)).mtime.getTime()>x.mtime){YG=!1;break}}if(YG){let c=x.output;if(F)c=yG(c,{preserveHead:!0});return{route:J,content:c}}}}catch{}let JG=await VG(J.filePath,w);if(JG){let QG=JG;if(F)QG=yG(QG,{preserveHead:!0});return{route:J,content:QG}}}let g=z?await p(J.filePath):await Bun.file(J.filePath).text(),{classifyAllScripts:t}=await import("././index.js"),P=t(g),e=P.server.map((x)=>x.content),KG=g;for(let x of P.server)KG=KG.replace(x.fullTag,"");let GG={__filename:J.filePath,__dirname:D.dirname(J.filePath),params:L??{}},{resetHead:wJ}=await import("././head.js");wJ();for(let x of e)try{await A(x,GG,J.filePath)}catch(JG){if(B.stxOptions?.debug)console.error("[stx] variable extraction error",J.filePath,JG?.message||JG)}let fG=new Set,ZG;if(B.profile){let x=performance.now();ZG=await N(KG,GG,J.filePath,w,fG);let JG=performance.now()-x,QG=D.relative(X,J.filePath)||J.filePath;console.log(`[stx:profile] ${QG} \u2192 ${JG.toFixed(2)}ms`)}else ZG=await N(KG,GG,J.filePath,w,fG);if(!F)ZG=await r(ZG);{let{interpolateScriptExpressions:x}=await import("././expressions.js");ZG=ZG.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(JG,QG,YG)=>{if(!/function\s+__stx_setup_/.test(YG))return JG;return`<script${QG}>${x(YG,GG)}</script>`})}if(F)ZG=yG(ZG,{preserveHead:!0});if(z&&T)await PG(J.filePath,ZG,fG,w);let{extractStreamBoundaries:DJ}=await import("././streaming.js"),OG=DJ(GG),FG=GG.__streamTemplates;if(FG&&typeof FG==="object"&&Object.keys(FG).length>0){let x=GG.streamBoundaries||{},JG={...w,autoShell:!1},QG=Object.keys(FG).map((c)=>({id:c,render:async()=>{let rG=typeof x[c]==="function"?await x[c]():void 0;return N(FG[c],{...GG,$boundary:rG},J.filePath,JG,new Set)}})),YG=new Set(QG.map((c)=>c.id));OG=[...(OG||[]).filter((c)=>!YG.has(c.id)),...QG]}if(OG&&OG.length>0)E.add(J.pattern);else OG=void 0;return{route:J,content:ZG,boundaries:OG}}catch(N){return console.error(`${G.red}Error building ${G.bright}${J.pattern}${G.reset}:`,N),null}},u=8,n=async()=>{H.clear(),M.clear();for(let J=0;J<R.length;J+=u){let L=R.slice(J,J+u),N=await Promise.all(L.map((A)=>Y(A)));for(let A of N)if(A)H.set(A.route.pattern,A)}for(let J=0;J<Z.length;J+=u){let L=Z.slice(J,J+u),N=await Promise.all(L.map(({route:A})=>Y(A)));for(let A of N)if(A)M.set(A.route.pattern,A)}return H.size>0};if(console.log(`${G.blue}Building pages...${G.reset}`),!await n())return console.error(`${G.red}No pages were successfully built${G.reset}`),!1;await jG(X);let zG=I;try{if(zG=await IG(I),zG!==I)console.log(`${G.yellow}Port ${I} is busy, using port ${zG} instead${G.reset}`)}catch{return console.error(`${G.red}Could not find an available port${G.reset}`),!1}if(v){let J=B.hmrPort||zG+1;j=SG({wsPort:J,verbose:!1}),_=j.start(J)}let CG=(J,L)=>{let N=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._rp=${JSON.stringify(L)};if(s.setRouteParams)s.setRouteParams(s._rp);})()</script>`;if(J.includes("</head>"))return J.replace("</head>",`${N}</head>`);if(J.includes("<body"))return J.replace(/<body([^>]*)>/,`<body$1>${N}`);return N+J};console.log(`${G.blue}Starting server...${G.reset}`);let bG=RJ({port:zG,async fetch(J){let L=new URL(J.url),N=b?.publicDir||"public",A=D.join(X,N,L.pathname),q=D.join(X,L.pathname),o=D.join(O,L.pathname),[r,VG,PG]=await Promise.all([a.promises.stat(A).catch(()=>null),a.promises.stat(q).catch(()=>null),a.promises.stat(o).catch(()=>null)]);if(r?.isFile())return hG(A);if(VG?.isFile())return hG(q);if(PG?.isFile())return hG(o);if(L.pathname.startsWith("/_stx/component/")){let W=decodeURIComponent(L.pathname.slice(16));if(W)try{let w=`<${W} />`,T={...buildConfig,autoShell:!1},z=await processDirectives(w,{},D.join(X,"components",`${W}.stx`),T,new Set);return new Response(z,{headers:{"Content-Type":"text/html"}})}catch(w){return new Response(`<div class="stx-async-error">${w.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(L.pathname==="/_stx/img"){let{handleImageRequest:W}=await import("./image-optimization/serve.js"),w=await W(J,{publicDir:D.join(X,N),cacheDir:D.join(X,".stx/cache/img")});if(w)return w}if(Q)try{let W=await Q.handleRequest(J);if(W.status!==404)return W}catch{}if(k[L.pathname])try{return await k[L.pathname](J)}catch(W){return new Response(JSON.stringify({error:W.message}),{status:500,headers:{"Content-Type":"application/json"}})}let p=pG(L.pathname,R);if(p){let W=H.get(p.route.pattern),w=E.has(p.route.pattern);if(p.route.isDynamic&&Object.keys(p.params).length>0||w){let T=await Y(p.route,p.params);if(T)W=T}if(W){let T=ZJ();if(T.validate){if(!await T.validate({params:p.params})){let t=await V(404);if(t){let P=t;if(P=await s(P,X),v)P=$G(P,_);return new Response(P,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(T.middleware){let g=KJ(L.pathname,p.params,T,L.search),t=VJ(g,null,J),P=await zJ(T.middleware,t);if(P.redirect){let e=P.redirect.path,KG=P.redirect.options.redirectCode||302,GG=new Headers(P.responseHeaders);return GG.set("Location",e),new Response(null,{status:KG,headers:GG})}if(P.abort){let{statusCode:e,message:KG}=P.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${KG}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(P.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(P.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;W.content=W.content.replace("</head>",`${e}</head>`)}}let z=W.content;if(F&&BJ(J)){let g=OJ(z),t=z.match(/<title[^>]*>([\s\S]*?)<\/title>/i),P=t?t[1].trim():"";if(Object.keys(p.params).length>0)z=CG(z,p.params);z=await s(z,X);let e=b?.router?.container||"main";return z=WJ(z,e),new Response(z,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":g.layout,"X-STX-Layout-Group":g.group,...P&&{"X-STX-Title":encodeURIComponent(P)},"Cache-Control":"no-store, no-cache, must-revalidate"}})}if(F)z=RG(F,z);if(Object.keys(p.params).length>0)z=CG(z,p.params);if(z=await s(z,X),v)z=$G(z,_);if(B.native)if(z.includes("<head>"))z=z.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else z="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+z;if(B.titlebarHidden)if(z.includes("<head>"))z=z.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else z=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${z}`;if(W.boundaries&&W.boundaries.length>0){let{renderStreamingPage:g,streamToResponse:t}=await import("././streaming.js");return t(g(z,W.boundaries,{timeoutMs:30000}),{headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(z,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}if(Z.length>0){let W=Z.map((T)=>T.route),w=pG(L.pathname,W);if(w){let T=M.get(w.route.pattern);if(T){let z=T.content;if(F)z=RG(F,z);if(Object.keys(w.params).length>0)z=CG(z,w.params);if(z=await s(z,X),v)z=$G(z,_);return new Response(z,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:T}of $)if(T!=="/"&&L.pathname.startsWith(T)){let z=M.get(T)||M.get(T+"/");if(z){let g=z.content;if(F)g=RG(F,g);if(g=await s(g,X),v)g=$G(g,_);return new Response(g,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let HG=H.get("/");if(HG){let W=HG.content;if(W=await s(W,X),v)W=$G(W,_);if(B.native)if(W.includes("<head>"))W=W.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else W="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+W;return new Response(W,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let AG=await V(404);if(AG){let W=AG;if(W=await s(W,X),v)W=$G(W,_);return new Response(W,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(J){let L=await V(500);if(L)return new Response(L,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${J}
178
+ ${J.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
179
+ ${G.blue}stx${G.reset} ${G.green}${process.env.stx_VERSION||"v0.0.10"}${G.reset} ${G.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${G.reset}`),console.log(`
180
+ ${G.bright}\u2192 ${G.cyan}http://localhost:${zG}/${G.reset}`),v)console.log(`${G.dim} HMR: ws://localhost:${_}${G.reset}`);console.log(`
181
+ ${G.yellow}Routes:${G.reset}`);let gG=[...LJ(R,X)];for(let{route:J}of Z)gG.push(`${J.pattern}`);if(gG.forEach((J,L)=>{let A=L===gG.length-1?"\u2514\u2500 ":"\u251C\u2500 ";console.log(` ${G.green}${A}${G.reset}${J}`)}),console.log(`
182
+ Press ${G.cyan}h${G.reset} + ${G.cyan}Enter${G.reset} to show shortcuts`),NG(bG.url.toString(),()=>{if(j)EG();bG.stop()}),B.native){let J,L=D.join(l,"index.stx");if(a.existsSync(L)){let A=await Bun.file(L).text();J=DG(A)}let N=b?.app?.window??{};await wG(zG,{title:b?.app?.head?.title||D.basename(X)||"stx App",width:N.width,height:N.height,darkMode:N.darkMode,hotReload:N.hotReload,titlebarHidden:N.titlebarHidden??B.titlebarHidden===!0,nativeSidebar:!!J,sidebarConfig:J})}if(y){console.log(`${G.blue}Watching for changes...${G.reset}`);let J=(A)=>{return A.startsWith("public/")||A.startsWith("public\\")},L=(A)=>{let q=A.toLowerCase();return q.endsWith(".stx")||q.endsWith(".html")||q.endsWith(".md")},N=a.watch(X,{recursive:!0},async(A,q)=>{if(!q||TG(q))return;if(xG(q))if(J(q)){if(console.log(`${G.cyan}${q} changed${G.reset}`),v&&j)j.reload(q)}else if(L(q)){console.log(`${G.yellow}${q} changed, rebuilding...${G.reset}`),UG.clear(),LG();try{let{invalidateFileCache:o,templateCache:r}=await import("././caching.js");o(D.resolve(X,q)),r.delete(D.resolve(X,q))}catch{}if(U&&q){if(D.resolve(X,q)===U||D.basename(U)===q){let r=await cG(U,B.stxOptions||{});if(r)F=r}}if(await n(),await MG(X),v&&j)j.reload(q)}else{console.log(`${G.yellow}${q} changed, rebuilding...${G.reset}`),UG.clear(),LG();try{let{invalidateFileCache:o,templateCache:r}=await import("././caching.js");o(D.resolve(X,q)),r.delete(D.resolve(X,q))}catch{}if(await n(),v&&j)j.reload(q)}else if(vG(q)){if(console.log(`${G.cyan}CSS ${q} changed${G.reset}`),v&&j)j.updateCss(q)}});process.on("SIGINT",()=>{if(N.close(),j)EG();bG.stop(),process.exit(0)})}return!0}var cX={};var kG={name:"bun-plugin-stx",async setup(S){let I={...await EJ(),...S.config?.stx},y=new Set,v=I.webComponents?.enabled?`./${qG.relative(qG.dirname(S.config?.outdir||"dist"),I.webComponents.outputDir||"dist/web-components")}`:"/web-components",j=[];if(I.webComponents?.enabled)try{let _=await FJ(I,y);if(j.push(..._),I.debug&&_.length>0)console.log(`Successfully built ${_.length} web components`)}catch(_){console.error("Failed to build web components:",_)}S.onLoad({filter:/\.stx$/},async({path:_})=>{try{let X=new Set;if(I.cache&&I.cachePath){let Z=await HJ(_,I);if(Z){if(I.debug)console.log(`Using cached version of ${_}`);return{contents:Z,loader:"html"}}}let C=await aG(()=>Bun.file(_).text(),"",(Z)=>{throw new sG(`Failed to read stx file: ${_}`,_,void 0,void 0,`File read error: ${Z.message}`)});if(!C)throw new sG(`stx file is empty: ${_}`,_);let{scriptContent:b,templateContent:f,allScripts:h}=iG.time("script-extraction",()=>{let Z=C,M=C.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(M)Z=M[1].trim();let F=C.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],U="",K=[];for(let Q of F){let O=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",H=Q.match(/<script\b([^>]*)>/i),E=H?H[1]:"";if(/\bserver\b/i.test(E))U=O;else K.push(Q)}let k=Z.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:U,templateContent:k,allScripts:K}}),l={__filename:_,__dirname:qG.dirname(_),__stx:{webComponentsPath:v,builtComponents:j}};await aG(()=>qJ(b,l,_),void 0,(Z)=>{let M=new lG(`Script execution failed in ${_}: ${Z.message}`,_,void 0,void 0,b.substring(0,100));if(nG.log(M,{filePath:_,scriptContent:b}),I.debug)throw M});let $=await iG.timeAsync("directive-processing",async()=>{return await MJ(f,l,_,I,X)});if(h.length>0){let{interpolateScriptsInTemplate:Z}=await import("././expressions.js"),M=Z(h.join(`
183
+ `),l),F=$.search(/<\/body>/i);if(F!==-1)$=$.slice(0,F)+M+`
184
+ `+$.slice(F);else $+=`
185
+ ${M}`}if($=await jJ($),X.forEach((Z)=>y.add(Z)),I.cache&&I.cachePath){if(await AJ(_,$,X,I),I.debug)console.log(`Cached template ${_} with ${X.size} dependencies`)}return{contents:$,loader:"html"}}catch(X){let C=X instanceof Error?X:new lG(`Plugin processing failed: ${String(X)}`,_);if(nG.log(C,{filePath:_,buildConfig:S.config}),NJ.logDetailedError(C,{filePath:_,plugin:"bun-plugin-stx"}),I.debug)console.error("stx Plugin Error:",C);let b=C,f=b.line||null,h=b.context||null;return{contents:I.debug||IJ()?`<!DOCTYPE html>
186
+ <html lang="en">
187
+ <head>
188
+ <meta charset="UTF-8">
189
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
190
+ <title>stx Rendering Error</title>
191
+ <style>
192
+ body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; line-height: 1.6; }
193
+ .error-header { color: #dc3545; border-left: 4px solid #dc3545; padding-left: 16px; margin-bottom: 24px; }
194
+ .error-details { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 16px; margin: 16px 0; }
195
+ .error-code { background: #2d3748; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; font-family: 'Monaco', 'Menlo', monospace; font-size: 14px; }
196
+ .help-section { background: #e3f2fd; border-left: 4px solid #2196f3; padding: 16px; margin-top: 24px; }
197
+ .file-path { font-family: monospace; background: #f1f3f4; padding: 2px 6px; border-radius: 4px; }
198
+ </style>
199
+ </head>
200
+ <body>
201
+ <div class="error-header">
202
+ <h1>stx Template Error</h1>
203
+ <p>An error occurred while processing your stx template.</p>
204
+ </div>
205
+
206
+ <div class="error-details">
207
+ <h3>Error Details</h3>
208
+ <p><strong>File:</strong> <span class="file-path">${BG(_)}</span></p>
209
+ <p><strong>Error:</strong> ${BG(C.message)}</p>
210
+ ${f?`<p><strong>Line:</strong> ${BG(String(f))}</p>`:""}
211
+ ${h?`<p><strong>Context:</strong> ${BG(String(h))}</p>`:""}
212
+ </div>
213
+
214
+ ${C.stack?`
215
+ <div class="error-details">
216
+ <h3>Stack Trace</h3>
217
+ <pre class="error-code">${BG(C.stack)}</pre>
218
+ </div>`:""}
219
+
220
+ <div class="help-section">
221
+ <h3>Troubleshooting Tips</h3>
222
+ <ul>
223
+ <li>Check the syntax of your stx directives (e.g., @if, @foreach)</li>
224
+ <li>Verify that all variables used in the template are properly defined</li>
225
+ <li>Ensure script tags have valid JavaScript/TypeScript syntax</li>
226
+ <li>Run <code>stx debug ${BG(qG.basename(_))}</code> for detailed analysis</li>
227
+ <li>Enable debug mode in your stx config for more detailed error messages</li>
228
+ </ul>
229
+ </div>
230
+ </body>
231
+ </html>`:`<!DOCTYPE html>
232
+ <html lang="en">
233
+ <head>
234
+ <meta charset="UTF-8">
235
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
236
+ <title>Error</title>
237
+ <style>
238
+ body { font-family: system-ui, -apple-system, sans-serif; max-width: 600px; margin: 80px auto; padding: 20px; text-align: center; color: #333; }
239
+ </style>
240
+ </head>
241
+ <body>
242
+ <h1>Something went wrong</h1>
243
+ <p>An internal error occurred. Please try again later.</p>
244
+ </body>
245
+ </html>`,loader:"html"}}})}},t0=kG;
246
+ export{kG as pf,t0 as qf,xJ as rf,XJ as sf,SJ as tf,yJ as uf,cX as vf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{rz as k,sz as q,xz as y}from"./chunk-adqh2m9z.js";function C(z,b){try{let j=z.trim();if(q(j))return y(j,Object.keys(b))(...Object.values(b));else return k(j,b)}catch{return!1}}
3
- export{C as lz};
2
+ import{pz as k,qz as q,vz as y}from"./chunk-w3b6m427.js";function C(z,b){try{let j=z.trim();if(q(j))return y(j,Object.keys(b))(...Object.values(b));else return k(j,b)}catch{return!1}}
3
+ export{C as jz};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{iz as i}from"./chunk-3rh7va1z.js";function a(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o;return}var r={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},x={name:"StxModal",aliases:["stx-modal"],render(e,t,o){let d=a(e,"id");if(!d)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let s=i(d),n=a(e,"size")||"md",l=a(e,"closeOnBackdrop")!=="false",c=a(e,"closeOnEscape")!=="false",m=r[n]||r.md;return`<div id="stx-modal-${s}" class="stx-modal-backdrop" data-stx-modal="${s}" data-close-backdrop="${l}" data-close-escape="${c}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
2
+ import{gz as i}from"./chunk-gz5fmp3q.js";function a(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o;return}var r={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},x={name:"StxModal",aliases:["stx-modal"],render(e,t,o){let d=a(e,"id");if(!d)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let s=i(d),n=a(e,"size")||"md",l=a(e,"closeOnBackdrop")!=="false",c=a(e,"closeOnEscape")!=="false",m=r[n]||r.md;return`<div id="stx-modal-${s}" class="stx-modal-backdrop" data-stx-modal="${s}" data-close-backdrop="${l}" data-close-escape="${c}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
3
3
  <div class="stx-modal-panel" style="${m};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
4
4
  <div style="padding:1.5rem">${t}</div>
5
5
  </div>
@@ -9,4 +9,4 @@ import{iz as i}from"./chunk-3rh7va1z.js";function a(e,t){if(e.serverDynamic[t]!=
9
9
  .stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
10
10
  .stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
11
11
  </style>`}};
12
- export{x as hz};
12
+ export{x as fz};
@@ -65,4 +65,4 @@ var B=null,F=[],J=0;function K(){return`stx-${++J}`}function M(q=null){return{sc
65
65
  };
66
66
  })();
67
67
  `}
68
- export{K as Uq,M as Vq,N as Wq,O as Xq,Q as Yq,R as Zq,U as _q,W as $q,X as ar,Y as br,Z as cr,_ as dr,$ as er,j as fr,A as gr,G as hr,T as ir,b as jr};
68
+ export{K as Tq,M as Uq,N as Vq,O as Wq,Q as Xq,R as Yq,U as Zq,W as _q,X as $q,Y as ar,Z as br,_ as cr,$ as dr,j as er,A as fr,G as gr,T as hr,b as ir};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{hy as y}from"./chunk-mrehzhxv.js";function O(j,H){let F=R(j,H);return F.ok?{expression:F.expression,endPos:F.endPos}:null}function R(j,H){let F=H;while(F<j.length&&/\s/.test(j[F]))F++;if(j[F]!=="(")return{ok:!1,reason:"missing-open-paren",pos:F};let L=y(j,"(",")",F);if(L===-1)return{ok:!1,reason:"unclosed-paren",pos:F};return{ok:!0,expression:j.slice(F+1,L),endPos:L+1}}function z(j,H,F,L){let Q=1,A=L,V=new RegExp(`@${H}\\s*\\(`,"g"),J=new RegExp(`@${F}(?![a-z])`,"g");while(A<j.length&&Q>0){V.lastIndex=A,J.lastIndex=A;let W=V.exec(j),q=J.exec(j),G=W?W.index:1/0,U=q?q.index:1/0;if(G<U)Q++,A=G+W[0].length;else if(U<1/0){if(Q--,Q===0)return U;A=U+q[0].length}else break}return-1}function I(j,H){let F=j.slice(H).match(/^@if\s*/);if(!F)return null;let L=H+F[0].length,Q=O(j,L);if(!Q)return null;let A=Q.endPos,V=z(j,"if","endif",A);if(V===-1)return null;let J=j.slice(A,V),W=[],q=0,G="if",U=Q.expression,K=0,Z=0;while(q<J.length){let X=J.indexOf("@",q);if(X===-1)break;q=X;let Y=J.substring(X);if(/^@if\s*\(/.test(Y)){Z++,q++;continue}if(/^@endif(?![a-z])/.test(Y)){Z--,q+=6;continue}if(Z===0){let _=Y.match(/^@elseif\s*/);if(_){W.push({type:G,condition:U,content:J.substring(K,q),start:A+K,end:A+q});let B=q+_[0].length,$=O(J,B);if(!$){q++;continue}G="elseif",U=$.expression,q=$.endPos,K=q;continue}else if(/^@else(?![a-z])/.test(Y)){W.push({type:G,condition:U,content:J.substring(K,q),start:A+K,end:A+q}),G="else",U=void 0,q+=5,K=q;continue}}q++}return W.push({type:G,condition:U,content:J.slice(K),start:A+K,end:A+J.length}),{fullMatch:j.slice(H,V+6),branches:W,start:H,end:V+6}}function v(j){let H=[],F=/@if\s*\(/g,L=F.exec(j);while(L!==null){if(H.some((V)=>L.index>V.start&&L.index<V.end)){L=F.exec(j);continue}let A=I(j,L.index);if(A)H.push(A),F.lastIndex=A.end;L=F.exec(j)}return H}function w(j,H,F){let L=[],Q=new RegExp(`@${H}\\s*\\(`,"g"),A=Q.exec(j);while(A!==null){if(L.some((Y)=>A.index>Y.start&&A.index<Y.end)){A=Q.exec(j);continue}let J=A.index,W=J+A[0].length-1,q=y(j,"(",")",W);if(q===-1){A=Q.exec(j);continue}let G=j.slice(W+1,q),U=q+1,K=z(j,H,F,U);if(K===-1){A=Q.exec(j);continue}let Z=j.slice(U,K),X=K+`@${F}`.length;L.push({fullMatch:j.slice(J,X),name:H,params:G,content:Z,start:J,end:X}),Q.lastIndex=X,A=Q.exec(j)}return L}function D(j,H){let F=j.slice(H).match(/^@switch\s*/);if(!F)return null;let L=H+F[0].length,Q=O(j,L);if(!Q)return null;let A=Q.endPos,V=z(j,"switch","endswitch",A);if(V===-1)return null;let J=j.slice(A,V),W=[],q=0,G=null,U=0;while(q<J.length){let K=J.slice(q),Z=K.match(/^@switch\s*\(/),X=K.match(/^@endswitch(?![a-z])/);if(Z){if(U++,G)G.content+=Z[0];q+=Z[0].length;continue}if(X){if(U--,G)G.content+=X[0];q+=X[0].length;continue}if(U>0){if(G)G.content+=J[q];q++;continue}let Y=K.match(/^@case\s*/),_=K.match(/^@default(?![a-z])/),B=K.match(/^@break(?![a-z])/);if(Y&&K.startsWith("@case")){if(G)W.push(G);let $=q+Y[0].length,k=O(J,$);if(!k){q++;continue}G={type:"case",value:k.expression,content:""},q=k.endPos}else if(_&&K.startsWith("@default")){if(G)W.push(G);G={type:"default",content:""},q+=_[0].length}else if(B&&K.startsWith("@break"))q+=B[0].length;else{if(G)G.content+=J[q];q++}}if(G)W.push(G);return{fullMatch:j.slice(H,V+10),expression:Q.expression,cases:W,start:H,end:V+10}}
3
- export{O as $x,R as ay,z as by,I as cy,v as dy,w as ey,D as fy};
2
+ import{fy as y}from"./chunk-bs3gmfxz.js";function O(j,H){let F=R(j,H);return F.ok?{expression:F.expression,endPos:F.endPos}:null}function R(j,H){let F=H;while(F<j.length&&/\s/.test(j[F]))F++;if(j[F]!=="(")return{ok:!1,reason:"missing-open-paren",pos:F};let L=y(j,"(",")",F);if(L===-1)return{ok:!1,reason:"unclosed-paren",pos:F};return{ok:!0,expression:j.slice(F+1,L),endPos:L+1}}function z(j,H,F,L){let Q=1,A=L,V=new RegExp(`@${H}\\s*\\(`,"g"),J=new RegExp(`@${F}(?![a-z])`,"g");while(A<j.length&&Q>0){V.lastIndex=A,J.lastIndex=A;let W=V.exec(j),q=J.exec(j),G=W?W.index:1/0,U=q?q.index:1/0;if(G<U)Q++,A=G+W[0].length;else if(U<1/0){if(Q--,Q===0)return U;A=U+q[0].length}else break}return-1}function I(j,H){let F=j.slice(H).match(/^@if\s*/);if(!F)return null;let L=H+F[0].length,Q=O(j,L);if(!Q)return null;let A=Q.endPos,V=z(j,"if","endif",A);if(V===-1)return null;let J=j.slice(A,V),W=[],q=0,G="if",U=Q.expression,K=0,Z=0;while(q<J.length){let X=J.indexOf("@",q);if(X===-1)break;q=X;let Y=J.substring(X);if(/^@if\s*\(/.test(Y)){Z++,q++;continue}if(/^@endif(?![a-z])/.test(Y)){Z--,q+=6;continue}if(Z===0){let _=Y.match(/^@elseif\s*/);if(_){W.push({type:G,condition:U,content:J.substring(K,q),start:A+K,end:A+q});let B=q+_[0].length,$=O(J,B);if(!$){q++;continue}G="elseif",U=$.expression,q=$.endPos,K=q;continue}else if(/^@else(?![a-z])/.test(Y)){W.push({type:G,condition:U,content:J.substring(K,q),start:A+K,end:A+q}),G="else",U=void 0,q+=5,K=q;continue}}q++}return W.push({type:G,condition:U,content:J.slice(K),start:A+K,end:A+J.length}),{fullMatch:j.slice(H,V+6),branches:W,start:H,end:V+6}}function v(j){let H=[],F=/@if\s*\(/g,L=F.exec(j);while(L!==null){if(H.some((V)=>L.index>V.start&&L.index<V.end)){L=F.exec(j);continue}let A=I(j,L.index);if(A)H.push(A),F.lastIndex=A.end;L=F.exec(j)}return H}function w(j,H,F){let L=[],Q=new RegExp(`@${H}\\s*\\(`,"g"),A=Q.exec(j);while(A!==null){if(L.some((Y)=>A.index>Y.start&&A.index<Y.end)){A=Q.exec(j);continue}let J=A.index,W=J+A[0].length-1,q=y(j,"(",")",W);if(q===-1){A=Q.exec(j);continue}let G=j.slice(W+1,q),U=q+1,K=z(j,H,F,U);if(K===-1){A=Q.exec(j);continue}let Z=j.slice(U,K),X=K+`@${F}`.length;L.push({fullMatch:j.slice(J,X),name:H,params:G,content:Z,start:J,end:X}),Q.lastIndex=X,A=Q.exec(j)}return L}function D(j,H){let F=j.slice(H).match(/^@switch\s*/);if(!F)return null;let L=H+F[0].length,Q=O(j,L);if(!Q)return null;let A=Q.endPos,V=z(j,"switch","endswitch",A);if(V===-1)return null;let J=j.slice(A,V),W=[],q=0,G=null,U=0;while(q<J.length){let K=J.slice(q),Z=K.match(/^@switch\s*\(/),X=K.match(/^@endswitch(?![a-z])/);if(Z){if(U++,G)G.content+=Z[0];q+=Z[0].length;continue}if(X){if(U--,G)G.content+=X[0];q+=X[0].length;continue}if(U>0){if(G)G.content+=J[q];q++;continue}let Y=K.match(/^@case\s*/),_=K.match(/^@default(?![a-z])/),B=K.match(/^@break(?![a-z])/);if(Y&&K.startsWith("@case")){if(G)W.push(G);let $=q+Y[0].length,k=O(J,$);if(!k){q++;continue}G={type:"case",value:k.expression,content:""},q=k.endPos}else if(_&&K.startsWith("@default")){if(G)W.push(G);G={type:"default",content:""},q+=_[0].length}else if(B&&K.startsWith("@break"))q+=B[0].length;else{if(G)G.content+=J[q];q++}}if(G)W.push(G);return{fullMatch:j.slice(H,V+10),expression:Q.expression,cases:W,start:H,end:V+10}}
3
+ export{O as Zx,R as _x,z as $x,I as ay,v as by,w as cy,D as dy};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Mi as E}from"./chunk-qfwzdffx.js";import{_k as D}from"./chunk-cn409b69.js";import{Pq as N}from"./chunk-ncnfa8ae.js";import{rB as x}from"./chunk-3jm3snz8.js";import C from"fs";import J from"path";var{serve:v}=globalThis.Bun;var y={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function c(O={}){let Z=J.resolve(O.outputDir||".output"),k=O.port||3000,U=D(Z);if(!U)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${U.routes.length} routes...`);let V=new Map,Y=new Map,_=new Map;for(let w of U.routes)try{let K=J.join(Z,w.compiledPath),A=JSON.parse(await Bun.file(K).text());V.set(w.pattern,A),_.set(w.pattern,N(A.html));let W=J.join(Z,w.fragmentPath);if(await Bun.file(W).exists())Y.set(w.pattern,await Bun.file(W).text())}catch(K){console.warn(`[stx] Failed to load route ${w.pattern}:`,K)}let $=new Map,F=[];for(let w of U.routes)if(w.hasParams){let K=[],A=w.pattern.replace(/:([^/]+)/g,(W,G)=>{return K.push(G),"([^/]+)"});F.push({regex:new RegExp(`^${A}$`),route:w,paramNames:K})}else $.set(w.pattern,w);let S=v({port:k,async fetch(w){let A=new URL(w.url).pathname;if(O.onRequest){let j=await O.onRequest(w);if(j)return j}if(O.apiRoutes?.[A])return O.apiRoutes[A](w);if((w.method==="GET"||w.method==="HEAD")&&A!=="/"){let j=J.resolve(Z,"public"),z;try{z=decodeURIComponent(A)}catch{z=A}if(!z.includes("\x00")){let B=J.resolve(j,`.${z}`);if(B===j||B.startsWith(`${j}${J.sep}`))try{if(C.existsSync(B)&&C.statSync(B).isFile()){let H=J.extname(B).toLowerCase(),I=y[H]||"application/octet-stream",b=A.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(A);return new Response(Bun.file(B),{headers:{"Content-Type":I,"Cache-Control":b?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let W=w.headers.get("X-STX-Router")==="true",G=null,L={};if(G=$.get(A)||null,!G)for(let{regex:j,route:z,paramNames:B}of F){let X=A.match(j);if(X){G=z,B.forEach((H,I)=>{L[H]=X[I+1]});break}}if(!G){let j=$.get("/404")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(W){let j=Y.get(G.pattern);if(j){let z=_.get(G.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},"Cache-Control":"no-cache"}})}}let Q=V.get(G.pattern);if(!Q){let j=$.get("/500")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!Q.hasServerScripts&&Object.keys(Q.placeholders).length===0)return new Response(Q.html,{headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:z}=await E(Q,{params:L,request:w});if(z&&z.length>0){let{renderStreamingPage:B,streamToResponse:X}=await import("././streaming.js");return X(B(j,z,{timeoutMs:30000}),{headers:{"Cache-Control":"no-cache"}})}return new Response(j,{headers:{"Content-Type":"text/html","Cache-Control":"no-cache"}})}catch(j){return console.error(`[stx] Hydration error for ${A}:`,j),new Response(Q.html,{headers:{"Content-Type":"text/html"}})}}});return console.log(`[stx] Production server running at http://localhost:${k}`),console.log(`[stx] Serving ${U.routes.length} routes (${V.size} pre-loaded)`),{port:k,stop:()=>S.stop()}}
3
- export{c as Ki};
2
+ import{Pi as E}from"./chunk-d1qh1x2g.js";import{bl as D}from"./chunk-80g54ncj.js";import{Oq as N}from"./chunk-d0zjtdw4.js";import{pB as x}from"./chunk-xv34zbp4.js";import C from"fs";import J from"path";var{serve:v}=globalThis.Bun;var y={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function c(O={}){let Z=J.resolve(O.outputDir||".output"),k=O.port||3000,U=D(Z);if(!U)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${U.routes.length} routes...`);let V=new Map,Y=new Map,_=new Map;for(let w of U.routes)try{let K=J.join(Z,w.compiledPath),A=JSON.parse(await Bun.file(K).text());V.set(w.pattern,A),_.set(w.pattern,N(A.html));let W=J.join(Z,w.fragmentPath);if(await Bun.file(W).exists())Y.set(w.pattern,await Bun.file(W).text())}catch(K){console.warn(`[stx] Failed to load route ${w.pattern}:`,K)}let $=new Map,F=[];for(let w of U.routes)if(w.hasParams){let K=[],A=w.pattern.replace(/:([^/]+)/g,(W,G)=>{return K.push(G),"([^/]+)"});F.push({regex:new RegExp(`^${A}$`),route:w,paramNames:K})}else $.set(w.pattern,w);let S=v({port:k,async fetch(w){let A=new URL(w.url).pathname;if(O.onRequest){let j=await O.onRequest(w);if(j)return j}if(O.apiRoutes?.[A])return O.apiRoutes[A](w);if((w.method==="GET"||w.method==="HEAD")&&A!=="/"){let j=J.resolve(Z,"public"),z;try{z=decodeURIComponent(A)}catch{z=A}if(!z.includes("\x00")){let B=J.resolve(j,`.${z}`);if(B===j||B.startsWith(`${j}${J.sep}`))try{if(C.existsSync(B)&&C.statSync(B).isFile()){let H=J.extname(B).toLowerCase(),I=y[H]||"application/octet-stream",b=A.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(A);return new Response(Bun.file(B),{headers:{"Content-Type":I,"Cache-Control":b?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let W=w.headers.get("X-STX-Router")==="true",G=null,L={};if(G=$.get(A)||null,!G)for(let{regex:j,route:z,paramNames:B}of F){let X=A.match(j);if(X){G=z,B.forEach((H,I)=>{L[H]=X[I+1]});break}}if(!G){let j=$.get("/404")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(W){let j=Y.get(G.pattern);if(j){let z=_.get(G.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},"Cache-Control":"no-cache"}})}}let Q=V.get(G.pattern);if(!Q){let j=$.get("/500")||null;if(j){let z=V.get(j.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!Q.hasServerScripts&&Object.keys(Q.placeholders).length===0)return new Response(Q.html,{headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:z}=await E(Q,{params:L,request:w});if(z&&z.length>0){let{renderStreamingPage:B,streamToResponse:X}=await import("././streaming.js");return X(B(j,z,{timeoutMs:30000}),{headers:{"Cache-Control":"no-cache"}})}return new Response(j,{headers:{"Content-Type":"text/html","Cache-Control":"no-cache"}})}catch(j){return console.error(`[stx] Hydration error for ${A}:`,j),new Response(Q.html,{headers:{"Content-Type":"text/html"}})}}});return console.log(`[stx] Production server running at http://localhost:${k}`),console.log(`[stx] Serving ${U.routes.length} routes (${V.size} pre-loaded)`),{port:k,stop:()=>S.stop()}}
3
+ export{c as Ni};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function C(j,A={}){let B=[];for(let[D,G]of Object.entries(A)){if(G===void 0||G===null)continue;if(Array.isArray(G))B.push(`${D}=${encodeURIComponent(G.join(","))}`);else if(typeof G==="boolean"){if(G)B.push(`${D}=true`)}else B.push(`${D}=${encodeURIComponent(String(G))}`)}if(B.length===0)return j;let F=j.includes("?")?"&":"?";return`${j}${F}${B.join("&")}`}function O(j){let A=j.indexOf("?");if(A===-1)return{src:j,params:{}};let B=j.slice(0,A),F=j.slice(A+1),D={};for(let G of F.split("&")){let[K,L]=G.split("="),J=L?decodeURIComponent(L):"";if(J==="true")D[K]=!0;else if(J==="false")D[K]=!1;else if(/^-?\d+$/.test(J))D[K]=Number.parseInt(J,10);else if(/^-?\d+\.\d+$/.test(J))D[K]=Number.parseFloat(J);else if(J.includes(","))D[K]=J.split(",");else D[K]=J}return{src:B,params:D}}function M(...j){let A={};for(let B of j)if(B)Object.assign(A,B);return A}function Q(j,A,B,F){let D={w:A};if(B)D.h=B;if(F)D.fit=F;return C(j,D)}function X(j,A,B,F="center"){return C(j,{w:A,h:B,fit:"crop",crop:F})}function Y(j,A,B="center"){return C(j,{w:A,h:A,fit:"crop",crop:B})}function Z(j,A,B){return C(j,{w:A,h:B,fit:"max"})}function _(j,A,B){return C(j,{w:A,h:B,fit:"crop"})}function $(j,A){return C(j,{blur:Math.min(2000,Math.max(0,A))})}function R(j,A){return C(j,{sharp:Math.min(100,Math.max(0,A))})}function T(j){return C(j,{sat:-100})}function E(j,A=100){return C(j,{sepia:Math.min(100,Math.max(0,A))})}function H(j){return C(j,{invert:!0})}function W(j,A){return C(j,{bri:Math.min(100,Math.max(-100,A))})}function V(j,A){return C(j,{con:Math.min(100,Math.max(-100,A))})}function f(j,A){return C(j,{sat:Math.min(100,Math.max(-100,A))})}function S(j,A){return C(j,{rot:(A%360+360)%360})}function x(j){return C(j,{flip:"h"})}function k(j){return C(j,{flip:"v"})}function P(j,A,B){let F={fm:A};if(B!==void 0)F.q=B;return C(j,F)}function w(j,A){return C(j,{q:Math.min(100,Math.max(1,A))})}function q(j,A=["format","compress"]){return C(j,{auto:A})}function v(j,A,B={}){return C(j,{mark:A,markx:B.x,marky:B.y,markalpha:B.alpha,markscale:B.scale,markalign:B.align})}var N={web:{fm:"webp",q:80,auto:["format","compress"]},highQuality:{q:95},thumb:{w:150,h:150,fit:"crop",crop:"center"},avatar:{w:200,h:200,fit:"crop",crop:"faces"},social:{w:1200,h:630,fit:"crop"},preview:{w:400,q:70},placeholder:{w:20,blur:200,q:20}};function y(j,A,B){return C(j,M(N[A],B))}function b(j,A,B){return A.map((F)=>C(j,{...B,w:F}))}function z(j,A,B=[1,2,3],F){return B.map((D)=>C(j,{...F,w:Math.round(A*D),dpr:D}))}function U(j){let A=[];if(j.w!==void 0&&(j.w<1||j.w>16383))A.push("Width must be between 1 and 16383");if(j.h!==void 0&&(j.h<1||j.h>16383))A.push("Height must be between 1 and 16383");if(j.q!==void 0&&(j.q<1||j.q>100))A.push("Quality must be between 1 and 100");if(j.blur!==void 0&&(j.blur<0||j.blur>2000))A.push("Blur must be between 0 and 2000");if(j.rot!==void 0&&(j.rot<0||j.rot>359))A.push("Rotation must be between 0 and 359");if(j.dpr!==void 0&&(j.dpr<1||j.dpr>5))A.push("DPR must be between 1 and 5");return{valid:A.length===0,errors:A}}function I(j){let A={...j};if(A.w!==void 0)A.w=Math.min(16383,Math.max(1,A.w));if(A.h!==void 0)A.h=Math.min(16383,Math.max(1,A.h));if(A.q!==void 0)A.q=Math.min(100,Math.max(1,A.q));if(A.blur!==void 0)A.blur=Math.min(2000,Math.max(0,A.blur));if(A.rot!==void 0)A.rot=(A.rot%360+360)%360;if(A.dpr!==void 0)A.dpr=Math.min(5,Math.max(1,A.dpr));return A}
3
- export{C as Zj,O as _j,M as $j,Q as ak,X as bk,Y as ck,Z as dk,_ as ek,$ as fk,R as gk,T as hk,E as ik,H as jk,W as kk,V as lk,f as mk,S as nk,x as ok,k as pk,P as qk,w as rk,q as sk,v as tk,N as uk,y as vk,b as wk,z as xk,U as yk,I as zk};
3
+ export{C as ak,O as bk,M as ck,Q as dk,X as ek,Y as fk,Z as gk,_ as hk,$ as ik,R as jk,T as kk,E as lk,H as mk,W as nk,V as ok,f as pk,S as qk,x as rk,k as sk,P as tk,w as uk,q as vk,v as wk,N as xk,y as yk,b as zk,z as Ak,U as Bk,I as Ck};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Sk as F,Xk as g}from"./chunk-5ggw1dyv.js";import{rB as R}from"./chunk-3jm3snz8.js";import{resolve as B,basename as v,extname as S,join as Q}from"path";import{mkdir as E,writeFile as b}from"fs/promises";async function U(){try{return await import("ts-videos")}catch{return null}}var f=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function y(W,Z,w,G,Y){let N=await U();if(!N)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let z=B(W);if(!await g(z))return null;let J=await F(z),C=v(W,S(W)),X=Q(w,`${C}-${J}-hls`);await E(X,{recursive:!0});let H=Z.length>0?Z:f,O=Y?.segmentDuration||6,V=(await new N.Input(z).getInfo()).duration||0,k=[],x=0;for(let $ of H){let _=Q(X,$.label);await E(_,{recursive:!0});let K=`${$.label}.m3u8`,j=Q(_,K);try{let M=await N.generateHLS(z,{outputDir:_,segmentDuration:O,width:$.width,height:$.height,videoBitrate:$.bitrate,audioBitrate:$.audioBitrate,playlistName:$.label});if(M)k.push({quality:$,url:`${G}/${C}-${J}-hls/${$.label}/${K}`,path:j}),x+=M.segmentCount||Math.ceil(V/O)}catch(M){console.warn(`[stx-media] Failed to generate HLS for ${$.label}: ${M}`)}}if(k.length===0)return null;let L=Q(X,"master.m3u8"),A=D(k,G,C,J);return await b(L,A),{manifestUrl:`${G}/${C}-${J}-hls/master.m3u8`,manifestPath:L,playlists:k,segmentCount:x,duration:V}}catch(z){return console.warn(`[stx-media] Failed to generate HLS manifest: ${z}`),null}}function D(W,Z,w,G){let Y=["#EXTM3U","#EXT-X-VERSION:3"];for(let N of W){let{quality:z}=N,J=z.bitrate+(z.audioBitrate||128000),C=`${z.width}x${z.height||Math.round(z.width*9/16)}`;Y.push(`#EXT-X-STREAM-INF:BANDWIDTH=${J},RESOLUTION=${C},NAME="${z.label}"`,`${z.label}/${z.label}.m3u8`)}return Y.join(`
2
+ import{Vk as F,_k as g}from"./chunk-jpndqst5.js";import{pB as R}from"./chunk-xv34zbp4.js";import{resolve as B,basename as v,extname as S,join as Q}from"path";import{mkdir as E,writeFile as b}from"fs/promises";async function U(){try{return await import("ts-videos")}catch{return null}}var f=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function y(W,Z,w,G,Y){let N=await U();if(!N)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let z=B(W);if(!await g(z))return null;let J=await F(z),C=v(W,S(W)),X=Q(w,`${C}-${J}-hls`);await E(X,{recursive:!0});let H=Z.length>0?Z:f,O=Y?.segmentDuration||6,V=(await new N.Input(z).getInfo()).duration||0,k=[],x=0;for(let $ of H){let _=Q(X,$.label);await E(_,{recursive:!0});let K=`${$.label}.m3u8`,j=Q(_,K);try{let M=await N.generateHLS(z,{outputDir:_,segmentDuration:O,width:$.width,height:$.height,videoBitrate:$.bitrate,audioBitrate:$.audioBitrate,playlistName:$.label});if(M)k.push({quality:$,url:`${G}/${C}-${J}-hls/${$.label}/${K}`,path:j}),x+=M.segmentCount||Math.ceil(V/O)}catch(M){console.warn(`[stx-media] Failed to generate HLS for ${$.label}: ${M}`)}}if(k.length===0)return null;let L=Q(X,"master.m3u8"),A=D(k,G,C,J);return await b(L,A),{manifestUrl:`${G}/${C}-${J}-hls/master.m3u8`,manifestPath:L,playlists:k,segmentCount:x,duration:V}}catch(z){return console.warn(`[stx-media] Failed to generate HLS manifest: ${z}`),null}}function D(W,Z,w,G){let Y=["#EXTM3U","#EXT-X-VERSION:3"];for(let N of W){let{quality:z}=N,J=z.bitrate+(z.audioBitrate||128000),C=`${z.width}x${z.height||Math.round(z.width*9/16)}`;Y.push(`#EXT-X-STREAM-INF:BANDWIDTH=${J},RESOLUTION=${C},NAME="${z.label}"`,`${z.label}/${z.label}.m3u8`)}return Y.join(`
3
3
  `)}async function p(W,Z,w,G,Y){let N=await U();if(!N)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let z=B(W);if(!await g(z))return null;let J=await F(z),C=v(W,S(W)),X=Q(w,`${C}-${J}-dash`);await E(X,{recursive:!0});let H=Z.length>0?Z:f,O=Y?.segmentDuration||4,I=Y?.minBufferTime||2,k=(await new N.Input(z).getInfo()).duration||0,x=[],L=[];for(let K of H){let j=Q(X,K.label);await E(j,{recursive:!0});try{if(await N.generateDASH(z,{outputDir:j,segmentDuration:O,width:K.width,height:K.height,videoBitrate:K.bitrate,audioBitrate:K.audioBitrate})){if(x.push({bandwidth:K.bitrate,width:K.width,height:K.height||Math.round(K.width*9/16),url:`${G}/${C}-${J}-dash/${K.label}/video`}),K.audioBitrate)L.push({bandwidth:K.audioBitrate,url:`${G}/${C}-${J}-dash/${K.label}/audio`})}}catch(M){console.warn(`[stx-media] Failed to generate DASH for ${K.label}: ${M}`)}}if(x.length===0)return null;let A=Q(X,"manifest.mpd"),$=h(x,L,k,O,I);await b(A,$);let _=[{type:"video",representations:x}];if(L.length>0)_.push({type:"audio",representations:L});return{manifestUrl:`${G}/${C}-${J}-dash/manifest.mpd`,manifestPath:A,adaptationSets:_,duration:k}}catch(z){return console.warn(`[stx-media] Failed to generate DASH manifest: ${z}`),null}}function h(W,Z,w,G,Y){let N=T(w),z=T(Y),J=`<?xml version="1.0" encoding="UTF-8"?>
4
4
  <MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
5
5
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -27,4 +27,4 @@ import{Sk as F,Xk as g}from"./chunk-5ggw1dyv.js";import{rB as R}from"./chunk-3jm
27
27
  `}J+=` </AdaptationSet>
28
28
  `}return J+=` </Period>
29
29
  </MPD>`,J}function T(W){let Z=Math.floor(W/3600),w=Math.floor(W%3600/60),G=Math.floor(W%60),Y="PT";if(Z>0)Y+=`${Z}H`;if(w>0)Y+=`${w}M`;return Y+=`${G}S`,Y}
30
- export{f as xj,y as yj,p as zj};
30
+ export{f as Aj,y as Bj,p as Cj};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{bq as B,cq as C}from"./chunk-bgec9r1v.js";import{createHash as F}from"crypto";import{getRouterScript as I}from"stx-router";function E(j){return F("sha256").update(j).digest("hex").slice(0,8)}function M(j=!1){let q=j?C():B(),A=E(q);return{content:q,filename:`runtime.${A}.js`,hash:A}}function N(){let j=I(),q=E(j);return{content:j,filename:`router.${q}.js`,hash:q}}function O(j){return{runtimeTag:j.runtime?`<script src="/__stx/${j.runtime.filename}"></script>`:"",routerTag:j.router?`<script src="/__stx/${j.router.filename}"></script>`:"",cssTag:j.css?`<link rel="stylesheet" href="/__stx/${j.css.filename}">`:""}}
3
- export{E as Zp,M as _p,N as $p,O as aq};
2
+ import{aq as B,bq as C}from"./chunk-15nesxgt.js";import{createHash as F}from"crypto";import{getRouterScript as I}from"stx-router";function E(j){return F("sha256").update(j).digest("hex").slice(0,8)}function M(j=!1){let q=j?C():B(),A=E(q);return{content:q,filename:`runtime.${A}.js`,hash:A}}function N(){let j=I(),q=E(j);return{content:j,filename:`router.${q}.js`,hash:q}}function O(j){return{runtimeTag:j.runtime?`<script src="/__stx/${j.runtime.filename}"></script>`:"",routerTag:j.router?`<script src="/__stx/${j.router.filename}"></script>`:"",cssTag:j.css?`<link rel="stylesheet" href="/__stx/${j.css.filename}">`:""}}
3
+ export{E as Yp,M as Zp,N as _p,O as $p};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{go as y}from"./chunk-cdbwprfv.js";import{ko as q}from"./chunk-mv03qb75.js";import{no as K,oo as M,po as N,qo as O}from"./chunk-57p201gb.js";import{wo as H}from"./chunk-cpcc11vp.js";import{Tr as X,Zr as A}from"./chunk-w01y57f5.js";import{Tw as j}from"./chunk-qdc3aav1.js";var{serve:F}=globalThis.Bun;import V from"fs";import E from"path";async function P(Y,J={}){let L=J.port||3000,Z=J.watch!==!1,B=E.resolve(Y);if(!V.existsSync(B))return console.error(`${j.red}Error: File not found: ${j.bright}${B}${j.reset}`),!1;if(!B.endsWith(".md"))return console.error(`${j.red}Error: File must have .md extension: ${j.bright}${B}${j.reset}`),!1;console.log(`${j.blue}Processing${j.reset} ${j.bright}${Y}${j.reset}...`);let _=null,$=async()=>{try{let{content:z,data:G}=await A(B,{markdown:{syntaxHighlighting:{serverSide:!0,enabled:!0,defaultTheme:X.markdown?.syntaxHighlighting?.defaultTheme||"github-dark",highlightUnknownLanguages:!0}}}),R=J.markdown?.syntaxHighlighting||X.markdown?.syntaxHighlighting,I=R?.defaultTheme||"github-dark",W=["github-dark"],k=R?.additionalThemes||[],C=[...new Set([...W,...k])].map((U)=>`<option value="${U}"${U===I?" selected":""}>${U}</option>`).join(`
2
+ import{fo as y}from"./chunk-x3r64r0c.js";import{jo as q}from"./chunk-1sr54zp8.js";import{mo as K,no as M,oo as N,po as O}from"./chunk-9t14se2t.js";import{vo as H}from"./chunk-nm15ccsg.js";import{Sr as X,Yr as A}from"./chunk-1xz0w746.js";import{Sw as j}from"./chunk-0dx4q6yq.js";var{serve:F}=globalThis.Bun;import V from"fs";import E from"path";async function P(Y,J={}){let L=J.port||3000,Z=J.watch!==!1,B=E.resolve(Y);if(!V.existsSync(B))return console.error(`${j.red}Error: File not found: ${j.bright}${B}${j.reset}`),!1;if(!B.endsWith(".md"))return console.error(`${j.red}Error: File must have .md extension: ${j.bright}${B}${j.reset}`),!1;console.log(`${j.blue}Processing${j.reset} ${j.bright}${Y}${j.reset}...`);let _=null,$=async()=>{try{let{content:z,data:G}=await A(B,{markdown:{syntaxHighlighting:{serverSide:!0,enabled:!0,defaultTheme:X.markdown?.syntaxHighlighting?.defaultTheme||"github-dark",highlightUnknownLanguages:!0}}}),R=J.markdown?.syntaxHighlighting||X.markdown?.syntaxHighlighting,I=R?.defaultTheme||"github-dark",W=["github-dark"],k=R?.additionalThemes||[],C=[...new Set([...W,...k])].map((U)=>`<option value="${U}"${U===I?" selected":""}>${U}</option>`).join(`
3
3
  `);return _=`
4
4
  <!DOCTYPE html>
5
5
  <html lang="en">
@@ -168,4 +168,4 @@ ${j.blue}stx${j.reset} ${j.green}${process.env.stx_VERSION||"v0.0.10"}${j.reset
168
168
  ${j.bright}\u2192 ${j.cyan}http://localhost:${D}/${j.reset}`),console.log(`
169
169
  ${j.yellow}Routes:${j.reset}`);let x=E.relative(process.cwd(),B);if(console.log(` ${j.green}\u2514\u2500 /${j.reset} \u2192 ${j.bright}${x}${j.reset}`),console.log(`
170
170
  Press ${j.cyan}h${j.reset} + ${j.cyan}Enter${j.reset} to show shortcuts`),H(Q.url.toString(),()=>{if(Z)V.watch(E.dirname(B),{recursive:!0}).close();Q.stop()}),J.native)await y(D,{title:E.basename(B,".md")});if(Z){let z=E.dirname(B);console.log(`${j.blue}Watching ${j.bright}${z}${j.reset} for changes...`);let G=V.watch(z,{recursive:!0},async(R,I)=>{if(I&&I.endsWith(".md"))console.log(`${j.yellow}File ${j.bright}${I}${j.yellow} changed, reprocessing...${j.reset}`),await $()});process.on("SIGINT",()=>{G.close(),Q.stop(),process.exit(0)})}return!0}
171
- export{P as pf};
171
+ export{P as Ln};
@@ -1,5 +1,5 @@
1
1
  // @bun
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===`
2
+ import{Ks as T,Qr as E,lr as b,nr as k}from"./chunk-1xz0w746.js";import{dt as j}from"./chunk-g1vt329s.js";import{Rt as H}from"./chunk-y1k17c8b.js";import{pB as w}from"./chunk-xv34zbp4.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 vi,m as wi};
19
+ export{x as yi,m as zi};
@@ -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 dz};
3
+ export{E as bz};
@@ -344,4 +344,4 @@ else {
344
344
 
345
345
  console.log('[stx] Lifecycle runtime initialized');
346
346
  })();
347
- `}var J=new Map,F=[];function Y(q){return Symbol(q)}function y(q,z){(F.length>0?F[F.length-1]:J).set(q,z)}function I(q,z){for(let B=F.length-1;B>=0;B--){let E=F[B];if(E.has(q))return E.get(q)}if(J.has(q))return J.get(q);if(arguments.length>1)return z;console.warn(`[stx] Injection "${String(q)}" not found.`);return}function w(){F.push(new Map)}function D(){F.pop()}async function k(q){w();try{return await q()}finally{D()}}function p(){J.clear(),F.length=0}var l=Y("theme"),u=Y("router"),r=Y("i18n");export{A as Bz,$ as Cz,T as Dz,N as Ez,K as Fz,O as Gz,x as Hz,v as Iz,f as Jz,W as Kz,g as Lz,S as Mz,m as Nz,C as Oz,d as Pz,h as Qz,V as Rz,j as Sz,Y as Tz,y as Uz,I as Vz,w as Wz,D as Xz,k as Yz,p as Zz,l as _z,u as $z,r as aA};
347
+ `}var J=new Map,F=[];function Y(q){return Symbol(q)}function y(q,z){(F.length>0?F[F.length-1]:J).set(q,z)}function I(q,z){for(let B=F.length-1;B>=0;B--){let E=F[B];if(E.has(q))return E.get(q)}if(J.has(q))return J.get(q);if(arguments.length>1)return z;console.warn(`[stx] Injection "${String(q)}" not found.`);return}function w(){F.push(new Map)}function D(){F.pop()}async function k(q){w();try{return await q()}finally{D()}}function p(){J.clear(),F.length=0}var l=Y("theme"),u=Y("router"),r=Y("i18n");export{A as zz,$ as Az,T as Bz,N as Cz,K as Dz,O as Ez,x as Fz,v as Gz,f as Hz,W as Iz,g as Jz,S as Kz,m as Lz,C as Mz,d as Nz,h as Oz,V as Pz,j as Qz,Y as Rz,y as Sz,I as Tz,w as Uz,D as Vz,k as Wz,p as Xz,l as Yz,u as Zz,r as _z};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  var L=new Set(["if","else","elseif","else-if","for","foreach","show","model","html","text","bind","key","ref","once","memo","slot","teleport","cloak","pre","effect","init"]),O=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function w(q){return q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(q){let Q=[],W=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,y;while((y=W.exec(q))!==null)Q.push([y.index,y.index+y[0].length]);return Q}function k(q,Q){for(let[W,y]of q)if(Q>=W&&Q<y)return!0;return!1}function B(q,Q){let W=1,y=0;for(let U=0;U<Q&&U<q.length;U++)if(q[U]===`
3
3
  `)W++,y=U+1;return{line:W,column:Q-y+1}}function M(q,Q,W){let y=Q.toLowerCase(),U=q.length,Y=1,J=W;while(J<U){let X=q.indexOf("<",J);if(X===-1)return-1;if(J=X,q.startsWith("<!--",J)){let G=q.indexOf("-->",J+4);if(G===-1)return-1;J=G+3;continue}if(q[J+1]==="/"){let G=/^<\/([a-z][\w-]*)\s*>/i.exec(q.slice(J,J+64));if(!G){J++;continue}if(G[1].toLowerCase()===y){if(Y--,J+=G[0].length,Y===0)return J;continue}J+=G[0].length;continue}let Z=/^<([a-z][\w-]*)\b/i.exec(q.slice(J,J+64));if(!Z){J++;continue}let $=q.indexOf(">",J);if($===-1)return-1;if(Z[1].toLowerCase()===y&&q[$-1]!=="/")Y++;J=$+1}return-1}function C(q,Q,W){let y=/@([a-z][\w:-]*)((?:\.[a-z][\w-]*)*)\s*=\s*"([^"]*)"/gi,U;while((U=y.exec(q))!==null){if(k(Q,U.index))continue;let Y=U[1].toLowerCase().split(":")[0];if(L.has(Y))continue;let J=U[3].trim();if(/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(J)){let X=q.indexOf(U[3],U.index),{line:Z,column:$}=B(q,X<0?U.index:X);W.push({ruleId:"stx/no-bare-function-ref-in-event",message:`Event handler @${U[1]}="${J}" is a bare reference and will not fire. Call it: @${U[1]}="${J}()".`,line:Z,column:$,severity:"error"})}}}function I(q,Q,W){if(Q!=="view")return;let y=/<script\b([^>]*)>/gi,U;while((U=y.exec(q))!==null)if(/(?:^|\s)client(?=[\s/=]|$)/i.test(U[1])){let{line:Y,column:J}=B(q,U.index);W.push({ruleId:"stx/no-view-level-script-client",message:"<script client> at the top level of a view is silently dropped \u2014 only components get client scopes. Move it into a component, or use <script> (server).",line:Y,column:J,severity:"error"})}}function D(q){let Q=q.split("/"),W=[];for(let y of Q){if(y===""||y===".")continue;if(y==="..")W.pop();else W.push(y)}return W.join("/")}function V(q,Q,W){let y=Q.replace(/\\/g,"/"),U=y.indexOf("resources/stores/");if(U===-1)return;let Y=y.slice(0,U+16),J=y.slice(0,y.lastIndexOf("/")),X=/\b(import|export)\s+(type\s+)?([^'"]*?)\s*from\s*['"]([^'"]+)['"]/g,Z;while((Z=X.exec(q))!==null){if(Z[2])continue;let $=Z[1],G=Z[4],N;if(G.startsWith("."))N=!D(`${J}/${G}`).startsWith(D(Y));else N=!0;if(N){let{line:j,column:H}=B(q,Z.index),F=$==="export"?"Value re-export":"Value import";W.push({ruleId:"stx/store-value-imports-must-be-local",message:`${F} from "${G}" is outside resources/stores/ and will be stripped from the store bundle. Use \`${$} type\`, or move the value into the stores dir.`,line:j,column:H,severity:"error"})}}}function b(q){let Q=q.trim(),W=(J)=>{let X=J.match(/[A-Za-z_$][\w$]*/g);return X?X:[]},y=/\bas\s+(.+)$/.exec(Q);if(y){let J=y[1].trim(),X=/^([A-Za-z_$][\w$]*)\s*=>\s*([A-Za-z_$][\w$]*)/.exec(J);if(X)return[X[1],X[2]];let Z=/^\(([^)]*)\)/.exec(J);if(Z)return W(Z[1]);let $=/^([A-Za-z_$][\w$]*)/.exec(J);return $?[$[1]]:[]}let U=/^\(([^)]*)\)\s+(?:in|of)\s+/.exec(Q);if(U)return W(U[1]);let Y=/^([A-Za-z_$][\w$]*)\s+(?:in|of)\s+/.exec(Q);return Y?[Y[1]]:[]}function v(q,Q){let W=/(?::for|x-for|@for)\s*=\s*"([^"]*)"/gi,y;while((y=W.exec(q))!==null){let U=b(y[1]);if(U.length===0)continue;let Y=q.lastIndexOf("<",y.index);if(Y===-1)continue;let J=/^<([a-z][\w-]*)/i.exec(q.slice(Y,Y+64));if(!J)continue;let X=q.indexOf(">",y.index);if(X===-1)continue;let $=q[X-1]==="/"||O.has(J[1].toLowerCase())?X+1:M(q,J[1],X+1),G=$===-1?X+1:$,N=q.indexOf(y[1],y.index),j=q.slice(Y,G);if(N>=0&&N+y[1].length<=G){let H=N-Y;j=j.slice(0,H)+" ".repeat(y[1].length)+j.slice(H+y[1].length)}for(let H of U){let F=new RegExp(`(?<![.\\w$])${w(H)}\\s*\\(`,"g"),A;while((A=F.exec(j))!==null){let K=Y+A.index,{line:_,column:x}=B(q,K);Q.push({ruleId:"stx/no-signal-call-in-for-iteration-var",message:`"${H}" is a :for iteration variable, not a signal \u2014 calling it as "${H}()" leaves it as a function and silently breaks comparisons. Use "${H}" directly.`,line:_,column:x,severity:"error"})}}}}function R(q,Q){let W=/<!--([\s\S]*?)-->/g,y;while((y=W.exec(q))!==null){let Y=y[1].indexOf("`");if(Y!==-1){let J=y.index+4+Y,{line:X,column:Z}=B(q,J);Q.push({ruleId:"stx/no-backticks-in-html-comments",message:"Backtick inside an HTML comment leaks into the merged setup function and flips the JS parser into template-literal mode. Remove it or rephrase the comment.",line:X,column:Z,severity:"error"})}}}function z(q,Q){return q?.[Q]!==!1}function E(q,Q={}){let W=[],y=P(q),U=(Q.filePath??"").replace(/\\/g,"/"),Y=Q.fileKind??(/\/components?\//i.test(U)?"component":"view");if(z(Q.rules,"stx/no-bare-function-ref-in-event"))C(q,y,W);if(z(Q.rules,"stx/no-view-level-script-client"))I(q,Y,W);if(U&&z(Q.rules,"stx/store-value-imports-must-be-local"))V(q,U,W);if(z(Q.rules,"stx/no-signal-call-in-for-iteration-var"))v(q,W);if(z(Q.rules,"stx/no-backticks-in-html-comments"))R(q,W);W.sort((X,Z)=>X.line-Z.line||X.column-Z.column);let J=new Set;return W.filter((X)=>{let Z=`${X.ruleId}:${X.line}:${X.column}`;if(J.has(Z))return!1;return J.add(Z),!0})}
4
- export{E as fg};
4
+ export{E as ig};