@stacksjs/stx 0.2.838 → 0.2.840

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 (241) hide show
  1. package/dist/builtins/image-delivery.js +7 -3
  2. package/dist/chunk-02cntwd8.js +2 -0
  3. package/dist/chunk-03v59965.js +2 -0
  4. package/dist/chunk-07hvjvj1.js +2 -0
  5. package/dist/{chunk-gh62p9mx.js → chunk-11y84h2d.js} +2 -2
  6. package/dist/{chunk-3bjnrmha.js → chunk-1b1ntgt7.js} +2 -2
  7. package/dist/{chunk-z25w7kmr.js → chunk-1m16mvt4.js} +4 -4
  8. package/dist/{chunk-4ntm3dtk.js → chunk-23r3rby6.js} +2 -2
  9. package/dist/{chunk-ya6bp08c.js → chunk-2fj5zev7.js} +1 -1
  10. package/dist/{chunk-29f6vmyz.js → chunk-2j5yane9.js} +4 -4
  11. package/dist/chunk-2knr61g3.js +2 -0
  12. package/dist/chunk-2pgc087j.js +2 -0
  13. package/dist/chunk-2vprq4x0.js +54 -0
  14. package/dist/{chunk-ac9ncbfw.js → chunk-321e41ck.js} +3 -3
  15. package/dist/chunk-3gzhh69y.js +2 -0
  16. package/dist/chunk-40bkdswh.js +2 -0
  17. package/dist/chunk-41sh9y5w.js +2 -0
  18. package/dist/chunk-4654xm1h.js +2 -0
  19. package/dist/{chunk-amg6kr1p.js → chunk-4657mnht.js} +4 -4
  20. package/dist/{chunk-s33andzg.js → chunk-4dxq7ft1.js} +2 -2
  21. package/dist/chunk-4eagsz5d.js +2 -0
  22. package/dist/{chunk-f7jgda7x.js → chunk-4j08cbjd.js} +5 -5
  23. package/dist/chunk-4rswqcfc.js +2 -0
  24. package/dist/{chunk-tx8wk6h7.js → chunk-4y6hes3h.js} +2 -2
  25. package/dist/{chunk-6s3hgq9z.js → chunk-57x8wxdf.js} +32 -32
  26. package/dist/chunk-5khpy4na.js +2 -0
  27. package/dist/{chunk-5w0cf32p.js → chunk-5pbxjx8s.js} +1 -1
  28. package/dist/chunk-5t93dqft.js +2 -0
  29. package/dist/chunk-66eba1h4.js +2 -0
  30. package/dist/chunk-6efz68j8.js +2 -0
  31. package/dist/chunk-6n5kew7a.js +3 -0
  32. package/dist/chunk-6nb07mdj.js +2 -0
  33. package/dist/{chunk-2x9zhezb.js → chunk-6wrf6302.js} +2 -2
  34. package/dist/{chunk-1zxahmnh.js → chunk-7cg2f588.js} +1 -1
  35. package/dist/{chunk-nm26vnzd.js → chunk-7dnp8evg.js} +6 -6
  36. package/dist/chunk-7m0r7mq9.js +2 -0
  37. package/dist/{chunk-jstrmqna.js → chunk-7m53tpxn.js} +2 -2
  38. package/dist/{chunk-ckg6q98b.js → chunk-7t57cnz9.js} +5 -5
  39. package/dist/{chunk-jr0r5pzw.js → chunk-7vhm0jj5.js} +2 -2
  40. package/dist/{chunk-mvehmtap.js → chunk-7y5gz0cs.js} +14 -14
  41. package/dist/{chunk-vfj9wp11.js → chunk-8370x30n.js} +2 -2
  42. package/dist/{chunk-65tptp4x.js → chunk-88rwr1w2.js} +2 -2
  43. package/dist/{chunk-txd2js5v.js → chunk-89d3h8mp.js} +14 -14
  44. package/dist/chunk-8c363c2r.js +2 -0
  45. package/dist/{chunk-wfsa28e7.js → chunk-8d4br2j5.js} +9 -9
  46. package/dist/chunk-8gdtys3s.js +2 -0
  47. package/dist/{chunk-em8tv6nz.js → chunk-8pj4v1eh.js} +2 -2
  48. package/dist/{chunk-z0ynyz62.js → chunk-8qbp5skx.js} +7 -7
  49. package/dist/chunk-8w0n2rae.js +2 -0
  50. package/dist/{chunk-c3dg8qdn.js → chunk-97k72dfh.js} +2 -2
  51. package/dist/{chunk-d689fbv1.js → chunk-9razzga7.js} +6 -6
  52. package/dist/{chunk-s53wjw7y.js → chunk-9xps62ek.js} +2 -2
  53. package/dist/{chunk-52g026sc.js → chunk-a1s5wqw4.js} +2 -2
  54. package/dist/chunk-a2p42cxf.js +2 -0
  55. package/dist/{chunk-myje6fhm.js → chunk-a9tzjqny.js} +5 -5
  56. package/dist/{chunk-ax624h16.js → chunk-azderqyk.js} +7 -7
  57. package/dist/chunk-b0fkvrat.js +2 -0
  58. package/dist/chunk-b3fx75th.js +2 -0
  59. package/dist/{chunk-20mmryy5.js → chunk-b685aqy4.js} +3 -3
  60. package/dist/chunk-b6w3457c.js +2 -0
  61. package/dist/{chunk-j59js1nh.js → chunk-b90xw7v4.js} +3 -3
  62. package/dist/{chunk-fvgk1w9s.js → chunk-bp918end.js} +2 -2
  63. package/dist/chunk-bq7qcndg.js +3 -0
  64. package/dist/chunk-c18pafmf.js +3 -0
  65. package/dist/chunk-c87zgwzn.js +2 -0
  66. package/dist/{chunk-c9vxm8yq.js → chunk-ca3c5qx2.js} +31 -31
  67. package/dist/{chunk-3yggtch5.js → chunk-chjdnmqv.js} +10 -10
  68. package/dist/{chunk-bky02g7k.js → chunk-d0dzzpfx.js} +2 -2
  69. package/dist/chunk-d44g9sek.js +2 -0
  70. package/dist/chunk-d5vr9g4b.js +2 -0
  71. package/dist/{chunk-yw1s8kyj.js → chunk-dgn87554.js} +4 -4
  72. package/dist/{chunk-fzdgevxr.js → chunk-ebxz30e5.js} +56 -56
  73. package/dist/{chunk-11fn3hgv.js → chunk-ecjx9z8a.js} +2 -2
  74. package/dist/{chunk-33czswpt.js → chunk-f1hkagxk.js} +3 -3
  75. package/dist/chunk-fpn5txnm.js +2 -0
  76. package/dist/chunk-g6r2313a.js +2 -0
  77. package/dist/{chunk-55e46spy.js → chunk-g7rsd8st.js} +5 -5
  78. package/dist/chunk-g957a2m3.js +2 -0
  79. package/dist/chunk-ga8waz0a.js +2 -0
  80. package/dist/chunk-gaxx0z19.js +2 -0
  81. package/dist/chunk-gbcwna5q.js +2 -0
  82. package/dist/chunk-gft9pg9n.js +2 -0
  83. package/dist/chunk-h8h79939.js +2 -0
  84. package/dist/{chunk-q5pwvr98.js → chunk-jc5y35b7.js} +1 -1
  85. package/dist/chunk-jgx0ex9p.js +3 -0
  86. package/dist/{chunk-vfxkn1pe.js → chunk-kd6r7z27.js} +3 -3
  87. package/dist/chunk-ksc83y9t.js +2 -0
  88. package/dist/{chunk-gw83680k.js → chunk-kvpzxnww.js} +5 -5
  89. package/dist/{chunk-rnm8ejpz.js → chunk-m5bj2jnb.js} +2 -2
  90. package/dist/{chunk-ckasfph2.js → chunk-m7acbayx.js} +5 -5
  91. package/dist/chunk-mh4kpnjr.js +2 -0
  92. package/dist/{chunk-b7tb00nz.js → chunk-mhyd24bg.js} +2 -2
  93. package/dist/chunk-n7pvz99f.js +2 -0
  94. package/dist/chunk-ndah5rvs.js +2 -0
  95. package/dist/{chunk-n4qznmkm.js → chunk-ngnr831a.js} +5 -5
  96. package/dist/chunk-nhk0aat9.js +2 -0
  97. package/dist/{chunk-t2vmk8tf.js → chunk-ns0171xk.js} +3 -3
  98. package/dist/chunk-p2e02hh7.js +2 -0
  99. package/dist/{chunk-cwfavkk0.js → chunk-p65ax8s0.js} +2 -2
  100. package/dist/{chunk-dv11h4f0.js → chunk-p9d2txcg.js} +1 -1
  101. package/dist/chunk-pjkdn8zf.js +2 -0
  102. package/dist/{chunk-pft65534.js → chunk-pqn7r8fw.js} +1 -1
  103. package/dist/{chunk-29bt1fbn.js → chunk-px5kda00.js} +5 -5
  104. package/dist/{chunk-xtqapjz3.js → chunk-q0s0kc66.js} +2 -2
  105. package/dist/{chunk-b1m41fwr.js → chunk-q1nj47gn.js} +3 -3
  106. package/dist/chunk-q88w2rv9.js +2 -0
  107. package/dist/chunk-qb3c05qq.js +2 -0
  108. package/dist/chunk-qcars8ar.js +2 -0
  109. package/dist/{chunk-v3xyb3ws.js → chunk-qfvddpcg.js} +2 -2
  110. package/dist/{chunk-e75dntfb.js → chunk-qk079ca7.js} +2 -2
  111. package/dist/{chunk-zj4s3rnw.js → chunk-qzms4d8s.js} +5 -5
  112. package/dist/chunk-r5bhgyes.js +2 -0
  113. package/dist/{chunk-64eeb5p5.js → chunk-rb17ssxh.js} +2 -2
  114. package/dist/{chunk-7bvvv74e.js → chunk-rk2ex6qx.js} +3 -3
  115. package/dist/chunk-rmc6dfj4.js +2 -0
  116. package/dist/chunk-rzfbffnv.js +2 -0
  117. package/dist/{chunk-r32q8mjw.js → chunk-s2k1x2rn.js} +3 -3
  118. package/dist/chunk-spdh99jy.js +2 -0
  119. package/dist/chunk-st75663x.js +2 -0
  120. package/dist/chunk-sv2d6nfe.js +2 -0
  121. package/dist/{chunk-7k9yahng.js → chunk-t0jed809.js} +6 -6
  122. package/dist/{chunk-s5dhvnnd.js → chunk-t3p0jy0s.js} +6 -6
  123. package/dist/{chunk-f49x34sr.js → chunk-v3q126ys.js} +2 -2
  124. package/dist/{chunk-kw5gra2z.js → chunk-v4ybemgb.js} +2 -2
  125. package/dist/{chunk-trwe0mfa.js → chunk-vbw9jhz2.js} +103 -103
  126. package/dist/chunk-vcx6dy59.js +2 -0
  127. package/dist/chunk-vv7b8p5z.js +2 -0
  128. package/dist/{chunk-wzjdq7d6.js → chunk-vwddsdk5.js} +9 -9
  129. package/dist/{chunk-vyv76w55.js → chunk-wbgc2n04.js} +2 -2
  130. package/dist/chunk-x0ygwk9x.js +2 -0
  131. package/dist/{chunk-nyg0nbjj.js → chunk-x110ssw2.js} +3 -3
  132. package/dist/chunk-x42tsdbx.js +2 -0
  133. package/dist/{chunk-sfsek961.js → chunk-x4f7efgp.js} +3 -3
  134. package/dist/chunk-x5wkbcsf.js +2 -0
  135. package/dist/{chunk-w0a6yz73.js → chunk-xbcnnk8x.js} +5 -5
  136. package/dist/{chunk-38ncpvww.js → chunk-xdzy4pm0.js} +2 -2
  137. package/dist/{chunk-84nw3921.js → chunk-xmsf1bnx.js} +3 -3
  138. package/dist/{chunk-4sv740a5.js → chunk-xqtt5t6d.js} +6 -6
  139. package/dist/{chunk-nmvhktsg.js → chunk-xz2569ra.js} +6 -6
  140. package/dist/chunk-y64qhgv1.js +2 -0
  141. package/dist/{chunk-52t0qpx6.js → chunk-y68xstqy.js} +1 -1
  142. package/dist/{chunk-evgghnjc.js → chunk-y8zzvzww.js} +4 -4
  143. package/dist/chunk-yg5a54pj.js +2 -0
  144. package/dist/chunk-yjskeqaj.js +2 -0
  145. package/dist/chunk-ywpan1k5.js +2 -0
  146. package/dist/chunk-yxqzarzh.js +2 -0
  147. package/dist/chunk-z4g64re8.js +3 -0
  148. package/dist/chunk-z9xjhc5m.js +42 -0
  149. package/dist/{chunk-ms3v5nat.js → chunk-zg44cf8a.js} +7 -7
  150. package/dist/{chunk-s6r54dyf.js → chunk-zjqvbcwa.js} +2 -2
  151. package/dist/chunk-znwc8gta.js +2 -0
  152. package/dist/{chunk-917v0bar.js → chunk-zrp4159x.js} +12 -12
  153. package/dist/{chunk-0rvntfhj.js → chunk-zvy88beh.js} +3 -3
  154. package/dist/cli.js +20 -20
  155. package/dist/compression.js +3 -3
  156. package/dist/craft-entry.js +2 -2
  157. package/dist/craft.js +2 -2
  158. package/dist/dev-server/port-utils.js +2 -1
  159. package/dist/expressions.js +1 -1
  160. package/dist/html-masking.d.ts +2 -0
  161. package/dist/html-masking.js +23 -0
  162. package/dist/image-optimization/processor.js +2 -2
  163. package/dist/includes.js +5 -4
  164. package/dist/misc-directives.js +2 -2
  165. package/dist/native/runtime/craft-bridge.js +2 -10
  166. package/dist/native/runtime/craft.d.ts +11 -0
  167. package/dist/native/runtime/navigation-chrome.d.ts +2 -0
  168. package/dist/native/runtime/navigation-chrome.js +25 -3
  169. package/dist/pwa.js +3 -3
  170. package/dist/ssg.js +8 -11
  171. package/dist/utils.js +16 -13
  172. package/package.json +5 -5
  173. package/dist/chunk-0a36jnq4.js +0 -2
  174. package/dist/chunk-0c02182b.js +0 -42
  175. package/dist/chunk-0rnfywsx.js +0 -2
  176. package/dist/chunk-1bpx9b0m.js +0 -2
  177. package/dist/chunk-1g6xxftp.js +0 -2
  178. package/dist/chunk-2fcg7aws.js +0 -2
  179. package/dist/chunk-2nxxhcyy.js +0 -2
  180. package/dist/chunk-4wgfqa56.js +0 -2
  181. package/dist/chunk-5p6x0ztt.js +0 -2
  182. package/dist/chunk-6aak0b7c.js +0 -2
  183. package/dist/chunk-6c6m6p9t.js +0 -3
  184. package/dist/chunk-6g8byhwn.js +0 -2
  185. package/dist/chunk-70akxpk5.js +0 -2
  186. package/dist/chunk-72gq0ywg.js +0 -2
  187. package/dist/chunk-72n804gy.js +0 -2
  188. package/dist/chunk-7efkc3gk.js +0 -2
  189. package/dist/chunk-88zc5chj.js +0 -2
  190. package/dist/chunk-8gg8gn87.js +0 -2
  191. package/dist/chunk-8wv2p899.js +0 -2
  192. package/dist/chunk-9w3r1ch2.js +0 -3
  193. package/dist/chunk-a1hxz8q4.js +0 -2
  194. package/dist/chunk-a579jdwb.js +0 -2
  195. package/dist/chunk-ahd8jdzx.js +0 -2
  196. package/dist/chunk-aqrx322x.js +0 -2
  197. package/dist/chunk-ay7ggc4k.js +0 -2
  198. package/dist/chunk-bc4x45vx.js +0 -2
  199. package/dist/chunk-c77vxvp3.js +0 -2
  200. package/dist/chunk-c7hw37ww.js +0 -2
  201. package/dist/chunk-cfrgrnej.js +0 -2
  202. package/dist/chunk-cw8vpk41.js +0 -2
  203. package/dist/chunk-d96b9qgj.js +0 -2
  204. package/dist/chunk-db1c0c3c.js +0 -2
  205. package/dist/chunk-f6vzn90z.js +0 -2
  206. package/dist/chunk-fd3815fe.js +0 -2
  207. package/dist/chunk-gtj8wy95.js +0 -2
  208. package/dist/chunk-h4tbpr7p.js +0 -2
  209. package/dist/chunk-h5aaq0j8.js +0 -2
  210. package/dist/chunk-j0j4p9t1.js +0 -2
  211. package/dist/chunk-j0w048sj.js +0 -2
  212. package/dist/chunk-jvg9e6t6.js +0 -2
  213. package/dist/chunk-k761q7s7.js +0 -2
  214. package/dist/chunk-m3tnxk01.js +0 -2
  215. package/dist/chunk-mdtysd2d.js +0 -2
  216. package/dist/chunk-nmtya57z.js +0 -3
  217. package/dist/chunk-nxfyjw59.js +0 -2
  218. package/dist/chunk-pe5qqem0.js +0 -2
  219. package/dist/chunk-pwv77cyb.js +0 -2
  220. package/dist/chunk-qs0vtav5.js +0 -2
  221. package/dist/chunk-qv21bsa1.js +0 -2
  222. package/dist/chunk-rrba4t7k.js +0 -2
  223. package/dist/chunk-s3j5vxy9.js +0 -3
  224. package/dist/chunk-ssrxqj55.js +0 -2
  225. package/dist/chunk-t612xpa4.js +0 -2
  226. package/dist/chunk-tesbhpbp.js +0 -2
  227. package/dist/chunk-tkgkdf93.js +0 -2
  228. package/dist/chunk-tvw571ab.js +0 -2
  229. package/dist/chunk-txzap6yn.js +0 -2
  230. package/dist/chunk-vhrq4xjf.js +0 -2
  231. package/dist/chunk-vqpypnys.js +0 -2
  232. package/dist/chunk-vv3w8z4v.js +0 -2
  233. package/dist/chunk-vypnjn9g.js +0 -3
  234. package/dist/chunk-w39cfxa6.js +0 -2
  235. package/dist/chunk-wj937ceq.js +0 -2
  236. package/dist/chunk-xbavxkm5.js +0 -2
  237. package/dist/chunk-xrspzeqx.js +0 -2
  238. package/dist/chunk-y41hhypj.js +0 -2
  239. package/dist/chunk-yv9589qr.js +0 -54
  240. package/dist/chunk-z0yq548d.js +0 -2
  241. package/dist/chunk-zfjbwp54.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{jt,ae,A,u,f,P,t,ce,K,l,_e,Ci,z,_n,Ei,zt,Ti,il,Rr,al,at,cl,Ar,ll,Cn,$i,ul,Pr,Or,Ce,Ri}from"./chunk-txd2js5v.js";import{li,Ac,o,C,Ne,fn,gn,Me,fe,J,xr,mn,Fs,Fc,zc,yn,Cr,Hs,Vs,Hc,mi,Vc,Uc,Wc,qc,Le,je,Us,ze,r,vn,h,p,W,Q,ke,_}from"./chunk-trwe0mfa.js";import{Lt}from"./chunk-vfj9wp11.js";import{Sn}from"./chunk-cwfavkk0.js";import{b}from"./chunk-wzjdq7d6.js";import{mr,Ps}from"./chunk-29f6vmyz.js";import{gc,mc,pr,et,hc,O}from"./chunk-3yggtch5.js";import{ei,ti,ni,ri}from"./chunk-ms3v5nat.js";import{lc,ds}from"./chunk-0c02182b.js";import{as,cs,ls}from"./chunk-yv9589qr.js";import{ms,qo,Ko,hs,ys,Xo}from"./chunk-wfsa28e7.js";import{ps,zo}from"./chunk-j59js1nh.js";import{Lo}from"./chunk-s33andzg.js";import{oe,Ho,Vo,Uo}from"./chunk-3bjnrmha.js";import{cr,we,dc,lr,pc}from"./chunk-4sv740a5.js";import{B,Ze}from"./chunk-ybq56wam.js";import{yc,bc}from"./chunk-t2vmk8tf.js";import{E,En,Ai}from"./chunk-jr0r5pzw.js";import Kn from"fs";import ie from"path";function dt(s){let e=fn(s),c=e.find((x)=>x.closing&&x.name.toLowerCase()==="head");if(!c)return s;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),g=0,n=[];for(let x=0;x<e.length;x++){let w=e[x];if(w.start<c.end)continue;let v=w.name.toLowerCase();if(a.has(v)){g=Math.max(0,g+(w.closing?-1:w.selfClosing?0:1));continue}if(v!=="style"||w.closing||g>0)continue;let k=e[x+1];if(k?.name.toLowerCase()==="style"&&k.closing){if(/@scope\s*\{/.test(s.slice(w.end,k.start)))continue;n.push({start:w.start,end:k.end}),x++}}if(!n.length)return s;let d=n.map((x)=>s.slice(x.start,x.end)).join(`
2
+ import{Bt,ae,A,u,f,P,t,ce,K,l,_e,Ei,z,Cn,Ti,Ht,$i,al,Ar,cl,at,ll,Pr,ul,En,Ri,dl,Ir,Nr,Ce,Ai}from"./chunk-89d3h8mp.js";import{ui,Pc,o,C,Ne,gn,mn,Me,fe,J,xr,hn,zs,zc,Hc,bn,Er,Vs,Us,Vc,hi,Uc,Wc,qc,Kc,Le,je,Ws,ze,r,xn,h,p,W,Q,ke,_}from"./chunk-vbw9jhz2.js";import{jt}from"./chunk-8370x30n.js";import{kn}from"./chunk-p65ax8s0.js";import{b}from"./chunk-vwddsdk5.js";import{hr,Is}from"./chunk-2j5yane9.js";import{mc,hc,fr,et,yc,O}from"./chunk-chjdnmqv.js";import{ti,ni,ri,si}from"./chunk-zg44cf8a.js";import{uc,ps}from"./chunk-z9xjhc5m.js";import{cs,ls,us}from"./chunk-2vprq4x0.js";import{hs,Ko,Xo,ys,bs,Go}from"./chunk-8d4br2j5.js";import{gs,Ho}from"./chunk-b90xw7v4.js";import{jo}from"./chunk-4dxq7ft1.js";import{oe,Vo,Uo,Wo}from"./chunk-1b1ntgt7.js";import{lr,we,pc,ur,fc}from"./chunk-xqtt5t6d.js";import{B,Ze}from"./chunk-ybq56wam.js";import{bc,wc}from"./chunk-ns0171xk.js";import{E,Tn,Pi}from"./chunk-7vhm0jj5.js";import Kn from"fs";import ie from"path";function dt(s){let e=gn(s),c=e.find((x)=>x.closing&&x.name.toLowerCase()==="head");if(!c)return s;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),g=0,n=[];for(let x=0;x<e.length;x++){let w=e[x];if(w.start<c.end)continue;let v=w.name.toLowerCase();if(a.has(v)){g=Math.max(0,g+(w.closing?-1:w.selfClosing?0:1));continue}if(v!=="style"||w.closing||g>0)continue;let k=e[x+1];if(k?.name.toLowerCase()==="style"&&k.closing){if(/@scope\s*\{/.test(s.slice(w.end,k.start)))continue;n.push({start:w.start,end:k.end}),x++}}if(!n.length)return s;let d=n.map((x)=>s.slice(x.start,x.end)).join(`
3
3
  `),y=[s.slice(0,c.start),d,`
4
4
  `],m=c.start;for(let x of n)y.push(s.slice(m,x.start)),m=x.end;return y.push(s.slice(m)),y.join("")}function pt(){return`
5
5
  // STX Lifecycle Runtime
@@ -349,7 +349,7 @@ else {
349
349
 
350
350
  console.log('[stx] Lifecycle runtime initialized');
351
351
  })();
352
- `}function Ge(s){return Symbol(s)}var xs=Ge("theme"),ks=Ge("router"),Ss=Ge("i18n");import*as gt from"crypto";function ft(s){let e=/\$(\w+)\./g,c=[],a;while((a=e.exec(s))!==null)if(!c.includes(a[1]))c.push(a[1]);return c}function Ir(){return`stx-${gt.randomBytes(4).toString("hex")}`}function Lr(s){return/\$\w+\./.test(s)}function jr(s){if(!/\{\{[^}]*\$\w/.test(s)||!/\$\w+\./.test(s))return{html:s,bindings:[],stores:new Set};let e=[],c=new Set,a=/<(\w+)([^>]*?)(\s*\/?>)/g,g=s;return g=g.replace(a,(n,d,y,m)=>{if(["script","style","template"].includes(d.toLowerCase()))return n;if(!y.includes("{{"))return n;let x=[],w=!1,v=y,k=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,S=[...y.matchAll(k)];for(let R of S){let D=R[0],j=R[1],N=R[2];if(Lr(N)){w=!0;let F=N.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(F){let I=F[1];if(x.push({attr:j,expr:I,fullMatch:D,originalAttr:j}),ft(I).forEach((H)=>c.add(H)),j==="text")v=v.replace(D,"");else if(j==="class")v=v.replace(D,'class=""');else if(j==="disabled"||j==="hidden")v=v.replace(D,"");else v=v.replace(D,`${j}=""`)}}}if(!w)return n;let M=v.match(/\bid\s*=\s*"([^"]+)"/),T;if(M)T=M[1];else T=Ir(),v=` id="${T}"${v}`;for(let R of x)e.push({elementId:T,attribute:R.attr,expression:R.expr,stores:ft(R.expr)});return`<${d}${v}${m}`}),{html:g,bindings:e,stores:c}}function Nr(s,e){if(s.length===0)return"";let c=Array.from(e),a=`
352
+ `}function Ge(s){return Symbol(s)}var xs=Ge("theme"),ks=Ge("router"),Ss=Ge("i18n");import*as gt from"crypto";function ft(s){let e=/\$(\w+)\./g,c=[],a;while((a=e.exec(s))!==null)if(!c.includes(a[1]))c.push(a[1]);return c}function Dr(){return`stx-${gt.randomBytes(4).toString("hex")}`}function Or(s){return/\$\w+\./.test(s)}function Lr(s){if(!/\{\{[^}]*\$\w/.test(s)||!/\$\w+\./.test(s))return{html:s,bindings:[],stores:new Set};let e=[],c=new Set,a=/<(\w+)([^>]*?)(\s*\/?>)/g,g=s;return g=g.replace(a,(n,d,y,m)=>{if(["script","style","template"].includes(d.toLowerCase()))return n;if(!y.includes("{{"))return n;let x=[],w=!1,v=y,k=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,S=[...y.matchAll(k)];for(let R of S){let D=R[0],j=R[1],N=R[2];if(Or(N)){w=!0;let F=N.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(F){let I=F[1];if(x.push({attr:j,expr:I,fullMatch:D,originalAttr:j}),ft(I).forEach((H)=>c.add(H)),j==="text")v=v.replace(D,"");else if(j==="class")v=v.replace(D,'class=""');else if(j==="disabled"||j==="hidden")v=v.replace(D,"");else v=v.replace(D,`${j}=""`)}}}if(!w)return n;let M=v.match(/\bid\s*=\s*"([^"]+)"/),T;if(M)T=M[1];else T=Dr(),v=` id="${T}"${v}`;for(let R of x)e.push({elementId:T,attribute:R.attr,expression:R.expr,stores:ft(R.expr)});return`<${d}${v}${m}`}),{html:g,bindings:e,stores:c}}function jr(s,e){if(s.length===0)return"";let c=Array.from(e),a=`
353
353
  <script>
354
354
  (function() {
355
355
  'use strict';
@@ -507,7 +507,7 @@ else {
507
507
  }
508
508
  })();
509
509
  </script>
510
- `,a}function mt(s){let{html:e,bindings:c,stores:a}=jr(s);if(c.length===0)return s;let g=Nr(c,a),n=e.lastIndexOf("</body>");if(n!==-1)return e.slice(0,n)+g+e.slice(n);return e+g}function Hr(s){let e=s.analytics;if(!e?.enabled)return"";switch(e.driver){case"fathom":return Br(e);case"google-analytics":return Fr(e);case"plausible":return Ur(e);case"self-hosted":return qr(e);case"custom":return Vr(e);default:return""}}function Br(s){let e=s.fathom;if(!e?.siteId)return"";let c=e.scriptUrl||"https://cdn.usefathom.com/script.js",a=e.defer!==!1?" defer":"",g=[`data-site="${ue(e.siteId)}"`];if(e.honorDnt)g.push('data-honor-dnt="true"');if(e.spa)g.push('data-spa="auto"');if(e.canonical)g.push(`data-canonical="${ue(e.canonical)}"`);if(e.auto===!1)g.push('data-auto="false"');return`
510
+ `,a}function mt(s){let{html:e,bindings:c,stores:a}=Lr(s);if(c.length===0)return s;let g=jr(c,a),n=e.lastIndexOf("</body>");if(n!==-1)return e.slice(0,n)+g+e.slice(n);return e+g}function Hr(s){let e=s.analytics;if(!e?.enabled)return"";switch(e.driver){case"fathom":return Br(e);case"google-analytics":return Fr(e);case"plausible":return Ur(e);case"self-hosted":return qr(e);case"custom":return Vr(e);default:return""}}function Br(s){let e=s.fathom;if(!e?.siteId)return"";let c=e.scriptUrl||"https://cdn.usefathom.com/script.js",a=e.defer!==!1?" defer":"",g=[`data-site="${ue(e.siteId)}"`];if(e.honorDnt)g.push('data-honor-dnt="true"');if(e.spa)g.push('data-spa="auto"');if(e.canonical)g.push(`data-canonical="${ue(e.canonical)}"`);if(e.auto===!1)g.push('data-auto="false"');return`
511
511
  <!-- Fathom Analytics -->
512
512
  <script src="${ue(c)}" ${g.join(" ")}${a}></script>
513
513
  `}function Fr(s){let e=s.googleAnalytics;if(!e?.measurementId)return"";let c=ue(e.measurementId),a=e.debug?`gtag('config', '${c}', { 'debug_mode': true });`:"";return`
@@ -564,24 +564,24 @@ ${e.inlineScript}
564
564
  `;if(!e.scriptUrl)return"";let c=[];if(e.scriptId)c.push(`id="${ue(e.scriptId)}"`);if(e.attributes)for(let[g,n]of Object.entries(e.attributes))c.push(`${ue(g)}="${ue(n)}"`);return`
565
565
  <!-- Custom Analytics -->
566
566
  <script${c.length>0?` ${c.join(" ")}`:""} src="${ue(e.scriptUrl)}" defer></script>
567
- `}function ht(s,e){let c=Hr(e);if(!c)return s;if(!s.includes("</head>")){let a=s.lastIndexOf("</body>");if(a!==-1)return s.slice(0,a)+c+s.slice(a);return s+c}return s.replace("</head>",`${c}</head>`)}function ue(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bt(s){let e=s.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function yt(s){let e=s?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Wr from"fs";import Je from"path";import{createHighlighter as Xr}from"ts-syntax-highlighter";var Qe=new Map;async function Ae(s,e={}){try{if(!await r(s))throw Error(`Markdown file not found: ${s}`);let a=(await Wr.promises.stat(s)).mtime.getTime();if(e.cache&&Qe.has(s)){let v=Qe.get(s);if(v.updatedAt>=a)return{content:v.content,data:v.data}}let g=await Bun.file(s).text(),{data:n,content:d}=pr(g),y=e.markdown||O.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},x=et(d,{gfm:!0});if(y.syntaxHighlighting?.enabled&&y.syntaxHighlighting?.serverSide)x=await zr(x,y.syntaxHighlighting?.defaultTheme||"github-dark",y.syntaxHighlighting?.highlightUnknownLanguages||!1);let w={content:x,data:n||{}};if(e.cache)Qe.set(s,{...w,updatedAt:a});return w}catch(c){if(e.debug)console.error(`Error reading/parsing markdown file ${s}:`,c);let a=c instanceof Error?c.message:String(c);return{content:h("Markdown File",`Error reading/parsing markdown file: ${a}`,s,"",0,""),data:{}}}}var Ue=null;async function zr(s,e,c){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Ue)try{Ue=await Xr({theme:e||"github-dark",cache:!0})}catch(y){return console.error("Failed to initialize ts-syntax-highlighter:",y),s}let g=async(y,m,x,w)=>{let v=w.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),k=x||(c?"text":"");if(!k)return y;try{if(!Ue.getSupportedLanguages().includes(k))return y;return(await Ue.highlight(v,k,{theme:e})).html}catch(S){console.error(`Error highlighting code block with language ${x}:`,S)}return y},n=s,d=s.matchAll(a);for(let y of d){let[m,x,w,v]=y,k=await g(m,x,w,v);n=n.replace(m,k)}return n}async function wt(s,e,c="",a={}){return await Kr(s,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(d,y,m,x)=>{try{let w=y;if(!Je.isAbsolute(y))w=Je.resolve(Je.dirname(c),y);let v={};if(m)try{try{v=JSON.parse(m)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let j=m.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let N of j){let F=N.indexOf(":");if(F>0){let I=N.substring(0,F).trim(),L=N.substring(F+1).trim(),H=L.startsWith('"')&&L.endsWith('"'),V=L.startsWith("'")&&L.endsWith("'");if(H||V)L=L.substring(1,L.length-1);v[I]=L}}}}catch(D){if(a.debug)console.error("Error parsing context in @markdown-file directive:",D)}let{content:k,data:S}=await Ae(w,a),M={...e,...S,...v},T=k,R=/\{\{([^}]+)\}\}/g;return T=T.replace(R,(D,j)=>{let N=j.trim();return M[N]!==void 0?String(M[N]):D}),T}catch(w){let v=w instanceof Error?w.message:String(w);return h("Markdown File",`Error including markdown file: ${v}`,c,s,x,d)}})}async function Kr(s,e,c){let a=[],g;while((g=e.exec(s))!==null){let y=g[0],m=g.index,x=g;a.push(c(...x).then((w)=>({match:y,replacement:w,index:m})))}let n=await Promise.all(a);n.sort((y,m)=>m.index-y.index);let d=s;for(let{match:y,replacement:m}of n)d=d.replace(y,()=>m);return d}var vt=new WeakMap;function xt(s=16){let e=new Uint8Array(s);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function qe(s,e){if(!s)return e?.nonceGenerator?.()??xt();let c=vt.get(s);if(!c)c=e?.nonceGenerator?.()??xt(),vt.set(s,c);return c}function Gr(s,e){let c=[];for(let[a,g]of Object.entries(s)){if(g===void 0||g===null)continue;if(typeof g==="boolean"){if(g)c.push(a);continue}if(Array.isArray(g)){let n=[...g];if(e&&(a==="script-src"||a==="style-src"))n=n.filter((d)=>!d.startsWith("'nonce-")),n.push(`'nonce-${e}'`);if(n.length>0)c.push(`${a} ${n.join(" ")}`)}}return c.join("; ")}function kt(s,e){return`<meta http-equiv="Content-Security-Policy" content="${Gr(s,e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}function St(s,e,c){if(!e.enabled||!e.addMetaTag)return s;if(s.includes('http-equiv="Content-Security-Policy"'))return s;if(!s.includes("<head>")&&!s.includes("<head "))return s;let a=e.useNonce?qe(c,e):void 0,g=kt(e.directives,a);return s.replace(/<head([^>]*)>/,`<head$1>
568
- ${g}`)}function $t(s,e){let c=s;return c=c.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),c=c.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),c}function Et(s,e,c,a){let g=s,n=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!n?.enabled||!n.directives)return"<!-- CSP not configured -->";let d=n.useNonce?qe(e,n):void 0;return kt(n.directives,d)}),g=g.replace(/@cspNonce\b/g,()=>{if(!n?.enabled||!n.useNonce)return"";return qe(e,n)}),n?.enabled&&n.useNonce)e.cspNonce=qe(e,n);return g}import Zr from"crypto";var Jr=40,Tt="_token",Ye=null;function Qr(s=Jr){let e=Zr.randomBytes(Math.ceil(s/2)).toString("hex").slice(0,s);return Ye=e,e}function Yr(){if(!Ye)Qr();return Ye}function en(s=Tt){let e=Yr();return`<input type="hidden" name="${s}" value="${e}">`}function _t(s){return s.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,c,a)=>en(a||Tt))}async function Ct(s,e,c,a){if(!a.customDirectives||a.customDirectives.length===0)return s;let g=s;for(let n of a.customDirectives){if(!n.name||typeof n.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",n);continue}if(n.hasEndTag)g=await tn(g,n,e,c,a);else g=await rn(g,n,e,c,a)}return g}async function tn(s,e,c,a,g){let{name:n,handler:d}=e,y=`@${n}`,m=`@end${n}`,x=s,w=jt(`${y}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${m}`,"g"),v=[],k=w.exec(x);while(k!==null){let[S,M="",T=""]=k,R=k.index||0;try{let D=M?At(e,M):[],j=T.trim(),N=await d(j,D,c,a);v.push({original:S,processed:N,startIndex:R})}catch(D){let j=D instanceof Error?D.message:String(D);if(g.debug)console.error(`Error processing custom directive @${n}:`,D);v.push({original:S,processed:l("CustomDirective",`Error in @${n}${M?`(${M})`:""}: ${j}`,t.EVALUATION_ERROR),startIndex:R})}k=w.exec(x)}for(let S=v.length-1;S>=0;S--){let{original:M,processed:T}=v[S];x=x.replace(M,T)}return x}async function rn(s,e,c,a,g){let{name:n,handler:d}=e,y=s,m=[],x=[];if(e.rawParams){for(let k of Ei(y,jt(`(?<![\\w$@])@${n}\\s*\\(`,"g")))if(k.end!==-1)x.push({fullMatch:k.call,paramString:k.args,startIndex:k.start})}else{let k=jt(`@${n}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");k.lastIndex=0;let S=k.exec(y);while(S!==null)x.push({fullMatch:S[0],paramString:S[1]??"",startIndex:S.index||0}),S=k.exec(y)}for(let{fullMatch:k,paramString:S,startIndex:M}of x)try{let T=At(e,S),R=await d("",T,c,a);m.push({original:k,processed:R,startIndex:M})}catch(T){let R=T instanceof Error?T.message:String(T);if(g.debug)console.error(`Error processing custom directive @${n}:`,T);m.push({original:k,processed:l("CustomDirective",`Error in @${n}(${S}): ${R}`,t.EVALUATION_ERROR),startIndex:M})}let w=jt(`@${n}(?!\\w)(?!\\s*\\()`,"g"),v=w.exec(y);while(v!==null){let[k]=v,S=v.index||0;try{let M=await d("",[],c,a);m.push({original:k,processed:M,startIndex:S})}catch(M){let T=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${n}:`,M);m.push({original:k,processed:l("CustomDirective",`Error in @${n}: ${T}`,t.EVALUATION_ERROR),startIndex:S})}v=w.exec(y)}for(let k=m.length-1;k>=0;k--){let{original:S,processed:M}=m[k];y=y.replace(S,M)}return y}function At(s,e){return s.rawParams?zt(e):nn(e)}function nn(s){if(!s.trim())return[];let e=[],c="",a=!1,g="";for(let n=0;n<s.length;n++){let d=s[n];if((d==='"'||d==="'")&&(n===0||s[n-1]!=="\\"))if(!a)a=!0,g=d;else if(d===g)a=!1;else c+=d;else if(d===","&&!a)e.push(c.trim()),c="";else c+=d}if(c.trim())e.push(c.trim());return e.map((n)=>{let d=n.trim();if(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))return d.substring(1,d.length-1);return d})}var Rt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Mt=/^[A-Za-z_$][\w$]*$/,sn=new Set(["light","dark","system"]);function xe(s,e){if(typeof s!=="string"||s.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function on(s){if(!s||typeof s!=="object"||Array.isArray(s))throw Error("@appearanceBootstrap expects an options object");let e=s,{appearance:c,colorMode:a}=e;if(xe(e.storageKey,"storageKey"),c!==void 0&&(!c||typeof c!=="object"||Array.isArray(c)))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(xe(a.key,"colorMode.key"),xe(a.attribute,"colorMode.attribute"),xe(a.default,"colorMode.default"),!Mt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Rt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!sn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(c){if(xe(c.key,"appearance.key"),xe(c.attribute,"appearance.attribute"),xe(c.default,"appearance.default"),!Mt.test(c.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Rt.test(c.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(c.allowed)||c.allowed.length===0||c.allowed.some((n)=>typeof n!=="string"||n.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!c.allowed.includes(c.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:c.key,attribute:c.attribute,allowed:[...new Set(c.allowed)],default:c.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function an(s){return JSON.stringify(s).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function cn(s){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${an(s)};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 ln(s,e){let c=1,a=null,g=!1;for(let n=e+1;n<s.length;n++){let d=s[n];if(g){g=!1;continue}if(a){if(d==="\\")g=!0;else if(d===a)a=null;continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="(")c++;else if(d===")"&&--c===0)return n}return-1}function Dt(s,e){let c=s,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(c))!==null){let n=g.index+g[0].length-1,d=ln(c,n);if(d===-1)throw Error("@appearanceBootstrap has an unclosed options object");let y=c.slice(n+1,d).trim(),m=u(`(${y})`,e),x=cn(on(m));c=c.slice(0,g.index)+x+c.slice(d+1),a.lastIndex=g.index+x.length}return c}import un from"crypto";function Y(s){return W(String(s??""))}var Ot={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ve(s,e,c,a){let g=s||e;return c?`${g} ${a}`:g}function ge(s){return String(s).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Re(s,e){if(/\bid\s*=/i.test(s))return"";return` id="${Y(e)}"`}function tt(s,e,c){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(c))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(c))a+=` aria-describedby="${Y(`${ge(s)}-error`)}"`;return a}function dn(){return un.randomUUID()}function We(s,e){let c=s;return c=c.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=dn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Y(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),c=c.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let n=g.toUpperCase();if(g&&!["GET","POST"].includes(n))return`<input type="hidden" name="_method" value="${Y(n)}">`;return a}),c}function Pt(s,e,c=Ot){let a=s;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,n,d,y,m,x="")=>{let w=n||d||"POST",v=y||m||"",k=ye(x),S=w.toUpperCase(),M=["GET","POST"].includes(S)?S:"POST",T=`<form method="${Y(M)}" action="${Y(v)}"${k?` ${k}`:""}>`;if(T+=`
567
+ `}function ht(s,e){let c=Hr(e);if(!c)return s;if(!s.includes("</head>")){let a=s.lastIndexOf("</body>");if(a!==-1)return s.slice(0,a)+c+s.slice(a);return s+c}return s.replace("</head>",`${c}</head>`)}function ue(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bt(s){let e=s.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function yt(s){let e=s?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Wr from"fs";import Je from"path";import{createHighlighter as Xr}from"ts-syntax-highlighter";var Qe=new Map;async function Ae(s,e={}){try{if(!await r(s))throw Error(`Markdown file not found: ${s}`);let a=(await Wr.promises.stat(s)).mtime.getTime();if(e.cache&&Qe.has(s)){let v=Qe.get(s);if(v.updatedAt>=a)return{content:v.content,data:v.data}}let g=await Bun.file(s).text(),{data:n,content:d}=fr(g),y=e.markdown||O.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},x=et(d,{gfm:!0});if(y.syntaxHighlighting?.enabled&&y.syntaxHighlighting?.serverSide)x=await zr(x,y.syntaxHighlighting?.defaultTheme||"github-dark",y.syntaxHighlighting?.highlightUnknownLanguages||!1);let w={content:x,data:n||{}};if(e.cache)Qe.set(s,{...w,updatedAt:a});return w}catch(c){if(e.debug)console.error(`Error reading/parsing markdown file ${s}:`,c);let a=c instanceof Error?c.message:String(c);return{content:h("Markdown File",`Error reading/parsing markdown file: ${a}`,s,"",0,""),data:{}}}}var Ue=null;async function zr(s,e,c){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Ue)try{Ue=await Xr({theme:e||"github-dark",cache:!0})}catch(y){return console.error("Failed to initialize ts-syntax-highlighter:",y),s}let g=async(y,m,x,w)=>{let v=w.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),k=x||(c?"text":"");if(!k)return y;try{if(!Ue.getSupportedLanguages().includes(k))return y;return(await Ue.highlight(v,k,{theme:e})).html}catch(S){console.error(`Error highlighting code block with language ${x}:`,S)}return y},n=s,d=s.matchAll(a);for(let y of d){let[m,x,w,v]=y,k=await g(m,x,w,v);n=n.replace(m,k)}return n}async function wt(s,e,c="",a={}){return await Kr(s,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(d,y,m,x)=>{try{let w=y;if(!Je.isAbsolute(y))w=Je.resolve(Je.dirname(c),y);let v={};if(m)try{try{v=JSON.parse(m)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let j=m.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let N of j){let F=N.indexOf(":");if(F>0){let I=N.substring(0,F).trim(),L=N.substring(F+1).trim(),H=L.startsWith('"')&&L.endsWith('"'),V=L.startsWith("'")&&L.endsWith("'");if(H||V)L=L.substring(1,L.length-1);v[I]=L}}}}catch(D){if(a.debug)console.error("Error parsing context in @markdown-file directive:",D)}let{content:k,data:S}=await Ae(w,a),M={...e,...S,...v},T=k,R=/\{\{([^}]+)\}\}/g;return T=T.replace(R,(D,j)=>{let N=j.trim();return M[N]!==void 0?String(M[N]):D}),T}catch(w){let v=w instanceof Error?w.message:String(w);return h("Markdown File",`Error including markdown file: ${v}`,c,s,x,d)}})}async function Kr(s,e,c){let a=[],g;while((g=e.exec(s))!==null){let y=g[0],m=g.index,x=g;a.push(c(...x).then((w)=>({match:y,replacement:w,index:m})))}let n=await Promise.all(a);n.sort((y,m)=>m.index-y.index);let d=s;for(let{match:y,replacement:m}of n)d=d.replace(y,()=>m);return d}var vt=new WeakMap;function xt(s=16){let e=new Uint8Array(s);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function qe(s,e){if(!s)return e?.nonceGenerator?.()??xt();let c=vt.get(s);if(!c)c=e?.nonceGenerator?.()??xt(),vt.set(s,c);return c}function Gr(s,e){let c=[];for(let[a,g]of Object.entries(s)){if(g===void 0||g===null)continue;if(typeof g==="boolean"){if(g)c.push(a);continue}if(Array.isArray(g)){let n=[...g];if(e&&(a==="script-src"||a==="style-src"))n=n.filter((d)=>!d.startsWith("'nonce-")),n.push(`'nonce-${e}'`);if(n.length>0)c.push(`${a} ${n.join(" ")}`)}}return c.join("; ")}function kt(s,e){return`<meta http-equiv="Content-Security-Policy" content="${Gr(s,e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}function St(s,e,c){if(!e.enabled||!e.addMetaTag)return s;if(s.includes('http-equiv="Content-Security-Policy"'))return s;if(!s.includes("<head>")&&!s.includes("<head "))return s;let a=e.useNonce?qe(c,e):void 0,g=kt(e.directives,a);return s.replace(/<head([^>]*)>/,`<head$1>
568
+ ${g}`)}function $t(s,e){let c=s;return c=c.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),c=c.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),c}function Et(s,e,c,a){let g=s,n=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!n?.enabled||!n.directives)return"<!-- CSP not configured -->";let d=n.useNonce?qe(e,n):void 0;return kt(n.directives,d)}),g=g.replace(/@cspNonce\b/g,()=>{if(!n?.enabled||!n.useNonce)return"";return qe(e,n)}),n?.enabled&&n.useNonce)e.cspNonce=qe(e,n);return g}import Zr from"crypto";var Jr=40,Tt="_token",Ye=null;function Qr(s=Jr){let e=Zr.randomBytes(Math.ceil(s/2)).toString("hex").slice(0,s);return Ye=e,e}function Yr(){if(!Ye)Qr();return Ye}function en(s=Tt){let e=Yr();return`<input type="hidden" name="${s}" value="${e}">`}function _t(s){return s.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,c,a)=>en(a||Tt))}async function Ct(s,e,c,a){if(!a.customDirectives||a.customDirectives.length===0)return s;let g=s;for(let n of a.customDirectives){if(!n.name||typeof n.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",n);continue}if(n.hasEndTag)g=await tn(g,n,e,c,a);else g=await rn(g,n,e,c,a)}return g}async function tn(s,e,c,a,g){let{name:n,handler:d}=e,y=`@${n}`,m=`@end${n}`,x=s,w=Bt(`${y}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${m}`,"g"),v=[],k=w.exec(x);while(k!==null){let[S,M="",T=""]=k,R=k.index||0;try{let D=M?At(e,M):[],j=T.trim(),N=await d(j,D,c,a);v.push({original:S,processed:N,startIndex:R})}catch(D){let j=D instanceof Error?D.message:String(D);if(g.debug)console.error(`Error processing custom directive @${n}:`,D);v.push({original:S,processed:l("CustomDirective",`Error in @${n}${M?`(${M})`:""}: ${j}`,t.EVALUATION_ERROR),startIndex:R})}k=w.exec(x)}for(let S=v.length-1;S>=0;S--){let{original:M,processed:T}=v[S];x=x.replace(M,T)}return x}async function rn(s,e,c,a,g){let{name:n,handler:d}=e,y=s,m=[],x=[];if(e.rawParams){for(let k of Ti(y,Bt(`(?<![\\w$@])@${n}\\s*\\(`,"g")))if(k.end!==-1)x.push({fullMatch:k.call,paramString:k.args,startIndex:k.start})}else{let k=Bt(`@${n}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");k.lastIndex=0;let S=k.exec(y);while(S!==null)x.push({fullMatch:S[0],paramString:S[1]??"",startIndex:S.index||0}),S=k.exec(y)}for(let{fullMatch:k,paramString:S,startIndex:M}of x)try{let T=At(e,S),R=await d("",T,c,a);m.push({original:k,processed:R,startIndex:M})}catch(T){let R=T instanceof Error?T.message:String(T);if(g.debug)console.error(`Error processing custom directive @${n}:`,T);m.push({original:k,processed:l("CustomDirective",`Error in @${n}(${S}): ${R}`,t.EVALUATION_ERROR),startIndex:M})}let w=Bt(`@${n}(?!\\w)(?!\\s*\\()`,"g"),v=w.exec(y);while(v!==null){let[k]=v,S=v.index||0;try{let M=await d("",[],c,a);m.push({original:k,processed:M,startIndex:S})}catch(M){let T=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${n}:`,M);m.push({original:k,processed:l("CustomDirective",`Error in @${n}: ${T}`,t.EVALUATION_ERROR),startIndex:S})}v=w.exec(y)}for(let k=m.length-1;k>=0;k--){let{original:S,processed:M}=m[k];y=y.replace(S,M)}return y}function At(s,e){return s.rawParams?Ht(e):nn(e)}function nn(s){if(!s.trim())return[];let e=[],c="",a=!1,g="";for(let n=0;n<s.length;n++){let d=s[n];if((d==='"'||d==="'")&&(n===0||s[n-1]!=="\\"))if(!a)a=!0,g=d;else if(d===g)a=!1;else c+=d;else if(d===","&&!a)e.push(c.trim()),c="";else c+=d}if(c.trim())e.push(c.trim());return e.map((n)=>{let d=n.trim();if(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))return d.substring(1,d.length-1);return d})}var Rt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Mt=/^[A-Za-z_$][\w$]*$/,sn=new Set(["light","dark","system"]);function xe(s,e){if(typeof s!=="string"||s.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function on(s){if(!s||typeof s!=="object"||Array.isArray(s))throw Error("@appearanceBootstrap expects an options object");let e=s,{appearance:c,colorMode:a}=e;if(xe(e.storageKey,"storageKey"),c!==void 0&&(!c||typeof c!=="object"||Array.isArray(c)))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(xe(a.key,"colorMode.key"),xe(a.attribute,"colorMode.attribute"),xe(a.default,"colorMode.default"),!Mt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Rt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!sn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(c){if(xe(c.key,"appearance.key"),xe(c.attribute,"appearance.attribute"),xe(c.default,"appearance.default"),!Mt.test(c.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Rt.test(c.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(c.allowed)||c.allowed.length===0||c.allowed.some((n)=>typeof n!=="string"||n.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!c.allowed.includes(c.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:c.key,attribute:c.attribute,allowed:[...new Set(c.allowed)],default:c.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function an(s){return JSON.stringify(s).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function cn(s){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${an(s)};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 ln(s,e){let c=1,a=null,g=!1;for(let n=e+1;n<s.length;n++){let d=s[n];if(g){g=!1;continue}if(a){if(d==="\\")g=!0;else if(d===a)a=null;continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="(")c++;else if(d===")"&&--c===0)return n}return-1}function Dt(s,e){let c=s,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(c))!==null){let n=g.index+g[0].length-1,d=ln(c,n);if(d===-1)throw Error("@appearanceBootstrap has an unclosed options object");let y=c.slice(n+1,d).trim(),m=u(`(${y})`,e),x=cn(on(m));c=c.slice(0,g.index)+x+c.slice(d+1),a.lastIndex=g.index+x.length}return c}import un from"crypto";function Y(s){return W(String(s??""))}var Ot={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ve(s,e,c,a){let g=s||e;return c?`${g} ${a}`:g}function ge(s){return String(s).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Re(s,e){if(/\bid\s*=/i.test(s))return"";return` id="${Y(e)}"`}function tt(s,e,c){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(c))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(c))a+=` aria-describedby="${Y(`${ge(s)}-error`)}"`;return a}function dn(){return un.randomUUID()}function We(s,e){let c=s;return c=c.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=dn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Y(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),c=c.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let n=g.toUpperCase();if(g&&!["GET","POST"].includes(n))return`<input type="hidden" name="_method" value="${Y(n)}">`;return a}),c}function Lt(s,e,c=Ot){let a=s;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,n,d,y,m,x="")=>{let w=n||d||"POST",v=y||m||"",k=ye(x),S=w.toUpperCase(),M=["GET","POST"].includes(S)?S:"POST",T=`<form method="${Y(M)}" action="${Y(v)}"${k?` ${k}`:""}>`;if(T+=`
569
569
  ${We("@csrf",e)}`,!["GET","POST"].includes(S))T+=`
570
- ${We(`@method('${S}')`,e)}`;return T}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,n,d,y,m,x="")=>{let w=n||d||"",v=y||m||"",k=ye(x),S=Pe(w,e),M=S!==void 0&&S!==null?S:v||"",T=k.match(/type=['"]([^'"]+)['"]/i),R=T?T[1]:"text",D=He(w,e),j=k.match(/class=['"]([^'"]+)['"]/i),N=Ve(j?j[1]:"",c.input,D,c.inputError),F=k.replace(/class=['"][^'"]+['"]/i,"");return F=F.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Y(R)}" name="${Y(w)}"${Re(k,ge(w))} value="${Y(M)}" class="${N}"${tt(w,D,k)}${F?` ${F}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(g,n,d="",y="")=>{let m=ye(d),x=Pe(n,e)||y.trim(),w=He(n,e),v=m.match(/class=['"]([^'"]+)['"]/i),k=Ve(v?v[1]:"",c.input,w,c.inputError),S=m.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Y(n)}"${Re(m,ge(n))} class="${k}"${tt(n,w,m)}${S?` ${S}`:""}>${Y(x)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(g,n,d="",y)=>{let m=ye(d),x=Pe(n,e),w=He(n,e),v=m.match(/class=['"]([^'"]+)['"]/i),k=Ve(v?v[1]:"",c.input,w,c.inputError),S=m.replace(/class=['"][^'"]+['"]/i,""),M=y;if(x!==void 0)M=y.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(T,R,D)=>{if((Array.isArray(x)?x.some((N)=>String(N)===D):String(x)===D)&&!R.includes("selected"))return R.replace(/(<option)/,"$1 selected");return T});return`<select name="${Y(n)}"${Re(m,ge(n))} class="${k}"${tt(n,w,m)}${S?` ${S}`:""}>${M}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(g,n,d,y="")=>{let m=d===void 0?"1":d,x=d===void 0?ge(n):`${ge(n)}-${ge(m)}`,w=ye(y),v=Pe(n,e),k=v!==void 0&&(Array.isArray(v)?v.some((R)=>String(R)===m):v===!0||String(v)===m),S=w.match(/class=['"]([^'"]+)['"]/i),M=S?S[1]:c.checkInput,T=w.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Y(n)}"${Re(w,x)} value="${Y(m)}" class="${M}"${k?" checked":""}${T?` ${T}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,n,d,y="")=>{let m=ye(y),x=Pe(n,e),w=x!==void 0&&x===d,v=m.match(/class=['"]([^'"]+)['"]/i),k=v?v[1]:c.checkInput,S=m.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Y(n)}"${Re(m,`${ge(n)}-${ge(d)}`)} value="${Y(d)}" class="${k}"${w?" checked":""}${S?` ${S}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,n,d="")=>{let y=ye(d),m=y.match(/accept=['"]([^'"]+)['"]/i),x=m?m[1]:"",w=y.includes("multiple"),v=He(n,e),k=y.match(/class=['"]([^'"]+)['"]/i),S=Ve(k?k[1]:"",c.input,v,c.inputError),M=y.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),T=[`<input type="file" name="${Y(n)}"${Re(y,ge(n))}`,`class="${S}"`];if(x)T.push(`accept="${Y(x)}"`);if(w)T.push("multiple");if(M)T.push(M);return`${T.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(g,n,d="",y)=>{let m=ye(d),x=m.match(/class=['"]([^'"]+)['"]/i),w=x?x[1]:c.label,v=m.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Y(ge(n))}" class="${w}"${v?` ${v}`:""}>${y}</label>`}),a}function Nt(s,e,c=Ot){return s.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,g,n)=>{try{if(He(g,e)){let d=n.replace(/\{\{([^}]+)\}\}/g,(y,m,x)=>{let w=(v)=>Q(n,x,String(v??""),!1,y.length);try{if(m.trim()==="$message"||m.trim()==="message")return w(It(g,e));if(m.trim().includes("errors.first")||m.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return w(e.errors.first(g));return w(It(g,e))}let v=m.trim();if(f(v)){let k=u(v,e);return k!==void 0?w(k):v}return v}catch{return m}});return`<div id="${Y(`${ge(g)}-error`)}" role="alert">${d}</div>`}return""}catch(d){return console.error("Error processing @error directive:",d),a}})}function He(s,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(s);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,s);return!1}function It(s,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(s);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,s)){let c=e.errors[s];return Array.isArray(c)?c[0]:String(c)}return""}function Pe(s,e){let c;if(e.old&&typeof e.old==="function")return e.old(s);if(e.old&&typeof e.old==="object")return e.old[s];if(s.endsWith("[]")){let a=s.slice(0,-2);if(c=e[a],c!==void 0)return c}return e[s]}function ye(s){if(!s.trim())return"";let e=[],c=s.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,g;while((g=a.exec(c))!==null){let[,n,,d]=g;e.push(`${n}="${d.trim()}"`)}return e.join(" ")}import*as rt from"path";async function Ht(s,e,c=""){if(rt.basename(c)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,s.replace(/@js[\s\S]*?@endjs/g,"");return Ft(s,e,c,"@js","@endjs")}async function Bt(s,e,c=""){if(rt.basename(c)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((n)=>({...n,displayName:`User ${n.id}: ${n.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return s.replace(/@ts[\s\S]*?@endts/g,"")}return Ft(s,e,c,"@ts","@endts")}async function Ft(s,e,c,a,g){let n=s,d=jt(`${a}([\\s\\S]*?)${g}`,"g"),y=[],m;while((m=d.exec(s))!==null)y.push({fullMatch:m[0],content:m[1]||"",index:m.index});for(let{fullMatch:x,content:w,index:v}of y)try{let k={...e,global:e},S=Object.keys(k),M=Object.values(k),T=w.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 D=(T.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((L)=>L.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),j=D.length>0?`return { ${D.join(", ")} };`:"return {};",N=`
570
+ ${We(`@method('${S}')`,e)}`;return T}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,n,d,y,m,x="")=>{let w=n||d||"",v=y||m||"",k=ye(x),S=Pe(w,e),M=S!==void 0&&S!==null?S:v||"",T=k.match(/type=['"]([^'"]+)['"]/i),R=T?T[1]:"text",D=He(w,e),j=k.match(/class=['"]([^'"]+)['"]/i),N=Ve(j?j[1]:"",c.input,D,c.inputError),F=k.replace(/class=['"][^'"]+['"]/i,"");return F=F.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Y(R)}" name="${Y(w)}"${Re(k,ge(w))} value="${Y(M)}" class="${N}"${tt(w,D,k)}${F?` ${F}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(g,n,d="",y="")=>{let m=ye(d),x=Pe(n,e)||y.trim(),w=He(n,e),v=m.match(/class=['"]([^'"]+)['"]/i),k=Ve(v?v[1]:"",c.input,w,c.inputError),S=m.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Y(n)}"${Re(m,ge(n))} class="${k}"${tt(n,w,m)}${S?` ${S}`:""}>${Y(x)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(g,n,d="",y)=>{let m=ye(d),x=Pe(n,e),w=He(n,e),v=m.match(/class=['"]([^'"]+)['"]/i),k=Ve(v?v[1]:"",c.input,w,c.inputError),S=m.replace(/class=['"][^'"]+['"]/i,""),M=y;if(x!==void 0)M=y.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(T,R,D)=>{if((Array.isArray(x)?x.some((N)=>String(N)===D):String(x)===D)&&!R.includes("selected"))return R.replace(/(<option)/,"$1 selected");return T});return`<select name="${Y(n)}"${Re(m,ge(n))} class="${k}"${tt(n,w,m)}${S?` ${S}`:""}>${M}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(g,n,d,y="")=>{let m=d===void 0?"1":d,x=d===void 0?ge(n):`${ge(n)}-${ge(m)}`,w=ye(y),v=Pe(n,e),k=v!==void 0&&(Array.isArray(v)?v.some((R)=>String(R)===m):v===!0||String(v)===m),S=w.match(/class=['"]([^'"]+)['"]/i),M=S?S[1]:c.checkInput,T=w.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Y(n)}"${Re(w,x)} value="${Y(m)}" class="${M}"${k?" checked":""}${T?` ${T}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,n,d,y="")=>{let m=ye(y),x=Pe(n,e),w=x!==void 0&&x===d,v=m.match(/class=['"]([^'"]+)['"]/i),k=v?v[1]:c.checkInput,S=m.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Y(n)}"${Re(m,`${ge(n)}-${ge(d)}`)} value="${Y(d)}" class="${k}"${w?" checked":""}${S?` ${S}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,n,d="")=>{let y=ye(d),m=y.match(/accept=['"]([^'"]+)['"]/i),x=m?m[1]:"",w=y.includes("multiple"),v=He(n,e),k=y.match(/class=['"]([^'"]+)['"]/i),S=Ve(k?k[1]:"",c.input,v,c.inputError),M=y.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),T=[`<input type="file" name="${Y(n)}"${Re(y,ge(n))}`,`class="${S}"`];if(x)T.push(`accept="${Y(x)}"`);if(w)T.push("multiple");if(M)T.push(M);return`${T.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(g,n,d="",y)=>{let m=ye(d),x=m.match(/class=['"]([^'"]+)['"]/i),w=x?x[1]:c.label,v=m.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Y(ge(n))}" class="${w}"${v?` ${v}`:""}>${y}</label>`}),a}function Pt(s,e,c=Ot){return s.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,g,n)=>{try{if(He(g,e)){let d=n.replace(/\{\{([^}]+)\}\}/g,(y,m,x)=>{let w=(v)=>Q(n,x,String(v??""),!1,y.length);try{if(m.trim()==="$message"||m.trim()==="message")return w(It(g,e));if(m.trim().includes("errors.first")||m.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return w(e.errors.first(g));return w(It(g,e))}let v=m.trim();if(f(v)){let k=u(v,e);return k!==void 0?w(k):v}return v}catch{return m}});return`<div id="${Y(`${ge(g)}-error`)}" role="alert">${d}</div>`}return""}catch(d){return console.error("Error processing @error directive:",d),a}})}function He(s,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(s);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,s);return!1}function It(s,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(s);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,s)){let c=e.errors[s];return Array.isArray(c)?c[0]:String(c)}return""}function Pe(s,e){let c;if(e.old&&typeof e.old==="function")return e.old(s);if(e.old&&typeof e.old==="object")return e.old[s];if(s.endsWith("[]")){let a=s.slice(0,-2);if(c=e[a],c!==void 0)return c}return e[s]}function ye(s){if(!s.trim())return"";let e=[],c=s.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,g;while((g=a.exec(c))!==null){let[,n,,d]=g;e.push(`${n}="${d.trim()}"`)}return e.join(" ")}import*as rt from"path";async function Nt(s,e,c=""){if(rt.basename(c)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,s.replace(/@js[\s\S]*?@endjs/g,"");return Ut(s,e,c,"@js","@endjs")}async function Ft(s,e,c=""){if(rt.basename(c)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((n)=>({...n,displayName:`User ${n.id}: ${n.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return s.replace(/@ts[\s\S]*?@endts/g,"")}return Ut(s,e,c,"@ts","@endts")}async function Ut(s,e,c,a,g){let n=s,d=Bt(`${a}([\\s\\S]*?)${g}`,"g"),y=[],m;while((m=d.exec(s))!==null)y.push({fullMatch:m[0],content:m[1]||"",index:m.index});for(let{fullMatch:x,content:w,index:v}of y)try{let k={...e,global:e},S=Object.keys(k),M=Object.values(k),T=w.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 D=(T.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((L)=>L.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),j=D.length>0?`return { ${D.join(", ")} };`:"return {};",N=`
571
571
  ${T}
572
572
  ${j}
573
- `,I=Function(...S,N)(...M);if(I&&typeof I==="object")Object.assign(e,I);n=n.replace(x,"")}catch(k){console.error(`Error executing ${a} code block in ${c}:`,k);let S=k instanceof Error?k.message:String(k),M=h(`${a} Directive`,`Error executing code: ${S}`,c,s,v,x);console.error(M),n=n.replace(x,"")}return n}function pn(s,e="_method"){let c=s.toUpperCase();if(c==="GET"||c==="POST")return"";return`<input type="hidden" name="${e}" value="${c}">`}function Ut(s){return s.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,c,a,g,n)=>pn(a,n||"_method"))}async function qt(s,e,c,a,g){if(!a.middleware||a.middleware.length===0)return s;let n=s,d=a.middleware.filter((y)=>y.timing===g);if(d.length===0)return n;for(let y of d){if(!y.name||typeof y.handler!=="function"){if(a.debug)console.warn("Invalid middleware:",y);continue}try{let m=await y.handler(n,e,c,a);if(typeof m==="string")n=m;else if(a.debug)console.warn(`Middleware ${y.name} did not return a string`)}catch(m){if(a.debug)console.error(`Error in middleware ${y.name}:`,m);if(a.debug){let x=h("Middleware",`Error in middleware '${y.name}': ${m instanceof Error?m.message:String(m)}`,c,s);n=n.replace(/<body[^>]*>/,`$&
573
+ `,I=Function(...S,N)(...M);if(I&&typeof I==="object")Object.assign(e,I);n=n.replace(x,"")}catch(k){console.error(`Error executing ${a} code block in ${c}:`,k);let S=k instanceof Error?k.message:String(k),M=h(`${a} Directive`,`Error executing code: ${S}`,c,s,v,x);console.error(M),n=n.replace(x,"")}return n}function pn(s,e="_method"){let c=s.toUpperCase();if(c==="GET"||c==="POST")return"";return`<input type="hidden" name="${e}" value="${c}">`}function qt(s){return s.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,c,a,g,n)=>pn(a,n||"_method"))}async function Vt(s,e,c,a,g){if(!a.middleware||a.middleware.length===0)return s;let n=s,d=a.middleware.filter((y)=>y.timing===g);if(d.length===0)return n;for(let y of d){if(!y.name||typeof y.handler!=="function"){if(a.debug)console.warn("Invalid middleware:",y);continue}try{let m=await y.handler(n,e,c,a);if(typeof m==="string")n=m;else if(a.debug)console.warn(`Middleware ${y.name} did not return a string`)}catch(m){if(a.debug)console.error(`Error in middleware ${y.name}:`,m);if(a.debug){let x=h("Middleware",`Error in middleware '${y.name}': ${m instanceof Error?m.message:String(m)}`,c,s);n=n.replace(/<body[^>]*>/,`$&
574
574
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${p(x)}</div>
575
- `)}}}return n}async function Vt(s,e,c,a){return qt(s,e,c,a,"before")}async function Wt(s,e,c,a){return qt(s,e,c,a,"after")}function Xt(s){return s.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,c,a,g,n)=>{try{let d=g?P(g,{}):{};return mr(a,d,n==="true")}catch(d){return console.error(`Error processing @route directive: ${d}`),"#route-error"}})}var Be={patterns:[],exact:{}};async function Kt(s,e){let c=s.split("/").pop()?.split(".")[0]||"";if(Be.exact[s])for(let a of Be.exact[s])await Promise.resolve(a(e,s));if(Be.exact[c])for(let a of Be.exact[c])await Promise.resolve(a(e,s));for(let{pattern:a,callback:g}of Be.patterns)if(a.test(s)||a.test(c))await Promise.resolve(g(e,s))}var hn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),bn=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(s,e){let c=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;c.lastIndex=e;let a=c.exec(s);if(!a)return null;let g=/\/\s*>$/.test(a[0])||a[1]===a[1].toLowerCase()&&hn.has(a[1]),n=g?a[2].replace(/\/\s*$/,""):a[2];return{full:a[0],tag:a[1],attrs:n,selfClosing:g,start:a.index,end:a.index+a[0].length}}function wn(s,e,c){let a=1,g=c,n=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),d=new RegExp(`</${e}\\s*>`,"gi");while(a>0&&g<s.length){n.lastIndex=g,d.lastIndex=g;let y=n.exec(s),m=d.exec(s);if(!m)return-1;if(y&&y.index<m.index)a++,g=y.index+y[0].length;else{if(a--,a===0)return m.index+m[0].length;g=m.index+m[0].length}}return-1}function Se(s,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let c=wn(s,e.tag,e.end);if(c===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:c,innerHTML:s.slice(e.end,c-`</${e.tag}>`.length)}}function Gt(s,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(s)||s.includes(` ${e}=`)||s.includes(` ${e} `)||s.trimEnd().endsWith(` ${e}`)}function Fe(s,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=s.match(new RegExp(`${c}="([^"]*)"`,"s"))||s.match(new RegExp(`${c}='([^']*)'`,"s"));return a?a[1]:null}function be(s,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return s.replace(new RegExp(`\\s*${c}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${c}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${c}(?=\\s|$|>|/)`,"g"),"")}function De(s,e,c){let a=e.selfClosing?" /":"",g=`<${e.tag}${c}${a}>`;return s.slice(0,e.start)+g+s.slice(e.end)}function xn(s){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(s)}function kn(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-for");if(g===null){c=a.end;continue}let n=g.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!n){c=a.end;continue}let d=n[1].trim(),y=n[2].trim(),m;if(d.includes(",")){let R=d.split(",").map((N)=>N.trim()),D=R[0],j=R[1];m=`${y} as ${j} => ${D}`}else m=`${y} as ${d}`;let x=be(a.attrs,"v-for"),w=be(x,":key").replace(/\s*v-bind:key="[^"]*"/g,""),v=Se(e,a),k=e.slice(v.outerStart,v.outerEnd),S=De(k,{...a,start:0,end:a.end-a.start},w),M=`@foreach(${m})
575
+ `)}}}return n}async function Wt(s,e,c,a){return Vt(s,e,c,a,"before")}async function Xt(s,e,c,a){return Vt(s,e,c,a,"after")}function zt(s){return s.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,c,a,g,n)=>{try{let d=g?P(g,{}):{};return hr(a,d,n==="true")}catch(d){return console.error(`Error processing @route directive: ${d}`),"#route-error"}})}var Be={patterns:[],exact:{}};async function Kt(s,e){let c=s.split("/").pop()?.split(".")[0]||"";if(Be.exact[s])for(let a of Be.exact[s])await Promise.resolve(a(e,s));if(Be.exact[c])for(let a of Be.exact[c])await Promise.resolve(a(e,s));for(let{pattern:a,callback:g}of Be.patterns)if(a.test(s)||a.test(c))await Promise.resolve(g(e,s))}var fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yn=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(s,e){let c=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;c.lastIndex=e;let a=c.exec(s);if(!a)return null;let g=/\/\s*>$/.test(a[0])||a[1]===a[1].toLowerCase()&&fn.has(a[1]),n=g?a[2].replace(/\/\s*$/,""):a[2];return{full:a[0],tag:a[1],attrs:n,selfClosing:g,start:a.index,end:a.index+a[0].length}}function wn(s,e,c){let a=1,g=c,n=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),d=new RegExp(`</${e}\\s*>`,"gi");while(a>0&&g<s.length){n.lastIndex=g,d.lastIndex=g;let y=n.exec(s),m=d.exec(s);if(!m)return-1;if(y&&y.index<m.index)a++,g=y.index+y[0].length;else{if(a--,a===0)return m.index+m[0].length;g=m.index+m[0].length}}return-1}function Se(s,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let c=wn(s,e.tag,e.end);if(c===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:c,innerHTML:s.slice(e.end,c-`</${e.tag}>`.length)}}function Gt(s,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(s)||s.includes(` ${e}=`)||s.includes(` ${e} `)||s.trimEnd().endsWith(` ${e}`)}function Fe(s,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=s.match(new RegExp(`${c}="([^"]*)"`,"s"))||s.match(new RegExp(`${c}='([^']*)'`,"s"));return a?a[1]:null}function be(s,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return s.replace(new RegExp(`\\s*${c}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${c}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${c}(?=\\s|$|>|/)`,"g"),"")}function De(s,e,c){let a=e.selfClosing?" /":"",g=`<${e.tag}${c}${a}>`;return s.slice(0,e.start)+g+s.slice(e.end)}function vn(s){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(s)}function Sn(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-for");if(g===null){c=a.end;continue}let n=g.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!n){c=a.end;continue}let d=n[1].trim(),y=n[2].trim(),m;if(d.includes(",")){let R=d.split(",").map((N)=>N.trim()),D=R[0],j=R[1];m=`${y} as ${j} => ${D}`}else m=`${y} as ${d}`;let x=be(a.attrs,"v-for"),w=be(x,":key").replace(/\s*v-bind:key="[^"]*"/g,""),v=Se(e,a),k=e.slice(v.outerStart,v.outerEnd),S=De(k,{...a,start:0,end:a.end-a.start},w),M=`@foreach(${m})
576
576
  `,T=`${M}${S}
