@stacksjs/stx 0.2.861 → 0.2.863

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 (291) hide show
  1. package/dist/analytics.js +3 -2
  2. package/dist/animation.js +3 -3
  3. package/dist/app-shell.js +4 -3
  4. package/dist/{chunk-14cvwsy1.js → chunk-01c16zw4.js} +2 -2
  5. package/dist/chunk-021tjkd6.js +3 -0
  6. package/dist/chunk-0bfgsv31.js +2 -0
  7. package/dist/chunk-0twkeh31.js +2 -0
  8. package/dist/chunk-0xtda6aw.js +2 -0
  9. package/dist/chunk-15m7jnc0.js +33 -0
  10. package/dist/{chunk-7bajrfb1.js → chunk-1grdbpsk.js} +8 -8
  11. package/dist/{chunk-9syvkm5z.js → chunk-1mqcttg3.js} +6 -6
  12. package/dist/chunk-2asyyky3.js +2 -0
  13. package/dist/{chunk-eye156nv.js → chunk-2c18y094.js} +1 -1
  14. package/dist/chunk-2n932qtv.js +20 -0
  15. package/dist/{chunk-76360zky.js → chunk-32ty2zx6.js} +9 -9
  16. package/dist/chunk-36j129p1.js +2 -0
  17. package/dist/chunk-3gk1e2b1.js +2 -0
  18. package/dist/chunk-3ryp43f3.js +2 -0
  19. package/dist/{chunk-12r22pf0.js → chunk-3z1mmar2.js} +2 -2
  20. package/dist/{chunk-zhxdpzga.js → chunk-46ddesnf.js} +3 -3
  21. package/dist/chunk-46pxmpeb.js +3 -0
  22. package/dist/chunk-4pr29yrx.js +2 -0
  23. package/dist/{chunk-tjz3r7rj.js → chunk-55zq2ha8.js} +5 -5
  24. package/dist/{chunk-avp271q4.js → chunk-58sh82aj.js} +2 -2
  25. package/dist/{chunk-gggadrs4.js → chunk-5a0d3048.js} +3 -3
  26. package/dist/{chunk-121cgm3s.js → chunk-5p1k2h5q.js} +8 -8
  27. package/dist/chunk-5s1fb8z4.js +4 -0
  28. package/dist/{chunk-x69457q9.js → chunk-5zzrrxns.js} +8 -8
  29. package/dist/chunk-64ebysb4.js +2 -0
  30. package/dist/{chunk-4rrxrxp6.js → chunk-669b2bya.js} +4 -4
  31. package/dist/{chunk-38qp2pg2.js → chunk-67dgp45w.js} +2 -2
  32. package/dist/{chunk-5xdkmn39.js → chunk-6ftee542.js} +2 -2
  33. package/dist/{chunk-5wr1qqz3.js → chunk-6k4ac74t.js} +2 -2
  34. package/dist/{chunk-c2w4wc9f.js → chunk-6m6y9bbx.js} +1 -1
  35. package/dist/chunk-6pczzq5f.js +2 -0
  36. package/dist/{chunk-6tp0w6hf.js → chunk-7ayvybdy.js} +3 -3
  37. package/dist/chunk-7mjf144y.js +2 -0
  38. package/dist/chunk-7wqevtks.js +2 -0
  39. package/dist/{chunk-bag9q4m0.js → chunk-8502xb4n.js} +39 -39
  40. package/dist/chunk-85zmxbt0.js +33 -0
  41. package/dist/{chunk-cxpq2zna.js → chunk-8arfg8kp.js} +3 -3
  42. package/dist/{chunk-xmy6g81m.js → chunk-8hhhmscy.js} +2 -2
  43. package/dist/{chunk-fyfvqd2s.js → chunk-8me8hamk.js} +2 -2
  44. package/dist/{chunk-pb09xy77.js → chunk-8s6s6nd0.js} +2 -2
  45. package/dist/chunk-8v1zpdef.js +2 -0
  46. package/dist/chunk-94mpe1ny.js +3 -0
  47. package/dist/{chunk-mzes9ds7.js → chunk-9zrvh3pz.js} +2 -2
  48. package/dist/chunk-a4cn8rf4.js +2 -0
  49. package/dist/{chunk-fpkp0bqf.js → chunk-adqh1gp1.js} +1 -1
  50. package/dist/chunk-ap84eenm.js +2 -0
  51. package/dist/chunk-as2ffje6.js +2 -0
  52. package/dist/chunk-az5xw3w8.js +2 -0
  53. package/dist/chunk-b6w0f610.js +712 -0
  54. package/dist/chunk-ba91r7q9.js +2 -0
  55. package/dist/{chunk-qkcn0exq.js → chunk-brzjass3.js} +6 -6
  56. package/dist/chunk-bwdbj60y.js +3 -0
  57. package/dist/{chunk-3wg9kr5z.js → chunk-bx5d87xx.js} +6 -7
  58. package/dist/chunk-c0t2tdfk.js +2 -0
  59. package/dist/chunk-caxqwrnc.js +2 -0
  60. package/dist/{chunk-37tefp7s.js → chunk-cqhwzd9y.js} +5 -5
  61. package/dist/chunk-cvgbtmxp.js +2 -0
  62. package/dist/chunk-czca8yds.js +42 -0
  63. package/dist/chunk-d0afg5f7.js +2 -0
  64. package/dist/chunk-d9vzfbdp.js +2 -0
  65. package/dist/{chunk-65cbfx5x.js → chunk-dpmayc2w.js} +2 -2
  66. package/dist/{chunk-d6216bcw.js → chunk-dtarm8x9.js} +9 -9
  67. package/dist/chunk-e634vffz.js +3 -0
  68. package/dist/chunk-eafqxbr0.js +2 -0
  69. package/dist/{chunk-qjm23ma2.js → chunk-ew5cey88.js} +1 -1
  70. package/dist/{chunk-xppm4cs4.js → chunk-farh4p7f.js} +3 -3
  71. package/dist/chunk-fnv94wc6.js +2 -0
  72. package/dist/chunk-g4gcf4jn.js +2 -0
  73. package/dist/chunk-g65dptx2.js +2 -0
  74. package/dist/{chunk-q6w7a1vc.js → chunk-gbtbfg7e.js} +3 -3
  75. package/dist/{chunk-15jymk6t.js → chunk-gd56arnm.js} +2 -2
  76. package/dist/{chunk-5ka3h8dy.js → chunk-gjngg182.js} +45 -46
  77. package/dist/{chunk-8hck9qqm.js → chunk-gp8hgpt9.js} +4 -4
  78. package/dist/chunk-gw7t6a3t.js +2 -0
  79. package/dist/chunk-h2qgqjkn.js +2 -0
  80. package/dist/chunk-h65shwe9.js +2 -0
  81. package/dist/{chunk-zpkgs5d3.js → chunk-h816ta81.js} +6 -6
  82. package/dist/chunk-hc6111md.js +54 -0
  83. package/dist/{chunk-cq2hedwn.js → chunk-hev4t4d5.js} +6 -6
  84. package/dist/{chunk-7yhhwv07.js → chunk-hmdkf6c6.js} +2 -2
  85. package/dist/{chunk-vggtxttf.js → chunk-j1efsjsb.js} +5 -5
  86. package/dist/chunk-j4zrq17p.js +2 -0
  87. package/dist/chunk-jfmj0wsy.js +2 -0
  88. package/dist/{chunk-bg0ywp5w.js → chunk-jgra00m8.js} +2 -2
  89. package/dist/{chunk-5rxks14t.js → chunk-k32q90b2.js} +2 -2
  90. package/dist/{chunk-naj146zq.js → chunk-k7dxm48r.js} +2 -2
  91. package/dist/chunk-ks5p5w6z.js +25 -0
  92. package/dist/chunk-kw11yydy.js +2 -0
  93. package/dist/chunk-m9cperj4.js +2 -0
  94. package/dist/{chunk-zs4s9fcq.js → chunk-mcnwvh06.js} +6 -6
  95. package/dist/chunk-meqsd5bt.js +2 -0
  96. package/dist/{chunk-dba4bwkd.js → chunk-mfa07erx.js} +16 -16
  97. package/dist/{chunk-jh2v1vvb.js → chunk-mrh08821.js} +3 -3
  98. package/dist/{chunk-9n8t7v78.js → chunk-n3jw3xpj.js} +2 -2
  99. package/dist/chunk-ns04v3am.js +2 -0
  100. package/dist/chunk-ntbe5q5x.js +16 -0
  101. package/dist/chunk-nttsc0aw.js +14 -0
  102. package/dist/chunk-p0tkhd12.js +2 -0
  103. package/dist/chunk-p2etn78y.js +2 -0
  104. package/dist/{chunk-1nankvf6.js → chunk-pbakxcv8.js} +2 -2
  105. package/dist/{chunk-h4aqpf2r.js → chunk-prrvggcy.js} +5 -5
  106. package/dist/chunk-pyckafsb.js +12 -0
  107. package/dist/{chunk-t5q31st4.js → chunk-q1wxgw5s.js} +2 -2
  108. package/dist/chunk-qa5y30sy.js +72 -0
  109. package/dist/{chunk-m3p4hksq.js → chunk-qbghf76y.js} +4 -4
  110. package/dist/{chunk-a6d92kv6.js → chunk-qcxrcypb.js} +2 -2
  111. package/dist/{chunk-1jwcp2k0.js → chunk-qjey0jk6.js} +2 -2
  112. package/dist/chunk-qmkaqjba.js +2 -0
  113. package/dist/chunk-qxw9h564.js +2 -0
  114. package/dist/chunk-r23zq8yk.js +2 -0
  115. package/dist/{chunk-68w65mhs.js → chunk-r4v4vswq.js} +3 -3
  116. package/dist/chunk-reeaknf2.js +2 -0
  117. package/dist/chunk-rqa92xm4.js +2 -0
  118. package/dist/chunk-rqmb09ss.js +2 -0
  119. package/dist/chunk-s92j8k4z.js +2 -0
  120. package/dist/chunk-s9df8srx.js +6 -0
  121. package/dist/{chunk-dt73ww6m.js → chunk-sb8n32rn.js} +1 -1
  122. package/dist/{chunk-5neezkj1.js → chunk-sj3ry5ck.js} +33 -25
  123. package/dist/chunk-snz2cxqv.js +2 -0
  124. package/dist/{chunk-36vksrry.js → chunk-srgnevws.js} +2 -2
  125. package/dist/chunk-sz6d3v6b.js +2 -0
  126. package/dist/{chunk-9pyvc0dc.js → chunk-tnp2ta5q.js} +2 -2
  127. package/dist/{chunk-gx96hctv.js → chunk-v37zmez0.js} +2 -2
  128. package/dist/chunk-v408qsze.js +2 -0
  129. package/dist/{chunk-thdnk1kd.js → chunk-v4xes880.js} +3 -3
  130. package/dist/chunk-va07zs9v.js +2 -0
  131. package/dist/chunk-vc42mvjn.js +2 -0
  132. package/dist/chunk-vk98r75z.js +2 -0
  133. package/dist/{chunk-yj9nyt93.js → chunk-vvzys1x7.js} +3 -3
  134. package/dist/chunk-vwwpbhd2.js +3 -0
  135. package/dist/{chunk-hyea17hp.js → chunk-w468n41y.js} +155 -157
  136. package/dist/{chunk-f1vvhbmw.js → chunk-w6pzkcjp.js} +2 -2
  137. package/dist/{chunk-15rkvc0t.js → chunk-wk4wg6sn.js} +5 -5
  138. package/dist/chunk-wtfamngc.js +20 -0
  139. package/dist/chunk-x3p4emdp.js +2 -0
  140. package/dist/{chunk-3gfd9t8a.js → chunk-x512h2gv.js} +4 -4
  141. package/dist/{chunk-nwxjh1gv.js → chunk-x7redxyd.js} +4 -4
  142. package/dist/chunk-xcjvx6zt.js +2 -0
  143. package/dist/chunk-xfd3yqgj.js +1327 -0
  144. package/dist/chunk-xjxcwrqs.js +2 -0
  145. package/dist/chunk-xymr4ys9.js +3 -0
  146. package/dist/chunk-xzdkjkyp.js +2 -0
  147. package/dist/{chunk-b1tctqn5.js → chunk-y036cwc7.js} +10 -10
  148. package/dist/chunk-y190sh29.js +16 -0
  149. package/dist/{chunk-wrbhq1y2.js → chunk-yakdcak2.js} +3 -3
  150. package/dist/chunk-ybkwnscv.js +2 -0
  151. package/dist/{chunk-6nb49h13.js → chunk-yhc1c4tr.js} +125 -126
  152. package/dist/chunk-ymdw4fhd.js +3 -0
  153. package/dist/chunk-ynkbv9jq.js +4 -0
  154. package/dist/chunk-yr1zx78b.js +3 -0
  155. package/dist/{chunk-e8nzbz66.js → chunk-ysfeg3cn.js} +2 -2
  156. package/dist/chunk-ytzzth34.js +2 -0
  157. package/dist/chunk-yxpjj003.js +2 -0
  158. package/dist/chunk-z1rs6b4x.js +2 -0
  159. package/dist/chunk-z383x16t.js +2 -0
  160. package/dist/chunk-z3gz5fy4.js +2 -0
  161. package/dist/{chunk-tm201m9x.js → chunk-z512gt4v.js} +3 -3
  162. package/dist/{chunk-5n7m8vqx.js → chunk-zbvfjm4a.js} +2 -2
  163. package/dist/chunk-zr22gtpf.js +2 -0
  164. package/dist/chunk-zsnmk5me.js +2 -0
  165. package/dist/chunk-ztbexx3h.js +2 -0
  166. package/dist/cli.js +35 -35
  167. package/dist/client/signals-timer-runtime.js +12 -4
  168. package/dist/craft-entry.js +2 -2
  169. package/dist/craft.js +2 -2
  170. package/dist/dev-server/serve-app.js +3 -2
  171. package/dist/dev-server/serve-multi.js +3 -4
  172. package/dist/dev-server/ts-css.js +4 -5
  173. package/dist/document-shell.js +4 -3
  174. package/dist/document-tags.d.ts +8 -0
  175. package/dist/document-tags.js +37 -0
  176. package/dist/events.js +2 -1
  177. package/dist/head-injection.js +2 -1
  178. package/dist/heatmap.js +2 -1
  179. package/dist/hot-reload.js +3 -1
  180. package/dist/index.d.ts +1 -1
  181. package/dist/index.js +1 -1
  182. package/dist/native-build.js +3 -3
  183. package/dist/process.js +5 -6
  184. package/dist/production-build.js +3 -3
  185. package/dist/pwa/inject.js +3 -3
  186. package/dist/pwa.js +3 -3
  187. package/dist/reactive-bindings.js +2 -1
  188. package/dist/reactive.js +2 -1
  189. package/dist/render.js +1 -1
  190. package/dist/runtime-injection.js +6 -6
  191. package/dist/serve.js +1 -1
  192. package/dist/site-builder/build.js +1 -1
  193. package/dist/site-builder/i18n.js +2 -2
  194. package/dist/site-builder/router.js +1 -1
  195. package/dist/site-builder/theme.js +1 -1
  196. package/dist/ssg.js +30 -31
  197. package/dist/template-hydrator.js +2 -1
  198. package/dist/web-components/css-scoping.js +3 -3
  199. package/dist/x-element.js +2 -1
  200. package/package.json +5 -5
  201. package/dist/body-close.d.ts +0 -13
  202. package/dist/body-close.js +0 -8
  203. package/dist/chunk-02css3vk.js +0 -14
  204. package/dist/chunk-0hqr6bff.js +0 -2
  205. package/dist/chunk-15sgdvyd.js +0 -2
  206. package/dist/chunk-261t62q4.js +0 -712
  207. package/dist/chunk-2b4a8tbd.js +0 -3
  208. package/dist/chunk-2fw36w1x.js +0 -2
  209. package/dist/chunk-2jcxsw75.js +0 -2
  210. package/dist/chunk-2pbhdaka.js +0 -2
  211. package/dist/chunk-2wba5ypm.js +0 -2
  212. package/dist/chunk-353gnvfe.js +0 -2
  213. package/dist/chunk-3cr5y8v1.js +0 -2
  214. package/dist/chunk-3y7yp0ka.js +0 -2
  215. package/dist/chunk-41wwqw0q.js +0 -2
  216. package/dist/chunk-4a1y51fs.js +0 -2
  217. package/dist/chunk-4a751brg.js +0 -2
  218. package/dist/chunk-4jgcd4d9.js +0 -33
  219. package/dist/chunk-5awhm4na.js +0 -2
  220. package/dist/chunk-5fhp9hxd.js +0 -2
  221. package/dist/chunk-5mg443dw.js +0 -2
  222. package/dist/chunk-5q4tncfw.js +0 -18
  223. package/dist/chunk-5x9ajbq0.js +0 -2
  224. package/dist/chunk-6g7tkmty.js +0 -2
  225. package/dist/chunk-72bj7ea4.js +0 -2
  226. package/dist/chunk-74g64pzt.js +0 -20
  227. package/dist/chunk-7de5y29a.js +0 -54
  228. package/dist/chunk-7ycmnsh5.js +0 -2
  229. package/dist/chunk-811hh6vp.js +0 -2
  230. package/dist/chunk-830ej8d2.js +0 -72
  231. package/dist/chunk-8fkmxrat.js +0 -2
  232. package/dist/chunk-8p9npc8y.js +0 -2
  233. package/dist/chunk-9fz3h6sx.js +0 -2
  234. package/dist/chunk-9jr30fns.js +0 -2
  235. package/dist/chunk-9xr628ew.js +0 -3
  236. package/dist/chunk-a9m6ajd7.js +0 -2
  237. package/dist/chunk-aj6vqdf7.js +0 -25
  238. package/dist/chunk-asr5v51s.js +0 -2
  239. package/dist/chunk-b7nmgkwa.js +0 -42
  240. package/dist/chunk-bv14vry8.js +0 -3
  241. package/dist/chunk-byx82s10.js +0 -2
  242. package/dist/chunk-c9y1g61m.js +0 -2
  243. package/dist/chunk-ck5nzbbv.js +0 -2
  244. package/dist/chunk-cvdm0hgq.js +0 -2
  245. package/dist/chunk-e0fxgbcc.js +0 -2
  246. package/dist/chunk-ed2m6pjf.js +0 -2
  247. package/dist/chunk-ednwdhv0.js +0 -2
  248. package/dist/chunk-egtphftq.js +0 -2
  249. package/dist/chunk-f18rxz70.js +0 -2
  250. package/dist/chunk-fahqq7c4.js +0 -2
  251. package/dist/chunk-fcbpzdyz.js +0 -2
  252. package/dist/chunk-gc79s0wh.js +0 -20
  253. package/dist/chunk-gjnrmz2q.js +0 -4
  254. package/dist/chunk-gp1dt8b8.js +0 -33
  255. package/dist/chunk-h0dsxxz4.js +0 -2
  256. package/dist/chunk-h2cvfp9y.js +0 -2
  257. package/dist/chunk-jhm1228j.js +0 -4
  258. package/dist/chunk-k3yym9zg.js +0 -2
  259. package/dist/chunk-k9fsd6t3.js +0 -2
  260. package/dist/chunk-kepxsjfx.js +0 -2
  261. package/dist/chunk-kgrvvtcy.js +0 -3
  262. package/dist/chunk-kh01rvag.js +0 -2
  263. package/dist/chunk-kv40xq53.js +0 -1329
  264. package/dist/chunk-mad172af.js +0 -2
  265. package/dist/chunk-mjkdskeg.js +0 -12
  266. package/dist/chunk-npt0mdzb.js +0 -2
  267. package/dist/chunk-p95fsnbk.js +0 -2
  268. package/dist/chunk-ptc3yqn3.js +0 -2
  269. package/dist/chunk-pybm7c9p.js +0 -2
  270. package/dist/chunk-q87hkwfg.js +0 -3
  271. package/dist/chunk-qe6631me.js +0 -2
  272. package/dist/chunk-qnx71b17.js +0 -2
  273. package/dist/chunk-qx8cav4w.js +0 -2
  274. package/dist/chunk-rb7cwck6.js +0 -2
  275. package/dist/chunk-s1e0t3hv.js +0 -2
  276. package/dist/chunk-s7vfmasx.js +0 -2
  277. package/dist/chunk-scwbttvt.js +0 -3
  278. package/dist/chunk-shy2hkvj.js +0 -2
  279. package/dist/chunk-sxtvy0sm.js +0 -3
  280. package/dist/chunk-t7z67vf6.js +0 -2
  281. package/dist/chunk-tarvase5.js +0 -2
  282. package/dist/chunk-tqs9pcga.js +0 -2
  283. package/dist/chunk-twjfrywv.js +0 -2
  284. package/dist/chunk-v0wdgxga.js +0 -3
  285. package/dist/chunk-vyna2rsq.js +0 -2
  286. package/dist/chunk-w4gjx2zs.js +0 -18
  287. package/dist/chunk-xhe7pw6e.js +0 -2
  288. package/dist/chunk-y86mpnrg.js +0 -2
  289. package/dist/chunk-z99bf0q0.js +0 -3
  290. package/dist/chunk-zm0g7ntw.js +0 -2
  291. package/dist/chunk-zrm2x65c.js +0 -2
