@stacksjs/stx 0.2.876 → 0.2.880

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 (276) hide show
  1. package/dist/{chunk-fdjx4vs3.js → chunk-00tq7ghn.js} +2 -2
  2. package/dist/{chunk-nv4c25zj.js → chunk-02qmvcmv.js} +3 -3
  3. package/dist/chunk-08cb7cyw.js +2 -0
  4. package/dist/chunk-0h1dyd38.js +2 -0
  5. package/dist/{chunk-2mt2zc5y.js → chunk-0m4c42qt.js} +10 -10
  6. package/dist/{chunk-x4jzhgdm.js → chunk-19k15mfc.js} +2 -2
  7. package/dist/chunk-1avy0p8v.js +2 -0
  8. package/dist/chunk-1jk46ve0.js +2 -0
  9. package/dist/chunk-1r612xxs.js +2 -0
  10. package/dist/chunk-1z6rrqvm.js +2 -0
  11. package/dist/chunk-2d68p12e.js +2 -0
  12. package/dist/chunk-2haf7t5h.js +2 -0
  13. package/dist/{chunk-1q5w3xav.js → chunk-2r0nrvqe.js} +2 -2
  14. package/dist/chunk-3jp5z1qj.js +2 -0
  15. package/dist/{chunk-dv56x3g8.js → chunk-3q0w0bzd.js} +10 -10
  16. package/dist/{chunk-eknm4jrm.js → chunk-3sema2js.js} +2 -2
  17. package/dist/{chunk-cj44e8mw.js → chunk-3wb82rxw.js} +5 -5
  18. package/dist/chunk-3zds0gmd.js +2 -0
  19. package/dist/{chunk-qnwd5bz4.js → chunk-463weehv.js} +1 -1
  20. package/dist/{chunk-wm029dh0.js → chunk-4fkcn6z5.js} +18 -12
  21. package/dist/{chunk-976kgb3r.js → chunk-4n45qa0b.js} +9 -9
  22. package/dist/chunk-4pjqj54a.js +2 -0
  23. package/dist/{chunk-j0rqa9bk.js → chunk-4r2rfdmr.js} +5 -5
  24. package/dist/{chunk-ft6em3wm.js → chunk-50cnypys.js} +6 -6
  25. package/dist/chunk-53cc06w7.js +2 -0
  26. package/dist/{chunk-y2e2zm6y.js → chunk-57q4nvs9.js} +3 -3
  27. package/dist/{chunk-3mz9bdf7.js → chunk-59er0fc7.js} +3 -3
  28. package/dist/{chunk-6kp4mg3h.js → chunk-5eftxrvv.js} +2 -2
  29. package/dist/chunk-5p3825qw.js +2 -0
  30. package/dist/chunk-5rd0an89.js +2 -0
  31. package/dist/{chunk-pk714ynv.js → chunk-69ezjc8k.js} +4 -4
  32. package/dist/{chunk-75v0yxeh.js → chunk-6c1vm6bs.js} +2 -2
  33. package/dist/{chunk-d3q0cg47.js → chunk-6df3j3qq.js} +3 -3
  34. package/dist/{chunk-kzc2tqzr.js → chunk-6t04tqvh.js} +2 -2
  35. package/dist/chunk-78zgmqhd.js +2 -0
  36. package/dist/chunk-7bsrnpmh.js +33 -0
  37. package/dist/chunk-7dq6ebvp.js +2 -0
  38. package/dist/chunk-7kqgp3p7.js +2 -0
  39. package/dist/{chunk-wzvdr4ta.js → chunk-7mcs59pr.js} +2 -2
  40. package/dist/chunk-83b9k17j.js +2 -0
  41. package/dist/chunk-86nsbxep.js +61 -0
  42. package/dist/{chunk-0g2mg8cw.js → chunk-8e1cv1hh.js} +3 -3
  43. package/dist/chunk-8h5nje66.js +2 -0
  44. package/dist/{chunk-ae8q4gze.js → chunk-8va3fs07.js} +5 -5
  45. package/dist/{chunk-fh72k2ks.js → chunk-93jhfbeg.js} +6 -6
  46. package/dist/{chunk-xmws1gaf.js → chunk-94ctmp0j.js} +2 -2
  47. package/dist/chunk-97kgrevs.js +4 -0
  48. package/dist/{chunk-nn6hvsxp.js → chunk-9cbf0seq.js} +2 -2
  49. package/dist/{chunk-mce3g2wb.js → chunk-9f31gs4m.js} +2 -2
  50. package/dist/chunk-9kza7gxd.js +2 -0
  51. package/dist/{chunk-b4d4tjvx.js → chunk-a0q0kb0s.js} +5 -5
  52. package/dist/chunk-a5gnxdfe.js +2 -0
  53. package/dist/chunk-a60ztvnp.js +3 -0
  54. package/dist/{chunk-s7fhpkvf.js → chunk-a7ryj8z8.js} +6 -6
  55. package/dist/{chunk-gqtb53s8.js → chunk-aaea157p.js} +2 -2
  56. package/dist/{chunk-wp0qpa50.js → chunk-agd2b928.js} +59 -27
  57. package/dist/chunk-aqxh80vh.js +2 -0
  58. package/dist/{chunk-2tcyfrvb.js → chunk-awp8a3t4.js} +2 -2
  59. package/dist/chunk-axra1yas.js +2 -0
  60. package/dist/chunk-az8b0726.js +21 -0
  61. package/dist/chunk-b7d3n4aw.js +2 -0
  62. package/dist/{chunk-r2bxjna3.js → chunk-c0g30cjs.js} +2 -2
  63. package/dist/{chunk-jt5tzddc.js → chunk-c73c0wf9.js} +2 -2
  64. package/dist/{chunk-3922g6sh.js → chunk-cad7e5q1.js} +9 -9
  65. package/dist/{chunk-bjjfr7qt.js → chunk-care745q.js} +2 -2
  66. package/dist/chunk-ce0zbpr5.js +2 -0
  67. package/dist/chunk-cjv89tnb.js +20 -0
  68. package/dist/chunk-cv1vm1w0.js +2 -0
  69. package/dist/{chunk-mw0rb1sf.js → chunk-czcx3nbx.js} +6 -6
  70. package/dist/chunk-d7b30bg6.js +2 -0
  71. package/dist/{chunk-stn7p7f1.js → chunk-dwyhpbpx.js} +2 -2
  72. package/dist/{chunk-y75bds1g.js → chunk-e362e615.js} +30 -30
  73. package/dist/{chunk-ydppkb8y.js → chunk-e41pgmgk.js} +2 -2
  74. package/dist/{chunk-ctjxcaxq.js → chunk-ec5q4nnw.js} +66 -66
  75. package/dist/{chunk-k0t9ye9j.js → chunk-egjmb32c.js} +126 -71
  76. package/dist/{chunk-g15reb1h.js → chunk-ew3vs3jq.js} +8 -8
  77. package/dist/{chunk-jqxerj6k.js → chunk-ezna4dhj.js} +2 -2
  78. package/dist/chunk-f3j1h3ch.js +2 -0
  79. package/dist/{chunk-mkwavsb3.js → chunk-f7znj9xg.js} +3 -3
  80. package/dist/chunk-fz4c5e9m.js +2 -0
  81. package/dist/{chunk-esjr9qhe.js → chunk-g2xy0z0e.js} +2 -2
  82. package/dist/{chunk-fwbccyhw.js → chunk-g83ph305.js} +2 -2
  83. package/dist/{chunk-kywe0f1v.js → chunk-gbncp2gp.js} +2 -2
  84. package/dist/chunk-gm67jt8p.js +2 -0
  85. package/dist/chunk-gmp10259.js +2 -0
  86. package/dist/{chunk-0sa9gqmc.js → chunk-h2tq6cbr.js} +11 -11
  87. package/dist/chunk-h3fv0q25.js +2 -0
  88. package/dist/{chunk-r09kz9bf.js → chunk-h63ma36g.js} +2 -2
  89. package/dist/chunk-hkx51atf.js +2 -0
  90. package/dist/{chunk-w8k9fz1w.js → chunk-hmntqqyd.js} +7 -7
  91. package/dist/{chunk-3w7gacva.js → chunk-hxhmhw23.js} +3 -3
  92. package/dist/chunk-jghpzx5m.js +2 -0
  93. package/dist/chunk-k206d3pn.js +2 -0
  94. package/dist/chunk-k40e0ete.js +4 -0
  95. package/dist/chunk-k6c5t9we.js +38 -0
  96. package/dist/{chunk-f4vgagjb.js → chunk-kee5a3ce.js} +3 -3
  97. package/dist/chunk-kn9tqjgv.js +25 -0
  98. package/dist/chunk-kna1bdm2.js +54 -0
  99. package/dist/{chunk-ttjscvre.js → chunk-mygsektn.js} +3 -3
  100. package/dist/chunk-nb6erf75.js +9 -0
  101. package/dist/chunk-ngzyzcrp.js +2 -0
  102. package/dist/{chunk-h17pfbng.js → chunk-nysbdr4r.js} +2 -2
  103. package/dist/chunk-p55a910x.js +1198 -0
  104. package/dist/chunk-p6hcrg3r.js +3 -0
  105. package/dist/chunk-p746twww.js +2 -0
  106. package/dist/chunk-pa2vt2ej.js +2 -0
  107. package/dist/chunk-pa6kgbmw.js +2 -0
  108. package/dist/{chunk-saqzk45g.js → chunk-pdprhg5k.js} +1 -1
  109. package/dist/chunk-pjjrx9pk.js +2 -0
  110. package/dist/{chunk-7rep2jqh.js → chunk-pm4rpc4a.js} +23 -23
  111. package/dist/chunk-pt3rp3zg.js +2 -0
  112. package/dist/{chunk-4517hny7.js → chunk-q1mb0fbt.js} +2 -2
  113. package/dist/{chunk-k1ew643q.js → chunk-q74affc4.js} +2 -2
  114. package/dist/chunk-qd9v1v8z.js +2 -0
  115. package/dist/chunk-qfwk93fk.js +2 -0
  116. package/dist/chunk-qg1kw5yf.js +2 -0
  117. package/dist/chunk-qn6y5ttj.js +2 -0
  118. package/dist/chunk-qxcc0aar.js +2 -0
  119. package/dist/{chunk-rzd9hyhv.js → chunk-ram5944w.js} +2 -2
  120. package/dist/{chunk-p5m1z6e1.js → chunk-rcxer2km.js} +4 -4
  121. package/dist/chunk-rdxph1tp.js +2 -0
  122. package/dist/chunk-rnrdngnn.js +2 -0
  123. package/dist/{chunk-x2ftkaz3.js → chunk-rsxxajv6.js} +2 -2
  124. package/dist/chunk-rw5sxr5a.js +2 -0
  125. package/dist/chunk-rzcdwybt.js +26 -0
  126. package/dist/chunk-s29hp1qw.js +14 -0
  127. package/dist/chunk-s7xywsqd.js +3 -0
  128. package/dist/{chunk-d6gqh2wv.js → chunk-satrf398.js} +1 -1
  129. package/dist/{chunk-zn6n075d.js → chunk-shcnt6aa.js} +3 -3
  130. package/dist/{chunk-ysfgabpf.js → chunk-sn4ndpd7.js} +3 -3
  131. package/dist/{chunk-zc8a2erc.js → chunk-ssg6ne5b.js} +4 -4
  132. package/dist/{chunk-afxfkb60.js → chunk-sv7fdqmc.js} +6 -6
  133. package/dist/chunk-swz0xprw.js +2 -0
  134. package/dist/chunk-t8r40wgf.js +2 -0
  135. package/dist/{chunk-dbvsa5ya.js → chunk-t94y8g35.js} +2 -2
  136. package/dist/{chunk-df6vjs3p.js → chunk-t9hxyvvc.js} +5 -5
  137. package/dist/{chunk-cvbwxskc.js → chunk-tgzs1kbj.js} +5 -5
  138. package/dist/chunk-tka73egx.js +2 -0
  139. package/dist/{chunk-xtaq95em.js → chunk-v1s838fe.js} +1 -1
  140. package/dist/chunk-v3747589.js +12 -0
  141. package/dist/chunk-v9h2bbhf.js +2 -0
  142. package/dist/chunk-v9mxhch2.js +2 -0
  143. package/dist/chunk-vm42j29z.js +2 -0
  144. package/dist/chunk-w2kdhm7k.js +2 -0
  145. package/dist/chunk-w5zzwe2f.js +2 -0
  146. package/dist/chunk-wbmx0rge.js +2 -0
  147. package/dist/chunk-wjafpvjv.js +2 -0
  148. package/dist/chunk-ws2h92mm.js +3 -0
  149. package/dist/chunk-ws9kr80x.js +2 -0
  150. package/dist/{chunk-zgds9nwv.js → chunk-xf0xacc9.js} +44 -44
  151. package/dist/chunk-xhr35ctb.js +2 -0
  152. package/dist/chunk-xmmr0916.js +2 -0
  153. package/dist/{chunk-yxdhz4ps.js → chunk-xpbakn6t.js} +2 -2
  154. package/dist/chunk-xz4v9tg1.js +3 -0
  155. package/dist/chunk-y7e61pz3.js +3 -0
  156. package/dist/{chunk-v0tdg16k.js → chunk-ybjgnnyf.js} +5 -5
  157. package/dist/chunk-yh2hnt3m.js +12 -0
  158. package/dist/{chunk-w6pzkcjp.js → chunk-ymqm898x.js} +2 -2
  159. package/dist/{chunk-2zaatnnh.js → chunk-yp4tn4zn.js} +4 -4
  160. package/dist/chunk-z7k1xn6k.js +2 -0
  161. package/dist/{chunk-vnkvnenn.js → chunk-z9ffr9gy.js} +7 -7
  162. package/dist/{chunk-nnp6rf4c.js → chunk-zch65qrd.js} +1 -1
  163. package/dist/{chunk-pbakxcv8.js → chunk-zek9t5za.js} +2 -2
  164. package/dist/cli.js +23 -23
  165. package/dist/client/signals-dom-ready-runtime.js +6 -0
  166. package/dist/client/signals-mount-runtime.js +1 -1
  167. package/dist/client-module-registry.js +10 -4
  168. package/dist/client-parameter-bindings.d.ts +5 -0
  169. package/dist/client-parameter-bindings.js +47 -6
  170. package/dist/client-script-bundler.js +4 -3
  171. package/dist/component-library.d.ts +1 -0
  172. package/dist/component-library.js +42 -14
  173. package/dist/composable-loader.js +19 -9
  174. package/dist/craft-entry.js +2 -2
  175. package/dist/craft.js +2 -2
  176. package/dist/html-masking.d.ts +2 -0
  177. package/dist/html-masking.js +10 -0
  178. package/dist/inherited-context.d.ts +1 -1
  179. package/dist/inherited-context.js +43 -14
  180. package/dist/module-syntax.d.ts +2 -0
  181. package/dist/module-syntax.js +21 -0
  182. package/dist/native-component-context.js +42 -16
  183. package/dist/page-module-order.d.ts +10 -0
  184. package/dist/page-module-order.js +139 -0
  185. package/dist/process.js +6 -4
  186. package/dist/pwa.js +3 -3
  187. package/dist/script-attributes.d.ts +4 -0
  188. package/dist/script-attributes.js +10 -0
  189. package/dist/ssg.js +39 -39
  190. package/dist/strip-literals.d.ts +2 -0
  191. package/dist/strip-literals.js +12 -6
  192. package/dist/stx-virtual-ts.d.ts +1 -0
  193. package/dist/stx-virtual-ts.js +21 -27
  194. package/dist/typecheck.js +8 -0
  195. package/package.json +5 -5
  196. package/dist/chunk-027meh1k.js +0 -2
  197. package/dist/chunk-0hs633pt.js +0 -2
  198. package/dist/chunk-0j8zre1m.js +0 -2
  199. package/dist/chunk-0v02qms8.js +0 -2
  200. package/dist/chunk-0z9gttw0.js +0 -2
  201. package/dist/chunk-11dwmcpy.js +0 -3
  202. package/dist/chunk-1a237qky.js +0 -33
  203. package/dist/chunk-1ehjzhnc.js +0 -25
  204. package/dist/chunk-1gfg6qmr.js +0 -2
  205. package/dist/chunk-1kgnk6ds.js +0 -2
  206. package/dist/chunk-1ztp5vkh.js +0 -3
  207. package/dist/chunk-32wvc376.js +0 -2
  208. package/dist/chunk-3k2d2jsn.js +0 -2
  209. package/dist/chunk-3te2y9qf.js +0 -2
  210. package/dist/chunk-40330tm5.js +0 -2
  211. package/dist/chunk-447jc6zc.js +0 -2
  212. package/dist/chunk-4dk6k0ad.js +0 -2
  213. package/dist/chunk-4e48zkq0.js +0 -2
  214. package/dist/chunk-5ep7p8te.js +0 -2
  215. package/dist/chunk-5gx403te.js +0 -1184
  216. package/dist/chunk-6q9a5bph.js +0 -2
  217. package/dist/chunk-7ds9mx4c.js +0 -2
  218. package/dist/chunk-7njy024g.js +0 -2
  219. package/dist/chunk-7tjewwmd.js +0 -2
  220. package/dist/chunk-85xabvtj.js +0 -2
  221. package/dist/chunk-880f8j99.js +0 -2
  222. package/dist/chunk-8f3dbthj.js +0 -2
  223. package/dist/chunk-99e3mxnn.js +0 -20
  224. package/dist/chunk-9gv847nn.js +0 -2
  225. package/dist/chunk-9mz2n39m.js +0 -2
  226. package/dist/chunk-akthsg33.js +0 -54
  227. package/dist/chunk-b1tcym2x.js +0 -2
  228. package/dist/chunk-bdh73gxd.js +0 -4
  229. package/dist/chunk-bspj1rf1.js +0 -2
  230. package/dist/chunk-bx3hpsxn.js +0 -2
  231. package/dist/chunk-byq488g4.js +0 -2
  232. package/dist/chunk-c4s25bm2.js +0 -2
  233. package/dist/chunk-csjqtzwc.js +0 -2
  234. package/dist/chunk-df78j74w.js +0 -4
  235. package/dist/chunk-dgs3d367.js +0 -2
  236. package/dist/chunk-dmf6zcf4.js +0 -2
  237. package/dist/chunk-e2b2f502.js +0 -2
  238. package/dist/chunk-ec6mrad6.js +0 -2
  239. package/dist/chunk-eecctzgp.js +0 -17
  240. package/dist/chunk-fa57bncd.js +0 -2
  241. package/dist/chunk-g4eheg0t.js +0 -24
  242. package/dist/chunk-gfe1jrw9.js +0 -2
  243. package/dist/chunk-gn16yq49.js +0 -2
  244. package/dist/chunk-gvs61tqn.js +0 -2
  245. package/dist/chunk-h2928108.js +0 -2
  246. package/dist/chunk-hat353vx.js +0 -2
  247. package/dist/chunk-jmjgj3nh.js +0 -2
  248. package/dist/chunk-jqtpzzz4.js +0 -12
  249. package/dist/chunk-jvy7z3hz.js +0 -3
  250. package/dist/chunk-k9dne5by.js +0 -12
  251. package/dist/chunk-kq8mffgf.js +0 -2
  252. package/dist/chunk-kx06jzdw.js +0 -2
  253. package/dist/chunk-n5pvdrkb.js +0 -2
  254. package/dist/chunk-ne8q191s.js +0 -2
  255. package/dist/chunk-np8wgbsa.js +0 -3
  256. package/dist/chunk-nthw4dca.js +0 -2
  257. package/dist/chunk-pp99rmjm.js +0 -72
  258. package/dist/chunk-pqmjeea6.js +0 -2
  259. package/dist/chunk-qggwr60r.js +0 -2
  260. package/dist/chunk-qm3v4qb7.js +0 -2
  261. package/dist/chunk-qty0t69x.js +0 -2
  262. package/dist/chunk-rjv6885r.js +0 -2
  263. package/dist/chunk-rm5gbthk.js +0 -2
  264. package/dist/chunk-sgengtap.js +0 -2
  265. package/dist/chunk-snz2cxqv.js +0 -2
  266. package/dist/chunk-szp7ajfm.js +0 -33
  267. package/dist/chunk-ts37jw3s.js +0 -2
  268. package/dist/chunk-v4emesnw.js +0 -2
  269. package/dist/chunk-vnrbjbrw.js +0 -3
  270. package/dist/chunk-vxra53wq.js +0 -2
  271. package/dist/chunk-x76qvq1n.js +0 -2
  272. package/dist/chunk-x85z6dmw.js +0 -2
  273. package/dist/chunk-xkfe03y9.js +0 -2
  274. package/dist/chunk-y4hn1qh0.js +0 -2
  275. package/dist/chunk-yc8ggeh2.js +0 -2
  276. package/dist/chunk-yfed67yc.js +0 -2
@@ -1,7 +1,62 @@
1
1
  // @bun
