@stacksjs/stx 0.2.898 → 0.2.899

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/{chunk-qe0t0m38.js → chunk-0b57fgpn.js} +4 -4
  2. package/dist/chunk-0f2d61b3.js +2 -0
  3. package/dist/{chunk-pjj54ddk.js → chunk-0gc1hez6.js} +3 -3
  4. package/dist/chunk-0ht6exrv.js +2 -0
  5. package/dist/{chunk-t3zmfh8w.js → chunk-150cz8qq.js} +7 -7
  6. package/dist/chunk-1pbghytr.js +2 -0
  7. package/dist/chunk-1tb18a92.js +2 -0
  8. package/dist/{chunk-dvjv4c3a.js → chunk-2sz1kh9m.js} +1 -1
  9. package/dist/chunk-2vqamyay.js +2 -0
  10. package/dist/chunk-36mz0nwv.js +2 -0
  11. package/dist/{chunk-q4dcchrt.js → chunk-3k4rteax.js} +13 -13
  12. package/dist/chunk-3m37fzvh.js +2 -0
  13. package/dist/chunk-3my2eef2.js +2 -0
  14. package/dist/{chunk-qcbj1m21.js → chunk-40fpt0r6.js} +10 -10
  15. package/dist/{chunk-khm56bfm.js → chunk-46khhke2.js} +1 -1
  16. package/dist/{chunk-4wh71ddp.js → chunk-472w7t7p.js} +2 -2
  17. package/dist/{chunk-bjmkyead.js → chunk-4e28p8vf.js} +6 -6
  18. package/dist/{chunk-bgfs3mbg.js → chunk-4hk1mjtv.js} +5 -5
  19. package/dist/chunk-4jtewn1v.js +2 -0
  20. package/dist/chunk-4s6w89m2.js +2 -0
  21. package/dist/{chunk-dd074gp5.js → chunk-4wd5sn16.js} +7 -7
  22. package/dist/{chunk-1bft48gk.js → chunk-50wjk5ap.js} +2 -2
  23. package/dist/{chunk-ch9028z3.js → chunk-54x7h3sb.js} +1 -1
  24. package/dist/chunk-5astk182.js +2 -0
  25. package/dist/{chunk-3b3mkgpj.js → chunk-5g5khx0m.js} +2 -2
  26. package/dist/{chunk-zf68afyh.js → chunk-5gnt3qtn.js} +3 -3
  27. package/dist/{chunk-80ky40mm.js → chunk-5jrpzepc.js} +2 -2
  28. package/dist/{chunk-q0y8gv18.js → chunk-5mrt1enm.js} +2 -2
  29. package/dist/{chunk-wg6fmren.js → chunk-5tm1pvt3.js} +2 -2
  30. package/dist/chunk-5tvse0vw.js +2 -0
  31. package/dist/{chunk-ytjn0gq2.js → chunk-5yvgzh6n.js} +2 -2
  32. package/dist/{chunk-n6q1d66k.js → chunk-65g78sge.js} +1 -1
  33. package/dist/chunk-65rx54n6.js +2 -0
  34. package/dist/{chunk-x5bn2svk.js → chunk-67pq803s.js} +2 -2
  35. package/dist/{chunk-neg6ckjg.js → chunk-68r2zs20.js} +4 -4
  36. package/dist/{chunk-2s0q8mjx.js → chunk-6hjcqaqr.js} +2 -2
  37. package/dist/chunk-70ez3njv.js +2 -0
  38. package/dist/chunk-726w7fm2.js +2 -0
  39. package/dist/{chunk-xy8smv5e.js → chunk-73ebyhqq.js} +2 -2
  40. package/dist/chunk-73nazfe5.js +2 -0
  41. package/dist/{chunk-vk2jy6mn.js → chunk-7b3dqeyr.js} +2 -2
  42. package/dist/{chunk-whcrca58.js → chunk-7nn5s0c3.js} +30 -30
  43. package/dist/{chunk-062qfv99.js → chunk-7pfhr4nk.js} +2 -2
  44. package/dist/chunk-7r294vc9.js +2 -0
  45. package/dist/chunk-7rn7w53f.js +2 -0
  46. package/dist/{chunk-5v4e2a02.js → chunk-7z1hqp86.js} +4 -4
  47. package/dist/chunk-81qvg3yd.js +2 -0
  48. package/dist/{chunk-e16ef18k.js → chunk-83hs9905.js} +2 -2
  49. package/dist/chunk-8a9gmbxa.js +2 -0
  50. package/dist/chunk-8jvwapq3.js +2 -0
  51. package/dist/{chunk-g8p4sjy4.js → chunk-8rgy17fj.js} +8 -8
  52. package/dist/{chunk-ns2d6pb9.js → chunk-8v2hsn4d.js} +3 -3
  53. package/dist/{chunk-y1d3j2j7.js → chunk-8xb09hnn.js} +4 -4
  54. package/dist/{chunk-xmg6bmh6.js → chunk-945zygwa.js} +13 -13
  55. package/dist/{chunk-pvm48tse.js → chunk-9ejk9mwk.js} +2 -2
  56. package/dist/{chunk-bw2m1e7g.js → chunk-9hwg13ec.js} +5 -5
  57. package/dist/{chunk-ezpk14gs.js → chunk-9jpsxqaf.js} +1 -1
  58. package/dist/{chunk-0vrt55pp.js → chunk-9m45t60c.js} +80 -80
  59. package/dist/{chunk-jm9rbxj4.js → chunk-9n5san33.js} +14 -14
  60. package/dist/chunk-9vafweyd.js +3 -0
  61. package/dist/{chunk-zwqkbk2m.js → chunk-9w7whtbx.js} +2 -2
  62. package/dist/{chunk-1ph2yhfn.js → chunk-arfpzf17.js} +2 -2
  63. package/dist/chunk-avqxkbrd.js +2 -0
  64. package/dist/{chunk-htx5yezj.js → chunk-ayady5ws.js} +2 -2
  65. package/dist/{chunk-051r7ebx.js → chunk-b6ctdvdf.js} +6 -6
  66. package/dist/{chunk-taeqm3nc.js → chunk-becs8132.js} +5 -5
  67. package/dist/chunk-bmwcgmev.js +2 -0
  68. package/dist/{chunk-67j2m620.js → chunk-bzd387yx.js} +4 -4
  69. package/dist/{chunk-mhrnjaka.js → chunk-c0x9wyj7.js} +4 -4
  70. package/dist/chunk-cgqpn3e2.js +2 -0
  71. package/dist/chunk-cp82351f.js +2 -0
  72. package/dist/chunk-cvxg2rc1.js +2 -0
  73. package/dist/{chunk-v8ewgs1y.js → chunk-d1bwb2kz.js} +3 -3
  74. package/dist/{chunk-05x1rd86.js → chunk-de61k0ab.js} +2 -2
  75. package/dist/chunk-dj8fyaea.js +2 -0
  76. package/dist/chunk-dmc91qke.js +2 -0
  77. package/dist/{chunk-mr34w48c.js → chunk-e0bwzxfd.js} +6 -6
  78. package/dist/{chunk-w2qct5kq.js → chunk-e4xd1ca7.js} +1 -1
  79. package/dist/{chunk-3jxmnnef.js → chunk-e5q1ammf.js} +3 -3
  80. package/dist/{chunk-xvncq3m5.js → chunk-eb5cma4b.js} +2 -2
  81. package/dist/{chunk-3bsz7zj3.js → chunk-eb5v9npc.js} +2 -2
  82. package/dist/{chunk-aj5tsksz.js → chunk-edpsk4bg.js} +5 -5
  83. package/dist/{chunk-6kn2vwtn.js → chunk-eka2e4cm.js} +4 -4
  84. package/dist/{chunk-pnmafbv5.js → chunk-ern5hyvr.js} +1 -1
  85. package/dist/{chunk-41z7f41b.js → chunk-esm0pnpz.js} +2 -2
  86. package/dist/chunk-fe1wmmr5.js +2 -0
  87. package/dist/{chunk-r5ecgcx2.js → chunk-ffytbb4x.js} +5 -5
  88. package/dist/{chunk-vf4ejngv.js → chunk-fksmr50h.js} +6 -6
  89. package/dist/{chunk-nw2zjwcg.js → chunk-fsxk5fsh.js} +8 -8
  90. package/dist/{chunk-htvft92j.js → chunk-ft9h5qbs.js} +4 -4
  91. package/dist/chunk-fznzn35q.js +2 -0
  92. package/dist/{chunk-s94gqce0.js → chunk-g065d7p7.js} +2 -2
  93. package/dist/{chunk-rf0smj4c.js → chunk-g32hc78c.js} +2 -2
  94. package/dist/{chunk-nq60tjkz.js → chunk-gnf1e5q7.js} +2 -2
  95. package/dist/{chunk-bj8pv8m9.js → chunk-gq3gttt5.js} +21 -21
  96. package/dist/chunk-h2gnz7ja.js +2 -0
  97. package/dist/chunk-hc8ks7y3.js +2 -0
  98. package/dist/{chunk-cphc60zw.js → chunk-hdfhaddy.js} +2 -2
  99. package/dist/{chunk-t0ttxayz.js → chunk-hnjeqxqy.js} +2 -2
  100. package/dist/chunk-hpqvq1r9.js +2 -0
  101. package/dist/chunk-hs2a040z.js +2 -0
  102. package/dist/{chunk-xdrp6d7e.js → chunk-javb4e3b.js} +5 -5
  103. package/dist/chunk-jq49238b.js +2 -0
  104. package/dist/chunk-jr3fmkq7.js +2 -0
  105. package/dist/chunk-k2fw6paw.js +2 -0
  106. package/dist/chunk-k352spys.js +2 -0
  107. package/dist/{chunk-1knk403z.js → chunk-k3566kgd.js} +2 -2
  108. package/dist/{chunk-cmg9x1ka.js → chunk-k3ytyhkr.js} +3 -3
  109. package/dist/chunk-k79dvx67.js +2 -0
  110. package/dist/chunk-km1k3c4e.js +2 -0
  111. package/dist/chunk-kvjbpbmw.js +2 -0
  112. package/dist/chunk-mhv84p0x.js +2 -0
  113. package/dist/{chunk-ykax1thr.js → chunk-mjqsz20a.js} +2 -2
  114. package/dist/chunk-mmtyp5z4.js +2 -0
  115. package/dist/{chunk-8hwfdwgn.js → chunk-mry67rsk.js} +6 -6
  116. package/dist/{chunk-ksmn19qw.js → chunk-n3fgrsva.js} +2 -2
  117. package/dist/{chunk-jnwj14eq.js → chunk-n8xjqsze.js} +3 -3
  118. package/dist/{chunk-p3hbsrk9.js → chunk-nc5d3a5r.js} +5 -5
  119. package/dist/chunk-p4hm5srd.js +2 -0
  120. package/dist/{chunk-0jkj8thz.js → chunk-p89rpak1.js} +1 -1
  121. package/dist/{chunk-hxws025y.js → chunk-p92272k0.js} +2 -2
  122. package/dist/{chunk-bh2j50cy.js → chunk-pd31ge72.js} +6 -6
  123. package/dist/chunk-pjpy86c3.js +3 -0
  124. package/dist/chunk-psyqrxg0.js +2 -0
  125. package/dist/chunk-q4yq72wh.js +2 -0
  126. package/dist/{chunk-5xq6eky7.js → chunk-q6p96qq7.js} +7 -7
  127. package/dist/{chunk-115bb91s.js → chunk-qs0zk04y.js} +2 -2
  128. package/dist/{chunk-ta07gj66.js → chunk-qt2mr3f0.js} +31 -16
  129. package/dist/{chunk-a0aqs5a8.js → chunk-qykbjg3z.js} +2 -2
  130. package/dist/chunk-qzx6h6af.js +2 -0
  131. package/dist/{chunk-g5nfqzfh.js → chunk-r0az4z6d.js} +2 -2
  132. package/dist/{chunk-b9npgke0.js → chunk-r9n86na1.js} +39 -39
  133. package/dist/{chunk-zy97etqx.js → chunk-rapr0m13.js} +3 -3
  134. package/dist/{chunk-j1cgj6z2.js → chunk-rrpfn9rr.js} +1 -1
  135. package/dist/chunk-ryp47rwp.js +2 -0
  136. package/dist/{chunk-3qk8vf9m.js → chunk-t14bn66j.js} +3 -3
  137. package/dist/chunk-t9j000tb.js +2 -0
  138. package/dist/{chunk-7h52e87j.js → chunk-tga3nrn6.js} +5 -5
  139. package/dist/chunk-tgwwa872.js +2 -0
  140. package/dist/chunk-v0r6zb87.js +2 -0
  141. package/dist/{chunk-n0jfwsz1.js → chunk-v5v6w6rn.js} +2 -2
  142. package/dist/{chunk-9rjgq8k4.js → chunk-vbmvft7g.js} +1 -1
  143. package/dist/{chunk-kk2p2tgv.js → chunk-vfctk20v.js} +3 -3
  144. package/dist/{chunk-66qfr6b0.js → chunk-vgvxs1ag.js} +2 -2
  145. package/dist/{chunk-rb2zbdqd.js → chunk-vw7crz0z.js} +4 -4
  146. package/dist/chunk-vxtna1b1.js +2 -0
  147. package/dist/chunk-x43x2c6v.js +2 -0
  148. package/dist/chunk-xqx8t9w5.js +2 -0
  149. package/dist/{chunk-sh7a0g09.js → chunk-xr1s56k5.js} +3 -3
  150. package/dist/chunk-y10eaxgc.js +2 -0
  151. package/dist/chunk-ytk4f2j9.js +2 -0
  152. package/dist/chunk-z33r3pzy.js +2 -0
  153. package/dist/chunk-zcys6b06.js +2 -0
  154. package/dist/chunk-zkr42285.js +2 -0
  155. package/dist/chunk-zpwh9bpc.js +2 -0
  156. package/dist/chunk-zrs22j09.js +2 -0
  157. package/dist/chunk-zw6tgr0s.js +2 -0
  158. package/dist/cli.js +19 -19
  159. package/dist/client/signals-scope-disposal-runtime.js +18 -3
  160. package/dist/craft-entry.js +2 -2
  161. package/dist/craft.js +2 -2
  162. package/dist/dynamic-components.js +47 -25
  163. package/dist/pwa.js +3 -3
  164. package/dist/ssg.js +4 -4
  165. package/package.json +5 -5
  166. package/dist/chunk-0hgetg3j.js +0 -2
  167. package/dist/chunk-0k437z3q.js +0 -2
  168. package/dist/chunk-0yh33smh.js +0 -2
  169. package/dist/chunk-0yycygry.js +0 -2
  170. package/dist/chunk-1a7a8cjs.js +0 -2
  171. package/dist/chunk-1p4q6t48.js +0 -2
  172. package/dist/chunk-1z6pqvmf.js +0 -2
  173. package/dist/chunk-2nqmw4dv.js +0 -2
  174. package/dist/chunk-2shw0j2q.js +0 -2
  175. package/dist/chunk-35j7gaj5.js +0 -2
  176. package/dist/chunk-3hd73qqj.js +0 -2
  177. package/dist/chunk-4akw3bym.js +0 -2
  178. package/dist/chunk-4d85str1.js +0 -2
  179. package/dist/chunk-53kcqdjj.js +0 -2
  180. package/dist/chunk-5eq2e6p3.js +0 -2
  181. package/dist/chunk-690518hw.js +0 -2
  182. package/dist/chunk-732gb689.js +0 -2
  183. package/dist/chunk-80xzjxah.js +0 -2
  184. package/dist/chunk-8cs8jckk.js +0 -2
  185. package/dist/chunk-9afkttvz.js +0 -2
  186. package/dist/chunk-a0jhmkpd.js +0 -2
  187. package/dist/chunk-a1s0tfcd.js +0 -3
  188. package/dist/chunk-a2bstyq1.js +0 -2
  189. package/dist/chunk-ah8az9vv.js +0 -2
  190. package/dist/chunk-arr79m90.js +0 -2
  191. package/dist/chunk-cgxmgjk4.js +0 -2
  192. package/dist/chunk-cp5x6kx1.js +0 -2
  193. package/dist/chunk-e28czxw3.js +0 -2
  194. package/dist/chunk-e8szp5wa.js +0 -2
  195. package/dist/chunk-essd43ad.js +0 -2
  196. package/dist/chunk-f60k8j9m.js +0 -2
  197. package/dist/chunk-fsehzmg8.js +0 -2
  198. package/dist/chunk-fsk3rk2x.js +0 -2
  199. package/dist/chunk-g0p2n9tm.js +0 -2
  200. package/dist/chunk-g5axctr0.js +0 -2
  201. package/dist/chunk-ggnhr4r3.js +0 -2
  202. package/dist/chunk-hk241gt2.js +0 -2
  203. package/dist/chunk-hmpmvf5c.js +0 -2
  204. package/dist/chunk-j1ncsbk2.js +0 -2
  205. package/dist/chunk-j9kejcrx.js +0 -2
  206. package/dist/chunk-jhbz5w30.js +0 -2
  207. package/dist/chunk-jvc2qb1n.js +0 -2
  208. package/dist/chunk-jytqf6p6.js +0 -2
  209. package/dist/chunk-k4x680e3.js +0 -2
  210. package/dist/chunk-kfdmm240.js +0 -2
  211. package/dist/chunk-mx5twaps.js +0 -2
  212. package/dist/chunk-nd2bhjdw.js +0 -2
  213. package/dist/chunk-qfxy34d4.js +0 -2
  214. package/dist/chunk-qwt94yh2.js +0 -2
  215. package/dist/chunk-rarsjcs4.js +0 -2
  216. package/dist/chunk-rryzw9x7.js +0 -2
  217. package/dist/chunk-ryj1srqn.js +0 -2
  218. package/dist/chunk-s5j4fpdr.js +0 -2
  219. package/dist/chunk-snkbn5y8.js +0 -2
  220. package/dist/chunk-tbh7r1wh.js +0 -2
  221. package/dist/chunk-tsz03zc9.js +0 -2
  222. package/dist/chunk-v3jyb8k6.js +0 -2
  223. package/dist/chunk-wbp6jgcr.js +0 -2
  224. package/dist/chunk-x6565mhk.js +0 -2
  225. package/dist/chunk-x8yne6s5.js +0 -2
  226. package/dist/chunk-xwgdcc7w.js +0 -2
  227. package/dist/chunk-z4tdnfxd.js +0 -2
  228. package/dist/chunk-zrbyvyn2.js +0 -2
  229. package/dist/chunk-zxjdfgdx.js +0 -3
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pe,uo,Kg,Ay,Gg,Py,On,g,Y,ae,Nn,Ne,Xg,Wi,Jg,Iy,P,qi,Yg,Oy,N,Ny}from"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Yg as applyFilters,Py as clearCustomFilters,Xg as clientLoopScopes,uo as defaultFilters,Nn as escapeAttributeValue,g as escapeHtml,Y as escapeHtmlValue,ae as escapeInterpolatedHtmlValue,N as evaluateExpression,Pe as findMustacheEnd,Gg as getAllFilters,Jg as interpolateScriptAttributes,Wi as interpolateScriptExpressions,Iy as interpolateScriptsInTemplate,P as processExpressions,qi as processExpressionsChunked,Kg as registerFilter,Ay as registerFilters,On as replaceInterpolations,Oy as resetRejectedExpressionWarnings,Ny as unescapeHtml,Ne as usesSignalsInScript};
@@ -72,7 +72,7 @@ else {
72
72
  ${t}
73
73
  })();
