@stacksjs/stx 0.2.706 → 0.2.708

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 (266) hide show
  1. package/dist/app-shell.d.ts +2 -1
  2. package/dist/app-shell.js +5 -2
  3. package/dist/{chunk-e3yhx053.js → chunk-029qng4p.js} +5 -5
  4. package/dist/chunk-03p4w958.js +2 -0
  5. package/dist/chunk-0dve54ne.js +3 -0
  6. package/dist/chunk-0jtrdgyv.js +422 -0
  7. package/dist/{chunk-m4j9gedb.js → chunk-0myrwz84.js} +48 -8
  8. package/dist/chunk-12vjp2gr.js +2 -0
  9. package/dist/chunk-18fr730w.js +2 -0
  10. package/dist/chunk-19knw8c6.js +2 -0
  11. package/dist/{chunk-5bgkb4vm.js → chunk-1kwsnqr1.js} +3 -3
  12. package/dist/{chunk-n2ema4wf.js → chunk-1xjv71dw.js} +2 -2
  13. package/dist/chunk-27catnpa.js +2 -0
  14. package/dist/chunk-29sapda2.js +2 -0
  15. package/dist/{chunk-d597d0dp.js → chunk-2aarvd3a.js} +6 -6
  16. package/dist/chunk-2k6d8s6h.js +2 -0
  17. package/dist/chunk-2qf6kd9r.js +2 -0
  18. package/dist/chunk-2snfd93r.js +2 -0
  19. package/dist/chunk-2srb5f7t.js +2 -0
  20. package/dist/{chunk-y91rz3rq.js → chunk-3457kk19.js} +7 -7
  21. package/dist/chunk-3907sad1.js +2 -0
  22. package/dist/chunk-3nsdb1fg.js +2 -0
  23. package/dist/chunk-3qnke2jb.js +2 -0
  24. package/dist/chunk-3sg2ardr.js +2 -0
  25. package/dist/chunk-3t3p2c1t.js +65 -0
  26. package/dist/chunk-3vsnnr1b.js +2 -0
  27. package/dist/{chunk-3850m7ab.js → chunk-3wkgd883.js} +1 -1
  28. package/dist/{chunk-epnpst9q.js → chunk-3xmt01wr.js} +11 -11
  29. package/dist/{chunk-t27fecet.js → chunk-42w6snem.js} +4 -4
  30. package/dist/chunk-48936paw.js +2 -0
  31. package/dist/chunk-4c1fbthr.js +2 -0
  32. package/dist/{chunk-zggdhtmn.js → chunk-4ckxs446.js} +3 -3
  33. package/dist/chunk-4cs5t287.js +2 -0
  34. package/dist/chunk-4fxg20je.js +2 -0
  35. package/dist/chunk-58v34kba.js +2 -0
  36. package/dist/chunk-5n4qg8za.js +3 -0
  37. package/dist/{chunk-j9h41w8b.js → chunk-609pekf5.js} +2 -2
  38. package/dist/chunk-65fcex5r.js +42 -0
  39. package/dist/{chunk-1kr1mpft.js → chunk-67abad76.js} +1 -1
  40. package/dist/{chunk-7smgebdq.js → chunk-6cz1sbb1.js} +3 -3
  41. package/dist/{chunk-4sesw88b.js → chunk-6n11z33h.js} +5 -5
  42. package/dist/chunk-6ndeycxk.js +2 -0
  43. package/dist/{chunk-tp4eqfxq.js → chunk-6ts3sthp.js} +2 -2
  44. package/dist/chunk-75n3vbtk.js +2 -0
  45. package/dist/{chunk-8w4y3dx3.js → chunk-768evhvm.js} +2 -2
  46. package/dist/chunk-7dc3n69c.js +3 -0
  47. package/dist/{chunk-66cfnzem.js → chunk-7kaadsd1.js} +5 -5
  48. package/dist/{chunk-ccqe741j.js → chunk-83p5k4eb.js} +2 -2
  49. package/dist/chunk-86775qk0.js +2 -0
  50. package/dist/chunk-8c4zbq1k.js +2 -0
  51. package/dist/chunk-8s4rxgs8.js +2 -0
  52. package/dist/chunk-8t9em8md.js +2 -0
  53. package/dist/{chunk-vfjenjez.js → chunk-8v2vbc4y.js} +1 -1
  54. package/dist/chunk-8z469777.js +2 -0
  55. package/dist/{chunk-9p452mq6.js → chunk-90kfvtf6.js} +114 -114
  56. package/dist/{chunk-rcdjse0z.js → chunk-93y8zwcz.js} +5 -5
  57. package/dist/chunk-9736003n.js +2 -0
  58. package/dist/chunk-97r557ws.js +2 -0
  59. package/dist/chunk-9adx6f4k.js +3 -0
  60. package/dist/{chunk-5w1erc2m.js → chunk-9dg5ja4w.js} +1 -1
  61. package/dist/chunk-9nvywf05.js +3 -0
  62. package/dist/chunk-9wgvn5rn.js +24 -0
  63. package/dist/chunk-9whmbfwx.js +2 -0
  64. package/dist/{chunk-2e2qnce5.js → chunk-9xb33nz0.js} +2 -2
  65. package/dist/chunk-a32xsr61.js +11 -0
  66. package/dist/{chunk-3hxd5td3.js → chunk-am4wadh7.js} +2 -2
  67. package/dist/{chunk-wqe98032.js → chunk-an387127.js} +2 -2
  68. package/dist/{chunk-bsr9wnq4.js → chunk-ap30qs8p.js} +2 -2
  69. package/dist/chunk-avr65xra.js +2 -0
  70. package/dist/chunk-axwwhdtt.js +2 -0
  71. package/dist/chunk-b6318vv3.js +2 -0
  72. package/dist/{chunk-7kn0d1f1.js → chunk-b7j48bq9.js} +2 -2
  73. package/dist/chunk-bcr8sq50.js +2 -0
  74. package/dist/chunk-bhpsr1mt.js +20 -0
  75. package/dist/{chunk-3ja845kw.js → chunk-c2b5p621.js} +171 -171
  76. package/dist/{chunk-11mjqfde.js → chunk-c71f6mfr.js} +45 -45
  77. package/dist/chunk-ccty08sm.js +32 -0
  78. package/dist/chunk-cjx11tgd.js +2 -0
  79. package/dist/{chunk-njhd845r.js → chunk-ckrmrdjp.js} +5 -5
  80. package/dist/chunk-cqnpjdc9.js +2 -0
  81. package/dist/{chunk-k296qq0p.js → chunk-cwhzk2n3.js} +2 -2
  82. package/dist/{chunk-nv886zy6.js → chunk-d2xnkt8m.js} +10 -10
  83. package/dist/chunk-dedmk383.js +2 -0
  84. package/dist/chunk-dhdt7e54.js +2 -0
  85. package/dist/chunk-dxqvv686.js +3 -0
  86. package/dist/chunk-e5vsw0fw.js +4 -0
  87. package/dist/{chunk-qef5mz20.js → chunk-e8brwwp1.js} +105 -105
  88. package/dist/{chunk-b3sw5ykg.js → chunk-edka95zp.js} +3 -3
  89. package/dist/{chunk-y7xsjr28.js → chunk-erqsgfdj.js} +1 -1
  90. package/dist/chunk-eywx2f4h.js +2 -0
  91. package/dist/chunk-f6ybdjt0.js +14 -0
  92. package/dist/{chunk-0qtygx7m.js → chunk-f9b7847f.js} +4 -4
  93. package/dist/{chunk-44c1mbye.js → chunk-fcbd7kwj.js} +3 -3
  94. package/dist/chunk-fj3pct59.js +2 -0
  95. package/dist/chunk-fvk1xr5a.js +2 -0
  96. package/dist/{chunk-b2j7s1a2.js → chunk-g1tq4xdb.js} +2 -2
  97. package/dist/chunk-g6wd49b5.js +2 -0
  98. package/dist/chunk-gk0nq2ky.js +2 -0
  99. package/dist/{chunk-z9csfarm.js → chunk-gvs17jd0.js} +11 -11
  100. package/dist/chunk-h6pmg82p.js +4 -0
  101. package/dist/chunk-h8kbcz9t.js +2 -0
  102. package/dist/chunk-h9n71rdn.js +2 -0
  103. package/dist/{chunk-eb3xg8an.js → chunk-hb77kw66.js} +1 -1
  104. package/dist/{chunk-a8erwxng.js → chunk-hmkg3xy0.js} +3 -3
  105. package/dist/{chunk-yn9kvsk1.js → chunk-j2mpqa4p.js} +2 -2
  106. package/dist/chunk-j7gg6xrc.js +2 -0
  107. package/dist/{chunk-gp9k0t3g.js → chunk-jb5sftzz.js} +2 -2
  108. package/dist/{chunk-t8d33x9w.js → chunk-khrckvwn.js} +4 -4
  109. package/dist/{chunk-4x2gnvz1.js → chunk-kxf8z7vp.js} +2 -2
  110. package/dist/{chunk-ygtfjnqj.js → chunk-kxwfrdt3.js} +2 -2
  111. package/dist/{chunk-ah5ch04j.js → chunk-mr3r8crk.js} +2 -2
  112. package/dist/chunk-mzwa2478.js +2 -0
  113. package/dist/chunk-n6carvxa.js +2 -0
  114. package/dist/chunk-ncs2j5kc.js +3 -0
  115. package/dist/{chunk-b1a79hgk.js → chunk-nde9yj3n.js} +2 -2
  116. package/dist/{chunk-2gzrx4ma.js → chunk-p3dkhz9v.js} +56 -56
  117. package/dist/{chunk-3ys3sa08.js → chunk-qa9t9k6z.js} +1 -1
  118. package/dist/{chunk-p4czdmrr.js → chunk-qcw1neka.js} +2 -2
  119. package/dist/chunk-r5k21k3x.js +54 -0
  120. package/dist/chunk-r6bc2q44.js +2 -0
  121. package/dist/{chunk-sxf17xfc.js → chunk-rb2a1qxb.js} +6 -6
  122. package/dist/chunk-rdj74dqc.js +2 -0
  123. package/dist/chunk-rswg7xsg.js +18 -0
  124. package/dist/chunk-rtbkjq0y.js +2 -0
  125. package/dist/chunk-rwjgpmrw.js +2 -0
  126. package/dist/chunk-s1vj8gtz.js +21 -0
  127. package/dist/{chunk-416jy1m5.js → chunk-s9b6abkb.js} +2 -2
  128. package/dist/{chunk-2p34qf9c.js → chunk-stvw8y3c.js} +2 -2
  129. package/dist/chunk-sy1btryy.js +2 -0
  130. package/dist/chunk-sz0e6tpq.js +20 -0
  131. package/dist/{chunk-9ra3ne11.js → chunk-t63f15yh.js} +3 -3
  132. package/dist/{chunk-2v7t87n8.js → chunk-t6ayy0t5.js} +2 -2
  133. package/dist/chunk-t7mbaf69.js +2 -0
  134. package/dist/{chunk-x7rtrdqq.js → chunk-tvcr9sct.js} +3 -3
  135. package/dist/chunk-v5s6r2b3.js +130 -0
  136. package/dist/chunk-vqratjvb.js +33 -0
  137. package/dist/chunk-vstvadc2.js +12 -0
  138. package/dist/chunk-w2h6nn70.js +2 -0
  139. package/dist/chunk-w8yv9hnf.js +2 -0
  140. package/dist/{chunk-ktkmv1j8.js → chunk-wbfg7p3k.js} +4 -4
  141. package/dist/chunk-weaxr0qe.js +2 -0
  142. package/dist/{chunk-3392k9vm.js → chunk-wp6q0geg.js} +2 -2
  143. package/dist/{chunk-2nqt1m3m.js → chunk-wt18wv6x.js} +2 -2
  144. package/dist/{chunk-jkywbfb0.js → chunk-x2gxx8eg.js} +2 -2
  145. package/dist/chunk-xw8wwcr8.js +25 -0
  146. package/dist/{chunk-xc03cdet.js → chunk-xyyt8v1r.js} +28 -28
  147. package/dist/chunk-ykmcnk3x.js +2 -0
  148. package/dist/chunk-yw66yks2.js +43 -0
  149. package/dist/chunk-z05dbey1.js +2 -0
  150. package/dist/chunk-zaj3gzet.js +2 -0
  151. package/dist/{chunk-w7e28p74.js → chunk-zav8yrtp.js} +9 -9
  152. package/dist/{chunk-ywzh979k.js → chunk-zecgd1wz.js} +4 -4
  153. package/dist/{chunk-c3hr5mm2.js → chunk-zjaw79zp.js} +2 -2
  154. package/dist/chunk-zjcmybab.js +3 -0
  155. package/dist/{chunk-fgr56q3w.js → chunk-zjw6j2x0.js} +4 -4
  156. package/dist/{chunk-k7pmzreg.js → chunk-zn3c0ew5.js} +3 -3
  157. package/dist/chunk-ztckg7a3.js +2 -0
  158. package/dist/cli.js +46 -46
  159. package/dist/craft-entry.js +2 -2
  160. package/dist/craft.js +2 -2
  161. package/dist/dev-server/serve-app.js +1 -1
  162. package/dist/expressions.js +6 -2
  163. package/dist/index.d.ts +1 -0
  164. package/dist/index.js +1 -0
  165. package/dist/island-chunking.js +5 -1
  166. package/dist/native/accessibility.d.ts +2 -2
  167. package/dist/native/accessibility.js +5 -3
  168. package/dist/native/compiler/html-to-ir.js +1 -1
  169. package/dist/native/runtime/native-host.js +5 -5
  170. package/dist/page-head.d.ts +2 -0
  171. package/dist/page-head.js +35 -0
  172. package/dist/production-builder.js +1 -1
  173. package/dist/production-server.js +2 -2
  174. package/dist/pwa.js +3 -3
  175. package/dist/site-builder/i18n.js +1 -1
  176. package/dist/ssg.js +36 -36
  177. package/dist/template-compiler.js +2 -1
  178. package/dist/utils.js +41 -0
  179. package/package.json +5 -5
  180. package/dist/chunk-09801kkv.js +0 -2
  181. package/dist/chunk-0s55c880.js +0 -2
  182. package/dist/chunk-0ys97vq8.js +0 -2
  183. package/dist/chunk-13jg9qpq.js +0 -2
  184. package/dist/chunk-1e79xcc8.js +0 -2
  185. package/dist/chunk-1yt4ynxh.js +0 -2
  186. package/dist/chunk-2whqx2c0.js +0 -2
  187. package/dist/chunk-2xtzzx00.js +0 -2
  188. package/dist/chunk-4t9cggwf.js +0 -2
  189. package/dist/chunk-5g7m27e1.js +0 -21
  190. package/dist/chunk-5h1ahj7m.js +0 -2
  191. package/dist/chunk-5zqxzyxk.js +0 -2
  192. package/dist/chunk-68wezwr7.js +0 -2
  193. package/dist/chunk-7gw96jpj.js +0 -2
  194. package/dist/chunk-7w2mrg3s.js +0 -2
  195. package/dist/chunk-8hhyp9p6.js +0 -2
  196. package/dist/chunk-926fs6g7.js +0 -2
  197. package/dist/chunk-93ft5jea.js +0 -3
  198. package/dist/chunk-94gp1g2f.js +0 -2
  199. package/dist/chunk-983zpa57.js +0 -3
  200. package/dist/chunk-98yf0aq9.js +0 -4
  201. package/dist/chunk-9wq145yr.js +0 -2
  202. package/dist/chunk-a4r93m1q.js +0 -2
  203. package/dist/chunk-aea12k73.js +0 -2
  204. package/dist/chunk-b378jpbp.js +0 -2
  205. package/dist/chunk-b7e07ybq.js +0 -3
  206. package/dist/chunk-bfhks7zf.js +0 -43
  207. package/dist/chunk-bhnq6xr5.js +0 -2
  208. package/dist/chunk-bksjh409.js +0 -2
  209. package/dist/chunk-c4sskkv6.js +0 -421
  210. package/dist/chunk-ca0vn95n.js +0 -18
  211. package/dist/chunk-cbdyns7r.js +0 -3
  212. package/dist/chunk-cknbhyw6.js +0 -2
  213. package/dist/chunk-csx3zne1.js +0 -3
  214. package/dist/chunk-d7vmzkjy.js +0 -2
  215. package/dist/chunk-djwat8vn.js +0 -2
  216. package/dist/chunk-dm7am3p3.js +0 -2
  217. package/dist/chunk-dpjs0ajs.js +0 -2
  218. package/dist/chunk-e41h5yrz.js +0 -11
  219. package/dist/chunk-f498cdg5.js +0 -2
  220. package/dist/chunk-fazw6sxz.js +0 -2
  221. package/dist/chunk-ffddd2t8.js +0 -14
  222. package/dist/chunk-fk71r3h6.js +0 -2
  223. package/dist/chunk-g1bed7se.js +0 -2
  224. package/dist/chunk-gbgbhpms.js +0 -2
  225. package/dist/chunk-gxtmq5r2.js +0 -130
  226. package/dist/chunk-h1fpjmr8.js +0 -2
  227. package/dist/chunk-ha4vb9a6.js +0 -2
  228. package/dist/chunk-hadbgke6.js +0 -2
  229. package/dist/chunk-hkmewh5h.js +0 -12
  230. package/dist/chunk-hmnj2hrh.js +0 -20
  231. package/dist/chunk-htyee0b7.js +0 -3
  232. package/dist/chunk-hz5vabap.js +0 -25
  233. package/dist/chunk-j10dhha2.js +0 -2
  234. package/dist/chunk-kjc1f6af.js +0 -2
  235. package/dist/chunk-m28d7w2s.js +0 -54
  236. package/dist/chunk-mv4wfsc5.js +0 -2
  237. package/dist/chunk-mwwd425n.js +0 -33
  238. package/dist/chunk-nbzy9m6a.js +0 -2
  239. package/dist/chunk-nmcgyxcg.js +0 -2
  240. package/dist/chunk-p4e7x4f6.js +0 -2
  241. package/dist/chunk-p6sdrq1y.js +0 -2
  242. package/dist/chunk-p78v88ng.js +0 -65
  243. package/dist/chunk-pbtr7w5e.js +0 -2
  244. package/dist/chunk-q13cp39b.js +0 -42
  245. package/dist/chunk-qfk2gh5y.js +0 -20
  246. package/dist/chunk-qqj8n8s9.js +0 -4
  247. package/dist/chunk-qtr1660m.js +0 -2
  248. package/dist/chunk-r0nm6sz0.js +0 -2
  249. package/dist/chunk-rb8g9nnc.js +0 -2
  250. package/dist/chunk-rhm7wg6p.js +0 -2
  251. package/dist/chunk-tjf1eajh.js +0 -2
  252. package/dist/chunk-ttn2hvze.js +0 -24
  253. package/dist/chunk-w42v5j1j.js +0 -2
  254. package/dist/chunk-w9kak6aj.js +0 -2
  255. package/dist/chunk-wr6z8z70.js +0 -2
  256. package/dist/chunk-xy3p6d2m.js +0 -2
  257. package/dist/chunk-yfppczrm.js +0 -2
  258. package/dist/chunk-yhf7pj12.js +0 -2
  259. package/dist/chunk-ympp4tja.js +0 -2
  260. package/dist/chunk-yyx89zxs.js +0 -2
  261. package/dist/chunk-z00ysspf.js +0 -31
  262. package/dist/chunk-z0x54ynx.js +0 -3
  263. package/dist/chunk-za6teyn1.js +0 -2
  264. package/dist/chunk-zgyw04pj.js +0 -2
  265. package/dist/chunk-zmnqha0x.js +0 -2
  266. package/dist/chunk-zw924mfr.js +0 -2
