@stacksjs/stx 0.2.875 → 0.2.880

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/{chunk-fdjx4vs3.js → chunk-00tq7ghn.js} +2 -2
  2. package/dist/{chunk-nv4c25zj.js → chunk-02qmvcmv.js} +3 -3
  3. package/dist/chunk-08cb7cyw.js +2 -0
  4. package/dist/chunk-0h1dyd38.js +2 -0
  5. package/dist/{chunk-4m11kcxz.js → chunk-0m4c42qt.js} +10 -10
  6. package/dist/{chunk-6ykfy7eh.js → chunk-19k15mfc.js} +2 -2
  7. package/dist/chunk-1avy0p8v.js +2 -0
  8. package/dist/chunk-1jk46ve0.js +2 -0
  9. package/dist/chunk-1r612xxs.js +2 -0
  10. package/dist/chunk-1z6rrqvm.js +2 -0
  11. package/dist/chunk-2d68p12e.js +2 -0
  12. package/dist/chunk-2haf7t5h.js +2 -0
  13. package/dist/{chunk-1q5w3xav.js → chunk-2r0nrvqe.js} +2 -2
  14. package/dist/chunk-3jp5z1qj.js +2 -0
  15. package/dist/{chunk-644ckv6e.js → chunk-3q0w0bzd.js} +10 -10
  16. package/dist/{chunk-eknm4jrm.js → chunk-3sema2js.js} +2 -2
  17. package/dist/{chunk-vznf808n.js → chunk-3wb82rxw.js} +5 -5
  18. package/dist/chunk-3zds0gmd.js +2 -0
  19. package/dist/{chunk-qnwd5bz4.js → chunk-463weehv.js} +1 -1
  20. package/dist/{chunk-wm029dh0.js → chunk-4fkcn6z5.js} +18 -12
  21. package/dist/{chunk-976kgb3r.js → chunk-4n45qa0b.js} +9 -9
  22. package/dist/chunk-4pjqj54a.js +2 -0
  23. package/dist/{chunk-9anqwafq.js → chunk-4r2rfdmr.js} +5 -5
  24. package/dist/{chunk-ft6em3wm.js → chunk-50cnypys.js} +6 -6
  25. package/dist/chunk-53cc06w7.js +2 -0
  26. package/dist/{chunk-y2e2zm6y.js → chunk-57q4nvs9.js} +3 -3
  27. package/dist/{chunk-3mz9bdf7.js → chunk-59er0fc7.js} +3 -3
  28. package/dist/{chunk-dw0ttj6p.js → chunk-5eftxrvv.js} +2 -2
  29. package/dist/chunk-5p3825qw.js +2 -0
  30. package/dist/chunk-5rd0an89.js +2 -0
  31. package/dist/{chunk-pk714ynv.js → chunk-69ezjc8k.js} +4 -4
  32. package/dist/{chunk-75v0yxeh.js → chunk-6c1vm6bs.js} +2 -2
  33. package/dist/{chunk-d3q0cg47.js → chunk-6df3j3qq.js} +3 -3
  34. package/dist/{chunk-kzc2tqzr.js → chunk-6t04tqvh.js} +2 -2
  35. package/dist/chunk-78zgmqhd.js +2 -0
  36. package/dist/chunk-7bsrnpmh.js +33 -0
  37. package/dist/chunk-7dq6ebvp.js +2 -0
  38. package/dist/chunk-7kqgp3p7.js +2 -0
  39. package/dist/{chunk-wzvdr4ta.js → chunk-7mcs59pr.js} +2 -2
  40. package/dist/chunk-83b9k17j.js +2 -0
  41. package/dist/chunk-86nsbxep.js +61 -0
  42. package/dist/{chunk-0g2mg8cw.js → chunk-8e1cv1hh.js} +3 -3
  43. package/dist/chunk-8h5nje66.js +2 -0
  44. package/dist/{chunk-ae8q4gze.js → chunk-8va3fs07.js} +5 -5
  45. package/dist/{chunk-fnjm3xbf.js → chunk-93jhfbeg.js} +6 -6
  46. package/dist/{chunk-xmws1gaf.js → chunk-94ctmp0j.js} +2 -2
  47. package/dist/chunk-97kgrevs.js +4 -0
  48. package/dist/{chunk-qvrew79n.js → chunk-9cbf0seq.js} +2 -2
  49. package/dist/{chunk-mce3g2wb.js → chunk-9f31gs4m.js} +2 -2
  50. package/dist/chunk-9kza7gxd.js +2 -0
  51. package/dist/{chunk-b4d4tjvx.js → chunk-a0q0kb0s.js} +5 -5
  52. package/dist/chunk-a5gnxdfe.js +2 -0
  53. package/dist/chunk-a60ztvnp.js +3 -0
  54. package/dist/{chunk-s7fhpkvf.js → chunk-a7ryj8z8.js} +6 -6
  55. package/dist/{chunk-gqtb53s8.js → chunk-aaea157p.js} +2 -2
  56. package/dist/{chunk-wp0qpa50.js → chunk-agd2b928.js} +59 -27
  57. package/dist/chunk-aqxh80vh.js +2 -0
  58. package/dist/{chunk-az5rh7fs.js → chunk-awp8a3t4.js} +2 -2
  59. package/dist/chunk-axra1yas.js +2 -0
  60. package/dist/chunk-az8b0726.js +21 -0
  61. package/dist/chunk-b7d3n4aw.js +2 -0
  62. package/dist/{chunk-r2bxjna3.js → chunk-c0g30cjs.js} +2 -2
  63. package/dist/{chunk-jt5tzddc.js → chunk-c73c0wf9.js} +2 -2
  64. package/dist/{chunk-88xayf21.js → chunk-cad7e5q1.js} +9 -9
  65. package/dist/{chunk-bjjfr7qt.js → chunk-care745q.js} +2 -2
  66. package/dist/chunk-ce0zbpr5.js +2 -0
  67. package/dist/chunk-cjv89tnb.js +20 -0
  68. package/dist/chunk-cv1vm1w0.js +2 -0
  69. package/dist/{chunk-mw0rb1sf.js → chunk-czcx3nbx.js} +6 -6
  70. package/dist/chunk-d7b30bg6.js +2 -0
  71. package/dist/{chunk-stn7p7f1.js → chunk-dwyhpbpx.js} +2 -2
  72. package/dist/{chunk-y75bds1g.js → chunk-e362e615.js} +30 -30
  73. package/dist/{chunk-ydppkb8y.js → chunk-e41pgmgk.js} +2 -2
  74. package/dist/{chunk-6az66mrc.js → chunk-ec5q4nnw.js} +66 -66
  75. package/dist/{chunk-0h6r7nvn.js → chunk-egjmb32c.js} +126 -71
  76. package/dist/{chunk-q7zc78az.js → chunk-ew3vs3jq.js} +8 -8
  77. package/dist/{chunk-jqxerj6k.js → chunk-ezna4dhj.js} +2 -2
  78. package/dist/chunk-f3j1h3ch.js +2 -0
  79. package/dist/{chunk-vmssv78v.js → chunk-f7znj9xg.js} +3 -3
  80. package/dist/chunk-fz4c5e9m.js +2 -0
  81. package/dist/{chunk-esjr9qhe.js → chunk-g2xy0z0e.js} +2 -2
  82. package/dist/{chunk-fy6ts0n4.js → chunk-g83ph305.js} +2 -2
  83. package/dist/{chunk-kywe0f1v.js → chunk-gbncp2gp.js} +2 -2
  84. package/dist/chunk-gm67jt8p.js +2 -0
  85. package/dist/chunk-gmp10259.js +2 -0
  86. package/dist/{chunk-0sa9gqmc.js → chunk-h2tq6cbr.js} +11 -11
  87. package/dist/chunk-h3fv0q25.js +2 -0
  88. package/dist/{chunk-r09kz9bf.js → chunk-h63ma36g.js} +2 -2
  89. package/dist/chunk-hkx51atf.js +2 -0
  90. package/dist/{chunk-95hbmv7k.js → chunk-hmntqqyd.js} +7 -7
  91. package/dist/{chunk-3w7gacva.js → chunk-hxhmhw23.js} +3 -3
  92. package/dist/chunk-jghpzx5m.js +2 -0
  93. package/dist/chunk-k206d3pn.js +2 -0
  94. package/dist/chunk-k40e0ete.js +4 -0
  95. package/dist/chunk-k6c5t9we.js +38 -0
  96. package/dist/{chunk-f4vgagjb.js → chunk-kee5a3ce.js} +3 -3
  97. package/dist/chunk-kn9tqjgv.js +25 -0
  98. package/dist/chunk-kna1bdm2.js +54 -0
  99. package/dist/{chunk-a5yb8w7s.js → chunk-mygsektn.js} +3 -3
  100. package/dist/chunk-nb6erf75.js +9 -0
  101. package/dist/chunk-ngzyzcrp.js +2 -0
  102. package/dist/{chunk-3f9wctns.js → chunk-nysbdr4r.js} +2 -2
  103. package/dist/chunk-p55a910x.js +1198 -0
  104. package/dist/chunk-p6hcrg3r.js +3 -0
  105. package/dist/chunk-p746twww.js +2 -0
  106. package/dist/chunk-pa2vt2ej.js +2 -0
  107. package/dist/chunk-pa6kgbmw.js +2 -0
  108. package/dist/{chunk-saqzk45g.js → chunk-pdprhg5k.js} +1 -1
  109. package/dist/chunk-pjjrx9pk.js +2 -0
  110. package/dist/{chunk-g7qpnmbm.js → chunk-pm4rpc4a.js} +23 -23
  111. package/dist/chunk-pt3rp3zg.js +2 -0
  112. package/dist/{chunk-4517hny7.js → chunk-q1mb0fbt.js} +2 -2
  113. package/dist/{chunk-k1ew643q.js → chunk-q74affc4.js} +2 -2
  114. package/dist/chunk-qd9v1v8z.js +2 -0
  115. package/dist/chunk-qfwk93fk.js +2 -0
  116. package/dist/chunk-qg1kw5yf.js +2 -0
  117. package/dist/chunk-qn6y5ttj.js +2 -0
  118. package/dist/chunk-qxcc0aar.js +2 -0
  119. package/dist/{chunk-rzd9hyhv.js → chunk-ram5944w.js} +2 -2
  120. package/dist/{chunk-p5m1z6e1.js → chunk-rcxer2km.js} +4 -4
  121. package/dist/chunk-rdxph1tp.js +2 -0
  122. package/dist/chunk-rnrdngnn.js +2 -0
  123. package/dist/{chunk-x2ftkaz3.js → chunk-rsxxajv6.js} +2 -2
  124. package/dist/chunk-rw5sxr5a.js +2 -0
  125. package/dist/chunk-rzcdwybt.js +26 -0
  126. package/dist/chunk-s29hp1qw.js +14 -0
  127. package/dist/chunk-s7xywsqd.js +3 -0
  128. package/dist/{chunk-d6gqh2wv.js → chunk-satrf398.js} +1 -1
  129. package/dist/{chunk-zn6n075d.js → chunk-shcnt6aa.js} +3 -3
  130. package/dist/{chunk-ysfgabpf.js → chunk-sn4ndpd7.js} +3 -3
  131. package/dist/{chunk-zc8a2erc.js → chunk-ssg6ne5b.js} +4 -4
  132. package/dist/{chunk-afxfkb60.js → chunk-sv7fdqmc.js} +6 -6
  133. package/dist/chunk-swz0xprw.js +2 -0
  134. package/dist/chunk-t8r40wgf.js +2 -0
  135. package/dist/{chunk-dbvsa5ya.js → chunk-t94y8g35.js} +2 -2
  136. package/dist/{chunk-g33ycxe3.js → chunk-t9hxyvvc.js} +5 -5
  137. package/dist/{chunk-cmh0bfkb.js → chunk-tgzs1kbj.js} +5 -5
  138. package/dist/chunk-tka73egx.js +2 -0
  139. package/dist/{chunk-xtaq95em.js → chunk-v1s838fe.js} +1 -1
  140. package/dist/chunk-v3747589.js +12 -0
  141. package/dist/chunk-v9h2bbhf.js +2 -0
  142. package/dist/chunk-v9mxhch2.js +2 -0
  143. package/dist/chunk-vm42j29z.js +2 -0
  144. package/dist/chunk-w2kdhm7k.js +2 -0
  145. package/dist/chunk-w5zzwe2f.js +2 -0
  146. package/dist/chunk-wbmx0rge.js +2 -0
  147. package/dist/chunk-wjafpvjv.js +2 -0
  148. package/dist/chunk-ws2h92mm.js +3 -0
  149. package/dist/chunk-ws9kr80x.js +2 -0
  150. package/dist/{chunk-45rzd16g.js → chunk-xf0xacc9.js} +44 -44
  151. package/dist/chunk-xhr35ctb.js +2 -0
  152. package/dist/chunk-xmmr0916.js +2 -0
  153. package/dist/{chunk-yxdhz4ps.js → chunk-xpbakn6t.js} +2 -2
  154. package/dist/chunk-xz4v9tg1.js +3 -0
  155. package/dist/chunk-y7e61pz3.js +3 -0
  156. package/dist/{chunk-v0tdg16k.js → chunk-ybjgnnyf.js} +5 -5
  157. package/dist/chunk-yh2hnt3m.js +12 -0
  158. package/dist/{chunk-w6pzkcjp.js → chunk-ymqm898x.js} +2 -2
  159. package/dist/{chunk-2zaatnnh.js → chunk-yp4tn4zn.js} +4 -4
  160. package/dist/chunk-z7k1xn6k.js +2 -0
  161. package/dist/{chunk-t4g3ka8c.js → chunk-z9ffr9gy.js} +7 -7
  162. package/dist/{chunk-nnp6rf4c.js → chunk-zch65qrd.js} +1 -1
  163. package/dist/{chunk-pbakxcv8.js → chunk-zek9t5za.js} +2 -2
  164. package/dist/cli.js +23 -23
  165. package/dist/client/signals-dom-ready-runtime.js +6 -0
  166. package/dist/client/signals-mount-runtime.js +1 -1
  167. package/dist/client-module-registry.js +10 -4
  168. package/dist/client-parameter-bindings.d.ts +5 -0
  169. package/dist/client-parameter-bindings.js +47 -6
  170. package/dist/client-script-bundler.js +4 -3
  171. package/dist/component-library.d.ts +1 -0
  172. package/dist/component-library.js +42 -14
  173. package/dist/composable-loader.js +19 -9
  174. package/dist/craft-entry.js +2 -2
  175. package/dist/craft.js +2 -2
  176. package/dist/html-masking.d.ts +2 -0
  177. package/dist/html-masking.js +10 -0
  178. package/dist/inherited-context.d.ts +1 -1
  179. package/dist/inherited-context.js +43 -14
  180. package/dist/module-syntax.d.ts +2 -0
  181. package/dist/module-syntax.js +21 -0
  182. package/dist/native-component-context.js +44 -17
  183. package/dist/page-module-order.d.ts +10 -0
  184. package/dist/page-module-order.js +139 -0
  185. package/dist/process.js +6 -4
  186. package/dist/pwa.js +3 -3
  187. package/dist/script-attributes.d.ts +4 -0
  188. package/dist/script-attributes.js +10 -0
  189. package/dist/ssg.js +39 -39
  190. package/dist/strip-literals.d.ts +2 -0
  191. package/dist/strip-literals.js +12 -6
  192. package/dist/stx-virtual-ts.d.ts +1 -0
  193. package/dist/stx-virtual-ts.js +21 -27
  194. package/dist/typecheck.js +8 -0
  195. package/package.json +5 -5
  196. package/dist/chunk-003ph86a.js +0 -2
  197. package/dist/chunk-027meh1k.js +0 -2
  198. package/dist/chunk-0bc3mwqd.js +0 -2
  199. package/dist/chunk-0gv2mmr0.js +0 -2
  200. package/dist/chunk-0j8zre1m.js +0 -2
  201. package/dist/chunk-0qwbhv3f.js +0 -33
  202. package/dist/chunk-1gfg6qmr.js +0 -2
  203. package/dist/chunk-1tqp2s13.js +0 -2
  204. package/dist/chunk-1y7kfp5d.js +0 -2
  205. package/dist/chunk-1ztp5vkh.js +0 -3
  206. package/dist/chunk-24e4dapm.js +0 -2
  207. package/dist/chunk-2qb9kp21.js +0 -25
  208. package/dist/chunk-32wvc376.js +0 -2
  209. package/dist/chunk-3te2y9qf.js +0 -2
  210. package/dist/chunk-447jc6zc.js +0 -2
  211. package/dist/chunk-51ymssz5.js +0 -2
  212. package/dist/chunk-6dz5za5z.js +0 -2
  213. package/dist/chunk-6ezt9kbe.js +0 -54
  214. package/dist/chunk-6grkdknk.js +0 -2
  215. package/dist/chunk-6q9a5bph.js +0 -2
  216. package/dist/chunk-6rqef7wp.js +0 -2
  217. package/dist/chunk-72p5annm.js +0 -33
  218. package/dist/chunk-74x6j229.js +0 -4
  219. package/dist/chunk-7j11vgm1.js +0 -3
  220. package/dist/chunk-7ngfcdv9.js +0 -2
  221. package/dist/chunk-7njy024g.js +0 -2
  222. package/dist/chunk-9e3ggwk7.js +0 -2
  223. package/dist/chunk-9mz2n39m.js +0 -2
  224. package/dist/chunk-a262spx7.js +0 -2
  225. package/dist/chunk-a8wn0snv.js +0 -2
  226. package/dist/chunk-af6m1s2b.js +0 -3
  227. package/dist/chunk-b1tcym2x.js +0 -2
  228. package/dist/chunk-b61dq7pz.js +0 -12
  229. package/dist/chunk-bdh73gxd.js +0 -4
  230. package/dist/chunk-bs7g6jtt.js +0 -2
  231. package/dist/chunk-bspj1rf1.js +0 -2
  232. package/dist/chunk-bx3hpsxn.js +0 -2
  233. package/dist/chunk-byq488g4.js +0 -2
  234. package/dist/chunk-c8pzj57b.js +0 -2
  235. package/dist/chunk-e2b2f502.js +0 -2
  236. package/dist/chunk-ec6mrad6.js +0 -2
  237. package/dist/chunk-eh2gec79.js +0 -2
  238. package/dist/chunk-em31p5pb.js +0 -2
  239. package/dist/chunk-eqfsw6x4.js +0 -2
  240. package/dist/chunk-ey1vwfpc.js +0 -24
  241. package/dist/chunk-fa57bncd.js +0 -2
  242. package/dist/chunk-fk79jbzn.js +0 -2
  243. package/dist/chunk-g97krv0d.js +0 -2
  244. package/dist/chunk-gn16yq49.js +0 -2
  245. package/dist/chunk-gvs61tqn.js +0 -2
  246. package/dist/chunk-h2928108.js +0 -2
  247. package/dist/chunk-hd5bny2c.js +0 -2
  248. package/dist/chunk-j1ytbd6r.js +0 -1184
  249. package/dist/chunk-jm7qa3v3.js +0 -2
  250. package/dist/chunk-jmjgj3nh.js +0 -2
  251. package/dist/chunk-jqtpzzz4.js +0 -12
  252. package/dist/chunk-kq8mffgf.js +0 -2
  253. package/dist/chunk-kx06jzdw.js +0 -2
  254. package/dist/chunk-n344ss97.js +0 -2
  255. package/dist/chunk-n5pvdrkb.js +0 -2
  256. package/dist/chunk-ne8q191s.js +0 -2
  257. package/dist/chunk-np8wgbsa.js +0 -3
  258. package/dist/chunk-p4e8myzj.js +0 -17
  259. package/dist/chunk-pp99rmjm.js +0 -72
  260. package/dist/chunk-pqmjeea6.js +0 -2
  261. package/dist/chunk-q0k2gmva.js +0 -2
  262. package/dist/chunk-qggwr60r.js +0 -2
  263. package/dist/chunk-qm3v4qb7.js +0 -2
  264. package/dist/chunk-qrn1nza9.js +0 -2
  265. package/dist/chunk-qty0t69x.js +0 -2
  266. package/dist/chunk-rzadf7vx.js +0 -20
  267. package/dist/chunk-snz2cxqv.js +0 -2
  268. package/dist/chunk-ts37jw3s.js +0 -2
  269. package/dist/chunk-vnrbjbrw.js +0 -3
  270. package/dist/chunk-wkb7dhp7.js +0 -2
  271. package/dist/chunk-wxyqp6g9.js +0 -2
  272. package/dist/chunk-x76qvq1n.js +0 -2
  273. package/dist/chunk-y4hn1qh0.js +0 -2
  274. package/dist/chunk-yc8ggeh2.js +0 -2
  275. package/dist/chunk-ydy0tfar.js +0 -2
  276. package/dist/chunk-yfed67yc.js +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xa,bm,Co,wm,eu,tu,vm,xm}from"./chunk-ey1vwfpc.js";import"./chunk-72p5annm.js";import"./chunk-rzadf7vx.js";import"./chunk-cmh0bfkb.js";import"./chunk-mce3g2wb.js";import"./chunk-4m11kcxz.js";import"./chunk-95hbmv7k.js";import"./chunk-xtaq95em.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import{ve,yg}from"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{xa as buildScriptVirtualFile,bm as buildVirtualSource,ve as extractScriptBlocks,yg as extractTemplateExpressions,eu as findRuntimeTypeDeclarations,tu as findStxModuleDeclarations,xm as formatTypecheckDiagnostics,wm as sourcePathFor,vm as typecheckStxFiles,Co as virtualPathFor};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{N,Nn}from"./chunk-3w7gacva.js";export{Nn as stripModuleImports,N as transformStoreImports};