2
- import{Vt,me,E,d,m,O,t,oe,Y,u,Ae,Bi,W,An,Fi,qt,zi,xl,Mr,Sl,pt,kl,Lr,_l,Pn,Hi,Cl,jr,Fr,Pe,Vi}from"./chunk-pp99rmjm.js";import{vi,Wc,o,T,Fe,Lt,bn,ze,we,ee,Tr,vn,Xs,tl,nl,Sn,Ir,Ys,Zs,rl,$i,sl,ol,il,al,He,Ve,Qs,qe,s,Cn,y,g,X,re,Re,R,Di}from"./chunk-5gx403te.js";import{Ht}from"./chunk-kzc2tqzr.js";import{$n}from"./chunk-x4jzhgdm.js";import{x}from"./chunk-dv56x3g8.js";import{Sr,js}from"./chunk-wp0qpa50.js";import{$c,Rc,wr,ot,Ac,M}from"./chunk-ctjxcaxq.js";import{ui,di,pi,fi}from"./chunk-0sa9gqmc.js";import{kc,ws}from"./chunk-3922g6sh.js";import{ms,hs,ys}from"./chunk-akthsg33.js";import{Ss,ni,ri,ks,_s,si}from"./chunk-2mt2zc5y.js";import{vs,Yo}from"./chunk-1ehjzhnc.js";import{Ko}from"./chunk-r2bxjna3.js";import{de,Zo,Qo,ei}from"./chunk-dbvsa5ya.js";import{mr,Ce,Cc,hr,Ec}from"./chunk-w8k9fz1w.js";import{V,rt}from"./chunk-bjjfr7qt.js";import{Ic,Oc}from"./chunk-ttjscvre.js";import{A,In,Ui}from"./chunk-1ztp5vkh.js";import{D,c,f}from"./chunk-yxdhz4ps.js";import Jn from"fs";import ae from"path";function mt(n){let e=Lt(n),l=e.find((S)=>S.closing&&S.name.toLowerCase()==="head");if(!l)return n;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),h=0,r=[];for(let S=0;S<e.length;S++){let v=e[S];if(v.start<l.end)continue;let k=v.name.toLowerCase();if(a.has(k)){h=Math.max(0,h+(v.closing?-1:v.selfClosing?0:1));continue}if(k!=="style"||v.closing||h>0)continue;let C=e[S+1];if(C?.name.toLowerCase()==="style"&&C.closing){if(/@scope\s*\{/.test(n.slice(v.end,C.start)))continue;r.push({start:v.start,end:C.end}),S++}}if(!r.length)return n;let p=r.map((S)=>n.slice(S.start,S.end)).join(`
3
- `),w=[n.slice(0,l.start),p,`
4
- `],b=l.start;for(let S of r)w.push(n.slice(b,S.start)),b=S.end;return w.push(n.slice(b)),w.join("")}function ht(){return`
2
+ import{Qt,ye,R}from"./chunk-s29hp1qw.js";import{Ti,Qc,o,A,Ue,Pe,_n,We,xe,re,Ir,J,En,to,ll,ul,$n,Lr,ro,so,dl,Mi,pl,fl,gl,ml,qe,Ke,oo,Je,s,An,y,g,Y,ie,Oe,P,Hi}from"./chunk-p55a910x.js";import{d,m,N,n,ae,ee,u,Ne,qi,q,Mn,Ki,Yt,Gi,$l,zr,Rl,bt,Al,Hr,Pl,Dn,Xi,Il,Vr,Wr,Me,Ji}from"./chunk-86nsbxep.js";import{Gt}from"./chunk-6t04tqvh.js";import{On}from"./chunk-19k15mfc.js";import{x}from"./chunk-3q0w0bzd.js";import{Tr,Us}from"./chunk-agd2b928.js";import{Dc,Lc,_r,ut,jc,L}from"./chunk-ec5q4nnw.js";import{yi,bi,wi,vi}from"./chunk-h2tq6cbr.js";import{Pc,Cs}from"./chunk-cad7e5q1.js";import{xs,Ss,ks}from"./chunk-kna1bdm2.js";import{$s,li,ui,Rs,As,di}from"./chunk-0m4c42qt.js";import{Es,si}from"./chunk-kn9tqjgv.js";import{ei}from"./chunk-c0g30cjs.js";import{fe,oi,ii,ai}from"./chunk-t94y8g35.js";import{vr,Te,Oc,xr,Nc}from"./chunk-hmntqqyd.js";import{U,ct}from"./chunk-care745q.js";import{Z}from"./chunk-nb6erf75.js";import{Fc,zc}from"./chunk-mygsektn.js";import{I,Ln,Yi}from"./chunk-ws2h92mm.js";import{Bn}from"./chunk-yh2hnt3m.js";import{D,c,f}from"./chunk-xpbakn6t.js";function Ge(r){return/\bimport\s*\.\s*meta\b/.test(Bn(r))}function Fr(r){let e=Pe(r),l=[],a=0;for(let h=0;h<e.length;h++){let t=e[h],p=t.name.toLowerCase();if(p==="template")a+=t.closing?-1:1;if(p!=="script"||t.closing)continue;let w=e[h+1];if(w?.name.toLowerCase()!=="script"||!w.closing)continue;l.push({start:t.start,end:w.end,attrs:t.attributes,body:r.slice(t.end,w.start),inert:a>0})}return l}function nt(r){return[...r].map(([e,l])=>l===!0?e:`${e}="${l.replace(/"/g,"&quot;")}"`).join(" ")}function vt(r){let e=Fr(r);if(e.some((b)=>J(b.attrs).has("data-stx-module-bootstrap")))return r;let l=(b)=>{if(Ge(b))return!0;try{return Z(b)}catch{return!1}};if(!e.some((b)=>l(b.body)||J(b.attrs).get("type")==="module"))return r;let a=new Bun.CryptoHasher("md5").update(r).digest("hex").slice(0,16),h="",t=0,p=!1,w=0;for(let b of e){let S=J(b.attrs),v=S.get("type");if(b.inert||S.has("data-stx-module-job")||S.has("data-stx-runtime")||S.has("data-stx-router"))continue;if(typeof v==="string"&&!["module","text/javascript","application/javascript"].includes(v.toLowerCase()))continue;if(![...S.keys()].some((T)=>/^data-stx-(?:scoped|modules|stores|(?:framework-)?composables)$/.test(T)))continue;let _=v==="module"||l(b.body);if(_)p=!0;if(!p)continue;if(!_&&(S.has("data-stx-owner")||S.has("data-stx-instance")))continue;h+=r.slice(t,b.start);let E=b.body,M=S.get("src");if(typeof M==="string")S.delete("src"),S.set("data-stx-source-url",M),E=`${_?"await":"return"} new Promise(function(resolve,reject){
3
+ var source=globalThis.__stxExecutingScript,script=document.createElement('script');
4
+ for(var attr of source.attributes)if(!['type','src','data-stx-module-job'].includes(attr.name))script.setAttribute(attr.name,attr.value);
5
+ ${_?"script.type='module';":""}
6
+ if(source.nonce)script.nonce=source.nonce;
7
+ script.src=new URL(source.getAttribute('data-stx-source-url'),document.baseURI).href;
8
+ script.onload=function(){${_?"":"globalThis.__stxExecutingScript=__stxPreviousScript;"}resolve();};
9
+ script.onerror=function(error){${_?"":"globalThis.__stxExecutingScript=__stxPreviousScript;"}reject(error);};
10
+ source.parentNode.insertBefore(script,source);
11
+ });`;if(_){let T=`${a}-${w++}`,C=JSON.stringify(T),O=new Map(S);O.delete("type"),O.delete("async"),O.delete("defer"),O.set("data-stx-module-bootstrap",!0),h+=`<script ${nt(O)}>
12
+ ;(function(){
13
+ var resolve,reject,previous=globalThis.__stxPageModulesReady||Promise.resolve();
14
+ var ready=new Promise(function(ok,fail){resolve=ok;reject=fail;});
15
+ var job={previous:previous,resolve:resolve,reject:reject};
16
+ (globalThis.__stxModuleJobs||(globalThis.__stxModuleJobs={}))[${C}]=job;
17
+ job.fail=function(event){
18
+ var script=document.querySelector('script[data-stx-module-job="${T}"]');
19
+ if((event.target&&event.target===script)||(event.filename&&event.filename===(script&&script.src||document.URL))){
20
+ window.removeEventListener('error',job.fail,true);
21
+ if(globalThis.__stxExecutingScript===job.script)globalThis.__stxExecutingScript=job.previousScript;
22
+ reject(event.error||new Error(event.message||'Page module failed to load'));
23
+ delete globalThis.__stxModuleJobs[${C}];
24
+ }
25
+ };
26
+ window.addEventListener('error',job.fail,true);
27
+ globalThis.__stxPageModulesReady=ready;
28
+ ready.catch(function(error){console.error('[stx] page module failed',error);});
29
+ })();
30
+ </script>`,S.set("type","module"),S.delete("async"),S.delete("defer"),S.set("data-stx-module-job",T),h+=`<script ${nt(S)}>
31
+ await globalThis.__stxModuleJobs[${C}].previous;
32
+ globalThis.__stxModuleJobs[${C}].previousScript=globalThis.__stxExecutingScript;
33
+ globalThis.__stxModuleJobs[${C}].script=document.querySelector('script[data-stx-module-job="${T}"]');
34
+ globalThis.__stxExecutingScript=globalThis.__stxModuleJobs[${C}].script;
35
+ ${E}
36
+ globalThis.__stxExecutingScript=globalThis.__stxModuleJobs[${C}].previousScript;
37
+ window.removeEventListener('error',globalThis.__stxModuleJobs[${C}].fail,true);
38
+ globalThis.__stxModuleJobs[${C}].resolve();
39
+ delete globalThis.__stxModuleJobs[${C}];
40
+ </script>`}else h+=`<script ${nt(S)}>
41
+ ;(function(__stxSource){
42
+ globalThis.__stxPageModulesReady=(globalThis.__stxPageModulesReady||Promise.resolve()).then(function(){
43
+ var __stxPreviousScript=globalThis.__stxExecutingScript;
44
+ globalThis.__stxExecutingScript=__stxSource;
45
+ ${typeof M==="string"?E:`var __stxLive=document.createElement('script');
46
+ for(var __stxAttr of __stxSource.attributes)if(!['src','type'].includes(__stxAttr.name))__stxLive.setAttribute(__stxAttr.name,__stxAttr.value);
47
+ if(__stxSource.nonce)__stxLive.nonce=__stxSource.nonce;
48
+ __stxLive.textContent=${JSON.stringify(E).replace(/<\/script/gi,"<\\/script")};
49
+ var __stxFailure;
50
+ function __stxCapture(event){__stxFailure=event.error||new Error(event.message);}
51
+ window.addEventListener('error',__stxCapture);
52
+ try { __stxSource.parentNode.replaceChild(__stxLive,__stxSource); }
53
+ finally { window.removeEventListener('error',__stxCapture); globalThis.__stxExecutingScript=__stxPreviousScript; }
54
+ if(__stxFailure)throw __stxFailure;`}
55
+ });
56
+ })(document.currentScript);
57
+ </script>`;t=b.end}return h+r.slice(t)}import ss from"fs";import le from"path";function xt(r){let e=Pe(r),l=e.find((S)=>S.closing&&S.name.toLowerCase()==="head");if(!l)return r;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),h=0,t=[];for(let S=0;S<e.length;S++){let v=e[S];if(v.start<l.end)continue;let k=v.name.toLowerCase();if(a.has(k)){h=Math.max(0,h+(v.closing?-1:v.selfClosing?0:1));continue}if(k!=="style"||v.closing||h>0)continue;let _=e[S+1];if(_?.name.toLowerCase()==="style"&&_.closing){if(/@scope\s*\{/.test(r.slice(v.end,_.start)))continue;t.push({start:v.start,end:_.end}),S++}}if(!t.length)return r;let p=t.map((S)=>r.slice(S.start,S.end)).join(`
58
+ `),w=[r.slice(0,l.start),p,`
59
+ `],b=l.start;for(let S of t)w.push(r.slice(b,S.start)),b=S.end;return w.push(r.slice(b)),w.join("")}function St(){return`
5
60
  // STX Lifecycle Runtime