package/dist/ssg.js CHANGED
@@ -1,51 +1,50 @@
1
1
  // @bun
2
- import"./chunk-mzes9ds7.js";import{x,gl}from"./chunk-830ej8d2.js";import"./chunk-1jwcp2k0.js";import"./chunk-xppm4cs4.js";import{It,y}from"./chunk-261t62q4.js";import"./chunk-5rxks14t.js";import"./chunk-naj146zq.js";import"./chunk-9pyvc0dc.js";import{Et,Tt,$t,Rt,At,Pt}from"./chunk-3gfd9t8a.js";import{a}from"./chunk-6nb49h13.js";import{As}from"./chunk-dba4bwkd.js";import"./chunk-4rrxrxp6.js";import"./chunk-15rkvc0t.js";import{be,sn,on}from"./chunk-74g64pzt.js";import"./chunk-z99bf0q0.js";import{b}from"./chunk-5q4tncfw.js";import{vt,i}from"./chunk-kv40xq53.js";import"./chunk-b7nmgkwa.js";import"./chunk-7de5y29a.js";import{ys}from"./chunk-b1tctqn5.js";import"./chunk-aj6vqdf7.js";import"./chunk-t5q31st4.js";import{ic,ac,cc}from"./chunk-thdnk1kd.js";import{nn,tr,nr}from"./chunk-q87hkwfg.js";import{rn}from"./chunk-avp271q4.js";import"./chunk-2b4a8tbd.js";import"./chunk-v0wdgxga.js";import{X,xe}from"./chunk-02css3vk.js";import"./chunk-h2cvfp9y.js";import"./chunk-68w65mhs.js";import{c}from"./chunk-sxtvy0sm.js";import{r,he}from"./chunk-nwxjh1gv.js";import D from"fs";import f from"path";import{createHash as bt}from"crypto";function kt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ot(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,o=t.replace(Dt,(e,u,g,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(g))return e;if(n.minify)w=kt(w);let p=Ct(w);if(!s.has(p))s.set(p,w);let P=n.integrity?` data-stx-integrity="sha384-${bt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),l=Array.from(s,([e,u])=>({hash:e,code:u}));return{html:o,chunks:l}}var Bt=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(t))!==null)n.set(o[1],o[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Bt.has(n.get(u[1])||""))l.add(u[2]);let g=/<\/head\s*>/iy,v=y(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(l.size===0||v===-1)return t;let w=Array.from(l).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var jt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function K(t){let n=t.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Ft(t){for(let n of jt){let s=t[n];if(!s)continue;let o=K(s);if(o)return{url:o,source:"env",via:n}}return null}function lt(t){if(!t||typeof t!=="object")return null;let n=t,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?K(s):null}async function Ot(t){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=s.resolve(t,o);if(!n(l))continue;try{let e=await import(l),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let n=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let u=K(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let l=await Ot(n);if(l)return{url:l,source:"site.config",via:"url"};let e=Ft(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
- `)}function q(t){return async()=>({paths:await t(),fallback:!1})}var Lt;function Ut(t){let n=r(t),{depths:s}=he(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(n))!==null){if(s[l.index]!==0)continue;let u=x(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),v=x(n,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(n))!==null){if(s[l.index]!==0)continue;let u=gl(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let n="read";try{let s=await Bun.file(t).text();n="parse";let o=rn(s),l=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>s.indexOf(e.fullTag)-s.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Lt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let g=Ut(u);if(/\bdefineStaticPaths\b/.test(r(g))&&It(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let v=Function("defineStaticPaths",`return (${g})`)(q);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let w=await v();n="result";let p=Array.isArray(w)?{paths:w}:w;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let s=D.statSync(t),o=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of n)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,n){let s=this.cache.get(t);if(!s)return null;let o=ft(n).some((u)=>D.existsSync(u)),l=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&ys(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||l)return this.cache.delete(t),null;let e=this.getHash(n,s.dependencies??[]);if(s.hash!==e)return this.cache.delete(t),null;return s.html}set(t,n,s,o){let l=this.getHash(n,s);this.cache.set(t,{hash:l,html:o,generatedAt:Date.now(),dependencies:s})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let s=this.getFilePath(t);await D.promises.mkdir(f.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await D.promises.unlink(n)}async invalidatePattern(t){let n=f.join(this.cacheDir,"isr");if(!D.existsSync(n))return;let s=await D.promises.readdir(n);for(let o of s){let l=o.replace(/_/g,"/").replace(".json","");if(t.test(l))await D.promises.unlink(f.join(n,o))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function _t(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let s=await gt(t.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${t.pattern} (${t.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let l of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(l.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return n}function ft(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let n of ft(t))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...l}=s;return l}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(t,n,s){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let l=o[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
2
+ import"./chunk-9zrvh3pz.js";import{k,yl}from"./chunk-qa5y30sy.js";import"./chunk-qjey0jk6.js";import"./chunk-farh4p7f.js";import{Mt,w}from"./chunk-b6w0f610.js";import"./chunk-k32q90b2.js";import"./chunk-k7dxm48r.js";import"./chunk-tnp2ta5q.js";import{Rt,At,Pt,It,Ot,Nt}from"./chunk-x512h2gv.js";import{a}from"./chunk-yhc1c4tr.js";import{Os}from"./chunk-mfa07erx.js";import"./chunk-669b2bya.js";import"./chunk-wk4wg6sn.js";import{xe,cn,ln}from"./chunk-wtfamngc.js";import"./chunk-021tjkd6.js";import{x}from"./chunk-y190sh29.js";import{kt,i}from"./chunk-xfd3yqgj.js";import"./chunk-czca8yds.js";import"./chunk-hc6111md.js";import{vs}from"./chunk-y036cwc7.js";import"./chunk-ks5p5w6z.js";import"./chunk-q1wxgw5s.js";import{lc,uc,dc}from"./chunk-v4xes880.js";import{on,sr,or}from"./chunk-ymdw4fhd.js";import{an}from"./chunk-58sh82aj.js";import"./chunk-e634vffz.js";import"./chunk-xymr4ys9.js";import{Z,_e}from"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-r4v4vswq.js";import{l}from"./chunk-46pxmpeb.js";import{r,we}from"./chunk-x7redxyd.js";import{f}from"./chunk-s9df8srx.js";import R from"fs";import m from"path";import{createHash as vt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Et(t){return Bun.hash(t).toString(16)}function ct(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,o=t.replace(Dt,(e,u,g,v)=>{let S=v.trim();if(!S)return e;if(/\bdata-stx-src=/.test(g))return e;if(n.minify)S=$t(S);let p=Et(S);if(!s.has(p))s.set(p,S);let P=n.integrity?` data-stx-integrity="sha384-${vt("sha384").update(S).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),c=Array.from(s,([e,u])=>({hash:e,code:u}));return{html:o,chunks:c}}var Ct=new Set(["visible","idle"]);function lt(t){if(!t.includes("data-stx-src="))return t;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(t))!==null)n.set(o[1],o[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Ct.has(n.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,v=w(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let S=Array.from(c).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!S)return t;return t.slice(0,v)+S+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let n=t.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let n of Bt){let s=t[n];if(!s)continue;let o=X(s);if(o)return{url:o,source:"env",via:n}}return null}function ut(t){if(!t||typeof t!=="object")return null;let n=t,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?X(s):null}async function Ft(t){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,o);if(!n(c))continue;try{let e=await import(c),u=ut(e.default??e);if(u)return u}catch{}}return null}async function dt(t={}){let n=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=ut(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await Ft(n);if(c)return{url:c,source:"site.config",via:"url"};let e=jt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function gt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Tt;function Lt(t){let n=r(t),{depths:s}=we(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=k(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),v=k(n,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(c.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=e.exec(n))!==null){if(s[c.index]!==0)continue;let u=yl(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function pt(t){let n="read";try{let s=await Bun.file(t).text();n="parse";let o=an(s),c=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>s.indexOf(e.fullTag)-s.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Tt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(r(g))&&Mt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let S=await v();n="result";let p=Array.isArray(S)?{paths:S}:S;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class ft{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=m.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await R.promises.mkdir(this.cacheDir,{recursive:!0});let t=m.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let s=R.statSync(t),o=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of n)if(R.existsSync(e)){let u=R.statSync(e);o+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,n){let s=this.cache.get(t);if(!s)return null;let o=mt(n).some((u)=>R.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&R.existsSync(u)&&vs(R.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(t),null;let e=this.getHash(n,s.dependencies??[]);if(s.hash!==e)return this.cache.delete(t),null;return s.html}set(t,n,s,o){let c=this.getHash(n,s);this.cache.set(t,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return m.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let s=this.getFilePath(t);await R.promises.mkdir(m.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await R.promises.unlink(n)}async invalidatePattern(t){let n=m.join(this.cacheDir,"isr");if(!R.existsSync(n))return;let s=await R.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(t.test(c))await R.promises.unlink(m.join(n,o))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function Ut(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let s=await pt(t.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${t.pattern} (${t.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let c of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(c.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function mt(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function _t(t){for(let n of mt(t))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(t,n,s){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
4
4
  return (async function getStaticProps() {
5
5
  ${e[1]}
6
6
  })()
7
- `)(n)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Nt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function mt(t,n,s={},o,l){let e=await Bun.file(t.filePath).text(),u=await Mt(t.filePath),g=await Gt(e,n,t.filePath),v={...u||{},...g||{},...s,params:n,$route:{path:t.pattern,params:n}},w=new Set,p=[],P=[],E={...l,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(R)=>{p.push(`${f.relative(process.cwd(),R.templatePath)}: ${R.message}
8
- resolved against partialsDir: ${R.partialsDir}`)},onServerScriptError:(R)=>{P.push(`${f.relative(process.cwd(),R.sourcePath)} (${R.kind}): ${R.message}`)}};if(Nt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let S=await i(e,v,t.filePath,E,w);for(let R of[t.filePath,...w])for(let A of be(R))w.add(A);if(Object.keys(n).length>0){let R=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(S.includes("</head>"))S=S.replace("</head>",`${R}
9
- </head>`);else S=`${R}
10
- ${S}`}if(S=await xe(S,{router:o.router}),S=await b(S),o.minify!==!1)return{html:Ht(S),dependencies:Array.from(w),includeFailures:p,serverScriptFailures:P};return{html:S,dependencies:Array.from(w),includeFailures:p,serverScriptFailures:P}}function Ht(t){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,l;while((l=o.exec(t))!==null){let u=t.slice(s,l.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let g=l[1],v=l[2],w=l[3];v=v.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(g+v+w),s=l.index+l[0].length}let e=t.slice(s);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function zt(t){let n=0;for(let s=0;s<t.length;s++){let o=t.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function Wt(t,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((l)=>{if(l instanceof RegExp)return l.test(t);return l.endsWith("/")?t===l.slice(0,-1)||t.startsWith(l):t===l})}function qt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
7
+ `)(n)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Ht(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function wt(t,n,s={},o,c){let e=await Bun.file(t.filePath).text(),u=await _t(t.filePath),g=await Gt(e,n,t.filePath),v={...u||{},...g||{},...s,params:n,$route:{path:t.pattern,params:n}},S=new Set,p=[],P=[],C={...c,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(E)=>{p.push(`${m.relative(process.cwd(),E.templatePath)}: ${E.message}
8
+ resolved against partialsDir: ${E.partialsDir}`)},onServerScriptError:(E)=>{P.push(`${m.relative(process.cwd(),E.sourcePath)} (${E.kind}): ${E.message}`)}};if(Ht(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let b=await i(e,v,t.filePath,C,S);for(let E of[t.filePath,...S])for(let O of xe(E))S.add(O);if(Object.keys(n).length>0){let E=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(b.includes("</head>"))b=f(b,E);else b=`${E}
9
+ ${b}`}if(b=await _e(b,{router:o.router}),b=await x(b),o.minify!==!1)return{html:zt(b),dependencies:Array.from(S),includeFailures:p,serverScriptFailures:P};return{html:b,dependencies:Array.from(S),includeFailures:p,serverScriptFailures:P}}function zt(t){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=o.exec(t))!==null){let u=t.slice(s,c.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let g=c[1],v=c[2],S=c[3];v=v.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(g+v+S),s=c.index+c[0].length}let e=t.slice(s);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function Wt(t){let n=0;for(let s=0;s<t.length;s++){let o=t.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function qt(t,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((c)=>{if(c instanceof RegExp)return c.test(t);return c.endsWith("/")?t===c.slice(0,-1)||t.startsWith(c):t===c})}function Jt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
11
10
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
12
- ${t.map((o)=>{let l=new URL(o.loc,n).href,e=` <url>
13
- <loc>${F(l)}</loc>`;if(o.lastmod)e+=`
11
+ ${t.map((o)=>{let c=new URL(o.loc,n).href,e=` <url>
12
+ <loc>${T(c)}</loc>`;if(o.lastmod)e+=`
14
13
  <lastmod>${o.lastmod}</lastmod>`;if(o.changefreq)e+=`
15
14
  <changefreq>${o.changefreq}</changefreq>`;if(o.priority!==void 0)e+=`
16
15
  <priority>${o.priority}</priority>`;return e+=`
17
16
  </url>`,e}).join(`
18
17
  `)}
19
- </urlset>`}function F(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Jt(t,n){let s=n.map((o)=>{let l=" <item>";if(l+=`
20
- <title>${F(o.title)}</title>`,l+=`
21
- <link>${F(o.link)}</link>`,o.description)l+=`
22
- <description>${F(o.description)}</description>`;if(o.pubDate)l+=`
23
- <pubDate>${o.pubDate.toUTCString()}</pubDate>`;if(o.author)l+=`
24
- <author>${F(o.author)}</author>`;if(o.categories)for(let e of o.categories)l+=`
25
- <category>${F(e)}</category>`;if(o.guid)l+=`
26
- <guid>${F(o.guid)}</guid>`;return l+=`
27
- </item>`,l});return`<?xml version="1.0" encoding="UTF-8"?>
18
+ </urlset>`}function T(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Vt(t,n){let s=n.map((o)=>{let c=" <item>";if(c+=`
19
+ <title>${T(o.title)}</title>`,c+=`
20
+ <link>${T(o.link)}</link>`,o.description)c+=`
21
+ <description>${T(o.description)}</description>`;if(o.pubDate)c+=`
22
+ <pubDate>${o.pubDate.toUTCString()}</pubDate>`;if(o.author)c+=`
23
+ <author>${T(o.author)}</author>`;if(o.categories)for(let e of o.categories)c+=`
24
+ <category>${T(e)}</category>`;if(o.guid)c+=`
25
+ <guid>${T(o.guid)}</guid>`;return c+=`
26
+ </item>`,c});return`<?xml version="1.0" encoding="UTF-8"?>
28
27
  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
29
28
  <channel>
30
- <title>${F(t.title)}</title>
31
- <link>${F(t.link)}</link>
32
- <description>${F(t.description)}</description>
29
+ <title>${T(t.title)}</title>
30
+ <link>${T(t.link)}</link>
31
+ <description>${T(t.description)}</description>
33
32
  ${t.language?`<language>${t.language}</language>`:""}
34
- ${t.copyright?`<copyright>${F(t.copyright)}</copyright>`:""}
33
+ ${t.copyright?`<copyright>${T(t.copyright)}</copyright>`:""}
35
34
  <lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
36
35
  <atom:link href="${t.link}/rss.xml" rel="self" type="application/rss+xml"/>
37
36
  ${s.join(`
38
37
  `)}
39
38
  </channel>
40
- </rss>`}async function Vt(t={}){let n=Date.now();on();let s=await a(process.cwd()),o=s.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:s});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,w={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-5fhp9hxd.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:S}=await import("./chunk-k3yym9zg.js"),R=await S(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let A=new pt(e.cacheDir,E);if(e.cache)await A.load();try{let{generateCss:d}=await import("./chunk-5fhp9hxd.js");await d('<div class="bg-black"></div>')}catch{}Et();let wt=s?.routeMiddleware?.dir||"middleware";await $t(process.cwd(),wt);let J=Tt();if(J.length>0)console.log(`Loaded ${J.length} middleware: ${J.join(", ")}`);let yt=s?.routeMiddleware?.global||[];cc(s?.layoutsDir,c(process.cwd()));let Z=X(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Z.length} routes`);let L=[];for(let d of Z)try{let m=await _t(d);for(let k of m)L.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=L.length+u.failedCount,console.log(`Generating ${L.length} pages...`);let U=[],Q=[];for(let d=0;d<L.length;d+=e.concurrency)Q.push(L.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:_,props:St,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let M=await Bun.file(k.filePath).text(),T=Yt(M),xt=T?.middleware?Array.isArray(T.middleware)?T.middleware:[T.middleware]:[],nt=[...yt,...xt];if(nt.length>0){let B=Rt(h,_,T||{}),N=At(B,null,void 0,{isServer:!0}),j=await Pt(nt,N);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,H=Zt(String(C),h),O=Qt(h,e);await D.promises.mkdir(f.dirname(O),{recursive:!0}),await Bun.write(O,H),u.successCount++,u.pages.push({route:h,outputPath:O,size:Buffer.byteLength(H),cached:!1}),U.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=T?.validate;if(typeof it==="function")try{if(!await it({params:_})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=A.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await mt(k,_,St,e,s);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
41
- ${B.includeFailures.join(`
39
+ </rss>`}async function Kt(t={}){let n=Date.now();ln();let s=await a(process.cwd()),o=s.build||{},c=await dt({explicit:t.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(gt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,S={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&R.existsSync(e.outputDir))await R.promises.rm(e.outputDir,{recursive:!0});await R.promises.mkdir(e.outputDir,{recursive:!0});let C=e.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-gw7t6a3t.js");try{C=y(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-z383x16t.js"),E=await b(e.publicDir,e.outputDir);if(E.count>0)console.log(`Optimized ${E.count} image(s) for responsive delivery`),C=[C,E.fingerprint].filter(Boolean).join(":");let O=new ft(e.cacheDir,C);if(e.cache)await O.load();try{let{generateCss:d}=await import("./chunk-gw7t6a3t.js");await d('<div class="bg-black"></div>')}catch{}Rt();let yt=s?.routeMiddleware?.dir||"middleware";await Pt(process.cwd(),yt);let V=At();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let St=s?.routeMiddleware?.global||[];dc(s?.layoutsDir,l(process.cwd()));let Q=Z(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Q.length} routes`);let U=[];for(let d of Q)try{let y=await Ut(d);for(let D of y)U.push({route:d,url:D.url,params:D.params,props:D.props,revalidate:D.revalidate??e.revalidate})}catch(y){let D=y instanceof Error?y:Error(String(y));u.failedCount++,u.errors.push({route:d.pattern,error:D}),await e.hooks.onError?.(D,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,D)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let _=[],tt=[];for(let d=0;d<U.length;d+=e.concurrency)tt.push(U.slice(d,d+e.concurrency));for(let d of tt)await Promise.all(d.map(async(y)=>{let{route:D,url:h,params:M,props:xt,revalidate:nt}=y;try{await e.hooks.onPageStart?.(h);let G=await Bun.file(D.filePath).text(),A=Zt(G),bt=A?.middleware?Array.isArray(A.middleware)?A.middleware:[A.middleware]:[],it=[...St,...bt];if(it.length>0){let j=It(h,M,A||{}),N=Ot(j,null,void 0,{isServer:!0}),F=await Nt(it,N);if(F.redirect){let I=typeof F.redirect==="string"?F.redirect:F.redirect.path||F.redirect,z=Qt(String(I),h),L=te(h,e);await R.promises.mkdir(m.dirname(L),{recursive:!0}),await Bun.write(L,z),u.successCount++,u.pages.push({route:h,outputPath:L,size:Buffer.byteLength(z),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${I}`);return}if(F.abort){let I=typeof F.abort==="string"?F.abort:F.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${I}`);return}}let st=A?.validate;if(typeof st==="function")try{if(!await st({params:M})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let B=null,at=!1;if(e.cache){if(B=O.get(h,D.filePath),B)at=!0,u.cachedCount++}if(!B){let j=await wt(D,M,xt,e,s);if(B=j.html,e.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
40
+ ${j.includeFailures.join(`
42
41
  `)}
43
- Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&B.serverScriptFailures.length>0)throw Error(`${B.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
44
- ${B.serverScriptFailures.join(`
42
+ Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&j.serverScriptFailures.length>0)throw Error(`${j.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
43
+ ${j.serverScriptFailures.join(`
45
44
  `)}
46
- Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)A.set(h,k.filePath,B.dependencies,I)}let G;if(e.trailingSlash)G=f.join(e.outputDir,h,"index.html");else G=h==="/"?f.join(e.outputDir,"index.html"):f.join(e.outputDir,`${h}.html`);if(e.chunkIslands){let{html:B,chunks:N}=ot(I,{integrity:e.integrityIslands,minify:e.minify});if(N.length>0){let j=f.join(e.outputDir,"_stx","islands");await D.promises.mkdir(j,{recursive:!0});for(let C of N){let H=f.join(j,`${C.hash}.js`);if(!await Bun.file(H).exists())await Bun.write(H,C.code);if(!g.has(C.hash)){g.add(C.hash);let O=Buffer.byteLength(C.code,"utf8");v+=O,w[C.hash]={bytes:O,file:`/_stx/islands/${C.hash}.js`}}}if(p[h]=N.map((C)=>C.hash),I=B,e.prefetchIslands)I=ct(I)}}if(await D.promises.mkdir(f.dirname(G),{recursive:!0}),await Bun.write(G,I),!Wt(h,I,T,e.sitemapExclude))U.push({loc:h,lastmod:new Date().toISOString().split("T")[0],priority:h==="/"?1:0.8});let at={route:h,outputPath:G,size:Buffer.byteLength(I,"utf8"),cached:st};if(rt!==!1)at.revalidateAt=Date.now()+rt*1000;u.pages.push(at),u.successCount++,await e.hooks.onPageEnd?.(h,I)}catch(M){u.failedCount++,u.errors.push({route:h,error:M}),await e.hooks.onError?.(M,h),console.error(`Error generating ${h}:`,M)}}));let tt=sn();if(tt.length>0){let d=tt.map((m)=>`${m.filePath}: ${m.message}`).join(`
45
+ Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)O.set(h,D.filePath,j.dependencies,B)}let H;if(e.trailingSlash)H=m.join(e.outputDir,h,"index.html");else H=h==="/"?m.join(e.outputDir,"index.html"):m.join(e.outputDir,`${h}.html`);if(e.chunkIslands){let{html:j,chunks:N}=ct(B,{integrity:e.integrityIslands,minify:e.minify});if(N.length>0){let F=m.join(e.outputDir,"_stx","islands");await R.promises.mkdir(F,{recursive:!0});for(let I of N){let z=m.join(F,`${I.hash}.js`);if(!await Bun.file(z).exists())await Bun.write(z,I.code);if(!g.has(I.hash)){g.add(I.hash);let L=Buffer.byteLength(I.code,"utf8");v+=L,S[I.hash]={bytes:L,file:`/_stx/islands/${I.hash}.js`}}}if(p[h]=N.map((I)=>I.hash),B=j,e.prefetchIslands)B=lt(B)}}if(await R.promises.mkdir(m.dirname(H),{recursive:!0}),await Bun.write(H,B),!qt(h,B,A,e.sitemapExclude))_.push({loc:h,lastmod:new Date().toISOString().split("T")[0],priority:h==="/"?1:0.8});let ot={route:h,outputPath:H,size:Buffer.byteLength(B,"utf8"),cached:at};if(nt!==!1)ot.revalidateAt=Date.now()+nt*1000;u.pages.push(ot),u.successCount++,await e.hooks.onPageEnd?.(h,B)}catch(G){u.failedCount++,u.errors.push({route:h,error:G}),await e.hooks.onError?.(G,h),console.error(`Error generating ${h}:`,G)}}));let et=cn();if(et.length>0){let d=et.map((y)=>`${y.filePath}: ${y.message}`).join(`
47
46
  `);throw Error(`Client script bundling failed:
48
- ${d}`)}if(e.cache)await A.save();if(e.generate404){let d=f.join(e.pagesDir,"404.stx");if(await Bun.file(d).exists()){let m=new Set,k={...s,minifyClient:!0,debug:!1,cache:!1},h=await i(await Bun.file(d).text(),{},d,k,m);await Bun.write(f.join(e.outputDir,"404.html"),h)}else await Bun.write(f.join(e.outputDir,"404.html"),`<!DOCTYPE html>
47
+ ${d}`)}if(e.cache)await O.save();if(e.generate404){let d=m.join(e.pagesDir,"404.stx");if(await Bun.file(d).exists()){let y=new Set,D={...s,minifyClient:!0,debug:!1,cache:!1},h=await i(await Bun.file(d).text(),{},d,D,y);await Bun.write(m.join(e.outputDir,"404.html"),h)}else await Bun.write(m.join(e.outputDir,"404.html"),`<!DOCTYPE html>
49
48
  <html lang="en">
50
49
  <head>
51
50
  <meta charset="UTF-8">
@@ -66,7 +65,7 @@ ${d}`)}if(e.cache)await A.save();if(e.generate404){let d=f.join(e.pagesDir,"404.
66
65
  <a href="/">Go home</a>
67
66
  </div>
68
67
  </body>
69
- </html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...s,minifyClient:!0,debug:!1,cache:!1},_=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),_)}}let V=f.join(e.pagesDir,"error.stx");if(await Bun.file(V).exists()){let d=new Set,m={...s,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(V).text(),{},V,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&U.length>0){let d=qt(U,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${U.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=As({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let z=ic(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let W=ac(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} repeated asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&D.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let et=nr();if(et)await Y(et,f.join(e.outputDir,tr)),console.log(`Copied assets from ${nn}`)}catch(E){throw await e.hooks.onError?.(E),E}if(u.buildTime=Date.now()-n,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let E={generatedChunks:g.size,totalBytes:v,chunks:w,pages:p};await Bun.write(f.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
68
+ </html>`)}for(let d of[500]){let y=m.join(e.pagesDir,`${d}.stx`);if(await Bun.file(y).exists()){let D=new Set,h={...s,minifyClient:!0,debug:!1,cache:!1},M=await i(await Bun.file(y).text(),{},y,h,D);await Bun.write(m.join(e.outputDir,`${d}.html`),M)}}let K=m.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,y={...s,minifyClient:!0,debug:!1,cache:!1},D=await i(await Bun.file(K).text(),{},K,y,d);await Bun.write(m.join(e.outputDir,"error.html"),D)}if(e.sitemap&&_.length>0){let d=Jt(_,e.domain),y=m.join(e.outputDir,"sitemap.xml");await Bun.write(y,d),u.sitemapPath=y,console.log(`Generated sitemap.xml with ${_.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},y=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],D=Os({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...y.length>0?{disallow:y}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(m.join(e.outputDir,"robots.txt"),D),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},y=[];if(d.getItems)y=await d.getItems();let D=Vt(d,y),h=m.join(e.outputDir,"rss.xml");await Bun.write(h,D),u.rssPath=h,console.log(`Generated rss.xml with ${y.length} items`)}let W=lc(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=uc(e.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&R.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let rt=or();if(rt)await Y(rt,m.join(e.outputDir,sr)),console.log(`Copied assets from ${on}`)}catch(C){throw await e.hooks.onError?.(C),C}if(u.buildTime=Date.now()-n,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let C={generatedChunks:g.size,totalBytes:v,chunks:S,pages:p};await Bun.write(m.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(C,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
70
69
  Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
71
70
  Build complete!
72
71
  Total: ${u.totalPages} pages
@@ -74,8 +73,8 @@ Build complete!
74
73
  Cached: ${u.cachedCount}
75
74
  Failed: ${u.failedCount}
76
75
  Time: ${u.buildTime}ms${P}
77
- `),u}async function Y(t,n){await D.promises.mkdir(n,{recursive:!0});let s=await D.promises.readdir(t,{withFileTypes:!0});for(let o of s){let l=f.join(t,o.name),e=f.join(n,o.name);if(o.isDirectory())await D.promises.mkdir(e,{recursive:!0}),await Y(l,e);else await D.promises.copyFile(l,e)}}function Kt(t={}){let n=t.cacheDir||c(process.cwd(),"ssg-cache"),s=new ht(n),o=t.revalidate||3600;return{async get(l){let e=await s.get(l);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(l).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(l){let u=X(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>l.match(P.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${l}`);return}let g=l.match(u.regex),v={};if(g)u.params.forEach((P,E)=>{v[P]=g[E+1]});let w=await a(),{html:p}=await mt(u,v,{},t,w);await s.set(l,{html:p,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:zt(p)}),console.log(`Revalidated: ${l}`)},async invalidate(l){if(typeof l==="string")await s.invalidate(l);else await s.invalidatePattern(l)}}}function Xt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},l=n;if(s){let w=s[1];l=n.slice(s[0].length).trim();for(let p of w.split(`
78
- `)){let P=p.indexOf(":");if(P>0){let E=p.slice(0,P).trim(),S=p.slice(P+1).trim();if(S==="true")S=!0;else if(S==="false")S=!1;else if(/^\d+$/.test(S))S=parseInt(S,10);else if(/^\d+\.\d+$/.test(S))S=parseFloat(S);else if(S.startsWith("[")&&S.endsWith("]"))S=S.slice(1,-1).split(",").map((R)=>R.trim().replace(/^['"]|['"]$/g,""));o[E]=S}}}let e=l.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],g=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,v;while((v=g.exec(e))!==null){let w=parseInt(v[1],10),p=v[2],P=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:P,text:p,level:w})}return{content:e,data:o,toc:u}}}}function Yt(t){return vt(t)}function Zt(t,n){return`<!DOCTYPE html>
76
+ `),u}async function Y(t,n){await R.promises.mkdir(n,{recursive:!0});let s=await R.promises.readdir(t,{withFileTypes:!0});for(let o of s){let c=m.join(t,o.name),e=m.join(n,o.name);if(o.isDirectory())await R.promises.mkdir(e,{recursive:!0}),await Y(c,e);else await R.promises.copyFile(c,e)}}function Xt(t={}){let n=t.cacheDir||l(process.cwd(),"ssg-cache"),s=new ht(n),o=t.revalidate||3600;return{async get(c){let e=await s.get(c);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(c).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(c){let u=Z(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>c.match(P.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${c}`);return}let g=c.match(u.regex),v={};if(g)u.params.forEach((P,C)=>{v[P]=g[C+1]});let S=await a(),{html:p}=await wt(u,v,{},t,S);await s.set(c,{html:p,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:Wt(p)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Yt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},c=n;if(s){let S=s[1];c=n.slice(s[0].length).trim();for(let p of S.split(`
77
+ `)){let P=p.indexOf(":");if(P>0){let C=p.slice(0,P).trim(),b=p.slice(P+1).trim();if(b==="true")b=!0;else if(b==="false")b=!1;else if(/^\d+$/.test(b))b=parseInt(b,10);else if(/^\d+\.\d+$/.test(b))b=parseFloat(b);else if(b.startsWith("[")&&b.endsWith("]"))b=b.slice(1,-1).split(",").map((E)=>E.trim().replace(/^['"]|['"]$/g,""));o[C]=b}}}let e=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],g=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,v;while((v=g.exec(e))!==null){let S=parseInt(v[1],10),p=v[2],P=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:P,text:p,level:S})}return{content:e,data:o,toc:u}}}}function Zt(t){return kt(t)}function Qt(t,n){return`<!DOCTYPE html>
79
78
  <html>
80
79
  <head>
81
80
  <meta charset="utf-8">
@@ -87,4 +86,4 @@ Build complete!
87
86
  <p>Redirecting to <a href="${t}">${t}</a>...</p>
88
87
  <script>window.location.replace('${t}')</script>
89
88
  </body>
90
- </html>`}function Qt(t,n){if(t==="/"||t==="")return f.join(n.outputDir,"index.html");let s=t.replace(/^\/|\/$/g,"");if(n.trailingSlash)return f.join(n.outputDir,s,"index.html");return f.join(n.outputDir,`${s}.html`)}var je={generateStaticSite:Vt,createISRHandler:Kt,defineStaticPaths:q,createMarkdownLoader:Xt};export{Kt as createISRHandler,Xt as createMarkdownLoader,Nt as declaresPageAction,je as default,q as defineStaticPaths,Vt as generateStaticSite,Wt as isExcludedFromSitemap};
89
+ </html>`}function te(t,n){if(t==="/"||t==="")return m.join(n.outputDir,"index.html");let s=t.replace(/^\/|\/$/g,"");if(n.trailingSlash)return m.join(n.outputDir,s,"index.html");return m.join(n.outputDir,`${s}.html`)}var Fe={generateStaticSite:Kt,createISRHandler:Xt,defineStaticPaths:J,createMarkdownLoader:Yt};export{Xt as createISRHandler,Yt as createMarkdownLoader,Ht as declaresPageAction,Fe as default,J as defineStaticPaths,Kt as generateStaticSite,qt as isExcludedFromSitemap};
@@ -1,3 +1,4 @@
1
+ import { headCloseIndex } from "./document-tags.js";
1
2
  import { extractVariables } from "./variable-extractor.js";
2
3
  import { evaluateExpression, escapeHtmlValue } from "./expressions.js";
3
4
  import { replacePlaceholders, hasPlaceholders } from "./placeholder.js";
@@ -51,7 +52,7 @@ async function runHydration(compiled, requestContext) {
51
52
  const clean = html.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi, ""), tag = serverDataTag(context);
52
53
  if (!tag)
53
54
  return clean;
54
- const head = clean.indexOf("</head>");
55
+ const head = headCloseIndex(clean);
55
56
  return head < 0 ? tag + clean : clean.slice(0, head) + tag + clean.slice(head);
56
57
  };
57
58
  if (action.redirect)
@@ -1,3 +1,4 @@
1
+ import { bodyCloseIndex, insertBeforeHeadClose } from "../document-tags.js";
1
2
  export function generateComponentId(componentName, salt = "") {
2
3
  const input = `${componentName}${salt}`;
3
4
  let hash = 0;
@@ -186,8 +187,7 @@ ${scopedCss}
186
187
  switch (position) {
187
188
  case "head":
188
189
  if (template.includes("</head>"))
189
- return template.replace("</head>", `${styleTag}
190
- </head>`);
190
+ return insertBeforeHeadClose(template, styleTag);
191
191
  return styleTag + template;
192
192
  case "body-start":
193
193
  if (template.includes("<body"))
@@ -195,7 +195,7 @@ ${scopedCss}
195
195
  ${styleTag}`);
196
196
  return styleTag + template;
197
197
  case "body-end": {
198
- const csBodyIdx = template.lastIndexOf("</body>");
198
+ const csBodyIdx = bodyCloseIndex(template);
199
199
  if (csBodyIdx !== -1)
200
200
  return template.slice(0, csBodyIdx) + styleTag + `
201
201
  ` + template.slice(csBodyIdx);
package/dist/x-element.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { bodyCloseIndex } from "./document-tags.js";
1
2
  export function generateXElementRuntime() {
2
3
  return `<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
3
4
  (function() {
@@ -292,7 +293,7 @@ export function processXElementDirectives(template) {
292
293
  const runtimePattern = /<script\b(?=[^>]*\bdata-stx-x-element-runtime\b)[^>]*>[\s\S]*?<\/script>\s*/gi, existingRuntimes = template.match(runtimePattern) || [], withoutRuntimes = existingRuntimes.length > 0 ? template.replace(runtimePattern, "") : template;
293
294
  if (!hasXElementDirectives(withoutRuntimes))
294
295
  return withoutRuntimes;
295
- const runtime = existingRuntimes[0]?.trim() || generateXElementRuntime(), bodyCloseIdx = withoutRuntimes.lastIndexOf("</body>");
296
+ const runtime = existingRuntimes[0]?.trim() || generateXElementRuntime(), bodyCloseIdx = bodyCloseIndex(withoutRuntimes);
296
297
  if (bodyCloseIdx !== -1)
297
298
  return withoutRuntimes.slice(0, bodyCloseIdx) + runtime + `
298
299
  ` + withoutRuntimes.slice(bodyCloseIdx);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.861",
4
+ "version": "0.2.863",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -127,14 +127,14 @@
127
127
  },
128
128
  "dependencies": {
129
129
  "@stacksjs/clapp": "^0.2.17",
130
- "@stacksjs/desktop": "0.2.861",
131
- "@stacksjs/sanitizer": "0.2.861",
130
+ "@stacksjs/desktop": "0.2.863",
131
+ "@stacksjs/sanitizer": "0.2.863",
132
132
  "@stacksjs/ts-css": "^0.3.21",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
134
  "@types/dom-speech-recognition": "^0.0.12",
135
- "bun-plugin-stx": "0.2.861",
135
+ "bun-plugin-stx": "0.2.863",
136
136
  "bunfig": "^0.15.21",
137
- "stx-router": "0.2.861",
137
+ "stx-router": "0.2.863",
138
138
  "ts-broadcasting": "^0.0.13",
139
139
  "ts-images": "^0.2.22",
140
140
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,13 +0,0 @@
1
- /**
2
- * Put markup just before the document's closing `</body>`.
3
- *
4
- * The LAST one, never the first. A page's first `</body>` is routinely inside a
5
- * script: a component that writes a document of its own (a preview frame, a
6
- * print view) has the tag in a string, and so do the router and x-element
7
- * runtimes. Replacing the first match drops the new markup into the middle of
8
- * that script, which ends it early and leaves the rest of its source on the
9
- * page as text.
10
- *
11
- * Without a `</body>` the markup goes on the end.
12
- */
13
- export declare function insertBeforeBodyClose(html: string, markup: string): string;
@@ -1,8 +0,0 @@
1
- export function insertBeforeBodyClose(html, markup) {
2
- const at = html.toLowerCase().lastIndexOf("</body>");
3
- if (at === -1)
4
- return `${html}
5
- ${markup}`;
6
- return `${html.slice(0, at)}${markup}
7
- ${html.slice(at)}`;
8
- }
@@ -1,14 +0,0 @@
1
- // @bun
2
- import{yr}from"./chunk-3gfd9t8a.js";import{Pr}from"./chunk-830ej8d2.js";import{a}from"./chunk-6nb49h13.js";import{B,Qe}from"./chunk-pb09xy77.js";import{xc}from"./chunk-7yhhwv07.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function dr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function X(e,r={}){return new yr(e,r).routes}import w from"path";var y=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=y.get(n);if(c)return c;let o=[];try{o=X(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return y.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function g(e){return O(JSON.stringify(e))}function ve(e){return e.includes("data-stx-runtime")}function wc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function l(e,r){let t=dr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
- `+e.slice(t);let n=Pr(e);if(n!==null)return`${e.slice(0,n)}
4
- ${r}${e.slice(n)}`;if(e.includes("</head>")){let o=e.indexOf("</head>");return e.slice(0,o)+r+`
5
- `+e.slice(o)}if(B(e))return Qe(e,(o)=>`${o}
6
- ${r}`);return`${r}
7
- ${e}`}async function pr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-qx8cav4w.js"),{url:c}=await n("runtime",r.debug===!0);return l(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return l(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-qx8cav4w.js"),s=await t(r.debug);return l(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function vc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${xc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
8
- ${r}`;return`${e.slice(0,t)}${r}
9
- ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function xe(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-qx8cav4w.js");n=`<script data-stx-owned-routes src="${T(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${g(f)};
10
- `)}"></script>
11
- `}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${g(i)};</script>
12
- `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-qx8cav4w.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
13
- </body>`+e.slice(d+7)}
14
- export{dr,X,ve,wc,pr,vc,xe};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{or,i}from"./chunk-kv40xq53.js";import"./chunk-5q4tncfw.js";import"./chunk-7de5y29a.js";import"./chunk-t5q31st4.js";import"./chunk-b7nmgkwa.js";import"./chunk-2b4a8tbd.js";import"./chunk-aj6vqdf7.js";import"./chunk-v0wdgxga.js";import"./chunk-b1tctqn5.js";import{xe}from"./chunk-02css3vk.js";import"./chunk-h2cvfp9y.js";import"./chunk-z99bf0q0.js";import"./chunk-6nb49h13.js";import"./chunk-68w65mhs.js";import"./chunk-9pyvc0dc.js";import"./chunk-4rrxrxp6.js";import"./chunk-dba4bwkd.js";import"./chunk-3gfd9t8a.js";import{Me,Ws,qs}from"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{or as buildModulesTag,xe as injectRouterScript,i as processDirectives,Ws as processJsonDirective,qs as processOnceDirective,Me as validateClientScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vh,Wf,Ze,hc,Uh,us,ds,ps}from"./chunk-7de5y29a.js";import"./chunk-b7nmgkwa.js";import"./chunk-2b4a8tbd.js";import"./chunk-v0wdgxga.js";import"./chunk-h2cvfp9y.js";import"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{Uh as clearOnceStore,hc as onceStore,Ze as partialsCache,us as processIncludes,ds as processStackPushDirectives,ps as processStackReplacements,Vh as resetUnscopedSignalWarnings,Wf as topLevelElements};