74
74
  </script>
75
- `}function xh(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
75
+ `}function Sh(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
76
76
  <div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
77
77
  ${d}
78
78
  ${c}
@@ -81,4 +81,4 @@ else {
81
81
  </div>
82
82
  ${h}
83
83
  `})}
84
- export{xh};
84
+ export{Sh};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- var Vo=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function Ua(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||Vo},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
2
+ var Uo=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function Wa(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||Uo},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
3
3
  `)}function N(e,t,r){let n=" ".repeat(r);if(r===0)t.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let i=`node_${r}`;t.push(`${n} var ${i} = try ${e.zigType}.init(allocator);`);for(let[o,s]of Object.entries(e.props))if(s.type==="literal"){let a=typeof s.value==="string"?`"${s.value}"`:String(s.value);t.push(`${n} ${i}.set${J(o)}(${a});`)}for(let o=0;o<e.children.length;o++){let s=e.children[o];if(s.type==="text"){let a=s.props.text?.type==="literal"?String(s.props.text.value):"";t.push(`${n} try ${i}.addChild(try craft.Text.init(allocator, "${a}"));`)}else N(s,t,r+1),t.push(`${n} try ${i}.addChild(node_${r+1});`)}if(r===0)t.push(` return ${i}.element();`),t.push("}")}function E(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('import { Craft } from "@stacksjs/craft";'),r.push(""),r.push("export function render(): Craft.Element {"),r.push(" return "+v(e,1)+";"),r.push("}"),r.join(`
4
4
  `)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
5
5
  ${r} [${o.join(`,
6
6
  ${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
7
- `)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Wa(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Ua,createHotReloadServer:Wa,NATIVE_COMPONENTS:Vo},Gh=K;
8
- export{Vo,Ua,Wa,Gh};
7
+ `)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function qa(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Wa,createHotReloadServer:qa,NATIVE_COMPONENTS:Uo},Xh=K;
8
+ export{Uo,Wa,qa,Xh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{si}from"./chunk-de61k0ab.js";export{si as warnUnbalancedTags};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Mu,lh}from"./chunk-fksmr50h.js";export{Eu as createIslandRegistry,lh as default,Mu as generateIslandManifest,$u as generatePartialHydrationCSS,Pu as hydrateAll,Au as hydrateByStrategy,Ru as hydrateIsland,Iu as isHydrated,Ou as onHydrated,Tu as processPartialHydrationDirectives,Nu as processStaticDirectives};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ns,rs,bm,wm,vm,xm,Sm}from"./chunk-0gc1hez6.js";export{ns as collectMessageCatalogs,wm as loadPageMessages,vm as messageAreasIn,xm as pageLanguages,bm as pageMessagesEnabled,Sm as pageMessagesScript,rs as pathSpellings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ze,Dn,po,Gi,z,Jt}from"./chunk-esm0pnpz.js";export{Dn as currentRuntimeConfig,Jt as injectRuntimeConfig,z as resolveRuntimeConfig,Gi as useRuntimeConfig,po as useServerRuntimeConfig,Ze as withRuntimeConfig};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ft}from"./chunk-qe0t0m38.js";import{At,rr}from"./chunk-ta07gj66.js";import{ye,$n,Cl,El}from"./chunk-0vrt55pp.js";import{Ur,Wr,qr,Gr,De}from"./chunk-xmg6bmh6.js";import{z}from"./chunk-41z7f41b.js";import{qi}from"./chunk-4wh71ddp.js";import{S}from"./chunk-nw2zjwcg.js";import{i}from"./chunk-b9npgke0.js";import{q,a}from"./chunk-qcbj1m21.js";import{Xc}from"./chunk-rb2zbdqd.js";import{Wn,qn,rt,Be,Na,Ma,Kn}from"./chunk-dd074gp5.js";import{vn,Zo}from"./chunk-taeqm3nc.js";import{Gn}from"./chunk-nq60tjkz.js";import{fn,pr,fr}from"./chunk-1ph2yhfn.js";import{re}from"./chunk-mr34w48c.js";import m from"fs";import c from"path";import{createHash as Y}from"crypto";function I(n){return Y("sha256").update(n).digest("hex").slice(0,8)}function W(n=!1){let l=n?rr():At(),o=I(l);return{content:l,filename:`runtime.${o}.js`,hash:o}}function J(){let n=ft(),l=I(n);return{content:n,filename:`router.${l}.js`,hash:l}}import U from"path";import{createHash as Q}from"crypto";function ee(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function V(n,l,o={}){let r=U.resolve(n),e=await Bun.file(r).text(),x=Q("sha256").update(e).digest("hex").slice(0,16);Cl();let _={};try{_=await a(o.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>ye(R))),{context:D}=ee({__filename:r,__dirname:U.dirname(r),__stx_serverDeclared:u}),A=new Set,T={...q,..._,...o,buildMode:"compile",strict:!1},f=await i(e,D,r,T,A),w=Wn(f)+qn(f)+rt(f),j=El();return{route:l,sourceFile:n,html:f,fragment:w,placeholders:j,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:x,status:$n(e),streamTemplates:D.__streamTemplates}}var te=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function X(n,l){let o=0,r=0;if(!m.existsSync(n))return{copied:o,bytes:r};m.mkdirSync(l,{recursive:!0});function e(x,_){let y=m.readdirSync(x,{withFileTypes:!0});for(let d of y){if(te.has(d.name))continue;let g=c.join(x,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),o++,r+=m.statSync(u).size}}}return e(n,l),{copied:o,bytes:r}}async function Om(n={}){let l=Date.now(),o=c.resolve(n.root||process.cwd()),r=c.resolve(o,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await a(o),x=c.resolve(o,n.componentsDir??e.componentsDir??"components"),_=c.resolve(o,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(o,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",g=De(e.app?.head,{known:Gr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=n.routeRules??e.routeRules??{},T=Gn(A),f=n.serverApi??e.serverApi,w=typeof f==="object"?f:{};if(f)vn(o,w);if(e.runtimeConfig)z(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let j=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of j)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=re(o,{pagesDirs:e._layerPageDirs}),Z=["components","layouts","partials"],P=R.filter((s)=>!Z.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${P.length} page routes (${R.length-P.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=W(n.debug),b=J();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",b.filename),b.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${b.filename} (${(b.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let B=[],O=[];for(let s of P){let h=T(s.pattern),M=h.rendering==="prerender";if(M&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await V(s.filePath,s.pattern,{configDir:o,componentsDir:x,partialsDir:_,layoutsDir:y,debug:n.debug});if(B.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,b.filename),t.html=qr(t.html,g,{bodyScripts:[`<script src="/__stx/${b.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Ur(t.html,u);if(g.htmlAttrs)t.html=Wr(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let G=p[1];t.html=t.html.replace(" "+G,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${G}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await S(t.html),M){let p=await Kn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=Be(t.html,D,!0);let N=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),K=c.join("server","pages",`${N}.compiled.json`),L=c.join("server","fragments",`${N}.html`);await Bun.write(c.join(r,K),JSON.stringify(t,null,2)),await Bun.write(c.join(r,L),t.fragment),O.push({pattern:s.pattern,compiledPath:K,fragmentPath:L,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:M}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let H=c.resolve(o,d);if(m.existsSync(H)){let{copied:s,bytes:h}=X(H,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let k=fr(o);if(k){let{copied:s,bytes:h}=X(k,c.join(r,"public",pr));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${fn}/`)}let E={runtime:v.filename,router:b.filename},C=Na(O,E,r);if(C.routeRules=A,C.routerContainer=D,f)C.apiRoutes=await Zo(o,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await qi(o,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Xc(e._layerGraph),null,2));Ma(C,r);let F=Date.now()-l;return console.log(`
2
+ import{ft}from"./chunk-0b57fgpn.js";import{At,sr}from"./chunk-qt2mr3f0.js";import{ye,Rn,El,Tl}from"./chunk-9m45t60c.js";import{Wr,qr,Kr,Xr,De}from"./chunk-945zygwa.js";import{z}from"./chunk-esm0pnpz.js";import{Ki}from"./chunk-472w7t7p.js";import{S}from"./chunk-fsxk5fsh.js";import{i}from"./chunk-r9n86na1.js";import{q,a}from"./chunk-40fpt0r6.js";import{Jc}from"./chunk-vw7crz0z.js";import{qn,Kn,rt,Be,Ma,Da,Gn}from"./chunk-4wd5sn16.js";import{vn,Qo}from"./chunk-becs8132.js";import{Xn}from"./chunk-gnf1e5q7.js";import{fn,fr,gr}from"./chunk-arfpzf17.js";import{re}from"./chunk-e0bwzxfd.js";import m from"fs";import c from"path";import{createHash as Y}from"crypto";function I(n){return Y("sha256").update(n).digest("hex").slice(0,8)}function W(n=!1){let l=n?sr():At(),o=I(l);return{content:l,filename:`runtime.${o}.js`,hash:o}}function J(){let n=ft(),l=I(n);return{content:n,filename:`router.${l}.js`,hash:l}}import U from"path";import{createHash as Q}from"crypto";function ee(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function V(n,l,o={}){let r=U.resolve(n),e=await Bun.file(r).text(),x=Q("sha256").update(e).digest("hex").slice(0,16);El();let _={};try{_=await a(o.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>ye(R))),{context:D}=ee({__filename:r,__dirname:U.dirname(r),__stx_serverDeclared:u}),A=new Set,T={...q,..._,...o,buildMode:"compile",strict:!1},f=await i(e,D,r,T,A),w=qn(f)+Kn(f)+rt(f),j=Tl();return{route:l,sourceFile:n,html:f,fragment:w,placeholders:j,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:x,status:Rn(e),streamTemplates:D.__streamTemplates}}var te=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function X(n,l){let o=0,r=0;if(!m.existsSync(n))return{copied:o,bytes:r};m.mkdirSync(l,{recursive:!0});function e(x,_){let y=m.readdirSync(x,{withFileTypes:!0});for(let d of y){if(te.has(d.name))continue;let g=c.join(x,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),o++,r+=m.statSync(u).size}}}return e(n,l),{copied:o,bytes:r}}async function Nm(n={}){let l=Date.now(),o=c.resolve(n.root||process.cwd()),r=c.resolve(o,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await a(o),x=c.resolve(o,n.componentsDir??e.componentsDir??"components"),_=c.resolve(o,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(o,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",g=De(e.app?.head,{known:Xr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=n.routeRules??e.routeRules??{},T=Xn(A),f=n.serverApi??e.serverApi,w=typeof f==="object"?f:{};if(f)vn(o,w);if(e.runtimeConfig)z(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let j=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of j)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=re(o,{pagesDirs:e._layerPageDirs}),Z=["components","layouts","partials"],P=R.filter((s)=>!Z.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${P.length} page routes (${R.length-P.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=W(n.debug),b=J();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",b.filename),b.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${b.filename} (${(b.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let B=[],O=[];for(let s of P){let h=T(s.pattern),M=h.rendering==="prerender";if(M&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await V(s.filePath,s.pattern,{configDir:o,componentsDir:x,partialsDir:_,layoutsDir:y,debug:n.debug});if(B.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,b.filename),t.html=Kr(t.html,g,{bodyScripts:[`<script src="/__stx/${b.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Wr(t.html,u);if(g.htmlAttrs)t.html=qr(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let G=p[1];t.html=t.html.replace(" "+G,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${G}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await S(t.html),M){let p=await Gn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=Be(t.html,D,!0);let N=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),K=c.join("server","pages",`${N}.compiled.json`),L=c.join("server","fragments",`${N}.html`);await Bun.write(c.join(r,K),JSON.stringify(t,null,2)),await Bun.write(c.join(r,L),t.fragment),O.push({pattern:s.pattern,compiledPath:K,fragmentPath:L,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:M}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let H=c.resolve(o,d);if(m.existsSync(H)){let{copied:s,bytes:h}=X(H,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let k=gr(o);if(k){let{copied:s,bytes:h}=X(k,c.join(r,"public",fr));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${fn}/`)}let E={runtime:v.filename,router:b.filename},C=Ma(O,E,r);if(C.routeRules=A,C.routerContainer=D,f)C.apiRoutes=await Qo(o,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Ki(o,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Jc(e._layerGraph),null,2));Da(C,r);let F=Date.now()-l;return console.log(`
3
3
  [stx build] Done in ${F}ms \u2014 ${B.length} pages compiled`),{pageCount:B.length,assets:E,outputDir:r,duration:F}}
4
- export{Om};
4
+ export{Nm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{le,ue,de,Jn,Ee,Fe,ds,vu,$t,ln,Yn,Zn,Qn,pe,er,tr,ps}from"./chunk-7pfhr4nk.js";import"./chunk-9ejk9mwk.js";export{ue as DEFAULT_FORMATS,de as DEFAULT_QUALITY,le as DEFAULT_WIDTHS,ps as ImageProcessingError,tr as formatSize,ln as generateSizes,$t as generateSrcSet,Yn as getFallbackVariant,ds as getImageMetadata,pe as getMimeType,er as getTotalSize,Zn as groupVariantsByFormat,Ee as isImageBackendAvailable,Qn as isImageFile,Jn as isSharpAvailable,Fe as processImage,vu as resizeAndConvert};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function Fa(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function za(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
2
+ function za(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function Ha(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
3
3
  <div class="virtual-item ${t.itemClass||""}"
4
4
  style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
5
5
  data-index="${a}">
@@ -76,7 +76,7 @@ function Fa(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
76
76
  };
77
77
  })();
78
78
  </script>
79
- `})}function xu(){return`
79
+ `})}function Su(){return`
80
80
  .virtual-list-container {
81
81
  position: relative;
82
82
  overflow-y: auto;
@@ -124,7 +124,7 @@ function Fa(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
124
124
  0% { background-position: 200% 0; }
125
125
  100% { background-position: -200% 0; }
126
126
  }
127
- `}function Su(v,c){let l=null,u=()=>{if(!l)l=Fa(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function ku(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=za(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
127
+ `}function ku(v,c){let l=null,u=()=>{if(!l)l=za(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function _u(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=Ha(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
128
128
  // Infinite scroll detection
129
129
  container.addEventListener('scroll', function() {
130
130
  const scrollBottom = container.scrollTop + container.clientHeight;
@@ -142,7 +142,7 @@ function Fa(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
142
142
  ${x}
143
143
  </div>
144
144
  </div>
145
- `})}function _u(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
145
+ `})}function Cu(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
146
146
  <div class="virtual-grid-item"
147
147
  style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
148
148
  data-index="${I}">
@@ -212,5 +212,5 @@ function Fa(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
212
212
  });
213
213
  })();
214
214
  </script>
215
- `})}var ah={createVirtualList:Fa,processVirtualListDirectives:za,processInfiniteListDirectives:ku,processVirtualGridDirectives:_u,generateVirtualListCSS:xu,useVirtualList:Su};
216
- export{Fa,za,xu,Su,ku,_u,ah};
215
+ `})}var ch={createVirtualList:za,processVirtualListDirectives:Ha,processInfiniteListDirectives:_u,processVirtualGridDirectives:Cu,generateVirtualListCSS:Su,useVirtualList:ku};
216
+ export{za,Ha,Su,ku,_u,Cu,ch};
@@ -298,5 +298,5 @@ catch (error) {
298
298
  init();
299
299
  }
300
300
  })();
301
- </script>`}var sm={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},om={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},im={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},am={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},So=[sm,om,im,am];function Wy(t){return[...t,...So]}
302
- export{sm,om,im,am,So,Wy};
301
+ </script>`}var om={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},im={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},am={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},cm={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},ko=[om,im,am,cm];function qy(t){return[...t,...ko]}
302
+ export{om,im,am,cm,ko,qy};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{P}from"./chunk-0vrt55pp.js";import{xe}from"./chunk-1bft48gk.js";function g(e,t){let r={};for(let n of e)r[n]=xe(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=xe(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Ha(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=xe(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var Mu=Ha;class tr{rules=[];defaultValue="";addRule(e){let t=new tr;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new tr;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new tr;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var lh=new tr;function Du(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>P(c,{...t,message:l},r)).join(`
3
- `)}catch{return""}})}function Lu(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>P(c,{...t,message:l},r)).join(`
4
- `)}catch{return""}})}function ju(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function uh(e,t,r){let n=e;return n=Du(n,t,r),n=Lu(n,t,r),n=ju(n,t,r),n}export{Ha,Mu,tr,lh,Du,Lu,ju,uh};
2
+ import{P}from"./chunk-9m45t60c.js";import{xe}from"./chunk-50wjk5ap.js";function g(e,t){let r={};for(let n of e)r[n]=xe(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=xe(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Va(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=xe(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var Du=Va;class nr{rules=[];defaultValue="";addRule(e){let t=new nr;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new nr;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new nr;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var uh=new nr;function Lu(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>P(c,{...t,message:l},r)).join(`
3
+ `)}catch{return""}})}function ju(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>P(c,{...t,message:l},r)).join(`
4
+ `)}catch{return""}})}function Bu(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function dh(e,t,r){let n=e;return n=Lu(n,t,r),n=ju(n,t,r),n=Bu(n,t,r),n}export{Va,Du,nr,uh,Lu,ju,Bu,dh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{tn}from"./chunk-67j2m620.js";import{c,f}from"./chunk-hxws025y.js";function vo(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=tn(e),i=`
2
+ import{tn}from"./chunk-bzd387yx.js";import{c,f}from"./chunk-p92272k0.js";function xo(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=tn(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -43,8 +43,8 @@ if ('serviceWorker' in navigator) {
43
43
  });
44
44
  }
45
45
  </script>
46
- <!-- End stx PWA -->`,i}function ra(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=c(e);if(o!==-1){let i=vo(n);return e.slice(0,o)+i+`
47
- `+e.slice(o)}return e+vo(n)}let t=vo(n);return f(e,t)}function em(e){if(!e.pwa?.enabled)return"";return`<script>
46
+ <!-- End stx PWA -->`,i}function sa(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=c(e);if(o!==-1){let i=xo(n);return e.slice(0,o)+i+`
47
+ `+e.slice(o)}return e+xo(n)}let t=xo(n);return f(e,t)}function tm(e){if(!e.pwa?.enabled)return"";return`<script>
48
48
  if ('serviceWorker' in navigator) {
49
49
  window.addEventListener('load', function() {
50
50
  navigator.serviceWorker.register('/${tn(e)}')
@@ -56,5 +56,5 @@ if ('serviceWorker' in navigator) {
56
56
  });
57
57
  });
58
58
  }
59
- </script>`}function tm(){return'<link rel="manifest" href="/manifest.json">'}function nm(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
60
- export{vo,ra,em,tm,nm};
59
+ </script>`}function nm(){return'<link rel="manifest" href="/manifest.json">'}function rm(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
60
+ export{xo,sa,tm,nm,rm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{og,Pc,sy,Ic,ig,ag,Sn,vr,oy,cg,lg,iy,S}from"./chunk-fsxk5fsh.js";import"./chunk-g065d7p7.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Sn as buildCss,cg as extractClassNames,ag as fingerprintConfig,lg as generateCss,oy as getCachedCSS,og as getCssServeAsset,S as injectCss,Pc as loadCssEngine,Ic as loadCssEngineConfig,vr as rebuildCss,sy as resetCssCache,ig as resolveUserCssConfig,iy as withLinkedModuleBundles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{kt,_t,Ct}from"./chunk-pwpge9bj.js";import{nn,rn,St,ba,sn,on}from"./chunk-g5nfqzfh.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();nn();let t=await kt({mode:"build"});if(!t.config.enabled){St("Story feature is disabled in config.");return}let n=await sn(t);_t(t,n);let l=on(t.config,n);Ct(t,l),rn(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;ba(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
2
+ import{kt,_t,Ct}from"./chunk-pwpge9bj.js";import{nn,rn,St,wa,sn,on}from"./chunk-r0az4z6d.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();nn();let t=await kt({mode:"build"});if(!t.config.enabled){St("Story feature is disabled in config.");return}let n=await sn(t);_t(t,n);let l=on(t.config,n);Ct(t,l),rn(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;wa(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  var i=/<!--[\s\S]*?-->|<(script|style|textarea|title)\b[^>]*>[\s\S]*?<\/\1\s*>|<\/(head|body)\s*>/gi;function o(e,r,t){if(!e.includes(`</${r}`)&&!e.includes(`</${r.toUpperCase()}`))return-1;let n=-1;i.lastIndex=0;for(let s=i.exec(e);s;s=i.exec(e)){if(s[2]?.toLowerCase()!==r)continue;if(n=s.index,t==="first")break}return i.lastIndex=0,n}function L(e){return o(e,"head","first")}function c(e){return o(e,"body","last")}function f(e,r,t=`
3
- `){let n=L(e);if(n===-1)return e;return`${e.slice(0,n)}${r}${t}${e.slice(n)}`}function oa(e,r,t=`
3
+ `){let n=L(e);if(n===-1)return e;return`${e.slice(0,n)}${r}${t}${e.slice(n)}`}function ia(e,r,t=`
4
4
  `){let n=c(e);if(n===-1)return`${e}
5
5
  ${r}`;return`${e.slice(0,n)}${r}${t}${e.slice(n)}`}
6
- export{L,c,f,oa};
6
+ export{L,c,f,ia};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{y,b,g}from"./chunk-0vrt55pp.js";import{q}from"./chunk-qcbj1m21.js";import{i}from"./chunk-b9npgke0.js";import k from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,n;O.lastIndex=0;while((n=O.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function dh(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await y(p,f,e);let E=z(c),l=new Set;if(!E.some((h)=>h.type==="suspense")){let h=n.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let u=await i(c,f,e,n,l);for(let x=0;x<u.length;x+=s)r.enqueue(u.slice(x,x+s)),await new Promise((m)=>setTimeout(m,0))}else{let u=[],x=new RegExp(T.source,"g"),m;while((m=x.exec(c))!==null)u.push({name:m[1],content:m[2],start:m.index,end:m.index+m[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let D=await i(I,f,e,n,l);r.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let h=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
2
+ import{y,b,g}from"./chunk-9m45t60c.js";import{q}from"./chunk-40fpt0r6.js";import{i}from"./chunk-r9n86na1.js";import k from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,n;O.lastIndex=0;while((n=O.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function ph(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await y(p,f,e);let E=z(c),l=new Set;if(!E.some((h)=>h.type==="suspense")){let h=n.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let u=await i(c,f,e,n,l);for(let x=0;x<u.length;x+=s)r.enqueue(u.slice(x,x+s)),await new Promise((m)=>setTimeout(m,0))}else{let u=[],x=new RegExp(T.source,"g"),m;while((m=x.exec(c))!==null)u.push({name:m[1],content:m[2],start:m.index,end:m.index+m[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let D=await i(I,f,e,n,l);r.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let h=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(d.name,i(d.content,f,e,n,l))}r.enqueue(`
5
5
  <script>
@@ -17,13 +17,13 @@ import{y,b,g}from"./chunk-0vrt55pp.js";import{q}from"./chunk-qcbj1m21.js";import
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let S=Array.from(h.entries()).map(async([d,u])=>{r.enqueue(await Va(d,u))});await Promise.all(S)}r.close()}catch(a){r.error(a)}}})}async function Va(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let S=Array.from(h.entries()).map(async([d,u])=>{r.enqueue(await Ua(d,u))});await Promise.all(S)}r.close()}catch(a){r.error(a)}}})}async function Ua(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${n}\`);
23
23
  </script>`}catch(o){let n=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${g(n)}</div>');
26
- </script>`}}var Bu=`
26
+ </script>`}}var Fu=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function ph(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(Bu),await Promise.all(t.map(async(r)=>{let a=A(r.render(),n,r.id);s.enqueue(await Va(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function fh(e,t){return e.replace(B,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),w=a[0].trim(),p=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=w,`<div data-suspense="${r}">${p}</div>`})}function gh(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function mh(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await y(p,f,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let S=await i(c,f,e,n,E);for(let d=0;d<S.length;d+=s)r.enqueue(S.slice(d,d+s))}else{let S=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)S.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let x=0;for(let m of S){if(m.start>x){let _=c.slice(x,m.start);if(_.trim()){let C=await i(_,f,e,n,E);r.enqueue(C)}}let v=await i(m.content,f,e,n,E);r.enqueue(v),x=m.end}if(x<c.length){let m=c.slice(x);if(m.trim()){let v=await i(m,f,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function hh(e,t={}){let o={...q,...t,streaming:{...M,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,p={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];p[l]=R}let f=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await y(r,R,e),i(f,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!p[l])return`<div class="error-message">Section "${g(l)}" not found in template "${g(e)}"</div>`;let h={...R,__filename:e,__dirname:k.dirname(e)};await y(r,h,e);let S=new Set;return await i(p[l],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return b("Expression",S,e,p[l]||"",0,p[l]||"")}},getSections:()=>Object.keys(p),getTemplate:()=>w}}var Fu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},zu={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),p=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
46
+ </script>`;function A(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function fh(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(Fu),await Promise.all(t.map(async(r)=>{let a=A(r.render(),n,r.id);s.enqueue(await Ua(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function gh(e,t){return e.replace(B,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),w=a[0].trim(),p=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=w,`<div data-suspense="${r}">${p}</div>`})}function mh(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function hh(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await y(p,f,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let S=await i(c,f,e,n,E);for(let d=0;d<S.length;d+=s)r.enqueue(S.slice(d,d+s))}else{let S=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)S.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let x=0;for(let m of S){if(m.start>x){let _=c.slice(x,m.start);if(_.trim()){let C=await i(_,f,e,n,E);r.enqueue(C)}}let v=await i(m.content,f,e,n,E);r.enqueue(v),x=m.end}if(x<c.length){let m=c.slice(x);if(m.trim()){let v=await i(m,f,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function yh(e,t={}){let o={...q,...t,streaming:{...M,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,p={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];p[l]=R}let f=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await y(r,R,e),i(f,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!p[l])return`<div class="error-message">Section "${g(l)}" not found in template "${g(e)}"</div>`;let h={...R,__filename:e,__dirname:k.dirname(e)};await y(r,h,e);let S=new Set;return await i(p[l],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return b("Expression",S,e,p[l]||"",0,p[l]||"")}},getSections:()=>Object.keys(p),getTemplate:()=>w}}var zu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},Hu={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),p=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${p?`{${p}}`:"{}"}
50
50
  </script>
51
- </div>`}};function yh(e={}){let t=[];if(e.streaming?.enabled)t.push(Fu);if(e.hydration?.enabled)t.push(zu);return t}async function bh(e,t,o,n={}){return e}function wh(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function vh(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function bh(e={}){let t=[];if(e.streaming?.enabled)t.push(zu);if(e.hydration?.enabled)t.push(Hu);return t}async function wh(e,t,o,n={}){return e}function vh(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function xh(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{dh,Va,Bu,ph,fh,gh,mh,hh,Fu,zu,yh,bh,wh,vh};
194
+ export{ph,Ua,Fu,fh,gh,mh,hh,yh,zu,Hu,bh,wh,vh,xh};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import i from"path";var Cn=".stx",o="STX_DIR",e=null;function tl(t){e=t?.trim()||null}function Pr(){return process.env[o]?.trim()||e||Cn}function l(t=process.cwd(),...n){let r=Pr();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function Ir(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==Cn&&!n.startsWith(`${Cn}/`))return t;let r=n.slice(Cn.length+1);return r?i.join(Pr(),r):Pr()}
3
+ export{Cn,tl,Pr,l,Ir};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{_m}from"./chunk-d1bwb2kz.js";import"./chunk-r9n86na1.js";import"./chunk-fsxk5fsh.js";import"./chunk-q6p96qq7.js";import"./chunk-de61k0ab.js";import"./chunk-eka2e4cm.js";import"./chunk-9vafweyd.js";import"./chunk-8v2hsn4d.js";import"./chunk-5jrpzepc.js";import"./chunk-8rgy17fj.js";import"./chunk-e0bwzxfd.js";import"./chunk-vbmvft7g.js";import"./chunk-g065d7p7.js";import"./chunk-65g78sge.js";import"./chunk-40fpt0r6.js";import"./chunk-rapr0m13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{_m as startInteractive};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ie,zi,Hi,Lg,Xt,xl,jg,Sl,$y,Ke,Pn,Ge}from"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import{Bl,t}from"./chunk-68r2zs20.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Ie as BROWSER_CORE_IMPORTS,Lg as STX_AUTO_IMPORTS,zi as extractAndStripCssImports,Ke as extractBridgeData,Bl as findInterpolationEnd,Sl as generateAutoImportDestructuring,$y as generateBrowserAutoImportDestructuring,Pn as generateServerDataBridge,Xt as injectBrowserCoreAutoImports,Ge as processClientScript,jg as referencesName,Hi as renderVendorStyleTags,t as stripCommentsAndLiterals,xl as transformAutoImports};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{d,m,M,p,te}from"./chunk-xmg6bmh6.js";import{T}from"./chunk-0jdz31q1.js";import{X,Gs,We,B,Ut,jr,Xe,Je,s,b,Ne,P}from"./chunk-0vrt55pp.js";import{xt}from"./chunk-cphc60zw.js";import{D}from"./chunk-vk2jy6mn.js";import{ge}from"./chunk-80ky40mm.js";import{W,lt}from"./chunk-a7bqrjm5.js";import{I,jn}from"./chunk-a0aqs5a8.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,z=t+1;while(z<r.length&&C>0){if(r[z]==="(")C++;else if(r[z]===")")C--;z++}if(C!==0)break;let ie=r.substring(t+1,z-1),N=`${a}(${ie})`;r=r.substring(0,u)+N+r.substring(z),S.lastIndex=u+N.length,n=S.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,u=e.length,t=(N)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<u&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},z=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
2
+ import{d,m,M,p,te}from"./chunk-945zygwa.js";import{T}from"./chunk-0jdz31q1.js";import{X,Xs,We,B,Ut,Br,Xe,Je,s,b,Ne,P}from"./chunk-9m45t60c.js";import{xt}from"./chunk-hdfhaddy.js";import{D}from"./chunk-7b3dqeyr.js";import{ge}from"./chunk-5jrpzepc.js";import{W,lt}from"./chunk-a7bqrjm5.js";import{I,Bn}from"./chunk-qykbjg3z.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,z=t+1;while(z<r.length&&C>0){if(r[z]==="(")C++;else if(r[z]===")")C--;z++}if(C!==0)break;let ie=r.substring(t+1,z-1),N=`${a}(${ie})`;r=r.substring(0,u)+N+r.substring(z),S.lastIndex=u+N.length,n=S.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,u=e.length,t=(N)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<u&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},z=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
3
3
  `)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(S!==0)return;let N=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let H=N[2];if(!r.has(H))a.push(H),r.add(H);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let H=se[1];if(!r.has(H))a.push(H),r.add(H);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let H=Y[1];if(!r.has(H))a.push(H),r.add(H)}};while(n<u){if(z())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){C();continue}if(e[n]==="{"){S++,n++;continue}if(e[n]==="}"){S--,n++;continue}if(S===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
4
4
  (function() {
5
5
  ${xt("var",a)}
@@ -9,7 +9,7 @@ import{d,m,M,p,te}from"./chunk-xmg6bmh6.js";import{T}from"./chunk-0jdz31q1.js";i
9
9
 
10
10
  ${c}
11
11
  ${e}})();
12
- `}function Re(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),S=new Set(X(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>S.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Gs(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
12
+ `}function Re(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),S=new Set(X(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>S.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Xs(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
13
13
  `);return`
14
14
  // Register scope variables for STX runtime
15
15
  if (!window.stx._scopes) window.stx._scopes = {};
@@ -44,11 +44,11 @@ ${n}
44
44
  }
45
45
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
46
46
  }
47
- })();`;return a+c+r}function Me(c,e){if(W(c)){let n=W(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:lt(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Ut(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),u=S.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],z=r[2];return{html:`${t}${C} data-stx-scope="${e}"${z}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Te=0;function fe(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Te}`}var le=new Set,pe=new Set;function iy(){le.clear(),pe.clear()}var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function lg(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],z=u[3]==="/"||Ae.has(C.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(C);if(!z)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var ct=new T(500),Ic=new Set;function ay(){Ic.clear()}function Ce(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Ic}async function _s(c,e,a,r,S,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=Ce(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let O=o[1],F=z(O,u,a),E="";if(F&&await Bun.file(F).exists())S.add(F),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(x+1,o-1),F=ae(O,0);if(F===-1){h.lastIndex=o;continue}let E=O.substring(0,F).trim(),V=O.substring(F+1).trim(),U=V.match(/^\s*['"]([^'"]+)['"]/);if(!U){h.lastIndex=o;continue}let _=U[1],J=V.substring(U[0].length),j,R=ae(J,0);if(R!==-1)j=J.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let ee=v?!L:L,re="";if(ee){let oe=z(_,u,a);if(oe&&await Bun.file(oe).exists())S.add(oe);re=`@include('${_}'${j?`, ${j}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),ee=b("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let[,F,E,V,U]=O;try{let _,J=E.trim();if(m(J))_=p(J,Object.keys(e))(...Object.values(e));else _=d(J,e);let j="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(F,k,c,h);j+=L}else if(U)j=await se(U,{},c,h);t=t.substring(0,h)+j+t.substring(x+1),f.lastIndex=0}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+b("Each",`Error in @each: ${J}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let F=O[1],E=l.slice(O[0].length),V,U=E.match(/^\s*,\s*\{/);if(U){E=E.slice(U[0].length-1);let j=1,R=1;while(R<E.length&&j>0){if(E[R]==="{")j++;else if(E[R]==="}"){if(j--,j===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,J=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(J)_=J[1];try{let j=JSON.parse(F.replace(/'/g,'"')),R={};if(V)try{R=M(V,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let re=b("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of j){let ee=z(L,u,a);if(!ee)continue;if(await s(ee)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=b("Include",`None of the includeFirst paths exist: ${F}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let R=j instanceof Error?j.message:String(j),k=b("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function z(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let U of r._layerPartialDirs??[]){let _=A.resolve(U,g);if(_.startsWith(`${A.resolve(U)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),O=o.startsWith(i+A.sep)||o===i,F=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))E=!0}if(!O&&!F&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function N(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),b("Include",v,a,h,g)}async function se(f,v={},h,g){let i=z(f,u,a);if(!i)return N(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return N(f,`Circular include detected: ${l}`,h,g)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let q=y instanceof Error?y.message:String(y);return N(f,`Error loading include file ${f}: ${q}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-rarsjcs4.js");l=y(l,e)}if(l&&(r.debug||!I()&&!jn()))try{let{warnUnbalancedTags:y}=await import("./chunk-1p4q6t48.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-j1ncsbk2.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=B(o);if(O)o=O.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let U=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,q,w)=>{if(!me(q))return"";return U.push({attrs:q,body:w}),`__STX_DATA_BLOCK_${U.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Ne(l,i);for(let[y,q]of Object.entries(v))_[y]=q;let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(J)].sort((y,q)=>{let w=(y[1]||"").includes("server"),K=(q[1]||"").includes("server");return Number(K)-Number(w)}),R="",k=null,L=!1,ee=!1;for(let y of j){let q=y[1]||"",w=y[2]||"";if(me(q))continue;let K=q.includes("server"),be=Xe(q);if(!K&&!/\bsrc\s*=/i.test(q))We(w,i,r.strict);if(!K&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-fsehzmg8.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-a0jhmkpd.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Je(w);if(!K){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-a0jhmkpd.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-jytqf6p6.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-s5j4fpdr.js");w=Z(w)}let de=Ee(w);if(!K){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-a0jhmkpd.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
47
+ })();`;return a+c+r}function Me(c,e){if(W(c)){let n=W(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:lt(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Ut(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),u=S.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],z=r[2];return{html:`${t}${C} data-stx-scope="${e}"${z}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Te=0;function fe(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Te}`}var le=new Set,pe=new Set;function ay(){le.clear(),pe.clear()}var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ug(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],z=u[3]==="/"||Ae.has(C.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(C);if(!z)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var ct=new T(500),Oc=new Set;function cy(){Oc.clear()}function Ce(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Oc}async function Cs(c,e,a,r,S,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=Ce(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let O=o[1],F=z(O,u,a),E="";if(F&&await Bun.file(F).exists())S.add(F),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(x+1,o-1),F=ae(O,0);if(F===-1){h.lastIndex=o;continue}let E=O.substring(0,F).trim(),V=O.substring(F+1).trim(),U=V.match(/^\s*['"]([^'"]+)['"]/);if(!U){h.lastIndex=o;continue}let _=U[1],J=V.substring(U[0].length),j,R=ae(J,0);if(R!==-1)j=J.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let ee=v?!L:L,re="";if(ee){let oe=z(_,u,a);if(oe&&await Bun.file(oe).exists())S.add(oe);re=`@include('${_}'${j?`, ${j}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),ee=b("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let[,F,E,V,U]=O;try{let _,J=E.trim();if(m(J))_=p(J,Object.keys(e))(...Object.values(e));else _=d(J,e);let j="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(F,k,c,h);j+=L}else if(U)j=await se(U,{},c,h);t=t.substring(0,h)+j+t.substring(x+1),f.lastIndex=0}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+b("Each",`Error in @each: ${J}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let F=O[1],E=l.slice(O[0].length),V,U=E.match(/^\s*,\s*\{/);if(U){E=E.slice(U[0].length-1);let j=1,R=1;while(R<E.length&&j>0){if(E[R]==="{")j++;else if(E[R]==="}"){if(j--,j===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,J=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(J)_=J[1];try{let j=JSON.parse(F.replace(/'/g,'"')),R={};if(V)try{R=M(V,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let re=b("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of j){let ee=z(L,u,a);if(!ee)continue;if(await s(ee)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=b("Include",`None of the includeFirst paths exist: ${F}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let R=j instanceof Error?j.message:String(j),k=b("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function z(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let U of r._layerPartialDirs??[]){let _=A.resolve(U,g);if(_.startsWith(`${A.resolve(U)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),O=o.startsWith(i+A.sep)||o===i,F=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))E=!0}if(!O&&!F&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function N(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),b("Include",v,a,h,g)}async function se(f,v={},h,g){let i=z(f,u,a);if(!i)return N(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return N(f,`Circular include detected: ${l}`,h,g)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let q=y instanceof Error?y.message:String(y);return N(f,`Error loading include file ${f}: ${q}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-y10eaxgc.js");l=y(l,e)}if(l&&(r.debug||!I()&&!Bn()))try{let{warnUnbalancedTags:y}=await import("./chunk-k79dvx67.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-jq49238b.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=B(o);if(O)o=O.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let U=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,q,w)=>{if(!me(q))return"";return U.push({attrs:q,body:w}),`__STX_DATA_BLOCK_${U.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Ne(l,i);for(let[y,q]of Object.entries(v))_[y]=q;let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(J)].sort((y,q)=>{let w=(y[1]||"").includes("server"),K=(q[1]||"").includes("server");return Number(K)-Number(w)}),R="",k=null,L=!1,ee=!1;for(let y of j){let q=y[1]||"",w=y[2]||"";if(me(q))continue;let K=q.includes("server"),be=Xe(q);if(!K&&!/\bsrc\s*=/i.test(q))We(w,i,r.strict);if(!K&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-k352spys.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-q4yq72wh.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Je(w);if(!K){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-q4yq72wh.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-2vqamyay.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-hpqvq1r9.js");w=Z(w)}let de=Ee(w);if(!K){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-q4yq72wh.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
48
48
  ${w}`}if(de&&!K){L=!0,k=fe(i,e);let Z=D(w),Q=ue(Z,k);R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}">${Q}</script>
49
- `;continue}if(K)try{let{extractVariables:Z}=await import("./chunk-qfxy34d4.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!K&&!de){let Z=q.replace(/\bclient\b/i,"").trim();k=fe(i,e);let Q=D(w),ne=ue(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))ee=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
- `}}if(U.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-fsehzmg8.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q,w)=>{let K=U[Number(w)];return`<script${K.attrs}>${y(K.body,_,f)}</script>`})}if(k){let y=Me(o,k);if(o=y.html,y.mergedIntoExisting){let w=k,K=y.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${K}'`).split(`"${w}"`).join(`"${K}"`),k=K}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let w=lg(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((K)=>`<${K}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let q=y.stamped&&y.root!==null&&jr(y.root);R=ke(R,q?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await _s(o,_,i,r,S,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-a2bstyq1.js"),G=re(o,_,i,void 0,!0);G=ge(G,_,i),G=oe(G);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-690518hw.js");if(G=xe(G,_,i,r),G=we(G,_,i),G=_e(G,_,i,r),G=P(G,_,i),V)G+=`
49
+ `;continue}if(K)try{let{extractVariables:Z}=await import("./chunk-1tb18a92.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!K&&!de){let Z=q.replace(/\bclient\b/i,"").trim();k=fe(i,e);let Q=D(w),ne=ue(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))ee=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
+ `}}if(U.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-k352spys.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q,w)=>{let K=U[Number(w)];return`<script${K.attrs}>${y(K.body,_,f)}</script>`})}if(k){let y=Me(o,k);if(o=y.html,y.mergedIntoExisting){let w=k,K=y.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${K}'`).split(`"${w}"`).join(`"${K}"`),k=K}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let w=ug(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((K)=>`<${K}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let q=y.stamped&&y.root!==null&&Br(y.root);R=ke(R,q?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await Cs(o,_,i,r,S,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-bmwcgmev.js"),G=re(o,_,i,void 0,!0);G=ge(G,_,i),G=oe(G);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-zw6tgr0s.js");if(G=xe(G,_,i,r),G=we(G,_,i),G=_e(G,_,i,r),G=P(G,_,i),V)G+=`
51
51
  `+V;if(R)G+=`
52
- `+R;return G}catch(l){if(l instanceof te)throw l;let o=l instanceof Error?l.message:String(l);return N(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],O,F=x.substring(l[0].length),E=ae(F,0);if(E!==-1)O=F.substring(E+1).trim();let V={};if(O)try{V=M(O,e)}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.replace(i,b("Include",`Error parsing include variables for ${o}: ${J}`,a,c,f)),Y.lastIndex=0;continue}let U=await se(o,V,c,f);t=t.substring(0,f)+U+t.substring(g),Y.lastIndex=0}return t}function Cs(c,e){let a=c;function r(S,n,u,t){let C=S,z=!0;while(z){z=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),N=C.match(ie);if(!N||N.index===void 0)break;let se=N.index,Y=N[1],H=se+N[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),O=l.match(v),F=o?g+o.index:1/0,E=O?g+O.index:1/0;if(F<E)h++,g=F+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),z=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function Es(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
52
+ `+R;return G}catch(l){if(l instanceof te)throw l;let o=l instanceof Error?l.message:String(l);return N(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],O,F=x.substring(l[0].length),E=ae(F,0);if(E!==-1)O=F.substring(E+1).trim();let V={};if(O)try{V=M(O,e)}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.replace(i,b("Include",`Error parsing include variables for ${o}: ${J}`,a,c,f)),Y.lastIndex=0;continue}let U=await se(o,V,c,f);t=t.substring(0,f)+U+t.substring(g),Y.lastIndex=0}return t}function Es(c,e){let a=c;function r(S,n,u,t){let C=S,z=!0;while(z){z=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),N=C.match(ie);if(!N||N.index===void 0)break;let se=N.index,Y=N[1],H=se+N[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),O=l.match(v),F=o?g+o.index:1/0,E=O?g+O.index:1/0;if(F<E)h++,g=F+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),z=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function Ts(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
53
53
  `)})}
54
- export{iy,lg,ct,Ic,ay,_s,Cs,Es};
54
+ export{ay,ug,ct,Oc,cy,Cs,Es,Ts};