@stacksjs/stx 0.2.530 → 0.2.532

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 (219) hide show
  1. package/dist/{chunk-35j1evvy.js → chunk-03wggzg8.js} +3 -3
  2. package/dist/chunk-08emfsq3.js +2 -0
  3. package/dist/{chunk-2twfqcxm.js → chunk-0dqxnx20.js} +2 -2
  4. package/dist/chunk-0p9pwd61.js +2 -0
  5. package/dist/chunk-0pebjkzx.js +18 -0
  6. package/dist/{chunk-f1n4e4jy.js → chunk-0wvsfs4s.js} +2 -2
  7. package/dist/chunk-0zmv31nc.js +2 -0
  8. package/dist/{chunk-c322rrge.js → chunk-12e4a0ab.js} +2 -2
  9. package/dist/chunk-12v4d123.js +2 -0
  10. package/dist/{chunk-2m5mx0x8.js → chunk-15r72kw7.js} +1 -1
  11. package/dist/{chunk-gvngrxvb.js → chunk-1945hk44.js} +1 -1
  12. package/dist/chunk-28xtazwz.js +2 -0
  13. package/dist/{chunk-y8h823cb.js → chunk-292vew7b.js} +36 -36
  14. package/dist/chunk-2936t942.js +2 -0
  15. package/dist/chunk-29qwmthc.js +2 -0
  16. package/dist/chunk-2a4szpje.js +3 -0
  17. package/dist/{chunk-8m3k43d3.js → chunk-2dzd2h15.js} +7 -7
  18. package/dist/{chunk-0rt5ec7a.js → chunk-2jk0vceh.js} +4 -4
  19. package/dist/{chunk-ktvr45qg.js → chunk-2qbvsvwc.js} +2 -2
  20. package/dist/chunk-2y6tzn6d.js +3 -0
  21. package/dist/{chunk-csbft3wz.js → chunk-31c1g3rt.js} +3 -3
  22. package/dist/chunk-323cxa69.js +2 -0
  23. package/dist/chunk-375zp0vr.js +2 -0
  24. package/dist/{chunk-21rm5kv6.js → chunk-38w14qs7.js} +2 -2
  25. package/dist/{chunk-raqbqt1r.js → chunk-3vvppnws.js} +6 -6
  26. package/dist/chunk-3w49r16x.js +2 -0
  27. package/dist/chunk-3zyvhf4p.js +2 -0
  28. package/dist/chunk-458etq5a.js +4 -0
  29. package/dist/chunk-4cmqjmqr.js +3 -0
  30. package/dist/{chunk-37nybpw1.js → chunk-4gt0r98p.js} +65 -14
  31. package/dist/{chunk-3x9d58f4.js → chunk-4xxhprts.js} +11 -11
  32. package/dist/{chunk-4drgbkga.js → chunk-587ehsxn.js} +2 -2
  33. package/dist/{chunk-5tyes97j.js → chunk-5tj6expd.js} +2 -2
  34. package/dist/{chunk-kzztmawd.js → chunk-664503e6.js} +6 -6
  35. package/dist/{chunk-hkjqqx92.js → chunk-6abvk7vj.js} +3 -3
  36. package/dist/{chunk-ba88n1j7.js → chunk-6v1gwdbv.js} +2 -2
  37. package/dist/{chunk-y0c1srgj.js → chunk-7s14bthq.js} +5 -5
  38. package/dist/{chunk-2etevws0.js → chunk-7tabykst.js} +2 -2
  39. package/dist/{chunk-zw029e7n.js → chunk-7wfh2hqy.js} +4 -4
  40. package/dist/chunk-7ybgfk0m.js +3 -0
  41. package/dist/chunk-8bcvb86w.js +2 -0
  42. package/dist/chunk-8gmb3k1p.js +2 -0
  43. package/dist/{chunk-v2zxxjqn.js → chunk-90wh9zzy.js} +6 -6
  44. package/dist/{chunk-d8ramz4s.js → chunk-9a73re8k.js} +2 -2
  45. package/dist/{chunk-p4gbvge6.js → chunk-9pztpvvk.js} +1 -1
  46. package/dist/chunk-9skdekv5.js +2 -0
  47. package/dist/{chunk-7p0zerfj.js → chunk-9sqjmd9a.js} +10 -10
  48. package/dist/{chunk-czmw5xsd.js → chunk-9w2vmfha.js} +2 -2
  49. package/dist/chunk-9xq5yer8.js +2 -0
  50. package/dist/chunk-a15yzfc6.js +2 -0
  51. package/dist/{chunk-2hc5mbw8.js → chunk-azb58ven.js} +2 -2
  52. package/dist/{chunk-869wyw0j.js → chunk-b7xdk1g4.js} +6 -6
  53. package/dist/{chunk-9mjy16pw.js → chunk-bpr4bkde.js} +2 -2
  54. package/dist/chunk-cp4dr9ch.js +2 -0
  55. package/dist/{chunk-6t0rq51y.js → chunk-d2r8t40y.js} +2 -2
  56. package/dist/chunk-d4155ec5.js +2 -0
  57. package/dist/{chunk-6k7spr38.js → chunk-d7x6n702.js} +7 -7
  58. package/dist/chunk-dd31q423.js +2 -0
  59. package/dist/{chunk-qhg55cvv.js → chunk-ee4wwr89.js} +5 -5
  60. package/dist/{chunk-f5pmyxtn.js → chunk-ennxrn5g.js} +5 -5
  61. package/dist/{chunk-xevnx24r.js → chunk-er031j13.js} +2 -2
  62. package/dist/chunk-f2q5bckn.js +2 -0
  63. package/dist/chunk-fhx35529.js +2 -0
  64. package/dist/chunk-frw35d2v.js +2 -0
  65. package/dist/chunk-fyxydww2.js +4 -0
  66. package/dist/{chunk-nzk14k6w.js → chunk-g060jncp.js} +7 -7
  67. package/dist/{chunk-x1tzt7yc.js → chunk-g12j8ahm.js} +4 -4
  68. package/dist/chunk-g5t10z04.js +2837 -0
  69. package/dist/{chunk-x9mzfq3p.js → chunk-grb3kfya.js} +1 -1
  70. package/dist/{chunk-3cn7973z.js → chunk-gsxb0ry9.js} +1 -1
  71. package/dist/{chunk-619j0mnz.js → chunk-gvw8wh29.js} +5 -5
  72. package/dist/{chunk-e6y6s7q8.js → chunk-gxfnmjzp.js} +2 -2
  73. package/dist/chunk-h1y5q942.js +2 -0
  74. package/dist/chunk-h791c7sb.js +2 -0
  75. package/dist/chunk-h88jcr3k.js +2 -0
  76. package/dist/chunk-heq5c0gd.js +2 -0
  77. package/dist/{chunk-ravc60z0.js → chunk-hp1tnxzb.js} +8 -8
  78. package/dist/chunk-hpeg9erh.js +3 -0
  79. package/dist/chunk-j3b24e77.js +2 -0
  80. package/dist/{chunk-vrrqnp5k.js → chunk-j8pacd7m.js} +5 -5
  81. package/dist/{chunk-346zc43s.js → chunk-jjwg83xv.js} +1 -1
  82. package/dist/chunk-jpck8nm5.js +2 -0
  83. package/dist/{chunk-58jyc7kp.js → chunk-kg77xs08.js} +3 -3
  84. package/dist/{chunk-1te1s9fa.js → chunk-khwj964t.js} +4 -4
  85. package/dist/{chunk-299xbyhn.js → chunk-kwvexxey.js} +4 -4
  86. package/dist/chunk-ky25egh1.js +2 -0
  87. package/dist/{chunk-w6ys6eq4.js → chunk-m2v04c6v.js} +93 -93
  88. package/dist/chunk-m4d99a9r.js +2 -0
  89. package/dist/chunk-ndv44bgs.js +2 -0
  90. package/dist/chunk-ng2sdph7.js +2 -0
  91. package/dist/{chunk-yh3p86qa.js → chunk-p8qr0q85.js} +2 -2
  92. package/dist/{chunk-6k4f583z.js → chunk-p8yh7mgr.js} +2 -2
  93. package/dist/chunk-pkfwxp9n.js +2 -0
  94. package/dist/chunk-pr5q4wev.js +2 -0
  95. package/dist/{chunk-fk45zc1b.js → chunk-q6e45gnw.js} +5 -5
  96. package/dist/chunk-qs3p7sc6.js +2 -0
  97. package/dist/{chunk-wqxdx2td.js → chunk-r6gxy92f.js} +2 -2
  98. package/dist/chunk-rchwwcxy.js +2 -0
  99. package/dist/chunk-rk4mttds.js +2 -0
  100. package/dist/chunk-rma3bv36.js +2 -0
  101. package/dist/chunk-rp5a91ak.js +2 -0
  102. package/dist/{chunk-hhys3aaa.js → chunk-rs46hksk.js} +2 -2
  103. package/dist/{chunk-wn5zjs5m.js → chunk-rtk6n3vh.js} +3 -3
  104. package/dist/chunk-rwn3b21z.js +3 -0
  105. package/dist/chunk-sp5x96rn.js +2 -0
  106. package/dist/chunk-st79dqpz.js +2 -0
  107. package/dist/{chunk-8g1fx4mg.js → chunk-stbsqy7e.js} +2 -2
  108. package/dist/chunk-t2mjeezd.js +2 -0
  109. package/dist/chunk-t61j834x.js +2 -0
  110. package/dist/{chunk-s19r6qe3.js → chunk-t6769zcy.js} +55 -55
  111. package/dist/chunk-t94z65ry.js +2 -0
  112. package/dist/{chunk-0ytm2ecf.js → chunk-tkeabv04.js} +16 -16
  113. package/dist/{chunk-1e7g79x4.js → chunk-v1m9nrn9.js} +1 -1
  114. package/dist/chunk-v2vg5jqq.js +2 -0
  115. package/dist/{chunk-07abr1v4.js → chunk-vg8thz41.js} +3 -3
  116. package/dist/chunk-vmfw4svt.js +2 -0
  117. package/dist/chunk-w6ecbk3y.js +2 -0
  118. package/dist/chunk-wbv6vjhm.js +2 -0
  119. package/dist/chunk-wfbr3txe.js +2 -0
  120. package/dist/{chunk-1v6yyvxf.js → chunk-wk85dz07.js} +3 -3
  121. package/dist/chunk-wpnv0naj.js +2 -0
  122. package/dist/chunk-wwny5dk9.js +2 -0
  123. package/dist/chunk-wzymzex7.js +2 -0
  124. package/dist/chunk-x55avrcf.js +2 -0
  125. package/dist/{chunk-hbwmmt91.js → chunk-xab6b4mt.js} +2 -2
  126. package/dist/{chunk-fd795e6s.js → chunk-xb0785wp.js} +2 -2
  127. package/dist/{chunk-1s7qdv2h.js → chunk-xcfhy5bj.js} +3 -3
  128. package/dist/{chunk-b0zz4dbx.js → chunk-xdtz2v5r.js} +3 -3
  129. package/dist/chunk-xmwd2xm6.js +2 -0
  130. package/dist/chunk-xtknewf7.js +2 -0
  131. package/dist/{chunk-wm5b2y65.js → chunk-y4qks0bd.js} +2 -2
  132. package/dist/{chunk-1h4z3xpy.js → chunk-y7ds4qyb.js} +3 -3
  133. package/dist/{chunk-p8c5g5n2.js → chunk-yn3kp3qy.js} +5 -5
  134. package/dist/chunk-yts2745t.js +2 -0
  135. package/dist/chunk-zah67v44.js +2 -0
  136. package/dist/chunk-zpdq0kx1.js +2 -0
  137. package/dist/chunk-zpf9he2x.js +2 -0
  138. package/dist/chunk-zpftj8s8.js +2 -0
  139. package/dist/{chunk-xpvvne6r.js → chunk-zzphh8g9.js} +9 -9
  140. package/dist/cli.js +62 -62
  141. package/dist/craft-entry.js +2 -2
  142. package/dist/craft.js +2 -2
  143. package/dist/image-optimization/processor.js +6 -8
  144. package/dist/native/runtime/native-host.js +4 -1
  145. package/dist/native-build.js +12 -7
  146. package/dist/pwa.js +3 -3
  147. package/dist/ssg.js +13 -13
  148. package/dist/temp-dir.d.ts +52 -0
  149. package/dist/temp-dir.js +140 -0
  150. package/package.json +5 -5
  151. package/dist/chunk-088jh5zy.js +0 -2
  152. package/dist/chunk-089x96rp.js +0 -2
  153. package/dist/chunk-0fad6jf4.js +0 -2
  154. package/dist/chunk-0fna7gd0.js +0 -2
  155. package/dist/chunk-0ksq0e6s.js +0 -2
  156. package/dist/chunk-2bwhc8ea.js +0 -2
  157. package/dist/chunk-2fb4yx25.js +0 -4
  158. package/dist/chunk-2y82wf9d.js +0 -3
  159. package/dist/chunk-3bsnte2s.js +0 -2
  160. package/dist/chunk-3j02tj5n.js +0 -2
  161. package/dist/chunk-3j9de8yh.js +0 -2
  162. package/dist/chunk-3v2bf157.js +0 -2
  163. package/dist/chunk-62ry3ta3.js +0 -2
  164. package/dist/chunk-62s4jb6m.js +0 -2
  165. package/dist/chunk-6dd0zr74.js +0 -2
  166. package/dist/chunk-87zse67b.js +0 -2
  167. package/dist/chunk-9hx4s11k.js +0 -2
  168. package/dist/chunk-9z76qhdm.js +0 -2
  169. package/dist/chunk-a0pq8xg4.js +0 -2
  170. package/dist/chunk-ad0czgpa.js +0 -2
  171. package/dist/chunk-axjzqh7v.js +0 -2
  172. package/dist/chunk-bday3eyq.js +0 -2
  173. package/dist/chunk-c2243par.js +0 -2
  174. package/dist/chunk-csy2m03w.js +0 -2
  175. package/dist/chunk-d3qdcdz9.js +0 -2
  176. package/dist/chunk-dvph69ej.js +0 -2
  177. package/dist/chunk-e1c9gypy.js +0 -2
  178. package/dist/chunk-eadr1eph.js +0 -2
  179. package/dist/chunk-eh3nvr2g.js +0 -2
  180. package/dist/chunk-f3nxd8z8.js +0 -2
  181. package/dist/chunk-fanmabb0.js +0 -2
  182. package/dist/chunk-fjd5ka6v.js +0 -2
  183. package/dist/chunk-fq5xecrx.js +0 -2
  184. package/dist/chunk-g25n9e8z.js +0 -2
  185. package/dist/chunk-g7ey7mtw.js +0 -3
  186. package/dist/chunk-gaz311xs.js +0 -2
  187. package/dist/chunk-ggb57j6c.js +0 -3
  188. package/dist/chunk-hmk2x1t8.js +0 -2
  189. package/dist/chunk-j1tbfabt.js +0 -2
  190. package/dist/chunk-jftv278d.js +0 -2
  191. package/dist/chunk-jj8ssn0d.js +0 -3
  192. package/dist/chunk-jkd0c82m.js +0 -2
  193. package/dist/chunk-jw536pve.js +0 -2
  194. package/dist/chunk-jwx0h9qb.js +0 -2
  195. package/dist/chunk-k4p80n25.js +0 -2
  196. package/dist/chunk-kpvr93cb.js +0 -2
  197. package/dist/chunk-kxa069d6.js +0 -2
  198. package/dist/chunk-pkwed7dt.js +0 -2
  199. package/dist/chunk-pq5nywkf.js +0 -2
  200. package/dist/chunk-qfm2gy40.js +0 -2
  201. package/dist/chunk-r37sf7ys.js +0 -18
  202. package/dist/chunk-rnnead1w.js +0 -2
  203. package/dist/chunk-szbvewf8.js +0 -2
  204. package/dist/chunk-t2yrb7pt.js +0 -2
  205. package/dist/chunk-tjjvphx3.js +0 -2
  206. package/dist/chunk-tsdjwe93.js +0 -2
  207. package/dist/chunk-v70hfs6d.js +0 -2
  208. package/dist/chunk-vp37585y.js +0 -2
  209. package/dist/chunk-vr0fb0x1.js +0 -2
  210. package/dist/chunk-w5kx0qzg.js +0 -2
  211. package/dist/chunk-wy36z6qp.js +0 -2
  212. package/dist/chunk-wyxjsx4k.js +0 -2837
  213. package/dist/chunk-x7a4c0x1.js +0 -2
  214. package/dist/chunk-y0a89hgw.js +0 -2
  215. package/dist/chunk-y4b60ke0.js +0 -2
  216. package/dist/chunk-yn2d8x8m.js +0 -3
  217. package/dist/chunk-yqh6dny3.js +0 -2
  218. package/dist/chunk-z4f2msjp.js +0 -2
  219. package/dist/chunk-zmdyr321.js +0 -3
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{b,u,n,g,R}from"./chunk-wyxjsx4k.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function dd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await u(m,y,e);let T=z(c),l=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,l);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,l);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,l);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,l);i.enqueue(I)}}}}else{let h=new Map;for(let d of T)if(d.type==="shell"||d.type==="content"){let p=await n(d.content,y,e,s,l);i.enqueue(p)}else if(d.type==="suspense"&&d.name){let p=`stx-suspense-${d.name}`;i.enqueue(`<div id="${p}" data-suspense="${d.name}" style="display:contents;">
2
+ import{b,d,n,g,R}from"./chunk-g5t10z04.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function fd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
- </div>`),h.set(d.name,n(d.content,y,e,s,l))}i.enqueue(`
4
+ </div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
5
5
  <script>
