@stacksjs/stx 0.2.876 → 0.2.880

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/{chunk-fdjx4vs3.js → chunk-00tq7ghn.js} +2 -2
  2. package/dist/{chunk-nv4c25zj.js → chunk-02qmvcmv.js} +3 -3
  3. package/dist/chunk-08cb7cyw.js +2 -0
  4. package/dist/chunk-0h1dyd38.js +2 -0
  5. package/dist/{chunk-2mt2zc5y.js → chunk-0m4c42qt.js} +10 -10
  6. package/dist/{chunk-x4jzhgdm.js → chunk-19k15mfc.js} +2 -2
  7. package/dist/chunk-1avy0p8v.js +2 -0
  8. package/dist/chunk-1jk46ve0.js +2 -0
  9. package/dist/chunk-1r612xxs.js +2 -0
  10. package/dist/chunk-1z6rrqvm.js +2 -0
  11. package/dist/chunk-2d68p12e.js +2 -0
  12. package/dist/chunk-2haf7t5h.js +2 -0
  13. package/dist/{chunk-1q5w3xav.js → chunk-2r0nrvqe.js} +2 -2
  14. package/dist/chunk-3jp5z1qj.js +2 -0
  15. package/dist/{chunk-dv56x3g8.js → chunk-3q0w0bzd.js} +10 -10
  16. package/dist/{chunk-eknm4jrm.js → chunk-3sema2js.js} +2 -2
  17. package/dist/{chunk-cj44e8mw.js → chunk-3wb82rxw.js} +5 -5
  18. package/dist/chunk-3zds0gmd.js +2 -0
  19. package/dist/{chunk-qnwd5bz4.js → chunk-463weehv.js} +1 -1
  20. package/dist/{chunk-wm029dh0.js → chunk-4fkcn6z5.js} +18 -12
  21. package/dist/{chunk-976kgb3r.js → chunk-4n45qa0b.js} +9 -9
  22. package/dist/chunk-4pjqj54a.js +2 -0
  23. package/dist/{chunk-j0rqa9bk.js → chunk-4r2rfdmr.js} +5 -5
  24. package/dist/{chunk-ft6em3wm.js → chunk-50cnypys.js} +6 -6
  25. package/dist/chunk-53cc06w7.js +2 -0
  26. package/dist/{chunk-y2e2zm6y.js → chunk-57q4nvs9.js} +3 -3
  27. package/dist/{chunk-3mz9bdf7.js → chunk-59er0fc7.js} +3 -3
  28. package/dist/{chunk-6kp4mg3h.js → chunk-5eftxrvv.js} +2 -2
  29. package/dist/chunk-5p3825qw.js +2 -0
  30. package/dist/chunk-5rd0an89.js +2 -0
  31. package/dist/{chunk-pk714ynv.js → chunk-69ezjc8k.js} +4 -4
  32. package/dist/{chunk-75v0yxeh.js → chunk-6c1vm6bs.js} +2 -2
  33. package/dist/{chunk-d3q0cg47.js → chunk-6df3j3qq.js} +3 -3
  34. package/dist/{chunk-kzc2tqzr.js → chunk-6t04tqvh.js} +2 -2
  35. package/dist/chunk-78zgmqhd.js +2 -0
  36. package/dist/chunk-7bsrnpmh.js +33 -0
  37. package/dist/chunk-7dq6ebvp.js +2 -0
  38. package/dist/chunk-7kqgp3p7.js +2 -0
  39. package/dist/{chunk-wzvdr4ta.js → chunk-7mcs59pr.js} +2 -2
  40. package/dist/chunk-83b9k17j.js +2 -0
  41. package/dist/chunk-86nsbxep.js +61 -0
  42. package/dist/{chunk-0g2mg8cw.js → chunk-8e1cv1hh.js} +3 -3
  43. package/dist/chunk-8h5nje66.js +2 -0
  44. package/dist/{chunk-ae8q4gze.js → chunk-8va3fs07.js} +5 -5
  45. package/dist/{chunk-fh72k2ks.js → chunk-93jhfbeg.js} +6 -6
  46. package/dist/{chunk-xmws1gaf.js → chunk-94ctmp0j.js} +2 -2
  47. package/dist/chunk-97kgrevs.js +4 -0
  48. package/dist/{chunk-nn6hvsxp.js → chunk-9cbf0seq.js} +2 -2
  49. package/dist/{chunk-mce3g2wb.js → chunk-9f31gs4m.js} +2 -2
  50. package/dist/chunk-9kza7gxd.js +2 -0
  51. package/dist/{chunk-b4d4tjvx.js → chunk-a0q0kb0s.js} +5 -5
  52. package/dist/chunk-a5gnxdfe.js +2 -0
  53. package/dist/chunk-a60ztvnp.js +3 -0
  54. package/dist/{chunk-s7fhpkvf.js → chunk-a7ryj8z8.js} +6 -6
  55. package/dist/{chunk-gqtb53s8.js → chunk-aaea157p.js} +2 -2
  56. package/dist/{chunk-wp0qpa50.js → chunk-agd2b928.js} +59 -27
  57. package/dist/chunk-aqxh80vh.js +2 -0
  58. package/dist/{chunk-2tcyfrvb.js → chunk-awp8a3t4.js} +2 -2
  59. package/dist/chunk-axra1yas.js +2 -0
  60. package/dist/chunk-az8b0726.js +21 -0
  61. package/dist/chunk-b7d3n4aw.js +2 -0
  62. package/dist/{chunk-r2bxjna3.js → chunk-c0g30cjs.js} +2 -2
  63. package/dist/{chunk-jt5tzddc.js → chunk-c73c0wf9.js} +2 -2
  64. package/dist/{chunk-3922g6sh.js → chunk-cad7e5q1.js} +9 -9
  65. package/dist/{chunk-bjjfr7qt.js → chunk-care745q.js} +2 -2
  66. package/dist/chunk-ce0zbpr5.js +2 -0
  67. package/dist/chunk-cjv89tnb.js +20 -0
  68. package/dist/chunk-cv1vm1w0.js +2 -0
  69. package/dist/{chunk-mw0rb1sf.js → chunk-czcx3nbx.js} +6 -6
  70. package/dist/chunk-d7b30bg6.js +2 -0
  71. package/dist/{chunk-stn7p7f1.js → chunk-dwyhpbpx.js} +2 -2
  72. package/dist/{chunk-y75bds1g.js → chunk-e362e615.js} +30 -30
  73. package/dist/{chunk-ydppkb8y.js → chunk-e41pgmgk.js} +2 -2
  74. package/dist/{chunk-ctjxcaxq.js → chunk-ec5q4nnw.js} +66 -66
  75. package/dist/{chunk-k0t9ye9j.js → chunk-egjmb32c.js} +126 -71
  76. package/dist/{chunk-g15reb1h.js → chunk-ew3vs3jq.js} +8 -8
  77. package/dist/{chunk-jqxerj6k.js → chunk-ezna4dhj.js} +2 -2
  78. package/dist/chunk-f3j1h3ch.js +2 -0
  79. package/dist/{chunk-mkwavsb3.js → chunk-f7znj9xg.js} +3 -3
  80. package/dist/chunk-fz4c5e9m.js +2 -0
  81. package/dist/{chunk-esjr9qhe.js → chunk-g2xy0z0e.js} +2 -2
  82. package/dist/{chunk-fwbccyhw.js → chunk-g83ph305.js} +2 -2
  83. package/dist/{chunk-kywe0f1v.js → chunk-gbncp2gp.js} +2 -2
  84. package/dist/chunk-gm67jt8p.js +2 -0
  85. package/dist/chunk-gmp10259.js +2 -0
  86. package/dist/{chunk-0sa9gqmc.js → chunk-h2tq6cbr.js} +11 -11
  87. package/dist/chunk-h3fv0q25.js +2 -0
  88. package/dist/{chunk-r09kz9bf.js → chunk-h63ma36g.js} +2 -2
  89. package/dist/chunk-hkx51atf.js +2 -0
  90. package/dist/{chunk-w8k9fz1w.js → chunk-hmntqqyd.js} +7 -7
  91. package/dist/{chunk-3w7gacva.js → chunk-hxhmhw23.js} +3 -3
  92. package/dist/chunk-jghpzx5m.js +2 -0
  93. package/dist/chunk-k206d3pn.js +2 -0
  94. package/dist/chunk-k40e0ete.js +4 -0
  95. package/dist/chunk-k6c5t9we.js +38 -0
  96. package/dist/{chunk-f4vgagjb.js → chunk-kee5a3ce.js} +3 -3
  97. package/dist/chunk-kn9tqjgv.js +25 -0
  98. package/dist/chunk-kna1bdm2.js +54 -0
  99. package/dist/{chunk-ttjscvre.js → chunk-mygsektn.js} +3 -3
  100. package/dist/chunk-nb6erf75.js +9 -0
  101. package/dist/chunk-ngzyzcrp.js +2 -0
  102. package/dist/{chunk-h17pfbng.js → chunk-nysbdr4r.js} +2 -2
  103. package/dist/chunk-p55a910x.js +1198 -0
  104. package/dist/chunk-p6hcrg3r.js +3 -0
  105. package/dist/chunk-p746twww.js +2 -0
  106. package/dist/chunk-pa2vt2ej.js +2 -0
  107. package/dist/chunk-pa6kgbmw.js +2 -0
  108. package/dist/{chunk-saqzk45g.js → chunk-pdprhg5k.js} +1 -1
  109. package/dist/chunk-pjjrx9pk.js +2 -0
  110. package/dist/{chunk-7rep2jqh.js → chunk-pm4rpc4a.js} +23 -23
  111. package/dist/chunk-pt3rp3zg.js +2 -0
  112. package/dist/{chunk-4517hny7.js → chunk-q1mb0fbt.js} +2 -2
  113. package/dist/{chunk-k1ew643q.js → chunk-q74affc4.js} +2 -2
  114. package/dist/chunk-qd9v1v8z.js +2 -0
  115. package/dist/chunk-qfwk93fk.js +2 -0
  116. package/dist/chunk-qg1kw5yf.js +2 -0
  117. package/dist/chunk-qn6y5ttj.js +2 -0
  118. package/dist/chunk-qxcc0aar.js +2 -0
  119. package/dist/{chunk-rzd9hyhv.js → chunk-ram5944w.js} +2 -2
  120. package/dist/{chunk-p5m1z6e1.js → chunk-rcxer2km.js} +4 -4
  121. package/dist/chunk-rdxph1tp.js +2 -0
  122. package/dist/chunk-rnrdngnn.js +2 -0
  123. package/dist/{chunk-x2ftkaz3.js → chunk-rsxxajv6.js} +2 -2
  124. package/dist/chunk-rw5sxr5a.js +2 -0
  125. package/dist/chunk-rzcdwybt.js +26 -0
  126. package/dist/chunk-s29hp1qw.js +14 -0
  127. package/dist/chunk-s7xywsqd.js +3 -0
  128. package/dist/{chunk-d6gqh2wv.js → chunk-satrf398.js} +1 -1
  129. package/dist/{chunk-zn6n075d.js → chunk-shcnt6aa.js} +3 -3
  130. package/dist/{chunk-ysfgabpf.js → chunk-sn4ndpd7.js} +3 -3
  131. package/dist/{chunk-zc8a2erc.js → chunk-ssg6ne5b.js} +4 -4
  132. package/dist/{chunk-afxfkb60.js → chunk-sv7fdqmc.js} +6 -6
  133. package/dist/chunk-swz0xprw.js +2 -0
  134. package/dist/chunk-t8r40wgf.js +2 -0
  135. package/dist/{chunk-dbvsa5ya.js → chunk-t94y8g35.js} +2 -2
  136. package/dist/{chunk-df6vjs3p.js → chunk-t9hxyvvc.js} +5 -5
  137. package/dist/{chunk-cvbwxskc.js → chunk-tgzs1kbj.js} +5 -5
  138. package/dist/chunk-tka73egx.js +2 -0
  139. package/dist/{chunk-xtaq95em.js → chunk-v1s838fe.js} +1 -1
  140. package/dist/chunk-v3747589.js +12 -0
  141. package/dist/chunk-v9h2bbhf.js +2 -0
  142. package/dist/chunk-v9mxhch2.js +2 -0
  143. package/dist/chunk-vm42j29z.js +2 -0
  144. package/dist/chunk-w2kdhm7k.js +2 -0
  145. package/dist/chunk-w5zzwe2f.js +2 -0
  146. package/dist/chunk-wbmx0rge.js +2 -0
  147. package/dist/chunk-wjafpvjv.js +2 -0
  148. package/dist/chunk-ws2h92mm.js +3 -0
  149. package/dist/chunk-ws9kr80x.js +2 -0
  150. package/dist/{chunk-zgds9nwv.js → chunk-xf0xacc9.js} +44 -44
  151. package/dist/chunk-xhr35ctb.js +2 -0
  152. package/dist/chunk-xmmr0916.js +2 -0
  153. package/dist/{chunk-yxdhz4ps.js → chunk-xpbakn6t.js} +2 -2
  154. package/dist/chunk-xz4v9tg1.js +3 -0
  155. package/dist/chunk-y7e61pz3.js +3 -0
  156. package/dist/{chunk-v0tdg16k.js → chunk-ybjgnnyf.js} +5 -5
  157. package/dist/chunk-yh2hnt3m.js +12 -0
  158. package/dist/{chunk-w6pzkcjp.js → chunk-ymqm898x.js} +2 -2
  159. package/dist/{chunk-2zaatnnh.js → chunk-yp4tn4zn.js} +4 -4
  160. package/dist/chunk-z7k1xn6k.js +2 -0
  161. package/dist/{chunk-vnkvnenn.js → chunk-z9ffr9gy.js} +7 -7
  162. package/dist/{chunk-nnp6rf4c.js → chunk-zch65qrd.js} +1 -1
  163. package/dist/{chunk-pbakxcv8.js → chunk-zek9t5za.js} +2 -2
  164. package/dist/cli.js +23 -23
  165. package/dist/client/signals-dom-ready-runtime.js +6 -0
  166. package/dist/client/signals-mount-runtime.js +1 -1
  167. package/dist/client-module-registry.js +10 -4
  168. package/dist/client-parameter-bindings.d.ts +5 -0
  169. package/dist/client-parameter-bindings.js +47 -6
  170. package/dist/client-script-bundler.js +4 -3
  171. package/dist/component-library.d.ts +1 -0
  172. package/dist/component-library.js +42 -14
  173. package/dist/composable-loader.js +19 -9
  174. package/dist/craft-entry.js +2 -2
  175. package/dist/craft.js +2 -2
  176. package/dist/html-masking.d.ts +2 -0
  177. package/dist/html-masking.js +10 -0
  178. package/dist/inherited-context.d.ts +1 -1
  179. package/dist/inherited-context.js +43 -14
  180. package/dist/module-syntax.d.ts +2 -0
  181. package/dist/module-syntax.js +21 -0
  182. package/dist/native-component-context.js +42 -16
  183. package/dist/page-module-order.d.ts +10 -0
  184. package/dist/page-module-order.js +139 -0
  185. package/dist/process.js +6 -4
  186. package/dist/pwa.js +3 -3
  187. package/dist/script-attributes.d.ts +4 -0
  188. package/dist/script-attributes.js +10 -0
  189. package/dist/ssg.js +39 -39
  190. package/dist/strip-literals.d.ts +2 -0
  191. package/dist/strip-literals.js +12 -6
  192. package/dist/stx-virtual-ts.d.ts +1 -0
  193. package/dist/stx-virtual-ts.js +21 -27
  194. package/dist/typecheck.js +8 -0
  195. package/package.json +5 -5
  196. package/dist/chunk-027meh1k.js +0 -2
  197. package/dist/chunk-0hs633pt.js +0 -2
  198. package/dist/chunk-0j8zre1m.js +0 -2
  199. package/dist/chunk-0v02qms8.js +0 -2
  200. package/dist/chunk-0z9gttw0.js +0 -2
  201. package/dist/chunk-11dwmcpy.js +0 -3
  202. package/dist/chunk-1a237qky.js +0 -33
  203. package/dist/chunk-1ehjzhnc.js +0 -25
  204. package/dist/chunk-1gfg6qmr.js +0 -2
  205. package/dist/chunk-1kgnk6ds.js +0 -2
  206. package/dist/chunk-1ztp5vkh.js +0 -3
  207. package/dist/chunk-32wvc376.js +0 -2
  208. package/dist/chunk-3k2d2jsn.js +0 -2
  209. package/dist/chunk-3te2y9qf.js +0 -2
  210. package/dist/chunk-40330tm5.js +0 -2
  211. package/dist/chunk-447jc6zc.js +0 -2
  212. package/dist/chunk-4dk6k0ad.js +0 -2
  213. package/dist/chunk-4e48zkq0.js +0 -2
  214. package/dist/chunk-5ep7p8te.js +0 -2
  215. package/dist/chunk-5gx403te.js +0 -1184
  216. package/dist/chunk-6q9a5bph.js +0 -2
  217. package/dist/chunk-7ds9mx4c.js +0 -2
  218. package/dist/chunk-7njy024g.js +0 -2
  219. package/dist/chunk-7tjewwmd.js +0 -2
  220. package/dist/chunk-85xabvtj.js +0 -2
  221. package/dist/chunk-880f8j99.js +0 -2
  222. package/dist/chunk-8f3dbthj.js +0 -2
  223. package/dist/chunk-99e3mxnn.js +0 -20
  224. package/dist/chunk-9gv847nn.js +0 -2
  225. package/dist/chunk-9mz2n39m.js +0 -2
  226. package/dist/chunk-akthsg33.js +0 -54
  227. package/dist/chunk-b1tcym2x.js +0 -2
  228. package/dist/chunk-bdh73gxd.js +0 -4
  229. package/dist/chunk-bspj1rf1.js +0 -2
  230. package/dist/chunk-bx3hpsxn.js +0 -2
  231. package/dist/chunk-byq488g4.js +0 -2
  232. package/dist/chunk-c4s25bm2.js +0 -2
  233. package/dist/chunk-csjqtzwc.js +0 -2
  234. package/dist/chunk-df78j74w.js +0 -4
  235. package/dist/chunk-dgs3d367.js +0 -2
  236. package/dist/chunk-dmf6zcf4.js +0 -2
  237. package/dist/chunk-e2b2f502.js +0 -2
  238. package/dist/chunk-ec6mrad6.js +0 -2
  239. package/dist/chunk-eecctzgp.js +0 -17
  240. package/dist/chunk-fa57bncd.js +0 -2
  241. package/dist/chunk-g4eheg0t.js +0 -24
  242. package/dist/chunk-gfe1jrw9.js +0 -2
  243. package/dist/chunk-gn16yq49.js +0 -2
  244. package/dist/chunk-gvs61tqn.js +0 -2
  245. package/dist/chunk-h2928108.js +0 -2
  246. package/dist/chunk-hat353vx.js +0 -2
  247. package/dist/chunk-jmjgj3nh.js +0 -2
  248. package/dist/chunk-jqtpzzz4.js +0 -12
  249. package/dist/chunk-jvy7z3hz.js +0 -3
  250. package/dist/chunk-k9dne5by.js +0 -12
  251. package/dist/chunk-kq8mffgf.js +0 -2
  252. package/dist/chunk-kx06jzdw.js +0 -2
  253. package/dist/chunk-n5pvdrkb.js +0 -2
  254. package/dist/chunk-ne8q191s.js +0 -2
  255. package/dist/chunk-np8wgbsa.js +0 -3
  256. package/dist/chunk-nthw4dca.js +0 -2
  257. package/dist/chunk-pp99rmjm.js +0 -72
  258. package/dist/chunk-pqmjeea6.js +0 -2
  259. package/dist/chunk-qggwr60r.js +0 -2
  260. package/dist/chunk-qm3v4qb7.js +0 -2
  261. package/dist/chunk-qty0t69x.js +0 -2
  262. package/dist/chunk-rjv6885r.js +0 -2
  263. package/dist/chunk-rm5gbthk.js +0 -2
  264. package/dist/chunk-sgengtap.js +0 -2
  265. package/dist/chunk-snz2cxqv.js +0 -2
  266. package/dist/chunk-szp7ajfm.js +0 -33
  267. package/dist/chunk-ts37jw3s.js +0 -2
  268. package/dist/chunk-v4emesnw.js +0 -2
  269. package/dist/chunk-vnrbjbrw.js +0 -3
  270. package/dist/chunk-vxra53wq.js +0 -2
  271. package/dist/chunk-x76qvq1n.js +0 -2
  272. package/dist/chunk-x85z6dmw.js +0 -2
  273. package/dist/chunk-xkfe03y9.js +0 -2
  274. package/dist/chunk-y4hn1qh0.js +0 -2
  275. package/dist/chunk-yc8ggeh2.js +0 -2
  276. package/dist/chunk-yfed67yc.js +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{St,Jn,Ph}from"./chunk-wm029dh0.js";import{ye,Yn,Ih,Zn,Po,rs,ss,Oh,Nh,Dh,Qn,er,Io,os,Mh}from"./chunk-x2ftkaz3.js";import"./chunk-fdjx4vs3.js";export{Po as batch,Ph as default,Yn as derived,Zn as effect,St as generateSignalsRuntime,Jn as generateSignalsRuntimeDev,er as isDerived,Qn as isSignal,Ih as memo,ss as onDestroy,rs as onMount,os as peek,Dh as pendingLifecycleCounts,Nh as runDestroyCallbacks,Oh as runMountCallbacks,ye as state,Io as untrack,Mh as useOptimistic};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$n,Mi}from"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";export{Mi as generateRuntimeConfigTypes,$n as prepareRuntimeConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ml,Ll,jl,zg,Hg}from"./chunk-ydppkb8y.js";export{Ll as auditBuildOutput,Ml as auditConfig,jl as calculateAuditResult,Hg as formatAuditResult,zg as runPwaAudit};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fn,zo,Ho,Vo,Wh,Uo}from"./chunk-cvbwxskc.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{Wr,mo,om,Hl,ho}from"./chunk-eecctzgp.js";export{om as buildModuleRegistryScript,ho as buildSharedModuleRegistries,Hl as exportsMutableBinding,Wr as registeredModuleIdsIn,mo as registeredModuleNamesIn};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gm}from"./chunk-h17pfbng.js";import"./chunk-1a237qky.js";import"./chunk-nn6hvsxp.js";import"./chunk-cvbwxskc.js";import"./chunk-11dwmcpy.js";import"./chunk-w8k9fz1w.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.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{qf,vc,qh,xc,Kf,Gf,mn,pr,Kh,Xf,Jf,Gh,x}from"./chunk-dv56x3g8.js";import"./chunk-6kp4mg3h.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{mn as buildCss,Xf as extractClassNames,Gf as fingerprintConfig,Jf as generateCss,Kh as getCachedCSS,qf as getCssServeAsset,x as injectCss,vc as loadCssEngine,xc as loadCssEngineConfig,pr as rebuildCss,qh as resetCssCache,Kf as resolveUserCssConfig,Gh as withLinkedModuleBundles};