577
577
  @endforeach`;e=e.slice(0,v.outerStart)+T+e.slice(v.outerEnd),c=v.outerStart+M.length}return e}function $n(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-if");if(g===null){c=a.end;continue}let n=[],d=Se(e,a),y=be(a.attrs,"v-if"),m=De(e.slice(d.outerStart,d.outerEnd),{...a,start:0,end:a.end-a.start},y);n.push({type:"if",expr:g,outerStart:d.outerStart,outerEnd:d.outerEnd,element:m,parsedTag:a});let x=d.outerEnd,w=!0;while(w){let T=e.slice(x).match(/^\s*/),R=T?T[0].length:0,D=$e(e,x+R);if(!D){w=!1;break}let j=Fe(D.attrs,"v-else-if"),N=Gt(D.attrs,"v-else");if(j!==null){let F=Se(e,D),I=be(D.attrs,"v-else-if"),L=De(e.slice(F.outerStart,F.outerEnd),{...D,start:0,end:D.end-D.start},I);n.push({type:"else-if",expr:j,outerStart:x,outerEnd:F.outerEnd,element:L,parsedTag:D}),x=F.outerEnd}else if(N){let F=Se(e,D),I=be(D.attrs,"v-else"),L=De(e.slice(F.outerStart,F.outerEnd),{...D,start:0,end:D.end-D.start},I);n.push({type:"else",outerStart:x,outerEnd:F.outerEnd,element:L,parsedTag:D}),w=!1}else w=!1}let v=[];for(let T of n)if(T.type==="if")v.push(`@if(${T.expr})