6
6
  (function() {
7
7
  window.__stxSuspense = window.__stxSuspense || {
@@ -17,13 +17,13 @@ import{b,u,n,g,R}from"./chunk-wyxjsx4k.js";import q from"path";var M={enabled:!0
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let S=Array.from(h.entries()).map(async([d,p])=>{i.enqueue(await So(d,p))});await Promise.all(S)}i.close()}catch(a){i.error(a)}}})}async function So(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let S=Array.from(h.entries()).map(async([l,p])=>{i.enqueue(await Co(l,p))});await Promise.all(S)}i.close()}catch(a){i.error(a)}}})}async function Co(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${s}\`);
23
23
  </script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${b(s)}</div>');
26
- </script>`}}var ja=`
26
+ </script>`}}var za=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function ud(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(ja),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await So(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function pd(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function fd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function gd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await u(m,y,e);let T=new Set,l=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(l!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let d=0;d<S.length;d+=r)i.enqueue(S.slice(d,d+r))}else{let S=[],d=new RegExp(C.source,"g"),p;while((p=d.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function md(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let l=c[1],v=c[2];m[l]=v}let y=a.replace(C,"");return{renderShell:async(l={})=>{let v={...l,__filename:e,__dirname:q.dirname(e)};return await u(i,v,e),n(y,v,e,o,new Set)},renderSection:async(l,v={})=>{try{if(!m[l])return`<div class="error-message">Section "${b(l)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await u(i,h,e);let S=new Set;return await n(m[l],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[l]||"",0,m[l]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ba={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Fa={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
46
+ </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function gd(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(za),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Co(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function md(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function hd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function yd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function bd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ha={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Va={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${m?`{${m}}`:"{}"}
50
50
  </script>
51
- </div>`}};function hd(e={}){let t=[];if(e.streaming?.enabled)t.push(Ba);if(e.hydration?.enabled)t.push(Fa);return t}async function yd(e,t,o,s={}){return e}function bd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function wd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function wd(e={}){let t=[];if(e.streaming?.enabled)t.push(Ha);if(e.hydration?.enabled)t.push(Va);return t}async function vd(e,t,o,s={}){return e}function xd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function Sd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{dd,So,ja,ud,pd,fd,gd,md,Ba,Fa,hd,yd,bd,wd};
194
+ export{fd,Co,za,gd,md,hd,yd,bd,Ha,Va,wd,vd,xd,Sd};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Zl(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function td(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function Ql(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function ed(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function td(){return`
229
+ `}function nd(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function rd(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function sd(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -300,7 +300,7 @@ catch (error) {
300
300
  background-size: 200% 100%;
301
301
  }
302
302
  }
303
- `}function nd(){return`
303
+ `}function od(){return`
304
304
  // STX Async Component Runtime
305
305
  (function() {
306
306
  if (typeof window === 'undefined') return;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{Zl,Ql,ed,td,nd};
358
+ export{td,nd,rd,sd,od};