@stacksjs/stx 0.2.887 → 0.2.889

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 (242) hide show
  1. package/dist/{chunk-c0g30cjs.js → chunk-05x1rd86.js} +2 -2
  2. package/dist/chunk-0g9cceht.js +2 -0
  3. package/dist/chunk-0k437z3q.js +2 -0
  4. package/dist/{chunk-69ezjc8k.js → chunk-0ncafcs2.js} +4 -4
  5. package/dist/chunk-0rpj5t80.js +2 -0
  6. package/dist/{chunk-sc1gmts0.js → chunk-1gyxxfdf.js} +2 -2
  7. package/dist/{chunk-aaea157p.js → chunk-1knk403z.js} +2 -2
  8. package/dist/{chunk-q74affc4.js → chunk-1n33yrar.js} +2 -2
  9. package/dist/chunk-1p4q6t48.js +2 -0
  10. package/dist/chunk-1z6pqvmf.js +2 -0
  11. package/dist/{chunk-s29hp1qw.js → chunk-2a5g80mq.js} +3 -3
  12. package/dist/chunk-2ba4zfa0.js +2 -0
  13. package/dist/chunk-2gn2nc2j.js +2 -0
  14. package/dist/chunk-2nqmw4dv.js +2 -0
  15. package/dist/chunk-2wkpksg1.js +2 -0
  16. package/dist/chunk-3dqfjpz4.js +68 -0
  17. package/dist/{chunk-zpj6ggee.js → chunk-3hsv6ejp.js} +4 -4
  18. package/dist/{chunk-8e1cv1hh.js → chunk-3qk8vf9m.js} +3 -3
  19. package/dist/chunk-3yjyjq0m.js +2 -0
  20. package/dist/chunk-444haxxa.js +2 -0
  21. package/dist/{chunk-azf6tdq6.js → chunk-446tb2th.js} +28 -28
  22. package/dist/{chunk-4251fy7d.js → chunk-48rwqchc.js} +11 -11
  23. package/dist/chunk-4akw3bym.js +2 -0
  24. package/dist/{chunk-twmkz0xs.js → chunk-4kmg6g5n.js} +9 -9
  25. package/dist/chunk-4rvfeee5.js +2 -0
  26. package/dist/{chunk-4n45qa0b.js → chunk-51720m79.js} +5 -5
  27. package/dist/chunk-53kcqdjj.js +2 -0
  28. package/dist/{chunk-02qmvcmv.js → chunk-55tc5w32.js} +3 -3
  29. package/dist/{chunk-0mx7rg07.js → chunk-58qzyyyv.js} +3 -3
  30. package/dist/chunk-5aa83bpm.js +2 -0
  31. package/dist/{chunk-d2pexm3z.js → chunk-5kqezrjt.js} +2 -2
  32. package/dist/chunk-5ssv10ep.js +2 -0
  33. package/dist/chunk-67rppc5v.js +2 -0
  34. package/dist/{chunk-care745q.js → chunk-6gtecbe7.js} +2 -2
  35. package/dist/{chunk-km14pdrt.js → chunk-6kyqejnq.js} +22 -22
  36. package/dist/{chunk-32twt3wx.js → chunk-6pdy7ajr.js} +3 -3
  37. package/dist/{chunk-fg67643b.js → chunk-6pz5gq6v.js} +9 -9
  38. package/dist/{chunk-rsxxajv6.js → chunk-700m927w.js} +2 -2
  39. package/dist/{chunk-gvd8nb8z.js → chunk-7212fwzz.js} +2 -2
  40. package/dist/chunk-732gb689.js +2 -0
  41. package/dist/chunk-77c89d23.js +2 -0
  42. package/dist/chunk-79vbkez0.js +2 -0
  43. package/dist/{chunk-88tshy2f.js → chunk-7hpca9c7.js} +6 -6
  44. package/dist/chunk-80xzjxah.js +2 -0
  45. package/dist/chunk-8354mzpd.js +2 -0
  46. package/dist/{chunk-2v7v6jcs.js → chunk-87g5xmmr.js} +12 -12
  47. package/dist/{chunk-sv7fdqmc.js → chunk-8hwfdwgn.js} +6 -6
  48. package/dist/chunk-8ygf6jnt.js +2 -0
  49. package/dist/{chunk-0rdh8bw3.js → chunk-95sd8h5g.js} +7 -7
  50. package/dist/{chunk-50cnypys.js → chunk-967ydrq4.js} +6 -6
  51. package/dist/chunk-9afkttvz.js +2 -0
  52. package/dist/{chunk-7wqz32ay.js → chunk-9d91h636.js} +2 -2
  53. package/dist/{chunk-kwf3kfr0.js → chunk-9n5h4sqc.js} +2 -2
  54. package/dist/chunk-9ztn7w4y.js +2 -0
  55. package/dist/chunk-ah8az9vv.js +2 -0
  56. package/dist/chunk-ankap9pc.js +2 -0
  57. package/dist/chunk-asnd03sr.js +2 -0
  58. package/dist/chunk-b0b5yr97.js +2 -0
  59. package/dist/chunk-b0e7dgv8.js +3 -0
  60. package/dist/{chunk-zj5eq4b6.js → chunk-b15c4g3e.js} +5 -5
  61. package/dist/{chunk-czcx3nbx.js → chunk-b6bf0t02.js} +6 -6
  62. package/dist/chunk-b7jj45bz.js +2 -0
  63. package/dist/{chunk-ybjgnnyf.js → chunk-bgfs3mbg.js} +5 -5
  64. package/dist/{chunk-f2twg7ze.js → chunk-bqtj62ys.js} +8 -8
  65. package/dist/{chunk-a0q0kb0s.js → chunk-bw2m1e7g.js} +5 -5
  66. package/dist/chunk-bwx6w87c.js +2 -0
  67. package/dist/{chunk-ef9m5fjb.js → chunk-cgfjrgfw.js} +14 -14
  68. package/dist/{chunk-463weehv.js → chunk-ch9028z3.js} +1 -1
  69. package/dist/{chunk-57q4nvs9.js → chunk-cmg9x1ka.js} +3 -3
  70. package/dist/{chunk-9f31gs4m.js → chunk-cz1sdes5.js} +2 -2
  71. package/dist/{chunk-satrf398.js → chunk-dvjv4c3a.js} +1 -1
  72. package/dist/{chunk-dz7amds0.js → chunk-dymck524.js} +5 -5
  73. package/dist/chunk-dzqfv801.js +3 -0
  74. package/dist/{chunk-agd2b928.js → chunk-eceeqy74.js} +4 -4
  75. package/dist/{chunk-c47stwqj.js → chunk-eqffvse2.js} +1 -1
  76. package/dist/chunk-ery4tty7.js +20 -0
  77. package/dist/chunk-evwrxsxd.js +3 -0
  78. package/dist/{chunk-6t04tqvh.js → chunk-eyx92t9n.js} +2 -2
  79. package/dist/{chunk-6mfpns00.js → chunk-f3cyghnb.js} +5 -5
  80. package/dist/chunk-f60k8j9m.js +2 -0
  81. package/dist/chunk-fdqdz018.js +2 -0
  82. package/dist/chunk-g6ap4085.js +2 -0
  83. package/dist/chunk-gz9pknbw.js +1204 -0
  84. package/dist/{chunk-pgrm1vet.js → chunk-hgf7bc50.js} +7 -7
  85. package/dist/chunk-hjb4c8g2.js +2 -0
  86. package/dist/chunk-hk241gt2.js +2 -0
  87. package/dist/{chunk-yasdj4ve.js → chunk-hm9d40yf.js} +2 -2
  88. package/dist/{chunk-6df3j3qq.js → chunk-hpzje67q.js} +2 -2
  89. package/dist/{chunk-qt39mb2a.js → chunk-htx5yezj.js} +2 -2
  90. package/dist/{chunk-xpbakn6t.js → chunk-hxws025y.js} +3 -3
  91. package/dist/chunk-jhbj9ja2.js +2 -0
  92. package/dist/chunk-k4x680e3.js +2 -0
  93. package/dist/chunk-k9abxnpa.js +2 -0
  94. package/dist/{chunk-c73c0wf9.js → chunk-kbbbpae2.js} +2 -2
  95. package/dist/chunk-kfdmm240.js +2 -0
  96. package/dist/{chunk-xcsgpf83.js → chunk-kj43fbzm.js} +1 -1
  97. package/dist/{chunk-59er0fc7.js → chunk-kk2p2tgv.js} +3 -3
  98. package/dist/{chunk-dwyhpbpx.js → chunk-ksmn19qw.js} +2 -2
  99. package/dist/{chunk-16aqrwmk.js → chunk-kx09v9ya.js} +7 -7
  100. package/dist/{chunk-3bfheqe3.js → chunk-m95sygv4.js} +3 -3
  101. package/dist/{chunk-nzpzyz22.js → chunk-mctzpw0w.js} +1 -1
  102. package/dist/{chunk-y6eaqs8v.js → chunk-me4yq8c2.js} +3 -3
  103. package/dist/{chunk-n22xtagg.js → chunk-mgh5rst1.js} +2 -2
  104. package/dist/{chunk-zch65qrd.js → chunk-mhxg6j6s.js} +1 -1
  105. package/dist/{chunk-pc8dt8xs.js → chunk-mjp1z9kz.js} +1 -1
  106. package/dist/{chunk-gtv9jd68.js → chunk-mt8edb75.js} +49 -49
  107. package/dist/chunk-mvavjydq.js +2 -0
  108. package/dist/{chunk-e362e615.js → chunk-mw7hacm3.js} +30 -30
  109. package/dist/{chunk-cv4bfhn1.js → chunk-nbdscgvj.js} +6 -6
  110. package/dist/{chunk-qx1nbryq.js → chunk-njpva3zq.js} +2 -2
  111. package/dist/{chunk-6qpe4f8e.js → chunk-nkyff7v6.js} +11 -11
  112. package/dist/{chunk-mxvgft6p.js → chunk-p8shtje2.js} +32 -32
  113. package/dist/{chunk-cb0c6959.js → chunk-pctf14yw.js} +1 -1
  114. package/dist/{chunk-3cq4a4x7.js → chunk-pjj54ddk.js} +3 -3
  115. package/dist/{chunk-pdprhg5k.js → chunk-pnmafbv5.js} +1 -1
  116. package/dist/{chunk-kee5a3ce.js → chunk-pz554g43.js} +3 -3
  117. package/dist/{chunk-h63ma36g.js → chunk-q0y8gv18.js} +2 -2
  118. package/dist/{chunk-ws2h92mm.js → chunk-q9tc9rdv.js} +2 -2
  119. package/dist/chunk-qqng9545.js +2 -0
  120. package/dist/{chunk-8va3fs07.js → chunk-r5ecgcx2.js} +5 -5
  121. package/dist/{chunk-q1mb0fbt.js → chunk-ranjkpc8.js} +2 -2
  122. package/dist/{chunk-ssg6ne5b.js → chunk-rb2zbdqd.js} +4 -4
  123. package/dist/{chunk-e41pgmgk.js → chunk-rf0smj4c.js} +2 -2
  124. package/dist/chunk-rjm515e2.js +2 -0
  125. package/dist/chunk-rye4b2x3.js +2 -0
  126. package/dist/chunk-ryj8139z.js +2 -0
  127. package/dist/{chunk-q3epnfp4.js → chunk-s0mf56y1.js} +5 -5
  128. package/dist/{chunk-kaem8q20.js → chunk-s93yh7ed.js} +2 -2
  129. package/dist/chunk-s9b809n2.js +2 -0
  130. package/dist/chunk-sb67wg5x.js +2 -0
  131. package/dist/{chunk-rv0a3stz.js → chunk-sjjw6y49.js} +6 -6
  132. package/dist/chunk-snkbn5y8.js +2 -0
  133. package/dist/{chunk-7mcs59pr.js → chunk-snv80b1b.js} +2 -2
  134. package/dist/chunk-sqwx2g02.js +2 -0
  135. package/dist/{chunk-2r0nrvqe.js → chunk-t0ttxayz.js} +2 -2
  136. package/dist/chunk-tbh7r1wh.js +2 -0
  137. package/dist/chunk-tpyekw0q.js +2 -0
  138. package/dist/chunk-v2627s75.js +2 -0
  139. package/dist/chunk-v3jyb8k6.js +2 -0
  140. package/dist/chunk-v98n53nk.js +2 -0
  141. package/dist/{chunk-sfyyn0mg.js → chunk-vc432a0w.js} +9 -9
  142. package/dist/{chunk-a7ryj8z8.js → chunk-vf4ejngv.js} +6 -6
  143. package/dist/{chunk-hxhmhw23.js → chunk-vk2jy6mn.js} +3 -3
  144. package/dist/chunk-w34vvhm7.js +2 -0
  145. package/dist/chunk-w82nk19t.js +2 -0
  146. package/dist/{chunk-ezna4dhj.js → chunk-x5bn2svk.js} +2 -2
  147. package/dist/chunk-x6565mhk.js +2 -0
  148. package/dist/{chunk-gbncp2gp.js → chunk-xvncq3m5.js} +2 -2
  149. package/dist/chunk-xwgdcc7w.js +2 -0
  150. package/dist/{chunk-ram5944w.js → chunk-xy8smv5e.js} +2 -2
  151. package/dist/{chunk-yp4tn4zn.js → chunk-y1d3j2j7.js} +4 -4
  152. package/dist/chunk-yjwa7ktk.js +2 -0
  153. package/dist/{chunk-94ctmp0j.js → chunk-ytjn0gq2.js} +2 -2
  154. package/dist/chunk-z47p2gx8.js +2 -0
  155. package/dist/chunk-z4tdnfxd.js +2 -0
  156. package/dist/chunk-z6kw6sct.js +4 -0
  157. package/dist/{chunk-shcnt6aa.js → chunk-zf68afyh.js} +3 -3
  158. package/dist/chunk-zhywjwdr.js +2 -0
  159. package/dist/{chunk-g2xy0z0e.js → chunk-zwwhpxp7.js} +2 -2
  160. package/dist/cli.js +21 -21
  161. package/dist/component-library.d.ts +2 -1
  162. package/dist/component-library.js +126 -308
  163. package/dist/craft-entry.js +2 -2
  164. package/dist/craft.js +2 -2
  165. package/dist/directive-arguments.js +39 -6
  166. package/dist/parser/tokenizer.d.ts +2 -1
  167. package/dist/parser/tokenizer.js +7 -5
  168. package/dist/props-declaration.d.ts +64 -0
  169. package/dist/props-declaration.js +354 -0
  170. package/dist/pwa.js +3 -3
  171. package/dist/ssg.js +7 -7
  172. package/dist/utils.js +20 -109
  173. package/package.json +5 -5
  174. package/dist/chunk-08cb7cyw.js +0 -2
  175. package/dist/chunk-0gkxqcpj.js +0 -2
  176. package/dist/chunk-0h1dyd38.js +0 -2
  177. package/dist/chunk-0sew66hf.js +0 -2
  178. package/dist/chunk-13dgqekj.js +0 -2
  179. package/dist/chunk-15n20xwe.js +0 -2
  180. package/dist/chunk-1ta1pj1t.js +0 -2
  181. package/dist/chunk-1z3r2jjp.js +0 -2
  182. package/dist/chunk-1z6rrqvm.js +0 -2
  183. package/dist/chunk-295bykzd.js +0 -61
  184. package/dist/chunk-41353gyc.js +0 -2
  185. package/dist/chunk-4j50hrgq.js +0 -20
  186. package/dist/chunk-4pjqj54a.js +0 -2
  187. package/dist/chunk-53cc06w7.js +0 -2
  188. package/dist/chunk-5m02cbxg.js +0 -2
  189. package/dist/chunk-5rd0an89.js +0 -2
  190. package/dist/chunk-5s0w910j.js +0 -2
  191. package/dist/chunk-6fy11vfb.js +0 -2
  192. package/dist/chunk-6mjk28s3.js +0 -2
  193. package/dist/chunk-8h5nje66.js +0 -2
  194. package/dist/chunk-97kgrevs.js +0 -4
  195. package/dist/chunk-9h3qq2d2.js +0 -2
  196. package/dist/chunk-9kza7gxd.js +0 -2
  197. package/dist/chunk-a02gt4tz.js +0 -1199
  198. package/dist/chunk-a30zpnqp.js +0 -2
  199. package/dist/chunk-aq0fz4mr.js +0 -2
  200. package/dist/chunk-aqxh80vh.js +0 -2
  201. package/dist/chunk-axra1yas.js +0 -2
  202. package/dist/chunk-b2vhsyf9.js +0 -2
  203. package/dist/chunk-c42b1y7z.js +0 -2
  204. package/dist/chunk-c89wryyz.js +0 -2
  205. package/dist/chunk-cev5z6gj.js +0 -2
  206. package/dist/chunk-ch57kgb6.js +0 -2
  207. package/dist/chunk-cv1vm1w0.js +0 -2
  208. package/dist/chunk-d7b30bg6.js +0 -2
  209. package/dist/chunk-f3j1h3ch.js +0 -2
  210. package/dist/chunk-fz4c5e9m.js +0 -2
  211. package/dist/chunk-gd04nvj3.js +0 -2
  212. package/dist/chunk-gmp10259.js +0 -2
  213. package/dist/chunk-gr956aar.js +0 -2
  214. package/dist/chunk-h3fv0q25.js +0 -2
  215. package/dist/chunk-jghpzx5m.js +0 -2
  216. package/dist/chunk-kcqfrw10.js +0 -2
  217. package/dist/chunk-kfzvtzsz.js +0 -2
  218. package/dist/chunk-kqgspa3s.js +0 -2
  219. package/dist/chunk-mast9wb2.js +0 -2
  220. package/dist/chunk-mqy1wz09.js +0 -3
  221. package/dist/chunk-mv21mc9p.js +0 -2
  222. package/dist/chunk-n9bw9bsn.js +0 -2
  223. package/dist/chunk-ngzyzcrp.js +0 -2
  224. package/dist/chunk-nnqyn7db.js +0 -2
  225. package/dist/chunk-p5qac909.js +0 -2
  226. package/dist/chunk-p6hcrg3r.js +0 -3
  227. package/dist/chunk-pa2vt2ej.js +0 -2
  228. package/dist/chunk-pa6kgbmw.js +0 -2
  229. package/dist/chunk-pd089tq0.js +0 -2
  230. package/dist/chunk-pjjrx9pk.js +0 -2
  231. package/dist/chunk-pt3rp3zg.js +0 -2
  232. package/dist/chunk-qg1kw5yf.js +0 -2
  233. package/dist/chunk-s7xywsqd.js +0 -3
  234. package/dist/chunk-t8r40wgf.js +0 -2
  235. package/dist/chunk-w5zzwe2f.js +0 -2
  236. package/dist/chunk-wjafpvjv.js +0 -2
  237. package/dist/chunk-x44f0eq1.js +0 -2
  238. package/dist/chunk-xhr35ctb.js +0 -2
  239. package/dist/chunk-xk15vzb6.js +0 -2
  240. package/dist/chunk-xmmr0916.js +0 -2
  241. package/dist/chunk-ywnqjqns.js +0 -2
  242. package/dist/chunk-z7k1xn6k.js +0 -2
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function w(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,r=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,t;while((t=p.exec(o))!==null){let e=t[1]==="/",n=t[2],a=t[3]==="/";if(f.has(n.toLowerCase()))continue;if(a)continue;if(e)r.set(n,(r.get(n)??0)+1);else{let g=s.get(n);if(g)g.count++;else{let d=o.slice(0,t.index).split(`
3
- `).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function ei(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
4
- export{ei};
3
+ `).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function ri(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
4
+ export{ri};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{dh,Va,Bu,ph,fh,gh,mh,hh,Fu,zu,yh,bh,wh,vh}from"./chunk-7hpca9c7.js";import"./chunk-mt8edb75.js";import"./chunk-vc432a0w.js";import"./chunk-48rwqchc.js";import"./chunk-05x1rd86.js";import"./chunk-hgf7bc50.js";import"./chunk-b0e7dgv8.js";import"./chunk-dymck524.js";import"./chunk-5kqezrjt.js";import"./chunk-4kmg6g5n.js";import"./chunk-bqtj62ys.js";import"./chunk-pctf14yw.js";import"./chunk-9d91h636.js";import"./chunk-eqffvse2.js";import"./chunk-p8shtje2.js";import"./chunk-58qzyyyv.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-95sd8h5g.js";import"./chunk-eceeqy74.js";import"./chunk-gz9pknbw.js";import"./chunk-s93yh7ed.js";import"./chunk-eyx92t9n.js";import"./chunk-3dqfjpz4.js";import"./chunk-vk2jy6mn.js";import"./chunk-9n5h4sqc.js";import"./chunk-2a5g80mq.js";import"./chunk-mgh5rst1.js";export{Bu as SUSPENSE_RESOLVER_RUNTIME,Va as buildSuspenseResolveScript,hh as createStreamRenderer,gh as extractStreamBoundaries,vh as generateHydrationRuntime,zu as islandDirective,bh as processSectionDirectives,fh as processStreamDirectives,yh as registerStreamingDirectives,ph as renderStreamingPage,dh as streamTemplate,mh as streamTemplateSimple,wh as streamToResponse,Fu as streamingSuspenseDirective};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Nm,Mm,Dm,Lm,gu,jm,Bm,Fm,zm,Hm,Vm,Um}from"./chunk-t0ttxayz.js";export{Vm as Broadcast,Um as BroadcastServer,gu as broadcast,zm as broadcastPresence,Fm as broadcastPrivate,Hm as channel,Nm as getBroadcastServer,Lm as loadChannels,Mm as startBroadcasting,Dm as stopBroadcasting,jm as toUser,Bm as toUsers};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{tt,Fn,na}from"./chunk-02qmvcmv.js";function bo(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?tt(a,e):null,h=u?Fn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
2
+ import{tt,zn,sa}from"./chunk-55tc5w32.js";function xo(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?tt(a,e):null,h=u?zn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
3
3
  * Service Worker - Auto-generated by stx
4
4
  * Cache Version: ${i}
5
5
  *
@@ -13,7 +13,7 @@ import{tt,Fn,na}from"./chunk-02qmvcmv.js";function bo(e,a){let t=e.pwa;if(!t?.en
13
13
  * Additional features:
14
14
  * - Push notifications: ${r?.enabled?"enabled":"disabled"}
15
15
  * - Background sync: ${s?.enabled?"enabled":"disabled"}
16
- * - Cache limits: ${n?.maxSize?`${na(n.maxSize*1024*1024)}`:"unlimited"}
16
+ * - Cache limits: ${n?.maxSize?`${sa(n.maxSize*1024*1024)}`:"unlimited"}
17
17
  */
18
18
 
19
19
  const CACHE_VERSION = '${i}';
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
825
825
  event.waitUntil(registerFormSync(event.data.payload));
826
826
  }
827
827
  });
828
- `}function en(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Xl(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function tm(e,a){if(!e.pwa?.enabled)return"";if(Xl(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-6df3j3qq.js");return t(e,a)}return bo(e,a)}
829
- export{bo,en,Xl,tm};
828
+ `}function Qt(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Yl(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function rm(e,a){if(!e.pwa?.enabled)return"";if(Yl(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-hpzje67q.js");return t(e,a)}return xo(e,a)}
829
+ export{xo,Qt,Yl,rm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ha,Mu,er,lh,Du,Lu,ju,uh}from"./chunk-me4yq8c2.js";import"./chunk-gz9pknbw.js";import"./chunk-s93yh7ed.js";import"./chunk-eyx92t9n.js";import"./chunk-3dqfjpz4.js";import"./chunk-vk2jy6mn.js";import"./chunk-9n5h4sqc.js";import"./chunk-2a5g80mq.js";import"./chunk-mgh5rst1.js";export{er as Validator,Mu as defineForm,Du as processErrorDirective,Lu as processErrorsDirective,uh as processFormValidationDirectives,ju as processHasErrorsDirective,Ha as useForm,lh as v};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{m,p}from"./chunk-295bykzd.js";import{se,B,g}from"./chunk-a02gt4tz.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function Z(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let f=t.indexOf("-->",s+4);n=f===-1?t.length:f+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function L(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let f=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=f||N.has(c)?-1:Z(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!f&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function j(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",f=u[2].toLowerCase();if(c){let l=i.lastIndexOf(f);if(l!==-1)i.splice(l);e=s;continue}if(f==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(f)){if(i.push(f),f==="script"||f==="style"){let l=t.toLowerCase().indexOf(`</${f}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function gu(t){let o={default:"",named:new Map},i=t,r=j(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=L(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Um(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function mu(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of c){let[d,l]=f.split(":").map((S)=>S.trim()),h=l||d;if(s[h]=o[d],o[d]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=I(e,s,a,u)}return e}function I(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(B(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!B(s,r))return e;let a=_(s,o);if(a===void 0)return e;return g(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!m(t))return;return p(t,Object.keys(o))(...Object.values(o))}catch{return}}async function hu(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,f)=>{let d=o.named.get(u),l=f?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&d?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=d.propsBinding.trim(),x=se(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=g(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${g(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${d.content}</template>`}return await mu(d,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let f=c?.trim()||"";return o.default||f}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Wm(t){let o=gu(t);return{defaultSlot:o.default,namedSlots:o.named}}async function qm(t,o,i,r,e){return await hu(t,{default:o,named:i},r,e)}
3
- export{gu,Um,mu,hu,Wm,qm};
2
+ import{m,p}from"./chunk-3dqfjpz4.js";import{oe,F,g}from"./chunk-gz9pknbw.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let f=t.indexOf("-->",s+4);n=f===-1?t.length:f+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let f=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=f||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!f&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",f=u[2].toLowerCase();if(c){let l=i.lastIndexOf(f);if(l!==-1)i.splice(l);e=s;continue}if(f==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(f)){if(i.push(f),f==="script"||f==="style"){let l=t.toLowerCase().indexOf(`</${f}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function hu(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function qm(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function yu(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of c){let[d,l]=f.split(":").map((S)=>S.trim()),h=l||d;if(s[h]=o[d],o[d]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(F(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!F(s,r))return e;let a=_(s,o);if(a===void 0)return e;return g(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!m(t))return;return p(t,Object.keys(o))(...Object.values(o))}catch{return}}async function bu(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,f)=>{let d=o.named.get(u),l=f?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&d?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=d.propsBinding.trim(),x=oe(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=g(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${g(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${d.content}</template>`}return await yu(d,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let f=c?.trim()||"";return o.default||f}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Km(t){let o=hu(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Gm(t,o,i,r,e){return await bu(t,{default:o,named:i},r,e)}
3
+ export{hu,qm,yu,bu,Km,Gm};
@@ -72,7 +72,7 @@ else {
72
72
  ${t}
73
73
  })();
74
74
  </script>
75
- `}function wh(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
75
+ `}function xh(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
76
76
  <div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
77
77
  ${d}
78
78
  ${c}
@@ -81,4 +81,4 @@ else {
81
81
  </div>
82
82
  ${h}
83
83
  `})}
84
- export{wh};
84
+ export{xh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{st,pe,wc}from"./chunk-kee5a3ce.js";import v from"fs";import g from"path";import V from"crypto";var ce=[320,640,768,1024,1280,1536,1920],le=["webp","jpeg"],ue=80,T=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],U={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},I=null,M=!1;async function d(){if(M)return I;M=!0;try{let t=await import("sharp");return I=t.default||t,I}catch{return null}}async function Kn(){return await d()!==null}async function _e(){return!0}async function Be(t,e={}){let{widths:a=ce,formats:n=le,quality:r=ue,fit:m="cover",placeholder:l="none",outputDir:o=".stx/images",baseUrl:c="/images"}=e,i,h;if(typeof t==="string"){if(h=t,!await Bun.file(t).exists())throw new cs(`Image not found: ${t}`,"NOT_FOUND");i=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else h="buffer-input",i=t;let b=V.createHash("sha256").update(i).digest("hex").slice(0,12),j=await as(i),{width:u,height:x}=j,F=u/x;await v.promises.mkdir(o,{recursive:!0});let B=[],A=g.basename(h,g.extname(h)),f=a.filter((s)=>s<=u);if(!f.includes(u)&&u<=Math.max(...a))f.push(u);f.sort((s,p)=>s-p);for(let s of f){let p=Math.round(s/F);for(let w of n){let S=`${A}-${s}w-${b}.${w}`,P=g.join(o,S),q=`${c}/${S}`,E=await yu(i,{width:s,height:p,format:w,quality:r,fit:m});await Bun.write(P,E),B.push({path:P,url:q,width:s,height:p,format:w,size:E.length})}}let y;if(l!=="none")y=await D(i,l);return{src:h,variants:B,placeholder:y,width:u,height:x,aspectRatio:F,hash:b}}async function as(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return L(e)}function L(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let r=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:r,format:"jpeg",hasAlpha:!1}}let n=t.readUInt16BE(e+2);e+=2+n}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,n=t.readUInt16LE(28)&16383;return{width:a,height:n,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),n=(a&16383)+1,r=(a>>14&16383)+1;return{width:n,height:r,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new cs("Unable to parse image dimensions","PARSE_ERROR")}async function yu(t,e){let a=await d();if(a){let r=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":r=r.webp({quality:e.quality});break;case"avif":r=r.avif({quality:e.quality});break;case"jpeg":r=r.jpeg({quality:e.quality});break;case"png":r=r.png({quality:e.quality});break}return r.toBuffer()}let{processImage:n}=await import("ts-images");return await wc("img",async(r)=>{let m=g.join(r,`out.${e.format}`);return await n({input:t,output:m,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(m).arrayBuffer())})}async function D(t,e){let a=await d();if(e==="blur"&&a){let c=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),i=await as(t);return`data:${U[i.format]||"image/jpeg"};base64,${c}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(c)=>{let i=await a(c).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let{generatePlaceholder:n}=await import("ts-images"),r=await as(t),m=st("ph"),l=g.join(m,`in.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(l,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",i=await n(l,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&i.dominantColor)return i.dominantColor;if(i.dataURL)return i.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{pe(m)}}function Et(t,e){return(e?t.filter((n)=>n.format===e):t).sort((n,r)=>n.width-r.width).map((n)=>`${n.url} ${n.width}w`).join(", ")}function cn(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,n)=>{let r=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(n[0].replace(/\D/g,""))||0)-r}).map(([a,n])=>`(max-width: ${a}) ${n}`).join(", ")+", 100vw"}function Gn(t){let e=t.filter((n)=>n.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((n,r)=>n.width-r.width);return a[Math.floor(a.length/2)]}function Xn(t){let e=new Map;for(let a of t){let n=e.get(a.format)||[];n.push(a),e.set(a.format,n)}return e}function Jn(t){let e=g.extname(t).toLowerCase();return T.includes(e)}function de(t){return U[t]||"application/octet-stream"}function Yn(t){return t.reduce((e,a)=>e+a.size,0)}function Zn(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class cs extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
- export{ce,le,ue,Kn,_e,Be,as,yu,Et,cn,Gn,Xn,Jn,de,Yn,Zn,cs};
2
+ import{st,fe,xc}from"./chunk-pz554g43.js";import v from"fs";import g from"path";import V from"crypto";var le=[320,640,768,1024,1280,1536,1920],ue=["webp","jpeg"],de=80,T=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],U={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},I=null,M=!1;async function d(){if(M)return I;M=!0;try{let t=await import("sharp");return I=t.default||t,I}catch{return null}}async function Gn(){return await d()!==null}async function Ce(){return!0}async function Be(t,e={}){let{widths:a=le,formats:n=ue,quality:r=de,fit:m="cover",placeholder:l="none",outputDir:o=".stx/images",baseUrl:c="/images"}=e,i,h;if(typeof t==="string"){if(h=t,!await Bun.file(t).exists())throw new ds(`Image not found: ${t}`,"NOT_FOUND");i=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else h="buffer-input",i=t;let b=V.createHash("sha256").update(i).digest("hex").slice(0,12),j=await us(i),{width:u,height:x}=j,F=u/x;await v.promises.mkdir(o,{recursive:!0});let B=[],A=g.basename(h,g.extname(h)),f=a.filter((s)=>s<=u);if(!f.includes(u)&&u<=Math.max(...a))f.push(u);f.sort((s,p)=>s-p);for(let s of f){let p=Math.round(s/F);for(let w of n){let S=`${A}-${s}w-${b}.${w}`,P=g.join(o,S),q=`${c}/${S}`,E=await wu(i,{width:s,height:p,format:w,quality:r,fit:m});await Bun.write(P,E),B.push({path:P,url:q,width:s,height:p,format:w,size:E.length})}}let y;if(l!=="none")y=await D(i,l);return{src:h,variants:B,placeholder:y,width:u,height:x,aspectRatio:F,hash:b}}async function us(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return L(e)}function L(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let r=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:r,format:"jpeg",hasAlpha:!1}}let n=t.readUInt16BE(e+2);e+=2+n}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,n=t.readUInt16LE(28)&16383;return{width:a,height:n,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),n=(a&16383)+1,r=(a>>14&16383)+1;return{width:n,height:r,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new ds("Unable to parse image dimensions","PARSE_ERROR")}async function wu(t,e){let a=await d();if(a){let r=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":r=r.webp({quality:e.quality});break;case"avif":r=r.avif({quality:e.quality});break;case"jpeg":r=r.jpeg({quality:e.quality});break;case"png":r=r.png({quality:e.quality});break}return r.toBuffer()}let{processImage:n}=await import("ts-images");return await xc("img",async(r)=>{let m=g.join(r,`out.${e.format}`);return await n({input:t,output:m,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(m).arrayBuffer())})}async function D(t,e){let a=await d();if(e==="blur"&&a){let c=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),i=await us(t);return`data:${U[i.format]||"image/jpeg"};base64,${c}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(c)=>{let i=await a(c).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let{generatePlaceholder:n}=await import("ts-images"),r=await us(t),m=st("ph"),l=g.join(m,`in.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(l,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",i=await n(l,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&i.dominantColor)return i.dominantColor;if(i.dataURL)return i.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{fe(m)}}function Et(t,e){return(e?t.filter((n)=>n.format===e):t).sort((n,r)=>n.width-r.width).map((n)=>`${n.url} ${n.width}w`).join(", ")}function an(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,n)=>{let r=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(n[0].replace(/\D/g,""))||0)-r}).map(([a,n])=>`(max-width: ${a}) ${n}`).join(", ")+", 100vw"}function Xn(t){let e=t.filter((n)=>n.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((n,r)=>n.width-r.width);return a[Math.floor(a.length/2)]}function Jn(t){let e=new Map;for(let a of t){let n=e.get(a.format)||[];n.push(a),e.set(a.format,n)}return e}function Yn(t){let e=g.extname(t).toLowerCase();return T.includes(e)}function pe(t){return U[t]||"application/octet-stream"}function Zn(t){return t.reduce((e,a)=>e+a.size,0)}function Qn(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class ds extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
+ export{le,ue,de,Gn,Ce,Be,us,wu,Et,an,Xn,Jn,Yn,pe,Zn,Qn,ds};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ri}from"./chunk-05x1rd86.js";export{ri as warnUnbalancedTags};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ba,Wm}from"./chunk-pnmafbv5.js";export{Ba as definePlugin,Wm as pluginManager};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- class T{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,t){this.maxSize=e,this.options=t??null,this.sizes=t?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let t=this.cache.keys().next().value;if(t===void 0)break;this.delete(t)}}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.delete(e);let i=this.options?this.options.sizeOf(t):0;if(this.options&&i>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+i>this.options.maxBytes)){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}if(this.cache.set(e,t),this.sizes)this.sizes.set(e,i),this.bytes+=i}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let t=this.sizes.get(e);if(t!==void 0)this.bytes-=t,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var o=new Map,x=500;function Qt(e,t){if(t?.includes("g"))return new RegExp(e,t);let i=`${e}:${t||""}`;if(!o.has(i)){if(o.size>=x){let n=o.keys().next().value;if(n)o.delete(n)}o.set(i,new RegExp(e,t))}return o.get(i)}class f{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let t=Array.from(new Set(e)),i=t.sort().join(","),n=this.pool.find((s)=>s.context.join(",")===i);if(n)return n.func;let r=this.fnCache,c=this.fnCacheMaxSize,a=(...s)=>(u)=>{try{let h=`${i}:${u}`,l=r.get(h);if(!l){if(r.size>=c){let d=r.keys().next().value;if(d)r.delete(d)}l=Function(...t,`
2
+ class T{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,t){this.maxSize=e,this.options=t??null,this.sizes=t?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let t=this.cache.keys().next().value;if(t===void 0)break;this.delete(t)}}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.delete(e);let i=this.options?this.options.sizeOf(t):0;if(this.options&&i>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+i>this.options.maxBytes)){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}if(this.cache.set(e,t),this.sizes)this.sizes.set(e,i),this.bytes+=i}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let t=this.sizes.get(e);if(t!==void 0)this.bytes-=t,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var o=new Map,x=500;function Zt(e,t){if(t?.includes("g"))return new RegExp(e,t);let i=`${e}:${t||""}`;if(!o.has(i)){if(o.size>=x){let n=o.keys().next().value;if(n)o.delete(n)}o.set(i,new RegExp(e,t))}return o.get(i)}class f{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let t=Array.from(new Set(e)),i=t.sort().join(","),n=this.pool.find((s)=>s.context.join(",")===i);if(n)return n.func;let r=this.fnCache,c=this.fnCacheMaxSize,a=(...s)=>(u)=>{try{let h=`${i}:${u}`,l=r.get(h);if(!l){if(r.size>=c){let d=r.keys().next().value;if(d)r.delete(d)}l=Function(...t,`
3
3
  'use strict';
4
4
  try {
5
5
  return ${u};
@@ -10,5 +10,5 @@ catch (e) {
10
10
  }
11
11
  throw e;
12
12
  }
13
- `),r.set(h,l)}return l(...s)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:t.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var v=new f;class p{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,t){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...t})}setBudgets(e){for(let[t,i]of Object.entries(e))this.setBudget(t,i)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[t,i]of this.budgets.entries())e[t]=i;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let t=this.violationHandlers.indexOf(e);if(t!==-1)this.violationHandlers.splice(t,1)}time(e,t){if(!this.enabled)return t();let i=performance.now(),n=t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}async timeAsync(e,t){if(!this.enabled)return t();let i=performance.now(),n=await t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}checkBudget(e,t){let i=this.budgets.get(e);if(!i)return;let n=t/i.maxTime*100,r=i.warnThreshold!==void 0?t>=i.maxTime*i.warnThreshold&&t<i.maxTime:!1,c=t>=i.maxTime;if(!r&&!c)return;let a={label:e,actualTime:t,budgetTime:i.maxTime,exceedancePercent:n,timestamp:new Date,isWarning:r};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let u of this.violationHandlers)try{u(a)}catch{}let s=r?`[Performance Warning] "${e}" took ${t.toFixed(2)}ms (${n.toFixed(1)}% of ${i.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${t.toFixed(2)}ms (exceeded ${i.maxTime}ms budget by ${(n-100).toFixed(1)}%)`;switch(i.action){case"log":console.log(s);break;case"warn":console.warn(s);break;case"error":console.error(s);break;case"throw":if(c)throw Error(s);else console.warn(s);break}}recordTime(e,t){let i=this.metrics.get(e);if(i)i.count++,i.totalTime+=t,i.maxTime=Math.max(i.maxTime,t),i.minTime=Math.min(i.minTime,t);else this.metrics.set(e,{count:1,totalTime:t,maxTime:t,minTime:t})}getStats(e){if(e){let i=this.metrics.get(e);if(!i)return{};let n=this.budgets.get(e);return{count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:n?.maxTime,budgetUtilization:n?i.totalTime/i.count/n.maxTime*100:void 0}}let t={};for(let[i,n]of this.metrics.entries()){let r=this.budgets.get(i);t[i]={count:n.count,avgTime:n.totalTime/n.count,totalTime:n.totalTime,maxTime:n.maxTime,minTime:n.minTime,budget:r?.maxTime,budgetUtilization:r?n.totalTime/n.count/r.maxTime*100:void 0}}return t}getViolations(e){if(e)return this.violations.filter((t)=>t.label===e);return[...this.violations]}getViolationStats(){let e={},t=0,i=0;for(let n of this.violations)if(e[n.label]=(e[n.label]||0)+1,n.isWarning)t++;else i++;return{total:this.violations.length,byLabel:e,warnings:t,errors:i}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var m=null;function b(){if(!m)m=new p;return m}var ye=new Proxy({},{get(e,t){return b()[t]}});var g=0;async function R(){if(performance.now()-g<16)return;await new Promise((e)=>setTimeout(e,0)),g=performance.now()}
14
- export{T,Qt,ye,R};
13
+ `),r.set(h,l)}return l(...s)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:t.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var v=new f;class p{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,t){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...t})}setBudgets(e){for(let[t,i]of Object.entries(e))this.setBudget(t,i)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[t,i]of this.budgets.entries())e[t]=i;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let t=this.violationHandlers.indexOf(e);if(t!==-1)this.violationHandlers.splice(t,1)}time(e,t){if(!this.enabled)return t();let i=performance.now(),n=t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}async timeAsync(e,t){if(!this.enabled)return t();let i=performance.now(),n=await t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}checkBudget(e,t){let i=this.budgets.get(e);if(!i)return;let n=t/i.maxTime*100,r=i.warnThreshold!==void 0?t>=i.maxTime*i.warnThreshold&&t<i.maxTime:!1,c=t>=i.maxTime;if(!r&&!c)return;let a={label:e,actualTime:t,budgetTime:i.maxTime,exceedancePercent:n,timestamp:new Date,isWarning:r};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let u of this.violationHandlers)try{u(a)}catch{}let s=r?`[Performance Warning] "${e}" took ${t.toFixed(2)}ms (${n.toFixed(1)}% of ${i.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${t.toFixed(2)}ms (exceeded ${i.maxTime}ms budget by ${(n-100).toFixed(1)}%)`;switch(i.action){case"log":console.log(s);break;case"warn":console.warn(s);break;case"error":console.error(s);break;case"throw":if(c)throw Error(s);else console.warn(s);break}}recordTime(e,t){let i=this.metrics.get(e);if(i)i.count++,i.totalTime+=t,i.maxTime=Math.max(i.maxTime,t),i.minTime=Math.min(i.minTime,t);else this.metrics.set(e,{count:1,totalTime:t,maxTime:t,minTime:t})}getStats(e){if(e){let i=this.metrics.get(e);if(!i)return{};let n=this.budgets.get(e);return{count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:n?.maxTime,budgetUtilization:n?i.totalTime/i.count/n.maxTime*100:void 0}}let t={};for(let[i,n]of this.metrics.entries()){let r=this.budgets.get(i);t[i]={count:n.count,avgTime:n.totalTime/n.count,totalTime:n.totalTime,maxTime:n.maxTime,minTime:n.minTime,budget:r?.maxTime,budgetUtilization:r?n.totalTime/n.count/r.maxTime*100:void 0}}return t}getViolations(e){if(e)return this.violations.filter((t)=>t.label===e);return[...this.violations]}getViolationStats(){let e={},t=0,i=0;for(let n of this.violations)if(e[n.label]=(e[n.label]||0)+1,n.isWarning)t++;else i++;return{total:this.violations.length,byLabel:e,warnings:t,errors:i}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var m=null;function b(){if(!m)m=new p;return m}var be=new Proxy({},{get(e,t){return b()[t]}});var g=0;async function R(){if(performance.now()-g<16)return;await new Promise((e)=>setTimeout(e,0)),g=performance.now()}
14
+ export{T,Zt,be,R};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{h,Bi,bl,wl,jg,Bg,Fg,zg,Hg,co,Vg,Ge,ie,Xe,Ug,Br,Wg,Sl,kl,Hi,Je,s,Rn,_l,y,_e,$y}from"./chunk-gz9pknbw.js";import"./chunk-s93yh7ed.js";import"./chunk-eyx92t9n.js";import"./chunk-3dqfjpz4.js";import"./chunk-vk2jy6mn.js";import"./chunk-9n5h4sqc.js";import"./chunk-2a5g80mq.js";import"./chunk-mgh5rst1.js";export{kl as SIGNAL_COMPOSABLE_CALL,_e as clearComponentCache,Hi as componentClientSignalNames,Bi as convertToCommonJS,y as createDetailedErrorMessage,Hg as extractDirectiveNames,bl as extractScriptFromTemplate,h as extractVariables,s as fileExists,$y as getComponentCacheStats,Bg as getPositionInfo,ie as getSharedTranspiler,_l as getSourceLineInfo,zg as hasDirectives,wl as hasVariables,Wg as isHydrateTrigger,Vg as isJavaScriptScript,Je as renderComponentWithSlot,Rn as resolveTemplatePath,Ug as scopeOnRootElement,co as scopeSequenceKey,Ge as shouldTranspileTypeScript,Sl as slotContentHasExpressions,Xe as transpileTypeScript,Br as userComponentFileExists,Fg as validateDirective,jg as validateTemplate};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Vu,Wo,ar,Uu,Wu,qu,Ku,Gu,Xu,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,md,hd,yd,bd,wd,vd,xd,Sd,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Id,Od,Nd,ln,ec,Md,Dd,Ld,tc,jd,Bd,Fd,zd,Hd,Vd,nc,Ud,Wd,qd,Kd,Gd,Xd,Jd,Yd,Zd,cr,Qd,ep,tp,np,rp,sp,op,ip,ap,cp,lp,up,qo,dp,pp,fp,gp,mp,ys,bs,hp,yp,bp,wp,vp,rc,xp,Sp,kp,sc,Ko,_p,Cp,oc,ic,ws,ac,Ep,un,Tp,cc,lc,Go,$p,Xo,Rp,Ap,Pp,Ip,Op,Np,Mp,uc,Dp,Lp,dc,jp,Bp,Fp,zp,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,pc,lf,uf,df,pf,ff,gf,mf,hf,yf,bf,wf,lr,fc,gc,vf,ur,xf,Sf,kf,mc,hc,vs,xs,_f,Jo,Cf,Ef,Tf,$f,Rf,Af,Pf,If,Of,Nf,Mf,Df,Lf,jf,Bf,Ff,zf,Hf,Vf,Uf,yc,Wf,qf,bc,wc,Kf,Gf}from"./chunk-mw7hacm3.js";export{Od as AVAILABLE_COMPONENTS,rc as AutoUpdater,Nd as COMPONENT_STYLES,vs as DEFAULT_WATCH_INTERVAL_MS,hc as MAX_WATCH_INTERVAL_MS,mc as MIN_WATCH_INTERVAL_MS,Vd as MODAL_STYLES,Zu as TOAST_STYLES,Jd as TRAY_MENU_STYLES,oc as UPDATE_MANIFEST_ASSET,Bd as alert,sf as appInfo,Af as appleScript,Gf as applicationDataDirectory,Rf as audio,qf as backgroundDelay,ef as battery,$f as biometric,bf as bluetooth,Mf as bonjour,un as bundlePathForExecutable,$p as caffeinate,xp as canReplaceBundle,Sp as clearQuarantine,Wp as clipboard,Hd as closeAllModals,up as closeAllWindows,jd as confirm,cf as contextMenu,zf as continuityCamera,Ff as coreml,wp as craftBinaryNotFoundMessage,qo as craftWindowArguments,lr as crashReporter,xd as createAccordion,gd as createAutocomplete,od as createAvatar,sd as createBadge,Qu as createButton,id as createCard,$d as createChart,td as createCheckbox,yd as createChip,Rd as createCodeEditor,dd as createColorPicker,Td as createDataGrid,pd as createDatePicker,bs as createDiskImage,cd as createDropdown,Pd as createFileExplorer,Ep as createGitHubUpdateManifest,ac as createGitHubUpdater,hd as createImageView,zp as createInterval,md as createLabel,_d as createListView,Ad as createMediaPlayer,Ud as createMenubar,kd as createModalComponent,Kf as createNativeUpdateApi,wc as createPantrySelfUpdater,Op as createPreferences,rd as createProgressBar,ud as createRadioButton,ld as createRating,wd as createScrollView,Go as createSelfUpdater,nd as createSlider,vd as createSplitView,Sd as createStepper,nc as createSystemTray,Cd as createTable,ad as createTabs,ed as createTextInput,fd as createTimePicker,Fp as createTimer,bd as createTooltip,Ed as createTreeView,Id as createWebView,dp as createWindow,fp as createWindowWithHTML,Xo as decaffeinate,Qp as deepLinks,Hp as delay,Xu as dismissAlertById,Ju as dismissAllAlerts,Yp as dragOut,kp as extractBundle,Pf as fileAssociations,Jo as focus,Ef as focusShortcutsReady,Up as formatCompact,Ip as formatDuration,Pp as formatRemainingTime,Dp as formatShortcut,Vp as formatTime,Kp as fs,sc as generateUpdateManifest,Yu as getActiveAlertCount,zd as getActiveModalCount,Wd as getActiveTrayInstances,cp as getActiveWindowIds,Ap as getCaffeinateStatus,Uf as getCapabilities,yc as getCapability,ip as getDesktopConfig,sp as getDialogBridgeScript,Bp as getRegisteredHotkeys,Gd as getSimulatedTrayHTML,Xd as getTrayBridgeScript,qd as getTrayInstance,lp as getWindow,mp as getWindowBridgeScript,ic as githubLatestAssetUrl,ws as githubReleaseAssetUrl,Xp as globalShortcuts,ur as handoff,Cf as hasFocusShortcuts,vf as iap,Mp as isAutoLaunchEnabled,Wf as isAvailable,Rp as isCaffeinated,Zp as isDragOutAvailable,gp as isWebviewAvailable,df as keychain,xf as liveActivities,Tf as localServer,Sf as location,Nf as log,hp as macOSRuntimeExecutablePath,af as menu,Bf as midi,gf as nativeAutoLaunch,mf as nativeTray,hf as nativeWindow,tf as network,qp as notifications,Gu as notify,pp as openDevWindow,yp as pack,bp as packageApp,bc as parsePantryUpdateManifest,uc as parseShortcut,Of as pdf,pf as permissions,ff as printing,Fd as prompt,cc as quitLauncher,Ko as readBundleIdentity,fc as redactPII,Lp as registerHotkey,lc as relaunchBundle,Vu as requestNotificationPermission,ap as resetDesktopConfig,vp as resolveCraftBinary,ys as resolveCraftExecutablePath,Tp as runningBundleTeamId,uf as screen,kf as screenCapture,xs as screenSharing,Vf as serial,Hf as serviceMenu,Np as setAutoLaunch,op as setDesktopConfig,Gp as shell,Wo as showAlert,ep as showAlertDialog,Qd as showColorPicker,tp as showConfirmDialog,np as showErrorDialog,Dd as showErrorModal,Ku as showErrorToast,ec as showInfoModal,Uu as showInfoToast,cr as showMessageBox,ln as showModal,Yd as showOpenDialog,tc as showQuestionModal,Zd as showSaveDialog,Ld as showSuccessModal,Wu as showSuccessToast,ar as showToast,rp as showWarningDialog,Md as showWarningModal,qu as showWarningToast,pc as sidebar,gc as signPayload,wf as speech,Lf as speechRecognition,Df as spotlight,of as standardMenus,_p as swapBundle,lf as system,If as tags,Jp as theme,yf as touchbar,Kd as triggerTrayAction,jp as unregisterAllHotkeys,dc as unregisterHotkey,nf as updater,Cp as verifyBundleTrust,jf as vision,_f as watchScreenSharing,rf as windowEvents};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{la,ua,da,fm,pa,fa,gm,ga,ma,Ql,mm}from"./chunk-zf68afyh.js";export{la as VideoProcessorCache,Ql as analyzeVideo,fm as clearVideoCache,ma as generateDASHManifest,ga as generateHLSManifest,pa as generatePoster,gm as generateSpriteSheet,fa as generateThumbnails,ua as getCachedVideoResult,mm as processVideo,da as setCachedVideoResult};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{su,$a,ou,iu,Ra,au,cu,lu,uu,Aa,du,$m}from"./chunk-b6bf0t02.js";import{ja,mu}from"./chunk-ranjkpc8.js";import{le,ue,de,Gn,Ce,Be,us,Et,an,Xn,Jn,Yn,pe,Zn,Qn,ds}from"./chunk-1n33yrar.js";import{vu}from"./chunk-xvncq3m5.js";import"./chunk-pz554g43.js";export{ue as DEFAULT_FORMATS,de as DEFAULT_QUALITY,le as DEFAULT_WIDTHS,ds as ImageProcessingError,iu as clearImageCache,Ra as createImageDirective,mu as createImageHandler,cu as createImagePlugin,$m as defaultImageConfig,Qn as formatSize,Aa as generateImageManifest,an as generateSizes,Et as generateSrcSet,Xn as getFallbackVariant,us as getImageMetadata,pe as getMimeType,Zn as getTotalSize,Jn as groupVariantsByFormat,ja as handleImageRequest,au as imageDirective,Ce as isImageBackendAvailable,Yn as isImageFile,Gn as isSharpAvailable,uu as optimizeDirectory,lu as optimizeImage,$a as parseImageComponent,Be as processImage,ou as processImageComponents,su as renderImageComponent,vu as rewriteImagesWithSiblings,du as writeImageManifest};
@@ -0,0 +1,68 @@
1
+ // @bun
2
+ import{T}from"./chunk-2a5g80mq.js";import{te}from"./chunk-q9tc9rdv.js";import{L}from"./chunk-hxws025y.js";import Fe from"path";var n={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function J(e){for(let[t,r]of Object.entries(n))if(r===e)return t;return}import ct from"path";var lt={showRelativePaths:!1,enableAutoRecovery:te(),logRecoveryWarnings:!0},Z={...lt};function P(){return{...Z}}function F(e){if(!Z.showRelativePaths||!e)return e;let t=Z.baseDir||process.cwd();try{let r=ct.relative(t,e);return r.startsWith("..")?e:r}catch{return e}}class N extends Error{code;filePath;line;column;context;numericCode;constructor(e,t,r,i,s,o,a){super(e);this.code=t;this.filePath=r;this.line=i;this.column=s;this.context=o;if(this.name="StxError",this.numericCode=a||n.EVALUATION_ERROR,this.filePath)this.filePath=F(this.filePath)}}class ce extends N{constructor(e,t,r,i,s,o){super(e,"stx_RUNTIME_ERROR",t,r,i,s,o||n.EVALUATION_ERROR);this.name="StxRuntimeError"}}class zr extends N{constructor(e,t,r,i,s,o){super(e,"stx_FILE_ERROR",t,r,i,s,o||n.FILE_NOT_FOUND);this.name="StxFileError"}}class ee extends N{isFatal=!0;constructor(e,t,r,i,s,o){super(e,"stx_VALIDATION_ERROR",t,r,i,s,o||n.DOM_API_VIOLATION);this.name="StxValidationError"}}function Ee(e){let{type:t,message:r,code:i,filePath:s,line:o,column:a,template:c,offset:g,snippet:l,suggestion:h,format:f="text"}=e,y=o,b=a;if(!y&&c&&g!==void 0){let Y=mt(c,g);y=Y.line,b=Y.column}let w=s?F(s):void 0,x=i?J(i):void 0,R={type:t,code:i,codeName:x,message:r,filePath:w,line:y,column:b,snippet:l,suggestion:h,timestamp:new Date().toISOString()},A;switch(f){case"html":A=gt(R);break;case"json":A=JSON.stringify(R,null,2);break;case"console":A=pt(R,c,g);break;case"text":default:A=ut(R,c,g);break}return{formatted:A,data:R}}function ut(e,t,r){let i=[],s=e.code?` [${e.codeName||e.code}]`:"";if(i.push(`[${e.type} Error${s}]`),e.filePath){let o=e.filePath;if(e.line){if(o+=`:${e.line}`,e.column)o+=`:${e.column}`}i.push(`at ${o}`)}if(i.push(`
3
+ ${e.message}`),t&&e.line){let o=ft(t,e.line,2);if(o)i.push(`
4
+ ${o}`)}if(e.snippet)i.push(`
5
+ Snippet: ${e.snippet}`);if(e.suggestion)i.push(`
6
+ Suggestion: ${e.suggestion}`);return i.join(" ")}function gt(e){let t=e.code?` [${e.code}]`:"",r=e.filePath?` in ${e.filePath}${e.line?`:${e.line}`:""}`:"",i=`<!-- [${e.type} Error${t}]${r}: ${ye(e.message)}`;if(e.suggestion)i+=` | Suggestion: ${ye(e.suggestion)}`;return i+=" -->",i}function pt(e,t,r){let l=[],h=e.code?` [${e.codeName||e.code}]`:"";if(l.push(`\x1B[1m${"\x1B[31m"}\u2501\u2501\u2501 ${e.type} Error${h} \u2501\u2501\u2501${"\x1B[0m"}`),e.filePath){let f=`\x1B[36m${e.filePath}\x1B[0m`;if(e.line){if(f+=`\x1B[90m:${e.line}\x1B[0m`,e.column)f+=`\x1B[90m:${e.column}\x1B[0m`}l.push(`
7
+ \x1B[90mat\x1B[0m ${f}`)}if(l.push(`
8
+
9
+ ${e.message}`),t&&e.line){let f=dt(t,e.line,2);if(f)l.push(`
10
+
11
+ \x1B[90mContext:\x1B[0m
12
+ ${f}`)}if(e.suggestion)l.push(`
13
+
14
+ \x1B[33mSuggestion:\x1B[0m ${e.suggestion}`);return l.push(`
15
+ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),l.join("")}function ft(e,t,r){let i=e.split(`
16
+ `),s=Math.max(0,t-r-1),o=Math.min(i.length-1,t+r-1),a=[];for(let c=s;c<=o;c++){let g=(c+1).toString().padStart(4),l=c===t-1?">":" ";a.push(`${l}${g} | ${i[c]}`)}return a.join(`
17
+ `)}function dt(e,t,r){let i=e.split(`
18
+ `),s=Math.max(0,t-r-1),o=Math.min(i.length-1,t+r-1),a="\x1B[90m",c="\x1B[31m",g="\x1B[0m",l=[];for(let h=s;h<=o;h++){let f=(h+1).toString().padStart(4),y=h===t-1,b=y?"\x1B[31m>\x1B[0m":" ",w=y?`\x1B[31m${i[h]}\x1B[0m`:`\x1B[90m${i[h]}\x1B[0m`;l.push(`${b}\x1B[90m${f}\x1B[0m | ${w}`)}return l.join(`
19
+ `)}function ye(e){return e.replace(/--/g,"- -").replace(/>/g,"&gt;")}function mt(e,t){let i=e.substring(0,t).split(`
20
+ `);return{line:i.length,column:i[i.length-1].length}}function u(e,t,r){return Ee({type:e,message:t,code:r,format:"html"}).formatted}async function Ne(e,t,r){try{return await e()}catch(i){if(r&&i instanceof Error)r(i);return t}}var Xi={isEnabled(){return P().enableAutoRecovery},fixCommonSyntaxErrors(e){let t=P();if(!t.enableAutoRecovery)return{fixed:e,fixes:[]};let r=e,i=[],s=(r.match(/\{\{/g)||[]).length,o=(r.match(/\}\}/g)||[]).length;if(s>o){let c=s-o;r+="}}".repeat(c),i.push(`Added ${c} missing closing braces '}}'`)}let a=["if","foreach","for","switch","section"];for(let c of a){let g=(r.match(new RegExp(`@${c}\\b`,"g"))||[]).length,l=(r.match(new RegExp(`@end${c}\\b`,"g"))||[]).length;if(g>l){let h=g-l;for(let f=0;f<h;f++)r+=`
21
+ @end${c}`;i.push(`Added ${h} missing @end${c}`)}}if(i.length>0&&t.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),i.forEach((c)=>console.warn(` - ${c}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:r,fixes:i}},createFallbackContent(e,t){if(te())return`<!-- ${e} failed: ${t.message} -->`;return"<!-- stx rendering error -->"}};class Q{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor(e={}){this.maxErrors=e.maxErrors??1000,this.enableFileLogging=e.enableFileLogging??!1,this.logFilePath=e.logFilePath??".stx/errors.log",this.logFormat=e.logFormat??"json",this.maxFileSize=e.maxFileSize??10485760,this.maxLogFiles=e.maxLogFiles??5,this.minLevel=e.minLevel??"all"}configure(e){if(e.maxErrors!==void 0)this.maxErrors=e.maxErrors;if(e.enableFileLogging!==void 0)this.enableFileLogging=e.enableFileLogging;if(e.logFilePath!==void 0)this.logFilePath=e.logFilePath;if(e.logFormat!==void 0)this.logFormat=e.logFormat;if(e.maxFileSize!==void 0)this.maxFileSize=e.maxFileSize;if(e.maxLogFiles!==void 0)this.maxLogFiles=e.maxLogFiles;if(e.minLevel!==void 0)this.minLevel=e.minLevel}log(e,t,r="error"){let i={timestamp:new Date,error:e,context:t,level:r};if(this.errors.push(i),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(r))this.writeToFile(i)}shouldLog(e){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return e==="error"||e==="warning";if(this.minLevel==="error")return e==="error";return!0}formatEntry(e){if(this.logFormat==="json")return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level||"error",type:e.error.constructor.name,message:e.error.message,stack:e.error.stack,context:e.context});let t=[`[${e.timestamp.toISOString()}] [${(e.level||"error").toUpperCase()}] ${e.error.constructor.name}: ${e.error.message}`];if(e.error.stack)t.push(` Stack: ${e.error.stack.split(`
22
+ `).slice(1).join(`
23
+ `)}`);if(e.context)t.push(` Context: ${JSON.stringify(e.context)}`);return t.join(`
24
+ `)}writeToFile(e){this.writeQueue=this.writeQueue.then(async()=>{try{let t=await import("fs"),r=await import("path"),i=r.dirname(this.logFilePath);if(!t.existsSync(i))t.mkdirSync(i,{recursive:!0});await this.rotateIfNeeded(t);let s=`${this.formatEntry(e)}
25
+ `;t.appendFileSync(this.logFilePath,s,"utf-8")}catch(t){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",t)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let r=this.maxLogFiles-1;r>=1;r--){let i=`${this.logFilePath}.${r}`,s=`${this.logFilePath}.${r+1}`;if(e.existsSync(i))if(r>=this.maxLogFiles-1)e.unlinkSync(i);else e.renameSync(i,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(t){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",t)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((t)=>t.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((t)=>t.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},t={error:0,warning:0,info:0};for(let r of this.errors){let i=r.error.constructor.name;e[i]=(e[i]||0)+1;let s=r.level||"error";t[s]=(t[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:t}}async exportToFile(e,t="json"){let r=await import("fs"),i=await import("path"),s=i.dirname(e);if(!r.existsSync(s))r.mkdirSync(s,{recursive:!0});if(t==="json"){let o=this.errors.map((a)=>({timestamp:a.timestamp.toISOString(),level:a.level||"error",type:a.error.constructor.name,message:a.error.message,stack:a.error.stack,context:a.context}));r.writeFileSync(e,JSON.stringify(o,null,2),"utf-8")}else{let o=this.errors.map((a)=>this.formatEntry(a));r.writeFileSync(e,o.join(`
26
+
27
+ `),"utf-8")}}async flush(){await this.writeQueue}}var K=new Q,Nn={isDevelopment(){return te()},logDetailedError(e,t){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),t)console.error("Context:",t);console.error("========================")},createErrorReport(e,t){let r=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(t)r.push(`Context: ${JSON.stringify(t,null,2)}`);return r.push("========================"),r.join(`
28
+ `)}};class Mn{context;source;pos=0;line=1;column=0;tokens=[];constructor(e,t="template"){this.context=t;this.source=e}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let e=this.nextToken();if(e)this.tokens.push(e)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let e=this.pos,t=this.line,r=this.column,i=this.source[this.pos];if(/\s/.test(i))return this.readWhitespace(e,t,r);if(i==="/"&&this.peek(1)==="/")return this.readLineComment(e,t,r);if(i==="/"&&this.peek(1)==="*")return this.readBlockComment(e,t,r);if(i==='"'||i==="'")return this.readString(i,e,t,r);if(i==="`")return this.readTemplateString(e,t,r);if(/\d/.test(i)||i==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(e,t,r);if(/[a-z_$]/i.test(i))return this.readIdentifier(e,t,r);if(this.context==="template"&&i==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:e,end:this.pos,line:t,column:r};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:e,end:this.pos,line:t,column:r};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:e,end:this.pos,line:t,column:r}}if(this.context==="template"&&i==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:e,end:this.pos,line:t,column:r};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:e,end:this.pos,line:t,column:r}}if(this.context==="template"&&i==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:e,end:this.pos,line:t,column:r};if(i==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(e,t,r);let s=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let o of s)if(this.source.slice(this.pos,this.pos+o.length)===o)return this.advance(o.length),{type:"OPERATOR",value:o,start:e,end:this.pos,line:t,column:r};if(/[+\-*/%<>=!&|^~?:]/.test(i))return this.advance(),{type:"OPERATOR",value:i,start:e,end:this.pos,line:t,column:r};if(/[()[\]{},;.]/.test(i))return this.advance(),{type:"PUNCTUATION",value:i,start:e,end:this.pos,line:t,column:r};return this.advance(),{type:"PUNCTUATION",value:i,start:e,end:this.pos,line:t,column:r}}readWhitespace(e,t,r){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readLineComment(e,t,r){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
29
+ `)this.advance();return{type:"COMMENT",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readBlockComment(e,t,r){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readString(e,t,r,i){this.advance();while(this.pos<this.source.length){let s=this.source[this.pos];if(s==="\\"){this.advance(2);continue}if(s===e){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(t,this.pos),start:t,end:this.pos,line:r,column:i}}readTemplateString(e,t,r){this.advance();let i=0,s=256;while(this.pos<this.source.length){let o=this.source[this.pos];if(o==="\\"){this.advance(2);continue}if(o==="$"&&this.peek(1)==="{"){if(i>=s){this.pos=this.source.length;break}this.advance(2),i++;continue}if(o==="{"&&i>0){i++,this.advance();continue}if(o==="}"&&i>0){i--,this.advance();continue}if(o==="`"&&i===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readNumber(e,t,r){if(this.source[this.pos]==="0"){let i=this.peek(1)?.toLowerCase();if(i==="x"||i==="o"||i==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&(this.context==="javascript"||/\d/.test(this.peek(1)||""))){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readIdentifier(e,t,r){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readDirective(e,t,r){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}advance(e=1){for(let t=0;t<e&&this.pos<this.source.length;t++){if(this.source[this.pos]===`
30
+ `)this.line++,this.column=0;else this.column++;this.pos++}}peek(e){return this.source[this.pos+e]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(e){this.pos=e.pos,this.line=e.line,this.column=e.column}}function k(e,t,r,i=0){let s=0,o=i,a=null,c=0,g=!1;while(o<e.length){let l=e[o];if(a&&g){g=!1,o++;continue}if(a&&l==="\\"){g=!0,o++;continue}if(g=!1,(l==='"'||l==="'"||l==="`")&&!a){a=l,o++;continue}if(l===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&l==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&l==="}"){c--,o++;continue}if(l==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(l===t)s++;else if(l===r){if(s--,s===0)return o}o++}return-1}function Rl(e,t){let r=t,i={paren:0,bracket:0,brace:0},s=null,o=0;while(r<e.length){let a=e[r];if((r>0?e[r-1]:"")==="\\"&&s){r++;continue}if((a==='"'||a==="'")&&!s){s=a,r++;continue}if(a===s&&s!=="`"){s=null,r++;continue}if(a==="`"&&!s){s="`",r++;continue}if(a==="`"&&s==="`"&&o===0){s=null,r++;continue}if(s==="`"&&a==="$"&&e[r+1]==="{"){o++,r+=2;continue}if(o>0){if(a==="{")o++;else if(a==="}")o--;r++;continue}if(s){r++;continue}if(i.paren===0&&i.bracket===0&&i.brace===0){if(e.slice(r,r+2)==="}}"||e.slice(r,r+3)==="!!}")break;if(a===","||a===";")break}if(a==="(")i.paren++;else if(a===")"){if(i.paren--,i.paren<0)break}else if(a==="[")i.bracket++;else if(a==="]"){if(i.bracket--,i.bracket<0)break}else if(a==="{")i.brace++;else if(a==="}"){if(i.brace--,i.brace<0)break}r++}return{expression:e.slice(t,r),endPos:r}}var Et={maxSanitizeDepth:10,allowBracketNotation:!1},Re={...Et};var z=/\bnew\s+/,U="__stx_safe_ctors",Ce=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ne=[...Ce,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],be=ne.map(()=>{return}),re=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),se=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,z,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],oe=new Set([...Ce,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",U]),ae=new Set(["__proto__","constructor","prototype"]);function Te(e){let t="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)t+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}t+=a,r.push(o)}return{text:t,map:r}}function Ae(e){return Te(e).text}var _e=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Ie=(()=>{let e={Date,URL,URLSearchParams},t=Intl;for(let r of _e)if(typeof t[r]==="function")e[`Intl_${r}`]=t[r];return Object.freeze(Object.assign(Object.create(null),e))})(),xt=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,xe=/(?<![\w$])new(?![\w$])/g,we=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${_e.join(",")}}() are allowed`;function wt(e){let{text:t,map:r}=Te(e),i=[];xe.lastIndex=0;let s;while((s=xe.exec(t))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(t.slice(0,a)))continue;let c=xt.exec(t.slice(a)),g=c?.[3],l=!c?null:g?`Intl_${g}`:c[2];if(!c||!l||!(l in Ie))throw new S(`matched /${z.source}/; ${we}`,e);let h=a+c[0].length,f=r[a],y=r[h-1]+1;if(e.slice(f,y)!==t.slice(a,h))throw new S(`matched /${z.source}/; ${we}`,e);let b=f+3+c[1].length;i.push({start:b,end:b+c[2].length,key:l})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${U}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,t,r){super(r??`Potentially unsafe expression (${e}): ${t}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=t}}function po(e){try{return le(e),null}catch(t){return t instanceof S?t.rule:t instanceof Error?t.message:String(t)}}function Oe(e,t){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(oe.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,t);if(o==="."&&ae.has(s))throw new S(`matched /.${s}/; property ${s}`,t)}}function Le(e,t=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),g=/^'(?:[^'\\]|\\.)*'$/.test(c),l=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(g||l){let f=c.slice(1,-1);if(ae.has(f))throw new S(`bracket key ${f}`,e);if(!Re.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(t&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function le(e){let t=e.trim(),r=Ae(t);Oe(r,t);let i=Le(t);for(let s of se){if(s===z)continue;if(s.test(r))throw new S(`matched /${s.source}/`,t)}return{...wt(t),dynamicKeys:i}}function Gi(e){return le(e),e.trim()}var fo=Symbol("stx.sanitizeCache"),St=4000,D=new Map;function kt(e){let t=D.get(e);if(t===void 0){if(t=se.some((r)=>r.test(e)),D.size>=St)D.clear();D.set(e,t)}return t}function V(e){let t={},r=e[fo];t.Math=Math,t.JSON=JSON,t.Date=Date,t.String=String,t.Number=Number,t.Boolean=Boolean,t.Array=Array,t.Object=re,t.parseInt=Number.parseInt,t.parseFloat=Number.parseFloat,t.isNaN=Number.isNaN,t.isFinite=Number.isFinite,t.encodeURIComponent=encodeURIComponent,t.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||kt(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=ie(s),r?.set(s,o);t[i]=o}else t[i]=s}return t}function ie(e,t=0){if(t>=Re.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>ie(i,t+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=ie(s,t+1);else r[i]=s}return r}function d(e,t){try{let r=V(t),i=Object.keys(r),s=Object.values(r);return p(e,i)(...s)}catch{return}}function m(e){try{return Gi(e),!0}catch{return!1}}var j=new Set;function vt(e,t,r){if(!t.startsWith("__")||!(t in r))return;let i=`${t}\x00${e}`;if(j.has(i))return;if(j.add(i),j.size>500)j.clear();console.warn(`[stx] a condition reads \`${t}\`, which conditions cannot see, so \`${e.trim()}\` is false and nothing it guards is rendered. Names starting with \`__\` are withheld from @if, @elseif and @unless. Derive a plain value in the server script (for example \`const hasRows = ${t}.length > 0\`) and test that instead.`)}function $l(e,t){try{let r=V(t),i=Object.keys(r),s=Object.values(r),o=!1,c=p(e,i,(g)=>{o=!0,vt(e,g,t)})(...s);return!o&&Boolean(c)}catch{return!1}}function M(e,t){try{let r=d(e,t);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var Pe=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),Se=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,$t=0,Rt=0;function Ct(e,t){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=Se;for(let s=0;s<16;s++){let o=`c${++$t}`,a=`'use strict';if(${r}===${JSON.stringify(Se)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+t);if(c(...i)===o)return c;Rt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var Tt=2000,B=new Map;function ke(e,t){let r=`${e.join(",")}\x00${t}`,i=B.get(r);if(i)return i;let s=Ct(e,t);if(B.size>=Tt)B.clear();return B.set(r,s),s}function ht(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var At=/^[A-Za-z_$][\w$]*$/;function Fr(e){return At.test(e)&&!Pe.has(e)}var ve=new T(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function p(e,t,r){let i=JSON.stringify([e,t]),s=ve.get(i);if(!s)s=_t(e,[...t]),s.sourceBytes+=i.length*2,ve.set(i,s);return It(Ot(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function _t(e,t){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=le(e),o=[];for(let f=0;f<t.length;f++){if(!Fr(t[f]))continue;if(t[f]===U||t[f]==="Object"||oe.has(t[f]))continue;o.push({key:t[f],index:f})}o.sort((f,y)=>f.key<y.key?-1:1);let a=o.map((f)=>f.key),c=o.map((f)=>f.index),g=`
31
+ 'use strict';
32
+ try {
33
+ return ${r};
34
+ }
35
+ catch (e) {
36
+ if (e instanceof TypeError) {
37
+ return undefined;
38
+ }
39
+ throw e;
40
+ }
41
+ `,l=i?(f)=>{let y=ke([U,"Object",...ne,...a,...f],g);return(...b)=>y(Ie,re,...be,...b)}:(f)=>{let y=ke(["Object",...ne,...a,...f],g);return(...b)=>y(re,...be,...b)},h=l([]);return{sourceBytes:e.length*2+t.reduce((f,y)=>f+y.length*2,0),contextKeys:t,filteredKeys:a,validEntries:o,validIndices:c,dynamicKeys:s,buildFunc:(f)=>f.length===0?h:l(f)}}function It(e,t,r){if(r.length===0)return e;let i=r.map((s)=>t.indexOf(s));return(...s)=>{for(let o of i){if(o<0)continue;let a=s[o];if(typeof a==="string"&&ae.has(a))return}return e(...s)}}function Ot(e,t,r,i,s,o){let a=e([]),c=i.every((l,h)=>l.index===h);if(t.length===r.length&&c)return $e(a,t,e,void 0,o);return $e((...l)=>{let h=Array(s.length);for(let f=0;f<s.length;f++)h[f]=l[s[f]];return a(...h)},t,e,(l)=>{a=e(l)},o)}function $e(e,t,r,i,s){let a=/^(\w+) is not defined$/,c=e,g=[],l=new Set(t);return(...h)=>{for(let f=0;f<=8;f++)try{return c(...h)}catch(y){let b=y instanceof Error?y.message:"",w=a.exec(b);if(!(y instanceof ReferenceError)||!w)return;let x=w[1];if(l.has(x)||Pe.has(x)||oe.has(x))return;if(s?.(x),l.add(x),g.push(x),i)i(g);else c=r(g)}return}}function go(e){let t=e.trim();try{let r=Ae(t);if(/\b(?:eval|function|import|require|process|globalthis|window|document|fetch|bun|deno|buffer|console|reflect|proxy|prototype|constructor|this)\b/i.test(r))return!1;Oe(r,t),Le(t);for(let i of se)if(i.test(r))return!1}catch{return!1}return!0}function Ji(e,t){let r=[];t.lastIndex=0;let i;while((i=t.exec(e))!==null){let s=i.index,o=s+i[0].length-1,a=k(e,"(",")",o);if(a===-1){r.push({start:s,end:-1,args:"",call:e.slice(s,Math.min(e.length,s+80))}),t.lastIndex=o+1;continue}r.push({start:s,end:a+1,args:e.slice(o+1,a),call:e.slice(s,a+1)}),t.lastIndex=a+1}return r}function Xt(e,t,r,i){let s="",o=0;for(let a of Ji(e,t)){if(s+=e.slice(o,a.start),a.end===-1){s+=i(a.call),o=a.start;continue}s+=r(a.args,a.call),o=a.end}return s+e.slice(o)}function Jt(e){let t=[],r=0,i=null,s="";for(let o=0;o<e.length;o++){let a=e[o];if(i){if(s+=a,a==="\\"&&o+1<e.length){s+=e[++o];continue}if(a===i)i=null;continue}if(a==="'"||a==='"'||a==="`")i=a;else if(a==="("||a==="["||a==="{")r++;else if(a===")"||a==="]"||a==="}")r--;else if(a===","&&r===0){t.push(s.trim()),s="";continue}s+=a}if(s.trim())t.push(s.trim());return t}function Dn(e){let t=e.trim(),r=t[0];if(r!=="'"&&r!=='"'&&r!=="`"||t.length<2||t.at(-1)!==r)return null;let i="",s={b:"\b",f:"\f",n:`
42
+ `,r:"\r",t:"\t",v:"\v",0:"\x00"};for(let o=1;o<t.length-1;o++){let a=t[o];if(a==="\\"){if(++o>=t.length-1)return null;let c=t[o];if(/[1-9]/.test(c)||c==="0"&&/\d/.test(t[o+1]??""))return null;if(c===`
43
+ `||c==="\u2028"||c==="\u2029")continue;if(c==="\r"){if(t[o+1]===`
44
+ `)o++;continue}if(c==="x"||c==="u"){let g=c==="u"&&t[o+1]==="{",l=g?t.indexOf("}",o+2):o+(c==="x"?2:4)+1,h=t.slice(o+(g?2:1),l);if(l<0||l>=t.length||!/^[\da-f]+$/i.test(h)||!g&&h.length!==(c==="x"?2:4))return null;let f=Number.parseInt(h,16);if(f>1114111)return null;i+=String.fromCodePoint(f),o=g?l:l-1;continue}i+=Object.hasOwn(s,c)?s[c]:c;continue}if(a===r||r!=="`"&&(a===`
45
+ `||a==="\r"))return null;if(r==="`"&&a==="$"&&t[o+1]==="{")return null;if(r==="`"&&a==="\r"){if(t[o+1]===`
46
+ `)o++;i+=`
47
+ `}else i+=a}return i}var Nt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Yt(e,t){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:n.INVALID_DIRECTIVE_SYNTAX};let i=po(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:n.UNSAFE_EXPRESSION};let s=V(t),o;try{o=p(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:n.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(ht(r))].filter((c)=>!Nt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((g)=>`"${g}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:n.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:n.EVALUATION_ERROR};return{ok:!0,value:o}}function Ze(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function yt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function De(e){if(!e)return"";return Fe.isAbsolute(e)?Fe.relative(process.cwd(),e)||e:e}function ue(e){let t=e.replace(/\s+/g," ").trim();return t.length>80?`${t.slice(0,77)}...`:t}function H(e,t,r,i,s=n.EVALUATION_ERROR){let o=i?` in ${De(i)}`:"";return console.warn(`[stx] ${ue(t)}${o}: ${r}`),u(e,`${ue(t)}: ${r}`,s)}function mo(e,t,r){let i=r?` in ${De(r)}`:"";console.warn(`[stx] ${ue(e)}${i}: ${t}`)}function Yi(){return{afterOpen:[],beforeClose:[]}}function Lt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function Al(e,t){if(!Lt(t))return e;let r=t.afterOpen.join(""),i=t.beforeClose.join(""),s=L(e),o=r?Hr(e):null,a=i&&s!==-1?s:null;if(o===null&&a===null)return e;if(o!==null&&a!==null)return`${e.slice(0,o)}${r}${e.slice(o,a)}${i}${e.slice(a)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,a)}${i}${e.slice(a)}`}var je=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Hr(e){let t=/<head\b[^>]*>/i.exec(e);if(!t)return null;let r=t.index+t[0].length;je.lastIndex=r;let i=je.exec(e);return i?r+i[0].length:r}var pe="data-stx-color-mode-boot",Be="__STX_COLOR_MODE__",Pt=new Set(["light","dark","auto","system"]),Mt=new Set(["auto","system"]),Ft=/^[a-z][\w:-]*$/i,Dt=/^[\w-]+$/;function jt(e){let t=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",i=e.darkClass===void 0?"dark":e.darkClass,s=e.attribute??null,o=e.autoValue??null,a=e.respectExisting===!0;if(typeof t!=="string"||t.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Pt.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(i!==null&&(typeof i!=="string"||!Dt.test(i)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(i)}`);if(s!==null&&(typeof s!=="string"||!Ft.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!Mt.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(i===null&&s===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(a&&s===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:t,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Bt(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function fe(e={}){let t=jt(e),r=Bt(t),i=`(function(){"use strict";var o=window.${Be};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${Be}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${pe}>${i}</script>`}function Vr(e,t={}){if(e.includes(pe))return e;let r=ge(e);if(r===null)return e;let i=fe(t);return`${e.slice(0,r)}
48
+ ${i}${e.slice(r)}`}var ge=Hr,zt=new RegExp(`<script\\b[^>]*\\b${pe}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),ze=/<meta\b[^>]*\bcharset\b[^>]*>/gi,He=/<\/head>/gi;function Ht(e){let t=/<head\b[^>]*>/i.exec(e);if(!t)return e;let r=t.index+t[0].length;He.lastIndex=r;let i=He.exec(e),s=i?i.index:e.length;ze.lastIndex=r;let o=ze.exec(e);if(!o||o.index>=s)return e;if(e.slice(r,o.index).trim()==="")return e;let a=o.index+o[0].length;return`${e.slice(0,r)}
49
+ ${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function Pl(e){return Ut(Ht(e))}function Ut(e){let t=zt.exec(e);if(!t)return e;let r=ge(e);if(r===null)return e;if(t.index<=r||e.slice(r,t.index).trim()==="")return e;let i=e.slice(0,t.index)+e.slice(t.index+t[0].length),s=ge(i);if(s===null)return e;return`${i.slice(0,s)}
50
+ ${t[0]}${i.slice(s)}`}var Vt="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",We=`<style data-stx-cloak>[x-cloak]{display:none !important}${Vt}</style>`,W="data-stx-html-attrs",X="data-stx-html-class",Ke=/^[A-Za-z_:][\w:.-]*$/;function v(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wt(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function Kt(e){let t=/^\s*<meta\b([^>]*)>/i.exec(e);if(!t)return null;let r={};for(let i of t[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function _(e,t){return Object.entries(e).filter(([r])=>!t?.(r)).map(([r,i])=>`${r}="${v(String(i))}"`).join(" ")}function q(e){let t=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?t.replace(/<\//g,"<\\/"):t}function Xe(e){let t=_(e,(r)=>r==="content");return`<script${t?` ${t}`:""}>${q(e)}</script>`}function qt(e={},t="en"){let r=[],i=[],s="",o=t;for(let[c,g]of Object.entries(e||{})){if(g==null)continue;let l=c.trim();if(!Ke.test(l))continue;let h=l.toLowerCase();if(h==="lang"){o=String(g);continue}if(h==="class"){s=String(g).trim();continue}r.push(` ${l}="${v(String(g))}"`),i.push(l)}let a=` lang="${v(o)}"`;if(s)a+=` class="${v(s)}"`;if(a+=r.join(""),s)a+=` ${X}="${v(s)}"`;if(i.length)a+=` ${W}="${v(i.join(" "))}"`;return a}function Il(e={},t={}){let r={...e,...t};if(e.class&&t.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of t.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Ur(e,t={}){if(!t||Object.keys(t).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let i={},s=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,a;while((a=o.exec(r[1]))!==null){let h=a[1];if(!(h in i))s.push(h);i[h]=a[2]??a[3]??a[4]??""}let c=[],g=[];for(let[h,f]of Object.entries(t)){if(f==null)continue;let y=h.trim();if(!Ke.test(y))continue;let b=y.toLowerCase();if(b==="class"){let w=(i.class||"").split(/\s+/).filter(Boolean);for(let x of String(f).split(/\s+/).filter(Boolean))if(!w.includes(x))w.push(x),c.push(x);if(!("class"in i))s.push("class");i.class=w.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(f),b!=="lang")g.push(y)}if(c.length){if(!(X in i))s.push(X);i[X]=c.join(" ")}if(g.length){if(!(W in i))s.push(W);i[W]=g.join(" ")}let l=s.map((h)=>` ${h}="${v(i[h])}"`).join("");return e.replace(r[0],()=>`<html${l}>`)}function Ol(e){if(e.includes("data-stx-cloak"))return null;if(L(e)===-1)return null;return`${We}
51
+ `}function Gt(e){let t=[],r=0;while(r<e.length){let o=e.slice(r),a=o.match(/^\s+/);if(a){r+=a[0].length;continue}if(o.startsWith("<!--")){let f=e.indexOf("-->",r);if(f===-1)break;r=f+3;continue}let c=o.match(/^<script\b[^>]*>/i);if(c){let f=e.toLowerCase().indexOf("</script>",r+c[0].length);if(f===-1)break;r=f+9;continue}let g=o.match(/^<link\b[^>]*>/i);if(g){t.push(g[0]),r+=g[0].length;continue}let l=o.match(/^<meta\b[^>]*>/i);if(l){t.push(l[0]),r+=l[0].length;continue}let h=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(h){t.push(h[0]),r+=h[0].length;continue}break}if(t.length===0)return{body:e,hoisted:t};let i="",s=0;while(s<e.length&&s<r){let o=e.slice(s),a=o.match(/^<link\b[^>]*>/i);if(a&&t.includes(a[0])){s+=a[0].length;continue}let c=o.match(/^<meta\b[^>]*>/i);if(c&&t.includes(c[0])){s+=c[0].length;continue}let g=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(g&&t.includes(g[0])){s+=g[0].length;continue}i+=e[s],s++}return i+=e.slice(r),{body:i,hoisted:t}}function Zt(e,t={},r={}){let{title:i="stx App",lang:s="en",meta:o=[],link:a=[],script:c=[],headRaw:g="",htmlAttrs:l={},bodyClass:h="",bodyAttrs:f={}}=t,y=r.title||i,b=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],w=new Set(o.map(bt).filter(Boolean)),{body:x,hoisted:R}=Gt(e),A=new Set(R.flatMap((E)=>{let O=Kt(E);return O?[bt(O)].filter(Boolean):[]})),et=[...b.filter((E)=>!w.has(bt(E))),...o].filter((E)=>!A.has(bt(E))).map((E)=>` <meta ${_(E)}>`).join(`
52
+ `),tt=a.map((E)=>` <link ${_(E)}>`).join(`
53
+ `),nt=c.map((E)=>{if(E.src)return` <script ${_(E,(O)=>O==="content")}></script>`;if(E.content)return` ${Xe(E)}`;return""}).filter(Boolean).join(`
54
+ `),rt=qt(l,s),it=Object.entries(f).map(([E,O])=>` ${E}="${v(String(O))}"`).join(""),st=h?` class="${v(h)}"`:"",ot=[et,r.colorMode?` ${fe(r.colorMode)}`:"",` <title>${r.titleIsHtml?y:Wt(y)}</title>`,` ${We}`,tt,nt,g?` ${g}`:"",...(r.styles||[]).map((E)=>` ${E}`),...R.map((E)=>` ${E}`),...(r.headScripts||[]).map((E)=>` ${E}`),r.headStack||""].filter(Boolean),at=[x,...(r.bodyScripts||[]).map((E)=>E),r.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
55
+ <html${rt}>
56
+ <head>
57
+ ${ot.join(`
58
+ `)}
59
+ </head>
60
+ <body${st}${it}>
61
+ ${at.join(`
62
+ `)}
63
+ </body>
64
+ </html>`}var de=/\s+/y,me=/<(script|style)\b[^>]*>/iy,Qt=/<\/script>/gi,en=/<\/style>/gi,Ue=/<!DOCTYPE\b/iy,Ve=/<html[\s>]/iy;function Ln(e){let t=0;while(t<e.length){if(de.lastIndex=t,de.exec(e)){t=de.lastIndex;continue}if(e.startsWith("<!--",t)){let s=e.indexOf("-->",t);if(s===-1)return!1;t=s+3;continue}me.lastIndex=t;let i=me.exec(e);if(i){let s=i[1].toLowerCase()==="script"?Qt:en;s.lastIndex=me.lastIndex;let o=s.exec(e);if(o===null)return!1;t=o.index+o[0].length;continue}if(Ue.lastIndex=t,Ue.test(e))return!0;return Ve.lastIndex=t,Ve.test(e)}return!1}function Zi(e){return Ln(e)}function Nl(e,t={}){let r=L(e);if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=t,c=e.slice(0,r),g=[];for(let l of i){let h=bt(l);if(h&&c.includes(h))continue;g.push(` <meta ${_(l)}>`)}for(let l of s){if(l.href&&c.includes(`href="${l.href}"`))continue;g.push(` <link ${_(l)}>`)}for(let l of o)if(l.src){if(c.includes(`src="${l.src}"`))continue;g.push(` <script ${_(l,(h)=>h==="content")}></script>`)}else if(l.content){if(c.includes(q(l)))continue;g.push(` ${Xe(l)}`)}if(a&&!c.includes(a))g.push(` ${a}`);if(g.length===0)return e;return`${e.slice(0,r)}${g.join(`
65
+ `)}
66
+ ${e.slice(r)}`}function Wr(e,t={},r={},i){if(i??Zi(e))return e;return Zt(e,t,r)}var tn=["og:","article:","book:","profile:","fb:","music:","video:"],nn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function qr(e,t){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:n.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:n.INVALID_DIRECTIVE_SYNTAX};let r=rn(e[0],t);if(typeof r!=="string")return r;let i;if(e.length===2){let o=sn(e[1],t);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=t.openGraph,c=t[o]??(yt(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:tn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function rn(e,t){let r=Dn(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:n.INVALID_DIRECTIVE_SYNTAX};if(nn.test(e.trim()))return e.trim();let i=Yt(e,t);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${Ze(i.value)}`,code:n.TYPE_ERROR};return i.value}function sn(e,t){let r=Dn(e);if(r!==null)return r;let i=Yt(e,t);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${Ze(s)}`,code:n.TYPE_ERROR};return String(s)}var Kr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],ho=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],Ye={links:"link",metas:"meta",scripts:"script",styles:"style"},qe=new Set,Ge=new WeakMap;function he(e){if(qe.has(e))return;qe.add(e),console.warn(e)}function on(e,t){let r=Array.from({length:t.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=t.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===t[o-1]?0:1)),s=a}}return r[t.length]}function an(e,t){let r=e.toLowerCase(),i=t.find((g)=>g.toLowerCase()===r);if(i)return i;let s=Ye[r];if(s&&t.includes(s))return s;let o,a=1/0;for(let g of t){let l=on(r,g.toLowerCase());if(l<a)o=g,a=l}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Me(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=Ge.get(e);if(r)return r;let{known:i,source:s}=t,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=Ye[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let l=Array.isArray(o[c])?o[c]:[];o[c]=[...l,...e[a]],delete o[a],he(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){he(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let g=an(a,i);he(g?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${g}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return Ge.set(e,o),o}var C={},cn=[],G={};function Qi(){return C}function Ny(){return G}function My(){C={},cn.length=0,G={}}function Ml(e){C=Qe(C,Me(e,{known:ho,source:"useHead()"}))}function Je(e,t,r){let i=[...e||[]];for(let s of t||[]){let o=r(s),a=o?i.findIndex((c)=>r(c)===o):-1;if(a<0)i.push(s);else i[a]=s}return i}function Qe(e,t){return{title:t.title??e.title,titleTemplate:t.titleTemplate??e.titleTemplate,base:t.base??e.base,meta:Je(e.meta,t.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:Je(e.link,t.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...t.script||[]],style:[...e.style||[],...t.style||[]],htmlAttrs:{...e.htmlAttrs,...t.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...t.bodyAttrs}}}function Yg(e){Ml(yo(e))}function yo(e){let t=[];if(e.description)t.push({name:"description",content:e.description});if(e.keywords){let g=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;t.push({name:"keywords",content:g})}if(e.author)t.push({name:"author",content:e.author});if(e.robots)t.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)t.push({property:"og:title",content:r});if(i)t.push({property:"og:description",content:i});if(e.ogImage){if(t.push({property:"og:image",content:e.ogImage}),e.ogImageType)t.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)t.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)t.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)t.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)t.push({property:"og:url",content:e.ogUrl});if(e.ogType)t.push({property:"og:type",content:e.ogType});if(e.ogSiteName)t.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)t.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)t.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)t.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)t.push({property:"profile:username",content:e.profileUsername});let s=e.twitterTitle??e.title,o=e.twitterDescription??e.description,a=e.twitterImage??e.ogImage;if(e.twitterCard)t.push({name:"twitter:card",content:e.twitterCard});if(s)t.push({name:"twitter:title",content:s});if(o)t.push({name:"twitter:description",content:o});if(a){t.push({name:"twitter:image",content:a});let g=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(g)t.push({name:"twitter:image:alt",content:g})}if(e.twitterSite)t.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)t.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)t.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)t.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)t.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)t.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let g of e.articleTags)t.push({property:"article:tag",content:g});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:t,link:c}}function Dy(e){if(G={...G,...e},e.title||e.description)Yg({title:e.title,description:e.description})}function Ly(e){let t=typeof e==="function"?e():e;Ml({title:t})}function jy(e=C){let t=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);t.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");t.push(`<base ${r}>`)}for(let r of e.meta||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s==="httpEquiv"?"http-equiv":s}="${I(String(o))}"`).join(" ");t.push(`<meta ${i}>`)}for(let r of e.link||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s}="${I(String(o))}"`).join(" ");t.push(`<link ${i}>`)}for(let r of e.script||[]){let{content:i,...s}=r,o=Object.entries(s).filter(([a,c])=>c!==void 0).map(([a,c])=>{if(typeof c==="boolean")return c?a:"";return`${a}="${I(String(c))}"`}).filter(Boolean).join(" ");if(i)t.push(`<script ${o}>${q(r)}</script>`);else t.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";t.push(`<style${i}>${r.content}</style>`)}return t.join(`
67
+ `)}function By(e=C){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([t,r])=>`${t}="${I(r)}"`).join(" ")}function Fy(e=C){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([t,r])=>`${t}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function zy(e=C){if(typeof document>"u")return;if(e.title){let t=e.title;if(e.titleTemplate)t=typeof e.titleTemplate==="function"?e.titleTemplate(t):e.titleTemplate.replace("%s",t);document.title=t}for(let t of e.meta||[]){let r=t.name?`meta[name="${t.name}"]`:t.property?`meta[property="${t.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),t.name)i.setAttribute("name",t.name);if(t.property)i.setAttribute("property",t.property);document.head.appendChild(i)}i.setAttribute("content",t.content)}}for(let t of e.link||[]){let r=`link[rel="${t.rel}"]${t.href?`[href="${t.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(t))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[t,r]of Object.entries(e.htmlAttrs))if(t==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(t,r);if(e.bodyAttrs)for(let[t,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(t,r)}function Hy(e){let t="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(t+=s.trim()+`
68
+ `,"")),headContent:t.trim()}}function Vy(e,t){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:t[(o||"").trim()]??o,c=t.__stx_runtime_head??{};return t.__stx_runtime_head=Qe(c,{title:a}),""})}function Uy(e,t,r=""){if(!e.includes("@meta"))return e;return Xt(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=qr(Jt(i),t);if(o.kind==="error")return H("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=t.__stx_runtime_head??{};t.__stx_runtime_head=Qe(a,{meta:[o.tag]})}return""},(i)=>H("Meta",i,"the call has no closing parenthesis",r,n.INVALID_DIRECTIVE_SYNTAX))}export{po,Gi,fo,d,m,$l,M,ht,Fr,p,go,n,ce,zr,ee,u,Ne,Xi,K,Nn,Mn,k,Rl,Ji,Xt,Jt,Dn,Yt,Ze,yt,H,mo,Yi,Al,Hr,Vr,Pl,bt,Il,Ur,Ol,Ln,Zi,Nl,Wr,qr,Kr,ho,Me,Qi,Ny,My,Ml,Qe,Yg,yo,Dy,Ly,jy,By,Fy,zy,Hy,Vy,Uy};
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- function b(e,s){let i=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===i)return n+1;n++}return e.length}function m(e,s){let i=s+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==="`")return i+1;if(e[i]==="$"&&e[i+1]==="{"){if(i=Dl(e,i+2),i<e.length)i++;continue}i++}return e.length}function Dl(e,s){let i=1,n=s,l="{",r="";while(n<e.length){let f=e[n];if(f==="\\"){n+=2;continue}if(f==='"'||f==="'"){n=b(e,n),l=g,r="";continue}if(f==="`"){n=m(e,n),l=g,r="";continue}if(f==="/"&&e[n+1]==="/"){while(n<e.length&&e[n]!==`
2
+ function b(e,s){let i=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===i)return n+1;n++}return e.length}function m(e,s){let i=s+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==="`")return i+1;if(e[i]==="$"&&e[i+1]==="{"){if(i=jl(e,i+2),i<e.length)i++;continue}i++}return e.length}function jl(e,s){let i=1,n=s,l="{",r="";while(n<e.length){let f=e[n];if(f==="\\"){n+=2;continue}if(f==='"'||f==="'"){n=b(e,n),l=g,r="";continue}if(f==="`"){n=m(e,n),l=g,r="";continue}if(f==="/"&&e[n+1]==="/"){while(n<e.length&&e[n]!==`
3
3
  `)n++;continue}if(f==="/"&&e[n+1]==="*"){n+=2;while(n<e.length&&e.slice(n,n+2)!=="*/")n++;n+=2;continue}if(f==="/"&&o(l,r)){let u=p(e,n);if(u!==-1){n=u,l=g,r="";continue}}if(f==="{")i++;else if(f==="}"){if(i--,i===0)return n}if(/[\w$]/.test(f))r=/[\w$]/.test(l)?r+f:f,l=f;else if(!/\s/.test(f))l=f,r="";n++}return e.length}var c=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function o(e,s){if(s)return c.has(s);return!(e===")"||e==="]"||e===g)}var g="\x00";function p(e,s){let i=s+1,n=!1;while(i<e.length){let l=e[i];if(l===`
4
- `)return-1;if(l==="\\"){i+=2;continue}if(l==="[")n=!0;else if(l==="]")n=!1;else if(l==="/"&&!n){i++;while(i<e.length&&/[a-z]/i.test(e[i]))i++;return i}i++}return-1}function t(e){return w(e,!1)}function Bn(e){return w(e,!0)}function w(e,s){let i="",n=0,l="",r="";while(n<e.length){let f=e.slice(n,n+2);if(f==="//"){while(n<e.length&&e[n]!==`
4
+ `)return-1;if(l==="\\"){i+=2;continue}if(l==="[")n=!0;else if(l==="]")n=!1;else if(l==="/"&&!n){i++;while(i<e.length&&/[a-z]/i.test(e[i]))i++;return i}i++}return-1}function t(e){return w(e,!1)}function Fn(e){return w(e,!0)}function w(e,s){let i="",n=0,l="",r="";while(n<e.length){let f=e.slice(n,n+2);if(f==="//"){while(n<e.length&&e[n]!==`
5
5
  `)i+=" ",n++;continue}if(f==="/*"){while(n<e.length&&e.slice(n,n+2)!=="*/")i+=e[n]===`
6
6
  `?`
7
7
  `:" ",n++;i+=" ",n+=2;continue}let u=e[n];if(u==='"'||u==="'"){let h=u;i+=" ",n++;while(n<e.length&&e[n]!==h){if(e[n]==="\\"){i+=" ",n+=2;continue}i+=e[n]===`
8
8
  `?`
9
- `:" ",n++}i+=s?"$":" ",n++,l=g,r="";continue}if(u==="/"&&o(l,r)){let h=p(e,n);if(h!==-1){i+=`/${" ".repeat(h-n-2)}/`,n=h,l=g,r="";continue}}if(u==="`"){i+=s?"(":" ",n++;while(n<e.length&&e[n]!=="`"){if(e[n]==="\\"){i+=" ",n+=2;continue}if(e[n]==="$"&&e[n+1]==="{"){let h=n+2,a=Dl(e,h);if(i+=s?" {":" ",i+=w(e.slice(h,a),s),a<e.length)i+=s?"}":" ";n=a+1;continue}i+=e[n]===`
9
+ `:" ",n++}i+=s?"$":" ",n++,l=g,r="";continue}if(u==="/"&&o(l,r)){let h=p(e,n);if(h!==-1){i+=`/${" ".repeat(h-n-2)}/`,n=h,l=g,r="";continue}}if(u==="`"){i+=s?"(":" ",n++;while(n<e.length&&e[n]!=="`"){if(e[n]==="\\"){i+=" ",n+=2;continue}if(e[n]==="$"&&e[n+1]==="{"){let h=n+2,a=jl(e,h);if(i+=s?" {":" ",i+=w(e.slice(h,a),s),a<e.length)i+=s?"}":" ";n=a+1;continue}i+=e[n]===`
10
10
  `?`
11
11
  `:" ",n++}i+=s?")":" ",n++,l=g,r="";continue}if(i+=u,n++,/[\w$]/.test(u))r=/[\w$]/.test(l)?r+u:u,l=u;else if(!/\s/.test(u))l=u,r=""}return i}function E(e){let s=new Uint16Array(e.length),i=0,n=!0;for(let l=0;l<e.length;l++){let r=e[l];if(r===")"||r==="]"||r==="}")if(i===0)n=!1;else i--;if(s[l]=i,r==="("||r==="["||r==="{")i++}return{depths:s,balanced:n&&i===0}}
12
- export{Dl,t,Bn,E};
12
+ export{jl,t,Fn,E};
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
45
45
  });
46
46
  })();
47
47
  </script>
48
- `}function vh(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
48
+ `}function Sh(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
49
49
  <div id="${a}" class="stx-teleport-source" style="display: none;">
50
50
  <template>${c}</template>
51
51
  </div>
52
52
  ${m}
53
- `})}function xh(){return`
53
+ `})}function kh(){return`
54
54
  <script>
55
55
  (function() {
56
56
  // Common teleport targets
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
68
68
  })();
69
69
  </script>
70
70
  `}
71
- export{vh,xh};
71
+ export{Sh,kh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{_i,Ci,Nt,xe,Er,Us,Tr,Ws,qs,vg,xg,Sg,$r,kg,_g,Cg,Eg,Jc,Yc,Zc,Ei,Qc,Tg,Mt,Dt,Lt,jt,Bt,Ft,pt,$g}from"./chunk-eceeqy74.js";export{Tr as Router,Cg as abortNavigation,Us as bracketPathToRegex,Mt as clearMiddleware,Yc as createClientCookieManager,Bt as createMiddlewareContext,jt as createRouteLocation,Jc as createServerCookieManager,Zc as createStorageManager,Eg as defineMiddleware,xg as defineRoute,Sg as defineRoutes,Ws as findErrorPage,qs as formatRoutes,Ci as generateRouteManifest,_i as generateRouteTypes,Qc as getMiddleware,Dt as getMiddlewareNames,pt as getRouterScript,$g as getRouterScriptDev,Tg as hasMiddleware,Nt as isFileRequestPath,Lt as loadMiddlewareFromDirectory,Er as matchRoute,_g as navigateTo,xe as patternToRegex,Ei as registerMiddleware,kg as resetRoutes,$r as route,Ft as runMiddleware,vg as setAppUrl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{bn,Yo,Zo,Qo,ny,ei}from"./chunk-s0mf56y1.js";import"./chunk-rb2zbdqd.js";import"./chunk-eceeqy74.js";import"./chunk-eyx92t9n.js";export{Zo as buildServerApi,ny as createServerApi,bn as discoverServerApi,Yo as generateApiTypes,ei as isServerApiSource,Qo as productionApiDispatcher};