578
578
  ${T.element}`);else if(T.type==="else-if")v.push(`@elseif(${T.expr})
579
579
  ${T.element}`);else v.push(`@else
580
580
  ${T.element}`);v.push("@endif");let k=v.join(`
581
- `),S=n[0].outerStart,M=n[n.length-1].outerEnd;e=e.slice(0,S)+k+e.slice(M),c=S+k.length}return e}function Tn(s){return s.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function An(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=bn.has(a.tag),n=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(y,m,x)=>{let w=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(m);if(!w||!x||!/^["']/.test(x))return y;let v=w[1]||"modelValue",k=w[2];if(g&&!w[1])return`@model${k}=${x}`;let S=x[0],M=x.slice(1,-1),T=`:${v}=${x} @update:${v}=${S}${M} = $event${S}`;if(k){let R=w[1]?`${v}Modifiers`:"modelModifiers",D=k.slice(1).split(".").map((j)=>`${j}: true`).join(", ");T+=` :${R}="{ ${D} }"`}return T});if(n===a.attrs){c=a.end;continue}let d=De(a.full,{...a,start:0,end:a.full.length},n);e=e.slice(0,a.start)+d+e.slice(a.end),c=a.start+d.length}return e}function Rn(s){return s.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Mn(s){return s.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Dn(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-html");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let n=Se(e,a),d=be(a.attrs,"v-html"),y=a.selfClosing?" /":"",m=`<${a.tag}${d}${y}>{!! ${g} !!}</${a.tag}>`;e=e.slice(0,n.outerStart)+m+e.slice(n.outerEnd),c=n.outerStart+m.length}return e}function In(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-text");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let n=Se(e,a),d=be(a.attrs,"v-text"),y=a.selfClosing?" /":"",m=`<${a.tag}${d}${y}>{{ ${g} }}</${a.tag}>`;e=e.slice(0,n.outerStart)+m+e.slice(n.outerEnd),c=n.outerStart+m.length}return e}function On(s){return s.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 Ln(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;if(!Gt(a.attrs,"v-once")){c=a.end;continue}let g=be(a.attrs,"v-once"),n=Se(e,a),d=e.slice(n.outerStart,n.outerEnd),m=`@once
581
+ `),S=n[0].outerStart,M=n[n.length-1].outerEnd;e=e.slice(0,S)+k+e.slice(M),c=S+k.length}return e}function _n(s){return s.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function An(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=yn.has(a.tag),n=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(y,m,x)=>{let w=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(m);if(!w||!x||!/^["']/.test(x))return y;let v=w[1]||"modelValue",k=w[2];if(g&&!w[1])return`@model${k}=${x}`;let S=x[0],M=x.slice(1,-1),T=`:${v}=${x} @update:${v}=${S}${M} = $event${S}`;if(k){let R=w[1]?`${v}Modifiers`:"modelModifiers",D=k.slice(1).split(".").map((j)=>`${j}: true`).join(", ");T+=` :${R}="{ ${D} }"`}return T});if(n===a.attrs){c=a.end;continue}let d=De(a.full,{...a,start:0,end:a.full.length},n);e=e.slice(0,a.start)+d+e.slice(a.end),c=a.start+d.length}return e}function Rn(s){return s.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Mn(s){return s.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Dn(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-html");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let n=Se(e,a),d=be(a.attrs,"v-html"),y=a.selfClosing?" /":"",m=`<${a.tag}${d}${y}>{!! ${g} !!}</${a.tag}>`;e=e.slice(0,n.outerStart)+m+e.slice(n.outerEnd),c=n.outerStart+m.length}return e}function In(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Fe(a.attrs,"v-text");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let n=Se(e,a),d=be(a.attrs,"v-text"),y=a.selfClosing?" /":"",m=`<${a.tag}${d}${y}>{{ ${g} }}</${a.tag}>`;e=e.slice(0,n.outerStart)+m+e.slice(n.outerEnd),c=n.outerStart+m.length}return e}function On(s){return s.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 Ln(s){let e=s,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;if(!Gt(a.attrs,"v-once")){c=a.end;continue}let g=be(a.attrs,"v-once"),n=Se(e,a),d=e.slice(n.outerStart,n.outerEnd),m=`@once
582
582
  ${De(d,{...a,start:0,end:a.end-a.start},g)}