@@ -1,12 +0,0 @@
1
- // @bun
2
- function o(e,l){let t=e[l],i=l+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]===t)return i+1;i++}return e.length}function b(e,l){let t=l+1;while(t<e.length){if(e[t]==="\\"){t+=2;continue}if(e[t]==="`")return t+1;if(e[t]==="$"&&e[t+1]==="{"){if(t=bl(e,t+2),t<e.length)t++;continue}t++}return e.length}function bl(e,l){let t=1,i=l,s="{",f="";while(i<e.length){let r=e[i];if(r==="\\"){i+=2;continue}if(r==='"'||r==="'"){i=o(e,i),s=h,f="";continue}if(r==="`"){i=b(e,i),s=h,f="";continue}if(r==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
3
- `)i++;continue}if(r==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&e.slice(i,i+2)!=="*/")i++;i+=2;continue}if(r==="/"&&a(s,f)){let u=w(e,i);if(u!==-1){i=u,s=h,f="";continue}}if(r==="{")t++;else if(r==="}"){if(t--,t===0)return i}if(/[\w$]/.test(r))f=/[\w$]/.test(s)?f+r:r,s=r;else if(!/\s/.test(r))s=r,f="";i++}return e.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(e,l){if(l)return m.has(l);return!(e===")"||e==="]"||e===h)}var h="\x00";function w(e,l){let t=l+1,i=!1;while(t<e.length){let s=e[t];if(s===`
4
- `)return-1;if(s==="\\"){t+=2;continue}if(s==="[")i=!0;else if(s==="]")i=!1;else if(s==="/"&&!i){t++;while(t<e.length&&/[a-z]/i.test(e[t]))t++;return t}t++}return-1}function n(e){let l="",t=0,i="",s="";while(t<e.length){let f=e.slice(t,t+2);if(f==="//"){while(t<e.length&&e[t]!==`
5
- `)l+=" ",t++;continue}if(f==="/*"){while(t<e.length&&e.slice(t,t+2)!=="*/")l+=e[t]===`
6
- `?`
7
- `:" ",t++;l+=" ",t+=2;continue}let r=e[t];if(r==='"'||r==="'"){let u=r;l+=" ",t++;while(t<e.length&&e[t]!==u){if(e[t]==="\\"){l+=" ",t+=2;continue}l+=e[t]===`
8
- `?`
9
- `:" ",t++}l+=" ",t++,i=h,s="";continue}if(r==="/"&&a(i,s)){let u=w(e,t);if(u!==-1){l+=`/${" ".repeat(u-t-2)}/`,t=u,i=h,s="";continue}}if(r==="`"){l+=" ",t++;while(t<e.length&&e[t]!=="`"){if(e[t]==="\\"){l+=" ",t+=2;continue}if(e[t]==="$"&&e[t+1]==="{"){let u=t+2,g=bl(e,u);if(l+=" ",l+=n(e.slice(u,g)),g<e.length)l+=" ";t=g+1;continue}l+=e[t]===`
10
- `?`
11
- `:" ",t++}l+=" ",t++,i=h,s="";continue}if(l+=r,t++,/[\w$]/.test(r))s=/[\w$]/.test(i)?s+r:r,i=r;else if(!/\s/.test(r))i=r,s=""}return l}function se(e){let l=new Uint16Array(e.length),t=0,i=!0;for(let s=0;s<e.length;s++){let f=e[s];if(f===")"||f==="]"||f==="}")if(t===0)i=!1;else t--;if(l[s]=t,f==="("||f==="["||f==="{")t++}return{depths:l,balanced:i&&t===0}}
12
- export{bl,n,se};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{uh}from"./chunk-gqtb53s8.js";export{uh as processDeferDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cr,De}from"./chunk-mce3g2wb.js";export{cr as describeBuildFailure,De as formatBuildFailure};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qh,ey,Zf,ws}from"./chunk-88xayf21.js";import"./chunk-7j11vgm1.js";import"./chunk-dbvsa5ya.js";import"./chunk-xtaq95em.js";import{Pr}from"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import{ut}from"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{ut as freeIdentifiers,ws as processComponents,Zf as processESImports,Pr as rendersAsElement,Qh as resetMarginStackWarnings,ey as resetTemplateLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{vo,ha,Yr,xo,So,Ln,Qt,ya,Zr,Qr,ko,_o,mm,hm,bt}from"./chunk-976kgb3r.js";export{bt as DeployError,ha as calculateSha1,Yr as collectDeployFiles,Qr as createDefaultNetlifyConfig,xo as createFileManifest,vo as createNetlifyClient,mm as deploy,Zr as detectProjectConfig,So as filterRequiredFiles,Ln as formatSize,ya as generateNetlifyToml,Qt as getTotalSize,_o as hasNetlifyConfig,hm as initNetlify,ko as writeNetlifyConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qr,Kr,im,am,cm,lm,um}from"./chunk-ysfgabpf.js";export{qr as collectMessageCatalogs,am as loadPageMessages,cm as messageAreasIn,lm as pageLanguages,im as pageMessagesEnabled,um as pageMessagesScript,Kr as pathSpellings};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import i from"path";var yn=".stx",o="STX_DIR",e=null;function Uc(t){e=t?.trim()||null}function kr(){return process.env[o]?.trim()||e||yn}function l(t=process.cwd(),...n){let r=kr();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function _r(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==yn&&!n.startsWith(`${yn}/`))return t;let r=n.slice(yn.length+1);return r?i.join(kr(),r):kr()}
3
- export{yn,Uc,kr,l,_r};
@@ -1,17 +0,0 @@
1
- // @bun
2
- import R from"path";var O=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function Wr(...g){let d=new Set;for(let c of g){if(!c||!c.includes("__stxModules["))continue;for(let s of c.matchAll(O))try{d.add(JSON.parse(`"${s[1]}"`))}catch{}}return[...d].sort()}function mo(...g){let d=new Map,c=(s,e)=>{let r=d.get(s);if(r===null)return;if(e===null){d.set(s,null);return}let n=r??new Set;for(let i of e)n.add(i);d.set(s,n)};for(let s of g){if(!s||!s.includes("__stxModules["))continue;let e=[];for(let n of s.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${n[2]}"`)}catch{continue}e.push({variable:n[1],id:i,start:n.index+n[0].length,end:s.length})}let r=s.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(e.length===0||r!==e.length){for(let n of Wr(s))c(n,null);continue}for(let[n,i]of e.entries()){let p=e.slice(n+1).find((h)=>h.variable===i.variable);i.end=p?p.start:s.length}for(let n of e){let i=new Set,p=!1,h=n.variable.replace(/[$]/g,"\\$&"),o=s.slice(n.start,n.end);for(let l of o.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=o.slice(l.index+n.variable.length,l.index+n.variable.length+200),a=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(a){i.add(a[a.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}c(n.id,p?null:i)}}return d}function v(g,d,c){let s=[],e=[];return g.forEach((r,n)=>{let i=r.startsWith("npm:")?r.slice(4):R.resolve(d,r),p=`__stxRegistered${n}`,h=JSON.stringify(r),o=c?.get(r);if(o&&[...o].every((l)=>/^[A-Za-z_$][\w$]*$/.test(l))){let l=[...o].sort(),f=l.map((m,_)=>`${m} as ${p}_${_}`);s.push(l.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let a=l.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${a} };`);return}s.push(`import * as ${p} from ${JSON.stringify(i)};`),e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...s,"globalThis.__stxModules = globalThis.__stxModules || {};",...e].join(`
3
- `)}async function om(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-em31p5pb.js"),f=()=>l(s,R.join(c,".stx-module-registry.ts"),{projectRoot:c,minify:d.minify,externalizeUserModules:!1,collectInputs:d.collectInputs,throwOnFailure:!0});try{e=await f()}catch(a){if(!d.names)throw a;s=v(g,c,void 0),e=await f()}}catch(l){let{formatBuildFailure:f}=await import("./chunk-kx06jzdw.js"),a=f(l);console.warn(`[stx] could not build the page module registry (#1957): ${a}`);let m=`[stx] the page module registry did not build, so ${g.join(", ")} cannot load (#1957): ${a}`;return`;console.error(${JSON.stringify(m)});`}let{transformAutoImports:r,generateAutoImportDestructuring:n}=await import("./chunk-1tqp2s13.js"),i=r(e),p=n(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-jmjgj3nh.js");e=h(i.code);let o=JSON.stringify(new Bun.CryptoHasher("md5").update(s).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${o}]) return;`,` __stxBundles[${o}] = true;`,p,e,"})();"].join(`
4
- `)}var P=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,j=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function J(g){let d=[],c=[],s=!0,r=g.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(P,(h,o,l,f)=>{let a=`__stxChunkExports${d.length}`;if(d.push(f),c.push(`var ${a} = __stxChunk(${JSON.stringify(f)});`),l)c.push(`var ${l} = ${a};`);else if(o)for(let m of o.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){s=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){s=!1;continue}c.push(`var ${t} = ${a}[${JSON.stringify(M)}];`)}return""});if(!s)throw Error("an import it does not read");let n=[];r=r.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,o,l)=>{let f=o??l;return n.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];r=r.replace(j,(h,o)=>{for(let l of o.split(",")){let f=l.trim();if(!f)continue;let a=N.exec(f);if(!a||a[1].startsWith('"')){s=!1;continue}if(I.has(a[1]))continue;let m=a[2]??a[1];i.push([a[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(r));if(!s||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:c.join(`
5
- `),chunks:d,lazy:n,body:r,exports:i}}function Hl(g){if(/\bexport\s+(?:let|var)\b/.test(g))return!0;if(g.length/Math.max(1,g.split(`
6
- `).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function ho(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-em31p5pb.js"),r=[],n=await e(new Map(c.map((t)=>[t.name,v(t.ids,s,t.names)])),{projectRoot:s,filePath:R.join(s,".stx-module-registry.ts"),collectInputs:r});d.collectInputs?.push(...r);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-1tqp2s13.js"),{transformStoreImports:h}=await import("./chunk-jmjgj3nh.js"),o=new Map;for(let[t,u]of[...n.chunks,...n.entries])try{o.set(t,J(u))}catch(b){throw Error(`cannot read ${t}: ${b instanceof Error?b.message:String(b)}`)}for(let[t,u]of[...n.chunks,...n.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of r)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Hl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let l=new Set,f=new Set,a=(t)=>{if(f.has(t))return;if(l.has(t))throw Error(`the chunks import each other (${t})`);l.add(t);for(let u of o.get(t)?.chunks??[]){if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);a(u)}for(let u of o.get(t)?.lazy??[])if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);l.delete(t),f.add(t)};for(let t of o.keys())a(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of n.chunks.keys()){let u=o.get(t),{prelude:b,body:k}=m(u),y=u.exports.map(([S,x])=>`get ${JSON.stringify(x)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
7
- ${b}
8
- ${u.reads}
9
- ${k}
10
- return { ${y} };
11
- }`)}let w=new Map,M=new Map;for(let t of n.entries.keys()){let u=o.get(t),{prelude:b,body:k}=m(u);w.set(t,`;(function() {
12
- var __stxChunk = function (name) { return globalThis.__stxNativeRuntime.chunk(name); };
13
- ${b}
14
- ${u.reads}
15
- ${k}
16
- })();`);let y=new Set,S=(x)=>{if(y.has(x))return;y.add(x);let E=o.get(x);for(let A of[...E.chunks,...E.lazy])S(A)};for(let x of[...u.chunks,...u.lazy])S(x);M.set(t,[...y].sort())}return{chunks:_,routes:w,reads:M}}catch(e){let{formatBuildFailure:r}=await import("./chunk-kx06jzdw.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${r(e)}`),null}}
17
- export{Wr,mo,om,Hl,ho};
@@ -1,72 +0,0 @@
1
- // @bun
2
- import{Z}from"./chunk-1ztp5vkh.js";import{D}from"./chunk-yxdhz4ps.js";import Ve from"path";var t={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 ee(e){for(let[n,r]of Object.entries(t))if(r===e)return n;return}import bt from"path";var Et={showRelativePaths:!1,enableAutoRecovery:Z(),logRecoveryWarnings:!0},te={...Et};function z(){return{...te}}function j(e){if(!te.showRelativePaths||!e)return e;let n=te.baseDir||process.cwd();try{let r=bt.relative(n,e);return r.startsWith("..")?e:r}catch{return e}}class N extends Error{code;filePath;line;column;context;numericCode;constructor(e,n,r,i,s,o,a){super(e);this.code=n;this.filePath=r;this.line=i;this.column=s;this.context=o;if(this.name="StxError",this.numericCode=a||t.EVALUATION_ERROR,this.filePath)this.filePath=j(this.filePath)}}class oe extends N{constructor(e,n,r,i,s,o){super(e,"stx_RUNTIME_ERROR",n,r,i,s,o||t.EVALUATION_ERROR);this.name="StxRuntimeError"}}class Nr extends N{constructor(e,n,r,i,s,o){super(e,"stx_FILE_ERROR",n,r,i,s,o||t.FILE_NOT_FOUND);this.name="StxFileError"}}class Y extends N{isFatal=!0;constructor(e,n,r,i,s,o){super(e,"stx_VALIDATION_ERROR",n,r,i,s,o||t.DOM_API_VIOLATION);this.name="StxValidationError"}}function ve(e){let{type:n,message:r,code:i,filePath:s,line:o,column:a,template:c,offset:g,snippet:l,suggestion:h,format:f="text"}=e,y=o,x=a;if(!y&&c&&g!==void 0){let Q=Tt(c,g);y=Q.line,x=Q.column}let v=s?j(s):void 0,w=i?ee(i):void 0,R={type:n,code:i,codeName:w,message:r,filePath:v,line:y,column:x,snippet:l,suggestion:h,timestamp:new Date().toISOString()},A;switch(f){case"html":A=wt(R);break;case"json":A=JSON.stringify(R,null,2);break;case"console":A=vt(R,c,g);break;case"text":default:A=xt(R,c,g);break}return{formatted:A,data:R}}function xt(e,n,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}`),n&&e.line){let o=St(n,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 wt(e){let n=e.code?` [${e.code}]`:"",r=e.filePath?` in ${e.filePath}${e.line?`:${e.line}`:""}`:"",i=`<!-- [${e.type} Error${n}]${r}: ${we(e.message)}`;if(e.suggestion)i+=` | Suggestion: ${we(e.suggestion)}`;return i+=" -->",i}function vt(e,n,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}`),n&&e.line){let f=kt(n,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 St(e,n,r){let i=e.split(`
16
- `),s=Math.max(0,n-r-1),o=Math.min(i.length-1,n+r-1),a=[];for(let c=s;c<=o;c++){let g=(c+1).toString().padStart(4),l=c===n-1?">":" ";a.push(`${l}${g} | ${i[c]}`)}return a.join(`
17
- `)}function kt(e,n,r){let i=e.split(`
18
- `),s=Math.max(0,n-r-1),o=Math.min(i.length-1,n+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===n-1,x=y?"\x1B[31m>\x1B[0m":" ",v=y?`\x1B[31m${i[h]}\x1B[0m`:`\x1B[90m${i[h]}\x1B[0m`;l.push(`${x}\x1B[90m${f}\x1B[0m | ${v}`)}return l.join(`
19
- `)}function we(e){return e.replace(/--/g,"- -").replace(/>/g,"&gt;")}function Tt(e,n){let i=e.substring(0,n).split(`
20
- `);return{line:i.length,column:i[i.length-1].length}}function u(e,n,r){return ve({type:e,message:n,code:r,format:"html"}).formatted}async function Ae(e,n,r){try{return await e()}catch(i){if(r&&i instanceof Error)r(i);return n}}var Bi={isEnabled(){return z().enableAutoRecovery},fixCommonSyntaxErrors(e){let n=z();if(!n.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&&n.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,n){if(Z())return`<!-- ${e} failed: ${n.message} -->`;return"<!-- stx rendering error -->"}};class ne{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,n,r="error"){let i={timestamp:new Date,error:e,context:n,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 n=[`[${e.timestamp.toISOString()}] [${(e.level||"error").toUpperCase()}] ${e.error.constructor.name}: ${e.error.message}`];if(e.error.stack)n.push(` Stack: ${e.error.stack.split(`
22
- `).slice(1).join(`
23
- `)}`);if(e.context)n.push(` Context: ${JSON.stringify(e.context)}`);return n.join(`
24
- `)}writeToFile(e){this.writeQueue=this.writeQueue.then(async()=>{try{let n=await import("fs"),r=await import("path"),i=r.dirname(this.logFilePath);if(!n.existsSync(i))n.mkdirSync(i,{recursive:!0});await this.rotateIfNeeded(n);let s=`${this.formatEntry(e)}
25
- `;n.appendFileSync(this.logFilePath,s,"utf-8")}catch(n){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",n)}})}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(n){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",n)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((n)=>n.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((n)=>n.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={},n={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";n[s]=(n[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:n}}async exportToFile(e,n="json"){let r=await import("fs"),i=await import("path"),s=i.dirname(e);if(!r.existsSync(s))r.mkdirSync(s,{recursive:!0});if(n==="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 W=new ne,An={isDevelopment(){return Z()},logDetailedError(e,n){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),n)console.error("Context:",n);console.error("========================")},createErrorReport(e,n){let r=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(n)r.push(`Context: ${JSON.stringify(n,null,2)}`);return r.push("========================"),r.join(`
28
- `)}};function k(e,n,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===n)s++;else if(l===r){if(s--,s===0)return o}o++}return-1}function vl(e,n){let r=n,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(n,r),endPos:r}}class P{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?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 n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let r=this.options?this.options.sizeOf(n):0;if(this.options&&r>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+r>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,r),this.bytes+=r}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,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 M=new Map,Rt=500;function Vt(e,n){if(n?.includes("g"))return new RegExp(e,n);let r=`${e}:${n||""}`;if(!M.has(r)){if(M.size>=Rt){let i=M.keys().next().value;if(i)M.delete(i)}M.set(r,new RegExp(e,n))}return M.get(r)}class ke{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),r=n.sort().join(","),i=this.pool.find((c)=>c.context.join(",")===r);if(i)return i.func;let s=this.fnCache,o=this.fnCacheMaxSize,a=(...c)=>(g)=>{try{let l=`${r}:${g}`,h=s.get(l);if(!h){if(s.size>=o){let f=s.keys().next().value;if(f)s.delete(f)}h=Function(...n,`
29
- 'use strict';
30
- try {
31
- return ${g};
32
- }
33
- catch (e) {
34
- if (e instanceof ReferenceError || e instanceof TypeError) {
35
- return undefined;
36
- }
37
- throw e;
38
- }
39
- `),s.set(l,h)}return h(...c)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:n.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var ar=new ke;class Te{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,n){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...n})}setBudgets(e){for(let[n,r]of Object.entries(e))this.setBudget(n,r)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[n,r]of this.budgets.entries())e[n]=r;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let n=this.violationHandlers.indexOf(e);if(n!==-1)this.violationHandlers.splice(n,1)}time(e,n){if(!this.enabled)return n();let r=performance.now(),i=n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}async timeAsync(e,n){if(!this.enabled)return n();let r=performance.now(),i=await n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}checkBudget(e,n){let r=this.budgets.get(e);if(!r)return;let i=n/r.maxTime*100,s=r.warnThreshold!==void 0?n>=r.maxTime*r.warnThreshold&&n<r.maxTime:!1,o=n>=r.maxTime;if(!s&&!o)return;let a={label:e,actualTime:n,budgetTime:r.maxTime,exceedancePercent:i,timestamp:new Date,isWarning:s};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let g of this.violationHandlers)try{g(a)}catch{}let c=s?`[Performance Warning] "${e}" took ${n.toFixed(2)}ms (${i.toFixed(1)}% of ${r.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${n.toFixed(2)}ms (exceeded ${r.maxTime}ms budget by ${(i-100).toFixed(1)}%)`;switch(r.action){case"log":console.log(c);break;case"warn":console.warn(c);break;case"error":console.error(c);break;case"throw":if(o)throw Error(c);else console.warn(c);break}}recordTime(e,n){let r=this.metrics.get(e);if(r)r.count++,r.totalTime+=n,r.maxTime=Math.max(r.maxTime,n),r.minTime=Math.min(r.minTime,n);else this.metrics.set(e,{count:1,totalTime:n,maxTime:n,minTime:n})}getStats(e){if(e){let r=this.metrics.get(e);if(!r)return{};let i=this.budgets.get(e);return{count:r.count,avgTime:r.totalTime/r.count,totalTime:r.totalTime,maxTime:r.maxTime,minTime:r.minTime,budget:i?.maxTime,budgetUtilization:i?r.totalTime/r.count/i.maxTime*100:void 0}}let n={};for(let[r,i]of this.metrics.entries()){let s=this.budgets.get(r);n[r]={count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:s?.maxTime,budgetUtilization:s?i.totalTime/i.count/s.maxTime*100:void 0}}return n}getViolations(e){if(e)return this.violations.filter((n)=>n.label===e);return[...this.violations]}getViolationStats(){let e={},n=0,r=0;for(let i of this.violations)if(e[i.label]=(e[i.label]||0)+1,i.isWarning)n++;else r++;return{total:this.violations.length,byLabel:e,warnings:n,errors:r}}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 re=null;function $t(){if(!re)re=new Te;return re}var me=new Proxy({},{get(e,n){return $t()[n]}});var Se=0;async function E(){if(performance.now()-Se<16)return;await new Promise((e)=>setTimeout(e,0)),Se=performance.now()}var Ct={maxSanitizeDepth:10,allowBracketNotation:!1},Me={...Ct};var U=/\bnew\s+/,V="__stx_safe_ctors",Ne=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ie=[...Ne,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],Re=ie.map(()=>{return}),se=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})),ce=[/\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*\(/,U,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],le=new Set([...Ne,"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",V]),ue=new Set(["__proto__","constructor","prototype"]);function De(e){let n="",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)n+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}n+=a,r.push(o)}return{text:n,map:r}}function Fe(e){return De(e).text}var ze=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],je=(()=>{let e={Date,URL,URLSearchParams},n=Intl;for(let r of ze)if(typeof n[r]==="function")e[`Intl_${r}`]=n[r];return Object.freeze(Object.assign(Object.create(null),e))})(),At=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,$e=/(?<![\w$])new(?![\w$])/g,Ce=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${ze.join(",")}}() are allowed`;function _t(e){let{text:n,map:r}=De(e),i=[];$e.lastIndex=0;let s;while((s=$e.exec(n))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(n.slice(0,a)))continue;let c=At.exec(n.slice(a)),g=c?.[3],l=!c?null:g?`Intl_${g}`:c[2];if(!c||!l||!(l in je))throw new S(`matched /${U.source}/; ${Ce}`,e);let h=a+c[0].length,f=r[a],y=r[h-1]+1;if(e.slice(f,y)!==n.slice(a,h))throw new S(`matched /${U.source}/; ${Ce}`,e);let x=f+3+c[1].length;i.push({start:x,end:x+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)}${V}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,n,r){super(r??`Potentially unsafe expression (${e}): ${n}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=n}}function no(e){try{return ge(e),null}catch(n){return n instanceof S?n.rule:n instanceof Error?n.message:String(n)}}function Be(e,n){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(le.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,n);if(o==="."&&ue.has(s))throw new S(`matched /.${s}/; property ${s}`,n)}}function He(e,n=!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(ue.has(f))throw new S(`bracket key ${f}`,e);if(!Me.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(n&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function ge(e){let n=e.trim(),r=Fe(n);Be(r,n);let i=He(n);for(let s of ce){if(s===U)continue;if(s.test(r))throw new S(`matched /${s.source}/`,n)}return{..._t(n),dynamicKeys:i}}function ji(e){return ge(e),e.trim()}var ro=Symbol("stx.sanitizeCache"),It=4000,B=new Map;function Ot(e){let n=B.get(e);if(n===void 0){if(n=ce.some((r)=>r.test(e)),B.size>=It)B.clear();B.set(e,n)}return n}function K(e){let n={},r=e[ro];n.Math=Math,n.JSON=JSON,n.Date=Date,n.String=String,n.Number=Number,n.Boolean=Boolean,n.Array=Array,n.Object=se,n.parseInt=Number.parseInt,n.parseFloat=Number.parseFloat,n.isNaN=Number.isNaN,n.isFinite=Number.isFinite,n.encodeURIComponent=encodeURIComponent,n.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||Ot(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=ae(s),r?.set(s,o);n[i]=o}else n[i]=s}return n}function ae(e,n=0){if(n>=Me.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>ae(i,n+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]=ae(s,n+1);else r[i]=s}return r}function d(e,n){try{let r=K(n),i=Object.keys(r),s=Object.values(r);return p(e,i)(...s)}catch{return}}function m(e){try{return ji(e),!0}catch{return!1}}function wl(e,n){try{let r=K(n),i=Object.keys(r),s=Object.values(r),o=!1,c=p(e,i,()=>{o=!0})(...s);return!o&&Boolean(c)}catch{return!1}}function O(e,n){try{let r=d(e,n);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var Ue=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"]),_e=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,Pt=0,Lt=0;function Mt(e,n){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=_e;for(let s=0;s<16;s++){let o=`c${++Pt}`,a=`'use strict';if(${r}===${JSON.stringify(_e)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+n);if(c(...i)===o)return c;Lt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var Nt=2000,H=new Map;function Ie(e,n){let r=`${e.join(",")}\x00${n}`,i=H.get(r);if(i)return i;let s=Mt(e,n);if(H.size>=Nt)H.clear();return H.set(r,s),s}function ut(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 Dt=/^[A-Za-z_$][\w$]*$/;function Ut(e){return Dt.test(e)&&!Ue.has(e)}var Oe=new P(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function p(e,n,r){let i=JSON.stringify([e,n]),s=Oe.get(i);if(!s)s=Ft(e,[...n]),s.sourceBytes+=i.length*2,Oe.set(i,s);return zt(jt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Ft(e,n){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=ge(e),o=[];for(let f=0;f<n.length;f++){if(!Ut(n[f]))continue;if(n[f]===V||n[f]==="Object"||le.has(n[f]))continue;o.push({key:n[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=`
40
- 'use strict';
41
- try {
42
- return ${r};
43
- }
44
- catch (e) {
45
- if (e instanceof TypeError) {
46
- return undefined;
47
- }
48
- throw e;
49
- }
50
- `,l=i?(f)=>{let y=Ie([V,"Object",...ie,...a,...f],g);return(...x)=>y(je,se,...Re,...x)}:(f)=>{let y=Ie(["Object",...ie,...a,...f],g);return(...x)=>y(se,...Re,...x)},h=l([]);return{sourceBytes:e.length*2+n.reduce((f,y)=>f+y.length*2,0),contextKeys:n,filteredKeys:a,validEntries:o,validIndices:c,dynamicKeys:s,buildFunc:(f)=>f.length===0?h:l(f)}}function zt(e,n,r){if(r.length===0)return e;let i=r.map((s)=>n.indexOf(s));return(...s)=>{for(let o of i){if(o<0)continue;let a=s[o];if(typeof a==="string"&&ue.has(a))return}return e(...s)}}function jt(e,n,r,i,s,o){let a=e([]),c=i.every((l,h)=>l.index===h);if(n.length===r.length&&c)return Le(a,n,e,void 0,o);return Le((...l)=>{let h=Array(s.length);for(let f=0;f<s.length;f++)h[f]=l[s[f]];return a(...h)},n,e,(l)=>{a=e(l)},o)}function Le(e,n,r,i,s){let a=/^(\w+) is not defined$/,c=e,g=[],l=new Set(n);return(...h)=>{for(let f=0;f<=8;f++)try{return c(...h)}catch(y){let x=y instanceof Error?y.message:"",v=a.exec(x);if(!(y instanceof ReferenceError)||!v)return;let w=v[1];if(l.has(w)||Ue.has(w)||le.has(w))return;if(s?.(w),l.add(w),g.push(w),i)i(g);else c=r(g)}return}}function so(e){let n=e.trim();try{let r=Fe(n);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;Be(r,n),He(n);for(let i of ce)if(i.test(r))return!1}catch{return!1}return!0}function Fi(e,n){let r=[];n.lastIndex=0;let i;while((i=n.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))}),n.lastIndex=o+1;continue}r.push({start:s,end:a+1,args:e.slice(o+1,a),call:e.slice(s,a+1)}),n.lastIndex=a+1}return r}function Wt(e,n,r,i){let s="",o=0;for(let a of Fi(e,n)){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 qt(e){let n=[],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){n.push(s.trim()),s="";continue}s+=a}if(s.trim())n.push(s.trim());return n}function de(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let i="";for(let s=1;s<n.length-1;s++){let o=n[s];if(o==="\\"&&s+1<n.length-1){let a=n[++s];i+=a==="n"?`
51
- `:a==="t"?"\t":a;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[s+1]==="{")return null;i+=o}return i}var Bt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Kt(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let i=no(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:t.UNSAFE_EXPRESSION};let s=K(n),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:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(ut(r))].filter((c)=>!Bt.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:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function Ge(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 dt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function We(e){if(!e)return"";return Ve.isAbsolute(e)?Ve.relative(process.cwd(),e)||e:e}function pe(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function F(e,n,r,i,s=t.EVALUATION_ERROR){let o=i?` in ${We(i)}`:"";return console.warn(`[stx] ${pe(n)}${o}: ${r}`),u(e,`${pe(n)}: ${r}`,s)}function oo(e,n,r){let i=r?` in ${We(r)}`:"";console.warn(`[stx] ${pe(e)}${i}: ${n}`)}function zi(){return{afterOpen:[],beforeClose:[]}}function Ht(e){return e.afterOpen.length>0||e.beforeClose.length>0}function xl(e,n){if(!Ht(n))return e;let r=n.afterOpen.join(""),i=n.beforeClose.join(""),s=D(e),o=r?Dr(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 Ke=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Dr(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return null;let r=n.index+n[0].length;Ke.lastIndex=r;let i=Ke.exec(e);return i?r+i[0].length:r}var he="data-stx-color-mode-boot",qe="__STX_COLOR_MODE__",Xt=new Set(["light","dark","auto","system"]),Gt=new Set(["auto","system"]),Yt=/^[a-z][\w:-]*$/i,Jt=/^[\w-]+$/;function Zt(e){let n=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 n!=="string"||n.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Xt.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"||!Jt.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"||!Yt.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!Gt.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:n,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Qt(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ye(e={}){let n=Zt(e),r=Qt(n),i=`(function(){"use strict";var o=window.${qe};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.${qe}={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 ${he}>${i}</script>`}function Mr(e,n={}){if(e.includes(he))return e;let r=fe(e);if(r===null)return e;let i=ye(n);return`${e.slice(0,r)}
52
- ${i}${e.slice(r)}`}var fe=Dr,en=new RegExp(`<script\\b[^>]*\\b${he}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),Ye=/<meta\b[^>]*\bcharset\b[^>]*>/gi,Je=/<\/head>/gi;function tn(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return e;let r=n.index+n[0].length;Je.lastIndex=r;let i=Je.exec(e),s=i?i.index:e.length;Ye.lastIndex=r;let o=Ye.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)}
53
- ${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function Sl(e){return nn(tn(e))}function nn(e){let n=en.exec(e);if(!n)return e;let r=fe(e);if(r===null)return e;if(n.index<=r||e.slice(r,n.index).trim()==="")return e;let i=e.slice(0,n.index)+e.slice(n.index+n[0].length),s=fe(i);if(s===null)return e;return`${i.slice(0,s)}
54
- ${n[0]}${i.slice(s)}`}var rn="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",et=`<style data-stx-cloak>[x-cloak]{display:none !important}${rn}</style>`,X="data-stx-html-attrs",q="data-stx-html-class",tt=/^[A-Za-z_:][\w:.-]*$/;function T(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function sn(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function pt(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 on(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let i of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function _(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,i])=>`${r}="${T(String(i))}"`).join(" ")}function G(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function nt(e){let n=_(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${G(e)}</script>`}function an(e={},n="en"){let r=[],i=[],s="",o=n;for(let[c,g]of Object.entries(e||{})){if(g==null)continue;let l=c.trim();if(!tt.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}="${T(String(g))}"`),i.push(l)}let a=` lang="${T(o)}"`;if(s)a+=` class="${T(s)}"`;if(a+=r.join(""),s)a+=` ${q}="${T(s)}"`;if(i.length)a+=` ${X}="${T(i.join(" "))}"`;return a}function kl(e={},n={}){let r={...e,...n};if(e.class&&n.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of n.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Lr(e,n={}){if(!n||Object.keys(n).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(n)){if(f==null)continue;let y=h.trim();if(!tt.test(y))continue;let x=y.toLowerCase();if(x==="class"){let v=(i.class||"").split(/\s+/).filter(Boolean);for(let w of String(f).split(/\s+/).filter(Boolean))if(!v.includes(w))v.push(w),c.push(w);if(!("class"in i))s.push("class");i.class=v.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(f),x!=="lang")g.push(y)}if(c.length){if(!(q in i))s.push(q);i[q]=c.join(" ")}if(g.length){if(!(X in i))s.push(X);i[X]=g.join(" ")}let l=s.map((h)=>` ${h}="${T(i[h])}"`).join("");return e.replace(r[0],()=>`<html${l}>`)}function _l(e){if(e.includes("data-stx-cloak"))return null;if(D(e)===-1)return null;return`${et}
55
- `}function cn(e){let n=[],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){n.push(g[0]),r+=g[0].length;continue}let l=o.match(/^<meta\b[^>]*>/i);if(l){n.push(l[0]),r+=l[0].length;continue}let h=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(h){n.push(h[0]),r+=h[0].length;continue}break}if(n.length===0)return{body:e,hoisted:n};let i="",s=0;while(s<e.length&&s<r){let o=e.slice(s),a=o.match(/^<link\b[^>]*>/i);if(a&&n.includes(a[0])){s+=a[0].length;continue}let c=o.match(/^<meta\b[^>]*>/i);if(c&&n.includes(c[0])){s+=c[0].length;continue}let g=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(g&&n.includes(g[0])){s+=g[0].length;continue}i+=e[s],s++}return i+=e.slice(r),{body:i,hoisted:n}}function ln(e,n={},r={}){let{title:i="stx App",lang:s="en",meta:o=[],link:a=[],script:c=[],headRaw:g="",htmlAttrs:l={},bodyClass:h="",bodyAttrs:f={}}=n,y=r.title||i,x=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],v=new Set(o.map(pt).filter(Boolean)),{body:w,hoisted:R}=cn(e),A=new Set(R.flatMap((b)=>{let L=on(b);return L?[pt(L)].filter(Boolean):[]})),at=[...x.filter((b)=>!v.has(pt(b))),...o].filter((b)=>!A.has(pt(b))).map((b)=>` <meta ${_(b)}>`).join(`
56
- `),ct=a.map((b)=>` <link ${_(b)}>`).join(`
57
- `),lt=c.map((b)=>{if(b.src)return` <script ${_(b,(L)=>L==="content")}></script>`;if(b.content)return` ${nt(b)}`;return""}).filter(Boolean).join(`
58
- `),gt=an(l,s),ft=Object.entries(f).map(([b,L])=>` ${b}="${T(String(L))}"`).join(""),mt=h?` class="${T(h)}"`:"",ht=[at,r.colorMode?` ${ye(r.colorMode)}`:"",` <title>${r.titleIsHtml?y:sn(y)}</title>`,` ${et}`,ct,lt,g?` ${g}`:"",...(r.styles||[]).map((b)=>` ${b}`),...R.map((b)=>` ${b}`),...(r.headScripts||[]).map((b)=>` ${b}`),r.headStack||""].filter(Boolean),yt=[w,...(r.bodyScripts||[]).map((b)=>b),r.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
59
- <html${gt}>
60
- <head>
61
- ${ht.join(`
62
- `)}
63
- </head>
64
- <body${mt}${ft}>
65
- ${yt.join(`
66
- `)}
67
- </body>
68
- </html>`}var be=/\s+/y,Ee=/<(script|style)\b[^>]*>/iy,un=/<\/script>/gi,gn=/<\/style>/gi,Ze=/<!DOCTYPE\b/iy,Qe=/<html[\s>]/iy;function Pn(e){let n=0;while(n<e.length){if(be.lastIndex=n,be.exec(e)){n=be.lastIndex;continue}if(e.startsWith("<!--",n)){let s=e.indexOf("-->",n);if(s===-1)return!1;n=s+3;continue}Ee.lastIndex=n;let i=Ee.exec(e);if(i){let s=i[1].toLowerCase()==="script"?un:gn;s.lastIndex=Ee.lastIndex;let o=s.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(Ze.lastIndex=n,Ze.test(e))return!0;return Qe.lastIndex=n,Qe.test(e)}return!1}function Hi(e){return Pn(e)}function Cl(e,n={}){let r=D(e);if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=n,c=e.slice(0,r),g=[];for(let l of i){let h=pt(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(G(l)))continue;g.push(` ${nt(l)}`)}if(a&&!c.includes(a))g.push(` ${a}`);if(g.length===0)return e;return`${e.slice(0,r)}${g.join(`
69
- `)}
70
- ${e.slice(r)}`}function jr(e,n={},r={},i){if(i??Hi(e))return e;return ln(e,n,r)}var pn=["og:","article:","book:","profile:","fb:","music:","video:"],dn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Br(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=fn(e[0],n);if(typeof r!=="string")return r;let i;if(e.length===2){let o=mn(e[1],n);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=n.openGraph,c=n[o]??(dt(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:pn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function fn(e,n){let r=de(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(dn.test(e.trim()))return e.trim();let i=Kt(e,n);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 ${Ge(i.value)}`,code:t.TYPE_ERROR};return i.value}function mn(e,n){let r=de(e);if(r!==null)return r;let i=Kt(e,n);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 ${Ge(s)}`,code:t.TYPE_ERROR};return String(s)}var Fr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],io=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],st={links:"link",metas:"meta",scripts:"script",styles:"style"},rt=new Set,it=new WeakMap;function xe(e){if(rt.has(e))return;rt.add(e),console.warn(e)}function hn(e,n){let r=Array.from({length:n.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<=n.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===n[o-1]?0:1)),s=a}}return r[n.length]}function yn(e,n){let r=e.toLowerCase(),i=n.find((g)=>g.toLowerCase()===r);if(i)return i;let s=st[r];if(s&&n.includes(s))return s;let o,a=1/0;for(let g of n){let l=hn(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 Pe(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=it.get(e);if(r)return r;let{known:i,source:s}=n,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=st[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],xe(`[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")){xe(`[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=yn(a,i);xe(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 it.set(e,o),o}var C={},bn=[],J={};function Vi(){return C}function ky(){return J}function _y(){C={},bn.length=0,J={}}function El(e){C=Xe(C,Pe(e,{known:io,source:"useHead()"}))}function ot(e,n,r){let i=[...e||[]];for(let s of n||[]){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 Xe(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:ot(e.meta,n.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:ot(e.link,n.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function Fg(e){El(ao(e))}function ao(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let g=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:g})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(i)n.push({property:"og:description",content:i});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.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)n.push({name:"twitter:card",content:e.twitterCard});if(s)n.push({name:"twitter:title",content:s});if(o)n.push({name:"twitter:description",content:o});if(a){n.push({name:"twitter:image",content:a});let g=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(g)n.push({name:"twitter:image:alt",content:g})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let g of e.articleTags)n.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:n,link:c}}function Cy(e){if(J={...J,...e},e.title||e.description)Fg({title:e.title,description:e.description})}function Ey(e){let n=typeof e==="function"?e():e;El({title:n})}function Ty(e=C){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");n.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(" ");n.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(" ");n.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)n.push(`<script ${o}>${G(r)}</script>`);else n.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";n.push(`<style${i}>${r.content}</style>`)}return n.join(`
71
- `)}function $y(e=C){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function Ry(e=C){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ay(e=C){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),n.name)i.setAttribute("name",n.name);if(n.property)i.setAttribute("property",n.property);document.head.appendChild(i)}i.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(n))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function Py(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(n+=s.trim()+`
72
- `,"")),headContent:n.trim()}}function Iy(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:n[(o||"").trim()]??o,c=n.__stx_runtime_head??{};return n.__stx_runtime_head=Xe(c,{title:a}),""})}function Oy(e,n,r=""){if(!e.includes("@meta"))return e;return Wt(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=Br(qt(i),n);if(o.kind==="error")return F("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=n.__stx_runtime_head??{};n.__stx_runtime_head=Xe(a,{meta:[o.tag]})}return""},(i)=>F("Meta",i,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{P,Vt,me,E,no,ji,ro,d,m,wl,O,ut,Ut,p,so,t,oe,Nr,Y,u,Ae,Bi,W,An,k,vl,Fi,Wt,qt,Kt,Ge,dt,F,oo,zi,xl,Dr,Mr,Sl,pt,kl,Lr,_l,Pn,Hi,Cl,jr,Br,Fr,io,Pe,Vi,ky,_y,El,Xe,Fg,ao,Cy,Ey,Ty,$y,Ry,Ay,Py,Iy,Oy};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qi,ea,ta,nm,na,ra,rm,sa,oa,zl,sm}from"./chunk-zn6n075d.js";export{Qi as VideoProcessorCache,zl as analyzeVideo,nm as clearVideoCache,oa as generateDASHManifest,sa as generateHLSManifest,na as generatePoster,rm as generateSpriteSheet,ra as generateThumbnails,ea as getCachedVideoResult,sm as processVideo,ta as setCachedVideoResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gm}from"./chunk-3f9wctns.js";import"./chunk-0qwbhv3f.js";import"./chunk-qvrew79n.js";import"./chunk-cmh0bfkb.js";import"./chunk-7j11vgm1.js";import"./chunk-95hbmv7k.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{gm as startProductionServer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{lo,Ki,Vg,Ug,Wg}from"./chunk-ft6em3wm.js";import"./chunk-pk714ynv.js";export{Ug as generateManifestLink,lo as generatePwaTags,Vg as generateSwRegistrationScript,Wg as generateThemeColorMeta,Ki as injectPwaTags};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ie,ae,ce,Hn,Se,Ne,ts,au,vt,tn,Vn,Un,Wn,le,qn,Kn,ns}from"./chunk-k1ew643q.js";import"./chunk-f4vgagjb.js";export{ae as DEFAULT_FORMATS,ce as DEFAULT_QUALITY,ie as DEFAULT_WIDTHS,ns as ImageProcessingError,Kn as formatSize,tn as generateSizes,vt as generateSrcSet,Vn as getFallbackVariant,ts as getImageMetadata,le as getMimeType,qn as getTotalSize,Un as groupVariantsByFormat,Se as isImageBackendAvailable,Wn as isImageFile,Hn as isSharpAvailable,Ne as processImage,au as resizeAndConvert};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Go,Xo,Jo,Yh,bs,Zh}from"./chunk-88xayf21.js";export{bs as clearImageDeliveryCatalog,Yh as deliveredImage,Jo as efficientDeliverySources,Go as getImageDelivery,Xo as isTransparentImage,Zh as prepareImageDelivery};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ql,ba,Kl,Gl,wa,Xl,Jl,Yl,Zl,va,Ql,ym}from"./chunk-mw0rb1sf.js";import{$a,ru}from"./chunk-4517hny7.js";import{ie,ae,ce,Hn,Se,Ne,ts,vt,tn,Vn,Un,Wn,le,qn,Kn,ns}from"./chunk-k1ew643q.js";import{cu}from"./chunk-kywe0f1v.js";import"./chunk-f4vgagjb.js";export{ae as DEFAULT_FORMATS,ce as DEFAULT_QUALITY,ie as DEFAULT_WIDTHS,ns as ImageProcessingError,Gl as clearImageCache,wa as createImageDirective,ru as createImageHandler,Jl as createImagePlugin,ym as defaultImageConfig,Kn as formatSize,va as generateImageManifest,tn as generateSizes,vt as generateSrcSet,Vn as getFallbackVariant,ts as getImageMetadata,le as getMimeType,qn as getTotalSize,Un as groupVariantsByFormat,$a as handleImageRequest,Xl as imageDirective,Se as isImageBackendAvailable,Wn as isImageFile,Hn as isSharpAvailable,Zl as optimizeDirectory,Yl as optimizeImage,ba as parseImageComponent,Ne as processImage,Kl as processImageComponents,ql as renderImageComponent,cu as rewriteImagesWithSiblings,Ql as writeImageManifest};
@@ -1,20 +0,0 @@
1
- // @bun
2
- import{cr,De}from"./chunk-mce3g2wb.js";import{K,S,Er,Us,T}from"./chunk-j1ytbd6r.js";import{a,M}from"./chunk-6az66mrc.js";import{Uo}from"./chunk-cmh0bfkb.js";import{ct}from"./chunk-75v0yxeh.js";import{l}from"./chunk-np8wgbsa.js";import{n,se}from"./chunk-jqtpzzz4.js";import d from"path";import j from"fs";import{AsyncLocalStorage as ot}from"async_hooks";import{randomUUID as bt}from"crypto";var $t=11;function J(t,e,s){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||Uo(t,e,s)}var at=2;function Lf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):l(t,"bundle-cache")}function nt(t,e){let s=t;for(let i of wt(e))if(i!==d.sep)s=s.split(i).join("\x00root");return s}var st=new Map;function wt(t){let e=d.resolve(t),s=st.get(e);if(!s){let i=e;try{i=j.realpathSync(e)}catch{}s=[...new Set([e,i])].sort((c,p)=>p.length-c.length),st.set(e,s)}return s}function St(t,e){try{let s=j.statSync(t),i=d.resolve(e),c=t.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,t):t,...c?{inRoot:!0}:{},mtimeMs:s.mtimeMs,size:s.size,hash:Bun.hash(j.readFileSync(t)).toString(36)}}catch{return null}}function lt(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function vt(t,e){for(let s of t){let i=lt(s,e);try{let c=j.statSync(i);if(c.size!==s.size)return!1;if(c.mtimeMs!==s.mtimeMs&&Bun.hash(j.readFileSync(i)).toString(36)!==s.hash)return!1}catch{return!1}}return!0}var ut=new Map,Bt=100;function jf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function jt(t){let e=G.get(t)??0;if(e>0&&e<Bt){G.set(t,e+1);return}G.set(t,1);try{let s=(await j.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=jf();if(s.length<=i)return;let p=(await Promise.all(s.map(async(o)=>{try{return{name:o,at:(await j.promises.stat(d.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,b)=>b.at-o.at);for(let o of p.slice(i)){let b=o.name.slice(0,-3);await j.promises.rm(d.join(t,`${b}.js`),{force:!0}),await j.promises.rm(d.join(t,`${b}.deps.json`),{force:!0})}N("pruned bundle cache to",i,"entries")}catch{}}function ke(t){return ut.get(t)??[]}function q(t,e){if(t)ut.set(t,e)}function Bf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function N(...t){if(Bf())console.log("[stx:bundler]",...t)}var Y=[];function mc(t,e,s){Y.push({filePath:t||"<inline>",message:e,details:s})}function cn(){return Y.slice()}function ln(){Y.length=0}var Z;function Vh(t){Z=t}function hc(){if(Z)return Z;try{let t=M.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function un(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,s;while((s=e.exec(t))!==null){let c=s[1];if(!Q.some((o)=>o.test(c)))return N("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((s=i.exec(t))!==null){let c=s[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!Q.some((o)=>o.test(c)))return N("detected side-effect import:",c),!0}return!1}var ar="stx-module:",Et=/\.(?:[cm]?[jt]sx?|json)$/i;function Ff(t,e){return d.relative(t,e).split(d.sep).join("/")}function zf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(s,i,c,p)=>{let o=e.get(p);return o&&!p.startsWith(ar)?`${i}${c}${o}${c}`:s})}function Hf(t,e){let s=0,i=(p)=>{let o=`__stxMod${s++}`,b=JSON.stringify(p);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let b of p.split(",")){let C=b.trim();if(!C)continue;let R=C.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!R)continue;let w=R[1].startsWith('"')?JSON.parse(R[1]):R[1],f=R[2]??w;e.push(`var ${f} = ${o}[${JSON.stringify(w)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,b)=>{let C=b.slice(ar.length),R=i(C),w=o.trim(),f=w.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!w.startsWith("{")&&!w.startsWith("*"))e.push(`var ${f[1]} = ${R}.default;`),w=w.slice(f[0].length).trim();let v=w.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${R};`);else if(w.startsWith("{"))c(w.replace(/^\{|\}$/g,""),R);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(ar.length)),"")),t}function rt(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,d.join(t,"index.ts"),d.join(t,"index.tsx"),d.join(t,"index.js"),d.join(t,"index.mjs")];for(let s of e)try{if(j.existsSync(s)&&j.statSync(s,{throwIfNoEntry:!1})?.isFile())return s}catch{}return}var X=new ot;function ps(t,e){let s=new Bun.CryptoHasher("md5");for(let[i,c]of[...t].sort(([p],[o])=>p<o?-1:p>o?1:0))s.update(`${i}\x00${c}\x00`);return X.run({modules:t,key:s.digest("hex").slice(0,12)},e)}var dt=new ot;function Vf(t){return dt.run(!0,t)}function Uf(){return dt.getStore()===!0}function yc(t){if(!Uf())return;throw Error(`The client script of ${t} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function dn(){return X.getStore()?.key??""}function pt(t,e,s,i,c,p,o=new Map,b,C,R){let w=new Map([[s,i],...R??[]]),f=(B)=>B!==void 0&&w.has(B),v=(B,r,u)=>{if(J(r,t,b))return null;if(!p||!f(B)||!Et.test(r))return null;try{if(!j.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(r);let E=`${ar}${Ff(process.cwd(),r)}`;return o.set(u,E),{path:E,external:!0}},y=(B,r)=>{let u=f(B)?e:d.dirname(B),E=d.resolve(u,r);return rt(E)??E};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=rt(r.path);if(u){let E=v(r.importer,u,r.path);if(E)return E;if(!f(u))c.add(u);return{path:u}}return{path:r.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(r)=>{let u=y(r.importer,r.path),E=v(r.importer,u,r.path);if(E)return E;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(r)=>{let u=d.resolve(t,r.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let h of E)if(j.existsSync(h)&&j.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,h,r.path);if(D)return D;return N(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",h),c.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${ar}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(w.has(r.path))return{contents:w.get(r.path),loader:"ts"};if(J(r.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=d.extname(r.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))c.add(r.path);let h=C?.get(r.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:j.readFileSync(r.path,"utf8"),loader:E}})}}}var H=new Map,z=S(64),it=Symbol.for("stx.client-bundle-build-queue");function Wf(t){let e=globalThis,i=(e[it]??Promise.resolve()).then(t,t);return e[it]=i.then(()=>{return},()=>{return}),i}async function pn(t,e,s={}){let i=s.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=s.minify??!1,o=s.externalizeUserModules??!0,b=s.expose?.length?[...new Set(s.expose)].sort():void 0,C=s.cacheDir||Lf(i),R=X.getStore(),w=new Bun.CryptoHasher("md5");w.update(`${$t}\x00${ct()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${p?"minified":"readable"}\x00${R?.key??""}\x00${nt(t,i)}\x00${nt(e,i)}`);let f=w.digest("hex").slice(0,12),v=d.join(C,`${f}.js`),y=z.get(v);if(y){if(Us(y.files)&&y.files.every((h)=>!J(h.path,i,c))){N("memo hit:",f);let h=y.files.map((D)=>D.path);return q(e,h),s.collectInputs?.push(...h),y.code}z.delete(v),N("memo invalidated by dep change:",f)}let B=d.join(C,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let h=Bun.file(B),D=!1,k=null;if(await h.exists())try{let O=JSON.parse(await h.text());if(O.metadataVersion===at&&Array.isArray(O.files)&&vt(O.files,i))k=Er(O.files.map((g)=>lt(g,i))),D=k.length===O.files.length&&!k.some((g)=>J(g.path,i,c))}catch{D=!1}if(D){if(N("cache hit:",f),k)q(e,k.map((U)=>U.path)),s.collectInputs?.push(...k.map((U)=>U.path));let O=await r.text(),g=new Date;if(j.promises.utimes(v,g,g).catch(()=>{}),k)z.set(v,{code:O,files:k});return O}N("cache invalidated by dep change:",f)}let u=H.get(f);if(u){let h=await u;if(s.collectInputs)s.collectInputs.push(...(z.get(v)?.files??[]).map((D)=>D.path));return h}yc(e);let E=Wf(()=>_t(t,e,{projectRoot:i,minify:p,cacheDir:C,hash:f,cachePath:v,depsPath:B,collectInputs:s.collectInputs,externalizeUserModules:o,serverApi:c,expose:b,throwOnFailure:s.throwOnFailure,substitutes:R?.modules}));H.set(f,E);try{return await E}finally{H.delete(f)}}function bc(t){return`${t}-${process.pid}-${bt()}`}async function Uh(t,e){let{projectRoot:s}=e,i=bc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(s,"bundle-tmp"),"out",i);j.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,b=0;for(let[f,v]of t){let y=d.join(s,`.stx-split-${i}-${b++}.ts`);p.set(y,v),o.set(d.basename(y).replace(/\.ts$/,""),f)}let[C,R]=[...p][0],w=new Set;yc(e.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[pt(s,d.dirname(e.filePath),C,R,w,!1,new Map,void 0,X.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...T()},root:s});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let B=d.basename(y.path);if(y.kind==="entry-point"){let r=o.get(B.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await y.text())}else if(y.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...w),v}finally{try{j.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function _t(t,e,s){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:b,depsPath:C,externalizeUserModules:R}=s,w=l(i,"bundle-tmp"),f=bc(o),v=d.join(i,`.stx-client-${f}.ts`),y=d.join(w,"out",f);j.mkdirSync(y,{recursive:!0});let B=d.dirname(e),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=n(t),{depths:D,balanced:k}=se(h),O=(F)=>!k||D[F]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((F)=>{let m=Mt(F);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;r.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!O(g.index))continue;let F=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(F&&Q.some((m)=>m.test(F)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)r.add(L)}}for(let F of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of F[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)r.delete(_)}let ft=r.size>0?`
3
- export { ${[...r].join(", ")} }`:"";N("bundling:",o,"from:",d.basename(e));let tt=new Set,et=new Map;try{let F=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:c?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[pt(i,B,v,t+ft,tt,R,et,s.serverApi,s.substitutes)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...T()},root:i});if(!F.success){let I=F.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ")||`Unable to bundle ${d.basename(e)}`,P=cr(F.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",I),mc(e||"",I,P),s.throwOnFailure||hc()==="error")throw Error(I);return t}let m="";for(let x of F.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of x[1].split(",")){let P=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(P){_.push([P[2],P[1]]);continue}let A=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(A))_.push([A,A])}if(s.expose){let x=new Set(s.expose);for(let I=_.length-1;I>=0;I--)if(!x.has(_[I][0]))_.splice(I,1)}let L=[];m=Hf(zf(m,et),L);let mt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),c&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let V=`__stxBundle_${o}`,gt=new Set(K(t,!0).split(",").map((x)=>x.trim())),ht=_.map(([x,I])=>`get ${JSON.stringify(x)}() { return ${I} }${gt.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${I}) { ${I} = __stxValue_${I} }`:""}`).join(", "),xt=_.map(([x])=>`var ${x} = undefined;`).join(`
4
- `),yt=_.map(([x])=>`${x} = ${V}[${JSON.stringify(x)}];`).join(`
5
- `);if(m=`${mt.join(`
6
- `)}
7
- ${xt}
8
- var ${V} = (function() {
9
- ${L.join(`
10
- `)}
11
- ${m}
12
- return { ${ht} };
13
- })();
14
- ${yt}
15
- var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
16
- Object.keys(${V}).forEach(function(name) {
17
- if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
18
- Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${V}, name));
19
- });`.trim(),N("bundled:",o,"output:",m.length,"bytes"),r.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(e)} (${o}); serving the unbundled source and not caching this result`),t;j.mkdirSync(p,{recursive:!0}),await Bun.write(b,m);let W=Er(tt);return await Bun.write(C,JSON.stringify({metadataVersion:at,files:W.map((x)=>St(x.path,i)).filter((x)=>x!==null)})),q(e,W.map((x)=>x.path)),s.collectInputs?.push(...W.map((x)=>x.path)),z.set(b,{code:m,files:W}),await jt(p),m}catch(F){let m=cr(F,e||void 0),_=De(F,e||void 0);if(console.warn(`[stx:bundler] error: ${_}`),mc(e||"",_,m),s.throwOnFailure||hc()==="error")throw F;return t}finally{try{j.rmSync(y,{recursive:!0,force:!0})}catch{}}}function Mt(t){let e=t.trim();if(!e)return null;let s=e.indexOf("=");if(s!==-1)e=e.slice(0,s).trim();let i=e.indexOf(":");if(i!==-1)e=e.slice(i+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
20
- export{Lf,jf,ke,Bf,mc,cn,ln,Vh,hc,un,ar,Ff,zf,Hf,ps,Vf,Uf,yc,dn,Wf,pn,bc,Uh};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{mt,ht,yt}from"./chunk-pbakxcv8.js";export{mt as createContext,ht as updateContextStoryFiles,yt as updateContextTree};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vi,ky,_y,El,Xe,Fg,ao,Cy,Ey,Ty,$y,Ry,Ay,Py,Iy,Oy}from"./chunk-pp99rmjm.js";export{Ay as applyHead,Cy as definePageMeta,Vi as getHead,ky as getPageMeta,Xe as mergeHeadConfigs,Py as processHeadDirective,Oy as processMetaDirective,Iy as processTitleDirective,Ry as renderBodyAttrs,Ty as renderHead,$y as renderHtmlAttrs,_y as resetHead,ao as seoMetaToHeadConfig,El as useHead,Ey as usePageTitle,Fg as useSeoMeta,Ey as useTitle};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import t from"fs";import r from"path";var on="resources/assets",or="assets";function ir(o=process.cwd()){let s=r.resolve(o,on);return t.existsSync(s)&&t.statSync(s).isDirectory()?s:null}
3
- export{on,or,ir};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{_h,Ro,Ch,Eh,Th,$h}from"./chunk-q7zc78az.js";import"./chunk-rzadf7vx.js";import"./chunk-cmh0bfkb.js";import"./chunk-mce3g2wb.js";import"./chunk-4m11kcxz.js";import"./chunk-95hbmv7k.js";import"./chunk-xtaq95em.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{$h as clearStoreCache,_h as getStoreScript,Th as getStoreScriptFor,Eh as pageStoresAll,Ro as storesRead,Ch as storesReadInFiles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Sm}from"./chunk-74x6j229.js";import"./chunk-0qwbhv3f.js";import"./chunk-wm029dh0.js";import"./chunk-qvrew79n.js";import"./chunk-cmh0bfkb.js";import"./chunk-0h6r7nvn.js";import"./chunk-644ckv6e.js";import"./chunk-6ezt9kbe.js";import"./chunk-r2bxjna3.js";import"./chunk-88xayf21.js";import"./chunk-7j11vgm1.js";import"./chunk-2qb9kp21.js";import"./chunk-dbvsa5ya.js";import"./chunk-4m11kcxz.js";import"./chunk-95hbmv7k.js";import"./chunk-xtaq95em.js";import"./chunk-dw0ttj6p.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{Sm as buildForProduction};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vm,Um,Wm,qm,Km,Gm,Xm}from"./chunk-ae8q4gze.js";export{Um as createKeepAliveCache,qm as generateKeepAliveCSS,Km as generateKeepAliveRuntime,Gm as onActivated,Xm as onDeactivated,Vm as processKeepAliveDirectives,Wm as shouldCacheComponent};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wh,vh,xh,Sh,kh}from"./chunk-b4d4tjvx.js";export{vh as createSSRSuspense,Sh as generateSuspenseCSS,kh as generateSuspenseRuntime,wh as processSuspenseDirectives,xh as renderSSRSuspense};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pu,Do,tr,Iu,Ou,Nu,Du,Mu,Lu,ju,Bu,Fu,zu,Hu,Vu,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,rn,Ua,kd,_d,Cd,Wa,Ed,Td,$d,Rd,Ad,Pd,qa,Id,Od,Nd,Dd,Md,Ld,jd,Bd,Fd,nr,zd,Hd,Vd,Ud,Wd,qd,Kd,Gd,Xd,Jd,Yd,Zd,Mo,Qd,ep,tp,np,rp,as,cs,sp,op,ip,ap,cp,Ka,lp,up,dp,Ga,Lo,pp,fp,Xa,Ja,ls,Ya,gp,sn,mp,Za,Qa,jo,hp,Bo,yp,bp,wp,vp,xp,Sp,kp,ec,_p,Cp,tc,Ep,Tp,$p,Rp,Ap,Pp,Ip,Op,Np,Dp,Mp,Lp,jp,Bp,Fp,zp,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,nc,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,rr,rc,sc,cf,sr,lf,uf,df,oc,ic,us,ds,pf,Fo,ff,gf,mf,hf,yf,bf,wf,vf,xf,Sf,kf,_f,Cf,Ef,Tf,$f,Rf,Af,Pf,If,ac,Of,Nf,cc,lc,Df,Mf}from"./chunk-y75bds1g.js";export{xd as AVAILABLE_COMPONENTS,Ka as AutoUpdater,Sd as COMPONENT_STYLES,us as DEFAULT_WATCH_INTERVAL_MS,ic as MAX_WATCH_INTERVAL_MS,oc as MIN_WATCH_INTERVAL_MS,Pd as MODAL_STYLES,Fu as TOAST_STYLES,jd as TRAY_MENU_STYLES,Xa as UPDATE_MANIFEST_ASSET,Td as alert,qp as appInfo,bf as appleScript,Mf as applicationDataDirectory,yf as audio,Nf as backgroundDelay,Hp as battery,hf as biometric,of as bluetooth,kf as bonjour,sn as bundlePathForExecutable,hp as caffeinate,lp as canReplaceBundle,up as clearQuarantine,Op as clipboard,Ad as closeAllModals,Zd as closeAllWindows,Ed as confirm,Xp as contextMenu,Rf as continuityCamera,$f as coreml,ap as craftBinaryNotFoundMessage,Mo as craftWindowArguments,rr as crashReporter,ld as createAccordion,nd as createAutocomplete,Ku as createAvatar,qu as createBadge,zu as createButton,Gu as createCard,hd as createChart,Vu as createCheckbox,od as createChip,yd as createCodeEditor,Qu as createColorPicker,md as createDataGrid,ed as createDatePicker,cs as createDiskImage,Ju as createDropdown,wd as createFileExplorer,gp as createGitHubUpdateManifest,Ya as createGitHubUpdater,sd as createImageView,Rp as createInterval,rd as createLabel,pd as createListView,bd as createMediaPlayer,Id as createMenubar,dd as createModalComponent,Df as createNativeUpdateApi,lc as createPantrySelfUpdater,xp as createPreferences,Wu as createProgressBar,Zu as createRadioButton,Yu as createRating,ad as createScrollView,jo as createSelfUpdater,Uu as createSlider,cd as createSplitView,ud as createStepper,qa as createSystemTray,fd as createTable,Xu as createTabs,Hu as createTextInput,td as createTimePicker,$p as createTimer,id as createTooltip,gd as createTreeView,vd as createWebView,Qd as createWindow,tp as createWindowWithHTML,Bo as decaffeinate,zp as deepLinks,Ap as delay,Lu as dismissAlertById,ju as dismissAllAlerts,Bp as dragOut,dp as extractBundle,wf as fileAssociations,Fo as focus,gf as focusShortcutsReady,Ip as formatCompact,vp as formatDuration,wp as formatRemainingTime,_p as formatShortcut,Pp as formatTime,Dp as fs,Ga as generateUpdateManifest,Bu as getActiveAlertCount,Rd as getActiveModalCount,Od as getActiveTrayInstances,Jd as getActiveWindowIds,bp as getCaffeinateStatus,If as getCapabilities,ac as getCapability,Gd as getDesktopConfig,qd as getDialogBridgeScript,Tp as getRegisteredHotkeys,Md as getSimulatedTrayHTML,Ld as getTrayBridgeScript,Nd as getTrayInstance,Yd as getWindow,rp as getWindowBridgeScript,Ja as githubLatestAssetUrl,ls as githubReleaseAssetUrl,Lp as globalShortcuts,sr as handoff,ff as hasFocusShortcuts,cf as iap,kp as isAutoLaunchEnabled,Of as isAvailable,yp as isCaffeinated,Fp as isDragOutAvailable,np as isWebviewAvailable,Zp as keychain,lf as liveActivities,mf as localServer,uf as location,Sf as log,sp as macOSRuntimeExecutablePath,Gp as menu,Tf as midi,tf as nativeAutoLaunch,nf as nativeTray,rf as nativeWindow,Vp as network,Np as notifications,Mu as notify,ep as openDevWindow,op as pack,ip as packageApp,cc as parsePantryUpdateManifest,ec as parseShortcut,xf as pdf,Qp as permissions,ef as printing,$d as prompt,Za as quitLauncher,Lo as readBundleIdentity,rc as redactPII,Cp as registerHotkey,Qa as relaunchBundle,Pu as requestNotificationPermission,Xd as resetDesktopConfig,cp as resolveCraftBinary,as as resolveCraftExecutablePath,mp as runningBundleTeamId,Yp as screen,df as screenCapture,ds as screenSharing,Pf as serial,Af as serviceMenu,Sp as setAutoLaunch,Kd as setDesktopConfig,Mp as shell,Do as showAlert,Hd as showAlertDialog,zd as showColorPicker,Vd as showConfirmDialog,Ud as showErrorDialog,_d as showErrorModal,Du as showErrorToast,Ua as showInfoModal,Iu as showInfoToast,nr as showMessageBox,rn as showModal,Bd as showOpenDialog,Wa as showQuestionModal,Fd as showSaveDialog,Cd as showSuccessModal,Ou as showSuccessToast,tr as showToast,Wd as showWarningDialog,kd as showWarningModal,Nu as showWarningToast,nc as sidebar,sc as signPayload,af as speech,Cf as speechRecognition,_f as spotlight,Kp as standardMenus,pp as swapBundle,Jp as system,vf as tags,jp as theme,sf as touchbar,Dd as triggerTrayAction,Ep as unregisterAllHotkeys,tc as unregisterHotkey,Up as updater,fp as verifyBundleTrust,Ef as vision,pf as watchScreenSharing,Wp as windowEvents};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fn,zo,Ho,Vo,Wh,Uo}from"./chunk-cmh0bfkb.js";import"./chunk-zc8a2erc.js";import"./chunk-wp0qpa50.js";import"./chunk-kzc2tqzr.js";export{Ho as buildServerApi,Wh as createServerApi,fn as discoverServerApi,zo as generateApiTypes,Uo as isServerApiSource,Vo as productionApiDispatcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Aa,Pa,lu,uu,du,pu,Jm}from"./chunk-afxfkb60.js";export{Aa as createVirtualList,Jm as default,lu as generateVirtualListCSS,du as processInfiniteListDirectives,pu as processVirtualGridDirectives,Pa as processVirtualListDirectives,uu as useVirtualList};