@@ -1,20 +0,0 @@
1
- // @bun
2
- import{cr,De}from"./chunk-mce3g2wb.js";import{K,S,Er,Us,T}from"./chunk-5gx403te.js";import{a,M}from"./chunk-ctjxcaxq.js";import{Uo}from"./chunk-cvbwxskc.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{fm}from"./chunk-fwbccyhw.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{fm as buildApp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fu,gu,mu,hu,yu,bu,wu,vu,xu,Su,Ym}from"./chunk-s7fhpkvf.js";export{fu as createIslandRegistry,Ym as default,Su as generateIslandManifest,mu as generatePartialHydrationCSS,bu as hydrateAll,yu as hydrateByStrategy,hu as hydrateIsland,wu as isHydrated,vu as onHydrated,gu as processPartialHydrationDirectives,xu as processStaticDirectives};
@@ -1,54 +0,0 @@
1
- // @bun
2
- import{P,d,m,O,p,Y}from"./chunk-pp99rmjm.js";import{K,Bs,Fe,L,Mt,Pr,Ue,We,s,y,Re,R}from"./chunk-5gx403te.js";import{ft}from"./chunk-fdjx4vs3.js";import{N}from"./chunk-3w7gacva.js";import{de}from"./chunk-dbvsa5ya.js";import{V,rt}from"./chunk-bjjfr7qt.js";import{A,In}from"./chunk-1ztp5vkh.js";import M from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let b=c[r];if(b==="("||b==="["||b==="{")a++;else if(b===")"||b==="]"||b==="}")a--;else if(b===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,b=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=b.exec(r);while(n){let u=n.index,t=u+n[0].length-1,T=1,W=t+1;while(W<r.length&&T>0){if(r[W]==="(")T++;else if(r[W]===")")T--;W++}if(T!==0)break;let ie=r.substring(t+1,W-1),B=`${a}(${ie})`;r=r.substring(0,u)+B+r.substring(W),b.lastIndex=u+B.length,n=b.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,b=0,n=0,u=e.length,t=(B)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===B){n++;return}n++}},T=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let B=1;while(n<u&&B>0)if(e[n]==="{")B++,n++;else if(e[n]==="}")B--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")T();else n++;continue}n++}},W=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
3
- `)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(b!==0)return;let B=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(B){let Z=B[2];if(!r.has(Z))a.push(Z),r.add(Z);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let Z=se[1];if(!r.has(Z))a.push(Z),r.add(Z);return}let ee=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(ee){let Z=ee[1];if(!r.has(Z))a.push(Z),r.add(Z)}};while(n<u){if(W())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){T();continue}if(e[n]==="{"){b++,n++;continue}if(e[n]==="}"){b--,n++;continue}if(b===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
4
- (function() {
5
- ${ft("var",a)}
6
- var __destroyHooks = [];
7
- var __origOnDestroy = onDestroy;
8
- onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
9
-
10
- ${c}
11
- ${e}})();
12
- `}function ke(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),b=new Set(K(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>b.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Bs(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
13
- `);return`
14
- // Register scope variables for STX runtime
15
- if (!window.stx._scopes) window.stx._scopes = {};
16
- var __scopeRegistration = window.stx._scopes['${e}'] || { __destroyCallbacks: __destroyHooks };
17
- ${n}
18
- // #1767: when the bundler renamed a component const that collided with an
19
- // inlined import (foo -> foo2), rebind the ORIGINAL template name to the
20
- // renamed declaration so it resolves to the component's value, not the
21
- // shadowing import. __stxScopeRenames is emitted by bundleClientScript.
22
- try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
23
- if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
24
- window.stx._scopes['${e}'] = __scopeRegistration;
25
- `}function Ie(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function ue(c,e){let a=ke(c,e);return Me(ve(c,a),e)}function Me(c,e){let a=`
26
- (function() {
27
- var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
28
- var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
29
- if (__stxScopeEl && typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxScopeEl;
30
- if (__stxScopeEl && typeof window !== 'undefined' && window.stx) {
31
- if (!window.stx._scopes) window.stx._scopes = {};
32
- window.stx._scopes['${e}'] = {};
33
- }
34
- var __stxEndEffects = (typeof window !== 'undefined' && window.stx && window.stx._beginEffects) ? window.stx._beginEffects() : null;
35
- try {`,r=`
36
- } finally {
37
- // The body's effects end where its onDestroy callbacks run: with the scope
38
- // when the partial has a root, with the page when it has none.
39
- if (__stxEndEffects) {
40
- var __stxDisposeEffects = __stxEndEffects();
41
- var __stxRegistered = __stxScopeEl && window.stx._scopes && window.stx._scopes['${e}'];
42
- if (__stxRegistered) __stxRegistered.__disposeEffects = __stxDisposeEffects;
43
- else if (window.stx._destroyCallbacks) window.stx._destroyCallbacks.push(__stxDisposeEffects);
44
- }
45
- if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
46
- }
47
- })();`;return a+c+r}function Te(c,e){if(V(c)){let n=V(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:rt(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Mt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),T=r[1],W=r[2];return{html:`${t}${T} data-stx-scope="${e}"${W}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=M.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,pe=new Set;function Xh(){le.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Yf(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",T=u[2],W=u[3]==="/"||Ce.has(T.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(T);if(!W)b++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var nt=new P(500),Sc=new Set;function Jh(){Sc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Sc}async function ms(c,e,a,r,b,n=new Set){let u=r.partialsDir||M.join(M.dirname(a),"partials");if(u&&!M.isAbsolute(u))u=M.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),T=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(T.has(i))return"";return T.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let C=o[1],z=W(C,u,a),E="";if(z&&await Bun.file(z).exists())b.add(z),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let C=t.substring(x+1,o-1),z=ae(C,0);if(z===-1){h.lastIndex=o;continue}let E=C.substring(0,z).trim(),H=C.substring(z+1).trim(),F=H.match(/^\s*['"]([^'"]+)['"]/);if(!F){h.lastIndex=o;continue}let _=F[1],J=H.substring(F[0].length),D,k=ae(J,0);if(k!==-1)D=J.substring(k+1).trim();try{let I=`Boolean(${E})`,j;if(m(I)){let oe=p(I,Object.keys(e));j=Boolean(oe(...Object.values(e)))}else j=Boolean(d(I,e));let te=v?!j:j,re="";if(te){let oe=W(_,u,a);if(oe&&await Bun.file(oe).exists())b.add(oe);re=`@include('${_}'${D?`, ${D}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(I){let j=I instanceof Error?I.message:String(I),te=y("Include",`Error evaluating ${f} condition: ${j}`,a,c,i);t=t.substring(0,i)+te+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let[,z,E,H,F]=C;try{let _,J=E.trim();if(m(J))_=p(J,Object.keys(e))(...Object.values(e));else _=d(J,e);let D="";if(Array.isArray(_)&&_.length>0)for(let k of _){let I={...e,[H]:k},j=await se(z,I,c,h);D+=j}else if(F)D=await se(F,{},c,h);t=t.substring(0,h)+D+t.substring(x+1),f.lastIndex=0}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${J}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*(\[[^\]]+\])/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let z=C[1],E=l.slice(C[0].length),H,F=E.match(/^\s*,\s*\{/);if(F){E=E.slice(F[0].length-1);let D=1,k=1;while(k<E.length&&D>0){if(E[k]==="{")D++;else if(E[k]==="}"){if(D--,D===0)break}k++}H=E.substring(0,k+1),E=E.slice(k+1)}let _,J=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(J)_=J[1];try{let D=JSON.parse(z.replace(/'/g,'"')),k={};if(H)try{k=O(H,e)}catch(j){let te=j instanceof Error?j.message:String(j);if(r.debug){let re=y("Include",`Error parsing includeFirst variables: ${te}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let I=!1;for(let j of D){let te=W(j,u,a);if(!te)continue;if(await s(te)){let re=await se(j,k,c,h);t=t.replace(o,()=>re),I=!0;break}}if(!I)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let j=y("Include",`None of the includeFirst paths exist: ${z}`,a,c,h,o);t=t.replace(o,()=>j)}else t=t.replace(o,"")}catch(D){let k=D instanceof Error?D.message:String(D),I=y("Include",`Error processing @includeFirst: ${k}`,a,c,h,o);t=t.replace(o,()=>I)}f.lastIndex=0}}function W(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=M.resolve(v),x=M.resolve(M.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let F of r._layerPartialDirs??[]){let _=M.resolve(F,g);if(_.startsWith(`${M.resolve(F)}${M.sep}`)&&ye(_))return _}l=M.resolve(v,g)}else l=M.resolve(x,g);let o=M.normalize(l),C=o.startsWith(i+M.sep)||o===i,z=o.startsWith(x+M.sep)||o===x,E=!1,H=M.dirname(x);if(o.startsWith(H+M.sep)){if(!M.relative(H,o).split(M.sep).some((D)=>D.startsWith(".")&&D!=="."&&D!==".."))E=!0}if(!C&&!z&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=M.resolve(a);n.add(ie);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function se(f,v={},h,g){let i=W(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=M.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>M.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let q=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${q}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-dgs3d367.js");l=S(l,e)}if(l&&(r.debug||!A()&&!In()))try{let{warnUnbalancedTags:S}=await import("./chunk-e2b2f502.js");S(l,i)}catch{}try{let{processESImports:S}=await import("./chunk-sgengtap.js");l=await S(l,e,i,r,b)}catch(S){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,S instanceof Error?S.message:S)}let o=l,C=L(o);if(C)o=C.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),H="";if(E)H=`<style${E[1]}>${E[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(S,q,w)=>{if(!me(q))return"";return F.push({attrs:q,body:w}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Re(l,i);for(let[S,q]of Object.entries(v))_[S]=q;let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,D=[...l.matchAll(J)].sort((S,q)=>{let w=(S[1]||"").includes("server"),X=(q[1]||"").includes("server");return Number(X)-Number(w)}),k="",I=null,j=!1,te=!1;for(let S of D){let q=S[1]||"",w=S[2]||"";if(me(q))continue;let X=q.includes("server"),be=Ue(q);if(!X&&!/\bsrc\s*=/i.test(q))Fe(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:U}=await import("./chunk-rjv6885r.js");w=U(w,_,f)}let ce="";try{let{extractAndStripCssImports:U,renderVendorStyleTags:Q}=await import("./chunk-c4s25bm2.js"),ne=U(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(U){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,U instanceof Error?U.message:U)}if(be&&w.trim())w=We(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-c4s25bm2.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-4e48zkq0.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:U}=await import("./chunk-gfe1jrw9.js");w=U(w)}let ge=Ee(w);if(!X){let{extractBridgeData:U,generateServerDataBridge:Q}=await import("./chunk-c4s25bm2.js"),ne=Q(w,U(_));if(ne)w=`${ne}
48
- ${w}`}if(ge&&!X){j=!0,I=fe(i,e);let U=N(w),Q=ue(U,I);k+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${I}">${Q}</script>
49
- `;continue}if(X)try{let{extractVariables:U}=await import("./chunk-rm5gbthk.js");await U(w,_,i)}catch(U){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,U)}if(!X&&!ge){let U=q.replace(/\bclient\b/i,"").trim();I=fe(i,e);let Q=N(w),ne=ue(Q,I);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))te=!0;k+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${I}"${U?` ${U}`:""}>${ne}</script>
50
- `}}if(F.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-rjv6885r.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q,w)=>{let X=F[Number(w)];return`<script${X.attrs}>${S(X.body,_,f)}</script>`})}if(I){let S=Te(o,I);if(o=S.html,S.mergedIntoExisting){let w=I,X=S.mergedIntoExisting;k=k.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),I=X}else if(!S.stamped&&j&&!le.has(i))le.add(i),console.warn(`[stx] ${M.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(S.stamped&&S.root!=="body"&&(j||te)&&!pe.has(i)){let w=Yf(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${M.relative(process.cwd(),i)} declares ${j?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let q=S.stamped&&S.root!==null&&Pr(S.root);k=Ie(k,q?I:null)}if(o.includes("@include")||o.includes("@partial"))o=await ms(o,_,i,r,b,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-0hs633pt.js"),G=re(o,_,i,void 0,!0);G=de(G,_,i),G=oe(G);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-0j8zre1m.js");if(G=xe(G,_,i,r),G=we(G,_,i),G=_e(G,_,i,r),G=R(G,_,i),H)G+=`
51
- `+H;if(k)G+=`
52
- `+k;return G}catch(l){if(l instanceof Y)throw l;let o=l instanceof Error?l.message:String(l);return B(f,`Error processing include ${f}: ${o}`,h,g)}}let ee=/@include\s*\(/g,Z;while((Z=ee.exec(t))!==null){let f=Z.index,v=f+Z[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){ee.lastIndex=g;continue}let o=l[1],C,z=x.substring(l[0].length),E=ae(z,0);if(E!==-1)C=z.substring(E+1).trim();let H={};if(C)try{H=O(C,e)}catch(_){let J=_ instanceof Error?_.message:String(_);t=t.replace(i,y("Include",`Error parsing include variables for ${o}: ${J}`,a,c,f)),ee.lastIndex=0;continue}let F=await se(o,H,c,f);t=t.substring(0,f)+F+t.substring(g),ee.lastIndex=0}return t}function hs(c,e){let a=c;function r(b,n,u,t){let T=b,W=!0;while(W){W=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),B=T.match(ie);if(!B||B.index===void 0)break;let se=B.index,ee=B[1],Z=se+B[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=Z,i=-1;while(h>0&&g<T.length){let l=T.slice(g),o=l.match(f),C=l.match(v),z=o?g+o.index:1/0,E=C?g+C.index:1/0;if(z<E)h++,g=z+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=T.slice(Z,i);if(!e[ee])e[ee]=[];if(t)e[ee].unshift(x);else e[ee].push(x);T=T.substring(0,se)+T.substring(i+`@${u}`.length),W=!0}return T}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function ys(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
53
- `)})}
54
- export{Xh,Yf,nt,Sc,Jh,ms,hs,ys};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ra,Nm}from"./chunk-saqzk45g.js";export{Ra as definePlugin,Nm as pluginManager};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import a from"fs";function xt(r){return o(r)}var g=1000,i=new Map;function Xn(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
3
- `)}function nn(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function he(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
4
- export{xt,Xn,nn,he};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ag,ci}from"./chunk-r09kz9bf.js";export{ag as looksLikeGlob,ci as resolveStxTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ji,Yi,Zi,Yg,Zg,Qg,Fl,em,tm}from"./chunk-qnwd5bz4.js";export{Ji as ImageProcessorCache,Fl as applyTransformations,Yg as clearImageCache,em as generateResponsiveVariants,tm as generateSrcset,Yi as getCachedImageResult,Qg as optimizeImage,Zg as processImage,Zi as setCachedImageResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{jm,Bm,Fm,zm,Hm}from"./chunk-2zaatnnh.js";export{Bm as defineAsyncComponent,zm as generateAsyncComponentCSS,Hm as generateAsyncComponentRuntime,Fm as isAsyncComponent,jm as processAsyncDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$e,Ai,Pi,Cg,zt,ul,Eg,dl,hy,He,_n,Ve}from"./chunk-5gx403te.js";import{bl,n}from"./chunk-jqtpzzz4.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{$e as BROWSER_CORE_IMPORTS,Cg as STX_AUTO_IMPORTS,Ai as extractAndStripCssImports,He as extractBridgeData,bl as findInterpolationEnd,dl as generateAutoImportDestructuring,hy as generateBrowserAutoImportDestructuring,_n as generateServerDataBridge,zt as injectBrowserCoreAutoImports,Ve as processClientScript,Eg as referencesName,Pi as renderVendorStyleTags,n as stripCommentsAndLiterals,ul as transformAutoImports};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Sm}from"./chunk-df78j74w.js";import"./chunk-1a237qky.js";import"./chunk-wm029dh0.js";import"./chunk-nn6hvsxp.js";import"./chunk-cvbwxskc.js";import"./chunk-k0t9ye9j.js";import"./chunk-dv56x3g8.js";import"./chunk-akthsg33.js";import"./chunk-r2bxjna3.js";import"./chunk-3922g6sh.js";import"./chunk-11dwmcpy.js";import"./chunk-1ehjzhnc.js";import"./chunk-dbvsa5ya.js";import"./chunk-2mt2zc5y.js";import"./chunk-w8k9fz1w.js";import"./chunk-xtaq95em.js";import"./chunk-6kp4mg3h.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{Sm as buildForProduction};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{at}from"./chunk-wp0qpa50.js";import{St,Jn}from"./chunk-wm029dh0.js";import{Mr,Lr,jr,Fr,Pe}from"./chunk-pp99rmjm.js";import{ge,xn,ml,hl}from"./chunk-5gx403te.js";import{B}from"./chunk-kzc2tqzr.js";import{Mi}from"./chunk-x4jzhgdm.js";import{x}from"./chunk-dv56x3g8.js";import{i}from"./chunk-k0t9ye9j.js";import{U,a}from"./chunk-ctjxcaxq.js";import{Bc}from"./chunk-zc8a2erc.js";import{jn,Bn,Ye,Oe,_a,Ca,Fn}from"./chunk-1a237qky.js";import{fn,Ho}from"./chunk-cvbwxskc.js";import{zn}from"./chunk-jt5tzddc.js";import{on,or,ir}from"./chunk-vnrbjbrw.js";import{Q}from"./chunk-w8k9fz1w.js";import m from"fs";import c from"path";import{createHash as Y}from"crypto";function I(n){return Y("sha256").update(n).digest("hex").slice(0,8)}function W(n=!1){let l=n?Jn():St(),o=I(l);return{content:l,filename:`runtime.${o}.js`,hash:o}}function J(){let n=at(),l=I(n);return{content:n,filename:`router.${l}.js`,hash:l}}import V from"path";import{createHash as ee}from"crypto";function te(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function q(n,l,o={}){let r=V.resolve(n),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);ml();let _={};try{_=await a(o.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>ge(R))),{context:D}=te({__filename:r,__dirname:V.dirname(r),__stx_serverDeclared:u}),A=new Set,T={...U,..._,...o,buildMode:"compile",strict:!1},f=await i(e,D,r,T,A),w=jn(f)+Bn(f)+Ye(f),j=hl();return{route:l,sourceFile:n,html:f,fragment:w,placeholders:j,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:S,status:xn(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function X(n,l){let o=0,r=0;if(!m.existsSync(n))return{copied:o,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),o++,r+=m.statSync(u).size}}}return e(n,l),{copied:o,bytes:r}}async function Sm(n={}){let l=Date.now(),o=c.resolve(n.root||process.cwd()),r=c.resolve(o,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await a(o),S=c.resolve(o,n.componentsDir??e.componentsDir??"components"),_=c.resolve(o,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(o,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",g=Pe(e.app?.head,{known:Fr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=n.routeRules??e.routeRules??{},T=zn(A),f=n.serverApi??e.serverApi,w=typeof f==="object"?f:{};if(f)fn(o,w);if(e.runtimeConfig)B(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let j=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of j)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=Q(o,{pagesDirs:e._layerPageDirs}),Z=["components","layouts","partials"],P=R.filter((s)=>!Z.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${P.length} page routes (${R.length-P.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=W(n.debug),b=J();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",b.filename),b.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${b.filename} (${(b.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],H=[];for(let s of P){let h=T(s.pattern),O=h.rendering==="prerender";if(O&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await q(s.filePath,s.pattern,{configDir:o,componentsDir:S,partialsDir:_,layoutsDir:y,debug:n.debug});if(M.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,b.filename),t.html=jr(t.html,g,{bodyScripts:[`<script src="/__stx/${b.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Mr(t.html,u);if(g.htmlAttrs)t.html=Lr(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let G=p[1];t.html=t.html.replace(" "+G,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${G}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await x(t.html),O){let p=await Fn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=Oe(t.html,D,!0);let K=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),L=c.join("server","pages",`${K}.compiled.json`),z=c.join("server","fragments",`${K}.html`);await Bun.write(c.join(r,L),JSON.stringify(t,null,2)),await Bun.write(c.join(r,z),t.fragment),H.push({pattern:s.pattern,compiledPath:L,fragmentPath:z,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let k=c.resolve(o,d);if(m.existsSync(k)){let{copied:s,bytes:h}=X(k,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let E=ir(o);if(E){let{copied:s,bytes:h}=X(E,c.join(r,"public",or));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${on}/`)}let F={runtime:v.filename,router:b.filename},C=_a(H,F,r);if(C.routeRules=A,C.routerContainer=D,f)C.apiRoutes=await Ho(o,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Mi(o,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Bc(e._layerGraph),null,2));Ca(C,r);let N=Date.now()-l;return console.log(`
3
- [stx build] Done in ${N}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:N}}
4
- export{Sm};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{eh,Oa,Tu,th,nh,rh,sh,oh,$u,Ru,ih,ah,ch,lh}from"./chunk-fh72k2ks.js";import"./chunk-k0t9ye9j.js";import"./chunk-dv56x3g8.js";import"./chunk-akthsg33.js";import"./chunk-r2bxjna3.js";import"./chunk-3922g6sh.js";import"./chunk-11dwmcpy.js";import"./chunk-1ehjzhnc.js";import"./chunk-dbvsa5ya.js";import"./chunk-2mt2zc5y.js";import"./chunk-w8k9fz1w.js";import"./chunk-xtaq95em.js";import"./chunk-6kp4mg3h.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{Tu as SUSPENSE_RESOLVER_RUNTIME,Oa as buildSuspenseResolveScript,oh as createStreamRenderer,rh as extractStreamBoundaries,lh as generateHydrationRuntime,Ru as islandDirective,ah as processSectionDirectives,nh as processStreamDirectives,ih as registerStreamingDirectives,th as renderStreamingPage,eh as streamTemplate,sh as streamTemplateSimple,ch as streamToResponse,$u as streamingSuspenseDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xa,bm,Co,wm,eu,tu,vm,xm}from"./chunk-g4eheg0t.js";import"./chunk-szp7ajfm.js";import"./chunk-99e3mxnn.js";import"./chunk-cvbwxskc.js";import"./chunk-mce3g2wb.js";import"./chunk-2mt2zc5y.js";import"./chunk-w8k9fz1w.js";import"./chunk-xtaq95em.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import{ve,yg}from"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.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{Ko}from"./chunk-r2bxjna3.js";export{Ko as warnUnbalancedTags};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Oo,Na,Da,Lh}from"./chunk-y2e2zm6y.js";export{Oo as NATIVE_COMPONENTS,Na as compileToNative,Da as createHotReloadServer,Lh as default};
@@ -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-4e48zkq0.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-c4s25bm2.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-4e48zkq0.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-c4s25bm2.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,2 +0,0 @@
1
- // @bun
2
- import{dh,ph}from"./chunk-0g2mg8cw.js";export{ph as ensureTeleportTargets,dh as processTeleportDirectives};
@@ -1,24 +0,0 @@
1
- // @bun
2
- import{$e,Ws,qs,Ks,ve,xi,wn,Xc,Jc,Si,Yc,Zc,Gs,_i,Ci,Qc,Ei,kn}from"./chunk-5gx403te.js";import{C}from"./chunk-fdjx4vs3.js";import{a}from"./chunk-ctjxcaxq.js";import{Ao}from"./chunk-szp7ajfm.js";import{l}from"./chunk-np8wgbsa.js";import{existsSync as G,readFileSync as U}from"fs";import h from"path";var ke=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),oe=kn.filter((e)=>!ke.has(e)).sort(),ce=[...C].sort(),we=[...new Set([...oe,...ce])].sort(),De=new Set(oe),Te=new Set(ce),Ee=new Set(we),se=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Ce(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ae(e,t){let o=[];for(let d of t){if(d.offset===void 0)continue;let i=d.kind==="server"?De:Te;se.lastIndex=0;for(let c of d.code.matchAll(se)){let m=c.index+c[0].indexOf("{")+1;for(let f of c[1].matchAll(/[^,]+/g)){let k=f[0];if(/^\s*type\s/.test(k))continue;let b=/^\s*([A-Za-z_$][\w$]*)/.exec(k);if(!b)continue;let r=b[1];if(!Ee.has(r)||i.has(r))continue;let u=d.offset+m+f.index+b[0].length-r.length,g=e.slice(0,u),E=g.split(`
3
- `).length;o.push({line:E,column:u-(g.lastIndexOf(`
4
- `)+1)+1,offset:u,length:r.length,name:r,kind:d.kind,message:Ce(r,d.kind)})}}}return o}import M from"path";var Ne="@stacksjs/stx-typescript-plugin";function Oe(e,t){let o=M.resolve(e);for(;;){let d=M.join(o,"tsconfig.json");if(t(d))return d;let i=M.dirname(o);if(i===o)return;o=i}}function le(e,t,o){let d=Oe(e,o);if(!d)return;let i=new Set,c=(m)=>{if(i.has(m))return;i.add(m);let f=t(m);if(!f)return;let k=f.compilerOptions?.plugins;if(Array.isArray(k)){let r=k.find((g)=>g?.name===Ne),u=Array.isArray(r?.libs)?r.libs.filter((g)=>typeof g==="string"):[];return r?{configPath:m,libs:u.map((g)=>M.resolve(M.dirname(m),g))}:null}let b=typeof f.extends==="string"?[f.extends]:Array.isArray(f.extends)?f.extends:[];for(let r of[...b].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let u=M.resolve(M.dirname(m),r.endsWith(".json")?r:`${r}.json`),g=c(u);if(g!==void 0)return g}return};return c(d)??void 0}function xa(e,t="",o="",d=t,i){let c=e.startLine>1?`
5
- `.repeat(e.startLine-1):"",m=xi(_i(e)+e.code,d),f=e.kind==="client"&&i?i.project(m.code):void 0,k=wn(f?.code??m.code),b=e.kind==="client"||e.kind==="plain"?Yc(t,e.code):"",r=(c+k).split(`
6
- `),u=r.length,g=new Map;for(let S of m.declarations)for(let[D,A]of S.text.split(`
7
- `).entries())if(r.push(A),S.origin)g.set(r.length,{...S.origin,line:e.startLine+S.origin.line-1+D,column:D===0?S.origin.column:1});r.push(...b.split(`
8
- `),...(i?.declarations??"").split(`
9
- `),...(e.kind==="server"?qs(e.code):"").split(`
10
- `)),r.push("export {}","");let E=Gs(r.join(`
11
- `),o);return{text:E.code,sourceLineCount:u,lineMap:g,scriptColumns:new Map([...m.columns].map(([S,D])=>[S+e.startLine-1,D])),importColumns:E.columns,componentColumns:f?new Map([...f.columns].map(([S,D])=>[S+e.startLine-1,D])):void 0}}function bm(e,t="",o=""){return xa(e,t,o).text}var _e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function Me(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],o=new Set(C),d=[];for(let{file:i,names:c}of e){let m=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));d.push(` export * from ${m}`);for(let f of c){if(o.has(f)||_e.has(f))continue;o.add(f),t.push(`declare const ${f}: typeof import(${m})[${JSON.stringify(f)}]`)}}return t.push("declare module '@composables' {",...d,"}"),t.join(`
12
- `)}function Co(e,t,o){return`${e}.__stx_${t}${o}.ts`}function wm(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function eu(){return ue("stx.d.ts")}function tu(){return ue("stx-module.d.ts")}function ue(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(G(t))return t;return null}var Re=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function pe(e){return e>=1000&&e<2000}function de(e){let t="",o=!1,d=!1;for(let i=0;i<e.length;i++){let c=e[i];if(o){if(t+=c,d)d=!1;else if(c==="\\")d=!0;else if(c==='"')o=!1;continue}if(c==='"'){o=!0,t+=c;continue}if(c==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
13
- `)i++;t+=`
14
- `;continue}if(c==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=c}return t.replace(/,(\s*[}\]])/g,"$1")}function je(e){try{return JSON.parse(de(U(e,"utf8")))}catch{return}}function Pe(e){let t=h.resolve(e),o;for(;;){let r=h.join(t,"tsconfig.json");if(G(r)){o=r;break}let u=h.dirname(t);if(u===t)break;t=u}if(!o)return{};let d=new Set,i=o,c,m,f=o;while(i&&!d.has(i)){d.add(i);let r;try{r=JSON.parse(de(U(i,"utf8")))}catch{break}let u=r?.compilerOptions??{};if(!c&&u.paths&&typeof u.paths==="object")c=u.paths,f=i;if(!m&&typeof u.baseUrl==="string")m=h.resolve(h.dirname(i),u.baseUrl);if(c&&m)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!c)return{};let k=m??h.dirname(f),b={};for(let[r,u]of Object.entries(c)){if(!Array.isArray(u))continue;b[r]=u.map((g)=>typeof g==="string"&&!h.isAbsolute(g)?h.resolve(k,g):g)}return{paths:b}}async function vm(e,t={}){let o=t.client!==!1,d=t.server!==!1,i=t.templates!==!1,c=i?await a():void 0,m=t.componentsDir??c?.componentsDir,f=t.partialsDir??c?.partialsDir,k=t.layoutsDir??c?.layoutsDir,b=new Map(await Promise.all(e.map(async(n)=>[n,await Bun.file(n).text()]))),r=[...b.values()].some((n)=>Ws(ve(n).filter((s)=>s.kind==="server").map((s)=>s.code).join(`
15
- `))),u=new Map,g=new Map,E=[],S=[],D=0,A=0,O=eu();for(let n of e){let s=b.get(n),x=ve(s).filter((p)=>{if(p.kind==="server")return d;return o}),T=ve(s).filter((p)=>p.kind==="server").map((p)=>p.code).join(`
16
- `),B=Si(ve(s)),_=Ks(s);for(let p of ae(s,x))E.push({file:n,line:p.line,column:p.column,code:0,message:p.message,category:"error",blockKind:p.kind});if(o&&T){let p=x.filter((v)=>v.kind!=="server"),y=[...new Set(p.flatMap((v)=>Zc(T,v.code)))];if(y.length>0)g.set(n,{names:y,line:p[0].startLine,kind:p[0].kind})}let L=h.dirname(h.resolve(n)),w=i?Ci(s,{runtimeGlobals:!O,originDir:L,filePath:h.resolve(n),componentsDir:m,partialsDir:f,layoutsDir:k,inheritedContractsKnown:r}):null,I=w?[...w.lineMap.values()].filter((p)=>p.expression).length:0;if(x.length===0&&I===0&&!_?.checks.length)continue;if(S.push(n),D+=x.length,A+=I,_&&o&&(x.some((p)=>p.kind!=="server")||!i&&_.checks.length)){let p=Ci(s,{runtimeGlobals:!1,globals:!1,originDir:L,templateExpressions:!1,scriptKinds:["client","plain"],nativeChecks:!i});u.set(Co(n,"client",0),{virtual:p,source:p.text,origin:n,kind:"client"})}if(x.forEach((p,y)=>{if(_&&p.kind!=="server")return;let v=xa(p,T,L,B);u.set(Co(n,p.kind,y),{virtual:v,source:v.text,origin:n,kind:p.kind})}),w&&(I>0||_?.checks.length))u.set(Co(n,"template",0),{source:w.text,origin:n,kind:"template",virtual:w})}if(u.size===0)return{diagnostics:E,checkedFiles:S,blockCount:0,expressionCount:0};let R=(t.extraLibs??[]).map((n)=>h.resolve(n)),fe=le(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),je,G);for(let n of fe?.libs??[])if(!R.includes(n)&&G(n))R.push(n);if(O)R.push(O);let W=O?tu():null;if(W)R.push(W);let z=`${l()}/typecheck/__stx_globals.d.ts`,me=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",Xc(O?Jc(U(O,"utf8")):void 0),...O?[]:["declare const window: any",...C.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...$e.map((n)=>`declare const ${n}: any`)].join(`
17
- `),Me(await Ao())].filter(Boolean).join(`
18
- `),j=`${l()}/typecheck`;await Bun.$`rm -rf ${j}`.quiet().nothrow(),await Bun.$`mkdir -p ${j}`.quiet().nothrow(),await Bun.write(z,me);let P=new Map,ge=0;for(let[n,s]of u){let x=`${ge++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${j}/${x}`,s.source),P.set(x,s)}let he={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Pe(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},q=async(n,s)=>{let x=`${j}/tsconfig${s===1?"":`.${s}`}.json`;await Bun.write(x,JSON.stringify({compilerOptions:he,files:n.map((B)=>`${j}/${B}`).concat(z,...R)},null,2));let T=Bun.spawnSync(["bun","x","tsc","-p",x,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(T.stdout)+new TextDecoder().decode(T.stderr),exitCode:T.exitCode??0}},H=await q([...P.keys()],1),Z=H.output,K=[],Q=H.exitCode,Y=0,xe=new Set(R.map((n)=>n.split("/").pop())),ee=0,F=new Set,te=(n)=>{for(let s of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
19
- `)){let x=s.match(Re);if(!x)continue;if(Y++,xe.has(x[1].split("/").pop()))ee++;let[,T,B,_,L,w,I]=x,p=T.split("/").pop(),y=P.get(p);if(!y)continue;if(pe(Number(w)))F.add(p);let v=Number(B),X=Number(_),re,J=y.kind;if(y.virtual){let N=Ei(y.virtual,v,X)??(y.kind!=="template"&&pe(Number(w))?Ei(y.virtual,y.virtual.sourceLineCount,1):null);if(!N||y.kind==="template"&&!N.expression&&!N.diagnosticOrigin)continue;if(Qc(N,Number(w)))continue;v=N.line,X=N.column,re=N.expression?.code.trim(),J=N.diagnosticOrigin??J}K.push({file:y.origin,line:v,column:X,code:Number(w),message:I,category:L==="error"?"error":"warning",blockKind:J,expression:re})}};te(Z);let ye=Y,be=ee;if(F.size>0&&F.size<P.size){let n=[...P.keys()].filter((s)=>!F.has(s));te((await q(n,2)).output)}if(o)for(let[n,s]of g){if(s.names.length===0)continue;K.push({file:n,line:s.line,column:1,code:0,message:`${s.names.length===1?"1 value reaches":`${s.names.length} values reach`} this block on the implicit bridge and ${s.names.length===1?"is":"are"} untyped: ${s.names.join(", ")}. Declare them with defineClientPayload({ ${s.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:s.kind})}K.push(...E);let ne=new Set,V=K.filter((n)=>{let s=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(ne.has(s))return!1;return ne.add(s),!0});V.sort((n,s)=>n.file.localeCompare(s.file)||n.line-s.line||n.column-s.column);let ie=be>0&&V.length===0,Se=ie||Q!==0&&ye===0?`${ie?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${Q} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
20
- ${Z.trim().split(`
21
- `).slice(0,12).join(`
22
- `)||"(no output)"}`:void 0;return{diagnostics:V,checkedFiles:S,blockCount:D,expressionCount:A,failure:Se}}function xm(e){return e.map((t)=>{let o=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${o}`}).join(`
23
- `)}
24
- export{xa,bm,Co,wm,eu,tu,vm,xm};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ty,xs,ti,Ss,gr,ni,ri,tg,ks,_s,Cs,si,_c,ng,Ct}from"./chunk-2mt2zc5y.js";import"./chunk-w8k9fz1w.js";import"./chunk-xtaq95em.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import{K}from"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{tg as bindLoopInterpolations,ty as clearScriptScanCache,ks as convertServerLoopAttributesToDirectives,ni as convertSignalDirectivesToAttributes,_s as convertSignalLoopsToAttributes,gr as extractClientSignalNames,K as extractExports,_c as findMarkupIndexOutsideScripts,Ss as hasSignalsSyntax,ti as parseLoopExpression,ri as preEvalLiteralReactiveIfs,Cs as processScriptSetup,si as processSignals,ng as rewriteStxImportSpecifiers,xs as scanScriptTags,Ct as stripStxRuntimeImports};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$a,ru}from"./chunk-4517hny7.js";import"./chunk-k1ew643q.js";import"./chunk-f4vgagjb.js";export{ru as createImageHandler,$a as handleImageRequest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{uo,Gt,Bl,qg}from"./chunk-pk714ynv.js";export{uo as generateServiceWorker,qg as generateServiceWorkerAuto,Gt as getServiceWorkerFileName,Bl as isWorkboxEnabled};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fh,gh,mh,hh,yh,bh}from"./chunk-v0tdg16k.js";export{hh as generateTransitionCSS,yh as generateTransitionRuntime,fh as performEnter,gh as performLeave,bh as processTransitionAttributes,mh as processTransitionDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ia,ku,Gn,Zm,_u,Cu,Eu,Qm}from"./chunk-mkwavsb3.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{Gn as Validator,ku as defineForm,_u as processErrorDirective,Cu as processErrorsDirective,Qm as processFormValidationDirectives,Eu as processHasErrorsDirective,Ia as useForm,Zm as v};
@@ -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,3 +0,0 @@
1
- // @bun
2
- import"./chunk-pp99rmjm.js";import"./chunk-fdjx4vs3.js";import"./chunk-3w7gacva.js";import"./chunk-5gx403te.js";import"./chunk-kzc2tqzr.js";import"./chunk-x4jzhgdm.js";import"./chunk-r09kz9bf.js";import"./chunk-ttjscvre.js";import{l}from"./chunk-np8wgbsa.js";import u from"fs";import m from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||l(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=m.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),c=JSON.parse(p);if(c.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(c.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\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\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"),t.push(" STX Story Visual Regression Tests"),t.push("\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\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"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\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\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"),t.push(""),t.join(`
3
- `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -1,12 +0,0 @@
1
- // @bun
2
- import"./chunk-fdjx4vs3.js";import"./chunk-3w7gacva.js";import"./chunk-pp99rmjm.js";import{S,_,T,ne}from"./chunk-5gx403te.js";import"./chunk-kzc2tqzr.js";import"./chunk-x4jzhgdm.js";import{fr}from"./chunk-wzvdr4ta.js";import{existsSync as C}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var u=new Map,h=S(64),w=new Set,v=0,E=new Set(b);function z(){u.clear(),h.clear()}function R(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function P(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function I(s){if(!s)return[];let o=_(s,v),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of E){if(w.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function M(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=fr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=I(s);if(t.length===0)return null;let i=o??M();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=ne({loader:"ts",target:"browser",define:T()}),k=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=R(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
3
- ${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let x=t.filter((n)=>!d.has(n)&&!P(s,n));if(x.length>0)console.warn(`[stx] could not bundle ${x.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return u.set(r,""),null;let O=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
4
- `),y=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
- ;(function(){
6
- var __s = window.stx = window.stx || {};
7
- ${m.join(`
8
-
9
- `)}
10
- ${O}
11
- })();
12
- </script>`;return u.set(r,y),y}function q(s){w.clear();for(let o of s)w.add(o);v++}export{q as __setRuntimeOwnedForTest,z as clearFrameworkComposableCache,V as getFrameworkComposableScript,I as referencedFrameworkComposables,R as selectComposableFiles};
@@ -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{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,2 +0,0 @@
1
- // @bun
2
- import{Xh,Yf,nt,Sc,Jh,ms,hs,ys}from"./chunk-akthsg33.js";import"./chunk-3922g6sh.js";import"./chunk-11dwmcpy.js";import"./chunk-dbvsa5ya.js";import"./chunk-xtaq95em.js";import"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{Jh as clearOnceStore,Sc as onceStore,nt as partialsCache,ms as processIncludes,hs as processStackPushDirectives,ys as processStackReplacements,Xh as resetUnscopedSignalWarnings,Yf as topLevelElements};