583
- @endonce`;e=e.slice(0,n.outerStart)+m+e.slice(n.outerEnd),c=n.outerStart+m.length}return e}function Pn(s){return s.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jn(s){return s.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 Zt(s){if(!xn(s))return s;let e=s;return e=kn(e),e=$n(e),e=Ln(e),e=Rn(e),e=Mn(e),e=An(e),e=Tn(e),e=jn(e),e=Dn(e),e=In(e),e=On(e),e=Pn(e),e}function Xe(s){return s.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var nt=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"]),Nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Jt(s,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(s),a=c?c[1]:s,g=u(a,e);if(g&&typeof g==="string")return g;let n=a.trim();return nt.has(n)?n:null}function Qt(s){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(s);return e?e[1]:s}function Yt(s,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${s} ${a}>`:`<${s}>`;if(Nn.has(s))return a?`<${s} ${a}>`:`<${s}>`;return`${g}${c}</${s}>`}async function er(s,e,c,a,g){let n=s,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,y=[],m;while((m=d.exec(n))!==null)y.push({full:m[0],expr:m[1],attrs:m[2],slotContent:m[3],index:m.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Jt(w.expr,e);if(!v||typeof v!=="string"){let j=`<!-- dynamic component: could not resolve "${Xe(Qt(w.expr))}" -->`;n=n.slice(0,w.index)+j+n.slice(w.index+w.full.length);continue}if(nt.has(v)){let j=Yt(v,w.attrs,w.slotContent);n=n.slice(0,w.index)+j+n.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,T;while((T=M.exec(k))!==null){let j=T[1]||T[2],N=T[3];if(T[1])try{S[j]=u(N,e)}catch{S[j]=N}else S[j]=N}let R=a.componentsDir||"components",D=await ze(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);n=n.slice(0,w.index)+D+n.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;n=n.slice(0,w.index)+S+n.slice(w.index+w.full.length)}}return n=await Hn(n,e,c,a,g),n}async function Hn(s,e,c,a,g){let n=s,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,y=[],m;while((m=d.exec(n))!==null)y.push({full:m[0],expr:m[1],attrs:m[2],index:m.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Jt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Xe(Qt(w.expr))}" -->`;n=n.slice(0,w.index)+M+n.slice(w.index+w.full.length);continue}if(nt.has(v)){let M=Yt(v,w.attrs,"");n=n.slice(0,w.index)+M+n.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await ze(v,{},"",k,e,c,a,new Set,g??new Set);n=n.slice(0,w.index)+S+n.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;n=n.slice(0,w.index)+S+n.slice(w.index+w.full.length)}}return n}var oc="X-STX-Build",st=Symbol.for("stx.buildId");function is(){let s=globalThis;if(!s[st])s[st]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return s[st]}function tr(s,e=is()){if(s.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(s))return null;return`
584
- <meta name="stx-build" content="${e}">`}var Mo="/_stx/sw.js";function Bn(s){if(typeof s!=="string"||!s.startsWith("/"))return null;let e=[],c=[],a=s.replace(/\/+$/,"").split("/").slice(1).map((g)=>{let n=/^:(\w+)$/.exec(g)||/^\[(\w+)\]$/.exec(g);if(n)return e.push(n[1]),c.push("0"),"([^/]+)";return c.push(g),g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:s,re:`^/${a.join("/")}/?$`,names:e,sample:`/${c.join("/")}`}}function Fn(s){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,c=window;if(c.stxOffline)return;let a=null,g=!1,n=[],d={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(w){if(d.updateReady)try{w()}catch{}else n.push(w);return()=>{let v=n.indexOf(w);if(v!==-1)n.splice(v,1)}},applyUpdate(){let w=a&&a.waiting;if(!w)return!1;return g=!0,w.postMessage({type:"stx:activate-update",force:!0}),!0}};c.stxOffline=d;let y=(w)=>{if(!w.waiting||!e.controller||d.updateReady)return;d.updateReady=!0;let v=n.splice(0);for(let k of v)try{k()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(w)=>{let v=w.data||{};if(v.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:v.url,kind:v.kind,fragment:!!v.fragment}}))}catch{}if(v.type==="stx:reachability"){if(c.stxOffline.reachable=v.reachable!==!1,Number(v.at)>0)c.stxOffline.reachedAt=Number(v.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:v.reachable!==!1,at:Number(v.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(g)g=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let m=()=>{e.register(s,{scope:"/"}).then((w)=>{a=w;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(w.waiting)y(w),w.waiting.postMessage({type:"stx:activate-update",reason:"load"});w.addEventListener("updatefound",()=>{let v=w.installing;if(!v)return;v.addEventListener("statechange",()=>{if(v.state==="installed")y(w)})})}).catch(()=>{})},x=()=>{let w=(v)=>{setTimeout(v,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>w(m));else w(m)};if(!e.controller)if(document.readyState==="complete")x();else addEventListener("load",x);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",x);else x()}function Un(){let s=`(${Fn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(s).trim().replace(/;$/,"")}catch{return s}}function qn(s,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!s||!s.startsWith("/"))return null;let c=s.split(/[?#]/)[0].split("/").filter(Boolean)[0];return c?`/${c}`:"/"}var nr=`<script data-stx-offline>${Un()}</script>`;function Do(s,e){let c=Number(s.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((s.pages||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")))),staticPages:(s.staticPages||[]).filter((g)=>typeof g==="string"&&((s.pages||[]).includes(g)||(s.routes||[]).includes(g))),api:s.apiPrefix||"/api/",timeout:Math.max(500,Number(s.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(c)&&c>0?Math.min(2147483647,Math.max(1,Math.floor(c))):1e4,networkFirst:(s.networkFirst||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")),updateOnColdStart:s.updateOnColdStart===!0,fallback:s.fallback||s.pages&&s.pages[0]||null,fallbackScope:qn(s.fallback||s.pages&&s.pages[0]||null,s.fallbackScope),routes:(s.routes||[]).map(Bn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...s.exclude||[]],mediaMax:Math.max(10485760,Number(s.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(s.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
583
+ @endonce`;e=e.slice(0,n.outerStart)+m+e.slice(n.outerEnd),c=n.outerStart+m.length}return e}function Pn(s){return s.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jn(s){return s.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 Zt(s){if(!vn(s))return s;let e=s;return e=Sn(e),e=$n(e),e=Ln(e),e=Rn(e),e=Mn(e),e=An(e),e=_n(e),e=jn(e),e=Dn(e),e=In(e),e=On(e),e=Pn(e),e}function Xe(s){return s.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var nt=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"]),Nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Jt(s,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(s),a=c?c[1]:s,g=u(a,e);if(g&&typeof g==="string")return g;let n=a.trim();return nt.has(n)?n:null}function Qt(s){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(s);return e?e[1]:s}function Yt(s,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${s} ${a}>`:`<${s}>`;if(Nn.has(s))return a?`<${s} ${a}>`:`<${s}>`;return`${g}${c}</${s}>`}async function er(s,e,c,a,g){let n=s,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,y=[],m;while((m=d.exec(n))!==null)y.push({full:m[0],expr:m[1],attrs:m[2],slotContent:m[3],index:m.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Jt(w.expr,e);if(!v||typeof v!=="string"){let j=`<!-- dynamic component: could not resolve "${Xe(Qt(w.expr))}" -->`;n=n.slice(0,w.index)+j+n.slice(w.index+w.full.length);continue}if(nt.has(v)){let j=Yt(v,w.attrs,w.slotContent);n=n.slice(0,w.index)+j+n.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,T;while((T=M.exec(k))!==null){let j=T[1]||T[2],N=T[3];if(T[1])try{S[j]=u(N,e)}catch{S[j]=N}else S[j]=N}let R=a.componentsDir||"components",D=await ze(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);n=n.slice(0,w.index)+D+n.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;n=n.slice(0,w.index)+S+n.slice(w.index+w.full.length)}}return n=await Hn(n,e,c,a,g),n}async function Hn(s,e,c,a,g){let n=s,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,y=[],m;while((m=d.exec(n))!==null)y.push({full:m[0],expr:m[1],attrs:m[2],index:m.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Jt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Xe(Qt(w.expr))}" -->`;n=n.slice(0,w.index)+M+n.slice(w.index+w.full.length);continue}if(nt.has(v)){let M=Yt(v,w.attrs,"");n=n.slice(0,w.index)+M+n.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await ze(v,{},"",k,e,c,a,new Set,g??new Set);n=n.slice(0,w.index)+S+n.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;n=n.slice(0,w.index)+S+n.slice(w.index+w.full.length)}}return n}var ic="X-STX-Build",st=Symbol.for("stx.buildId");function as(){let s=globalThis;if(!s[st])s[st]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return s[st]}function tr(s,e=as()){if(s.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(s))return null;return`
584
+ <meta name="stx-build" content="${e}">`}var Do="/_stx/sw.js";function Bn(s){if(typeof s!=="string"||!s.startsWith("/"))return null;let e=[],c=[],a=s.replace(/\/+$/,"").split("/").slice(1).map((g)=>{let n=/^:(\w+)$/.exec(g)||/^\[(\w+)\]$/.exec(g);if(n)return e.push(n[1]),c.push("0"),"([^/]+)";return c.push(g),g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:s,re:`^/${a.join("/")}/?$`,names:e,sample:`/${c.join("/")}`}}function Fn(s){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,c=window;if(c.stxOffline)return;let a=null,g=!1,n=[],d={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(w){if(d.updateReady)try{w()}catch{}else n.push(w);return()=>{let v=n.indexOf(w);if(v!==-1)n.splice(v,1)}},applyUpdate(){let w=a&&a.waiting;if(!w)return!1;return g=!0,w.postMessage({type:"stx:activate-update",force:!0}),!0}};c.stxOffline=d;let y=(w)=>{if(!w.waiting||!e.controller||d.updateReady)return;d.updateReady=!0;let v=n.splice(0);for(let k of v)try{k()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(w)=>{let v=w.data||{};if(v.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:v.url,kind:v.kind,fragment:!!v.fragment}}))}catch{}if(v.type==="stx:reachability"){if(c.stxOffline.reachable=v.reachable!==!1,Number(v.at)>0)c.stxOffline.reachedAt=Number(v.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:v.reachable!==!1,at:Number(v.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(g)g=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let m=()=>{e.register(s,{scope:"/"}).then((w)=>{a=w;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(w.waiting)y(w),w.waiting.postMessage({type:"stx:activate-update",reason:"load"});w.addEventListener("updatefound",()=>{let v=w.installing;if(!v)return;v.addEventListener("statechange",()=>{if(v.state==="installed")y(w)})})}).catch(()=>{})},x=()=>{let w=(v)=>{setTimeout(v,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>w(m));else w(m)};if(!e.controller)if(document.readyState==="complete")x();else addEventListener("load",x);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",x);else x()}function Un(){let s=`(${Fn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(s).trim().replace(/;$/,"")}catch{return s}}function qn(s,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!s||!s.startsWith("/"))return null;let c=s.split(/[?#]/)[0].split("/").filter(Boolean)[0];return c?`/${c}`:"/"}var rr=`<script data-stx-offline>${Un()}</script>`;function Lo(s,e){let c=Number(s.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((s.pages||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")))),staticPages:(s.staticPages||[]).filter((g)=>typeof g==="string"&&((s.pages||[]).includes(g)||(s.routes||[]).includes(g))),api:s.apiPrefix||"/api/",timeout:Math.max(500,Number(s.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(c)&&c>0?Math.min(2147483647,Math.max(1,Math.floor(c))):1e4,networkFirst:(s.networkFirst||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")),updateOnColdStart:s.updateOnColdStart===!0,fallback:s.fallback||s.pages&&s.pages[0]||null,fallbackScope:qn(s.fallback||s.pages&&s.pages[0]||null,s.fallbackScope),routes:(s.routes||[]).map(Bn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...s.exclude||[]],mediaMax:Math.max(10485760,Number(s.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(s.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
585
585
  'use strict';
586
586
  var S = ${JSON.stringify(a)};
587
587
  var SHELL = 'stx-shell-' + S.build;
@@ -1285,45 +1285,45 @@ self.addEventListener('fetch', function (event) {
1285
1285
  event.respondWith(pageResponse(request, event));
1286
1286
  }
1287
1287
  });
1288
- `}import Ie from"path";function sr(s){return s.startsWith("http://")||s.startsWith("https://")||s.startsWith("//")}async function ir(s,e,c){try{let a;if(s.startsWith("/")){let g=e;for(let n=0;n<5;n++){let d=Ie.join(g,s);if(await Bun.file(d).exists())return d;g=Ie.dirname(g)}a=Ie.join(e,s)}else if(s.startsWith("./")||s.startsWith("../"))a=Ie.resolve(e,s);else a=Ie.resolve(e,s);if(await Bun.file(a).exists())return a;return null}catch{return null}}var or=Symbol.for("stx.inline-assets.import-meta");function Vn(s,e){if(!s.includes("import.meta"))return;let c=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 c[or]=!0,c}async function ar(s,e,c){let a=s,g=Ie.dirname(e),n=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,d;while((d=n.exec(a))!==null){let[x,w,v,k]=d;if(sr(v))continue;let S=await ir(v,g,e);if(S)try{let M=await Bun.file(S).text();if(c.add(S),v.endsWith(".ts")||v.endsWith(".tsx")){let R=await Bun.build({entrypoints:[S],target:"browser",minify:!0,define:C()});if(R.outputs.length>0)M=await R.outputs[0].text(),Vn(M,v)}let T=`<script>
1288
+ `}import Ie from"path";function nr(s){return s.startsWith("http://")||s.startsWith("https://")||s.startsWith("//")}async function ir(s,e,c){try{let a;if(s.startsWith("/")){let g=e;for(let n=0;n<5;n++){let d=Ie.join(g,s);if(await Bun.file(d).exists())return d;g=Ie.dirname(g)}a=Ie.join(e,s)}else if(s.startsWith("./")||s.startsWith("../"))a=Ie.resolve(e,s);else a=Ie.resolve(e,s);if(await Bun.file(a).exists())return a;return null}catch{return null}}var or=Symbol.for("stx.inline-assets.import-meta");function Vn(s,e){if(!s.includes("import.meta"))return;let c=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 c[or]=!0,c}async function ar(s,e,c){let a=s,g=Ie.dirname(e),n=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,d;while((d=n.exec(a))!==null){let[x,w,v,k]=d;if(nr(v))continue;let S=await ir(v,g,e);if(S)try{let M=await Bun.file(S).text();if(c.add(S),v.endsWith(".ts")||v.endsWith(".tsx")){let R=await Bun.build({entrypoints:[S],target:"browser",minify:!0,define:C()});if(R.outputs.length>0)M=await R.outputs[0].text(),Vn(M,v)}let T=`<script>
1290
1290
  // Source: ${v}
1291
1291
  ${M}
1292
- </script>`;a=a.replace(x,T),n.lastIndex=0}catch(M){if(M?.[or])throw M}}let y=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,m;while((m=y.exec(a))!==null){let[x,w,v,k]=m,S=w+k;if(sr(v))continue;if(/rel=["']stylesheet["']/.test(S)||v.endsWith(".css")){let T=await ir(v,g,e);if(T)try{let R=await Bun.file(T).text();c.add(T);let D=`<style>
1292
+ </script>`;a=a.replace(x,T),n.lastIndex=0}catch(M){if(M?.[or])throw M}}let y=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,m;while((m=y.exec(a))!==null){let[x,w,v,k]=m,S=w+k;if(nr(v))continue;if(/rel=["']stylesheet["']/.test(S)||v.endsWith(".css")){let T=await ir(v,g,e);if(T)try{let R=await Bun.file(T).text();c.add(T);let D=`<style>
1293
1293
  /* Source: ${v} */
1294
1294
  ${R}
1295
- </style>`;a=a.replace(x,D),y.lastIndex=0}catch(R){}}}return a}import it from"path";var Wn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Xn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function zn(s,e){if(!e||!s.includes("/"))return s;let c=it.dirname(e);return s.replace(Wn,(a,g,n,d)=>{let y=it.resolve(c,d);return`${g}${n}${y.split(it.sep).join("/")}${n}`})}function ur(s,e){if(!e||!s.includes("<script"))return s;return s.replace(Xn,(c,a,g,n)=>`${a}${zn(g,e)}${n}`)}var Ee="<!--PARENT_CONTENT_PLACEHOLDER-->";function dr(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vr(s,e){let c=s.length,a=e,g=!0,n=[],d=(y)=>y+9<=c&&s[y]==="<"&&s[y+1]==="/"&&(s[y+2]==="s"||s[y+2]==="S")&&(s[y+3]==="c"||s[y+3]==="C")&&(s[y+4]==="r"||s[y+4]==="R")&&(s[y+5]==="i"||s[y+5]==="I")&&(s[y+6]==="p"||s[y+6]==="P")&&(s[y+7]==="t"||s[y+7]==="T")&&(s[y+8]===">"||/\s/.test(s[y+8]));while(a<c){let y=s[a];if(d(a))return a;if(y==="/"&&s[a+1]==="/"){if(a=s.indexOf(`
1295
+ </style>`;a=a.replace(x,D),y.lastIndex=0}catch(R){}}}return a}import it from"path";var Wn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Xn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function zn(s,e){if(!e||!s.includes("/"))return s;let c=it.dirname(e);return s.replace(Wn,(a,g,n,d)=>{let y=it.resolve(c,d);return`${g}${n}${y.split(it.sep).join("/")}${n}`})}function cr(s,e){if(!e||!s.includes("<script"))return s;return s.replace(Xn,(c,a,g,n)=>`${a}${zn(g,e)}${n}`)}var Ee="<!--PARENT_CONTENT_PLACEHOLDER-->";function dr(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vr(s,e){let c=s.length,a=e,g=!0,n=[],d=(y)=>y+9<=c&&s[y]==="<"&&s[y+1]==="/"&&(s[y+2]==="s"||s[y+2]==="S")&&(s[y+3]==="c"||s[y+3]==="C")&&(s[y+4]==="r"||s[y+4]==="R")&&(s[y+5]==="i"||s[y+5]==="I")&&(s[y+6]==="p"||s[y+6]==="P")&&(s[y+7]==="t"||s[y+7]==="T")&&(s[y+8]===">"||/\s/.test(s[y+8]));while(a<c){let y=s[a];if(d(a))return a;if(y==="/"&&s[a+1]==="/"){if(a=s.indexOf(`
1296
1296
  `,a+2),a===-1)return-1;a+=1,g=!0;continue}if(y==="/"&&s[a+1]==="*"){let m=s.indexOf("*/",a+2);if(m===-1)return-1;a=m+2,g=!0;continue}if(y==="/"&&g){let m=a+1,x=!1;while(m<c){let w=s[m];if(w==="\\"){m+=2;continue}if(w==="[")x=!0;else if(w==="]")x=!1;else if(w==="/"&&!x){m++;break}else if(w===`
1297
1297
  `){m=-1;break}m++}if(m===-1){a++,g=!1;continue}while(m<c&&/[a-z]/.test(s[m]))m++;a=m,g=!1;continue}if(y==="'"||y==='"'){let m=y;a++;while(a<c){if(s[a]==="\\"){a+=2;continue}if(s[a]===m){a++;break}if(s[a]===`
1298
- `)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(s[a]==="\\"){a+=2;continue}if(s[a]==="`"){a++;break}if(s[a]==="$"&&s[a+1]==="{"){n.push(!0),a+=2,g=!0;break}a++}if(n.length===0)g=!1;continue}if(y==="}"&&n.length>0){n.pop(),a++;while(a<c){if(s[a]==="\\"){a+=2;continue}if(s[a]==="`"){a++,g=!1;break}if(s[a]==="$"&&s[a+1]==="{"){n.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function kr(s,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(s);if(!a)return null;let g=a.index+a[0].length,n=s.indexOf("</script>",g);if(n===-1)return null;let d=s.indexOf(">",n);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function ot(s,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-6g8byhwn.js");return`<script ${s} src="${a(e)}"></script>`}async function rr(s,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:n}=await o("stx/client-module-registry",()=>import("./chunk-z0yq548d.js")),d=[],y=await n(g(...s),{minify:Ai(e.buildMode,e.minifyClient),collectInputs:d});for(let m of d)c?.add(m);if(a)a.inputs=d,a.code=y??void 0;if(!y)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-6g8byhwn.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(y)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Zn(s,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-5w0cf32p.js"));g.frameworkScript=await k(s)}catch{}let n=null;try{n=await o("stx/store-loader",()=>import("./chunk-zfjbwp54.js"))}catch{}let d=e.storesDir,y=!!a.__stx_native_screen||(n?.pageStoresAll()??!0),m=y?"":s.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",T=!1;try{if(n){let N=y?await n.getStoreScript(d).then((F)=>F?{code:F,stores:["*"],functions:null}:null):await n.getStoreScriptFor(d,[m],{reads:n.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),T=!!N.functions&&!y}}catch{}if(v!==null&&M===v)break;v=M;let R=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await ot(R,S,e)??D:null;let j={};g.modulesTag=await rr([s,D],e,c,j),g.modulesCode=j.code??null,x=j.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-aqrx322x.js")),F=e.composablesDir,I=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??F,s,I,w);if(L)g.composableCode=L,g.composableTag=await ot('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(y||!n)break}return g}async function Jn(s,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:n}=await import("./chunk-qs0vtav5.js"),d=await import("./chunk-2nxxhcyy.js"),{messages:y,webModules:m}=e,x=null,w=null,v=n()===""&&!a.__stx_native_screen;if(y&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),y)}catch(R){Qn(R)}if(m&&Object.keys(m).length&&v)try{w=await(await import("./chunk-c3dg8qdn.js")).loadWebModules(process.cwd(),m)}catch(R){Yn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Zn(s,e,c,a),M=k.size?await g(k,S):await S(),T=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(s,x),R);if(D)T=await ot('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var fr=!1;function Qn(s){if(fr)return;fr=!0,console.warn(`[stx] messages: ${s instanceof Error?s.message:String(s)}; pages ship every language`)}var gr=!1;function Yn(s){if(gr)return;gr=!0,console.warn(`[stx] ${s instanceof Error?s.message:String(s)}; pages bundle the real modules`)}function es(s,e=""){let c=kr(s,"data-stx-runtime");if(!c)return s;let a=cr(s);if(a===-1||a===c.start){if(!e)return s;return s.slice(0,c.end)+e+s.slice(c.end)}if(a<c.start)return s.slice(0,a)+s.slice(c.start,c.end)+e+`
1299
- `+s.slice(a,c.start)+s.slice(c.end);let g=s.slice(c.start,c.end),n=s.slice(0,c.start)+s.slice(c.end),d=cr(n);if(d===-1)return g+e+`
1298
+ `)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(s[a]==="\\"){a+=2;continue}if(s[a]==="`"){a++;break}if(s[a]==="$"&&s[a+1]==="{"){n.push(!0),a+=2,g=!0;break}a++}if(n.length===0)g=!1;continue}if(y==="}"&&n.length>0){n.pop(),a++;while(a<c){if(s[a]==="\\"){a+=2;continue}if(s[a]==="`"){a++,g=!1;break}if(s[a]==="$"&&s[a+1]==="{"){n.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function kr(s,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(s);if(!a)return null;let g=a.index+a[0].length,n=s.indexOf("</script>",g);if(n===-1)return null;let d=s.indexOf(">",n);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function ot(s,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-ywpan1k5.js");return`<script ${s} src="${a(e)}"></script>`}async function sr(s,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:n}=await o("stx/client-module-registry",()=>import("./chunk-znwc8gta.js")),d=[],y=await n(g(...s),{minify:Pi(e.buildMode,e.minifyClient),collectInputs:d});for(let m of d)c?.add(m);if(a)a.inputs=d,a.code=y??void 0;if(!y)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-ywpan1k5.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(y)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Zn(s,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-5pbxjx8s.js"));g.frameworkScript=await k(s)}catch{}let n=null;try{n=await o("stx/store-loader",()=>import("./chunk-03v59965.js"))}catch{}let d=e.storesDir,y=!!a.__stx_native_screen||(n?.pageStoresAll()??!0),m=y?"":s.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",T=!1;try{if(n){let N=y?await n.getStoreScript(d).then((F)=>F?{code:F,stores:["*"],functions:null}:null):await n.getStoreScriptFor(d,[m],{reads:n.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),T=!!N.functions&&!y}}catch{}if(v!==null&&M===v)break;v=M;let R=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await ot(R,S,e)??D:null;let j={};g.modulesTag=await sr([s,D],e,c,j),g.modulesCode=j.code??null,x=j.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-a2p42cxf.js")),F=e.composablesDir,I=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??F,s,I,w);if(L)g.composableCode=L,g.composableTag=await ot('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(y||!n)break}return g}async function Jn(s,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:n}=await import("./chunk-mh4kpnjr.js"),d=await import("./chunk-sv2d6nfe.js"),{messages:y,webModules:m}=e,x=null,w=null,v=n()===""&&!a.__stx_native_screen;if(y&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),y)}catch(R){Qn(R)}if(m&&Object.keys(m).length&&v)try{w=await(await import("./chunk-97k72dfh.js")).loadWebModules(process.cwd(),m)}catch(R){Yn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Zn(s,e,c,a),M=k.size?await g(k,S):await S(),T=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(s,x),R);if(D)T=await ot('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var pr=!1;function Qn(s){if(pr)return;pr=!0,console.warn(`[stx] messages: ${s instanceof Error?s.message:String(s)}; pages ship every language`)}var gr=!1;function Yn(s){if(gr)return;gr=!0,console.warn(`[stx] ${s instanceof Error?s.message:String(s)}; pages bundle the real modules`)}function es(s,e=""){let c=kr(s,"data-stx-runtime");if(!c)return s;let a=lr(s);if(a===-1||a===c.start){if(!e)return s;return s.slice(0,c.end)+e+s.slice(c.end)}if(a<c.start)return s.slice(0,a)+s.slice(c.start,c.end)+e+`
1299
+ `+s.slice(a,c.start)+s.slice(c.end);let g=s.slice(c.start,c.end),n=s.slice(0,c.start)+s.slice(c.end),d=lr(n);if(d===-1)return g+e+`
1300
1300
  `+n;return n.slice(0,d)+g+e+`
1301
- `+n.slice(d)}function ts(s){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return s.replace(e,(c,a,g)=>{let n=s.slice(0,g);return n.lastIndexOf("<")>n.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(s,e,c,a,g){if(await A(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return s;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=ke(s,c);let n=!e.__stxProcessingDepth;yn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(n&&a.runtimeConfig)await Sn(e,c,a.runtimeConfig);if(n)Wc(e),e.__stx_scope_seq??={n:0,key:Us(String(e.__filename??c))},e.__stx_head_injections=Ti(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!E()&&!En())&&c&&c.endsWith(".stx"))Lo(s,c);try{return await ae.timeAsync("template-processing",async()=>{let d=await rs(s,e,c,a,g);if(n)d=mi(d);if(n&&a.autoShell&&a.buildMode!=="compile"){let y=Ce(a.app?.head,{known:Or,source:"app.head"}),x=(e.__stx_runtime_head||null)??Ri(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?_(S,e,c):void 0,T=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],j=new Set(D.map((V)=>at(V)).filter(Boolean)),N={...y,...T&&{title:T},meta:[...(y.meta||[]).filter((V)=>!j.has(at(V))),...D],link:[...y.link||[],...x.link||[]],script:[...y.script||[],...x.script||[]],headRaw:[y.headRaw,w].filter(Boolean).join(`
1302
- `),...x.htmlAttrs&&{htmlAttrs:cl(y.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...y.bodyAttrs||{},...x.bodyAttrs}}},F=$i(d);if(d=Pr(d,N,{...R&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},F),F)d=ul(d,y),d=Ar(d,N.htmlAttrs);let I=d.match(/<!-- stx-layout: ([^ ]+) -->/);if(I&&d.includes("<head")){let V=I[1],X=Ps(V);d=d.replace(/<head\b[^>]*>/i,(ee)=>`${ee}
1301
+ `+n.slice(d)}function ts(s){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return s.replace(e,(c,a,g)=>{let n=s.slice(0,g);return n.lastIndexOf("<")>n.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(s,e,c,a,g){if(await A(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return s;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=ke(s,c);let n=!e.__stxProcessingDepth;bn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(n&&a.runtimeConfig)await kn(e,c,a.runtimeConfig);if(n)qc(e),e.__stx_scope_seq??={n:0,key:Ws(String(e.__filename??c))},e.__stx_head_injections=$i(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!E()&&!Tn())&&c&&c.endsWith(".stx"))jo(s,c);try{return await ae.timeAsync("template-processing",async()=>{let d=await rs(s,e,c,a,g);if(n)d=hi(d);if(n&&a.autoShell&&a.buildMode!=="compile"){let y=Ce(a.app?.head,{known:Nr,source:"app.head"}),x=(e.__stx_runtime_head||null)??Ai(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?_(S,e,c):void 0,T=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],j=new Set(D.map((V)=>at(V)).filter(Boolean)),N={...y,...T&&{title:T},meta:[...(y.meta||[]).filter((V)=>!j.has(at(V))),...D],link:[...y.link||[],...x.link||[]],script:[...y.script||[],...x.script||[]],headRaw:[y.headRaw,w].filter(Boolean).join(`
1302
+ `),...x.htmlAttrs&&{htmlAttrs:ll(y.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...y.bodyAttrs||{},...x.bodyAttrs}}},F=Ri(d);if(d=Ir(d,N,{...R&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},F),F)d=dl(d,y),d=Pr(d,N.htmlAttrs);let I=d.match(/<!-- stx-layout: ([^ ]+) -->/);if(I&&d.includes("<head")){let V=I[1],X=Is(V);d=d.replace(/<head\b[^>]*>/i,(ee)=>`${ee}
1303
1303
  <meta name="stx-layout" content="${dr(V)}">
1304
- <meta name="stx-layout-group" content="${dr(X)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?B(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Ze(d,(X,ee)=>`<body${ee} data-stx="${L[1]}">`);let V=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(V,"$1")}}if(n){let y=e.__stx_head_injections??Ti(),m=ll(d);if(m!==null)y.beforeClose.push(m);let x=tr(d);if(x!==null)y.afterOpen.push(x);if(a.offline?.enabled&&!d.includes("data-stx-offline"))y.beforeClose.push(nr);d=il(d,y);let w=a.app?.colorMode;if(w)d=Rr(d,w)}if(n)if(kr(d,"data-stx-runtime")){let m=await Jn(d,a,g,e);d=es(d,m.map((x)=>`
1305
- ${x}`).join(""))}else{let m=await rr([d],a,g);if(m){let x=d.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)d=d.slice(0,x)+m+`
1306
- `+d.slice(x)}}if(n)d=al(d);if(n&&e.__stx_inject_css!==!1)d=await b(d,void 0,a.buildMode==="serve",!0);else if(n)d=mn(d);if(n)d=dt(d);if(d=d.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),d=ts(d),n&&e.__stx_runtime_config)d=Lt(d,e.__stx_runtime_config);if(n&&!e.__stx_defer_server_data){let y=Cr(e);if(y){let m=/<head\b[^>]*>/i.exec(d),x=m?m.index+m[0].length:0;d=d.slice(0,x)+y+d.slice(x)}}return d})}catch(d){if(d instanceof K)throw d;let y=d instanceof Error?d.message:String(d),m=new ce(`Template processing failed: ${y}`,c,void 0,void 0,s.substring(0,200)+(s.length>200?"...":""));if(z.log(m,{filePath:c,context:e}),_n.logDetailedError(m,{filePath:c,template:s.substring(0,500)}),E()&&!a.debug)console.error(`[stx] ${ie.relative(process.cwd(),c)||c}: ${m.message}`);if(a.debug)throw m;return Ci.createFallbackContent("Template Processing",m)}}async function rs(s,e,c,a,g){let n=process.cwd(),d={...a,partialsDir:a.partialsDir&&!ie.isAbsolute(a.partialsDir)?ie.resolve(n,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!ie.isAbsolute(a.componentsDir)?ie.resolve(n,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!ie.isAbsolute(a.layoutsDir)?ie.resolve(n,a.layoutsDir):a.layoutsDir},y=d,m=s;await os(c,e),ss(e,y),m=await _e(()=>Vt(m,e,c,y),m,(I)=>{z.log(I,{filePath:c,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${c}: ${I.message}`)}),m=m.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=fe(m,Me,(I,L)=>`\x00STX_HTML_COMMENT_${L}\x00`);m=x.output;let w=x.tokens,v=(I)=>w.length===0?I:I.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(L,H)=>w[Number(H)]??""),k="\x00STX_ESCAPED_AT\x00",S="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";m=m.replace(/@@/g,k),m=m.replace(/@\{\{([\s\S]*?)\}\}/g,(I,L)=>`${S}${L}${M}`),m=Zt(m),m=await ar(m,c,g);let T={};m=cs(m,T);let R={...e.__sections||{}},D="",j=yt(bt(s)),N=/@nolayout\b/.test(m)||j===!1;if(/@nolayout\b/.test(m))m=m.replace(/@nolayout\b\s*/g,"");let F=m.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(F)D=F[1],m=m.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof j==="string"){if(D=j,!/@section\s*\(/.test(m))m=`@section('content')
1304
+ <meta name="stx-layout-group" content="${dr(X)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?B(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Ze(d,(X,ee)=>`<body${ee} data-stx="${L[1]}">`);let V=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(V,"$1")}}if(n){let y=e.__stx_head_injections??$i(),m=ul(d);if(m!==null)y.beforeClose.push(m);let x=tr(d);if(x!==null)y.afterOpen.push(x);if(a.offline?.enabled&&!d.includes("data-stx-offline"))y.beforeClose.push(rr);d=al(d,y);let w=a.app?.colorMode;if(w)d=Ar(d,w)}if(n)if(kr(d,"data-stx-runtime")){let m=await Jn(d,a,g,e);d=es(d,m.map((x)=>`
1305
+ ${x}`).join(""))}else{let m=await sr([d],a,g);if(m){let x=d.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)d=d.slice(0,x)+m+`
1306
+ `+d.slice(x)}}if(n)d=cl(d);if(n&&e.__stx_inject_css!==!1)d=await b(d,void 0,a.buildMode==="serve",!0);else if(n)d=hn(d);if(n)d=dt(d);if(d=d.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),d=ts(d),n&&e.__stx_runtime_config)d=jt(d,e.__stx_runtime_config);if(n&&!e.__stx_defer_server_data){let y=Er(e);if(y){let m=/<head\b[^>]*>/i.exec(d),x=m?m.index+m[0].length:0;d=d.slice(0,x)+y+d.slice(x)}}return d})}catch(d){if(d instanceof K)throw d;let y=d instanceof Error?d.message:String(d),m=new ce(`Template processing failed: ${y}`,c,void 0,void 0,s.substring(0,200)+(s.length>200?"...":""));if(z.log(m,{filePath:c,context:e}),Cn.logDetailedError(m,{filePath:c,template:s.substring(0,500)}),E()&&!a.debug)console.error(`[stx] ${ie.relative(process.cwd(),c)||c}: ${m.message}`);if(a.debug)throw m;return Ei.createFallbackContent("Template Processing",m)}}async function rs(s,e,c,a,g){let n=process.cwd(),d={...a,partialsDir:a.partialsDir&&!ie.isAbsolute(a.partialsDir)?ie.resolve(n,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!ie.isAbsolute(a.componentsDir)?ie.resolve(n,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!ie.isAbsolute(a.layoutsDir)?ie.resolve(n,a.layoutsDir):a.layoutsDir},y=d,m=s;await is(c,e),ss(e,y),m=await _e(()=>Wt(m,e,c,y),m,(I)=>{z.log(I,{filePath:c,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${c}: ${I.message}`)}),m=m.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=fe(m,Me,(I,L)=>`\x00STX_HTML_COMMENT_${L}\x00`);m=x.output;let w=x.tokens,v=(I)=>w.length===0?I:I.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(L,H)=>w[Number(H)]??""),k="\x00STX_ESCAPED_AT\x00",S="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";m=m.replace(/@@/g,k),m=m.replace(/@\{\{([\s\S]*?)\}\}/g,(I,L)=>`${S}${L}${M}`),m=Zt(m),m=await ar(m,c,g);let T={};m=ls(m,T);let R={...e.__sections||{}},D="",j=yt(bt(s)),N=/@nolayout\b/.test(m)||j===!1;if(/@nolayout\b/.test(m))m=m.replace(/@nolayout\b\s*/g,"");let F=m.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(F)D=F[1],m=m.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof j==="string"){if(D=j,!/@section\s*\(/.test(m))m=`@section('content')
1307
1307
  ${m.trim()}
1308
- @endsection`}if(!D&&!N&&y.defaultLayout){let I=Cn(m),L=/@section\s*\(/.test(m);if(!I||L){let H="",V=ie.dirname(c),X=y.layoutsDir?ie.dirname(y.layoutsDir):process.cwd();for(let ee=0;ee<20;ee++){let te=ie.join(V,"_layout.stx");if(await r(te)){H=te;break}let re=ie.dirname(V);if(re===V||re.length<X.length)break;V=re}if(H)D=H;else if(y.layoutsDir){let ee=ie.isAbsolute(y.layoutsDir)?y.layoutsDir:ie.resolve(process.cwd(),y.layoutsDir),te=ie.join(ee,`${y.defaultLayout}.stx`);if(await r(te))D=te}if(D&&!L)m=`@section('content')
1308
+ @endsection`}if(!D&&!N&&y.defaultLayout){let I=En(m),L=/@section\s*\(/.test(m);if(!I||L){let H="",V=ie.dirname(c),X=y.layoutsDir?ie.dirname(y.layoutsDir):process.cwd();for(let ee=0;ee<20;ee++){let te=ie.join(V,"_layout.stx");if(await r(te)){H=te;break}let re=ie.dirname(V);if(re===V||re.length<X.length)break;V=re}if(H)D=H;else if(y.layoutsDir){let ee=ie.isAbsolute(y.layoutsDir)?y.layoutsDir:ie.resolve(process.cwd(),y.layoutsDir),te=ie.join(ee,`${y.defaultLayout}.stx`);if(await r(te))D=te}if(D&&!L)m=`@section('content')
1309
1309
  ${m.trim()}
1310
- @endsection`}}if(D&&m.includes("<script")){let I=J(m),L=I.scripts.map((H)=>hr(H,c)??H);m=xr(I.output,L)}if(m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(I,L,H)=>(R[L]=H,"")),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(I,L,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return I;try{let V=u(H.trim(),e);if(V===void 0)return I;let ee=(e.__stx_inline_section_values??=[]).push(V)-1;return R[L]=`{{ __stx_inline_section_values[${ee}] }}`,""}catch{return I}}),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(I,L,H)=>{if(H.includes("@parent"))R[L]=H.replace("@parent",Ee);else R[L]=H.trim();return""}),e.__sections=R,m=m.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(I,L,H)=>R[L]||H||""),!("slot"in e)||e.slot===void 0)m=m.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||"");if(m=ls(m,T),D){let I=[],L=J(m),H=fe(L.output,gn,(V,X)=>`\x00STX_ORPHAN_STYLE_${X}\x00`);if(m=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(V,X,ee)=>{let te=X==="SCRIPT"?hr(L.scripts[Number(ee)],c):H.tokens[Number(ee)];if(te)I.push(te);return""}),I.length>0){let V=I.join(`
1310
+ @endsection`}}if(D&&m.includes("<script")){let I=J(m),L=I.scripts.map((H)=>mr(H,c)??H);m=xr(I.output,L)}if(m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(I,L,H)=>(R[L]=H,"")),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(I,L,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return I;try{let V=u(H.trim(),e);if(V===void 0)return I;let ee=(e.__stx_inline_section_values??=[]).push(V)-1;return R[L]=`{{ __stx_inline_section_values[${ee}] }}`,""}catch{return I}}),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(I,L,H)=>{if(H.includes("@parent"))R[L]=H.replace("@parent",Ee);else R[L]=H.trim();return""}),e.__sections=R,m=m.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(I,L,H)=>R[L]||H||""),!("slot"in e)||e.slot===void 0)m=m.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||"");if(m=us(m,T),D){let I=[],L=J(m),H=fe(L.output,mn,(V,X)=>`\x00STX_ORPHAN_STYLE_${X}\x00`);if(m=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(V,X,ee)=>{let te=X==="SCRIPT"?mr(L.scripts[Number(ee)],c):H.tokens[Number(ee)];if(te)I.push(te);return""}),I.length>0){let V=I.join(`
1311
1311
  `);R.content=R.content?`${R.content}
1312
- ${V}`:V,e.__sections=R}}if(D)try{let I;if(ie.isAbsolute(D))I=D,g.add(D);else I=await _e(()=>vn(D,c,d,g),null,()=>{throw new ce(`Failed to resolve layout path: ${D}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!I){let te=(G)=>{if(!G)return[];try{let me=ie.isAbsolute(G)?G:ie.resolve(process.cwd(),G);return Kn.readdirSync(me).filter((ve)=>ve.endsWith(".stx")).map((ve)=>ve.replace(/\.stx$/,""))}catch{return[]}},re=[...te(d.layoutsDir),...te(d.fallbackLayoutsDir)].filter((G,me,ve)=>ve.indexOf(G)===me).sort(),le=[d.layoutsDir,d.fallbackLayoutsDir].filter((G)=>typeof G==="string"&&G.length>0),de=le.length>0?` Searched: ${le.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",se=`Layout not found: ${D} (referenced from ${c})`+(re.length>0?`. Available layouts: ${re.join(", ")}`:d.layoutsDir?`. No .stx layouts found in ${d.layoutsDir}`:"")+de;if(z.log(Error(se),{layoutPath:D,filePath:c,available:re},"error"),console.error(`[stx] ${se}`),d.debug)throw new ce(se,c);return m}let L=await _e(()=>Bun.file(I).text(),"",()=>{throw new ce(`Failed to read layout file: ${I}`,c,void 0,void 0,"Layout content could not be loaded")});L=ur(L,I);let H=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(H){if(d.debug)console.log(`Found nested layout: ${H[1]} in ${I}`);let te={},re=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(se,G,me)=>(te[G]=me.trim(),""));for(let[se,G]of Object.entries(te))if(R[se]&&R[se].includes(Ee)){let me=R[se].indexOf(Ee);R[se]=R[se].slice(0,me)+G+R[se].slice(me+Ee.length)}else if(!R[se])R[se]=G;let le={...e,__sections:R},de=`@layout('${H[1]}')${re}`;return await i(de,le,I,d,g)}let V=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),X=cs(V,T),ee={};return X=X.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(te,re,le)=>(ee[re]=le.trim(),`@slot('${re}')`)),X=X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(te,re,le)=>{if(R[re]){let de=R[re];if(de.includes(Ee)){let se=ee[re]||"",G=de.indexOf(Ee);de=de.slice(0,G)+se+de.slice(G+Ee.length)}return de}return le||""}),X=ns(X,R),X=X.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||""),X=ls(X,T),e.__originalFilePath=c,m=await wr(X,e,I,d,g),m=`<!-- stx-layout: ${D} -->
1313
- ${m}`,v(m)}catch(I){if(I instanceof K)throw I;throw new ce(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await wr(m,e,c,d,g))}function ns(s,e){return s.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let n=e[a];if(n!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(n))return n}return g||""})}function ss(s,e){if(s.__stx_sfc_mode=!0,s.__stx_options=e,e.buildMode)s.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,n]of Object.entries(process.env))if(g.startsWith(c)&&n!==void 0)a[g]=n;s.$env=a}async function os(s,e){await _e(()=>Kt(s,e),void 0,(c)=>{z.log(c,{filePath:s,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${s}: ${c.message}`)})}var ct="data-stx-source";function hr(s,e){if(!s)return s;let c=/^<script\b([^>]*)>/i.exec(s);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return s;return`<script ${ct}="${encodeURIComponent(e)}"${s.slice(7)}`}function us(s){let e=new RegExp(`${ct}="([^"]*)"`).exec(s);return e?decodeURIComponent(e[1]):void 0}function yr(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function br(s,e,c){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">${yr(s)}</span><span style="display:block;margin-top:4px">${yr(c)}</span></div>`}async function fs(s,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-d96b9qgj.js")),n=[],d=!E()&&!En();for(let m of g(s)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let w=m.start+m.fullMatch.indexOf(">")+1,v=vr(s,w);if(v===-1)continue;let k=s.slice(w,v);if(!k.trim())continue;let S=us(x)??c,M={index:m.start,length:v+9-m.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-88zc5chj.js"));await T(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;n.push({...M,markup:br(S,R.kind,R.message)})}})}catch(T){let R=T instanceof Error?T:Error(String(T));if(z.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)n.push({...M,markup:br(S,"unknown",R.message)})}}if(n.length===0)return s;let y=s;for(let m of n.sort((x,w)=>w.index-x.index))y=y.slice(0,m.index)+m.markup+y.slice(m.index+m.length);return y}async function gs(s,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-5p6x0ztt.js"));return a(s,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return z.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),s}}async function wr(s,e,c,a,g){let n=s;await A();let d=a;if(n=await fs(n,e,c,a),n=await Ht(n,e,c),n=await Bt(n,e,c),n=await gs(n,e,c),await A(),n=await Ct(n,e,c,d),ke(n))n=qo(n,e),n=ys(n,e),n=hs(n,e);n=Ko(n),await A();let{processStreamDirectives:y}=await o("stx/streaming",()=>import("./chunk-y41hhypj.js"));n=y(n,e),n=await zo(n,e,c,d,!0),await A(),n=await er(n,e,c,d,g),n=await ds(n,e,c,d,g),await A(),n=gc(n,e,c,d);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-ay7ggc4k.js"));n=m(n,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-1bpx9b0m.js"));n=x(n,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-72n804gy.js"));n=w(n,e,c),n=v(n);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));n=k(n,e,c),n=S(n);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-txzap6yn.js"));n=M(n,e,c);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-m3tnxk01.js"));n=T(n,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-6aak0b7c.js"));n=R(n,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:j,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-cw8vpk41.js"));n=D(n,e,c),n=j(n,e,c),n=N(n,e,c),await A();let{processPartialHydrationDirectives:F,processStaticDirectives:I}=await o("stx/partial-hydration",()=>import("./chunk-pe5qqem0.js"));n=F(n,e,c),n=I(n);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));n=L(n,e,c),n=H(n,e,c);let{processFormValidationDirectives:V}=await o("stx/forms-validation",()=>import("./chunk-wj937ceq.js"));n=V(n,e,c);let{processHeadDirective:X,processTitleDirective:ee,processMetaDirective:te,resetHead:re}=await o("stx/head",()=>import("./chunk-bc4x45vx.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)re();let le=X(n);if(n=le.content,le.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${le.headContent}
1314
- `;if(n=ee(n,e),n=te(n,e,c),n=Xt(n),n=Ho(n,e),n=_t(n),n=Ut(n),n=await as(n,e,c,d,g),n=await ds(n,e,c,d,g),await A(),n=n.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),n=mi(n),n=oe(n,e,c),n=ps(n),await A(),e.__stxProcessingDepth===1)n=qc(n,e);if(n=Fc(n,e,{filePath:c,buildMode:d.buildMode}),n=Vo(n,e),n=Uo(n,e),n=We(n,e),n=Pt(n,e),n=Nt(n,e),n=await wt(n,e,c,d),n=await hc(n,e,c),n=await yc(n,e,c,d),await A(),n=bc(n,e,c,d),n=ei(n,e,c,d),n=ti(n,e,c),n=ni(n,e,c,d),n=Et(n,e,c,d),n=Hs(n,e),n=Vs(n),n=Hc(n),!d.skipEventDirectives)n=Ac(n,e,c);if(n=zc(n,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await A(),d.debug){let U=/\bx-data\s*=/.test(n),q=ms(s);if(U&&q)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1312
+ ${V}`:V,e.__sections=R}}if(D)try{let I;if(ie.isAbsolute(D))I=D,g.add(D);else I=await _e(()=>xn(D,c,d,g),null,()=>{throw new ce(`Failed to resolve layout path: ${D}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!I){let te=(G)=>{if(!G)return[];try{let me=ie.isAbsolute(G)?G:ie.resolve(process.cwd(),G);return Kn.readdirSync(me).filter((ve)=>ve.endsWith(".stx")).map((ve)=>ve.replace(/\.stx$/,""))}catch{return[]}},re=[...te(d.layoutsDir),...te(d.fallbackLayoutsDir)].filter((G,me,ve)=>ve.indexOf(G)===me).sort(),le=[d.layoutsDir,d.fallbackLayoutsDir].filter((G)=>typeof G==="string"&&G.length>0),de=le.length>0?` Searched: ${le.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",se=`Layout not found: ${D} (referenced from ${c})`+(re.length>0?`. Available layouts: ${re.join(", ")}`:d.layoutsDir?`. No .stx layouts found in ${d.layoutsDir}`:"")+de;if(z.log(Error(se),{layoutPath:D,filePath:c,available:re},"error"),console.error(`[stx] ${se}`),d.debug)throw new ce(se,c);return m}let L=await _e(()=>Bun.file(I).text(),"",()=>{throw new ce(`Failed to read layout file: ${I}`,c,void 0,void 0,"Layout content could not be loaded")});L=cr(L,I);let H=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(H){if(d.debug)console.log(`Found nested layout: ${H[1]} in ${I}`);let te={},re=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(se,G,me)=>(te[G]=me.trim(),""));for(let[se,G]of Object.entries(te))if(R[se]&&R[se].includes(Ee)){let me=R[se].indexOf(Ee);R[se]=R[se].slice(0,me)+G+R[se].slice(me+Ee.length)}else if(!R[se])R[se]=G;let le={...e,__sections:R},de=`@layout('${H[1]}')${re}`;return await i(de,le,I,d,g)}let V=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),X=ls(V,T),ee={};return X=X.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(te,re,le)=>(ee[re]=le.trim(),`@slot('${re}')`)),X=X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(te,re,le)=>{if(R[re]){let de=R[re];if(de.includes(Ee)){let se=ee[re]||"",G=de.indexOf(Ee);de=de.slice(0,G)+se+de.slice(G+Ee.length)}return de}return le||""}),X=ns(X,R),X=X.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||""),X=us(X,T),e.__originalFilePath=c,m=await wr(X,e,I,d,g),m=`<!-- stx-layout: ${D} -->
1313
+ ${m}`,v(m)}catch(I){if(I instanceof K)throw I;throw new ce(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await wr(m,e,c,d,g))}function ns(s,e){return s.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let n=e[a];if(n!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(n))return n}return g||""})}function ss(s,e){if(s.__stx_sfc_mode=!0,s.__stx_options=e,e.buildMode)s.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,n]of Object.entries(process.env))if(g.startsWith(c)&&n!==void 0)a[g]=n;s.$env=a}async function is(s,e){await _e(()=>Kt(s,e),void 0,(c)=>{z.log(c,{filePath:s,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${s}: ${c.message}`)})}var ct="data-stx-source";function mr(s,e){if(!s)return s;let c=/^<script\b([^>]*)>/i.exec(s);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return s;return`<script ${ct}="${encodeURIComponent(e)}"${s.slice(7)}`}function os(s){let e=new RegExp(`${ct}="([^"]*)"`).exec(s);return e?decodeURIComponent(e[1]):void 0}function yr(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function br(s,e,c){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">${yr(s)}</span><span style="display:block;margin-top:4px">${yr(c)}</span></div>`}async function ds(s,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-qcars8ar.js")),n=[],d=!E()&&!Tn();for(let m of g(s)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let w=m.start+m.fullMatch.indexOf(">")+1,v=vr(s,w);if(v===-1)continue;let k=s.slice(w,v);if(!k.trim())continue;let S=os(x)??c,M={index:m.start,length:v+9-m.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-3gzhh69y.js"));await T(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;n.push({...M,markup:br(S,R.kind,R.message)})}})}catch(T){let R=T instanceof Error?T:Error(String(T));if(z.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)n.push({...M,markup:br(S,"unknown",R.message)})}}if(n.length===0)return s;let y=s;for(let m of n.sort((x,w)=>w.index-x.index))y=y.slice(0,m.index)+m.markup+y.slice(m.index+m.length);return y}async function fs(s,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-8gdtys3s.js"));return a(s,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return z.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),s}}async function wr(s,e,c,a,g){let n=s;await A();let d=a;if(n=await ds(n,e,c,a),n=await Nt(n,e,c),n=await Ft(n,e,c),n=await fs(n,e,c),await A(),n=await Ct(n,e,c,d),ke(n))n=Ko(n,e),n=bs(n,e),n=ys(n,e);n=Xo(n),await A();let{processStreamDirectives:y}=await o("stx/streaming",()=>import("./chunk-p2e02hh7.js"));n=y(n,e),n=await Ho(n,e,c,d,!0),await A(),n=await er(n,e,c,d,g),n=await ps(n,e,c,d,g),await A(),n=mc(n,e,c,d);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-d5vr9g4b.js"));n=m(n,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-r5bhgyes.js"));n=x(n,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-y64qhgv1.js"));n=w(n,e,c),n=v(n);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));n=k(n,e,c),n=S(n);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-d44g9sek.js"));n=M(n,e,c);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-41sh9y5w.js"));n=T(n,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-gaxx0z19.js"));n=R(n,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:j,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-yjskeqaj.js"));n=D(n,e,c),n=j(n,e,c),n=N(n,e,c),await A();let{processPartialHydrationDirectives:F,processStaticDirectives:I}=await o("stx/partial-hydration",()=>import("./chunk-h8h79939.js"));n=F(n,e,c),n=I(n);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));n=L(n,e,c),n=H(n,e,c);let{processFormValidationDirectives:V}=await o("stx/forms-validation",()=>import("./chunk-ga8waz0a.js"));n=V(n,e,c);let{processHeadDirective:X,processTitleDirective:ee,processMetaDirective:te,resetHead:re}=await o("stx/head",()=>import("./chunk-ksc83y9t.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)re();let le=X(n);if(n=le.content,le.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${le.headContent}
1314
+ `;if(n=ee(n,e),n=te(n,e,c),n=zt(n),n=Vo(n,e),n=_t(n),n=qt(n),n=await cs(n,e,c,d,g),n=await ps(n,e,c,d,g),await A(),n=n.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),n=hi(n),n=oe(n,e,c),n=gs(n),await A(),e.__stxProcessingDepth===1)n=Kc(n,e);if(n=zc(n,e,{filePath:c,buildMode:d.buildMode}),n=Uo(n,e),n=Wo(n,e),n=We(n,e),n=Lt(n,e),n=Pt(n,e),n=await wt(n,e,c,d),n=await yc(n,e,c),n=await bc(n,e,c,d),await A(),n=wc(n,e,c,d),n=ti(n,e,c,d),n=ni(n,e,c),n=ri(n,e,c,d),n=Et(n,e,c,d),n=Vs(n,e),n=Us(n),n=Vc(n),!d.skipEventDirectives)n=Pc(n,e,c);if(n=Hc(n,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await A(),d.debug){let U=/\bx-data\s*=/.test(n),q=hs(s);if(U&&q)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1315
1315
  Both work on the same page, but they manage separate scopes.
1316
- Prefer signals (state/derived/effect) for new components.`)}n=lc(n,e),n=await _(n,e,c),await A(),n=Vc(n),n=Uc(n),n=mt(n);let{processXElementDirectives:de}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));n=de(n);let se=e.__originalFilePath||c,G=Le(e);if(n=await Xo(n,d,se,G),await A(),n=Dt(n,e),n=await Wt(n,e,c,d),await A(),d.media?.image?.autoSiblings){let U=d.publicDir||"public",{rewriteImagesWithSiblings:q}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-xrspzeqx.js"));n=await q(n,{publicDir:U})}if(d.seo?.enabled)n=ri(n,e,d);let me=(U,q,Z=!0)=>{if(!q)return U;let he=q.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ne=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(U),pe=ne?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ne[0]):null;if(he&&ne&&pe){if(Z){let Te=ne.index+pe.index;U=U.slice(0,Te)+he[0]+U.slice(Te+pe[0].length)}if(q=q.replace(he[0],"").trim(),!q)return U}if(/<\/head>/i.test(U))return U.replace(/<\/head>/i,`${q}
1316
+ Prefer signals (state/derived/effect) for new components.`)}n=uc(n,e),n=await _(n,e,c),await A(),n=Uc(n),n=Wc(n),n=mt(n);let{processXElementDirectives:de}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));n=de(n);let se=e.__originalFilePath||c,G=Le(e);if(n=await Go(n,d,se,G),await A(),n=Dt(n,e),n=await Xt(n,e,c,d),await A(),d.media?.image?.autoSiblings){let U=d.publicDir||"public",{rewriteImagesWithSiblings:q}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-rzfbffnv.js"));n=await q(n,{publicDir:U})}if(d.seo?.enabled)n=si(n,e,d);let me=(U,q,Z=!0)=>{if(!q)return U;let he=q.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ne=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(U),pe=ne?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ne[0]):null;if(he&&ne&&pe){if(Z){let Te=ne.index+pe.index;U=U.slice(0,Te)+he[0]+U.slice(Te+pe[0].length)}if(q=q.replace(he[0],"").trim(),!q)return U}if(/<\/head>/i.test(U))return U.replace(/<\/head>/i,`${q}
1317
1317
  </head>`);if(/<head\b[^>]*>/i.test(U))return U.replace(/(<head\b[^>]*>)/i,`$1
1318
1318
  ${q}`);if(/<html\b[^>]*>/i.test(U))return U.replace(/(<html\b[^>]*>)/i,`$1
1319
1319
  <head>
1320
1320
  ${q}
1321
- </head>`);return U},{renderHead:ve,getHead:Sr}=await o("stx/head",()=>import("./chunk-bc4x45vx.js")),Oe=e.__stx_runtime_head??Sr();if(Oe.title||Oe.meta?.length||Oe.link?.length){let U=ve(Oe);if(U)n=me(n,U)}if(le.headContent)n=me(n,le.headContent,!Oe.title);if(d.csp?.enabled&&d.csp.addMetaTag)n=St(n,d.csp,e);if(d.analytics?.enabled)n=ht(n,d);if(d.heatmap?.enabled)n=mc(n,d);if(d.pwa?.enabled&&d.pwa.autoInject!==!1){let{injectPwaTags:U}=await o("stx/pwa/inject",()=>import("./chunk-mdtysd2d.js"));n=U(n,d)}let $r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(n),Er=/\bSTX\.\w+/.test(n),Tr=/window\.STX\s*=/.test(n);if($r&&Er&&!Tr){let q=`<script data-stx-scoped data-stx-run="once">
1321
+ </head>`);return U},{renderHead:ve,getHead:Sr}=await o("stx/head",()=>import("./chunk-ksc83y9t.js")),Oe=e.__stx_runtime_head??Sr();if(Oe.title||Oe.meta?.length||Oe.link?.length){let U=ve(Oe);if(U)n=me(n,U)}if(le.headContent)n=me(n,le.headContent,!Oe.title);if(d.csp?.enabled&&d.csp.addMetaTag)n=St(n,d.csp,e);if(d.analytics?.enabled)n=ht(n,d);if(d.heatmap?.enabled)n=hc(n,d);if(d.pwa?.enabled&&d.pwa.autoInject!==!1){let{injectPwaTags:U}=await o("stx/pwa/inject",()=>import("./chunk-b6w3457c.js"));n=U(n,d)}let $r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(n),Tr=/\bSTX\.\w+/.test(n),_r=/window\.STX\s*=/.test(n);if($r&&Tr&&!_r){let q=`<script data-stx-scoped data-stx-run="once">
1322
1322
  ${pt()}
1323
1323
  </script>`;if(n.includes("</head>")){let Z=n.indexOf("</head>"),ne=n.slice(0,Z).indexOf("<script");if(ne!==-1){let pe=n.slice(0,ne),Te=n.slice(ne);n=pe+q+`
1324
1324
  `+Te}else n=n.replace("</head>",`${q}
1325
1325
  </head>`)}else if(n.includes("<body"))n=n.replace(/<body([^>]*)>/,`<body$1>
1326
1326
  ${q}`);else n=q+`
1327
- `+n}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-d96b9qgj.js")),q=[];for(let Z of U(n)){if(!/\bserver\b/i.test(Z.attrs))continue;let he=Z.start+Z.fullMatch.indexOf(">")+1,ne=vr(n,he);if(ne===-1)continue;let pe=ne+9;while(pe<n.length&&/\s/.test(n[pe]))pe++;q.push({start:Z.start,end:pe})}if(q.length>0){let Z=Array(q.length+1),he=0;for(let ne=0;ne<q.length;ne++){let{start:pe,end:Te}=q[ne];Z[ne]=n.slice(he,pe),he=Te}Z[q.length]=n.slice(he),n=Z.join("")}}let lt=Fs(n,c);if(lt.hasScoped)n=lt.html;let _r=e.__stx_event_bindings||[],Ke=!1,ut=[],Mr=/\s:[a-z][\w.-]*\s*=/.test(n),{scanScriptTags:Dr}=await o("stx/signal-processing",()=>import("./chunk-d96b9qgj.js"));for(let U of Dr(n,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ut.push({match:U.fullMatch,attrs:U.attrs,content:U.body});for(let{match:U,attrs:q,content:Z}of ut){Ke=!0;let he=Z;Ne(Z,c,a.strict,e.__originalFilePath);let ne=await je(Z,{eventBindings:_r,attrs:q,hasColonDirectives:Mr,templateContent:s,filePath:c,projectRoot:process.cwd(),production:Ai(a.buildMode,a.minifyClient),serverData:G});n=n.replace(U,()=>ne)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let U=e.__stx_event_bindings||[];if(U.length>0){let q=li(U);if(q){let Z=n.lastIndexOf("</body>");n=Z===-1?n+q:n.slice(0,Z)+q+`
1328
- `+n.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!we(n)&&dc(n))n=await lr(n,d);if(n=pc(n),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")n=$t(n,e.cspNonce);return n}
1329
- export{bt,Ae,oc,is,Mo,Do,rr,i};
1327
+ `+n}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-qcars8ar.js")),q=[];for(let Z of U(n)){if(!/\bserver\b/i.test(Z.attrs))continue;let he=Z.start+Z.fullMatch.indexOf(">")+1,ne=vr(n,he);if(ne===-1)continue;let pe=ne+9;while(pe<n.length&&/\s/.test(n[pe]))pe++;q.push({start:Z.start,end:pe})}if(q.length>0){let Z=Array(q.length+1),he=0;for(let ne=0;ne<q.length;ne++){let{start:pe,end:Te}=q[ne];Z[ne]=n.slice(he,pe),he=Te}Z[q.length]=n.slice(he),n=Z.join("")}}let lt=zs(n,c);if(lt.hasScoped)n=lt.html;let Cr=e.__stx_event_bindings||[],Ke=!1,ut=[],Rr=/\s:[a-z][\w.-]*\s*=/.test(n),{scanScriptTags:Mr}=await o("stx/signal-processing",()=>import("./chunk-qcars8ar.js"));for(let U of Mr(n,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ut.push({match:U.fullMatch,attrs:U.attrs,content:U.body});for(let{match:U,attrs:q,content:Z}of ut){Ke=!0;let he=Z;Ne(Z,c,a.strict,e.__originalFilePath);let ne=await je(Z,{eventBindings:Cr,attrs:q,hasColonDirectives:Rr,templateContent:s,filePath:c,projectRoot:process.cwd(),production:Pi(a.buildMode,a.minifyClient),serverData:G});n=n.replace(U,()=>ne)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let U=e.__stx_event_bindings||[];if(U.length>0){let q=ui(U);if(q){let Z=n.lastIndexOf("</body>");n=Z===-1?n+q:n.slice(0,Z)+q+`
1328
+ `+n.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!we(n)&&pc(n))n=await ur(n,d);if(n=fc(n),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")n=$t(n,e.cspNonce);return n}
1329
+ export{bt,Ae,ic,as,Do,Lo,sr,i};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zg}from"./chunk-6n5kew7a.js";import"./chunk-7dnp8evg.js";import"./chunk-xdzy4pm0.js";import"./chunk-qzms4d8s.js";import"./chunk-jgx0ex9p.js";import"./chunk-xqtt5t6d.js";import"./chunk-chjdnmqv.js";import"./chunk-ns0171xk.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-vbw9jhz2.js";import"./chunk-p65ax8s0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{Zg as startProductionServer};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-4ntm3dtk.js";import"./chunk-s6r54dyf.js";import"./chunk-txd2js5v.js";import{w,S,C,Z}from"./chunk-trwe0mfa.js";import"./chunk-vfj9wp11.js";import"./chunk-cwfavkk0.js";import f from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var l=new Map,h=w(64),x=new Set,k=0,R=new Set(b);function T(){l.clear(),h.clear()}function P(n){let o=new Map;for(let r of n){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=o.get(t);if(i&&!i.endsWith(".js"))continue;o.set(t,r)}return[...o.values()].sort()}function I(n,o){let r=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(n)}function M(n){if(!n)return[];let o=S(n,k),r=h.get(o);if(r)return r.slice();let a=n.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(x.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),h.set(o,t),t.slice()}async function A(n,o){let r=M(n);if(r.length===0)return null;let a=o??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=Z({loader:"ts",target:"browser",define:C()}),O=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
2
+ import"./chunk-23r3rby6.js";import"./chunk-zjqvbcwa.js";import"./chunk-89d3h8mp.js";import{w,S,C,Z}from"./chunk-vbw9jhz2.js";import"./chunk-8370x30n.js";import"./chunk-p65ax8s0.js";import f from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var l=new Map,h=w(64),x=new Set,k=0,R=new Set(b);function T(){l.clear(),h.clear()}function P(n){let o=new Map;for(let r of n){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=o.get(t);if(i&&!i.endsWith(".js"))continue;o.set(t,r)}return[...o.values()].sort()}function I(n,o){let r=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(n)}function M(n){if(!n)return[];let o=S(n,k),r=h.get(o);if(r)return r.slice();let a=n.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(x.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),h.set(o,t),t.slice()}async function A(n,o){let r=M(n);if(r.length===0)return null;let a=o??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=Z({loader:"ts",target:"browser",define:C()}),O=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
3
3
  ${u.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let y=r.filter((s)=>!d.has(s)&&!I(n,s));if(y.length>0)console.warn(`[stx] could not bundle ${y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return l.set(t,""),null;let E=[...d].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
4
4
  `),v=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
5
  ;(function(){
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ya,bm}from"./chunk-jc5y35b7.js";export{ya as definePlugin,bm as pluginManager};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gs,Lf,Ho,jf}from"./chunk-b90xw7v4.js";import"./chunk-1b1ntgt7.js";import"./chunk-8d4br2j5.js";import"./chunk-xqtt5t6d.js";import"./chunk-2fj5zev7.js";import"./chunk-chjdnmqv.js";import"./chunk-ns0171xk.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import{It}from"./chunk-vbw9jhz2.js";import"./chunk-p65ax8s0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{jf as declareBareLoopHead,It as parseLoopBinding,Lf as processLoops,Ho as processLoopsAsync,gs as reportDeferredLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Yg}from"./chunk-rb17ssxh.js";import"./chunk-chjdnmqv.js";import"./chunk-ns0171xk.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-vbw9jhz2.js";import"./chunk-p65ax8s0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{Yg as buildApp};