6
61
  (function() {
7
62
  if (typeof window === 'undefined') return;
@@ -349,7 +404,7 @@ else {
349
404
 
350
405
  console.log('[stx] Lifecycle runtime initialized');
351
406
  })();
352
- `}function Ye(n){return Symbol(n)}var xs=Ye("theme"),$s=Ye("router"),Es=Ye("i18n");import*as bt from"crypto";function yt(n){let e=/\$(\w+)\./g,l=[],a;while((a=e.exec(n))!==null)if(!l.includes(a[1]))l.push(a[1]);return l}function Hr(){return`stx-${bt.randomBytes(4).toString("hex")}`}function Nr(n){return/\$\w+\./.test(n)}function Br(n){if(!/\{\{[^}]*\$\w/.test(n)||!/\$\w+\./.test(n))return{html:n,bindings:[],stores:new Set};let e=[],l=new Set,a=/<(\w+)([^>]*?)(\s*\/?>)/g,h=n;return h=h.replace(a,(r,p,w,b)=>{if(["script","style","template"].includes(p.toLowerCase()))return r;if(!w.includes("{{"))return r;let S=[],v=!1,k=w,C=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,_=[...w.matchAll(C)];for(let L of _){let j=L[0],B=L[1],F=L[2];if(Nr(F)){v=!0;let q=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(q){let H=q[1];if(S.push({attr:B,expr:H,fullMatch:j,originalAttr:B}),yt(H).forEach((U)=>l.add(U)),B==="text")k=k.replace(j,"");else if(B==="class")k=k.replace(j,'class=""');else if(B==="disabled"||B==="hidden")k=k.replace(j,"");else k=k.replace(j,`${B}=""`)}}}if(!v)return r;let P=k.match(/\bid\s*=\s*"([^"]+)"/),I;if(P)I=P[1];else I=Hr(),k=` id="${I}"${k}`;for(let L of S)e.push({elementId:I,attribute:L.attr,expression:L.expr,stores:yt(L.expr)});return`<${p}${k}${b}`}),{html:h,bindings:e,stores:l}}function Ur(n,e){if(n.length===0)return"";let l=Array.from(e),a=`
407
+ `}function st(r){return Symbol(r)}var Ps=st("theme"),js=st("router"),Ns=st("i18n");import*as _t from"crypto";function kt(r){let e=/\$(\w+)\./g,l=[],a;while((a=e.exec(r))!==null)if(!l.includes(a[1]))l.push(a[1]);return l}function qr(){return`stx-${_t.randomBytes(4).toString("hex")}`}function Ur(r){return/\$\w+\./.test(r)}function Xr(r){if(!/\{\{[^}]*\$\w/.test(r)||!/\$\w+\./.test(r))return{html:r,bindings:[],stores:new Set};let e=[],l=new Set,a=/<(\w+)([^>]*?)(\s*\/?>)/g,h=r;return h=h.replace(a,(t,p,w,b)=>{if(["script","style","template"].includes(p.toLowerCase()))return t;if(!w.includes("{{"))return t;let S=[],v=!1,k=w,_=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,E=[...w.matchAll(_)];for(let C of E){let O=C[0],B=C[1],F=C[2];if(Ur(F)){v=!0;let W=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(W){let j=W[1];if(S.push({attr:B,expr:j,fullMatch:O,originalAttr:B}),kt(j).forEach((V)=>l.add(V)),B==="text")k=k.replace(O,"");else if(B==="class")k=k.replace(O,'class=""');else if(B==="disabled"||B==="hidden")k=k.replace(O,"");else k=k.replace(O,`${B}=""`)}}}if(!v)return t;let M=k.match(/\bid\s*=\s*"([^"]+)"/),T;if(M)T=M[1];else T=qr(),k=` id="${T}"${k}`;for(let C of S)e.push({elementId:T,attribute:C.attr,expression:C.expr,stores:kt(C.expr)});return`<${p}${k}${b}`}),{html:h,bindings:e,stores:l}}function Kr(r,e){if(r.length===0)return"";let l=Array.from(e),a=`
353
408
  <script>
354
409
  (function() {
355
410
  'use strict';
@@ -369,8 +424,8 @@ else {
369
424
  `;a+=`
370
425
  // Binding update functions
371
426
  function updateBindings() {
372
- `;for(let h of n){let{elementId:r,attribute:p,expression:w}=h,b=w.replace(/\$(\w+)\./g,"$state.$1.");if(p==="text")a+=` (function() {
373
- var el = document.getElementById('${r}');
427
+ `;for(let h of r){let{elementId:t,attribute:p,expression:w}=h,b=w.replace(/\$(\w+)\./g,"$state.$1.");if(p==="text")a+=` (function() {
428
+ var el = document.getElementById('${t}');
374
429
  if (el) {
375
430
  try {
376
431
  el.textContent = ${b};
@@ -379,7 +434,7 @@ catch (e) { console.error('Binding error:', e); }
379
434
  }
380
435
  })();
381
436
  `;else if(p==="html")a+=` (function() {
382
- var el = document.getElementById('${r}');
437
+ var el = document.getElementById('${t}');
383
438
  if (el) {
384
439
  try {
385
440
  el.innerHTML = ${b};
@@ -388,7 +443,7 @@ catch (e) { console.error('Binding error:', e); }
388
443
  }
389
444
  })();
390
445
  `;else if(p==="class")a+=` (function() {
391
- var el = document.getElementById('${r}');
446
+ var el = document.getElementById('${t}');
392
447
  if (el) {
393
448
  try {
394
449
  var value = ${b};
@@ -417,7 +472,7 @@ catch (e) { console.error('Binding error:', e); }
417
472
  }
418
473
  })();
419
474
  `;else if(p==="show")a+=` (function() {
420
- var el = document.getElementById('${r}');
475
+ var el = document.getElementById('${t}');
421
476
  if (el) {
422
477
  try {
423
478
  el.style.display = (${b}) ? '' : 'none';
@@ -426,7 +481,7 @@ catch (e) { console.error('Binding error:', e); }
426
481
  }
427
482
  })();
428
483
  `;else if(p==="if")a+=` (function() {
429
- var el = document.getElementById('${r}');
484
+ var el = document.getElementById('${t}');
430
485
  if (el) {
431
486
  try {
432
487
  el.style.visibility = (${b}) ? 'visible' : 'hidden';
@@ -435,7 +490,7 @@ catch (e) { console.error('Binding error:', e); }
435
490
  }
436
491
  })();
437
492
  `;else a+=` (function() {
438
- var el = document.getElementById('${r}');
493
+ var el = document.getElementById('${t}');
439
494
  if (el) {
440
495
  try {
441
496
  var value = ${b};
@@ -507,10 +562,10 @@ else {
507
562
  }
508
563
  })();
509
564
  </script>
510
- `,a}function wt(n){let{html:e,bindings:l,stores:a}=Br(n);if(l.length===0)return n;let h=Ur(l,a),r=c(e);if(r!==-1)return e.slice(0,r)+h+e.slice(r);return e+h}function qr(n){let e=n.analytics;if(!e?.enabled)return"";switch(e.driver){case"fathom":return Vr(e);case"google-analytics":return Wr(e);case"plausible":return Xr(e);case"self-hosted":return zr(e);case"custom":return Kr(e);default:return""}}function Vr(n){let e=n.fathom;if(!e?.siteId)return"";let l=e.scriptUrl||"https://cdn.usefathom.com/script.js",a=e.defer!==!1?" defer":"",h=[`data-site="${pe(e.siteId)}"`];if(e.honorDnt)h.push('data-honor-dnt="true"');if(e.spa)h.push('data-spa="auto"');if(e.canonical)h.push(`data-canonical="${pe(e.canonical)}"`);if(e.auto===!1)h.push('data-auto="false"');return`
565
+ `,a}function $t(r){let{html:e,bindings:l,stores:a}=Xr(r);if(l.length===0)return r;let h=Kr(l,a),t=c(e);if(t!==-1)return e.slice(0,t)+h+e.slice(t);return e+h}function Jr(r){let e=r.analytics;if(!e?.enabled)return"";switch(e.driver){case"fathom":return Gr(e);case"google-analytics":return Zr(e);case"plausible":return Qr(e);case"self-hosted":return Yr(e);case"custom":return en(e);default:return""}}function Gr(r){let e=r.fathom;if(!e?.siteId)return"";let l=e.scriptUrl||"https://cdn.usefathom.com/script.js",a=e.defer!==!1?" defer":"",h=[`data-site="${ge(e.siteId)}"`];if(e.honorDnt)h.push('data-honor-dnt="true"');if(e.spa)h.push('data-spa="auto"');if(e.canonical)h.push(`data-canonical="${ge(e.canonical)}"`);if(e.auto===!1)h.push('data-auto="false"');return`
511
566
  <!-- Fathom Analytics -->
512
- <script src="${pe(l)}" ${h.join(" ")}${a}></script>
513
- `}function Wr(n){let e=n.googleAnalytics;if(!e?.measurementId)return"";let l=pe(e.measurementId),a=e.debug?`gtag('config', '${l}', { 'debug_mode': true });`:"";return`
567
+ <script src="${ge(l)}" ${h.join(" ")}${a}></script>
568
+ `}function Zr(r){let e=r.googleAnalytics;if(!e?.measurementId)return"";let l=ge(e.measurementId),a=e.debug?`gtag('config', '${l}', { 'debug_mode': true });`:"";return`
514
569
  <!-- Google Analytics -->
515
570
  <script async src="https://www.googletagmanager.com/gtag/js?id=${l}"></script>
516
571
  <script>
@@ -520,10 +575,10 @@ else {
520
575
  gtag('config', '${l}');
521
576
  ${a}
522
577
  </script>
523
- `}function Xr(n){let e=n.plausible;if(!e?.domain)return"";let l=e.scriptUrl||"https://plausible.io/js/script.js",a=[`data-domain="${pe(e.domain)}"`],h=l,r=[];if(e.trackLocalhost)r.push("local");if(e.hashMode)r.push("hash");if(r.length>0&&l==="https://plausible.io/js/script.js")h=`https://plausible.io/js/script.${r.join(".")}.js`;return`
578
+ `}function Qr(r){let e=r.plausible;if(!e?.domain)return"";let l=e.scriptUrl||"https://plausible.io/js/script.js",a=[`data-domain="${ge(e.domain)}"`],h=l,t=[];if(e.trackLocalhost)t.push("local");if(e.hashMode)t.push("hash");if(t.length>0&&l==="https://plausible.io/js/script.js")h=`https://plausible.io/js/script.${t.join(".")}.js`;return`
524
579
  <!-- Plausible Analytics -->
525
- <script defer data-domain="${pe(e.domain)}" src="${pe(h)}"></script>
526
- `}function zr(n){let e=n.selfHosted;if(!e?.siteId||!e?.apiEndpoint)return"";let l=pe(e.siteId),a=pe(e.apiEndpoint),h=e.honorDnt?'if(n.doNotTrack==="1")return;':"",r=e.trackHashChanges?"w.addEventListener('hashchange',pv);":"",p=e.trackOutboundLinks?`
580
+ <script defer data-domain="${ge(e.domain)}" src="${ge(h)}"></script>
581
+ `}function Yr(r){let e=r.selfHosted;if(!e?.siteId||!e?.apiEndpoint)return"";let l=ge(e.siteId),a=ge(e.apiEndpoint),h=e.honorDnt?'if(n.doNotTrack==="1")return;':"",t=e.trackHashChanges?"w.addEventListener('hashchange',pv);":"",p=e.trackOutboundLinks?`
527
582
  d.addEventListener('click',function(e){
528
583
  var a=e.target.closest('a');
529
584
  if(a&&a.hostname!==location.hostname){
@@ -549,39 +604,39 @@ else {
549
604
  }));
550
605
  }
551
606
  function pv(){t('pageview');}
552
- ${r}
607
+ ${t}
553
608
  ${p}
554
609
  if(d.readyState==='complete')pv();
555
610
  else w.addEventListener('load',pv);
556
611
  w.stxAnalytics={track:function(n,v){t('event',{name:n,value:v});}};
557
612
  })();
558
613
  </script>
559
- `}function Kr(n){let e=n.custom;if(!e)return"";if(e.inlineScript)return`
614
+ `}function en(r){let e=r.custom;if(!e)return"";if(e.inlineScript)return`
560
615
  <!-- Custom Analytics -->
561
616
  <script>
562
617
  ${e.inlineScript}
563
618
  </script>
564
- `;if(!e.scriptUrl)return"";let l=[];if(e.scriptId)l.push(`id="${pe(e.scriptId)}"`);if(e.attributes)for(let[h,r]of Object.entries(e.attributes))l.push(`${pe(h)}="${pe(r)}"`);return`
619
+ `;if(!e.scriptUrl)return"";let l=[];if(e.scriptId)l.push(`id="${ge(e.scriptId)}"`);if(e.attributes)for(let[h,t]of Object.entries(e.attributes))l.push(`${ge(h)}="${ge(t)}"`);return`
565
620
  <!-- Custom Analytics -->
566
- <script${l.length>0?` ${l.join(" ")}`:""} src="${pe(e.scriptUrl)}" defer></script>
567
- `}function vt(n,e){let l=qr(e);if(!l)return n;if(!n.includes("</head>")){let a=c(n);if(a!==-1)return n.slice(0,a)+l+n.slice(a);return n+l}return f(n,l,"")}function pe(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kt(n){let e=n.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function xt(n){let e=n?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Gr from"fs";import et from"path";import{createHighlighter as Zr}from"ts-syntax-highlighter";var tt=new Map;async function Me(n,e={}){try{if(!await s(n))throw Error(`Markdown file not found: ${n}`);let a=(await Gr.promises.stat(n)).mtime.getTime();if(e.cache&&tt.has(n)){let k=tt.get(n);if(k.updatedAt>=a)return{content:k.content,data:k.data}}let h=await Bun.file(n).text(),{data:r,content:p}=wr(h),w=e.markdown||M.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},S=ot(p,{gfm:!0});if(w.syntaxHighlighting?.enabled&&w.syntaxHighlighting?.serverSide)S=await Jr(S,w.syntaxHighlighting?.defaultTheme||"github-dark",w.syntaxHighlighting?.highlightUnknownLanguages||!1);let v={content:S,data:r||{}};if(e.cache)tt.set(n,{...v,updatedAt:a});return v}catch(l){if(e.debug)console.error(`Error reading/parsing markdown file ${n}:`,l);let a=l instanceof Error?l.message:String(l);return{content:y("Markdown File",`Error reading/parsing markdown file: ${a}`,n,"",0,""),data:{}}}}var Xe=null;async function Jr(n,e,l){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Xe)try{Xe=await Zr({theme:e||"github-dark",cache:!0})}catch(w){return console.error("Failed to initialize ts-syntax-highlighter:",w),n}let h=async(w,b,S,v)=>{let k=v.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),C=S||(l?"text":"");if(!C)return w;try{if(!Xe.getSupportedLanguages().includes(C))return w;return(await Xe.highlight(k,C,{theme:e})).html}catch(_){console.error(`Error highlighting code block with language ${S}:`,_)}return w},r=n,p=n.matchAll(a);for(let w of p){let[b,S,v,k]=w,C=await h(b,S,v,k);r=r.replace(b,C)}return r}async function St(n,e,l="",a={}){return await Qr(n,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(p,w,b,S)=>{try{let v=w;if(!et.isAbsolute(w))v=et.resolve(et.dirname(l),w);let k={};if(b)try{try{k=JSON.parse(b)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let B=b.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let F of B){let q=F.indexOf(":");if(q>0){let H=F.substring(0,q).trim(),N=F.substring(q+1).trim(),U=N.startsWith('"')&&N.endsWith('"'),G=N.startsWith("'")&&N.endsWith("'");if(U||G)N=N.substring(1,N.length-1);k[H]=N}}}}catch(j){if(a.debug)console.error("Error parsing context in @markdown-file directive:",j)}let{content:C,data:_}=await Me(v,a),P={...e,..._,...k},I=C,L=/\{\{([^}]+)\}\}/g;return I=I.replace(L,(j,B)=>{let F=B.trim();return P[F]!==void 0?String(P[F]):j}),I}catch(v){let k=v instanceof Error?v.message:String(v);return y("Markdown File",`Error including markdown file: ${k}`,l,n,S,p)}})}async function Qr(n,e,l){let a=[],h;while((h=e.exec(n))!==null){let w=h[0],b=h.index,S=h;a.push(l(...S).then((v)=>({match:w,replacement:v,index:b})))}let r=await Promise.all(a);r.sort((w,b)=>b.index-w.index);let p=n;for(let{match:w,replacement:b}of r)p=p.replace(w,()=>b);return p}var $t=new WeakMap;function Et(n=16){let e=new Uint8Array(n);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function Ke(n,e){if(!n)return e?.nonceGenerator?.()??Et();let l=$t.get(n);if(!l)l=e?.nonceGenerator?.()??Et(),$t.set(n,l);return l}function Yr(n,e){let l=[];for(let[a,h]of Object.entries(n)){if(h===void 0||h===null)continue;if(typeof h==="boolean"){if(h)l.push(a);continue}if(Array.isArray(h)){let r=[...h];if(e&&(a==="script-src"||a==="style-src"))r=r.filter((p)=>!p.startsWith("'nonce-")),r.push(`'nonce-${e}'`);if(r.length>0)l.push(`${a} ${r.join(" ")}`)}}return l.join("; ")}function Ct(n,e){return`<meta http-equiv="Content-Security-Policy" content="${Yr(n,e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}function _t(n,e,l){if(!e.enabled||!e.addMetaTag)return n;if(n.includes('http-equiv="Content-Security-Policy"'))return n;if(!n.includes("<head>")&&!n.includes("<head "))return n;let a=e.useNonce?Ke(l,e):void 0,h=Ct(e.directives,a);return n.replace(/<head([^>]*)>/,`<head$1>
568
- ${h}`)}function Tt(n,e){let l=n;return l=l.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<script nonce="${e}"${h}>`}),l=l.replace(/<style([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<style nonce="${e}"${h}>`}),l}function At(n,e,l,a){let h=n,r=a.csp;if(h=h.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let p=r.useNonce?Ke(e,r):void 0;return Ct(r.directives,p)}),h=h.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return Ke(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=Ke(e,r);return h}import en from"crypto";var tn=40,Rt="_token",nt=null;function rn(n=tn){let e=en.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return nt=e,e}function nn(){if(!nt)rn();return nt}function sn(n=Rt){let e=nn();return`<input type="hidden" name="${n}" value="${e}">`}function Mt(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,l,a)=>sn(a||Rt))}async function Dt(n,e,l,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let h=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)h=await on(h,r,e,l,a);else h=await an(h,r,e,l,a)}return h}async function on(n,e,l,a,h){let{name:r,handler:p}=e,w=`@${r}`,b=`@end${r}`,S=n,v=Vt(`${w}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${b}`,"g"),k=[],C=v.exec(S);while(C!==null){let[_,P="",I=""]=C,L=C.index||0;try{let j=P?It(e,P):[],B=I.trim(),F=await p(B,j,l,a);k.push({original:_,processed:F,startIndex:L})}catch(j){let B=j instanceof Error?j.message:String(j);if(h.debug)console.error(`Error processing custom directive @${r}:`,j);k.push({original:_,processed:u("CustomDirective",`Error in @${r}${P?`(${P})`:""}: ${B}`,t.EVALUATION_ERROR),startIndex:L})}C=v.exec(S)}for(let _=k.length-1;_>=0;_--){let{original:P,processed:I}=k[_];S=S.replace(P,I)}return S}async function an(n,e,l,a,h){let{name:r,handler:p}=e,w=n,b=[],S=[];if(e.rawParams){for(let C of Fi(w,Vt(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(C.end!==-1)S.push({fullMatch:C.call,paramString:C.args,startIndex:C.start})}else{let C=Vt(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");C.lastIndex=0;let _=C.exec(w);while(_!==null)S.push({fullMatch:_[0],paramString:_[1]??"",startIndex:_.index||0}),_=C.exec(w)}for(let{fullMatch:C,paramString:_,startIndex:P}of S)try{let I=It(e,_),L=await p("",I,l,a);b.push({original:C,processed:L,startIndex:P})}catch(I){let L=I instanceof Error?I.message:String(I);if(h.debug)console.error(`Error processing custom directive @${r}:`,I);b.push({original:C,processed:u("CustomDirective",`Error in @${r}(${_}): ${L}`,t.EVALUATION_ERROR),startIndex:P})}let v=Vt(`@${r}(?!\\w)(?!\\s*\\()`,"g"),k=v.exec(w);while(k!==null){let[C]=k,_=k.index||0;try{let P=await p("",[],l,a);b.push({original:C,processed:P,startIndex:_})}catch(P){let I=P instanceof Error?P.message:String(P);if(h.debug)console.error(`Error processing custom directive @${r}:`,P);b.push({original:C,processed:u("CustomDirective",`Error in @${r}: ${I}`,t.EVALUATION_ERROR),startIndex:_})}k=v.exec(w)}for(let C=b.length-1;C>=0;C--){let{original:_,processed:P}=b[C];w=w.replace(_,P)}return w}function It(n,e){return n.rawParams?qt(e):cn(e)}function cn(n){if(!n.trim())return[];let e=[],l="",a=!1,h="";for(let r=0;r<n.length;r++){let p=n[r];if((p==='"'||p==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,h=p;else if(p===h)a=!1;else l+=p;else if(p===","&&!a)e.push(l.trim()),l="";else l+=p}if(l.trim())e.push(l.trim());return e.map((r)=>{let p=r.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Ot=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Pt=/^[A-Za-z_$][\w$]*$/,ln=new Set(["light","dark","system"]);function $e(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function un(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:l,colorMode:a}=e;if($e(e.storageKey,"storageKey"),l!==void 0&&(!l||typeof l!=="object"||Array.isArray(l)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if($e(a.key,"colorMode.key"),$e(a.attribute,"colorMode.attribute"),$e(a.default,"colorMode.default"),!Pt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ot.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!ln.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let h=null;if(l){if($e(l.key,"appearance.key"),$e(l.attribute,"appearance.attribute"),$e(l.default,"appearance.default"),!Pt.test(l.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ot.test(l.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(l.allowed)||l.allowed.length===0||l.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!l.allowed.includes(l.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");h={key:l.key,attribute:l.attribute,allowed:[...new Set(l.allowed)],default:l.default}}return{storageKey:e.storageKey,appearance:h,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function dn(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function pn(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${dn(n)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function fn(n,e){let l=1,a=null,h=!1;for(let r=e+1;r<n.length;r++){let p=n[r];if(h){h=!1;continue}if(a){if(p==="\\")h=!0;else if(p===a)a=null;continue}if(p==='"'||p==="'"||p==="`"){a=p;continue}if(p==="(")l++;else if(p===")"&&--l===0)return r}return-1}function jt(n,e){let l=n,a=/@appearanceBootstrap\s*\(/g,h;while((h=a.exec(l))!==null){let r=h.index+h[0].length-1,p=fn(l,r);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let w=l.slice(r+1,p).trim(),b=d(`(${w})`,e),S=pn(un(b));l=l.slice(0,h.index)+S+l.slice(p+1),a.lastIndex=h.index+S.length}return l}import gn from"crypto";function te(n){return X(String(n??""))}var Bt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ge(n,e,l,a){let h=n||e;return l?`${h} ${a}`:h}function he(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Ie(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${te(e)}"`}function st(n,e,l){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(l))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(l))a+=` aria-describedby="${te(`${he(n)}-error`)}"`;return a}function mn(){return gn.randomUUID()}function Ze(n,e){let l=n;return l=l.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=mn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${te(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),l=l.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,h)=>{let r=h.toUpperCase();if(h&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${te(r)}">`;return a}),l}function Ft(n,e,l=Bt){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(h,r,p,w,b,S="")=>{let v=r||p||"POST",k=w||b||"",C=xe(S),_=v.toUpperCase(),P=["GET","POST"].includes(_)?_:"POST",I=`<form method="${te(P)}" action="${te(k)}"${C?` ${C}`:""}>`;if(I+=`
569
- ${Ze("@csrf",e)}`,!["GET","POST"].includes(_))I+=`
570
- ${Ze(`@method('${_}')`,e)}`;return I}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(h,r,p,w,b,S="")=>{let v=r||p||"",k=w||b||"",C=xe(S),_=Ne(v,e),P=_!==void 0&&_!==null?_:k||"",I=C.match(/type=['"]([^'"]+)['"]/i),L=I?I[1]:"text",j=Be(v,e),B=C.match(/class=['"]([^'"]+)['"]/i),F=Ge(B?B[1]:"",l.input,j,l.inputError),q=C.replace(/class=['"][^'"]+['"]/i,"");return q=q.replace(/type=['"][^'"]+['"]/i,""),`<input type="${te(L)}" name="${te(v)}"${Ie(C,he(v))} value="${te(P)}" class="${F}"${st(v,j,C)}${q?` ${q}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(h,r,p="",w="")=>{let b=xe(p),S=Ne(r,e)||w.trim(),v=Be(r,e),k=b.match(/class=['"]([^'"]+)['"]/i),C=Ge(k?k[1]:"",l.input,v,l.inputError),_=b.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${te(r)}"${Ie(b,he(r))} class="${C}"${st(r,v,b)}${_?` ${_}`:""}>${te(S)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(h,r,p="",w)=>{let b=xe(p),S=Ne(r,e),v=Be(r,e),k=b.match(/class=['"]([^'"]+)['"]/i),C=Ge(k?k[1]:"",l.input,v,l.inputError),_=b.replace(/class=['"][^'"]+['"]/i,""),P=w;if(S!==void 0)P=w.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(I,L,j)=>{if((Array.isArray(S)?S.some((F)=>String(F)===j):String(S)===j)&&!L.includes("selected"))return L.replace(/(<option)/,"$1 selected");return I});return`<select name="${te(r)}"${Ie(b,he(r))} class="${C}"${st(r,v,b)}${_?` ${_}`:""}>${P}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(h,r,p,w="")=>{let b=p===void 0?"1":p,S=p===void 0?he(r):`${he(r)}-${he(b)}`,v=xe(w),k=Ne(r,e),C=k!==void 0&&(Array.isArray(k)?k.some((L)=>String(L)===b):k===!0||String(k)===b),_=v.match(/class=['"]([^'"]+)['"]/i),P=_?_[1]:l.checkInput,I=v.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${te(r)}"${Ie(v,S)} value="${te(b)}" class="${P}"${C?" checked":""}${I?` ${I}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(h,r,p,w="")=>{let b=xe(w),S=Ne(r,e),v=S!==void 0&&S===p,k=b.match(/class=['"]([^'"]+)['"]/i),C=k?k[1]:l.checkInput,_=b.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${te(r)}"${Ie(b,`${he(r)}-${he(p)}`)} value="${te(p)}" class="${C}"${v?" checked":""}${_?` ${_}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(h,r,p="")=>{let w=xe(p),b=w.match(/accept=['"]([^'"]+)['"]/i),S=b?b[1]:"",v=w.includes("multiple"),k=Be(r,e),C=w.match(/class=['"]([^'"]+)['"]/i),_=Ge(C?C[1]:"",l.input,k,l.inputError),P=w.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),I=[`<input type="file" name="${te(r)}"${Ie(w,he(r))}`,`class="${_}"`];if(S)I.push(`accept="${te(S)}"`);if(v)I.push("multiple");if(P)I.push(P);return`${I.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(h,r,p="",w)=>{let b=xe(p),S=b.match(/class=['"]([^'"]+)['"]/i),v=S?S[1]:l.label,k=b.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${te(he(r))}" class="${v}"${k?` ${k}`:""}>${w}</label>`}),a}function Ut(n,e,l=Bt){return n.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,h,r)=>{try{if(Be(h,e)){let p=r.replace(/\{\{([^}]+)\}\}/g,(w,b,S)=>{let v=(k)=>re(r,S,String(k??""),!1,w.length);try{if(b.trim()==="$message"||b.trim()==="message")return v(Nt(h,e));if(b.trim().includes("errors.first")||b.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return v(e.errors.first(h));return v(Nt(h,e))}let k=b.trim();if(m(k)){let C=d(k,e);return C!==void 0?v(C):k}return k}catch{return b}});return`<div id="${te(`${he(h)}-error`)}" role="alert">${p}</div>`}return""}catch(p){return console.error("Error processing @error directive:",p),a}})}function Be(n,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(n);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,n);return!1}function Nt(n,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(n);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,n)){let l=e.errors[n];return Array.isArray(l)?l[0]:String(l)}return""}function Ne(n,e){let l;if(e.old&&typeof e.old==="function")return e.old(n);if(e.old&&typeof e.old==="object")return e.old[n];if(n.endsWith("[]")){let a=n.slice(0,-2);if(l=e[a],l!==void 0)return l}return e[n]}function xe(n){if(!n.trim())return"";let e=[],l=n.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,h;while((h=a.exec(l))!==null){let[,r,,p]=h;e.push(`${r}="${p.trim()}"`)}return e.join(" ")}import*as it from"path";async function Wt(n,e,l=""){if(it.basename(l)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,n.replace(/@js[\s\S]*?@endjs/g,"");return zt(n,e,l,"@js","@endjs")}async function Xt(n,e,l=""){if(it.basename(l)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((r)=>({...r,displayName:`User ${r.id}: ${r.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return n.replace(/@ts[\s\S]*?@endts/g,"")}return zt(n,e,l,"@ts","@endts")}async function zt(n,e,l,a,h){let r=n,p=Vt(`${a}([\\s\\S]*?)${h}`,"g"),w=[],b;while((b=p.exec(n))!==null)w.push({fullMatch:b[0],content:b[1]||"",index:b.index});for(let{fullMatch:S,content:v,index:k}of w)try{let C={...e,global:e},_=Object.keys(C),P=Object.values(C),I=v.trim();if(a==="@ts")I=I.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let j=(I.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((N)=>N.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),B=j.length>0?`return { ${j.join(", ")} };`:"return {};",F=`
571
- ${I}
621
+ <script${l.length>0?` ${l.join(" ")}`:""} src="${ge(e.scriptUrl)}" defer></script>
622
+ `}function Et(r,e){let l=Jr(e);if(!l)return r;if(!r.includes("</head>")){let a=c(r);if(a!==-1)return r.slice(0,a)+l+r.slice(a);return r+l}return f(r,l,"")}function ge(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Rt(r){let e=r.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function Tt(r){let e=r?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import tn from"fs";import it from"path";import{createHighlighter as rn}from"ts-syntax-highlighter";var ot=new Map;async function ze(r,e={}){try{if(!await s(r))throw Error(`Markdown file not found: ${r}`);let a=(await tn.promises.stat(r)).mtime.getTime();if(e.cache&&ot.has(r)){let k=ot.get(r);if(k.updatedAt>=a)return{content:k.content,data:k.data}}let h=await Bun.file(r).text(),{data:t,content:p}=_r(h),w=e.markdown||L.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},S=ut(p,{gfm:!0});if(w.syntaxHighlighting?.enabled&&w.syntaxHighlighting?.serverSide)S=await nn(S,w.syntaxHighlighting?.defaultTheme||"github-dark",w.syntaxHighlighting?.highlightUnknownLanguages||!1);let v={content:S,data:t||{}};if(e.cache)ot.set(r,{...v,updatedAt:a});return v}catch(l){if(e.debug)console.error(`Error reading/parsing markdown file ${r}:`,l);let a=l instanceof Error?l.message:String(l);return{content:y("Markdown File",`Error reading/parsing markdown file: ${a}`,r,"",0,""),data:{}}}}var Ze=null;async function nn(r,e,l){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Ze)try{Ze=await rn({theme:e||"github-dark",cache:!0})}catch(w){return console.error("Failed to initialize ts-syntax-highlighter:",w),r}let h=async(w,b,S,v)=>{let k=v.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),_=S||(l?"text":"");if(!_)return w;try{if(!Ze.getSupportedLanguages().includes(_))return w;return(await Ze.highlight(k,_,{theme:e})).html}catch(E){console.error(`Error highlighting code block with language ${S}:`,E)}return w},t=r,p=r.matchAll(a);for(let w of p){let[b,S,v,k]=w,_=await h(b,S,v,k);t=t.replace(b,_)}return t}async function Ct(r,e,l="",a={}){return await sn(r,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(p,w,b,S)=>{try{let v=w;if(!it.isAbsolute(w))v=it.resolve(it.dirname(l),w);let k={};if(b)try{try{k=JSON.parse(b)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let B=b.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let F of B){let W=F.indexOf(":");if(W>0){let j=F.substring(0,W).trim(),H=F.substring(W+1).trim(),V=H.startsWith('"')&&H.endsWith('"'),K=H.startsWith("'")&&H.endsWith("'");if(V||K)H=H.substring(1,H.length-1);k[j]=H}}}}catch(O){if(a.debug)console.error("Error parsing context in @markdown-file directive:",O)}let{content:_,data:E}=await ze(v,a),M={...e,...E,...k},T=_,C=/\{\{([^}]+)\}\}/g;return T=T.replace(C,(O,B)=>{let F=B.trim();return M[F]!==void 0?String(M[F]):O}),T}catch(v){let k=v instanceof Error?v.message:String(v);return y("Markdown File",`Error including markdown file: ${k}`,l,r,S,p)}})}async function sn(r,e,l){let a=[],h;while((h=e.exec(r))!==null){let w=h[0],b=h.index,S=h;a.push(l(...S).then((v)=>({match:w,replacement:v,index:b})))}let t=await Promise.all(a);t.sort((w,b)=>b.index-w.index);let p=r;for(let{match:w,replacement:b}of t)p=p.replace(w,()=>b);return p}var At=new WeakMap;function Mt(r=16){let e=new Uint8Array(r);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function Qe(r,e){if(!r)return e?.nonceGenerator?.()??Mt();let l=At.get(r);if(!l)l=e?.nonceGenerator?.()??Mt(),At.set(r,l);return l}function on(r,e){let l=[];for(let[a,h]of Object.entries(r)){if(h===void 0||h===null)continue;if(typeof h==="boolean"){if(h)l.push(a);continue}if(Array.isArray(h)){let t=[...h];if(e&&(a==="script-src"||a==="style-src"))t=t.filter((p)=>!p.startsWith("'nonce-")),t.push(`'nonce-${e}'`);if(t.length>0)l.push(`${a} ${t.join(" ")}`)}}return l.join("; ")}function Dt(r,e){return`<meta http-equiv="Content-Security-Policy" content="${on(r,e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}function It(r,e,l){if(!e.enabled||!e.addMetaTag)return r;if(r.includes('http-equiv="Content-Security-Policy"'))return r;if(!r.includes("<head>")&&!r.includes("<head "))return r;let a=e.useNonce?Qe(l,e):void 0,h=Dt(e.directives,a);return r.replace(/<head([^>]*)>/,`<head$1>
623
+ ${h}`)}function Ot(r,e){let l=r;return l=l.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<script nonce="${e}"${h}>`}),l=l.replace(/<style([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<style nonce="${e}"${h}>`}),l}function Lt(r,e,l,a){let h=r,t=a.csp;if(h=h.replace(/@csp\b/g,()=>{if(!t?.enabled||!t.directives)return"<!-- CSP not configured -->";let p=t.useNonce?Qe(e,t):void 0;return Dt(t.directives,p)}),h=h.replace(/@cspNonce\b/g,()=>{if(!t?.enabled||!t.useNonce)return"";return Qe(e,t)}),t?.enabled&&t.useNonce)e.cspNonce=Qe(e,t);return h}import an from"crypto";var cn=40,Pt="_token",at=null;function ln(r=cn){let e=an.randomBytes(Math.ceil(r/2)).toString("hex").slice(0,r);return at=e,e}function un(){if(!at)ln();return at}function dn(r=Pt){let e=un();return`<input type="hidden" name="${r}" value="${e}">`}function jt(r){return r.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,l,a)=>dn(a||Pt))}async function Nt(r,e,l,a){if(!a.customDirectives||a.customDirectives.length===0)return r;let h=r;for(let t of a.customDirectives){if(!t.name||typeof t.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",t);continue}if(t.hasEndTag)h=await pn(h,t,e,l,a);else h=await fn(h,t,e,l,a)}return h}async function pn(r,e,l,a,h){let{name:t,handler:p}=e,w=`@${t}`,b=`@end${t}`,S=r,v=Qt(`${w}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${b}`,"g"),k=[],_=v.exec(S);while(_!==null){let[E,M="",T=""]=_,C=_.index||0;try{let O=M?Ht(e,M):[],B=T.trim(),F=await p(B,O,l,a);k.push({original:E,processed:F,startIndex:C})}catch(O){let B=O instanceof Error?O.message:String(O);if(h.debug)console.error(`Error processing custom directive @${t}:`,O);k.push({original:E,processed:u("CustomDirective",`Error in @${t}${M?`(${M})`:""}: ${B}`,n.EVALUATION_ERROR),startIndex:C})}_=v.exec(S)}for(let E=k.length-1;E>=0;E--){let{original:M,processed:T}=k[E];S=S.replace(M,T)}return S}async function fn(r,e,l,a,h){let{name:t,handler:p}=e,w=r,b=[],S=[];if(e.rawParams){for(let _ of Ki(w,Qt(`(?<![\\w$@])@${t}\\s*\\(`,"g")))if(_.end!==-1)S.push({fullMatch:_.call,paramString:_.args,startIndex:_.start})}else{let _=Qt(`@${t}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");_.lastIndex=0;let E=_.exec(w);while(E!==null)S.push({fullMatch:E[0],paramString:E[1]??"",startIndex:E.index||0}),E=_.exec(w)}for(let{fullMatch:_,paramString:E,startIndex:M}of S)try{let T=Ht(e,E),C=await p("",T,l,a);b.push({original:_,processed:C,startIndex:M})}catch(T){let C=T instanceof Error?T.message:String(T);if(h.debug)console.error(`Error processing custom directive @${t}:`,T);b.push({original:_,processed:u("CustomDirective",`Error in @${t}(${E}): ${C}`,n.EVALUATION_ERROR),startIndex:M})}let v=Qt(`@${t}(?!\\w)(?!\\s*\\()`,"g"),k=v.exec(w);while(k!==null){let[_]=k,E=k.index||0;try{let M=await p("",[],l,a);b.push({original:_,processed:M,startIndex:E})}catch(M){let T=M instanceof Error?M.message:String(M);if(h.debug)console.error(`Error processing custom directive @${t}:`,M);b.push({original:_,processed:u("CustomDirective",`Error in @${t}: ${T}`,n.EVALUATION_ERROR),startIndex:E})}k=v.exec(w)}for(let _=b.length-1;_>=0;_--){let{original:E,processed:M}=b[_];w=w.replace(E,M)}return w}function Ht(r,e){return r.rawParams?Yt(e):gn(e)}function gn(r){if(!r.trim())return[];let e=[],l="",a=!1,h="";for(let t=0;t<r.length;t++){let p=r[t];if((p==='"'||p==="'")&&(t===0||r[t-1]!=="\\"))if(!a)a=!0,h=p;else if(p===h)a=!1;else l+=p;else if(p===","&&!a)e.push(l.trim()),l="";else l+=p}if(l.trim())e.push(l.trim());return e.map((t)=>{let p=t.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Bt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Ft=/^[A-Za-z_$][\w$]*$/,mn=new Set(["light","dark","system"]);function Ee(r,e){if(typeof r!=="string"||r.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function hn(r){if(!r||typeof r!=="object"||Array.isArray(r))throw Error("@appearanceBootstrap expects an options object");let e=r,{appearance:l,colorMode:a}=e;if(Ee(e.storageKey,"storageKey"),l!==void 0&&(!l||typeof l!=="object"||Array.isArray(l)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if(Ee(a.key,"colorMode.key"),Ee(a.attribute,"colorMode.attribute"),Ee(a.default,"colorMode.default"),!Ft.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Bt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!mn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let h=null;if(l){if(Ee(l.key,"appearance.key"),Ee(l.attribute,"appearance.attribute"),Ee(l.default,"appearance.default"),!Ft.test(l.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Bt.test(l.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(l.allowed)||l.allowed.length===0||l.allowed.some((t)=>typeof t!=="string"||t.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!l.allowed.includes(l.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");h={key:l.key,attribute:l.attribute,allowed:[...new Set(l.allowed)],default:l.default}}return{storageKey:e.storageKey,appearance:h,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function yn(r){return JSON.stringify(r).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function bn(r){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${yn(r)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function wn(r,e){let l=1,a=null,h=!1;for(let t=e+1;t<r.length;t++){let p=r[t];if(h){h=!1;continue}if(a){if(p==="\\")h=!0;else if(p===a)a=null;continue}if(p==='"'||p==="'"||p==="`"){a=p;continue}if(p==="(")l++;else if(p===")"&&--l===0)return t}return-1}function qt(r,e){let l=r,a=/@appearanceBootstrap\s*\(/g,h;while((h=a.exec(l))!==null){let t=h.index+h[0].length-1,p=wn(l,t);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let w=l.slice(t+1,p).trim(),b=d(`(${w})`,e),S=bn(hn(b));l=l.slice(0,h.index)+S+l.slice(p+1),a.lastIndex=h.index+S.length}return l}import vn from"crypto";function ne(r){return Y(String(r??""))}var Vt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ye(r,e,l,a){let h=r||e;return l?`${h} ${a}`:h}function be(r){return String(r).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Ie(r,e){if(/\bid\s*=/i.test(r))return"";return` id="${ne(e)}"`}function lt(r,e,l){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(l))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(l))a+=` aria-describedby="${ne(`${be(r)}-error`)}"`;return a}function xn(){return vn.randomUUID()}function et(r,e){let l=r;return l=l.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=xn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${ne(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),l=l.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,h)=>{let t=h.toUpperCase();if(h&&!["GET","POST"].includes(t))return`<input type="hidden" name="_method" value="${ne(t)}">`;return a}),l}function Wt(r,e,l=Vt){let a=r;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(h,t,p,w,b,S="")=>{let v=t||p||"POST",k=w||b||"",_=ke(S),E=v.toUpperCase(),M=["GET","POST"].includes(E)?E:"POST",T=`<form method="${ne(M)}" action="${ne(k)}"${_?` ${_}`:""}>`;if(T+=`
624
+ ${et("@csrf",e)}`,!["GET","POST"].includes(E))T+=`
625
+ ${et(`@method('${E}')`,e)}`;return T}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(h,t,p,w,b,S="")=>{let v=t||p||"",k=w||b||"",_=ke(S),E=Be(v,e),M=E!==void 0&&E!==null?E:k||"",T=_.match(/type=['"]([^'"]+)['"]/i),C=T?T[1]:"text",O=Fe(v,e),B=_.match(/class=['"]([^'"]+)['"]/i),F=Ye(B?B[1]:"",l.input,O,l.inputError),W=_.replace(/class=['"][^'"]+['"]/i,"");return W=W.replace(/type=['"][^'"]+['"]/i,""),`<input type="${ne(C)}" name="${ne(v)}"${Ie(_,be(v))} value="${ne(M)}" class="${F}"${lt(v,O,_)}${W?` ${W}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(h,t,p="",w="")=>{let b=ke(p),S=Be(t,e)||w.trim(),v=Fe(t,e),k=b.match(/class=['"]([^'"]+)['"]/i),_=Ye(k?k[1]:"",l.input,v,l.inputError),E=b.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${ne(t)}"${Ie(b,be(t))} class="${_}"${lt(t,v,b)}${E?` ${E}`:""}>${ne(S)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(h,t,p="",w)=>{let b=ke(p),S=Be(t,e),v=Fe(t,e),k=b.match(/class=['"]([^'"]+)['"]/i),_=Ye(k?k[1]:"",l.input,v,l.inputError),E=b.replace(/class=['"][^'"]+['"]/i,""),M=w;if(S!==void 0)M=w.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(T,C,O)=>{if((Array.isArray(S)?S.some((F)=>String(F)===O):String(S)===O)&&!C.includes("selected"))return C.replace(/(<option)/,"$1 selected");return T});return`<select name="${ne(t)}"${Ie(b,be(t))} class="${_}"${lt(t,v,b)}${E?` ${E}`:""}>${M}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(h,t,p,w="")=>{let b=p===void 0?"1":p,S=p===void 0?be(t):`${be(t)}-${be(b)}`,v=ke(w),k=Be(t,e),_=k!==void 0&&(Array.isArray(k)?k.some((C)=>String(C)===b):k===!0||String(k)===b),E=v.match(/class=['"]([^'"]+)['"]/i),M=E?E[1]:l.checkInput,T=v.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${ne(t)}"${Ie(v,S)} value="${ne(b)}" class="${M}"${_?" checked":""}${T?` ${T}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(h,t,p,w="")=>{let b=ke(w),S=Be(t,e),v=S!==void 0&&S===p,k=b.match(/class=['"]([^'"]+)['"]/i),_=k?k[1]:l.checkInput,E=b.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${ne(t)}"${Ie(b,`${be(t)}-${be(p)}`)} value="${ne(p)}" class="${_}"${v?" checked":""}${E?` ${E}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(h,t,p="")=>{let w=ke(p),b=w.match(/accept=['"]([^'"]+)['"]/i),S=b?b[1]:"",v=w.includes("multiple"),k=Fe(t,e),_=w.match(/class=['"]([^'"]+)['"]/i),E=Ye(_?_[1]:"",l.input,k,l.inputError),M=w.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),T=[`<input type="file" name="${ne(t)}"${Ie(w,be(t))}`,`class="${E}"`];if(S)T.push(`accept="${ne(S)}"`);if(v)T.push("multiple");if(M)T.push(M);return`${T.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(h,t,p="",w)=>{let b=ke(p),S=b.match(/class=['"]([^'"]+)['"]/i),v=S?S[1]:l.label,k=b.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${ne(be(t))}" class="${v}"${k?` ${k}`:""}>${w}</label>`}),a}function Xt(r,e,l=Vt){return r.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,h,t)=>{try{if(Fe(h,e)){let p=t.replace(/\{\{([^}]+)\}\}/g,(w,b,S)=>{let v=(k)=>ie(t,S,String(k??""),!1,w.length);try{if(b.trim()==="$message"||b.trim()==="message")return v(Ut(h,e));if(b.trim().includes("errors.first")||b.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return v(e.errors.first(h));return v(Ut(h,e))}let k=b.trim();if(m(k)){let _=d(k,e);return _!==void 0?v(_):k}return k}catch{return b}});return`<div id="${ne(`${be(h)}-error`)}" role="alert">${p}</div>`}return""}catch(p){return console.error("Error processing @error directive:",p),a}})}function Fe(r,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(r);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,r);return!1}function Ut(r,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(r);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,r)){let l=e.errors[r];return Array.isArray(l)?l[0]:String(l)}return""}function Be(r,e){let l;if(e.old&&typeof e.old==="function")return e.old(r);if(e.old&&typeof e.old==="object")return e.old[r];if(r.endsWith("[]")){let a=r.slice(0,-2);if(l=e[a],l!==void 0)return l}return e[r]}function ke(r){if(!r.trim())return"";let e=[],l=r.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,h;while((h=a.exec(l))!==null){let[,t,,p]=h;e.push(`${t}="${p.trim()}"`)}return e.join(" ")}import*as dt from"path";async function zt(r,e,l=""){if(dt.basename(l)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,r.replace(/@js[\s\S]*?@endjs/g,"");return Jt(r,e,l,"@js","@endjs")}async function Kt(r,e,l=""){if(dt.basename(l)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((t)=>({...t,displayName:`User ${t.id}: ${t.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return r.replace(/@ts[\s\S]*?@endts/g,"")}return Jt(r,e,l,"@ts","@endts")}async function Jt(r,e,l,a,h){let t=r,p=Qt(`${a}([\\s\\S]*?)${h}`,"g"),w=[],b;while((b=p.exec(r))!==null)w.push({fullMatch:b[0],content:b[1]||"",index:b.index});for(let{fullMatch:S,content:v,index:k}of w)try{let _={...e,global:e},E=Object.keys(_),M=Object.values(_),T=v.trim();if(a==="@ts")T=T.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let O=(T.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((H)=>H.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),B=O.length>0?`return { ${O.join(", ")} };`:"return {};",F=`
626
+ ${T}
572
627
  ${B}
573
- `,H=Function(..._,F)(...P);if(H&&typeof H==="object")Object.assign(e,H);r=r.replace(S,"")}catch(C){console.error(`Error executing ${a} code block in ${l}:`,C);let _=C instanceof Error?C.message:String(C),P=y(`${a} Directive`,`Error executing code: ${_}`,l,n,k,S);console.error(P),r=r.replace(S,"")}return r}function hn(n,e="_method"){let l=n.toUpperCase();if(l==="GET"||l==="POST")return"";return`<input type="hidden" name="${e}" value="${l}">`}function Kt(n){return n.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,l,a,h,r)=>hn(a,r||"_method"))}async function Gt(n,e,l,a,h){if(!a.middleware||a.middleware.length===0)return n;let r=n,p=a.middleware.filter((w)=>w.timing===h);if(p.length===0)return r;for(let w of p){if(!w.name||typeof w.handler!=="function"){if(a.debug)console.warn("Invalid middleware:",w);continue}try{let b=await w.handler(r,e,l,a);if(typeof b==="string")r=b;else if(a.debug)console.warn(`Middleware ${w.name} did not return a string`)}catch(b){if(a.debug)console.error(`Error in middleware ${w.name}:`,b);if(a.debug){let S=y("Middleware",`Error in middleware '${w.name}': ${b instanceof Error?b.message:String(b)}`,l,n);r=r.replace(/<body[^>]*>/,`$&
628
+ `,j=Function(...E,F)(...M);if(j&&typeof j==="object")Object.assign(e,j);t=t.replace(S,"")}catch(_){console.error(`Error executing ${a} code block in ${l}:`,_);let E=_ instanceof Error?_.message:String(_),M=y(`${a} Directive`,`Error executing code: ${E}`,l,r,k,S);console.error(M),t=t.replace(S,"")}return t}function Sn(r,e="_method"){let l=r.toUpperCase();if(l==="GET"||l==="POST")return"";return`<input type="hidden" name="${e}" value="${l}">`}function Zt(r){return r.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,l,a,h,t)=>Sn(a,t||"_method"))}async function er(r,e,l,a,h){if(!a.middleware||a.middleware.length===0)return r;let t=r,p=a.middleware.filter((w)=>w.timing===h);if(p.length===0)return t;for(let w of p){if(!w.name||typeof w.handler!=="function"){if(a.debug)console.warn("Invalid middleware:",w);continue}try{let b=await w.handler(t,e,l,a);if(typeof b==="string")t=b;else if(a.debug)console.warn(`Middleware ${w.name} did not return a string`)}catch(b){if(a.debug)console.error(`Error in middleware ${w.name}:`,b);if(a.debug){let S=y("Middleware",`Error in middleware '${w.name}': ${b instanceof Error?b.message:String(b)}`,l,r);t=t.replace(/<body[^>]*>/,`$&
574
629
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${g(S)}</div>
575
- `)}}}return r}async function Zt(n,e,l,a){return Gt(n,e,l,a,"before")}async function Jt(n,e,l,a){return Gt(n,e,l,a,"after")}function Qt(n){return n.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,l,a,h,r)=>{try{let p=h?O(h,{}):{};return Sr(a,p,r==="true")}catch(p){return console.error(`Error processing @route directive: ${p}`),"#route-error"}})}var Ue={patterns:[],exact:{}};async function Yt(n,e){let l=n.split("/").pop()?.split(".")[0]||"";if(Ue.exact[n])for(let a of Ue.exact[n])await Promise.resolve(a(e,n));if(Ue.exact[l])for(let a of Ue.exact[l])await Promise.resolve(a(e,n));for(let{pattern:a,callback:h}of Ue.patterns)if(a.test(n)||a.test(l))await Promise.resolve(h(e,n))}var yn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function _e(n,e){let l=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;l.lastIndex=e;let a=l.exec(n);if(!a)return null;let h=/\/\s*>$/.test(a[0])||a[1]===a[1].toLowerCase()&&yn.has(a[1]),r=h?a[2].replace(/\/\s*$/,""):a[2];return{full:a[0],tag:a[1],attrs:r,selfClosing:h,start:a.index,end:a.index+a[0].length}}function xn(n,e,l){let a=1,h=l,r=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),p=new RegExp(`</${e}\\s*>`,"gi");while(a>0&&h<n.length){r.lastIndex=h,p.lastIndex=h;let w=r.exec(n),b=p.exec(n);if(!b)return-1;if(w&&w.index<b.index)a++,h=w.index+w[0].length;else{if(a--,a===0)return b.index+b[0].length;h=b.index+b[0].length}}return-1}function Ee(n,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let l=xn(n,e.tag,e.end);if(l===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:l,innerHTML:n.slice(e.end,l-`</${e.tag}>`.length)}}function er(n,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(n)||n.includes(` ${e}=`)||n.includes(` ${e} `)||n.trimEnd().endsWith(` ${e}`)}function We(n,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=n.match(new RegExp(`${l}="([^"]*)"`,"s"))||n.match(new RegExp(`${l}='([^']*)'`,"s"));return a?a[1]:null}function ke(n,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return n.replace(new RegExp(`\\s*${l}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${l}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${l}(?=\\s|$|>|/)`,"g"),"")}function Oe(n,e,l){let a=e.selfClosing?" /":"",h=`<${e.tag}${l}${a}>`;return n.slice(0,e.start)+h+n.slice(e.end)}function kn(n){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(n)}function En(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-for");if(h===null){l=a.end;continue}let r=h.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!r){l=a.end;continue}let p=r[1].trim(),w=r[2].trim(),b;if(p.includes(",")){let L=p.split(",").map((F)=>F.trim()),j=L[0],B=L[1];b=`${w} as ${B} => ${j}`}else b=`${w} as ${p}`;let S=ke(a.attrs,"v-for"),v=ke(S,":key").replace(/\s*v-bind:key="[^"]*"/g,""),k=Ee(e,a),C=e.slice(k.outerStart,k.outerEnd),_=Oe(C,{...a,start:0,end:a.end-a.start},v),P=`@foreach(${b})
576
- `,I=`${P}${_}
577
- @endforeach`;e=e.slice(0,k.outerStart)+I+e.slice(k.outerEnd),l=k.outerStart+P.length}return e}function _n(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-if");if(h===null){l=a.end;continue}let r=[],p=Ee(e,a),w=ke(a.attrs,"v-if"),b=Oe(e.slice(p.outerStart,p.outerEnd),{...a,start:0,end:a.end-a.start},w);r.push({type:"if",expr:h,outerStart:p.outerStart,outerEnd:p.outerEnd,element:b,parsedTag:a});let S=p.outerEnd,v=!0;while(v){let I=e.slice(S).match(/^\s*/),L=I?I[0].length:0,j=_e(e,S+L);if(!j){v=!1;break}let B=We(j.attrs,"v-else-if"),F=er(j.attrs,"v-else");if(B!==null){let q=Ee(e,j),H=ke(j.attrs,"v-else-if"),N=Oe(e.slice(q.outerStart,q.outerEnd),{...j,start:0,end:j.end-j.start},H);r.push({type:"else-if",expr:B,outerStart:S,outerEnd:q.outerEnd,element:N,parsedTag:j}),S=q.outerEnd}else if(F){let q=Ee(e,j),H=ke(j.attrs,"v-else"),N=Oe(e.slice(q.outerStart,q.outerEnd),{...j,start:0,end:j.end-j.start},H);r.push({type:"else",outerStart:S,outerEnd:q.outerEnd,element:N,parsedTag:j}),v=!1}else v=!1}let k=[];for(let I of r)if(I.type==="if")k.push(`@if(${I.expr})
578
- ${I.element}`);else if(I.type==="else-if")k.push(`@elseif(${I.expr})
579
- ${I.element}`);else k.push(`@else
580
- ${I.element}`);k.push("@endif");let C=k.join(`
581
- `),_=r[0].outerStart,P=r[r.length-1].outerEnd;e=e.slice(0,_)+C+e.slice(P),l=_+C.length}return e}function Tn(n){return n.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function Rn(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=wn.has(a.tag),r=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(w,b,S)=>{let v=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(b);if(!v||!S||!/^["']/.test(S))return w;let k=v[1]||"modelValue",C=v[2];if(h&&!v[1])return`@model${C}=${S}`;let _=S[0],P=S.slice(1,-1),I=`:${k}=${S} @update:${k}=${_}${P} = $event${_}`;if(C){let L=v[1]?`${k}Modifiers`:"modelModifiers",j=C.slice(1).split(".").map((B)=>`${B}: true`).join(", ");I+=` :${L}="{ ${j} }"`}return I});if(r===a.attrs){l=a.end;continue}let p=Oe(a.full,{...a,start:0,end:a.full.length},r);e=e.slice(0,a.start)+p+e.slice(a.end),l=a.start+p.length}return e}function Mn(n){return n.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Dn(n){return n.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function On(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-html");if(h===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let r=Ee(e,a),p=ke(a.attrs,"v-html"),w=a.selfClosing?" /":"",b=`<${a.tag}${p}${w}>{!! ${h} !!}</${a.tag}>`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function Ln(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-text");if(h===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let r=Ee(e,a),p=ke(a.attrs,"v-text"),w=a.selfClosing?" /":"",b=`<${a.tag}${p}${w}>{{ ${h} }}</${a.tag}>`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function jn(n){return n.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function Hn(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;if(!er(a.attrs,"v-once")){l=a.end;continue}let h=ke(a.attrs,"v-once"),r=Ee(e,a),p=e.slice(r.outerStart,r.outerEnd),b=`@once
582
- ${Oe(p,{...a,start:0,end:a.end-a.start},h)}
583
- @endonce`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function Nn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Bn(n){return n.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function tr(n){if(!kn(n))return n;let e=n;return e=En(e),e=_n(e),e=Hn(e),e=Mn(e),e=Dn(e),e=Rn(e),e=Tn(e),e=Bn(e),e=On(e),e=Ln(e),e=jn(e),e=Nn(e),e}function Je(n){return n.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var at=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),Fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function rr(n,e){let l=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=l?l[1]:n,h=d(a,e);if(h&&typeof h==="string")return h;let r=a.trim();return at.has(r)?r:null}function nr(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function sr(n,e,l){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),h=a?`<${n} ${a}>`:`<${n}>`;if(Fn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${h}${l}</${n}>`}async function ir(n,e,l,a,h){let r=n,p=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,w=[],b;while((b=p.exec(r))!==null)w.push({full:b[0],expr:b[1],attrs:b[2],slotContent:b[3],index:b.index});for(let S=w.length-1;S>=0;S--){let v=w[S];try{let k=rr(v.expr,e);if(!k||typeof k!=="string"){let B=`<!-- dynamic component: could not resolve "${Je(nr(v.expr))}" -->`;r=r.slice(0,v.index)+B+r.slice(v.index+v.full.length);continue}if(at.has(k)){let B=sr(k,v.attrs,v.slotContent);r=r.slice(0,v.index)+B+r.slice(v.index+v.full.length);continue}let C=v.attrs.trim(),_={},P=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,I;while((I=P.exec(C))!==null){let B=I[1]||I[2],F=I[3];if(I[1])try{_[B]=d(F,e)}catch{_[B]=F}else _[B]=F}let L=a.componentsDir||"components",j=await qe(k,_,v.slotContent,L,e,l,a,new Set,h??new Set);r=r.slice(0,v.index)+j+r.slice(v.index+v.full.length)}catch(k){let C=k instanceof Error?k.message:String(k),_=`<!-- dynamic component error: ${Je(C)} -->`;r=r.slice(0,v.index)+_+r.slice(v.index+v.full.length)}}return r=await Un(r,e,l,a,h),r}async function Un(n,e,l,a,h){let r=n,p=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,w=[],b;while((b=p.exec(r))!==null)w.push({full:b[0],expr:b[1],attrs:b[2],index:b.index});for(let S=w.length-1;S>=0;S--){let v=w[S];try{let k=rr(v.expr,e);if(!k||typeof k!=="string"){let P=`<!-- dynamic component: could not resolve "${Je(nr(v.expr))}" -->`;r=r.slice(0,v.index)+P+r.slice(v.index+v.full.length);continue}if(at.has(k)){let P=sr(k,v.attrs,"");r=r.slice(0,v.index)+P+r.slice(v.index+v.full.length);continue}let C=a.componentsDir||"components",_=await qe(k,{},"",C,e,l,a,new Set,h??new Set);r=r.slice(0,v.index)+_+r.slice(v.index+v.full.length)}catch(k){let C=k instanceof Error?k.message:String(k),_=`<!-- dynamic component error: ${Je(C)} -->`;r=r.slice(0,v.index)+_+r.slice(v.index+v.full.length)}}return r}var wc="X-STX-Build",ct=Symbol.for("stx.buildId");function gs(){let n=globalThis;if(!n[ct])n[ct]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return n[ct]}function or(n,e=gs()){if(n.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(n))return null;return`
584
- <meta name="stx-build" content="${e}">`}var Wo="/_stx/sw.js";function qn(n){if(typeof n!=="string"||!n.startsWith("/"))return null;let e=[],l=[],a=n.replace(/\/+$/,"").split("/").slice(1).map((h)=>{let r=/^:(\w+)$/.exec(h)||/^\[(\w+)\]$/.exec(h);if(r)return e.push(r[1]),l.push("0"),"([^/]+)";return l.push(h),h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:n,re:`^/${a.join("/")}/?$`,names:e,sample:`/${l.join("/")}`}}function Vn(n){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,l=window;if(l.stxOffline)return;let a=null,h=!1,r=[],p={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(v){if(p.updateReady)try{v()}catch{}else r.push(v);return()=>{let k=r.indexOf(v);if(k!==-1)r.splice(k,1)}},applyUpdate(){let v=a&&a.waiting;if(!v)return!1;return h=!0,v.postMessage({type:"stx:activate-update",force:!0}),!0}};l.stxOffline=p;let w=(v)=>{if(!v.waiting||!e.controller||p.updateReady)return;p.updateReady=!0;let k=r.splice(0);for(let C of k)try{C()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(v)=>{let k=v.data||{};if(k.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:k.url,kind:k.kind,fragment:!!k.fragment}}))}catch{}if(k.type==="stx:reachability"){if(l.stxOffline.reachable=k.reachable!==!1,Number(k.at)>0)l.stxOffline.reachedAt=Number(k.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:k.reachable!==!1,at:Number(k.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(h)h=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let b=()=>{e.register(n,{scope:"/"}).then((v)=>{a=v;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(v.waiting)w(v),v.waiting.postMessage({type:"stx:activate-update",reason:"load"});v.addEventListener("updatefound",()=>{let k=v.installing;if(!k)return;k.addEventListener("statechange",()=>{if(k.state==="installed")w(v)})})}).catch(()=>{})},S=()=>{let v=(k)=>{setTimeout(k,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>v(b));else v(b)};if(!e.controller)if(document.readyState==="complete")S();else addEventListener("load",S);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",S);else S()}function Wn(){let n=`(${Vn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim().replace(/;$/,"")}catch{return n}}function Xn(n,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!n||!n.startsWith("/"))return null;let l=n.split(/[?#]/)[0].split("/").filter(Boolean)[0];return l?`/${l}`:"/"}var ar=`<script data-stx-offline>${Wn()}</script>`;function qo(n,e){let l=Number(n.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((n.pages||[]).filter((h)=>typeof h==="string"&&h.startsWith("/")))),staticPages:(n.staticPages||[]).filter((h)=>typeof h==="string"&&((n.pages||[]).includes(h)||(n.routes||[]).includes(h))),api:n.apiPrefix||"/api/",timeout:Math.max(500,Number(n.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(l)&&l>0?Math.min(2147483647,Math.max(1,Math.floor(l))):1e4,networkFirst:(n.networkFirst||[]).filter((h)=>typeof h==="string"&&h.startsWith("/")),updateOnColdStart:n.updateOnColdStart===!0,fallback:n.fallback||n.pages&&n.pages[0]||null,fallbackScope:Xn(n.fallback||n.pages&&n.pages[0]||null,n.fallbackScope),routes:(n.routes||[]).map(qn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...n.exclude||[]],mediaMax:Math.max(10485760,Number(n.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(n.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
630
+ `)}}}return t}async function tr(r,e,l,a){return er(r,e,l,a,"before")}async function rr(r,e,l,a){return er(r,e,l,a,"after")}function nr(r){return r.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,l,a,h,t)=>{try{let p=h?N(h,{}):{};return Tr(a,p,t==="true")}catch(p){return console.error(`Error processing @route directive: ${p}`),"#route-error"}})}var Ve={patterns:[],exact:{}};async function sr(r,e){let l=r.split("/").pop()?.split(".")[0]||"";if(Ve.exact[r])for(let a of Ve.exact[r])await Promise.resolve(a(e,r));if(Ve.exact[l])for(let a of Ve.exact[l])await Promise.resolve(a(e,r));for(let{pattern:a,callback:h}of Ve.patterns)if(a.test(r)||a.test(l))await Promise.resolve(h(e,r))}var kn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Tn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function Ae(r,e){let l=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;l.lastIndex=e;let a=l.exec(r);if(!a)return null;let h=/\/\s*>$/.test(a[0])||a[1]===a[1].toLowerCase()&&kn.has(a[1]),t=h?a[2].replace(/\/\s*$/,""):a[2];return{full:a[0],tag:a[1],attrs:t,selfClosing:h,start:a.index,end:a.index+a[0].length}}function Cn(r,e,l){let a=1,h=l,t=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),p=new RegExp(`</${e}\\s*>`,"gi");while(a>0&&h<r.length){t.lastIndex=h,p.lastIndex=h;let w=t.exec(r),b=p.exec(r);if(!b)return-1;if(w&&w.index<b.index)a++,h=w.index+w[0].length;else{if(a--,a===0)return b.index+b[0].length;h=b.index+b[0].length}}return-1}function Ce(r,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let l=Cn(r,e.tag,e.end);if(l===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:l,innerHTML:r.slice(e.end,l-`</${e.tag}>`.length)}}function ir(r,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(r)||r.includes(` ${e}=`)||r.includes(` ${e} `)||r.trimEnd().endsWith(` ${e}`)}function Xe(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=r.match(new RegExp(`${l}="([^"]*)"`,"s"))||r.match(new RegExp(`${l}='([^']*)'`,"s"));return a?a[1]:null}function _e(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return r.replace(new RegExp(`\\s*${l}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${l}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${l}(?=\\s|$|>|/)`,"g"),"")}function Le(r,e,l){let a=e.selfClosing?" /":"",h=`<${e.tag}${l}${a}>`;return r.slice(0,e.start)+h+r.slice(e.end)}function Rn(r){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(r)}function In(r){let e=r,l=0;while(l<e.length){let a=Ae(e,l);if(!a)break;let h=Xe(a.attrs,"v-for");if(h===null){l=a.end;continue}let t=h.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!t){l=a.end;continue}let p=t[1].trim(),w=t[2].trim(),b;if(p.includes(",")){let C=p.split(",").map((F)=>F.trim()),O=C[0],B=C[1];b=`${w} as ${B} => ${O}`}else b=`${w} as ${p}`;let S=_e(a.attrs,"v-for"),v=_e(S,":key").replace(/\s*v-bind:key="[^"]*"/g,""),k=Ce(e,a),_=e.slice(k.outerStart,k.outerEnd),E=Le(_,{...a,start:0,end:a.end-a.start},v),M=`@foreach(${b})
631
+ `,T=`${M}${E}
632
+ @endforeach`;e=e.slice(0,k.outerStart)+T+e.slice(k.outerEnd),l=k.outerStart+M.length}return e}function Pn(r){let e=r,l=0;while(l<e.length){let a=Ae(e,l);if(!a)break;let h=Xe(a.attrs,"v-if");if(h===null){l=a.end;continue}let t=[],p=Ce(e,a),w=_e(a.attrs,"v-if"),b=Le(e.slice(p.outerStart,p.outerEnd),{...a,start:0,end:a.end-a.start},w);t.push({type:"if",expr:h,outerStart:p.outerStart,outerEnd:p.outerEnd,element:b,parsedTag:a});let S=p.outerEnd,v=!0;while(v){let T=e.slice(S).match(/^\s*/),C=T?T[0].length:0,O=Ae(e,S+C);if(!O){v=!1;break}let B=Xe(O.attrs,"v-else-if"),F=ir(O.attrs,"v-else");if(B!==null){let W=Ce(e,O),j=_e(O.attrs,"v-else-if"),H=Le(e.slice(W.outerStart,W.outerEnd),{...O,start:0,end:O.end-O.start},j);t.push({type:"else-if",expr:B,outerStart:S,outerEnd:W.outerEnd,element:H,parsedTag:O}),S=W.outerEnd}else if(F){let W=Ce(e,O),j=_e(O.attrs,"v-else"),H=Le(e.slice(W.outerStart,W.outerEnd),{...O,start:0,end:O.end-O.start},j);t.push({type:"else",outerStart:S,outerEnd:W.outerEnd,element:H,parsedTag:O}),v=!1}else v=!1}let k=[];for(let T of t)if(T.type==="if")k.push(`@if(${T.expr})
633
+ ${T.element}`);else if(T.type==="else-if")k.push(`@elseif(${T.expr})
634
+ ${T.element}`);else k.push(`@else
635
+ ${T.element}`);k.push("@endif");let _=k.join(`
636
+ `),E=t[0].outerStart,M=t[t.length-1].outerEnd;e=e.slice(0,E)+_+e.slice(M),l=E+_.length}return e}function jn(r){return r.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function Nn(r){let e=r,l=0;while(l<e.length){let a=Ae(e,l);if(!a)break;let h=Tn.has(a.tag),t=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(w,b,S)=>{let v=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(b);if(!v||!S||!/^["']/.test(S))return w;let k=v[1]||"modelValue",_=v[2];if(h&&!v[1])return`@model${_}=${S}`;let E=S[0],M=S.slice(1,-1),T=`:${k}=${S} @update:${k}=${E}${M} = $event${E}`;if(_){let C=v[1]?`${k}Modifiers`:"modelModifiers",O=_.slice(1).split(".").map((B)=>`${B}: true`).join(", ");T+=` :${C}="{ ${O} }"`}return T});if(t===a.attrs){l=a.end;continue}let p=Le(a.full,{...a,start:0,end:a.full.length},t);e=e.slice(0,a.start)+p+e.slice(a.end),l=a.start+p.length}return e}function Hn(r){return r.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Fn(r){return r.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function qn(r){let e=r,l=0;while(l<e.length){let a=Ae(e,l);if(!a)break;let h=Xe(a.attrs,"v-html");if(h===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let t=Ce(e,a),p=_e(a.attrs,"v-html"),w=a.selfClosing?" /":"",b=`<${a.tag}${p}${w}>{!! ${h} !!}</${a.tag}>`;e=e.slice(0,t.outerStart)+b+e.slice(t.outerEnd),l=t.outerStart+b.length}return e}function Un(r){let e=r,l=0;while(l<e.length){let a=Ae(e,l);if(!a)break;let h=Xe(a.attrs,"v-text");if(h===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let t=Ce(e,a),p=_e(a.attrs,"v-text"),w=a.selfClosing?" /":"",b=`<${a.tag}${p}${w}>{{ ${h} }}</${a.tag}>`;e=e.slice(0,t.outerStart)+b+e.slice(t.outerEnd),l=t.outerStart+b.length}return e}function Vn(r){return r.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function Wn(r){let e=r,l=0;while(l<e.length){let a=Ae(e,l);if(!a)break;if(!ir(a.attrs,"v-once")){l=a.end;continue}let h=_e(a.attrs,"v-once"),t=Ce(e,a),p=e.slice(t.outerStart,t.outerEnd),b=`@once
637
+ ${Le(p,{...a,start:0,end:a.end-a.start},h)}
638
+ @endonce`;e=e.slice(0,t.outerStart)+b+e.slice(t.outerEnd),l=t.outerStart+b.length}return e}function Xn(r){return r.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function zn(r){return r.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function or(r){if(!Rn(r))return r;let e=r;return e=In(e),e=Pn(e),e=Wn(e),e=Hn(e),e=Fn(e),e=Nn(e),e=jn(e),e=zn(e),e=qn(e),e=Un(e),e=Vn(e),e=Xn(e),e}function tt(r){return r.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var pt=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),Kn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function ar(r,e){let l=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(r),a=l?l[1]:r,h=d(a,e);if(h&&typeof h==="string")return h;let t=a.trim();return pt.has(t)?t:null}function cr(r){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(r);return e?e[1]:r}function lr(r,e,l){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),h=a?`<${r} ${a}>`:`<${r}>`;if(Kn.has(r))return a?`<${r} ${a}>`:`<${r}>`;return`${h}${l}</${r}>`}async function ur(r,e,l,a,h){let t=r,p=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,w=[],b;while((b=p.exec(t))!==null)w.push({full:b[0],expr:b[1],attrs:b[2],slotContent:b[3],index:b.index});for(let S=w.length-1;S>=0;S--){let v=w[S];try{let k=ar(v.expr,e);if(!k||typeof k!=="string"){let B=`<!-- dynamic component: could not resolve "${tt(cr(v.expr))}" -->`;t=t.slice(0,v.index)+B+t.slice(v.index+v.full.length);continue}if(pt.has(k)){let B=lr(k,v.attrs,v.slotContent);t=t.slice(0,v.index)+B+t.slice(v.index+v.full.length);continue}let _=v.attrs.trim(),E={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,T;while((T=M.exec(_))!==null){let B=T[1]||T[2],F=T[3];if(T[1])try{E[B]=d(F,e)}catch{E[B]=F}else E[B]=F}let C=a.componentsDir||"components",O=await Je(k,E,v.slotContent,C,e,l,a,new Set,h??new Set);t=t.slice(0,v.index)+O+t.slice(v.index+v.full.length)}catch(k){let _=k instanceof Error?k.message:String(k),E=`<!-- dynamic component error: ${tt(_)} -->`;t=t.slice(0,v.index)+E+t.slice(v.index+v.full.length)}}return t=await Jn(t,e,l,a,h),t}async function Jn(r,e,l,a,h){let t=r,p=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,w=[],b;while((b=p.exec(t))!==null)w.push({full:b[0],expr:b[1],attrs:b[2],index:b.index});for(let S=w.length-1;S>=0;S--){let v=w[S];try{let k=ar(v.expr,e);if(!k||typeof k!=="string"){let M=`<!-- dynamic component: could not resolve "${tt(cr(v.expr))}" -->`;t=t.slice(0,v.index)+M+t.slice(v.index+v.full.length);continue}if(pt.has(k)){let M=lr(k,v.attrs,"");t=t.slice(0,v.index)+M+t.slice(v.index+v.full.length);continue}let _=a.componentsDir||"components",E=await Je(k,{},"",_,e,l,a,new Set,h??new Set);t=t.slice(0,v.index)+E+t.slice(v.index+v.full.length)}catch(k){let _=k instanceof Error?k.message:String(k),E=`<!-- dynamic component error: ${tt(_)} -->`;t=t.slice(0,v.index)+E+t.slice(v.index+v.full.length)}}return t}var Tc="X-STX-Build",ft=Symbol.for("stx.buildId");function vs(){let r=globalThis;if(!r[ft])r[ft]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return r[ft]}function dr(r,e=vs()){if(r.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(r))return null;return`
639
+ <meta name="stx-build" content="${e}">`}var Zo="/_stx/sw.js";function Gn(r){if(typeof r!=="string"||!r.startsWith("/"))return null;let e=[],l=[],a=r.replace(/\/+$/,"").split("/").slice(1).map((h)=>{let t=/^:(\w+)$/.exec(h)||/^\[(\w+)\]$/.exec(h);if(t)return e.push(t[1]),l.push("0"),"([^/]+)";return l.push(h),h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:r,re:`^/${a.join("/")}/?$`,names:e,sample:`/${l.join("/")}`}}function Zn(r){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,l=window;if(l.stxOffline)return;let a=null,h=!1,t=[],p={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(v){if(p.updateReady)try{v()}catch{}else t.push(v);return()=>{let k=t.indexOf(v);if(k!==-1)t.splice(k,1)}},applyUpdate(){let v=a&&a.waiting;if(!v)return!1;return h=!0,v.postMessage({type:"stx:activate-update",force:!0}),!0}};l.stxOffline=p;let w=(v)=>{if(!v.waiting||!e.controller||p.updateReady)return;p.updateReady=!0;let k=t.splice(0);for(let _ of k)try{_()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(v)=>{let k=v.data||{};if(k.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:k.url,kind:k.kind,fragment:!!k.fragment}}))}catch{}if(k.type==="stx:reachability"){if(l.stxOffline.reachable=k.reachable!==!1,Number(k.at)>0)l.stxOffline.reachedAt=Number(k.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:k.reachable!==!1,at:Number(k.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(h)h=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let b=()=>{e.register(r,{scope:"/"}).then((v)=>{a=v;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(v.waiting)w(v),v.waiting.postMessage({type:"stx:activate-update",reason:"load"});v.addEventListener("updatefound",()=>{let k=v.installing;if(!k)return;k.addEventListener("statechange",()=>{if(k.state==="installed")w(v)})})}).catch(()=>{})},S=()=>{let v=(k)=>{setTimeout(k,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>v(b));else v(b)};if(!e.controller)if(document.readyState==="complete")S();else addEventListener("load",S);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",S);else S()}function Qn(){let r=`(${Zn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(r).trim().replace(/;$/,"")}catch{return r}}function Yn(r,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!r||!r.startsWith("/"))return null;let l=r.split(/[?#]/)[0].split("/").filter(Boolean)[0];return l?`/${l}`:"/"}var pr=`<script data-stx-offline>${Qn()}</script>`;function Qo(r,e){let l=Number(r.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((r.pages||[]).filter((h)=>typeof h==="string"&&h.startsWith("/")))),staticPages:(r.staticPages||[]).filter((h)=>typeof h==="string"&&((r.pages||[]).includes(h)||(r.routes||[]).includes(h))),api:r.apiPrefix||"/api/",timeout:Math.max(500,Number(r.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(l)&&l>0?Math.min(2147483647,Math.max(1,Math.floor(l))):1e4,networkFirst:(r.networkFirst||[]).filter((h)=>typeof h==="string"&&h.startsWith("/")),updateOnColdStart:r.updateOnColdStart===!0,fallback:r.fallback||r.pages&&r.pages[0]||null,fallbackScope:Yn(r.fallback||r.pages&&r.pages[0]||null,r.fallbackScope),routes:(r.routes||[]).map(Gn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...r.exclude||[]],mediaMax:Math.max(10485760,Number(r.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(r.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
585
640
  'use strict';
586
641
  var S = ${JSON.stringify(a)};
587
642
  var SHELL = 'stx-shell-' + S.build;
@@ -1285,43 +1340,43 @@ self.addEventListener('fetch', function (event) {
1285
1340
  event.respondWith(pageResponse(request, event));
1286
1341
  }
1287
1342
  });
1288
- `}import Le from"path";function cr(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("//")}async function ur(n,e,l){try{let a;if(n.startsWith("/")){let h=e;for(let r=0;r<5;r++){let p=Le.join(h,n);if(await Bun.file(p).exists())return p;h=Le.dirname(h)}a=Le.join(e,n)}else if(n.startsWith("./")||n.startsWith("../"))a=Le.resolve(e,n);else a=Le.resolve(e,n);if(await Bun.file(a).exists())return a;return null}catch{return null}}var dr=Symbol.for("stx.inline-assets.import-meta");function zn(n,e){if(!n.includes("import.meta"))return;let l=Error(`[stx] ${e} still references \`import.meta\` after bundling, and it is being inlined as a classic <script> where that is a SyntaxError \u2014 the whole script fails to parse, taking every other script on the page with it.
1289
- `+" `import.meta.env.STX_PUBLIC_*` is substituted at build time and is safe; anything else is not.\n Fix it by moving the module-only code (`import.meta.glob`, `import.meta.url`) into its own module, or by resolving the value without `import.meta`.");throw l[dr]=!0,l}async function pr(n,e,l){let a=n,h=Le.dirname(e),r=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,p;while((p=r.exec(a))!==null){let[S,v,k,C]=p;if(cr(k))continue;let _=await ur(k,h,e);if(_)try{let P=await Bun.file(_).text();if(l.add(_),k.endsWith(".ts")||k.endsWith(".tsx")){let L=await Bun.build({entrypoints:[_],target:"browser",minify:!0,define:T()});if(L.outputs.length>0)P=await L.outputs[0].text(),zn(P,k)}let I=`<script>
1343
+ `}import je from"path";function fr(r){return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")}async function mr(r,e,l){try{let a;if(r.startsWith("/")){let h=e;for(let t=0;t<5;t++){let p=je.join(h,r);if(await Bun.file(p).exists())return p;h=je.dirname(h)}a=je.join(e,r)}else if(r.startsWith("./")||r.startsWith("../"))a=je.resolve(e,r);else a=je.resolve(e,r);if(await Bun.file(a).exists())return a;return null}catch{return null}}var hr=Symbol.for("stx.inline-assets.import-meta");function es(r,e){if(!r.includes("import.meta"))return;let l=Error(`[stx] ${e} still references \`import.meta\` after bundling, and it is being inlined as a classic <script> where that is a SyntaxError \u2014 the whole script fails to parse, taking every other script on the page with it.
1344
+ `+" `import.meta.env.STX_PUBLIC_*` is substituted at build time and is safe; anything else is not.\n Fix it by moving the module-only code (`import.meta.glob`, `import.meta.url`) into its own module, or by resolving the value without `import.meta`.");throw l[hr]=!0,l}async function yr(r,e,l){let a=r,h=je.dirname(e),t=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,p;while((p=t.exec(a))!==null){let[S,v,k,_]=p;if(fr(k))continue;let E=await mr(k,h,e);if(E)try{let M=await Bun.file(E).text();if(l.add(E),k.endsWith(".ts")||k.endsWith(".tsx")){let C=await Bun.build({entrypoints:[E],target:"browser",minify:!0,define:A()});if(C.outputs.length>0)M=await C.outputs[0].text(),es(M,k)}let T=`<script>
1290
1345
  // Source: ${k}
1291
- ${P}
1292
- </script>`;a=a.replace(S,I),r.lastIndex=0}catch(P){if(P?.[dr])throw P}}let w=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,b;while((b=w.exec(a))!==null){let[S,v,k,C]=b,_=v+C;if(cr(k))continue;if(/rel=["']stylesheet["']/.test(_)||k.endsWith(".css")){let I=await ur(k,h,e);if(I)try{let L=await Bun.file(I).text();l.add(I);let j=`<style>
1346
+ ${M}
1347
+ </script>`;a=a.replace(S,T),t.lastIndex=0}catch(M){if(M?.[hr])throw M}}let w=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,b;while((b=w.exec(a))!==null){let[S,v,k,_]=b,E=v+_;if(fr(k))continue;if(/rel=["']stylesheet["']/.test(E)||k.endsWith(".css")){let T=await mr(k,h,e);if(T)try{let C=await Bun.file(T).text();l.add(T);let O=`<style>
1293
1348
  /* Source: ${k} */
1294
- ${L}
1295
- </style>`;a=a.replace(S,j),w.lastIndex=0}catch(L){}}}return a}import lt from"path";var Kn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Gn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function Zn(n,e){if(!e||!n.includes("/"))return n;let l=lt.dirname(e);return n.replace(Kn,(a,h,r,p)=>{let w=lt.resolve(l,p);return`${h}${r}${w.split(lt.sep).join("/")}${r}`})}function fr(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Gn,(l,a,h,r)=>`${a}${Zn(h,e)}${r}`)}var Te="<!--PARENT_CONTENT_PLACEHOLDER-->";function gr(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Er(n,e){let l=n.length,a=e,h=!0,r=[],p=(w)=>w+9<=l&&n[w]==="<"&&n[w+1]==="/"&&(n[w+2]==="s"||n[w+2]==="S")&&(n[w+3]==="c"||n[w+3]==="C")&&(n[w+4]==="r"||n[w+4]==="R")&&(n[w+5]==="i"||n[w+5]==="I")&&(n[w+6]==="p"||n[w+6]==="P")&&(n[w+7]==="t"||n[w+7]==="T")&&(n[w+8]===">"||/\s/.test(n[w+8]));while(a<l){let w=n[a];if(p(a))return a;if(w==="/"&&n[a+1]==="/"){if(a=n.indexOf(`
1296
- `,a+2),a===-1)return-1;a+=1,h=!0;continue}if(w==="/"&&n[a+1]==="*"){let b=n.indexOf("*/",a+2);if(b===-1)return-1;a=b+2,h=!0;continue}if(w==="/"&&h){let b=a+1,S=!1;while(b<l){let v=n[b];if(v==="\\"){b+=2;continue}if(v==="[")S=!0;else if(v==="]")S=!1;else if(v==="/"&&!S){b++;break}else if(v===`
1297
- `){b=-1;break}b++}if(b===-1){a++,h=!1;continue}while(b<l&&/[a-z]/.test(n[b]))b++;a=b,h=!1;continue}if(w==="'"||w==='"'){let b=w;a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]===b){a++;break}if(n[a]===`
1298
- `)break;a++}h=!1;continue}if(w==="`"){a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,h=!0;break}a++}if(r.length===0)h=!1;continue}if(w==="}"&&r.length>0){r.pop(),a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,h=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,h=!0;break}a++}continue}if(/\s/.test(w));else if(/[)\].\w$]/.test(w))h=!1;else h=!0;a++}return-1}function Cr(n,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${l}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let h=a.index+a[0].length,r=n.indexOf("</script>",h);if(r===-1)return null;let p=n.indexOf(">",r);if(p===-1)return null;return{start:a.index,end:p+1}}var Qn=4096;async function ut(n,e,l){if(l.buildMode!=="serve"||e.length<Qn)return null;let{registerServeModuleBundle:a}=await import("./chunk-0z9gttw0.js");return`<script ${n} src="${a(e)}"></script>`}async function lr(n,e,l,a){try{let{registeredModuleIdsIn:h,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-85xabvtj.js")),p=[],w=await r(h(...n),{minify:Ui(e.buildMode,e.minifyClient),collectInputs:p});for(let b of p)l?.add(b);if(a)a.inputs=p,a.code=w??void 0;if(!w)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:b}=await import("./chunk-0z9gttw0.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${b(w)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${w.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Yn(n,e,l,a){let h={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:C}=await o("stx/framework-composables",()=>import("./chunk-k9dne5by.js"));h.frameworkScript=await C(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-3k2d2jsn.js"))}catch{}let p=e.storesDir,w=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),b=w?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),S=[],v=[],k=null;for(let C=0;C<8;C++){let _=null,P="",I=!1;try{if(r){let F=w?await r.getStoreScript(p).then((q)=>q?{code:q,stores:["*"],functions:null}:null):await r.getStoreScriptFor(p,[b],{reads:r.storesReadInFiles([...S,...v]),runOnce:!0});if(F)_=F.code,P=F.stores.join(","),I=!!F.functions&&!w}}catch{}if(k!==null&&P===k)break;k=P;let L=I?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",j=_?`<script ${L}>${_}</script>`:null;h.storeCode=_,h.storeTag=_?await ut(L,_,e)??j:null;let B={};h.modulesTag=await lr([n,j],e,l,B),h.modulesCode=B.code??null,S=B.inputs??[],h.composableTag=null,h.composableCode=null,v=[];try{let{getComposableScript:F}=await o("stx/composable-loader",()=>import("./chunk-0v02qms8.js")),q=e.composablesDir,H=[h.modulesCode??h.modulesTag,j,h.frameworkScript].filter((U)=>U!==null),N=await F(e._layerComposableDirs??q,n,H,v);if(N)h.composableCode=N,h.composableTag=await ut('data-stx-scoped data-stx-run="always" data-stx-composables',N,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${N}</script>`}catch{}if(w||!r)break}return h}async function es(n,e,l,a={}){let{withModuleSubstitutes:h,moduleSubstitutionKey:r}=await import("./chunk-4e48zkq0.js"),p=await import("./chunk-ne8q191s.js"),{messages:w,webModules:b}=e,S=null,v=null,k=r()===""&&!a.__stx_native_screen;if(w&&p.pageMessagesEnabled(e)&&k)try{S=await p.loadPageMessages(process.cwd(),w)}catch(L){ts(L)}if(b&&Object.keys(b).length&&k)try{v=await(await import("./chunk-eknm4jrm.js")).loadWebModules(process.cwd(),b)}catch(L){rs(L)}let C=new Map([...v??[],...S?.stubs??[]]),_=()=>Yn(n,e,l,a),P=C.size?await h(C,_):await _(),I=null;if(S){let L=p.messageAreasIn(P.modulesCode,P.storeCode,P.composableCode),j=p.pageMessagesScript(S,p.pageLanguages(n,S),L);if(j)I=await ut('data-stx-scoped data-stx-run="always" data-stx-messages',j,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${j.replace(/<\/script/gi,"<\\/script")}</script>`}return[I,P.modulesTag,P.storeTag,P.composableTag,P.frameworkScript].filter((L)=>L!==null)}var yr=!1;function ts(n){if(yr)return;yr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var br=!1;function rs(n){if(br)return;br=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function ns(n,e=""){let l=Cr(n,"data-stx-runtime");if(!l)return n;let a=mr(n);if(a===-1||a===l.start){if(!e)return n;return n.slice(0,l.end)+e+n.slice(l.end)}if(a<l.start)return n.slice(0,a)+n.slice(l.start,l.end)+e+`
1299
- `+n.slice(a,l.start)+n.slice(l.end);let h=n.slice(l.start,l.end),r=n.slice(0,l.start)+n.slice(l.end),p=mr(r);if(p===-1)return h+e+`
1300
- `+r;return r.slice(0,p)+h+e+`
1301
- `+r.slice(p)}function ss(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(l,a,h)=>{let r=n.slice(0,h);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,l,a,h){if(await E(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Re(n,l);let r=!e.__stxProcessingDepth;Sn(e);for(let p of a._layerGraph?.configDependencies??[])h.add(p);if(r&&a.runtimeConfig)await $n(e,l,a.runtimeConfig);if(r)il(e),e.__stx_scope_seq??={n:0,key:Qs(String(e.__filename??l))},e.__stx_head_injections=zi(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!A()&&!In())&&l&&l.endsWith(".stx"))Ko(n,l);try{return await me.timeAsync("template-processing",async()=>{let p=await is(n,e,l,a,h);if(r)p=$i(p);if(r&&a.autoShell&&a.buildMode!=="compile"){let w=Pe(a.app?.head,{known:Fr,source:"app.head"}),S=(e.__stx_runtime_head||null)??Vi(),v=(e.__stx_head_raw||"").trim(),k,C=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(C)k=C[1].trim(),v=v.replace(C[0],"").trim();let _=e.__sections?.title,P=_?R(_,e,l):void 0,I=S.title||k||P,L=!S.title&&(!!k||!!P),j=S.meta||[],B=new Set(j.map((G)=>pt(G)).filter(Boolean)),F={...w,...I&&{title:I},meta:[...(w.meta||[]).filter((G)=>!B.has(pt(G))),...j],link:[...w.link||[],...S.link||[]],script:[...w.script||[],...S.script||[]],headRaw:[w.headRaw,v].filter(Boolean).join(`
1302
- `),...S.htmlAttrs&&{htmlAttrs:kl(w.htmlAttrs,S.htmlAttrs)},...S.bodyAttrs&&{bodyAttrs:{...w.bodyAttrs||{},...S.bodyAttrs}}},q=Hi(p);if(p=jr(p,F,{...L&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},q),q)p=Cl(p,w),p=Lr(p,F.htmlAttrs);let H=p.match(/<!-- stx-layout: ([^ ]+) -->/);if(H&&p.includes("<head")){let G=H[1],le=js(G);p=p.replace(/<head\b[^>]*>/i,(Z)=>`${Z}
1303
- <meta name="stx-layout" content="${gr(G)}">
1304
- <meta name="stx-layout-group" content="${gr(le)}">`)}let N=p.match(/function (__stx_setup_\w+)\(/),U=N?V(p):null;if(N&&U&&!/\bdata-stx=/.test(U.tag)){p=rt(p,(le,Z)=>`<body${Z} data-stx="${N[1]}">`);let G=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${N[1]}"`,"i");p=p.replace(G,"$1")}}if(r){let w=e.__stx_head_injections??zi(),b=_l(p);if(b!==null)w.beforeClose.push(b);let S=or(p);if(S!==null)w.afterOpen.push(S);if(a.offline?.enabled&&!p.includes("data-stx-offline"))w.beforeClose.push(ar);p=xl(p,w);let v=a.app?.colorMode;if(v)p=Mr(p,v)}if(r)if(Cr(p,"data-stx-runtime")){let b=await es(p,a,h,e);p=ns(p,b.map((S)=>`
1305
- ${S}`).join(""))}else{let b=await lr([p],a,h);if(b){let S=p.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(S!==-1)p=p.slice(0,S)+b+`
1306
- `+p.slice(S)}}if(r)p=Sl(p);if(r&&e.__stx_inject_css!==!1)p=await x(p,void 0,a.buildMode==="serve",!0);else if(r)p=vn(p);if(r)p=mt(p);if(p=p.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),p=ss(p),r&&e.__stx_runtime_config)p=Ht(p,e.__stx_runtime_config);if(r&&!e.__stx_defer_server_data){let w=Ir(e);if(w){let b=/<head\b[^>]*>/i.exec(p),S=b?b.index+b[0].length:0;p=p.slice(0,S)+w+p.slice(S)}}return p})}catch(p){if(p instanceof Y)throw p;let w=p instanceof Error?p.message:String(p),b=new oe(`Template processing failed: ${w}`,l,void 0,void 0,n.substring(0,200)+(n.length>200?"...":""));if(W.log(b,{filePath:l,context:e}),An.logDetailedError(b,{filePath:l,template:n.substring(0,500)}),A()&&!a.debug)console.error(`[stx] ${ae.relative(process.cwd(),l)||l}: ${b.message}`);if(a.debug)throw b;return Bi.createFallbackContent("Template Processing",b)}}async function is(n,e,l,a,h){let r=process.cwd(),p={...a,partialsDir:a.partialsDir&&!ae.isAbsolute(a.partialsDir)?ae.resolve(r,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!ae.isAbsolute(a.componentsDir)?ae.resolve(r,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!ae.isAbsolute(a.layoutsDir)?ae.resolve(r,a.layoutsDir):a.layoutsDir},w=p,b=n;await cs(l,e),as(e,w),b=await Ae(()=>Zt(b,e,l,w),b,(H)=>{W.log(H,{filePath:l,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${l}: ${H.message}`)}),b=b.replace(/\{\{--[\s\S]*?--\}\}/g,"");let S=we(b,ze,(H,N)=>`\x00STX_HTML_COMMENT_${N}\x00`);b=S.output;let v=S.tokens,k=(H)=>v.length===0?H:H.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(N,U)=>v[Number(U)]??""),C="\x00STX_ESCAPED_AT\x00",_="\x00STX_ESC_MUSTACHE_OPEN\x00",P="\x00STX_ESC_MUSTACHE_CLOSE\x00";b=b.replace(/@@/g,C),b=b.replace(/@\{\{([\s\S]*?)\}\}/g,(H,N)=>`${_}${N}${P}`),b=tr(b),b=await pr(b,l,h);let I={};b=hs(b,I);let L={...e.__sections||{}},j="",B=xt(kt(n)),F=/@nolayout\b/.test(b)||B===!1;if(/@nolayout\b/.test(b))b=b.replace(/@nolayout\b\s*/g,"");let q=b.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(q)j=q[1],b=b.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof B==="string"){if(j=B,!/@section\s*\(/.test(b))b=`@section('content')
1349
+ ${C}
1350
+ </style>`;a=a.replace(S,O),w.lastIndex=0}catch(C){}}}return a}import gt from"path";var ts=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,rs=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function ns(r,e){if(!e||!r.includes("/"))return r;let l=gt.dirname(e);return r.replace(ts,(a,h,t,p)=>{let w=gt.resolve(l,p);return`${h}${t}${w.split(gt.sep).join("/")}${t}`})}function br(r,e){if(!e||!r.includes("<script"))return r;return r.replace(rs,(l,a,h,t)=>`${a}${ns(h,e)}${t}`)}var Re="<!--PARENT_CONTENT_PLACEHOLDER-->";function wr(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Mr(r,e){let l=r.length,a=e,h=!0,t=[],p=(w)=>w+9<=l&&r[w]==="<"&&r[w+1]==="/"&&(r[w+2]==="s"||r[w+2]==="S")&&(r[w+3]==="c"||r[w+3]==="C")&&(r[w+4]==="r"||r[w+4]==="R")&&(r[w+5]==="i"||r[w+5]==="I")&&(r[w+6]==="p"||r[w+6]==="P")&&(r[w+7]==="t"||r[w+7]==="T")&&(r[w+8]===">"||/\s/.test(r[w+8]));while(a<l){let w=r[a];if(p(a))return a;if(w==="/"&&r[a+1]==="/"){if(a=r.indexOf(`
1351
+ `,a+2),a===-1)return-1;a+=1,h=!0;continue}if(w==="/"&&r[a+1]==="*"){let b=r.indexOf("*/",a+2);if(b===-1)return-1;a=b+2,h=!0;continue}if(w==="/"&&h){let b=a+1,S=!1;while(b<l){let v=r[b];if(v==="\\"){b+=2;continue}if(v==="[")S=!0;else if(v==="]")S=!1;else if(v==="/"&&!S){b++;break}else if(v===`
1352
+ `){b=-1;break}b++}if(b===-1){a++,h=!1;continue}while(b<l&&/[a-z]/.test(r[b]))b++;a=b,h=!1;continue}if(w==="'"||w==='"'){let b=w;a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]===b){a++;break}if(r[a]===`
1353
+ `)break;a++}h=!1;continue}if(w==="`"){a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,h=!0;break}a++}if(t.length===0)h=!1;continue}if(w==="}"&&t.length>0){t.pop(),a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++,h=!1;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,h=!0;break}a++}continue}if(/\s/.test(w));else if(/[)\].\w$]/.test(w))h=!1;else h=!0;a++}return-1}function Rr(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${l}(?:\\s|=|/?>))[^>]*>`,"i").exec(r);if(!a)return null;let h=a.index+a[0].length,t=r.indexOf("</script>",h);if(t===-1)return null;let p=r.indexOf(">",t);if(p===-1)return null;return{start:a.index,end:p+1}}var is=4096;async function mt(r,e,l){if(Ge(e)||Z(e)||l.buildMode!=="serve"||e.length<is)return null;let{registerServeModuleBundle:a}=await import("./chunk-qd9v1v8z.js");return`<script ${r} src="${a(e)}"></script>`}async function gr(r,e,l,a){try{let{registeredModuleIdsIn:h,buildModuleRegistryScript:t}=await o("stx/client-module-registry",()=>import("./chunk-1avy0p8v.js")),p=[],w=await t(h(...r),{minify:Yi(e.buildMode,e.minifyClient),collectInputs:p});for(let b of p)l?.add(b);if(a)a.inputs=p,a.code=w??void 0;if(!w)return null;if(e.buildMode==="serve"&&!Ge(w)&&!Z(w)){let{registerServeModuleBundle:b}=await import("./chunk-qd9v1v8z.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${b(w)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${w.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function os(r,e,l,a){let h={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:_}=await o("stx/framework-composables",()=>import("./chunk-v3747589.js"));h.frameworkScript=await _(r)}catch{}let t=null;try{t=await o("stx/store-loader",()=>import("./chunk-ws9kr80x.js"))}catch{}let p=e.storesDir,w=!!a.__stx_native_screen||(t?.pageStoresAll()??!0),b=w?"":r.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),S=[],v=[],k=null;for(let _=0;_<8;_++){let E=null,M="",T=!1;try{if(t){let F=w?await t.getStoreScript(p).then((W)=>W?{code:W,stores:["*"],functions:null}:null):await t.getStoreScriptFor(p,[b],{reads:t.storesReadInFiles([...S,...v]),runOnce:!0});if(F)E=F.code,M=F.stores.join(","),T=!!F.functions&&!w}}catch{}if(k!==null&&M===k)break;k=M;let C=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",O=E?`<script ${C}>${E}</script>`:null;h.storeCode=E,h.storeTag=E?await mt(C,E,e)??O:null;let B={};h.modulesTag=await gr([r,O],e,l,B),h.modulesCode=B.code??null,S=B.inputs??[],h.composableTag=null,h.composableCode=null,v=[];try{let{getComposableScript:F}=await o("stx/composable-loader",()=>import("./chunk-83b9k17j.js")),W=e.composablesDir,j=[h.modulesCode??h.modulesTag,O,h.frameworkScript].filter((V)=>V!==null),H=await F(e._layerComposableDirs??W,r,j,v);if(H)h.composableCode=H,h.composableTag=await mt('data-stx-scoped data-stx-run="always" data-stx-composables',H,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${H.replace(/<\/script/gi,"<\\/script")}</script>`}catch{}if(w||!t)break}return h}async function as(r,e,l,a={}){let{withModuleSubstitutes:h,moduleSubstitutionKey:t}=await import("./chunk-3zds0gmd.js"),p=await import("./chunk-7kqgp3p7.js"),{messages:w,webModules:b}=e,S=null,v=null,k=t()===""&&!a.__stx_native_screen;if(w&&p.pageMessagesEnabled(e)&&k)try{S=await p.loadPageMessages(process.cwd(),w)}catch(C){cs(C)}if(b&&Object.keys(b).length&&k)try{v=await(await import("./chunk-3sema2js.js")).loadWebModules(process.cwd(),b)}catch(C){ls(C)}let _=new Map([...v??[],...S?.stubs??[]]),E=()=>os(r,e,l,a),M=_.size?await h(_,E):await E(),T=null;if(S){let C=p.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),O=p.pageMessagesScript(S,p.pageLanguages(r,S),C);if(O)T=await mt('data-stx-scoped data-stx-run="always" data-stx-messages',O,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${O.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((C)=>C!==null)}var Sr=!1;function cs(r){if(Sr)return;Sr=!0,console.warn(`[stx] messages: ${r instanceof Error?r.message:String(r)}; pages ship every language`)}var kr=!1;function ls(r){if(kr)return;kr=!0,console.warn(`[stx] ${r instanceof Error?r.message:String(r)}; pages bundle the real modules`)}function us(r,e=""){let l=Rr(r,"data-stx-runtime");if(!l)return r;let a=vr(r);if(a===-1||a===l.start){if(!e)return r;return r.slice(0,l.end)+e+r.slice(l.end)}if(a<l.start)return r.slice(0,a)+r.slice(l.start,l.end)+e+`
1354
+ `+r.slice(a,l.start)+r.slice(l.end);let h=r.slice(l.start,l.end),t=r.slice(0,l.start)+r.slice(l.end),p=vr(t);if(p===-1)return h+e+`
1355
+ `+t;return t.slice(0,p)+h+e+`
1356
+ `+t.slice(p)}function ds(r){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return r.replace(e,(l,a,h)=>{let t=r.slice(0,h);return t.lastIndexOf("<")>t.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(r,e,l,a,h){if(await R(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return r;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Oe(r,l);let t=!e.__stxProcessingDepth;$n(e);for(let p of a._layerGraph?.configDependencies??[])h.add(p);if(t&&a.runtimeConfig)await On(e,l,a.runtimeConfig);if(t)gl(e),e.__stx_scope_seq??={n:0,key:oo(String(e.__filename??l))},e.__stx_head_injections=Gi(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!I()&&!Ln())&&l&&l.endsWith(".stx"))ei(r,l);try{return await ye.timeAsync("template-processing",async()=>{let p=await ps(r,e,l,a,h);if(t)p=Mi(p);if(t&&a.autoShell&&a.buildMode!=="compile"){let w=Me(a.app?.head,{known:Wr,source:"app.head"}),S=(e.__stx_runtime_head||null)??Ji(),v=(e.__stx_head_raw||"").trim(),k,_=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(_)k=_[1].trim(),v=v.replace(_[0],"").trim();let E=e.__sections?.title,M=E?P(E,e,l):void 0,T=S.title||k||M,C=!S.title&&(!!k||!!M),O=S.meta||[],B=new Set(O.map((K)=>bt(K)).filter(Boolean)),F={...w,...T&&{title:T},meta:[...(w.meta||[]).filter((K)=>!B.has(bt(K))),...O],link:[...w.link||[],...S.link||[]],script:[...w.script||[],...S.script||[]],headRaw:[w.headRaw,v].filter(Boolean).join(`
1357
+ `),...S.htmlAttrs&&{htmlAttrs:Al(w.htmlAttrs,S.htmlAttrs)},...S.bodyAttrs&&{bodyAttrs:{...w.bodyAttrs||{},...S.bodyAttrs}}},W=Xi(p);if(p=Vr(p,F,{...C&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},W),W)p=Il(p,w),p=Hr(p,F.htmlAttrs);let j=p.match(/<!-- stx-layout: ([^ ]+) -->/);if(j&&p.includes("<head")){let K=j[1],de=Us(K);p=p.replace(/<head\b[^>]*>/i,(G)=>`${G}
1358
+ <meta name="stx-layout" content="${wr(K)}">
1359
+ <meta name="stx-layout-group" content="${wr(de)}">`)}let H=p.match(/function (__stx_setup_\w+)\(/),V=H?U(p):null;if(H&&V&&!/\bdata-stx=/.test(V.tag)){p=ct(p,(de,G)=>`<body${G} data-stx="${H[1]}">`);let K=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${H[1]}"`,"i");p=p.replace(K,"$1")}}if(t){let w=e.__stx_head_injections??Gi(),b=Pl(p);if(b!==null)w.beforeClose.push(b);let S=dr(p);if(S!==null)w.afterOpen.push(S);if(a.offline?.enabled&&!p.includes("data-stx-offline"))w.beforeClose.push(pr);p=$l(p,w);let v=a.app?.colorMode;if(v)p=zr(p,v)}if(t)if(Rr(p,"data-stx-runtime")){let b=await as(p,a,h,e);p=us(p,b.map((S)=>`
1360
+ ${S}`).join(""))}else{let b=await gr([p],a,h);if(b){let S=p.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(S!==-1)p=p.slice(0,S)+b+`
1361
+ `+p.slice(S)}}if(t)p=Rl(p);if(t&&e.__stx_inject_css!==!1)p=await x(p,void 0,a.buildMode==="serve",!0);else if(t)p=En(p);if(t)p=xt(p);if(p=p.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),p=ds(p),t&&e.__stx_runtime_config)p=Gt(p,e.__stx_runtime_config);if(t&&!e.__stx_defer_server_data){let w=Lr(e);if(w){let b=/<head\b[^>]*>/i.exec(p),S=b?b.index+b[0].length:0;p=p.slice(0,S)+w+p.slice(S)}}return t?vt(p):p})}catch(p){if(p instanceof ee)throw p;let w=p instanceof Error?p.message:String(p),b=new ae(`Template processing failed: ${w}`,l,void 0,void 0,r.substring(0,200)+(r.length>200?"...":""));if(q.log(b,{filePath:l,context:e}),Mn.logDetailedError(b,{filePath:l,template:r.substring(0,500)}),I()&&!a.debug)console.error(`[stx] ${le.relative(process.cwd(),l)||l}: ${b.message}`);if(a.debug)throw b;return qi.createFallbackContent("Template Processing",b)}}async function ps(r,e,l,a,h){let t=process.cwd(),p={...a,partialsDir:a.partialsDir&&!le.isAbsolute(a.partialsDir)?le.resolve(t,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!le.isAbsolute(a.componentsDir)?le.resolve(t,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!le.isAbsolute(a.layoutsDir)?le.resolve(t,a.layoutsDir):a.layoutsDir},w=p,b=r;await ms(l,e),gs(e,w),b=await Ne(()=>tr(b,e,l,w),b,(j)=>{q.log(j,{filePath:l,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${l}: ${j.message}`)}),b=b.replace(/\{\{--[\s\S]*?--\}\}/g,"");let S=xe(b,We,(j,H)=>`\x00STX_HTML_COMMENT_${H}\x00`);b=S.output;let v=S.tokens,k=(j)=>v.length===0?j:j.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(H,V)=>v[Number(V)]??""),_="\x00STX_ESCAPED_AT\x00",E="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";b=b.replace(/@@/g,_),b=b.replace(/@\{\{([\s\S]*?)\}\}/g,(j,H)=>`${E}${H}${M}`),b=or(b),b=await yr(b,l,h);let T={};b=Ss(b,T);let C={...e.__sections||{}},O="",B=Tt(Rt(r)),F=/@nolayout\b/.test(b)||B===!1;if(/@nolayout\b/.test(b))b=b.replace(/@nolayout\b\s*/g,"");let W=b.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(W)O=W[1],b=b.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof B==="string"){if(O=B,!/@section\s*\(/.test(b))b=`@section('content')
1307
1362
  ${b.trim()}
1308
- @endsection`}if(!j&&!F&&w.defaultLayout){let H=Pn(b),N=/@section\s*\(/.test(b);if(!H||N){let U="",G=ae.dirname(l),le=w.layoutsDir?ae.dirname(w.layoutsDir):process.cwd();for(let Z=0;Z<20;Z++){let ue=ae.join(G,"_layout.stx");if(await s(ue)){U=ue;break}let ce=ae.dirname(G);if(ce===G||ce.length<le.length)break;G=ce}if(U)j=U;else if(w.layoutsDir){let Z=ae.isAbsolute(w.layoutsDir)?w.layoutsDir:ae.resolve(process.cwd(),w.layoutsDir),ue=ae.join(Z,`${w.defaultLayout}.stx`);if(await s(ue))j=ue}if(j&&!N)b=`@section('content')
1363
+ @endsection`}if(!O&&!F&&w.defaultLayout){let j=Dn(b),H=/@section\s*\(/.test(b);if(!j||H){let V="",K=le.dirname(l),de=w.layoutsDir?le.dirname(w.layoutsDir):process.cwd();for(let G=0;G<20;G++){let pe=le.join(K,"_layout.stx");if(await s(pe)){V=pe;break}let ue=le.dirname(K);if(ue===K||ue.length<de.length)break;K=ue}if(V)O=V;else if(w.layoutsDir){let G=le.isAbsolute(w.layoutsDir)?w.layoutsDir:le.resolve(process.cwd(),w.layoutsDir),pe=le.join(G,`${w.defaultLayout}.stx`);if(await s(pe))O=pe}if(O&&!H)b=`@section('content')
1309
1364
  ${b.trim()}
1310
- @endsection`}}if(j&&b.includes("<script")){let H=ee(b),N=H.scripts.map((U)=>vr(U,l)??U);b=Tr(H.output,N)}if(b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(H,N,U)=>(L[N]=U,"")),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(H,N,U)=>{if(/^(['"]).*\1$/.test(U.trim()))return H;try{let G=d(U.trim(),e);if(G===void 0)return H;let Z=(e.__stx_inline_section_values??=[]).push(G)-1;return L[N]=`{{ __stx_inline_section_values[${Z}] }}`,""}catch{return H}}),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(H,N,U)=>{if(U.includes("@parent"))L[N]=U.replace("@parent",Te);else L[N]=U.trim();return""}),e.__sections=L,b=b.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(H,N,U)=>L[N]||U||""),!("slot"in e)||e.slot===void 0)b=b.replace(/\{\{\s*slot\s*\}\}/g,()=>L.content||"");if(b=ys(b,I),j){let H=[],N=ee(b),U=we(N.output,bn,(G,le)=>`\x00STX_ORPHAN_STYLE_${le}\x00`);if(b=U.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(G,le,Z)=>{let ue=le==="SCRIPT"?vr(N.scripts[Number(Z)],l):U.tokens[Number(Z)];if(ue)H.push(ue);return""}),H.length>0){let G=H.join(`
1311
- `);L.content=L.content?`${L.content}
1312
- ${G}`:G,e.__sections=L}}if(j)try{let H;if(ae.isAbsolute(j))H=j,h.add(j);else H=await Ae(()=>Cn(j,l,p,h),null,()=>{throw new oe(`Failed to resolve layout path: ${j}`,l,void 0,void 0,`Layout referenced from ${l}`)});if(!H){let ce=(J)=>{if(!J)return[];try{let ve=ae.isAbsolute(J)?J:ae.resolve(process.cwd(),J);return Jn.readdirSync(ve).filter((Se)=>Se.endsWith(".stx")).map((Se)=>Se.replace(/\.stx$/,""))}catch{return[]}},ne=[...ce(p.layoutsDir),...ce(p.fallbackLayoutsDir)].filter((J,ve,Se)=>Se.indexOf(J)===ve).sort(),be=[p.layoutsDir,p.fallbackLayoutsDir].filter((J)=>typeof J==="string"&&J.length>0),fe=be.length>0?` Searched: ${be.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",se=`Layout not found: ${j} (referenced from ${l})`+(ne.length>0?`. Available layouts: ${ne.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"")+fe;if(W.log(Error(se),{layoutPath:j,filePath:l,available:ne},"error"),console.error(`[stx] ${se}`),p.debug)throw new oe(se,l);return b}let N=await Ae(()=>Bun.file(H).text(),"",()=>{throw new oe(`Failed to read layout file: ${H}`,l,void 0,void 0,"Layout content could not be loaded")});N=fr(N,H),N=N.replace(/\{\{--[\s\S]*?--\}\}/g,"");let U=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(U.includes(H)){let ce=[...U.slice(U.indexOf(H)),H];throw new oe(ce.length===2?`Circular layout: ${H} extends itself`:`Circular layout: ${ce.join(" -> ")}`,l,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let G=N.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(G){if(p.debug)console.log(`Found nested layout: ${G[1]} in ${H}`);let ce={},ne=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(se,J,ve)=>(ce[J]=ve.trim(),""));for(let[se,J]of Object.entries(ce))if(L[se]&&L[se].includes(Te)){let ve=L[se].indexOf(Te);L[se]=L[se].slice(0,ve)+J+L[se].slice(ve+Te.length)}else if(!L[se])L[se]=J;let be={...e,__sections:L,__layoutChain:[...U,H]},fe=`@layout('${G[1]}')${ne}`;return await i(fe,be,H,p,h)}let le=N.replace(/\{\{--[\s\S]*?--\}\}/g,""),Z=hs(le,I),ue={};return Z=Z.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ce,ne,be)=>(ue[ne]=be.trim(),`@slot('${ne}')`)),Z=Z.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ce,ne,be)=>{if(L[ne]){let fe=L[ne];if(fe.includes(Te)){let se=ue[ne]||"",J=fe.indexOf(Te);fe=fe.slice(0,J)+se+fe.slice(J+Te.length)}return fe}return be||""}),Z=os(Z,L),Z=Z.replace(/\{\{\s*slot\s*\}\}/g,()=>L.content||""),Z=ys(Z,I),e.__originalFilePath=l,b=await $r(Z,e,H,p,h),b=`<!-- stx-layout: ${j} -->
1313
- ${b}`,k(b)}catch(H){if(H instanceof Y)throw H;throw new oe(`Error processing layout ${j}: ${H instanceof Error?H.message:String(H)}`,l)}return k(await $r(b,e,l,p,h))}function os(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,a,h)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return h||""})}function as(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let l=e.envPrefix||"STX_PUBLIC_",a={};for(let[h,r]of Object.entries(process.env))if(h.startsWith(l)&&r!==void 0)a[h]=r;n.$env=a}async function cs(n,e){await Ae(()=>Yt(n,e),void 0,(l)=>{W.log(l,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${l.message}`)})}var dt="data-stx-source";function vr(n,e){if(!n)return n;let l=/^<script\b([^>]*)>/i.exec(n);if(!l||!/\bserver\b/.test(l[1])||l[1].includes(dt))return n;return`<script ${dt}="${encodeURIComponent(e)}"${n.slice(7)}`}function ls(n){let e=new RegExp(`${dt}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function xr(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function kr(n,e,l){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${xr(n)}</span><span style="display:block;margin-top:4px">${xr(l)}</span></div>`}async function us(n,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-gfe1jrw9.js")),r=[],p=!A()&&!In();for(let b of h(n)){let S=b.attrs;if(!/\bserver\b/.test(S))continue;let v=b.start+b.fullMatch.indexOf(">")+1,k=Er(n,v);if(k===-1)continue;let C=n.slice(v,k);if(!C.trim())continue;let _=ls(S)??l,P={index:b.start,length:k+9-b.start};try{let{extractVariables:I}=await o("stx/variable-extractor",()=>import("./chunk-rm5gbthk.js"));await I(C,e,_,{preserveExisting:!0,onFailure:(L)=>{if(L.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:_,kind:L.kind,message:L.message}),!p)return;r.push({...P,markup:kr(_,L.kind,L.message)})}})}catch(I){let L=I instanceof Error?I:Error(String(I));if(W.log(L,{filePath:_,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${_}: ${L.message}`),p)r.push({...P,markup:kr(_,"unknown",L.message)})}}if(r.length===0)return n;let w=n;for(let b of r.sort((S,v)=>v.index-S.index))w=w.slice(0,b.index)+b.markup+w.slice(b.index+b.length);return w}async function ds(n,e,l){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-rjv6885r.js"));return a(n,e,{skipServer:!0})}catch(a){let h=a instanceof Error?a:Error(String(a));return W.log(h,{filePath:l,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${l}: ${h.message}`),n}}async function $r(n,e,l,a,h){let r=n;await E();let p=a;if(r=await us(r,e,l,a),r=await Wt(r,e,l),r=await Xt(r,e,l),r=await ds(r,e,l),await E(),r=await Dt(r,e,l,p),Re(r))r=ni(r,e),r=_s(r,e),r=ks(r,e);r=ri(r),await E();let{processStreamDirectives:w}=await o("stx/streaming",()=>import("./chunk-dgs3d367.js"));r=w(r,e),r=await Yo(r,e,l,p,!0),await E(),r=await ir(r,e,l,p,h),r=await ws(r,e,l,p,h),await E(),r=$c(r,e,l,p);let{processDeferDirectives:b}=await o("stx/defer",()=>import("./chunk-kq8mffgf.js"));r=b(r,e,l);let{processTeleportDirectives:S}=await o("stx/teleport",()=>import("./chunk-fa57bncd.js"));r=S(r,e,l);let{processTransitionDirectives:v,processTransitionAttributes:k}=await o("stx/transitions",()=>import("./chunk-h2928108.js"));r=v(r,e,l),r=k(r);let{processErrorBoundaryDirectives:C,stripRenderFailedMarkers:_}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=C(r,e,l),r=_(r);let{processSuspenseDirectives:P}=await o("stx/suspense",()=>import("./chunk-y4hn1qh0.js"));r=P(r,e,l);let{processAsyncDirectives:I}=await o("stx/async-components",()=>import("./chunk-byq488g4.js"));r=I(r,e,l);let{processKeepAliveDirectives:L}=await o("stx/keep-alive",()=>import("./chunk-x76qvq1n.js"));r=L(r,e,l);let{processVirtualListDirectives:j,processVirtualGridDirectives:B,processInfiniteListDirectives:F}=await o("stx/virtual-scrolling",()=>import("./chunk-yfed67yc.js"));r=j(r,e,l),r=B(r,e,l),r=F(r,e,l),await E();let{processPartialHydrationDirectives:q,processStaticDirectives:H}=await o("stx/partial-hydration",()=>import("./chunk-9mz2n39m.js"));r=q(r,e,l),r=H(r);let{processComputedDirectives:N,processWatchDirectives:U}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=N(r,e,l),r=U(r,e,l);let{processFormValidationDirectives:G}=await o("stx/forms-validation",()=>import("./chunk-hat353vx.js"));r=G(r,e,l);let{processHeadDirective:le,processTitleDirective:Z,processMetaDirective:ue,resetHead:ce}=await o("stx/head",()=>import("./chunk-ts37jw3s.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ce();let ne=le(r);if(r=ne.content,ne.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${ne.headContent}
1314
- `;if(r=Z(r,e),r=ue(r,e,l),r=Qt(r),r=Zo(r,e),r=Mt(r),r=Kt(r),r=await ms(r,e,l,p,h),r=await ws(r,e,l,p,h),await E(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=$i(r),r=de(r,e,l),r=vs(r),await E(),e.__stxProcessingDepth===1)r=al(r,e);if(r=tl(r,e,{filePath:l,buildMode:p.buildMode}),r=Qo(r,e),r=ei(r,e),r=Ze(r,e),r=Ft(r,e),r=Ut(r,e),r=await St(r,e,l,p),r=await Ac(r,e,l),r=await Ic(r,e,l,p),await E(),r=Oc(r,e,l,p),r=ui(r,e,l,p),r=di(r,e,l),r=pi(r,e,l,p),r=At(r,e,l,p),r=Ys(r,e),r=Zs(r),r=rl(r),!p.skipEventDirectives)r=Wc(r,e,l);if(r=nl(r,e,l,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await E(),p.debug){let z=/\bx-data\s*=/.test(r),K=Ss(n);if(z&&K)console.warn(`[stx] ${l}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1365
+ @endsection`}}if(O&&b.includes("<script")){let j=re(b),H=j.scripts.map((V)=>$r(V,l)??V);b=Ir(j.output,H)}if(b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(j,H,V)=>(C[H]=V,"")),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(j,H,V)=>{if(/^(['"]).*\1$/.test(V.trim()))return j;try{let K=d(V.trim(),e);if(K===void 0)return j;let G=(e.__stx_inline_section_values??=[]).push(K)-1;return C[H]=`{{ __stx_inline_section_values[${G}] }}`,""}catch{return j}}),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(j,H,V)=>{if(V.includes("@parent"))C[H]=V.replace("@parent",Re);else C[H]=V.trim();return""}),e.__sections=C,b=b.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(j,H,V)=>C[H]||V||""),!("slot"in e)||e.slot===void 0)b=b.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||"");if(b=ks(b,T),O){let j=[],H=re(b),V=xe(H.output,_n,(K,de)=>`\x00STX_ORPHAN_STYLE_${de}\x00`);if(b=V.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(K,de,G)=>{let pe=de==="SCRIPT"?$r(H.scripts[Number(G)],l):V.tokens[Number(G)];if(pe)j.push(pe);return""}),j.length>0){let K=j.join(`
1366
+ `);C.content=C.content?`${C.content}
1367
+ ${K}`:K,e.__sections=C}}if(O)try{let j;if(le.isAbsolute(O))j=O,h.add(O);else j=await Ne(()=>An(O,l,p,h),null,()=>{throw new ae(`Failed to resolve layout path: ${O}`,l,void 0,void 0,`Layout referenced from ${l}`)});if(!j){let ue=(Q)=>{if(!Q)return[];try{let Se=le.isAbsolute(Q)?Q:le.resolve(process.cwd(),Q);return ss.readdirSync(Se).filter(($e)=>$e.endsWith(".stx")).map(($e)=>$e.replace(/\.stx$/,""))}catch{return[]}},se=[...ue(p.layoutsDir),...ue(p.fallbackLayoutsDir)].filter((Q,Se,$e)=>$e.indexOf(Q)===Se).sort(),ve=[p.layoutsDir,p.fallbackLayoutsDir].filter((Q)=>typeof Q==="string"&&Q.length>0),me=ve.length>0?` Searched: ${ve.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",oe=`Layout not found: ${O} (referenced from ${l})`+(se.length>0?`. Available layouts: ${se.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"")+me;if(q.log(Error(oe),{layoutPath:O,filePath:l,available:se},"error"),console.error(`[stx] ${oe}`),p.debug)throw new ae(oe,l);return b}let H=await Ne(()=>Bun.file(j).text(),"",()=>{throw new ae(`Failed to read layout file: ${j}`,l,void 0,void 0,"Layout content could not be loaded")});H=br(H,j),H=H.replace(/\{\{--[\s\S]*?--\}\}/g,"");let V=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(V.includes(j)){let ue=[...V.slice(V.indexOf(j)),j];throw new ae(ue.length===2?`Circular layout: ${j} extends itself`:`Circular layout: ${ue.join(" -> ")}`,l,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let K=H.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(K){if(p.debug)console.log(`Found nested layout: ${K[1]} in ${j}`);let ue={},se=H.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(oe,Q,Se)=>(ue[Q]=Se.trim(),""));for(let[oe,Q]of Object.entries(ue))if(C[oe]&&C[oe].includes(Re)){let Se=C[oe].indexOf(Re);C[oe]=C[oe].slice(0,Se)+Q+C[oe].slice(Se+Re.length)}else if(!C[oe])C[oe]=Q;let ve={...e,__sections:C,__layoutChain:[...V,j]},me=`@layout('${K[1]}')${se}`;return await i(me,ve,j,p,h)}let de=H.replace(/\{\{--[\s\S]*?--\}\}/g,""),G=Ss(de,T),pe={};return G=G.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ue,se,ve)=>(pe[se]=ve.trim(),`@slot('${se}')`)),G=G.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ue,se,ve)=>{if(C[se]){let me=C[se];if(me.includes(Re)){let oe=pe[se]||"",Q=me.indexOf(Re);me=me.slice(0,Q)+oe+me.slice(Q+Re.length)}return me}return ve||""}),G=fs(G,C),G=G.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||""),G=ks(G,T),e.__originalFilePath=l,b=await Ar(G,e,j,p,h),b=`<!-- stx-layout: ${O} -->
1368
+ ${b}`,k(b)}catch(j){if(j instanceof ee)throw j;throw new ae(`Error processing layout ${O}: ${j instanceof Error?j.message:String(j)}`,l)}return k(await Ar(b,e,l,p,h))}function fs(r,e){return r.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,a,h)=>{let t=e[a];if(t!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(t))return t}return h||""})}function gs(r,e){if(r.__stx_sfc_mode=!0,r.__stx_options=e,e.buildMode)r.__stx_buildMode=e.buildMode;let l=e.envPrefix||"STX_PUBLIC_",a={};for(let[h,t]of Object.entries(process.env))if(h.startsWith(l)&&t!==void 0)a[h]=t;r.$env=a}async function ms(r,e){await Ne(()=>sr(r,e),void 0,(l)=>{q.log(l,{filePath:r,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${r}: ${l.message}`)})}var ht="data-stx-source";function $r(r,e){if(!r)return r;let l=/^<script\b([^>]*)>/i.exec(r);if(!l||!/\bserver\b/.test(l[1])||l[1].includes(ht))return r;return`<script ${ht}="${encodeURIComponent(e)}"${r.slice(7)}`}function hs(r){let e=new RegExp(`${ht}="([^"]*)"`).exec(r);return e?decodeURIComponent(e[1]):void 0}function Er(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Cr(r,e,l){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${Er(r)}</span><span style="display:block;margin-top:4px">${Er(l)}</span></div>`}async function ys(r,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-5p3825qw.js")),t=[],p=!I()&&!Ln();for(let b of h(r)){let S=b.attrs;if(!/\bserver\b/.test(S))continue;let v=b.start+b.fullMatch.indexOf(">")+1,k=Mr(r,v);if(k===-1)continue;let _=r.slice(v,k);if(!_.trim())continue;let E=hs(S)??l,M={index:b.start,length:k+9-b.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-vm42j29z.js"));await T(_,e,E,{preserveExisting:!0,onFailure:(C)=>{if(C.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:E,kind:C.kind,message:C.message}),!p)return;t.push({...M,markup:Cr(E,C.kind,C.message)})}})}catch(T){let C=T instanceof Error?T:Error(String(T));if(q.log(C,{filePath:E,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${E}: ${C.message}`),p)t.push({...M,markup:Cr(E,"unknown",C.message)})}}if(t.length===0)return r;let w=r;for(let b of t.sort((S,v)=>v.index-S.index))w=w.slice(0,b.index)+b.markup+w.slice(b.index+b.length);return w}async function bs(r,e,l){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-qxcc0aar.js"));return a(r,e,{skipServer:!0})}catch(a){let h=a instanceof Error?a:Error(String(a));return q.log(h,{filePath:l,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${l}: ${h.message}`),r}}async function Ar(r,e,l,a,h){let t=r;await R();let p=a;if(t=await ys(t,e,l,a),t=await zt(t,e,l),t=await Kt(t,e,l),t=await bs(t,e,l),await R(),t=await Nt(t,e,l,p),Oe(t))t=li(t,e),t=As(t,e),t=Rs(t,e);t=ui(t),await R();let{processStreamDirectives:w}=await o("stx/streaming",()=>import("./chunk-hkx51atf.js"));t=w(t,e),t=await si(t,e,l,p,!0),await R(),t=await ur(t,e,l,p,h),t=await Cs(t,e,l,p,h),await R(),t=Dc(t,e,l,p);let{processDeferDirectives:b}=await o("stx/defer",()=>import("./chunk-t8r40wgf.js"));t=b(t,e,l);let{processTeleportDirectives:S}=await o("stx/teleport",()=>import("./chunk-fz4c5e9m.js"));t=S(t,e,l);let{processTransitionDirectives:v,processTransitionAttributes:k}=await o("stx/transitions",()=>import("./chunk-d7b30bg6.js"));t=v(t,e,l),t=k(t);let{processErrorBoundaryDirectives:_,stripRenderFailedMarkers:E}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));t=_(t,e,l),t=E(t);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-gmp10259.js"));t=M(t,e,l);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-pjjrx9pk.js"));t=T(t,e,l);let{processKeepAliveDirectives:C}=await o("stx/keep-alive",()=>import("./chunk-axra1yas.js"));t=C(t,e,l);let{processVirtualListDirectives:O,processVirtualGridDirectives:B,processInfiniteListDirectives:F}=await o("stx/virtual-scrolling",()=>import("./chunk-jghpzx5m.js"));t=O(t,e,l),t=B(t,e,l),t=F(t,e,l),await R();let{processPartialHydrationDirectives:W,processStaticDirectives:j}=await o("stx/partial-hydration",()=>import("./chunk-4pjqj54a.js"));t=W(t,e,l),t=j(t);let{processComputedDirectives:H,processWatchDirectives:V}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));t=H(t,e,l),t=V(t,e,l);let{processFormValidationDirectives:K}=await o("stx/forms-validation",()=>import("./chunk-k206d3pn.js"));t=K(t,e,l);let{processHeadDirective:de,processTitleDirective:G,processMetaDirective:pe,resetHead:ue}=await o("stx/head",()=>import("./chunk-1jk46ve0.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ue();let se=de(t);if(t=se.content,se.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${se.headContent}
1369
+ `;if(t=G(t,e),t=pe(t,e,l),t=nr(t),t=oi(t,e),t=jt(t),t=Zt(t),t=await xs(t,e,l,p,h),t=await Cs(t,e,l,p,h),await R(),t=t.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),t=Mi(t),t=fe(t,e,l),t=Es(t),await R(),e.__stxProcessingDepth===1)t=ml(t,e);if(t=ll(t,e,{filePath:l,buildMode:p.buildMode}),t=ii(t,e),t=ai(t,e),t=et(t,e),t=Wt(t,e),t=Xt(t,e),t=await Ct(t,e,l,p),t=await jc(t,e,l),t=await Fc(t,e,l,p),await R(),t=zc(t,e,l,p),t=yi(t,e,l,p),t=bi(t,e,l),t=wi(t,e,l,p),t=Lt(t,e,l,p),t=ro(t,e),t=so(t),t=dl(t),!p.skipEventDirectives)t=Qc(t,e,l);if(t=ul(t,e,l,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await R(),p.debug){let X=/\bx-data\s*=/.test(t),z=$s(r);if(X&&z)console.warn(`[stx] ${l}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1315
1370
  Both work on the same page, but they manage separate scopes.
1316
- Prefer signals (state/derived/effect) for new components.`)}r=kc(r,e),r=await Di(r,e,l),await E(),r=sl(r),r=ol(r),r=wt(r);let{processXElementDirectives:be}=await o("stx/x-element",()=>import("./chunk-d6gqh2wv.js"));r=be(r);let fe=e.__originalFilePath||l,se=He(e);if(r=await si(r,p,fe,se),await E(),r=jt(r,e),r=await Jt(r,e,l,p),await E(),p.media?.image?.autoSiblings){let z=p.publicDir||"public",{rewriteImagesWithSiblings:K}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-447jc6zc.js"));r=await K(r,{publicDir:z})}if(p.seo?.enabled)r=fi(r,e,p);let J=(z,K,Q=!0)=>{if(!K)return z;let ye=K.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ie=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(z),ge=ie?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ie[0]):null;if(ye&&ie&&ge){if(Q){let De=ie.index+ge.index;z=z.slice(0,De)+ye[0]+z.slice(De+ge[0].length)}if(K=K.replace(ye[0],"").trim(),!K)return z}if(/<\/head>/i.test(z))return f(z,K);if(/<head\b[^>]*>/i.test(z))return z.replace(/(<head\b[^>]*>)/i,`$1
1317
- ${K}`);if(/<html\b[^>]*>/i.test(z))return z.replace(/(<html\b[^>]*>)/i,`$1
1371
+ Prefer signals (state/derived/effect) for new components.`)}t=Pc(t,e),t=await Hi(t,e,l),await R(),t=pl(t),t=fl(t),t=$t(t);let{processXElementDirectives:ve}=await o("stx/x-element",()=>import("./chunk-satrf398.js"));t=ve(t);let me=e.__originalFilePath||l,oe=qe(e);if(t=await di(t,p,me,oe),await R(),t=qt(t,e),t=await rr(t,e,l,p),await R(),p.media?.image?.autoSiblings){let X=p.publicDir||"public",{rewriteImagesWithSiblings:z}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-f3j1h3ch.js"));t=await z(t,{publicDir:X})}if(p.seo?.enabled)t=vi(t,e,p);let Q=(X,z,te=!0)=>{if(!z)return X;let we=z.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ce=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(X),he=ce?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ce[0]):null;if(we&&ce&&he){if(te){let De=ce.index+he.index;X=X.slice(0,De)+we[0]+X.slice(De+he[0].length)}if(z=z.replace(we[0],"").trim(),!z)return X}if(/<\/head>/i.test(X))return f(X,z);if(/<head\b[^>]*>/i.test(X))return X.replace(/(<head\b[^>]*>)/i,`$1
1372
+ ${z}`);if(/<html\b[^>]*>/i.test(X))return X.replace(/(<html\b[^>]*>)/i,`$1
1318
1373
  <head>
1319
- ${K}
1320
- </head>`);return z},{renderHead:ve,getHead:Se}=await o("stx/head",()=>import("./chunk-ts37jw3s.js")),je=e.__stx_runtime_head??Se();if(je.title||je.meta?.length||je.link?.length){let z=ve(je);if(z)r=J(r,z)}if(ne.headContent)r=J(r,ne.headContent,!je.title);if(p.csp?.enabled&&p.csp.addMetaTag)r=_t(r,p.csp,e);if(p.analytics?.enabled)r=vt(r,p);if(p.heatmap?.enabled)r=Rc(r,p);if(p.pwa?.enabled&&p.pwa.autoInject!==!1){let{injectPwaTags:z}=await o("stx/pwa/inject",()=>import("./chunk-qggwr60r.js"));r=z(r,p)}let _r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(r),Ar=/\bSTX\.\w+/.test(r),Rr=/window\.STX\s*=/.test(r);if(_r&&Ar&&!Rr){let K=`<script data-stx-scoped data-stx-run="once">
1321
- ${ht()}
1322
- </script>`;if(r.includes("</head>")){let Q=D(r),ie=r.slice(0,Q).indexOf("<script");if(ie!==-1){let ge=r.slice(0,ie),De=r.slice(ie);r=ge+K+`
1323
- `+De}else r=f(r,K)}else if(r.includes("<body"))r=r.replace(/<body([^>]*)>/,`<body$1>
1324
- ${K}`);else r=K+`
1325
- `+r}{let{scanScriptTags:z}=await o("stx/signal-processing",()=>import("./chunk-gfe1jrw9.js")),K=[];for(let Q of z(r)){if(!/\bserver\b/i.test(Q.attrs))continue;let ye=Q.start+Q.fullMatch.indexOf(">")+1,ie=Er(r,ye);if(ie===-1)continue;let ge=ie+9;while(ge<r.length&&/\s/.test(r[ge]))ge++;K.push({start:Q.start,end:ge})}if(K.length>0){let Q=Array(K.length+1),ye=0;for(let ie=0;ie<K.length;ie++){let{start:ge,end:De}=K[ie];Q[ie]=r.slice(ye,ge),ye=De}Q[K.length]=r.slice(ye),r=Q.join("")}}let ft=Xs(r,l);if(ft.hasScoped)r=ft.html;let Dr=e.__stx_event_bindings||[],Qe=!1,gt=[],Or=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Pr}=await o("stx/signal-processing",()=>import("./chunk-gfe1jrw9.js"));for(let z of Pr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))gt.push({match:z.fullMatch,attrs:z.attrs,content:z.body});for(let{match:z,attrs:K,content:Q}of gt){Qe=!0;let ye=Q;Fe(Q,l,a.strict,e.__originalFilePath);let ie=await Ve(Q,{eventBindings:Dr,attrs:K,hasColonDirectives:Or,templateContent:n,filePath:l,projectRoot:process.cwd(),production:Ui(a.buildMode,a.minifyClient),serverData:se});r=r.replace(z,()=>ie)}if(Qe)e.__stx_event_bindings=[];if(!Qe&&e.__stxProcessingDepth===1){let z=e.__stx_event_bindings||[];if(z.length>0){let K=vi(z);if(K){let Q=c(r);r=Q===-1?r+K:r.slice(0,Q)+K+`
1326
- `+r.slice(Q)}e.__stx_event_bindings=[]}}if(!p.skipSignalsRuntime&&!Ce(r)&&Cc(r))r=await hr(r,p);if(r=Ec(r),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")r=Tt(r,e.cspNonce);return r}
1327
- export{kt,Me,wc,gs,Wo,qo,lr,i};
1374
+ ${z}
1375
+ </head>`);return X},{renderHead:Se,getHead:$e}=await o("stx/head",()=>import("./chunk-1jk46ve0.js")),He=e.__stx_runtime_head??$e();if(He.title||He.meta?.length||He.link?.length){let X=Se(He);if(X)t=Q(t,X)}if(se.headContent)t=Q(t,se.headContent,!He.title);if(p.csp?.enabled&&p.csp.addMetaTag)t=It(t,p.csp,e);if(p.analytics?.enabled)t=Et(t,p);if(p.heatmap?.enabled)t=Lc(t,p);if(p.pwa?.enabled&&p.pwa.autoInject!==!1){let{injectPwaTags:X}=await o("stx/pwa/inject",()=>import("./chunk-wjafpvjv.js"));t=X(t,p)}let Dr=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(t),Or=/\bSTX\.\w+/.test(t),Pr=/window\.STX\s*=/.test(t);if(Dr&&Or&&!Pr){let z=`<script data-stx-scoped data-stx-run="once">
1376
+ ${St()}
1377
+ </script>`;if(t.includes("</head>")){let te=D(t),ce=t.slice(0,te).indexOf("<script");if(ce!==-1){let he=t.slice(0,ce),De=t.slice(ce);t=he+z+`
1378
+ `+De}else t=f(t,z)}else if(t.includes("<body"))t=t.replace(/<body([^>]*)>/,`<body$1>
1379
+ ${z}`);else t=z+`
1380
+ `+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-5p3825qw.js")),z=[];for(let te of X(t)){if(!/\bserver\b/i.test(te.attrs))continue;let we=te.start+te.fullMatch.indexOf(">")+1,ce=Mr(t,we);if(ce===-1)continue;let he=ce+9;while(he<t.length&&/\s/.test(t[he]))he++;z.push({start:te.start,end:he})}if(z.length>0){let te=Array(z.length+1),we=0;for(let ce=0;ce<z.length;ce++){let{start:he,end:De}=z[ce];te[ce]=t.slice(we,he),we=De}te[z.length]=t.slice(we),t=te.join("")}}let yt=to(t,l);if(yt.hasScoped)t=yt.html;let jr=e.__stx_event_bindings||[],rt=!1,wt=[],Nr=/\s:[a-z][\w.-]*\s*=/.test(t),{scanScriptTags:Br}=await o("stx/signal-processing",()=>import("./chunk-5p3825qw.js"));for(let X of Br(t,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))wt.push({match:X.fullMatch,attrs:X.attrs,content:X.body});for(let{match:X,attrs:z,content:te}of wt){rt=!0;let we=te;Ue(te,l,a.strict,e.__originalFilePath);let ce=await Ke(te,{eventBindings:jr,attrs:z,hasColonDirectives:Nr,templateContent:r,filePath:l,projectRoot:process.cwd(),production:Yi(a.buildMode,a.minifyClient),serverData:oe});t=t.replace(X,()=>ce)}if(rt)e.__stx_event_bindings=[];if(!rt&&e.__stxProcessingDepth===1){let X=e.__stx_event_bindings||[];if(X.length>0){let z=Ti(X);if(z){let te=c(t);t=te===-1?t+z:t.slice(0,te)+z+`
1381
+ `+t.slice(te)}e.__stx_event_bindings=[]}}if(!p.skipSignalsRuntime&&!Te(t)&&Oc(t))t=await xr(t,p);if(t=Nc(t),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")t=Ot(t,e.cspNonce);return t}
1382
+ export{Rt,ze,Tc,vs,Zo,Qo,gr,i};