@@ -1,20 +0,0 @@
1
- // @bun
2
- import{Kn,Te}from"./chunk-n2ema4wf.js";import{L,b,dr,xs,k}from"./chunk-c4sskkv6.js";import{i,R}from"./chunk-9p452mq6.js";import{mo}from"./chunk-66cfnzem.js";import{Qe}from"./chunk-yn9kvsk1.js";import{c}from"./chunk-93ft5jea.js";import{r,fe}from"./chunk-hkmewh5h.js";import d from"path";import v from"fs";import{AsyncLocalStorage as gt}from"async_hooks";var ht=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||mo(t,e,n)}var ot=2;function Yp(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):c(t,"bundle-cache")}function nt(t,e){let n=t;for(let o of xt(e))if(o!==d.sep)n=n.split(o).join("\x00root");return n}var st=new Map;function xt(t){let e=d.resolve(t),n=st.get(e);if(!n){let o=e;try{o=v.realpathSync(e)}catch{}n=[...new Set([e,o])].sort((u,m)=>m.length-u.length),st.set(e,n)}return n}function $t(t,e){try{let n=v.statSync(t),o=d.resolve(e),u=t.startsWith(`${o}${d.sep}`);return{path:u?d.relative(o,t):t,...u?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(v.readFileSync(t)).toString(36)}}catch{return null}}function at(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function yt(t,e){for(let n of t){let o=at(n,e);try{let u=v.statSync(o);if(u.size!==n.size)return!1;if(u.mtimeMs!==n.mtimeMs&&Bun.hash(v.readFileSync(o)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var ct=new Map,bt=100;function Zp(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 wt(t){let e=G.get(t)??0;if(e>0&&e<bt){G.set(t,e+1);return}G.set(t,1);try{let n=(await v.promises.readdir(t)).filter((l)=>l.endsWith(".js")),o=Zp();if(n.length<=o)return;let m=(await Promise.all(n.map(async(l)=>{try{return{name:l,at:(await v.promises.stat(d.join(t,l))).mtimeMs}}catch{return null}}))).filter((l)=>l!==null);m.sort((l,y)=>y.at-l.at);for(let l of m.slice(o)){let y=l.name.slice(0,-3);await v.promises.rm(d.join(t,`${y}.js`),{force:!0}),await v.promises.rm(d.join(t,`${y}.deps.json`),{force:!0})}O("pruned bundle cache to",o,"entries")}catch{}}function Ee(t){return ct.get(t)??[]}function q(t,e){if(t)ct.set(t,e)}function Qp(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function O(...t){if(Qp())console.log("[stx:bundler]",...t)}var Y=[];function Ma(t,e,n){Y.push({filePath:t||"<inline>",message:e,details:n})}function Jt(){return Y.slice()}function Yt(){Y.length=0}var Z;function qm(t){Z=t}function La(){if(Z)return Z;try{let t=R.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function Zt(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let u=n[1];if(!Q.some((l)=>l.test(u)))return O("detected user import:",u),!0}let o=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=o.exec(t))!==null){let u=n[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Q.some((l)=>l.test(u)))return O("detected side-effect import:",u),!0}return!1}var Gn="stx-module:",St=/\.(?:[cm]?[jt]sx?|json)$/i;function ef(t,e){return d.relative(t,e).split(d.sep).join("/")}function tf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,o,u,m)=>{let l=e.get(m);return l&&!m.startsWith(Gn)?`${o}${u}${l}${u}`:n})}function nf(t,e){let n=0,o=(m)=>{let l=`__stxMod${n++}`,y=JSON.stringify(m);return e.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${y}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(y)} + " is not registered on this page (#1957)");`),l},u=(m,l)=>{for(let y of m.split(",")){let F=y.trim();if(!F)continue;let B=F.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!B)continue;let j=B[1].startsWith('"')?JSON.parse(B[1]):B[1],p=B[2]??j;e.push(`var ${p} = ${l}[${JSON.stringify(j)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,l,y)=>{let F=y.slice(Gn.length),B=o(F),j=l.trim(),p=j.match(/^([\w$]+)\s*(?:,\s*|$)/);if(p&&!j.startsWith("{")&&!j.startsWith("*"))e.push(`var ${p[1]} = ${B}.default;`),j=j.slice(p[0].length).trim();let s=j.match(/^\*\s*as\s+([\w$]+)$/);if(s)e.push(`var ${s[1]} = ${B};`);else if(j.startsWith("{"))u(j.replace(/^\{|\}$/g,""),B);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,l)=>(o(l.slice(Gn.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 n of e)try{if(v.existsSync(n)&&v.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var K=new gt;function uo(t,e){let n=new Bun.CryptoHasher("md5");for(let[o,u]of[...t].sort(([m],[l])=>m<l?-1:m>l?1:0))n.update(`${o}\x00${u}\x00`);return K.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function Qt(){return K.getStore()?.key??""}function vt(t,e,n,o,u,m,l=new Map,y,F){let B=(p,s,a)=>{if(X(s,t,y))return null;if(!m||p!==n||!St.test(s))return null;try{if(!v.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}u.add(s);let w=`${Gn}${ef(process.cwd(),s)}`;return l.set(a,w),{path:w,external:!0}},j=(p,s)=>{let a=p===n?e:d.dirname(p),w=d.resolve(a,s);return rt(w)??w};return{name:"stx-client-bundle",setup(p){if(p.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),p.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),p.onResolve({filter:/^\//},(s)=>{if(s.path===n)return{path:n};let a=rt(s.path);if(a){let w=B(s.importer,a,s.path);if(w)return w;if(a!==n)u.add(a);return{path:a}}return{path:s.path,external:!0}}),p.onResolve({filter:/^\.\.?\//},(s)=>{let a=j(s.importer,s.path),w=B(s.importer,a,s.path);if(w)return w;return u.add(a),{path:a}}),p.onResolve({filter:/^[@~]\//},(s)=>{let a=d.resolve(t,s.path.slice(2)),w=[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.mjs`,`${a}.jsx`,d.join(a,"index.ts"),d.join(a,"index.tsx"),d.join(a,"index.js"),d.join(a,"index.mjs")];for(let x of w)if(v.existsSync(x)&&v.statSync(x,{throwIfNoEntry:!1})?.isFile()){let A=B(s.importer,x,s.path);if(A)return A;return O(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",x),u.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:a}}),m)p.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(s.importer!==n)return;let a=`${Gn}npm:${s.path}`;return l.set(s.path,a),{path:a,external:!0}});p.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(s.path===n)return{contents:o,loader:"ts"};if(X(s.path,t,y))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let a=d.extname(s.path).toLowerCase(),w=a===".json"?"json":a===".tsx"?"tsx":a===".jsx"?"jsx":a===".ts"||a===".mts"||a===".cts"?"ts":"js";if(s.path!==n)u.add(s.path);let x=F?.get(s.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:v.readFileSync(s.path,"utf8"),loader:w}})}}}var H=new Map,P=b(64),it=Symbol.for("stx.client-bundle-build-queue");function rf(t){let e=globalThis,o=(e[it]??Promise.resolve()).then(t,t);return e[it]=o.then(()=>{return},()=>{return}),o}async function en(t,e,n={}){let o=n.projectRoot||process.cwd(),u=(await i(o)).serverApi,m=n.minify??!1,l=n.externalizeUserModules??!0,y=n.expose?.length?[...new Set(n.expose)].sort():void 0,F=n.cacheDir||Yp(o),B=K.getStore(),j=new Bun.CryptoHasher("md5");j.update(`${ht}\x00${Qe()}\x00${JSON.stringify(u??!1)}\x00${l?"registry":"inline"}\x00${y?y.join(","):"*"}\x00${m?"minified":"readable"}\x00${B?.key??""}\x00${nt(t,o)}\x00${nt(e,o)}`);let p=j.digest("hex").slice(0,12),s=d.join(F,`${p}.js`),a=P.get(s);if(a){if(xs(a.files)&&a.files.every((M)=>!X(M.path,o,u))){O("memo hit:",p);let M=a.files.map((C)=>C.path);return q(e,M),n.collectInputs?.push(...M),a.code}P.delete(s),O("memo invalidated by dep change:",p)}let w=d.join(F,`${p}.deps.json`),x=Bun.file(s);if(await x.exists()){let M=Bun.file(w),C=!1,D=null;if(await M.exists())try{let I=JSON.parse(await M.text());if(I.metadataVersion===ot&&Array.isArray(I.files)&&yt(I.files,o))D=dr(I.files.map((g)=>at(g,o))),C=D.length===I.files.length&&!D.some((g)=>X(g.path,o,u))}catch{C=!1}if(C){if(O("cache hit:",p),D)q(e,D.map((T)=>T.path)),n.collectInputs?.push(...D.map((T)=>T.path));let I=await x.text(),g=new Date;if(v.promises.utimes(s,g,g).catch(()=>{}),D)P.set(s,{code:I,files:D});return I}O("cache invalidated by dep change:",p)}let A=H.get(p);if(A){let M=await A;if(n.collectInputs)n.collectInputs.push(...(P.get(s)?.files??[]).map((C)=>C.path));return M}let V=rf(()=>jt(t,e,{projectRoot:o,minify:m,cacheDir:F,hash:p,cachePath:s,depsPath:w,collectInputs:n.collectInputs,externalizeUserModules:l,serverApi:u,expose:y,throwOnFailure:n.throwOnFailure,substitutes:B?.modules}));H.set(p,V);try{return await V}finally{H.delete(p)}}var Bt=0;function sf(t){return`${t}-${process.pid}-${++Bt}`}async function jt(t,e,n){let{projectRoot:o,minify:u,cacheDir:m,hash:l,cachePath:y,depsPath:F,externalizeUserModules:B}=n,j=c(o,"bundle-tmp"),p=sf(l),s=d.join(o,`.stx-client-${p}.ts`),a=d.join(j,"out",p);v.mkdirSync(a,{recursive:!0});let w=d.dirname(e),x=new Set,A=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,V=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=r(t),{depths:C,balanced:D}=fe(M),I=(_)=>!D||C[_]===0,g;while((g=A.exec(M))!==null){if(g[1])continue;if(!I(g.index))continue;if(g[2])g[2].split(",").forEach((_)=>{let f=_t(_);if(f)x.add(f)});else if(g[3])x.add(g[3])}while((g=V.exec(M))!==null){if(g[1])continue;if(!I(g.index))continue;x.add(g[2])}let T=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=T.exec(M))!==null){if(!I(g.index))continue;let _=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(_&&Q.some((f)=>f.test(_)))continue;if(g[1])x.add(g[1]);if(g[2])x.add(g[2]);for(let f of(g[3]??"").split(",")){let S=f.trim();if(!S||/^type\s/.test(S))continue;let U=/\bas\s+(\w+)\s*$/.exec(S)?.[1]??/^\w+$/.exec(S)?.[0];if(U)x.add(U)}}for(let _ of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of _[1].split(",")){let S=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(S)x.delete(S)}let lt=x.size>0?`
3
- export { ${[...x].join(", ")} }`:"";O("bundling:",l,"from:",d.basename(e));let tt=new Set,et=new Map;try{let _=await Bun.build({entrypoints:[s],outdir:a,target:"browser",format:"esm",minify:u?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[vt(o,w,s,t+lt,tt,B,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...k()},root:o});if(!_.success){let E=_.logs.filter((N)=>N.level==="error").map((N)=>N.message).join(", ")||`Unable to bundle ${d.basename(e)}`,z=Kn(_.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",E),Ma(e||"",E,z),n.throwOnFailure||La()==="error")throw Error(E);return t}let f="";for(let h of _.outputs){f=await h.text();break}let S=[];for(let h of f.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let E of h[1].split(",")){let z=E.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){S.push([z[2],z[1]]);continue}let N=E.trim();if(/^[A-Za-z_$][\w$]*$/.test(N))S.push([N,N])}if(n.expose){let h=new Set(n.expose);for(let E=S.length-1;E>=0;E--)if(!h.has(S[E][0]))S.splice(E,1)}let U=[];f=nf(tf(f,et),U);let ut=f.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(f=f.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),u&&f)try{f=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(f)}catch{}let J=`__stxBundle_${l}`,dt=new Set(L(t,!0).split(",").map((h)=>h.trim())),pt=S.map(([h,E])=>`get ${JSON.stringify(h)}() { return ${E} }${dt.has(h)?`, set ${JSON.stringify(h)}(__stxValue_${E}) { ${E} = __stxValue_${E} }`:""}`).join(", "),ft=S.map(([h])=>`var ${h} = undefined;`).join(`
4
- `),mt=S.map(([h])=>`${h} = ${J}[${JSON.stringify(h)}];`).join(`
5
- `);if(f=`${ut.join(`
6
- `)}
7
- ${ft}
8
- var ${J} = (function() {
9
- ${U.join(`
10
- `)}
11
- ${f}
12
- return { ${pt} };
13
- })();
14
- ${mt}
15
- var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
16
- Object.keys(${J}).forEach(function(name) {
17
- if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
18
- Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${J}, name));
19
- });`.trim(),O("bundled:",l,"output:",f.length,"bytes"),x.size>0&&S.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(e)} (${l}); serving the unbundled source and not caching this result`),t;v.mkdirSync(m,{recursive:!0}),await Bun.write(y,f);let W=dr(tt);return await Bun.write(F,JSON.stringify({metadataVersion:ot,files:W.map((h)=>$t(h.path,o)).filter((h)=>h!==null)})),q(e,W.map((h)=>h.path)),n.collectInputs?.push(...W.map((h)=>h.path)),P.set(y,{code:f,files:W}),await wt(m),f}catch(_){let f=Kn(_,e||void 0),S=Te(_,e||void 0);if(console.warn(`[stx:bundler] error: ${S}`),Ma(e||"",S,f),n.throwOnFailure||La()==="error")throw _;return t}finally{try{v.rmSync(a,{recursive:!0,force:!0})}catch{}}}function _t(t){let e=t.trim();if(!e)return null;let n=e.indexOf("=");if(n!==-1)e=e.slice(0,n).trim();let o=e.indexOf(":");if(o!==-1)e=e.slice(o+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
20
- export{Yp,Zp,Ee,Qp,Ma,Jt,Yt,qm,La,Zt,Gn,ef,tf,nf,uo,Qt,rf,en,sf};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{Ze}from"./chunk-m4j9gedb.js";import{ft,Mn}from"./chunk-z9csfarm.js";import{Oe,dn,Ic,Oc}from"./chunk-c4sskkv6.js";import{wr,xr,Sr,_r,Se}from"./chunk-xc03cdet.js";import{A}from"./chunk-3392k9vm.js";import{ri}from"./chunk-p4czdmrr.js";import{h}from"./chunk-epnpst9q.js";import{o}from"./chunk-qef5mz20.js";import{N,i}from"./chunk-9p452mq6.js";import{rc}from"./chunk-fgr56q3w.js";import{Ve,_e,qi,Gi,En}from"./chunk-z00ysspf.js";import{tn,fo}from"./chunk-66cfnzem.js";import{Tn}from"./chunk-7kn0d1f1.js";import{Kt,Wn,qn}from"./chunk-z0x54ynx.js";import{q}from"./chunk-ffddd2t8.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function W(n){return Q("sha256").update(n).digest("hex").slice(0,8)}function J(n=!1){let l=n?Mn():ft(),a=W(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function U(){let n=Ze(),l=W(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 X(n,l,a={}){let r=V.resolve(n),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);Ic();let _={};try{_=await i(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,f;while((f=d.exec(e))!==null){let R=f[1];if(/\bserver\b/.test(R))y.push(f[2])}let u=new Set(y.flatMap((R)=>Oe(R))),{context:D}=te({__filename:r,__dirname:V.dirname(r),__stx_serverDeclared:u}),w=new Set,j={...N,..._,...a,buildMode:"compile",strict:!1},b=await o(e,D,r,j,w),C=Ve(b),P=Oc();return{route:l,sourceFile:n,html:b,fragment:C,placeholders:P,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:dn(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(n,l){let a=0,r=0;if(!m.existsSync(n))return{copied:a,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 f=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(f,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(f,u),a++,r+=m.statSync(u).size}}}return e(n,l),{copied:a,bytes:r}}async function Cg(n={}){let l=Date.now(),a=c.resolve(n.root||process.cwd()),r=c.resolve(a,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await i(a),S=c.resolve(a,n.componentsDir??e.componentsDir??"components"),_=c.resolve(a,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",f=Se(e.app?.head,{known:_r,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",w=n.routeRules??e.routeRules??{},j=Tn(w),b=n.serverApi??e.serverApi,C=typeof b==="object"?b:{};if(b)tn(a,C);if(e.runtimeConfig)A(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let P=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of P)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=q(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],B=R.filter((s)=>!Y.some((g)=>s.pattern.startsWith(`/${g}/`)||s.pattern===`/${g}`));console.log(`[stx build] Found ${B.length} page routes (${R.length-B.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=J(n.debug),x=U();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],k=[];for(let s of B){let g=j(s.pattern),O=g.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 X(s.filePath,s.pattern,{configDir:a,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,x.filename),t.html=Sr(t.html,f,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=wr(t.html,u);if(f.htmlAttrs)t.html=xr(t.html,f.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 I=p[1];t.html=t.html.replace(" "+I,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${I}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await h(t.html),O){let p=await En(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=_e(t.html,D);let L=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),z=c.join("server","pages",`${L}.compiled.json`),G=c.join("server","fragments",`${L}.html`);await Bun.write(c.join(r,z),JSON.stringify(t,null,2)),await Bun.write(c.join(r,G),t.fragment),k.push({pattern:s.pattern,compiledPath:z,fragmentPath:G,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(g).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let E=c.resolve(a,d);if(m.existsSync(E)){let{copied:s,bytes:g}=Z(E,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${d}/`)}let H=qn(a);if(H){let{copied:s,bytes:g}=Z(H,c.join(r,"public",Wn));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${Kt}/`)}let F={runtime:v.filename,router:x.filename},T=qi(k,F,r);if(T.routeRules=w,T.routerContainer=D,b)T.apiRoutes=await fo(a,r,C);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await ri(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(rc(e._layerGraph),null,2));Gi(T,r);let K=Date.now()-l;return console.log(`
3
- [stx build] Done in ${K}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:K}}
4
- export{Cg};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gr,Qn,uf}from"./chunk-hz5vabap.js";import"./chunk-cbdyns7r.js";import"./chunk-5g7m27e1.js";import"./chunk-ffddd2t8.js";import"./chunk-vfjenjez.js";import"./chunk-9p452mq6.js";import"./chunk-a8erwxng.js";import"./chunk-2p34qf9c.js";import"./chunk-fgr56q3w.js";import"./chunk-p78v88ng.js";import"./chunk-m4j9gedb.js";import{$t}from"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{uf as declareBareLoopHead,$t as parseLoopBinding,Qn as processLoops,Gr as reportDeferredLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{nh,ff,Co,Qr,er,Eo,To,es,ts,ns,$o,Va,gf,ht}from"./chunk-5g7m27e1.js";import"./chunk-ffddd2t8.js";import"./chunk-vfjenjez.js";import"./chunk-9p452mq6.js";import"./chunk-a8erwxng.js";import"./chunk-2p34qf9c.js";import"./chunk-fgr56q3w.js";import"./chunk-p78v88ng.js";import"./chunk-m4j9gedb.js";import{L}from"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{nh as clearScriptScanCache,es as convertServerLoopAttributesToDirectives,Eo as convertSignalDirectivesToAttributes,ts as convertSignalLoopsToAttributes,er as extractClientSignalNames,L as extractExports,Va as findMarkupIndexOutsideScripts,Qr as hasSignalsSyntax,Co as parseLoopExpression,To as preEvalLiteralReactiveIfs,ns as processScriptSetup,$o as processSignals,gf as rewriteStxImportSpecifiers,ff as scanScriptTags,ht as stripStxRuntimeImports};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Z,Q,ee,$n,ge,Ce,Lr,_l,dt,Wt,Rn,An,Pn,te,In,On,jr}from"./chunk-983zpa57.js";import"./chunk-9ra3ne11.js";export{Q as DEFAULT_FORMATS,ee as DEFAULT_QUALITY,Z as DEFAULT_WIDTHS,jr as ImageProcessingError,On as formatSize,Wt as generateSizes,dt as generateSrcSet,Rn as getFallbackVariant,Lr as getImageMetadata,te as getMimeType,In as getTotalSize,An as groupVariantsByFormat,ge as isImageBackendAvailable,Pn as isImageFile,$n as isSharpAvailable,Ce as processImage,_l as resizeAndConvert};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rl,Al,Pl,Il,Ol,Nl,Dl,Ml,Ll,jl,Vg}from"./chunk-sxf17xfc.js";export{Rl as createIslandRegistry,Vg as default,jl as generateIslandManifest,Pl as generatePartialHydrationCSS,Nl as hydrateAll,Ol as hydrateByStrategy,Il as hydrateIsland,Dl as isHydrated,Ml as onHydrated,Al as processPartialHydrationDirectives,Ll as processStaticDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Yp,Zp,Ee,Qp,Ma,Jt,Yt,qm,La,Zt,Gn,ef,tf,nf,uo,Qt,rf,en,sf}from"./chunk-qfk2gh5y.js";import"./chunk-66cfnzem.js";import"./chunk-n2ema4wf.js";import"./chunk-9p452mq6.js";import"./chunk-a8erwxng.js";import"./chunk-2p34qf9c.js";import"./chunk-fgr56q3w.js";import"./chunk-p78v88ng.js";import"./chunk-m4j9gedb.js";import"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{Gn as MODULE_SPECIFIER_PREFIX,Yp as bundleCacheDir,Zp as bundleCacheEntryLimit,en as bundleClientScript,Yt as clearBundleFailures,Ee as clientBundleDependencies,Jt as getBundleFailures,Zt as hasUserImports,Qt as moduleSubstitutionKey,tf as normalizeRegistrySpecifiers,rf as queueClientBundleBuild,Ma as recordBundleFailure,ef as registryIdForPath,La as resolveBundlerFallback,nf as rewriteRegistryImports,qm as setBundlerFallbackMode,Qp as shouldLogBundlerDiagnostics,sf as tempBuildName,uo as withModuleSubstitutes};
@@ -1,24 +0,0 @@
1
- // @bun
2
- import{x}from"./chunk-c4sskkv6.js";import{o}from"./chunk-qef5mz20.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,n)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
3
- ${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
4
- `)}else{console.log(`
5
- ${e.bold}Available Commands:${e.reset}
6
- `);for(let[r,s]of Object.entries(u))console.log(` ${e.cyan}${r.padEnd(12)}${e.reset} ${s.description}`);console.log(`
7
- ${e.dim}Type 'help <command>' for more details${e.reset}
8
- `)}}},render:{description:"Render a template file",usage:"render <file> [--raw]",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file to render${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}try{let s=await Bun.file(r).text(),l=t.includes("--raw");console.log(`
9
- ${e.dim}Rendering ${r}...${e.reset}
10
- `);let c=await o(s,n.context,r,{},new Set);if(n.lastResult=c,l)console.log(c);else c.split(`
11
- `).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,n)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let r=t.join(" ");try{let s=`{{ ${r} }}`,c=(await x(s,n.context,"eval")).trim();n.lastResult=c,console.log(`${e.green}\u2192${e.reset} ${c}`)}catch(s){console.log(`${e.red}Error:${e.reset}`,s)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,n)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let r=t[0],s=t.slice(1).join(" "),l;try{l=JSON.parse(s)}catch{l=s}n.context[r]=l,console.log(`${e.green}\u2713${e.reset} ${r} = ${JSON.stringify(l)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in n.context)delete n.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,n)=>{let r=Object.keys(n.context);if(r.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
12
- ${e.bold}Context Variables:${e.reset}
13
- `);for(let s of r){let l=n.context[s],c=Array.isArray(l)?"array":typeof l,a=JSON.stringify(l).slice(0,50);console.log(` ${e.cyan}${s}${e.reset} ${e.dim}(${c})${e.reset}: ${a}${a.length>=50?"...":""}`)}console.log()}},clear:{description:"Clear context or screen",usage:"clear [context|screen]",handler:async(t,n)=>{if(t[0]==="context"||!t[0])n.context={},console.log(`${e.green}\u2713${e.reset} Context cleared`);if(t[0]==="screen"||!t[0])console.clear()}},cd:{description:"Change working directory",usage:"cd <directory>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.cyan}${n.cwd}${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);if(!p.existsSync(r)){console.log(`${e.red}Error: Directory not found: ${r}${e.reset}`);return}if(!p.statSync(r).isDirectory()){console.log(`${e.red}Error: Not a directory: ${r}${e.reset}`);return}n.cwd=r,console.log(`${e.green}\u2713${e.reset} ${r}`)}},ls:{description:"List files in current directory",usage:"ls [pattern]",handler:async(t,n)=>{let r=t[0]||"*",s=new Bun.Glob(r),l=[];for await(let i of s.scan({cwd:n.cwd,onlyFiles:!1}))l.push(i);if(l.length===0){console.log(`${e.dim}No files found${e.reset}`);return}l.sort();let c=l.filter((i)=>i.endsWith(".stx")),a=l.filter((i)=>i.endsWith(".md")),d=l.filter((i)=>!i.endsWith(".stx")&&!i.endsWith(".md"));if(c.length>0)console.log(`
14
- ${e.bold}Templates:${e.reset}`),c.forEach((i)=>console.log(` ${e.green}${i}${e.reset}`));if(a.length>0)console.log(`
15
- ${e.bold}Markdown:${e.reset}`),a.forEach((i)=>console.log(` ${e.blue}${i}${e.reset}`));if(d.length>0)console.log(`
16
- ${e.bold}Other:${e.reset}`),d.forEach((i)=>console.log(` ${e.dim}${i}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}let l=(await Bun.file(r).text()).split(`
17
- `);console.log(),l.forEach((c,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${c}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}try{let s=await Bun.file(r).text(),l=JSON.parse(s);n.context={...n.context,...l},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(l).length} variables from ${t[0]}`)}catch(s){console.log(`${e.red}Error parsing JSON:${e.reset}`,s)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,n)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let r=g.resolve(n.cwd,t[0]);try{await Bun.write(r,JSON.stringify(n.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(s){console.log(`${e.red}Error saving file:${e.reset}`,s)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,n)=>{let r=t[0]?Number.parseInt(t[0],10):20,s=n.history.slice(-r);if(s.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),s.forEach((l,c)=>{let a=String(n.history.length-s.length+c+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${l}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,n)=>{n.running=!1,console.log(`
18
- ${e.dim}Goodbye!${e.reset}
19
- `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,n)=>u.exit.handler(t,n)}};function h(t,n){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(n.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(n.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function hg(t={}){let n={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},r=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,n),l],historySize:t.maxHistory||100});console.log(`
20
- ${e.bold}${e.blue}stx Interactive Mode${e.reset}
21
- ${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
22
- `);let s=()=>{let l=n.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(n.running)s();return}n.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,n)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await x(a,n.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(n.running)s();else r.close()})};r.on("SIGINT",()=>{console.log(`
23
- ${e.dim}(Use 'exit' to quit)${e.reset}`),s()}),s()}
24
- export{hg};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fn,Af,Pf,If,Of,Nf,g,Df,Jo,Mf,Ec,Tc}from"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{fn as STX_ENGINE_BINDING_NAMES,Jo as convertToCommonJS,Ec as extractScriptFromTemplate,g as extractVariables,Tc as hasVariables,Df as isCompleteImport,Nf as isMissingBindingFailure,If as isModuleResolutionFailure,Of as isSyntaxFailure,Mf as splitDeclaration,Af as stripTypeScript,Pf as withoutStxReferrer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{No,Do,Mo,Lo,cs,ls,ph,fh,gh,mh,us,hh}from"./chunk-p78v88ng.js";import"./chunk-xc03cdet.js";export{hh as generateDefaultRobotsTxt,us as generateRobotsTxt,fh as generateSitemap,gh as generateSitemapIndex,Lo as injectSeoTags,cs as metaDirective,No as processMetaDirectives,Mo as processSeoDirective,Do as processStructuredData,ph as registerSeoDirectives,mh as scanForSitemapEntries,ls as structuredDataDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{be,Rs,qf,vh,Gf,wh,Ot,d,V,Y,hn,we,Kf,ni,Xf,xh,x,Jf,Sh,_,kh}from"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{Jf as applyFilters,wh as clearCustomFilters,Kf as clientLoopScopes,Rs as defaultFilters,hn as escapeAttributeValue,d as escapeHtml,V as escapeHtmlValue,Y as escapeInterpolatedHtmlValue,_ as evaluateExpression,be as findMustacheEnd,Gf as getAllFilters,Xf as interpolateScriptAttributes,ni as interpolateScriptExpressions,xh as interpolateScriptsInTemplate,x as processExpressions,qf as registerFilter,vh as registerFilters,Ot as replaceInterpolations,Sh as resetRejectedExpressionWarnings,kh as unescapeHtml,we as usesSignalsInScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hg}from"./chunk-ttn2hvze.js";import"./chunk-qef5mz20.js";import"./chunk-epnpst9q.js";import"./chunk-bsr9wnq4.js";import"./chunk-hz5vabap.js";import"./chunk-m28d7w2s.js";import"./chunk-q13cp39b.js";import"./chunk-cbdyns7r.js";import"./chunk-5g7m27e1.js";import"./chunk-ffddd2t8.js";import"./chunk-vfjenjez.js";import"./chunk-htyee0b7.js";import"./chunk-9p452mq6.js";import"./chunk-a8erwxng.js";import"./chunk-2p34qf9c.js";import"./chunk-fgr56q3w.js";import"./chunk-p78v88ng.js";import"./chunk-m4j9gedb.js";import"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{hg as startInteractive};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{rm,sm}from"./chunk-zggdhtmn.js";export{sm as ensureTeleportTargets,rm as processTeleportDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ea,Bl,Nn,Ug,Fl,zl,Hl,Wg}from"./chunk-5bgkb4vm.js";import"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{Nn as Validator,Bl as defineForm,Fl as processErrorDirective,zl as processErrorsDirective,Wg as processFormValidationDirectives,Hl as processHasErrorsDirective,ea as useForm,Ug as v};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xl,Bg,Sl,kl,Fg,zg}from"./chunk-ygtfjnqj.js";import"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{zg as applySlots,Fg as extractSlotContent,Bg as parseSlotElement,xl as parseSlots,kl as processSlots,Sl as renderSlot};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qs,Li,Or,Gs,Ks,Cn,Ut,ji,Nr,Dr,Xs,Js,bg,vg,lt}from"./chunk-w7e28p74.js";export{lt as DeployError,Li as calculateSha1,Or as collectDeployFiles,Dr as createDefaultNetlifyConfig,Gs as createFileManifest,qs as createNetlifyClient,bg as deploy,Nr as detectProjectConfig,Ks as filterRequiredFiles,Cn as formatSize,ji as generateNetlifyToml,Ut as getTotalSize,Js as hasNetlifyConfig,vg as initNetlify,Xs as writeNetlifyConfig};
@@ -1,31 +0,0 @@
1
- // @bun
2
- import{wn}from"./chunk-xc03cdet.js";import{F,z,At,Pt,hr,g,Nc,ti,V,_}from"./chunk-c4sskkv6.js";import{Xt}from"./chunk-j9h41w8b.js";import{W}from"./chunk-csx3zne1.js";var H=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function B(e){let n=[],t=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=t.exec(e))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(e,n){return n.some((t)=>e>=t.start&&e<t.end)}function q(e){let n=(e||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let t={},r=n,s=r.match(/^[a-z][\w-]*/i);if(s)t.tag=s[0].toLowerCase(),r=r.slice(s[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(t.attr=o[1],o[3]!==void 0&&o[3]!=="")t.attrValue=o[3];r=r.slice(o[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){t.id=a[1],r=r.slice(a[0].length);continue}let i=r.match(/^\.([\w-]+)/);if(i){t.className=i[1],r=r.slice(i[0].length);continue}return null}if(!t.tag&&!t.attr&&!t.id&&!t.className)return null;return t}function U(e,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(e))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(e))return!1}if(n.className){let t=e.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!t)return!1;if(!t[2].split(/\s+/).includes(n.className))return!1}return!0}function T(e,n="main"){let t=q(n);if(!t)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,s=B(e),o;while((o=r.exec(e))!==null){if(P(o.index,s))continue;let a=o[1].toLowerCase(),i=o[2]||"";if(i.trimEnd().endsWith("/")||H.has(a))continue;if(t.tag&&t.tag!==a)continue;if(!U(i,t))continue;let c=o[0],u=o.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,m;while((m=l.exec(e))!==null){if(P(m.index,s))continue;let x=m[1]==="/";if(!x&&(m[2]||"").trimEnd().endsWith("/"))continue;if(f+=x?-1:1,f===0)return{openTag:c,openIndex:o.index,start:u,end:m.index,tagName:a}}return null}return null}var ut="private, no-store";function Vi(e){return e.replace(/&#(\d+);/g,(n,t)=>M(Number(t),n)).replace(/&#x([0-9a-f]+);/gi,(n,t)=>M(Number.parseInt(t,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(e,n){if(!Number.isInteger(e)||e<0||e>1114111)return n;try{return String.fromCodePoint(e)}catch{return n}}function ke(e){return e.headers.get("X-STX-Router")==="true"}function G(e,n){if(!e)return n;return e.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?e:`${e}, ${n}`}function O(e){return{Vary:G(e,"X-STX-Router")}}import E from"path";var X="stx-page-head:",J=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,C={dev:null,prod:null};function K(){let e=W()?"dev":"prod",n=C[e];if(n!==null)return n;try{let t=import.meta.require("./chunk-kjc1f6af.js"),r=e==="dev"&&typeof t.getRouterScriptDev==="function"?t.getRouterScriptDev:t.getRouterScript;C[e]=`<script>${r()}</script>`}catch{C[e]=""}return C[e]}async function Ui(e,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(e,n);if(await Bun.file(r).exists())return r;return null}let t=E.join(e,"app.stx");if(await Bun.file(t).exists())return t;return null}async function Ys(e,n){try{let t=await Bun.file(e).text(),r=t,s=t.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(s)r=s[1].trim();let o=Xt(t),a=[...o.client.map((d)=>d.fullTag),...o.signals.map((d)=>d.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(t))!==null)i.push(u[0]);let l=r;for(let d of o.server)l=l.replace(d.fullTag,"");for(let d of o.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${e} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:x,defaultConfig:y,loadStxConfig:R}=await import("./chunk-09801kkv.js"),S=await R(),p={__filename:e,__dirname:E.dirname(e)};for(let d of a){let w=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(w&&!d.includes("client")&&!d.includes('type="module"'))await x(w[1],p,e)}let b=await m(l,p,e,{...y,...S,...n},new Set),h=b.indexOf(f);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:b.substring(0,h),afterSlot:b.substring(h+f.length),filePath:e,shellScripts:a,shellStyles:i}}catch(t){return console.error(`[stx] Error processing shell ${e}:`,t),null}}function Mr(e,n,t){let r,s="",o=n.match(J);if(o){n=n.replace(o[0],"");try{let l=Buffer.from(o[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();s=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=t||r||"stx App",i=K(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>${a}</title>
8
- ${s?` ${s}
9
- `:""} ${e.shellStyles.join(`
10
- `)}
11
- </head>
12
- <body>
13
- ${e.beforeSlot}
14
- <div data-stx-content>${n}</div>
15
- ${e.afterSlot}
16
- ${e.shellScripts.filter((l)=>!l.includes("server")).join(`
17
- `)}
18
- ${c}
19
- ${i}
20
- </body>
21
- </html>`}function Ve(e,n={}){let t=e.trim();if(!wn(t))return e;let r=[],s=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let c=s[1],u=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=u.exec(c))!==null)r.push(l[0]);let f=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(f)r.push(f[0]);let m=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(m)r.push(m[0])}if(n.preserveHead&&s){let c=[],u=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=u.exec(s[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${X}${Buffer.from(c.join(`
22
- `),"utf8").toString("base64")}-->`)}let o=t.match(/<body\b[^>]*>/i),a=t.lastIndexOf("</body>");if(o&&a!==-1){let c=o.index+o[0].length,u=t.slice(c,a).trim();if(r.length>0)return r.join(`
23
- `)+`
24
- `+u;return u}let i=t;if(i=i.replace(/<!DOCTYPE\b[^>]*>/i,""),i=i.replace(/<html\b[^>]*>/i,""),i=i.replace(/<\/html\s*>/i,""),s)i=i.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
25
- `));return i=i.replace(/<body\b[^>]*>/i,""),i=i.replace(/<\/body\s*>/i,""),i.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function N(e,n,t,r){if(!j.test(n))return!1;let s=n.slice(0,n.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(s)?.[1];if(!o)return!0;let a=`data-stx-scope="${o}"`;for(let i=e.indexOf(a);i!==-1;i=e.indexOf(a,i+a.length))if(i>=t&&i<r)return!1;return!0}function Wi(e){return ke(e)}function Y(e,n){let t=[],r=new Set;for(let s of z(e,F)){if(s.start>=n.start&&s.start<n.end)continue;let o=s.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let u of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(u[1].toLowerCase(),u[2]??u[3]??u[4]??"");let i=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!i||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(i))continue;if(N(e,s.token,n.start,n.end)||r.has(s.token))continue;r.add(s.token),t.push(s.token)}return t}function _e(e,n="main"){let t=e.trim(),r=[],s=[],o=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(o){let p=o[1],b=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=b.exec(p))!==null)r.push(h[0]);let d=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=d.exec(p))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;s.push(h[0])}}let a=T(t,n);if(!a)return Ve(e);let i=Y(t,a),c=new Set(i),{tagName:u,start:l,end:f}=a,m=t.slice(l,f).trim(),x=[],y=t.match(/<body\b[^>]*>/i),R=t.lastIndexOf("</body>");if(y&&y.index!==void 0&&R!==-1){let b=[[y.index+y[0].length,a.openIndex],[f+`</${u}>`.length,R]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[d,w]of b){if(d>=w)continue;let L=t.slice(d,w),A;h.lastIndex=0;while((A=h.exec(L))!==null){if(N(t,A[0],l,f))continue;x.push(A[0])}}}let S=[];if(r.length>0)S.push(r.join(`
26
- `));if(i.length>0)S.push(i.join(`
27
- `));if(s.length>0)S.push(s.filter((p)=>!c.has(p)).join(`
28
- `));if(x.length>0)S.push(x.filter((p)=>!c.has(p)).join(`
29
- `));return S.push(m),S.join(`
30
- `)}import v from"fs";import I from"path";function qi(e,n,t){return{version:1,buildTime:new Date().toISOString(),routes:e,assets:n,outputDir:t}}function Gi(e,n){let t=I.join(n,"manifest.json");v.writeFileSync(t,JSON.stringify(e,null,2))}function Ki(e){let n=I.join(e,"manifest.json");if(!v.existsSync(n))return null;try{let t=v.readFileSync(n,"utf-8"),r=JSON.parse(t);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(t){return console.warn("[stx] Failed to load manifest:",t),null}}function k(e,n,t={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`;if(t.maxAge!==void 0)r+=`; Max-Age=${t.maxAge}`;if(t.expires)r+=`; Expires=${t.expires.toUTCString()}`;if(t.path)r+=`; Path=${t.path}`;if(t.domain)r+=`; Domain=${t.domain}`;if(t.secure)r+="; Secure";if(t.httpOnly)r+="; HttpOnly";if(t.sameSite)r+=`; SameSite=${t.sameSite}`;return r}async function Z(e){let n=e.headers.get("content-type")||"",t={},r=(s,o)=>{let a=t[s];if(a===void 0)t[s]=o;else if(Array.isArray(a))a.push(o);else t[s]=[a,o]};if(n.includes("multipart/form-data")){let s=await e.formData();for(let[o,a]of s.entries())if(typeof a==="string")r(o,a);return t}if(n.includes("application/x-www-form-urlencoded")){for(let[s,o]of new URLSearchParams(await e.text()).entries())r(s,o);return t}return t}function Zs(e){if(!e)return!1;let n=e.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function D(e,n={}){let t=n.request,r=n.method??t?.method;if(!t||!Zs(r))return{ran:!1};if(typeof e.action!=="function")return{ran:!1};let s={};try{s=await Z(t)}catch{}let o=await e.action({request:t,form:s,params:n.params??{},query:e.query??{},cookies:n.cookies??{}});if(o&&typeof o==="object"){let a=o,i=Q(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(e,f),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function Q(e){if(!e||typeof e!=="object"||Array.isArray(e))return[];let n=[];for(let[t,r]of Object.entries(e)){if(!t)continue;if(typeof r==="string"){n.push(k(t,r));continue}if(r&&typeof r==="object"){let s=r;if(typeof s.value!=="string")continue;n.push(k(t,s.value,s))}}return n}function Xi(e,n=[],t){let r=new Headers({Location:e,"Cache-Control":"no-store"});for(let s of n)r.append("Set-Cookie",s);for(let[s,o]of Object.entries(t??{}))if(s.toLowerCase()!=="location")r.set(s,o);return new Response(null,{status:303,headers:r})}async function En(e,n={}){let{html:t,context:r,redirect:s,cookies:o}=await tt(e,n),a=At(r),i=Pt(r);if(s)return{html:t,redirect:s,cookies:o,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-cknbhyw6.js"),u=c(r),l=e.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-f498cdg5.js"),{defaultConfig:m}=await import("./chunk-13jg9qpq.js"),x=r.streamBoundaries||{},y={...m,autoShell:!1},R=Object.keys(l).map((p)=>({id:p,render:async()=>{let b=typeof x[p]==="function"?await x[p]():void 0;return f(l[p],{...r,$boundary:b},e.sourceFile,y,new Set)}})),S=new Set(R.map((p)=>p.id));u=[...(u||[]).filter((p)=>!S.has(p.id)),...R]}return{html:t,boundaries:u&&u.length>0?u:void 0,cookies:o,status:a,headers:i}}async function tt(e,n){let t={__filename:e.sourceFile,__dirname:e.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!e.hasServerScripts&&!ti(e.html))return{html:e.html,context:t};for(let a of e.serverScriptContent)try{await g(a,t,e.sourceFile)}catch(i){if(n.__stx_strict_hydration)throw i;console.warn(`[stx] Server script error in ${e.sourceFile}:`,i)}let r=await D(t,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),s=(a)=>{let i=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=hr(t);if(!c)return i;let u=i.indexOf("</head>");return u<0?c+i:i.slice(0,u)+c+i.slice(u)};if(r.redirect)return{html:e.html,context:t,redirect:r.redirect,cookies:r.cookies};if(!ti(e.html))return{html:s(e.html),context:t,cookies:r.cookies};let o=new Map;for(let[a,i]of Object.entries(e.placeholders))if(i.expression)try{let c=_(i.expression,t);if(i.type==="raw")o.set(a,c!==void 0&&c!==null?String(c):"");else o.set(a,c!==void 0&&c!==null?V(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;o.set(a,"")}return{html:s(Nc(e.html,o)),context:t,cookies:r.cookies}}
31
- export{ut,Vi,ke,O,Ui,Ys,Mr,Ve,Wi,_e,qi,Gi,Ki,Zs,Xi,En};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import t from"fs";import r from"path";var Kt="resources/assets",Wn="assets";function qn(o=process.cwd()){let s=r.resolve(o,Kt);return t.existsSync(s)&&t.statSync(s).isDirectory()?s:null}
3
- export{Kt,Wn,qn};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{vf,Io}from"./chunk-2p34qf9c.js";export{vf as looksLikeGlob,Io as resolveStxTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{dm,pm,fm,gm,mm}from"./chunk-njhd845r.js";export{pm as createSSRSuspense,gm as generateSuspenseCSS,mm as generateSuspenseRuntime,dm as processSuspenseDirectives,fm as renderSSRSuspense};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{mf,rh,sh,oh,ih,hf,yf,ah,ch,Ao,lh,rr,sr,ss}from"./chunk-htyee0b7.js";import{Qe}from"./chunk-yn9kvsk1.js";import"./chunk-c4sskkv6.js";import"./chunk-p4czdmrr.js";import"./chunk-3392k9vm.js";import"./chunk-xc03cdet.js";import"./chunk-k7pmzreg.js";import"./chunk-2nqt1m3m.js";export{ih as __setSignalsGeneratorsForTest,Qe as cacheEngineFingerprint,sr as cacheTemplate,rr as checkCache,lh as clearDevCaches,yf as getCachedRouterScript,hf as getCachedSignalsRuntime,ah as getServeClientAsset,Ao as getServeModuleBundle,ss as hashFilePath,sh as invalidateFileCache,oh as invalidateFileCacheByDir,rh as readFileCached,ch as registerServeModuleBundle,mf as templateCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{al,Bi,cl,ll,Fi,ul,dl,pl,fl,zi,gl,wg}from"./chunk-bfhks7zf.js";import{Ji,wl}from"./chunk-b2j7s1a2.js";import{Z,Q,ee,$n,ge,Ce,Lr,dt,Wt,Rn,An,Pn,te,In,On,jr}from"./chunk-983zpa57.js";import{Vl}from"./chunk-416jy1m5.js";import"./chunk-9ra3ne11.js";export{Q as DEFAULT_FORMATS,ee as DEFAULT_QUALITY,Z as DEFAULT_WIDTHS,jr as ImageProcessingError,ll as clearImageCache,Fi as createImageDirective,wl as createImageHandler,dl as createImagePlugin,wg as defaultImageConfig,On as formatSize,zi as generateImageManifest,Wt as generateSizes,dt as generateSrcSet,Rn as getFallbackVariant,Lr as getImageMetadata,te as getMimeType,In as getTotalSize,An as groupVariantsByFormat,Ji as handleImageRequest,ul as imageDirective,ge as isImageBackendAvailable,Pn as isImageFile,$n as isSharpAvailable,fl as optimizeDirectory,pl as optimizeImage,Bi as parseImageComponent,Ce as processImage,cl as processImageComponents,al as renderImageComponent,Vl as rewriteImagesWithSiblings,gl as writeImageManifest};