@stacksjs/stx 0.2.415 → 0.2.417

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 (218) hide show
  1. package/dist/chunk-072f6hnz.js +2 -0
  2. package/dist/{chunk-0zaess6f.js → chunk-072mzamc.js} +5 -5
  3. package/dist/{chunk-q9bdh4s5.js → chunk-08p07eq7.js} +2 -2
  4. package/dist/chunk-0x076wz1.js +2 -0
  5. package/dist/{chunk-xfp7k0v8.js → chunk-0xgf3xgy.js} +16 -16
  6. package/dist/chunk-1680nbq4.js +2816 -0
  7. package/dist/{chunk-9g27ybyr.js → chunk-25n4gmek.js} +2 -2
  8. package/dist/chunk-2gfj59pt.js +2 -0
  9. package/dist/chunk-2gntnw7e.js +2 -0
  10. package/dist/chunk-2hvvwhmv.js +2 -0
  11. package/dist/{chunk-m4sk62wb.js → chunk-31a8eh0j.js} +4 -4
  12. package/dist/{chunk-t4hzprsm.js → chunk-3aqe7wy7.js} +2 -2
  13. package/dist/{chunk-ej9j6k1q.js → chunk-3f5td68v.js} +2 -2
  14. package/dist/chunk-3senpdjt.js +3 -0
  15. package/dist/{chunk-5qns2sdz.js → chunk-3wmxb126.js} +2 -2
  16. package/dist/{chunk-ft4p6d28.js → chunk-47h689h6.js} +2 -2
  17. package/dist/chunk-4bhertga.js +2 -0
  18. package/dist/chunk-4s9dypby.js +2 -0
  19. package/dist/{chunk-s5xezjps.js → chunk-5f3k2mke.js} +1 -1
  20. package/dist/{chunk-r3f9jcf7.js → chunk-5fwy3xap.js} +3 -3
  21. package/dist/{chunk-g186znp9.js → chunk-5vzamjf6.js} +4 -4
  22. package/dist/chunk-5z56g0n4.js +2 -0
  23. package/dist/chunk-68rq2fqt.js +12 -0
  24. package/dist/chunk-6ad0nseq.js +2 -0
  25. package/dist/{chunk-czxt605c.js → chunk-76japd6k.js} +4 -4
  26. package/dist/chunk-7eazcxzf.js +2 -0
  27. package/dist/chunk-7hy29tcy.js +2 -0
  28. package/dist/{chunk-ngc2wke4.js → chunk-7q1yy18q.js} +2 -2
  29. package/dist/{chunk-thyt8ed8.js → chunk-85bm5xrm.js} +3 -3
  30. package/dist/{chunk-7gkv67ky.js → chunk-865xvpp2.js} +2 -2
  31. package/dist/chunk-8fyqbq14.js +2 -0
  32. package/dist/chunk-92xzpt6p.js +2 -0
  33. package/dist/{chunk-96k8s808.js → chunk-94ky725r.js} +2 -2
  34. package/dist/{chunk-fh1qrp68.js → chunk-9af8qbwb.js} +5 -5
  35. package/dist/{chunk-j03revz2.js → chunk-9bq4w4d6.js} +3 -3
  36. package/dist/chunk-9kmmafp4.js +2 -0
  37. package/dist/{chunk-vgvtnwxa.js → chunk-9r5ycpdg.js} +3 -3
  38. package/dist/{chunk-gawrg4gb.js → chunk-9yt899e7.js} +6 -6
  39. package/dist/chunk-atgwc7r7.js +2 -0
  40. package/dist/{chunk-a688m6js.js → chunk-ayd5r3se.js} +2 -2
  41. package/dist/{chunk-ce1sejr3.js → chunk-bk5ndwv3.js} +2 -2
  42. package/dist/chunk-bs6y5wy2.js +2 -0
  43. package/dist/{chunk-y5310237.js → chunk-bt11a8z4.js} +3 -3
  44. package/dist/{chunk-amd6ey3t.js → chunk-c8p4v1rd.js} +5 -5
  45. package/dist/chunk-ccg6xjr1.js +2 -0
  46. package/dist/chunk-ckv4aty5.js +2 -0
  47. package/dist/{chunk-mp6hy8g4.js → chunk-d0ynfema.js} +1 -1
  48. package/dist/chunk-d6h9rpm4.js +30 -0
  49. package/dist/chunk-dbh7h0kt.js +2 -0
  50. package/dist/chunk-dhqkg0ph.js +2 -0
  51. package/dist/{chunk-h6zsqb9r.js → chunk-dw961rvn.js} +2 -2
  52. package/dist/{chunk-340a824p.js → chunk-dym1eteb.js} +1 -1
  53. package/dist/{chunk-ak1cgcah.js → chunk-e2m674vf.js} +4 -4
  54. package/dist/{chunk-169n1vpx.js → chunk-e83j8xe9.js} +4 -4
  55. package/dist/chunk-ettat5ah.js +2 -0
  56. package/dist/{chunk-6hc5vz20.js → chunk-ev8bhsc0.js} +2 -2
  57. package/dist/chunk-f4ws0qcd.js +2 -0
  58. package/dist/chunk-f97v10zr.js +2 -0
  59. package/dist/chunk-fe5st320.js +2 -0
  60. package/dist/chunk-fet3hce8.js +2 -0
  61. package/dist/chunk-fq7128p1.js +2 -0
  62. package/dist/{chunk-x0q32ees.js → chunk-fr8jq2ys.js} +2 -2
  63. package/dist/chunk-fwy2h1ms.js +2 -0
  64. package/dist/{chunk-shr559s7.js → chunk-fxhvkenf.js} +2 -2
  65. package/dist/{chunk-6h38kkjf.js → chunk-g947brd0.js} +6 -6
  66. package/dist/{chunk-tafqyf2g.js → chunk-gfm7g98y.js} +95 -95
  67. package/dist/chunk-gtkhykc4.js +2 -0
  68. package/dist/{chunk-y1cmjvk3.js → chunk-h8f18cc5.js} +6 -6
  69. package/dist/chunk-h8pkm7c5.js +2 -0
  70. package/dist/{chunk-hkrmcbwy.js → chunk-hg3tyzn5.js} +11 -11
  71. package/dist/{chunk-ym95v4nc.js → chunk-hkxxfzfd.js} +2 -2
  72. package/dist/{chunk-b84h16er.js → chunk-hm2k9a04.js} +7 -7
  73. package/dist/chunk-hneg0155.js +2 -0
  74. package/dist/chunk-hs90en70.js +2 -0
  75. package/dist/{chunk-v91p6ekp.js → chunk-jfjym18d.js} +5 -5
  76. package/dist/chunk-jgsgd6rt.js +17 -0
  77. package/dist/chunk-jn3njpxs.js +2 -0
  78. package/dist/chunk-ka8x4sw6.js +18 -0
  79. package/dist/{chunk-8eqrwj1k.js → chunk-kds79hq3.js} +11 -11
  80. package/dist/{chunk-9vrja6vp.js → chunk-kkj5x9rp.js} +1 -1
  81. package/dist/chunk-mcqn70v8.js +3 -0
  82. package/dist/chunk-mcs7p3fy.js +2 -0
  83. package/dist/{chunk-hepd9qgx.js → chunk-mj6fme15.js} +5 -5
  84. package/dist/{chunk-yazk54jr.js → chunk-mj9yv1vb.js} +1 -1
  85. package/dist/chunk-mmtg0jxd.js +2 -0
  86. package/dist/chunk-mrsxwd0h.js +2 -0
  87. package/dist/chunk-mscky0ww.js +2 -0
  88. package/dist/chunk-mtphm33a.js +2 -0
  89. package/dist/chunk-p2jbc71s.js +2 -0
  90. package/dist/{chunk-fr2txj8q.js → chunk-pb0fgdvn.js} +4 -4
  91. package/dist/{chunk-amtr3rmf.js → chunk-psmdbcbc.js} +4 -4
  92. package/dist/chunk-pvd9k3kx.js +2 -0
  93. package/dist/chunk-pz1jc3db.js +2 -0
  94. package/dist/chunk-q8swb7na.js +4 -0
  95. package/dist/{chunk-3kthfs03.js → chunk-qmzwhtr2.js} +2 -2
  96. package/dist/chunk-qvr6e2ve.js +3 -0
  97. package/dist/chunk-ra0pkkvd.js +2 -0
  98. package/dist/chunk-rcbtd4w3.js +2 -0
  99. package/dist/chunk-rd2r9jvn.js +2 -0
  100. package/dist/chunk-s8srb8bg.js +2 -0
  101. package/dist/{chunk-md8rqn48.js → chunk-sjjc670z.js} +9 -9
  102. package/dist/chunk-snf2b68p.js +2 -0
  103. package/dist/chunk-t2bfwr9v.js +2 -0
  104. package/dist/chunk-tbmwdahm.js +2 -0
  105. package/dist/{chunk-qghxz7jm.js → chunk-v15g9jjh.js} +6 -6
  106. package/dist/{chunk-8nhshfz6.js → chunk-vdqa5gt7.js} +2 -2
  107. package/dist/{chunk-9amp82bx.js → chunk-vepc9rbt.js} +2 -2
  108. package/dist/{chunk-eed4fwps.js → chunk-vfdwvt23.js} +2 -2
  109. package/dist/chunk-vpv896zx.js +2 -0
  110. package/dist/{chunk-bay9s6rs.js → chunk-vyfg2qd2.js} +5 -5
  111. package/dist/{chunk-9pt8fd2n.js → chunk-w5zmvn7b.js} +3 -3
  112. package/dist/chunk-w6h63b48.js +2 -0
  113. package/dist/{chunk-pgzvyrv6.js → chunk-wgzxmh7w.js} +3 -3
  114. package/dist/{chunk-jnkrn913.js → chunk-wpkxbggq.js} +1 -1
  115. package/dist/chunk-wrk3gkgg.js +2 -0
  116. package/dist/chunk-wtd71jsa.js +2 -0
  117. package/dist/{chunk-z0g9jvv0.js → chunk-wweasgq9.js} +18 -18
  118. package/dist/chunk-wymf1ek6.js +2 -0
  119. package/dist/chunk-wz8hyh8h.js +4 -0
  120. package/dist/chunk-x32wpjs0.js +2 -0
  121. package/dist/chunk-x4q2eyt0.js +2 -0
  122. package/dist/chunk-x95ejws0.js +2 -0
  123. package/dist/chunk-xket8ejt.js +2 -0
  124. package/dist/{chunk-pbh4smw3.js → chunk-xt6d3zws.js} +4 -4
  125. package/dist/{chunk-752hw7cd.js → chunk-xvn3sv3v.js} +3 -3
  126. package/dist/{chunk-tfexmdkt.js → chunk-xwkdv585.js} +2 -2
  127. package/dist/{chunk-765e1s44.js → chunk-y9t55tv7.js} +6 -6
  128. package/dist/chunk-ypfzy1mq.js +2 -0
  129. package/dist/{chunk-9p9qkbtg.js → chunk-yrbzsrde.js} +2 -2
  130. package/dist/chunk-zg68pwy8.js +2 -0
  131. package/dist/chunk-zs58fnme.js +2 -0
  132. package/dist/chunk-zy3p0vmx.js +3 -0
  133. package/dist/cli.js +21 -21
  134. package/dist/craft-entry.js +2 -2
  135. package/dist/craft.js +2 -2
  136. package/dist/dev-server/serve-app.js +3 -0
  137. package/dist/dev-server/serve-multi.js +1 -1
  138. package/dist/dev-server/ts-css.d.ts +11 -0
  139. package/dist/dev-server/ts-css.js +13 -1
  140. package/dist/document-shell.js +15 -3
  141. package/dist/native/components/primitives.d.ts +2 -0
  142. package/dist/production-server.js +4 -4
  143. package/dist/pwa.js +3 -3
  144. package/dist/ssg.js +17 -17
  145. package/package.json +5 -5
  146. package/dist/chunk-020xyn9q.js +0 -3
  147. package/dist/chunk-04jhmfbz.js +0 -2
  148. package/dist/chunk-0pnj3zt2.js +0 -2
  149. package/dist/chunk-1098mas0.js +0 -2
  150. package/dist/chunk-18vmfkcc.js +0 -2
  151. package/dist/chunk-1b6t12hd.js +0 -2
  152. package/dist/chunk-1zs30k3y.js +0 -2
  153. package/dist/chunk-2ce7f416.js +0 -2
  154. package/dist/chunk-393341w7.js +0 -2
  155. package/dist/chunk-39g1134q.js +0 -2
  156. package/dist/chunk-3efw27as.js +0 -2785
  157. package/dist/chunk-3qn1wcdg.js +0 -2
  158. package/dist/chunk-3s2vnqcf.js +0 -2
  159. package/dist/chunk-42wbs8vq.js +0 -17
  160. package/dist/chunk-4bjravgk.js +0 -2
  161. package/dist/chunk-5gsxpaqk.js +0 -2
  162. package/dist/chunk-6cfa3g0r.js +0 -2
  163. package/dist/chunk-7z2ra0yf.js +0 -2
  164. package/dist/chunk-92ps1xpk.js +0 -2
  165. package/dist/chunk-9xrbve19.js +0 -2
  166. package/dist/chunk-atws6p5s.js +0 -2
  167. package/dist/chunk-b98be3yp.js +0 -32
  168. package/dist/chunk-dd8cja4h.js +0 -2
  169. package/dist/chunk-dgdm3hy3.js +0 -2
  170. package/dist/chunk-e9hs7kk6.js +0 -12
  171. package/dist/chunk-et0rr8c7.js +0 -3
  172. package/dist/chunk-f1sxycmv.js +0 -2
  173. package/dist/chunk-f46qsp4m.js +0 -4
  174. package/dist/chunk-fbcv4fes.js +0 -2
  175. package/dist/chunk-fjs0a8h7.js +0 -2
  176. package/dist/chunk-fpfzm238.js +0 -2
  177. package/dist/chunk-fyzajkrx.js +0 -2
  178. package/dist/chunk-fzapbw9p.js +0 -3
  179. package/dist/chunk-g03s93qr.js +0 -3
  180. package/dist/chunk-gc1drn2p.js +0 -2
  181. package/dist/chunk-gea5hf0v.js +0 -2
  182. package/dist/chunk-gqv3ta5d.js +0 -2
  183. package/dist/chunk-h6kp2m9r.js +0 -2
  184. package/dist/chunk-hbxz85wy.js +0 -2
  185. package/dist/chunk-hhnw2sn3.js +0 -2
  186. package/dist/chunk-hjg3ndgh.js +0 -2
  187. package/dist/chunk-hk1mj4tz.js +0 -2
  188. package/dist/chunk-hn9pkyv8.js +0 -2
  189. package/dist/chunk-hpgr4qgp.js +0 -2
  190. package/dist/chunk-hrbbbtbn.js +0 -2
  191. package/dist/chunk-j9qcrwbg.js +0 -2
  192. package/dist/chunk-jk4njz0w.js +0 -2
  193. package/dist/chunk-jmabeqfq.js +0 -2
  194. package/dist/chunk-jp10q90g.js +0 -2
  195. package/dist/chunk-jt0n43mk.js +0 -2
  196. package/dist/chunk-kjbv8a3m.js +0 -2
  197. package/dist/chunk-m1vdghnx.js +0 -2
  198. package/dist/chunk-nc8my58s.js +0 -2
  199. package/dist/chunk-nn2vstke.js +0 -2
  200. package/dist/chunk-nppdrf0x.js +0 -2
  201. package/dist/chunk-p2v2a68k.js +0 -2
  202. package/dist/chunk-pazfr1a1.js +0 -2
  203. package/dist/chunk-pdb5fw3r.js +0 -2
  204. package/dist/chunk-pdt69hpb.js +0 -2
  205. package/dist/chunk-px7fvbj6.js +0 -3
  206. package/dist/chunk-q6vrb2pe.js +0 -2
  207. package/dist/chunk-q7qchkvk.js +0 -2
  208. package/dist/chunk-re8b5r9x.js +0 -3
  209. package/dist/chunk-sd321bn3.js +0 -2
  210. package/dist/chunk-t5pvq5mx.js +0 -2
  211. package/dist/chunk-w72qx0eb.js +0 -2
  212. package/dist/chunk-wfy1zq53.js +0 -30
  213. package/dist/chunk-wzx0164n.js +0 -18
  214. package/dist/chunk-xtvf6n6f.js +0 -4
  215. package/dist/chunk-xwzvfqcb.js +0 -2
  216. package/dist/chunk-ydjfar14.js +0 -2
  217. package/dist/chunk-z23kaxq6.js +0 -2
  218. package/dist/chunk-z8xn5ta3.js +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{yr,Ks,kn,br,vr,Dt,lt,Gs,Cn,$n,wr,xr,Hc,Vc,Ae}from"./chunk-md8rqn48.js";export{Ae as DeployError,Ks as calculateSha1,kn as collectDeployFiles,$n as createDefaultNetlifyConfig,br as createFileManifest,yr as createNetlifyClient,Hc as deploy,Cn as detectProjectConfig,vr as filterRequiredFiles,Dt as formatSize,Gs as generateNetlifyToml,lt as getTotalSize,xr as hasNetlifyConfig,Vc as initNetlify,wr as writeNetlifyConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wl}from"./chunk-5qns2sdz.js";export{wl as processDeferDirectives};
@@ -1,17 +0,0 @@
1
- // @bun
2
- import{y,i,T}from"./chunk-3efw27as.js";import{P,kt}from"./chunk-b98be3yp.js";import{qr}from"./chunk-hepd9qgx.js";import{he}from"./chunk-et0rr8c7.js";import{s,we}from"./chunk-169n1vpx.js";import{o}from"./chunk-fzapbw9p.js";import f from"path";import b from"fs";function de(e){if(!e||typeof e!=="object")return!1;let t=e;return typeof t.message==="string"&&(t.name==="BuildMessage"||t.name==="ResolveMessage"||("position"in t))}function pe(e){if(e&&typeof e==="object"&&Array.isArray(e.errors))return e.errors;return[e]}function U(e,t){let r=[];for(let l of pe(e)){if(de(l)){let u=l.position||void 0;r.push({file:t||u?.file,line:u?.line,column:u?.column,message:l.message??"",lineText:u?.lineText});continue}r.push({file:t,message:l instanceof Error?l.message:String(l)})}return r}function Me(e,t){return U(e,t).map((r)=>{let l=r.file?`${r.file}${r.line?`:${r.line}${r.column?`:${r.column}`:""}`:""}`:"",u=r.lineText?`
3
- ${r.lineText.trim()}`:"";return l?`${l}: ${r.message}${u}`:`${r.message}${u}`}).join(`
4
- `)}var me=9;function z(e,t,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(f.basename(e))||qr(e,t,r)}var re=1,se=new Map,J=600,fe=100,V=new Map;async function ge(e){let t=V.get(e)??0;if(t>0&&t<fe){V.set(e,t+1);return}V.set(e,1);try{let r=(await b.promises.readdir(e)).filter((p)=>p.endsWith(".js"));if(r.length<=J)return;let u=(await Promise.all(r.map(async(p)=>{try{return{name:p,at:(await b.promises.stat(f.join(e,p))).mtimeMs}}catch{return null}}))).filter((p)=>p!==null);u.sort((p,d)=>d.at-p.at);for(let p of u.slice(J)){let d=p.name.slice(0,-3);await b.promises.rm(f.join(e,`${d}.js`),{force:!0}),await b.promises.rm(f.join(e,`${d}.deps.json`),{force:!0})}F("pruned bundle cache to",J,"entries")}catch{}}function ce(e){return se.get(e)??[]}function G(e,t){if(e)se.set(e,t)}function Fa(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function F(...e){if(Fa())console.log("[stx:bundler]",...e)}var q=[];function Di(e,t,r){q.push({filePath:e||"<inline>",message:t,details:r})}function ft(){return q.slice()}function gt(){q.length=0}var X;function $u(e){X=e}function Oi(){if(X)return X;try{let e=T.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var ee=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function mt(e){let t=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=t.exec(e))!==null){let u=r[1];if(!ee.some((d)=>d.test(u)))return F("detected user import:",u),!0}let l=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((r=l.exec(e))!==null){let u=r[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!ee.some((d)=>d.test(u)))return F("detected side-effect import:",u),!0}return!1}var nn="stx-module:",xe=/\.(?:[cm]?[jt]sx?|json)$/i;function za(e,t){return f.relative(e,t).split(f.sep).join("/")}function Ha(e,t){if(t.size===0)return e;return e.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(r,l,u,p)=>{let d=t.get(p);return d&&!p.startsWith(nn)?`${l}${u}${d}${u}`:r})}function Va(e,t){let r=0,l=(p)=>{let d=`__stxMod${r++}`,x=JSON.stringify(p);return t.push(`var ${d} = globalThis.__stxModules && globalThis.__stxModules[${x}];`,`if (${d} === undefined) throw new Error("[stx] module " + ${JSON.stringify(x)} + " is not registered on this page (#1957)");`),d},u=(p,d)=>{for(let x of p.split(",")){let v=x.trim();if(!v)continue;let c=v.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!c)continue;let n=c[1].startsWith('"')?JSON.parse(c[1]):c[1],a=c[2]??n;t.push(`var ${a} = ${d}[${JSON.stringify(n)}];`)}};return e=e.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d,x)=>{let v=x.slice(nn.length),c=l(v),n=d.trim(),a=n.match(/^([\w$]+)\s*(?:,\s*|$)/);if(a&&!n.startsWith("{")&&!n.startsWith("*"))t.push(`var ${a[1]} = ${c}.default;`),n=n.slice(a[0].length).trim();let m=n.match(/^\*\s*as\s+([\w$]+)$/);if(m)t.push(`var ${m[1]} = ${c};`);else if(n.startsWith("{"))u(n.replace(/^\{|\}$/g,""),c);return""}),e=e.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d)=>(l(d.slice(nn.length)),"")),e}function te(e){let t=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,f.join(e,"index.ts"),f.join(e,"index.tsx"),f.join(e,"index.js"),f.join(e,"index.mjs")];for(let r of t)try{if(b.existsSync(r)&&b.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}function $e(e,t,r,l,u,p=new Map,d){let x=(c,n,a)=>{if(z(n,e,d))return null;if(!u||c!==r||!xe.test(n))return null;try{if(!b.statSync(n,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(n);let m=`${nn}${za(process.cwd(),n)}`;return p.set(a,m),{path:m,external:!0}},v=(c,n)=>{let a=c===r?t:f.dirname(c),m=f.resolve(a,n);return te(m)??m};return{name:"stx-client-bundle",setup(c){if(c.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^\//},(n)=>{let a=te(n.path);if(a){let m=x(n.importer,a,n.path);if(m)return m;if(a!==r)l.add(a);return{path:a}}return{path:n.path,external:!0}}),c.onResolve({filter:/^\.\.?\//},(n)=>{let a=v(n.importer,n.path),m=x(n.importer,a,n.path);if(m)return m;return l.add(a),{path:a}}),c.onResolve({filter:/^[@~]\//},(n)=>{let a=f.resolve(e,n.path.slice(2)),m=[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.mjs`,`${a}.jsx`,f.join(a,"index.ts"),f.join(a,"index.tsx"),f.join(a,"index.js"),f.join(a,"index.mjs")];for(let w of m)if(b.existsSync(w)&&b.statSync(w,{throwIfNoEntry:!1})?.isFile()){let I=x(n.importer,w,n.path);if(I)return I;return F(`resolved ${n.path[0]}/ import:`,n.path,"\u2192",w),l.add(w),{path:w}}return console.warn(`[stx:bundler] could not resolve ${n.path[0]}/ import:`,n.path),{path:a}}),u)c.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(n)=>{if(n.importer!==r)return;let a=`${nn}npm:${n.path}`;return p.set(n.path,a),{path:a,external:!0}});c.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(n)=>{if(z(n.path,e,d))throw Error(`Server-only API source cannot be imported by a client script: ${n.path}`);let a=f.extname(n.path).toLowerCase(),m=a===".json"?"json":a===".tsx"?"tsx":a===".jsx"?"jsx":a===".ts"||a===".mts"||a===".cts"?"ts":"js";if(n.path!==r)l.add(n.path);return{contents:b.readFileSync(n.path,"utf8"),loader:m}})}}}var W=new Map,L=P(64),ne=Symbol.for("stx.client-bundle-build-queue");function Ua(e){let t=globalThis,l=(t[ne]??Promise.resolve()).then(e,e);return t[ne]=l.then(()=>{return},()=>{return}),l}async function ht(e,t,r={}){let l=r.projectRoot||process.cwd(),u=(await i(l)).serverApi,p=r.minify??!1,d=r.externalizeUserModules??!0,x=r.cacheDir||o(l,"bundle-cache"),v=new Bun.CryptoHasher("md5");v.update(`${me}\x00${he()}\x00${JSON.stringify(u??!1)}\x00${d?"registry":"inline"}\x00${e}\x00${t}`);let c=v.digest("hex").slice(0,12),n=f.join(x,`${c}.js`),a=L.get(n);if(a){if(kt(a.files)&&a.files.every((E)=>!z(E.path,l,u))){F("memo hit:",c);let E=a.files.map((S)=>S.path);return G(t,E),r.collectInputs?.push(...E),a.code}L.delete(n),F("memo invalidated by dep change:",c)}let m=f.join(x,`${c}.deps.json`),w=Bun.file(n);if(await w.exists()){let E=Bun.file(m),S=!1,B=null;if(await E.exists())try{let D=JSON.parse(await E.text());if(D.metadataVersion!==re||!Array.isArray(D.files))S=!1;else B=D.files,S=!0;if(B&&(!kt(B)||B.some((N)=>z(N.path,l,u))))S=!1}catch{S=!1}if(S){if(F("cache hit:",c),B)G(t,B.map((N)=>N.path)),r.collectInputs?.push(...B.map((N)=>N.path));let D=await w.text();if(B)L.set(n,{code:D,files:B});return D}F("cache invalidated by dep change:",c)}let I=W.get(c);if(I){let E=await I;if(r.collectInputs)r.collectInputs.push(...(L.get(n)?.files??[]).map((S)=>S.path));return E}let _=Ua(()=>ye(e,t,{projectRoot:l,minify:p,cacheDir:x,hash:c,cachePath:n,depsPath:m,collectInputs:r.collectInputs,externalizeUserModules:d,serverApi:u}));W.set(c,_);try{return await _}finally{W.delete(c)}}var be=0;function Wa(e){return`${e}-${process.pid}-${++be}`}async function ye(e,t,r){let{projectRoot:l,minify:u,cacheDir:p,hash:d,cachePath:x,depsPath:v,externalizeUserModules:c}=r,n=o(l,"bundle-tmp"),a=Wa(d),m=f.join(n,`${a}.ts`),w=f.join(n,"out",a);b.mkdirSync(n,{recursive:!0}),b.mkdirSync(w,{recursive:!0});let I=f.dirname(t),_=new Set,E=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,S=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:D,balanced:N}=we(B),H=(j)=>!N||D[j]===0,M;while((M=E.exec(B))!==null){if(M[1])continue;if(!H(M.index))continue;if(M[2])M[2].split(",").forEach((j)=>{let h=Be(j);if(h)_.add(h)});else if(M[3])_.add(M[3])}while((M=S.exec(B))!==null){if(M[1])continue;if(!H(M.index))continue;_.add(M[2])}let ie=_.size>0?`
5
- export { ${[..._].join(", ")} }`:"";await Bun.write(m,e+ie),F("bundling:",d,"from:",f.basename(t));let Z=new Set,Y=new Map;try{let j=await Bun.build({entrypoints:[m],outdir:w,target:"browser",format:"esm",minify:u,plugins:[$e(l,I,m,Z,c,Y,r.serverApi)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...y()},root:l});if(!j.success){let R=j.logs.filter((k)=>k.level==="error").map((k)=>k.message).join(", ")||`Unable to bundle ${f.basename(t)}`,C=U(j.logs,t||void 0);if(console.warn("[stx:bundler] build failed:",R),Di(t||"",R,C),Oi()==="error")throw Error(R);return e}let h="";for(let g of j.outputs){h=await g.text();break}let A=[];for(let g of h.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let R of g[1].split(",")){let C=R.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(C){A.push([C[2],C[1]]);continue}let k=R.trim();if(/^[A-Za-z_$][\w$]*$/.test(k))A.push([k,k])}let Q=[];h=Va(Ha(h,Y),Q);let oe=h.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];h=h.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let K=`__stxBundle_${d}`,ae=A.map(([g,R])=>`${JSON.stringify(g)}: ${R}`).join(", "),le=A.map(([g])=>`var ${g} = undefined;`).join(`
6
- `),ue=A.map(([g])=>`${g} = ${K}[${JSON.stringify(g)}];`).join(`
7
- `);if(h=`${oe.join(`
8
- `)}
9
- ${le}
10
- var ${K} = (function() {
11
- ${Q.join(`
12
- `)}
13
- ${h}
14
- return { ${ae} };
15
- })();
16
- ${ue}`.trim(),F("bundled:",d,"output:",h.length,"bytes"),_.size>0&&A.length===0)return console.warn(`[stx:bundler] dropped every binding for ${f.basename(t)} (${d}); serving the unbundled source and not caching this result`),e;b.mkdirSync(p,{recursive:!0}),await Bun.write(x,h);let O=Array.from(Z).map((g)=>{try{return{path:g,mtimeMs:b.statSync(g).mtimeMs}}catch{return null}}).filter((g)=>g!==null);return await Bun.write(v,JSON.stringify({metadataVersion:re,files:O})),G(t,O.map((g)=>g.path)),r.collectInputs?.push(...O.map((g)=>g.path)),L.set(x,{code:h,files:O}),await ge(p),h}catch(j){let h=U(j,t||void 0),A=Me(j,t||void 0);if(console.warn(`[stx:bundler] error: ${A}`),Di(t||"",A,h),Oi()==="error")throw j;return e}finally{try{b.rmSync(m,{force:!0}),b.rmSync(w,{recursive:!0,force:!0})}catch{}}}function Be(e){let t=e.trim();if(!t)return null;let r=t.indexOf("=");if(r!==-1)t=t.slice(0,r).trim();let l=t.indexOf(":");if(l!==-1)t=t.slice(l+1).trim();if(t.startsWith("..."))t=t.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(t)?t:null}
17
- export{Me,ce,Fa,Di,ft,gt,$u,Oi,mt,nn,za,Ha,Va,Ua,ht,Wa};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kc,vs}from"./chunk-shr559s7.js";export{kc as looksLikeGlob,vs as resolveStxTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rn,Kt,su}from"./chunk-765e1s44.js";import{U,An,Gt,Nr,Lr,Pn,iu,ou,au,Jt,Yt,jr,In,cu}from"./chunk-6hc5vz20.js";import"./chunk-ce1sejr3.js";export{Nr as batch,su as default,An as derived,Gt as effect,Rn as generateSignalsRuntime,Kt as generateSignalsRuntimeDev,Yt as isDerived,Jt as isSignal,Pn as onDestroy,Lr as onMount,In as peek,au as pendingLifecycleCounts,ou as runDestroyCallbacks,iu as runMountCallbacks,U as state,jr as untrack,cu as useOptimistic};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kl,Cl,$l,El,Tl,_l}from"./chunk-bay9s6rs.js";export{El as generateTransitionCSS,Tl as generateTransitionRuntime,kl as performEnter,Cl as performLeave,_l as processTransitionAttributes,$l as processTransitionDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ta}from"./chunk-t4hzprsm.js";export{Ta as rewriteImagesWithSiblings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ko,Kc}from"./chunk-3kthfs03.js";export{Ko as captureScreenshot,Kc as captureScreenshots};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{_s,Gu,Ju,So,fe,_c,sr,Yu,Zu,Qu,ed,td,nd,rd,sd,id}from"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";export{nd as applyHead,Yu as definePageMeta,_s as getHead,Gu as getPageMeta,fe as mergeHeadConfigs,rd as processHeadDirective,id as processMetaDirective,sd as processTitleDirective,td as renderBodyAttrs,Qu as renderHead,ed as renderHtmlAttrs,Ju as resetHead,sr as seoMetaToHeadConfig,So as useHead,Zu as usePageTitle,_c as useSeoMeta,Zu as useTitle};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ql,Xl}from"./chunk-amtr3rmf.js";import"./chunk-42wbs8vq.js";import"./chunk-hepd9qgx.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{Xl as clearStoreCache,ql as getStoreScript};
@@ -1,32 +0,0 @@
1
- // @bun
2
- import{o}from"./chunk-fzapbw9p.js";import h from"path";import{hasLocalConfig as Ae}from"bunfig";var ue={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function N(t){return`--stx-${t}`}function W(t,n){let r=n.lastIndexOf("-");if(r===-1)return typeof t[n]==="string"?t[n]:void 0;let s=t[n.slice(0,r)];if(!s||typeof s!=="object")return;let i=s[n.slice(r+1)];return typeof i==="string"?i:void 0}function de(t){let n={};for(let[r,s]of Object.entries(ue)){let i=W(t,s.light);if(i===void 0)continue;n[r]=`var(${N(r)}, ${i})`}return n}function ge(t){let n=[],r=[];for(let[s,i]of Object.entries(ue)){let a=W(t,i.light),c=W(t,i.dark);if(a===void 0)continue;if(n.push(` ${N(s)}: ${a};`),c!==void 0)r.push(` ${N(s)}: ${c};`)}if(n.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...n,"}",".dark {",...r,"}",""].join(`
3
- `)}var fe={control:{value:"0.375rem",description:"Buttons, inputs, selects \u2014 rounded-md"},panel:{value:"0.5rem",description:"Cards, dialogs, menus \u2014 rounded-lg"},pill:{value:"9999px",description:"Chips and badges, which are pill-shaped by intent"}};function pe(t){return`--stx-radius-${t}`}function he(){let t={};for(let[n,r]of Object.entries(fe))t[n]=`var(${pe(n)}, ${r.value})`;return t}function me(){return["/* stx shape tokens \u2014 a radius by what the thing is. */",":root {",...Object.entries(fe).map(([t,n])=>` ${pe(t)}: ${n.value};`),"}",""].join(`
4
- `)}function ye(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function F(t,n){let r={...t};for(let[s,i]of Object.entries(n))r[s]=ye(i)&&ye(r[s])?F(r[s],i):i;return r}function be(t={},n={}){let r=t.theme||{},s=n.theme||{},{extend:i,...a}=s,{extend:c,...d}=r,l=d.colors||{};d.colors={...l,...de(l)};let u=d.borderRadius||{};d.borderRadius={...u,...he()};let g=F(d,a),p=F(c||{},i||{});if(Object.keys(p).length>0)g.extend=p;let m=[...t.safelist||[],...n.safelist||[]],S={...t.shortcuts||{},...n.shortcuts||{}},C=[...t.preflights||[],...n.preflights||[]];return{config:{...t,...n,theme:g,safelist:m,shortcuts:S,...C.length>0?{preflights:C}:{},content:[],output:""},safelist:m,shortcuts:S,includePreflight:n.preflight!==!1,minify:n.minify===!0,tokenCSS:ge(l)+me()}}var _=/<script\b[^>]*>/iy,q=/<\/script\s*>/ig,M=/<style\b[^>]*>/iy,Q=/<\/style\s*>/ig;function Se(t,n,r,s){r.lastIndex=n;let i=r.exec(t);if(!i||i.index!==n)return-1;s.lastIndex=r.lastIndex;let a=s.exec(t);if(!a)return-1;return a.index+a[0].length}function G(t,n){return Se(t,n,_,q)}function Ct(t,n){return Se(t,n,M,Q)}function xe(t,n){if(!t.startsWith("<!--",n))return-1;let r=t.indexOf("-->",n+4);if(r===-1)return-1;return r+3}function Ce(t,n){if(t.startsWith("<!--",n)){let i=xe(t,n);return i===-1?t.length:i}if(_.lastIndex=n,_.exec(t)?.index===n){q.lastIndex=_.lastIndex;let i=q.exec(t);return i?i.index+i[0].length:t.length}if(M.lastIndex=n,M.exec(t)?.index===n){Q.lastIndex=M.lastIndex;let i=Q.exec(t);return i?i.index+i[0].length:t.length}return-1}function $t(t,n){let r=[],s=0,i=t.length,a=!1,c=null;while(s<i){let d=t[s];if(a){if(c){if(d===c)c=null}else if(d==='"'||d==="'")c=d;else if(d===">")a=!1;s++;continue}if(d!=="<"){let p=t.indexOf("<",s+1);if(p===-1)break;s=p;continue}let l=n(t,s);if(l>s){r.push({start:s,end:l,token:t.slice(s,l)}),s=l;continue}let u=Ce(t,s);if(u>s){s=u;continue}let g=t.charCodeAt(s+1);if(g>=65&&g<=90||g>=97&&g<=122)a=!0;s++}return r}function bo(t){let n=0,r=0,s=0,i=!1,a=null;while(s<t.length){if(i){let p=t[s];if(a){if(p===a)a=null}else if(p==='"'||p==="'")a=p;else if(p===">")i=!1;s++;continue}let c=t.indexOf("<",s),d=c===-1?t.length:c;while(s<d){let p=t[s++];if(p==="{")n++;else if(p==="}")r++;if(n>=2&&r>=2)return!0}if(c===-1)break;let l=Ce(t,c);if(l>c){s=l;continue}let u=t.charCodeAt(c+1),g=u===47?t.charCodeAt(c+2):u;if(g>=65&&g<=90||g>=97&&g<=122)i=!0;s=c+1}return!1}function Yn(t,n){while(t.size>=n){let r=t.keys().next();if(r.done)return;t.delete(r.value)}}var Ve=65536,He=12,U=new Map;function ne(t,n,r,s){let i=s!==void 0&&t.length>=Ve,a=i?`${s}\x00${t}`:"";if(i){let g=U.get(a);if(g)return{output:g.output,tokens:g.tokens.slice()}}let c=$t(t,n);if(c.length===0)return{output:t,tokens:[]};let d=c.map((g)=>g.token),l="",u=0;for(let g=0;g<c.length;g++){let p=c[g];l+=t.slice(u,p.start),l+=r(p.token,g),u=p.end}if(l+=t.slice(u),i)return Yn(U,He),U.set(a,{output:l,tokens:d}),{output:l,tokens:d.slice()};return{output:l,tokens:d}}var Ke=65536,Ne=4,Y=new Map;function X(t,n,r){return{output:n,scripts:r,restore:(s)=>s===n?t:Et(s,r)}}function V(t){let n=t.length>=Ke;if(n){let i=Y.get(t);if(i)return X(t,i.output,i.scripts.slice())}let{output:r,tokens:s}=ne(t,G,(i,a)=>`\x00STX_SCRIPT_${a}\x00`);if(n)return Yn(Y,Ne),Y.set(t,{output:r,scripts:s}),X(t,r,s.slice());return X(t,r,s)}function Et(t,n){if(n.length===0)return t;return t.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(r,s)=>n[+s]??"")}function ke(t,n=""){let r=`${t}${n}`,s=0;for(let i=0;i<r.length;i++){let a=r.charCodeAt(i);s=(s<<5)-s+a,s=s&s}return`stx-${Math.abs(s).toString(36)}`}function we(t,n,r={}){let{prefix:s="",preserveHost:i=!0,scopeKeyframes:a=!0,scopeCustomProperties:c=!1}=r;if(!t.trim())return"";let d=J(t),l=[],u=new Map;if(a)for(let g of d){let p=g.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(p){let m=p[1],S=`${n}_${m}`;u.set(m,S)}}for(let g of d){let p=Te(g,n,s,i,u,c);l.push(p)}return l.join(`
5
-
6
- `)}function J(t){let n=[],r=t.replace(/\/\*[\s\S]*?\*\//g,""),s=0,i="",a=!1,c="";for(let d=0;d<r.length;d++){let l=r[d];if(l==="@"&&s===0)a=!0;if(l==="{")s++;else if(l==="}"){if(s--,s===0){if(a){c+=l;let u=c.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(u){let[,g,p,m]=u;if(g==="keyframes")n.push({selector:`@keyframes ${p.trim()}`,declarations:m.trim()});else if(g==="media"||g==="supports"||g==="container"){let S=J(m);n.push({selector:`@${g} ${p.trim()}`,declarations:S.map((C)=>`${C.selector} { ${C.declarations} }`).join(`
7
- `)})}else n.push({selector:`@${g} ${p.trim()}`,declarations:m.trim()})}c="",a=!1}else if(i.trim()){i+=l;let u=i.match(/([^{]+)\{([^}]*)\}/);if(u)n.push({selector:u[1].trim(),declarations:u[2].trim()});i=""}continue}}if(a)c+=l;else i+=l}return n}function Te(t,n,r,s,i,a){let{selector:c,declarations:d}=t;if(c.startsWith("@")){if(c.startsWith("@keyframes")){let g=c.replace("@keyframes ","").trim();return`@keyframes ${i.get(g)||g} { ${d} }`}if(c.startsWith("@media")||c.startsWith("@supports")||c.startsWith("@container")){let p=J(`x { ${d} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((m)=>Te(m,n,r,s,i,a)).join(`
8
- `);return`${c} {
9
- ${p}
10
- }`}return`${c} { ${d} }`}let l=We(c,n,r,s),u=d;for(let[g,p]of i)u=u.replace(new RegExp(`\\b${g}\\b`,"g"),p);if(a)u=u.replace(/--([a-z-]+)/gi,`--${n}-$1`);return`${l} { ${u} }`}function We(t,n,r,s){let i=t.split(",").map((c)=>c.trim()),a=[];for(let c of i){if(c.startsWith(":host")){if(s)a.push(c);else{let u=c.replace(/:host(\([^)]*\))?/,`.${n}$1`);a.push(u)}continue}if(c.includes("::slotted")){a.push(c);continue}if(c===":root"){a.push(`:root .${n}`);continue}let d=r?`${r} .${n}`:`.${n}`;a.push(`${d} ${c}`);let l=Fe(c,n);if(l)a.push(r?`${r} ${l}`:l)}return a.join(", ")}function Fe(t,n){let r=0,s=t.length;for(let l=0;l<t.length;l++){let u=t[l];if(u==="["||u==="(")r++;else if(u==="]"||u===")")r--;else if(r===0&&(u===" "||u===">"||u==="+"||u==="~")){s=l;break}}let i=t.slice(0,s),a=t.slice(s);if(!i)return"";let c=i.length,d=0;for(let l=0;l<i.length;l++){let u=i[l];if(u==="["||u==="(")d++;else if(u==="]"||u===")")d--;else if(r===0&&d===0&&u===":"){c=l;break}}return`${i.slice(0,c)}.${n}${i.slice(c)}${a}`}var Ee=String.raw`(?<![\w-])scoped(?![\w-])`,Z=/<style\s+([^>]*)>/gi,ve=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,Re=new RegExp(Ee,"i"),Ue=new RegExp(Ee,"gi"),ee=/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi;function Ge(t){Z.lastIndex=0;let n=Z.exec(t);while(n!==null){if(Re.test(n[1]))return!0;n=Z.exec(t)}return!1}function te(t){let n=new Set,r=[];ee.lastIndex=0;let s=ee.exec(t);while(s!==null){let i=s[0].trim();if(n.has(i))r.push({start:s.index,end:s.index+s[0].length});else n.add(i);s=ee.exec(t)}return r}function cn(t){let n=te(t);if(n.length===0)return t;let r=Array(n.length+1),s=0;for(let i=0;i<n.length;i++){let a=n[i];r[i]=t.slice(s,a.start),s=a.end}return r[n.length]=t.slice(s),r.join("")}function Zn(t,n){if(!Ge(t))return{html:t,hasScoped:!1};let r=ke(n),s=`data-v-${r}`,i=t,a=!1;if(ve.lastIndex=0,i=i.replace(ve,(c,d,l)=>{if(!Re.test(d))return c;a=!0;let u=Ye(l,s),g=d.replace(Ue,"").trim(),p=g?` ${g}`:"";return`<style data-stx-scoped="${r}"${p}>${u}</style>`}),!a)return{html:t,hasScoped:!1};return i=Qe(i,s),{html:i,hasScoped:!0}}function Ye(t,n){return we(t,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${n}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${n}]`)}var qe=(t)=>`\x00stx-scope-mask-${t}\x00`,$e=/\u0000stx-scope-mask-(\d+)\u0000/g;function Qe(t,n){let r=ne(t,(i,a)=>{let c=G(i,a);return c>a?c:Ct(i,a)},(i,a)=>qe(a)),s=Je(r.output,n);return $e.lastIndex=0,s.replace($e,(i,a)=>r.tokens[Number(a)])}function Je(t,n){let r=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(s,i,a)=>{if(r.has(i.toLowerCase()))return s;if(s.includes(n))return s;if(i.toLowerCase()==="style"||i.toLowerCase()==="script")return s;if(a)return s.replace(`<${i}${a}`,`<${i} ${n}${a}`);if(s.endsWith("/>"))return`<${i} ${n} />`;return`<${i} ${n}>`})}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import _e from"fs";class z{cache=new Map;maxSize;options;sizes;bytes=0;constructor(t=100,n){this.maxSize=t,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(t){if(!this.options)return;this.options={...this.options,maxBytes:t};while(this.bytes>t&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.delete(t);let r=this.options?this.options.sizeOf(n):0;if(this.options&&r>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+r>this.options.maxBytes)){let s=this.cache.keys().next().value;if(s===void 0)break;this.delete(s)}if(this.cache.set(t,n),this.sizes)this.sizes.set(t,r),this.bytes+=r}has(t){return this.cache.has(t)}delete(t){if(this.sizes){let n=this.sizes.get(t);if(n!==void 0)this.bytes-=n,this.sizes.delete(t)}return this.cache.delete(t)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var T=new Map,Ze=500;function Xe(t,n){if(n?.includes("g"))return new RegExp(t,n);let r=`${t}:${n||""}`;if(!T.has(r)){if(T.size>=Ze){let s=T.keys().next().value;if(s)T.delete(s)}T.set(r,new RegExp(t,n))}return T.get(r)}class Pe{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(t){let n=Array.from(new Set(t)),r=n.sort().join(","),s=this.pool.find((d)=>d.context.join(",")===r);if(s)return s.func;let i=this.fnCache,a=this.fnCacheMaxSize,c=(...d)=>(l)=>{try{let u=`${r}:${l}`,g=i.get(u);if(!g){if(i.size>=a){let p=i.keys().next().value;if(p)i.delete(p)}g=Function(...n,`
11
- 'use strict';
12
- try {
13
- return ${l};
14
- }
15
- catch (e) {
16
- if (e instanceof ReferenceError || e instanceof TypeError) {
17
- return undefined;
18
- }
19
- throw e;
20
- }
21
- `),i.set(u,g)}return g(...d)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:c,context:n.slice()});return c}clear(){this.pool.length=0,this.fnCache.clear()}}var St=new Pe;class Be{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(t){this.enabled=t}isEnabled(){return this.enabled}setBudget(t,n){this.budgets.set(t,{warnThreshold:0.8,action:"warn",...n})}setBudgets(t){for(let[n,r]of Object.entries(t))this.setBudget(n,r)}removeBudget(t){this.budgets.delete(t)}getBudgets(){let t={};for(let[n,r]of this.budgets.entries())t[n]=r;return t}onViolation(t){this.violationHandlers.push(t)}offViolation(t){let n=this.violationHandlers.indexOf(t);if(n!==-1)this.violationHandlers.splice(n,1)}time(t,n){if(!this.enabled)return n();let r=performance.now(),s=n(),i=performance.now()-r;return this.recordTime(t,i),this.checkBudget(t,i),s}async timeAsync(t,n){if(!this.enabled)return n();let r=performance.now(),s=await n(),i=performance.now()-r;return this.recordTime(t,i),this.checkBudget(t,i),s}checkBudget(t,n){let r=this.budgets.get(t);if(!r)return;let s=n/r.maxTime*100,i=r.warnThreshold!==void 0?n>=r.maxTime*r.warnThreshold&&n<r.maxTime:!1,a=n>=r.maxTime;if(!i&&!a)return;let c={label:t,actualTime:n,budgetTime:r.maxTime,exceedancePercent:s,timestamp:new Date,isWarning:i};this.violations.push(c);while(this.violations.length>this.maxViolations)this.violations.shift();for(let l of this.violationHandlers)try{l(c)}catch{}let d=i?`[Performance Warning] "${t}" took ${n.toFixed(2)}ms (${s.toFixed(1)}% of ${r.maxTime}ms budget)`:`[Performance Budget Exceeded] "${t}" took ${n.toFixed(2)}ms (exceeded ${r.maxTime}ms budget by ${(s-100).toFixed(1)}%)`;switch(r.action){case"log":console.log(d);break;case"warn":console.warn(d);break;case"error":console.error(d);break;case"throw":if(a)throw Error(d);else console.warn(d);break}}recordTime(t,n){let r=this.metrics.get(t);if(r)r.count++,r.totalTime+=n,r.maxTime=Math.max(r.maxTime,n),r.minTime=Math.min(r.minTime,n);else this.metrics.set(t,{count:1,totalTime:n,maxTime:n,minTime:n})}getStats(t){if(t){let r=this.metrics.get(t);if(!r)return{};let s=this.budgets.get(t);return{count:r.count,avgTime:r.totalTime/r.count,totalTime:r.totalTime,maxTime:r.maxTime,minTime:r.minTime,budget:s?.maxTime,budgetUtilization:s?r.totalTime/r.count/s.maxTime*100:void 0}}let n={};for(let[r,s]of this.metrics.entries()){let i=this.budgets.get(r);n[r]={count:s.count,avgTime:s.totalTime/s.count,totalTime:s.totalTime,maxTime:s.maxTime,minTime:s.minTime,budget:i?.maxTime,budgetUtilization:i?s.totalTime/s.count/i.maxTime*100:void 0}}return n}getViolations(t){if(t)return this.violations.filter((n)=>n.label===t);return[...this.violations]}getViolationStats(){let t={},n=0,r=0;for(let s of this.violations)if(t[s.label]=(t[s.label]||0)+1,s.isWarning)n++;else r++;return{total:this.violations.length,byLabel:t,warnings:n,errors:r}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var se=null;function et(){if(!se)se=new Be;return se}var H=new Proxy({},{get(t,n){return et()[n]}});var Me=[];function P(t){let n=new z(t);return Me.push(n),n}function ho(){for(let t of Me)t.clear()}function D(t,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${t.length}\x00${Bun.hash(t)}`}function yo(t){let n=[];for(let r of new Set(t))try{n.push({path:r,mtimeMs:_e.statSync(r).mtimeMs})}catch{}return n}function kt(t){for(let n of t)try{if(_e.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var y=null,ie=!1,w=null,B="",v=!1,De=256,k=new Map,b=new Map,A=null,ze=null,O=new Map;function j(t){return Bun.hash(t).toString(16).padStart(16,"0").slice(0,16)}function re(t,n){if(k.has(t))k.delete(t);else if(k.size>=De)k.delete(k.keys().next().value);k.set(t,n)}function tt(t){let n=j(t);if(b.has(n))b.delete(n);else if(b.size>=De)b.delete(b.keys().next().value);return b.set(n,t),n}function zu(t){let n=b.get(t);if(n===void 0)return;return b.delete(t),b.set(t,n),n}async function nt(t,n=A){if(!n)return null;try{let r=Bun.file(h.join(n,`cw-${j(t)}.css`));if(!await r.exists())return null;return await r.text()}catch{return null}}async function st(t,n,r=A){if(!r)return;try{if(!fs.existsSync(r))fs.mkdirSync(r,{recursive:!0});await Bun.write(h.join(r,`cw-${j(t)}.css`),n)}catch{}}async function Oe(t){try{let n=await import(t);if(n&&n.CSSGenerator)return{CSSGenerator:n.CSSGenerator,config:n.config,build:n.build,defaultConfig:n.defaultConfig,extractClasses:n.extractClasses}}catch{}return null}var rt=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],it=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function ot(){let t=[],n=process.cwd();while(n!==h.dirname(n)){for(let r of["node_modules","pantry"])for(let s of rt)t.push(h.join(n,r,...s));n=h.dirname(n)}return t}function at(){let t=[],n=process.env.HOME||process.env.USERPROFILE||"",r=[n&&h.join(n,"Code","Tools","ts-css"),n&&h.join(n,"Code","Tools","crosswind"),n&&h.join(n,"repos","stacks-org","ts-css"),n&&h.join(n,"repos","stacks-org","crosswind"),h.join(process.cwd(),"..","ts-css"),h.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let s of r)t.push(h.join(s,"packages","toolkit","dist","engine","index.js")),t.push(h.join(s,"packages","toolkit","src","engine","index.ts"));if(n)t.push(h.join(n,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return t}async function vo(){if(ie)return y;ie=!0;try{let t=async(i)=>{for(let a of i){if(!await Bun.file(a).exists())continue;let c=await Oe(a);if(c){if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${h.dirname(h.dirname(a))}`);return c}}return null};if(process.env.CROSSWIND_SRC){let i=h.resolve(process.env.CROSSWIND_SRC),a=await t([i]);if(!a)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return y=a,y}let n=await t(ot());if(n)return y=n,y;let r=it;for(let i of r){let a=await Oe(i);if(a){if(y=a,!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return y}}let s=await t(at());if(s)return y=s,y;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function Hu(){oe.clear(),y=null,ie=!1,w=null,B="",k.clear(),b.clear(),ze=null,O.clear()}var je=!1;async function wo(t){try{let n=Ae({name:"css",cwd:t})?"css":Ae({name:"crosswind",cwd:t})?"crosswind":null;if(!n)return null;if(n==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!je)je=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:r}=await import("bunfig"),s=await r({name:n,cwd:t,defaultConfig:{},checkEnv:!1,verbose:!1});if(!s?.path||!s.config||Object.keys(s.config).length===0)return null;let i=h.relative(t,s.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||s.path}`);return s.config}catch(n){if(n instanceof Error&&n.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,n instanceof Error?n.message:n),null}}async function Cc(t){let n=null;try{let{loadStxConfig:r}=await import("./chunk-hpgr4qgp.js"),s=await r(t);if(s.css)if(typeof s.css==="string"){let i=h.isAbsolute(s.css)?s.css:h.resolve(t,s.css);if(await Bun.file(i).exists()){let a=await import(i);n=a.default||a,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${s.css}`)}}else{if(n={...s.css,content:s.css.content||[],preflight:s.css.preflight??!0,minify:s.css.minify??!1},s.css.config){let i=h.isAbsolute(s.css.config)?s.css.config:h.resolve(t,s.css.config);if(await Bun.file(i).exists()){let a=await import(i);n={...a.default||a,...n}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return n||await wo(t)}function $c(t){try{let n=new WeakSet;return j(JSON.stringify(t??{},(r,s)=>{if(typeof s==="function")return`[fn]${String(s)}`;if(typeof s==="object"&&s!==null){if(n.has(s))return"[circular]";n.add(s)}return s})??"")}catch{return"unhashable"}}async function Tt(t){if(v)return B;v=!0;try{let n=await vo();if(!n||!n.build)return v=!1,"";if(!w)w=await wo(t);if(!w)return v=!1,"";let r=n.defaultConfig?.theme||{},s=w.theme||{},i={...n.defaultConfig,...w,theme:{...r,...s,extend:{...r.extend||{},...s.extend||{}}}},a=performance.now(),c=await n.build(i),d=performance.now()-a;if(B=c.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${c.classes.size} classes in ${d.toFixed(1)}ms`),i.output){let l=h.isAbsolute(i.output)?i.output:h.join(t,i.output),u=h.dirname(l);if(!fs.existsSync(u))fs.mkdirSync(u,{recursive:!0});await Bun.write(l,c.css)}return v=!1,c.css}catch(n){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,n),v=!1,B}}async function ln(t){w=null,await Tt(t)}function Vu(){return B}function Ec(t){let n=new Set,r=/class\s*=\s*["']([^"']+)["']/gi,s=r.exec(t);while(s!==null){for(let c of s[1].split(/\s+/))if(c.trim())n.add(c.trim());s=r.exec(t)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,a=i.exec(t);while(a!==null){let c=a[1].match(/'([^']+)'/g);if(c){for(let d of c)for(let l of d.slice(1,-1).split(/\s+/))if(l.trim())n.add(l.trim())}a=i.exec(t)}return n}var oe=P(64);async function Tc(t,n){let r=()=>O.get(n?h.resolve(n):process.cwd())?.fingerprint??null,s=oe.get(D(t,n,r()));if(s!==void 0)return s;let i=await ct(t,n);if(i)oe.set(D(t,n,r()),i);return i}async function ct(t,n){try{let r=await vo();if(!r)return"";let s=typeof r.extractClasses==="function"?r.extractClasses(t):Ec(t);if(s.size===0)return"";let i=n?h.resolve(n):process.cwd(),a=o(i,"cache");if(!A)A=a;let c=O.get(i);if(!c){let x=await Cc(i);c={config:x,fingerprint:$c(x)},O.set(i,c),ze=c.fingerprint}let d=[...s].sort().join(" "),l=`${c.fingerprint||"default"}::${d}`,u=k.get(l);if(u!==void 0)return re(l,u),u;let g=await nt(l,a);if(g!==null)return re(l,g),g;let p=r.defaultConfig||r.config,m=c.config||{},S=be(p,m),{safelist:C,includePreflight:ae,minify:ce,tokenCSS:Ie}=S,I=S.config,L=new r.CSSGenerator(I),K=I.shortcuts||m.shortcuts||{},le=Object.keys(K).filter((x)=>s.has(x)||C.includes(x));for(let x of C)if(!K[x])L.generate(x);for(let x of s)if(!K[x])L.generate(x);let E="";if(le.length>0){let x=new r.CSSGenerator(I);for(let Le of le)x.generate(Le);if(E=x.toCSS(!1,ce),E&&!E.endsWith(`
22
- `))E+=`
23
- `}let R=E+L.toCSS(ae,ce);return R=Ie+R,re(l,R),st(l,R,a),R}catch(r){return console.warn("Failed to generate Css CSS:",r),""}}async function f(t,n,r=!1,s=!1){let i=await Tc(t,n);if(!i)return s?cn(t):t;let a=r?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${tt(i)}.css">`:`<style data-css="generated">
24
- ${i}
25
- </style>`;if(s)return lt(t,a);let c=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(c.test(t)){let d=!1;return t.replace(c,()=>{if(d)return"";return d=!0,a})}if(t.includes("</head>"))return t.replace("</head>",`${a}
26
- </head>`);if(t.includes("<body"))return t.replace(/<body([^>]*)>/,`<body$1>
27
- ${a}`);return a+t}function lt(t,n){let r=te(t).map((l)=>({...l,replacement:""})),s=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g,i=s.exec(t);if(i!==null){let l=!0;while(i!==null)r.push({start:i.index,end:i.index+i[0].length,replacement:l?n:""}),l=!1,i=s.exec(t)}else{let l=t.indexOf("</head>");if(l!==-1)r.push({start:l,end:l,replacement:`${n}
28
- `});else{let u=t.match(/<body([^>]*)>/);if(u?.index!==void 0)r.push({start:u.index,end:u.index+u[0].length,replacement:`${u[0]}
29
- ${n}`});else r.push({start:0,end:0,replacement:n})}}r.sort((l,u)=>l.start-u.start||l.end-u.end);for(let l=1;l<r.length;l++)if(r[l].start<r[l-1].end)return ut(cn(t),n);let a=Array(r.length*2+1),c=0,d=0;for(let l of r)a[d++]=t.slice(c,l.start),a[d++]=l.replacement,c=l.end;return a[d]=t.slice(c),a.join("")}function ut(t,n){let r=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(r.test(t)){let s=!1;return t.replace(r,()=>{if(s)return"";return s=!0,n})}if(t.includes("</head>"))return t.replace("</head>",`${n}
30
- </head>`);if(t.includes("<body"))return t.replace(/<body([^>]*)>/,`<body$1>
31
- ${n}`);return n+t}
32
- export{z,Xe,H,P,ho,D,yo,kt,G,Ct,xe,$t,bo,Yn,ne,V,Et,cn,Zn,e,zu,vo,Hu,wo,Cc,$c,Tt,ln,Vu,Ec,Tc,f};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wi,xi,Si,ku}from"./chunk-hkrmcbwy.js";import"./chunk-wzx0164n.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{wi as buildNative,ku as default,Si as getAvailableFormats,xi as getAvailableTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Yc,Zc,Qc,el,Go,tl,nl,rl,sl,il,ol,al}from"./chunk-x0q32ees.js";export{ol as Broadcast,al as BroadcastServer,Go as broadcast,sl as broadcastPresence,rl as broadcastPrivate,il as channel,Yc as getBroadcastServer,el as loadChannels,Zc as startBroadcasting,Qc as stopBroadcasting,tl as toUser,nl as toUsers};
@@ -1,12 +0,0 @@
1
- // @bun
2
- import"./chunk-ce1sejr3.js";import"./chunk-8nhshfz6.js";import{y,N}from"./chunk-3efw27as.js";import"./chunk-z0g9jvv0.js";import{P,D}from"./chunk-b98be3yp.js";import"./chunk-shr559s7.js";import"./chunk-czxt605c.js";import"./chunk-m4sk62wb.js";import"./chunk-xfp7k0v8.js";import"./chunk-ak1cgcah.js";import"./chunk-ngc2wke4.js";import"./chunk-9amp82bx.js";import"./chunk-7gkv67ky.js";import"./chunk-752hw7cd.js";import f from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],M=new Set(b);var l=new Map,h=P(64),S=new Set,v=0,C=new Set(b);function W(){l.clear(),h.clear()}function E(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function R(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function I(o){if(!o)return[];let n=D(o,v),r=h.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of C){if(S.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),h.set(n,t),t.slice()}async function U(o,n){let r=I(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=N({loader:"ts",target:"browser",define:y()}),k=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=E(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
3
- ${u.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let w=r.filter((s)=>!d.has(s)&&!R(o,s));if(w.length>0)console.warn(`[stx] could not bundle ${w.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return l.set(t,""),null;let O=[...d].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
4
- `),x=`<script data-stx-framework-composables>
5
- ;(function(){
6
- var __s = window.stx = window.stx || {};
7
- ${m.join(`
8
-
9
- `)}
10
- ${O}
11
- })();
12
- </script>`;return l.set(t,x),x}function A(o){S.clear();for(let n of o)S.add(n);v++}export{A as __setRuntimeOwnedForTest,W as clearFrameworkComposableCache,U as getFrameworkComposableScript,I as referencedFrameworkComposables,E as selectComposableFiles};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import n from"fs";import a from"path";import{fileURLToPath as s}from"url";var i;function he(){if(i)return i;let t="unknown";try{t=String(JSON.parse(n.readFileSync(new URL("../package.json",import.meta.url),"utf8")).version)}catch{}if(import.meta.url.endsWith(".ts"))try{let o=a.dirname(s(import.meta.url)),e=0;for(let r of n.readdirSync(o,{recursive:!0,withFileTypes:!0}))if(r.isFile()&&r.name.endsWith(".ts"))e=Math.max(e,n.statSync(a.join(r.parentPath,r.name)).mtimeMs);t+=`+src.${Math.trunc(e)}`}catch{}return i=t,t}
3
- export{he};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gc}from"./chunk-v91p6ekp.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{Gc as startInteractive};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import i from"fs";function De(e){return[...e].sort().map((n)=>{try{let t=i.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
3
- `)}function Xt(e,n,t){let r=e.get(n);return r!==void 0&&r.signature===t?r.value:void 0}function Q(e,n,t,r){return e.set(n,{signature:t,value:r}),r}
4
- export{De,Xt,Q};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Mo,No}from"./chunk-tafqyf2g.js";import"./chunk-md8rqn48.js";import"./chunk-y1cmjvk3.js";import"./chunk-8eqrwj1k.js";import"./chunk-3kthfs03.js";import"./chunk-v91p6ekp.js";import"./chunk-xtvf6n6f.js";import"./chunk-x0q32ees.js";import"./chunk-ej9j6k1q.js";import"./chunk-9p9qkbtg.js";import"./chunk-g03s93qr.js";import{ti}from"./chunk-wfy1zq53.js";import"./chunk-340a824p.js";import"./chunk-eed4fwps.js";import"./chunk-96k8s808.js";import"./chunk-mp6hy8g4.js";import"./chunk-pgzvyrv6.js";import"./chunk-gawrg4gb.js";import"./chunk-6h38kkjf.js";import"./chunk-vgvtnwxa.js";import"./chunk-t4hzprsm.js";import"./chunk-g186znp9.js";import"./chunk-5qns2sdz.js";import"./chunk-9pt8fd2n.js";import"./chunk-bay9s6rs.js";import"./chunk-fh1qrp68.js";import"./chunk-pbh4smw3.js";import"./chunk-amd6ey3t.js";import"./chunk-amtr3rmf.js";import"./chunk-qghxz7jm.js";import"./chunk-765e1s44.js";import{Zt,Qt}from"./chunk-re8b5r9x.js";import"./chunk-wzx0164n.js";import"./chunk-r3f9jcf7.js";import"./chunk-42wbs8vq.js";import"./chunk-hepd9qgx.js";import{ye,X,d,r,Kn,A,i,ue}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{Kn as buildWebComponents,Qt as cacheTemplate,Zt as checkCache,ti as classifyAllScripts,Mo as createMiddleware,No as createRoute,A as defaultConfig,d as extractVariables,X as injectRouterScript,i as loadStxConfig,ye as processClientScript,r as processDirectives,ue as readMarkdownFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fr,ki,Ci,Cu}from"./chunk-j03revz2.js";export{Fr as NATIVE_COMPONENTS,ki as compileToNative,Ci as createHotReloadServer,Cu as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ll}from"./chunk-g03s93qr.js";import"./chunk-wfy1zq53.js";import"./chunk-hepd9qgx.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{ll as startProductionServer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fa,ga,ma,ha,ya,ba,va,wa,xa,Sa,ml}from"./chunk-6h38kkjf.js";export{fa as createIslandRegistry,ml as default,Sa as generateIslandManifest,ma as generatePartialHydrationCSS,ba as hydrateAll,ya as hydrateByStrategy,ha as hydrateIsland,va as isHydrated,wa as onHydrated,ga as processPartialHydrationDirectives,xa as processStaticDirectives};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import i from"path";var _t=".stx",s="STX_DIR",e=null;function xo(t){e=t?.trim()||null}function un(){return process.env[s]?.trim()||e||_t}function o(t=process.cwd(),...n){let r=un();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function dn(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==_t&&!n.startsWith(`${_t}/`))return t;let r=n.slice(_t.length+1);return r?i.join(un(),r):un()}
3
- export{_t,xo,un,o,dn};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{le}from"./chunk-3efw27as.js";import{de,S,Ke}from"./chunk-ngc2wke4.js";import{z}from"./chunk-b98be3yp.js";import{Y,Ce}from"./chunk-czxt605c.js";import{Pe,se,C,ie,ai,kr,ci,Mt}from"./chunk-wfy1zq53.js";import{Wr}from"./chunk-hepd9qgx.js";import{Nt}from"./chunk-9g27ybyr.js";import J from"fs";import M from"path";var{serve:ae}=globalThis.Bun;import k from"zlib";import{promisify as q}from"util";var Q=q(k.brotliCompress),Z=q(k.gzip),K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[s,...i]=a.trim().split(";"),l=s.trim().toLowerCase();if(!l)continue;let m=1;for(let f of i){let x=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(f);if(!x)continue;let g=Number.parseFloat(x[1]);if(Number.isFinite(g))m=g}e.set(l,m)}return e}function oe(t){if(!t)return null;let e=re(t),a=e.get("*"),s=(i)=>e.get(i)??a??0;if(s("br")>0)return"br";if(s("gzip")>0)return"gzip";return null}async function Ot(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let s=oe(t.headers.get("accept-encoding"));if(!s)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let l=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:W(e.headers)});if(i.length<(a.threshold??te))return l();try{let m=s==="br"?await Q(i,{params:{[k.constants.BROTLI_PARAM_QUALITY]:a.quality??5,[k.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Z(i);if(m.length>=i.length)return l();let f=W(e.headers);return f.set("Content-Encoding",s),f.set("Content-Length",String(m.length)),new Response(m,{status:e.status,statusText:e.statusText,headers:f})}catch{return l()}}function W(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class D{now;entries=new z(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let s,i=async()=>{let r=s??await a();return r.headers.set("Cache-Control","private, no-store"),r.headers.set("Vary",C(r.headers.get("Vary")).Vary),r};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let l=new URL(t.url),m=`${l.origin}${l.pathname}${l.search}|${se(t)?"fragment":"document"}`,f=this.entries.get(m),x=(r)=>{let T=new Headers(r.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-r.created)/1000)))),new Response(r.body.slice(0),{headers:T})},g=f?(this.now()-f.created)/1000:1/0;if(f&&g<e.maxAge)return x(f);let b=this.generation,B=async()=>{let r=await a();s=r;let T=(r.headers.get("Vary")??"").toLowerCase().split(",").map((R)=>R.trim()).filter(Boolean);if(r.status!==200||r.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(r.headers.get("Cache-Control")??"")||T.some((R)=>R!=="x-stx-router"&&R!=="accept-encoding"))return null;let L=await r.clone().arrayBuffer();if(L.byteLength>1048576)return null;r.headers.set("Vary",C(r.headers.get("Vary")).Vary);let n={body:L,headers:Array.from(r.headers.entries()),created:this.now(),path:l.pathname};if(this.generation===b)this.entries.set(m,n);return n},v=this.pending.get(m);if(!v){if(this.pending.size>=1000)return i();v=B().finally(()=>{if(this.pending.get(m)===v)this.pending.delete(m)}),this.pending.set(m,v)}if(f&&g<e.maxAge+(e.swr??0))return v.catch(()=>{}),x(f);let E=await v;return E?x(E):i()}}var ce={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function ll(t={}){let e=M.resolve(t.outputDir||".output"),a=t.port??3000,s=ai(e);if(!s)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${s.routes.length} routes...`);let i=Nt(s.routeRules),l=new D,m=Wr(e,s.apiRoutes??[]),f=Bun.file(M.join(e,"server/runtime-config.json")),x=t.runtimeConfig??(await f.exists()?await f.json():void 0),g=x?S(x):void 0,b=new Map,B=new Map,v=new Map,E=new Map;for(let n of s.routes)try{let R=M.join(e,n.compiledPath),c=JSON.parse(await Bun.file(R).text());if(g)c.html=Ke(c.html,g);b.set(n.pattern,c),v.set(n.pattern,Ce(c.html)),E.set(n.pattern,le(c.html));let N=M.join(e,n.fragmentPath);if(await Bun.file(N).exists()){let A=await Bun.file(N).text();B.set(n.pattern,g?Ke(A,g):A)}}catch(R){console.warn(`[stx] Failed to load route ${n.pattern}:`,R)}let r=new Map,T=[];for(let n of s.routes)if(n.hasParams){let{regex:R,params:c}=Y(n.pattern);T.push({regex:R,route:n,paramNames:c})}else r.set(n.pattern,n);let L=ae({port:a,async fetch(n){return Ot(n,await de(g??S(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let N=await m(n);if(N)return N;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=M.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=M.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${M.sep}`))try{if(J.existsSync(u)&&J.statSync(u).isFile()){let h=M.extname(u).toLowerCase(),j=ce[h]||"application/octet-stream",_=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":j,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=se(n),y=null,G={};if(y=r.get(c)||null,!y)for(let{regex:p,route:d,paramNames:u}of T){let o=c.match(p);if(o){y=d,u.forEach((h,j)=>{G[h]=o[j+1]});break}}if(!y){let p=r.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let O=i(c),U=Object.keys(O).length>0;return l.respond(n,O.cache,async()=>{let p=b.get(y.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=B.get(y.pattern);if(o){let h=v.get(y.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(y.pattern)?{"X-STX-Runtime":E.get(y.pattern)?"true":"false"}:{},...h?{"X-STX-Layout":h.layout,"X-STX-Layout-Group":h.group}:{},...C(),...O.cache?{}:{"Cache-Control":Pe}}})}}let d=kr(n.method),u=b.get(y.pattern);if(!u){let o=r.get("/500")||null;if(o){let h=b.get(o.pattern);if(h)return new Response(h.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(y.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...C(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:h,redirect:j,cookies:_,status:H,headers:I}=await Mt(u,{params:G,request:n,method:n.method,__stx_strict_hydration:U,__stx_runtime_config:g});if(j)return ci(j,_,I);if(h&&h.length>0){let{renderStreamingPage:P,streamToResponse:F}=await import("./chunk-gc1drn2p.js"),X=new Headers({...C(),...I,"Cache-Control":"private, no-store"});for(let V of _??[])X.append("Set-Cookie",V);if(A&&!d){let V=Ce(o);X.set("X-STX-Fragment","true"),X.set("X-STX-Runtime",le(o)?"true":"false"),X.set("X-STX-Layout",V.layout),X.set("X-STX-Layout-Group",V.group)}return F(P(A&&!d?ie(o,s.routerContainer||"main"):o,h,{timeoutMs:30000}),{status:H??u.status??200,headers:X})}let w=new Headers({"Content-Type":"text/html",...C(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of _??[])w.append("Set-Cookie",P);for(let[P,F]of Object.entries(I??{}))w.set(P,F);if(w.set("Vary",C(w.get("Vary")).Vary),A&&!d){let P=Ce(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",le(o)?"true":"false"),w.set("X-STX-Layout",P.layout),w.set("X-STX-Layout-Group",P.group),new Response(ie(o,s.routerContainer||"main"),{status:H??u.status??200,headers:w})}return new Response(o,{status:H??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),U)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${L.port}`),console.log(`[stx] Serving ${s.routes.length} routes (${b.size} pre-loaded)`),{port:L.port,stop:()=>{l.invalidate(),L.stop()},invalidate:(n)=>l.invalidate(n)}}
3
- export{Ot,ll};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Kl,mi,_a,Gl,Jl,Yl,Zl,Ql,Ra,Aa,eu,tu,nu,ru}from"./chunk-qghxz7jm.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{_a as SUSPENSE_RESOLVER_RUNTIME,mi as buildSuspenseResolveScript,Ql as createStreamRenderer,Yl as extractStreamBoundaries,ru as generateHydrationRuntime,Aa as islandDirective,tu as processSectionDirectives,Jl as processStreamDirectives,eu as registerStreamingDirectives,Gl as renderStreamingPage,Kl as streamTemplate,Zl as streamTemplateSimple,nu as streamToResponse,Ra as streamingSuspenseDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pa,lu,uu,du,pu,Ia,Da,fu,gu,mu,hu,Zt,Qt,Dn}from"./chunk-re8b5r9x.js";import{he}from"./chunk-et0rr8c7.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{pu as __setSignalsGeneratorsForTest,he as cacheEngineFingerprint,Qt as cacheTemplate,Zt as checkCache,hu as clearDevCaches,Da as getCachedRouterScript,Ia as getCachedSignalsRuntime,fu as getServeClientAsset,mu as getServeModuleBundle,Dn as hashFilePath,uu as invalidateFileCache,du as invalidateFileCacheByDir,lu as readFileCached,gu as registerServeModuleBundle,Pa as templateCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Jc}from"./chunk-xtvf6n6f.js";import"./chunk-wfy1zq53.js";import"./chunk-765e1s44.js";import"./chunk-hepd9qgx.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{Jc as buildForProduction};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{St,as,Ki,dc}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{dc as declareBareLoopHead,St as parseLoopBinding,Ki as processLoops,as as reportDeferredLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gi,ka,qt,hl,Ca,$a,Ea,yl}from"./chunk-vgvtnwxa.js";export{qt as Validator,ka as defineForm,Ca as processErrorDirective,$a as processErrorsDirective,yl as processFormValidationDirectives,Ea as processHasErrorsDirective,gi as useForm,hl as v};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{d,os,qi,Xi,fc,gc,mc,hc,yc,bc,Ve,N,Ue,vc,qn,wc,so,xc,We,n,Xn,io,g,K,ju}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{K as clearComponentCache,xc as componentClientSignalNames,os as convertToCommonJS,g as createDetailedErrorMessage,yc as extractDirectiveNames,qi as extractScriptFromTemplate,d as extractVariables,n as fileExists,ju as getComponentCacheStats,gc as getPositionInfo,N as getSharedTranspiler,io as getSourceLineInfo,hc as hasDirectives,Xi as hasVariables,wc as isHydrateTrigger,bc as isJavaScriptScript,We as renderComponentWithSlot,Xn as resolveTemplatePath,vc as scopeOnRootElement,Ve as shouldTranspileTypeScript,so as slotContentHasExpressions,Ue as transpileTypeScript,qn as userComponentFileExists,mc as validateDirective,fc as validateTemplate};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{de,Rt,Qn,Ss,S,Ke}from"./chunk-ngc2wke4.js";export{Rt as currentRuntimeConfig,Ke as injectRuntimeConfig,S as resolveRuntimeConfig,Ss as useRuntimeConfig,Qn as useServerRuntimeConfig,de as withRuntimeConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{rn,Qa,ts}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import{ke}from"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{ke as freeIdentifiers,ts as processComponents,Qa as processESImports,rn as rendersAsElement};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ce,Fa,Di,ft,gt,$u,Oi,mt,nn,za,Ha,Va,Ua,ht,Wa}from"./chunk-42wbs8vq.js";import"./chunk-hepd9qgx.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{nn as MODULE_SPECIFIER_PREFIX,ht as bundleClientScript,gt as clearBundleFailures,ce as clientBundleDependencies,ft as getBundleFailures,mt as hasUserImports,Ha as normalizeRegistrySpecifiers,Ua as queueClientBundleBuild,Di as recordBundleFailure,za as registryIdForPath,Oi as resolveBundlerFallback,Va as rewriteRegistryImports,$u as setBundlerFallbackMode,Fa as shouldLogBundlerDiagnostics,Wa as tempBuildName};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{A,Sc,i,T,Bu,Fu}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{T as config,A as defaultConfig,Bu as defineStxConfig,i as loadStxConfig,Sc as resolveStxDirectories,Fu as validateConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ks,Cs,$s,Es,er,tr,Uu,Wu,qu,Xu,nr,Ku}from"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";export{Ku as generateDefaultRobotsTxt,nr as generateRobotsTxt,Wu as generateSitemap,qu as generateSitemapIndex,Es as injectSeoTags,er as metaDirective,ks as processMetaDirectives,$s as processSeoDirective,Cs as processStructuredData,Uu as registerSeoDirectives,Xu as scanForSitemapEntries,tr as structuredDataDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ol,Ml,Nl,Ll,jl}from"./chunk-pbh4smw3.js";export{Ml as defineAsyncComponent,Ll as generateAsyncComponentCSS,jl as generateAsyncComponentRuntime,Nl as isAsyncComponent,Ol as processAsyncDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Os,Ms,Y,yn,ar,bn,cr,lr,Rc,Ac,Pc,vn,Ic,Dc,Oc,Mc,Po,Io,Do,Ns,Oo,Nc,Qe,et,tt,nt,rt,st,$e,Lc}from"./chunk-czxt605c.js";export{bn as Router,Oc as abortNavigation,ar as bracketPathToRegex,Qe as clearMiddleware,Io as createClientCookieManager,rt as createMiddlewareContext,nt as createRouteLocation,Po as createServerCookieManager,Do as createStorageManager,Mc as defineMiddleware,Ac as defineRoute,Pc as defineRoutes,cr as findErrorPage,lr as formatRoutes,Ms as generateRouteManifest,Os as generateRouteTypes,Oo as getMiddleware,et as getMiddlewareNames,$e as getRouterScript,Lc as getRouterScriptDev,Nc as hasMiddleware,tt as loadMiddlewareFromDirectory,yn as matchRoute,Dc as navigateTo,Y as patternToRegex,Ns as registerMiddleware,Ic as resetRoutes,vn as route,st as runMiddleware,Rc as setAppUrl};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xl,Sl}from"./chunk-9pt8fd2n.js";export{Sl as ensureTeleportTargets,xl as processTeleportDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{an,xs}from"./chunk-9amp82bx.js";import"./chunk-ngc2wke4.js";export{xs as generateRuntimeConfigTypes,an as prepareRuntimeConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{_r,Rr,Ar,oa,Pr,Ir,aa,Dr,Or,di,ca}from"./chunk-pgzvyrv6.js";export{_r as VideoProcessorCache,di as analyzeVideo,oa as clearVideoCache,Or as generateDASHManifest,Dr as generateHLSManifest,Pr as generatePoster,aa as generateSpriteSheet,Ir as generateThumbnails,Rr as getCachedVideoResult,ca as processVideo,Ar as setCachedVideoResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Te,_e,Re}from"./chunk-a688m6js.js";export{Te as createContext,_e as updateContextStoryFiles,Re as updateContextTree};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Mn,Oe,Ii,Ba}from"./chunk-fr2txj8q.js";export{Mn as generateServiceWorker,Ba as generateServiceWorkerAuto,Oe as getServiceWorkerFileName,Ii as isWorkboxEnabled};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{W,Xr,Kr,qa,bt,Mi,Ni,Li,Tu,Le,Gr,ye}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import{po,s}from"./chunk-169n1vpx.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{W as BROWSER_CORE_IMPORTS,qa as STX_AUTO_IMPORTS,Xr as extractAndStripCssImports,Le as extractBridgeData,po as findInterpolationEnd,Li as generateAutoImportDestructuring,Tu as generateBrowserAutoImportDestructuring,Gr as generateServerDataBridge,bt as injectBrowserCoreAutoImports,ye as processClientScript,Ni as referencesName,Kr as renderVendorStyleTags,s as stripCommentsAndLiterals,Mi as transformAutoImports};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{On,zr,Na,La,ja}from"./chunk-b84h16er.js";import"./chunk-fr2txj8q.js";export{La as generateManifestLink,On as generatePwaTags,Na as generateSwRegistrationScript,ja as generateThemeColorMeta,zr as injectPwaTags};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Zo,dl,Qo,ea,pl,fl}from"./chunk-96k8s808.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{fl as applySlots,pl as extractSlotContent,dl as parseSlotElement,Zo as parseSlots,ea as processSlots,Qo as renderSlot};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{pi,fi,la,ua,da,pa,gl}from"./chunk-gawrg4gb.js";export{pi as createVirtualList,gl as default,la as generateVirtualListCSS,da as processInfiniteListDirectives,pa as processVirtualGridDirectives,fi as processVirtualListDirectives,ua as useVirtualList};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cl}from"./chunk-9p9qkbtg.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{cl as buildApp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{X,ps,gs,ms,r}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{X as injectRouterScript,r as processDirectives,ps as processJsonDirective,gs as processOnceDirective,ms as validateClientScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$r,Er,Tr,ta,na,ra,ui,sa,ia}from"./chunk-mp6hy8g4.js";export{$r as ImageProcessorCache,ui as applyTransformations,ta as clearImageCache,sa as generateResponsiveVariants,ia as generateSrcset,Er as getCachedImageResult,ra as optimizeImage,na as processImage,Tr as setCachedImageResult};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function ge(){let{NODE_ENV:o}=process.env;return o==="production"}function O(){let{STX_DEBUG:o}=process.env;return!ge()||o==="true"}function mn(){let{NODE_ENV:o}=process.env;return o==="test"}
3
- export{ge,O,mn};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ei,Jo}from"./chunk-ej9j6k1q.js";import"./chunk-eed4fwps.js";export{Jo as createImageHandler,ei as handleImageRequest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rl,Al,Pl,Il,Dl}from"./chunk-fh1qrp68.js";export{Al as createSSRSuspense,Il as generateSuspenseCSS,Dl as generateSuspenseRuntime,Rl as processSuspenseDirectives,Pl as renderSSRSuspense};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{n,K}from"./chunk-3efw27as.js";import{ho}from"./chunk-b98be3yp.js";import{he}from"./chunk-et0rr8c7.js";import{o}from"./chunk-fzapbw9p.js";import c from"fs";import l from"path";var Pa=new Map,m=new Map;async function lu(e){let r;for(let s=0;s<3;s++)try{let g=(await c.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),S=(await c.promises.stat(e)).mtime.getTime();if(S!==g)continue;return m.set(e,{content:h,mtime:S}),h}catch(i){r=i;break}throw m.delete(e),Error(`File not found: ${e}${r?` (${r.message})`:""}`)}function uu(e){m.delete(e)}function du(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var d=null,v=null,y=null;function pu(e){y=e}async function Ia(e=!1){let t=y??await import("./chunk-5gsxpaqk.js");if(e)return t.generateSignalsRuntimeDev();if(d===null)d=t.generateSignalsRuntime();return d}var f=null;async function Da(){if(f===null){let{getRouterScript:e}=await import("./chunk-jk4njz0w.js");f=e()}return f}var w={};async function fu(e,t=!1){let r=e==="runtime"?await Ia(t):await Da(),s=e==="runtime"&&t?"runtime-debug":e,i=w[s];if(!i||i.content!==r)i={content:r,hash:Bun.hash(r).toString(16).padStart(16,"0").slice(0,16)},w[s]=i;return{content:r,hash:i.hash,url:`/_stx/${e}.${i.hash}.js`}}var T=500,u=new Map;function x(e){return o(process.cwd(),"module-bundles",`${e}.js`)}function gu(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),r=u.has(t);if(r)u.delete(t);u.set(t,e);while(u.size>T)u.delete(u.keys().next().value);if(!r)try{let s=x(t);if(!c.existsSync(s))c.mkdirSync(l.dirname(s),{recursive:!0}),c.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function mu(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=u.get(e);if(t!==void 0)return t;try{return c.readFileSync(x(e),"utf8")}catch{return}}function hu(){m.clear(),K(),ho(),d=null,v=null,f=null}function C(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((r)=>({name:r.name,timing:r.timing,handler:String(r.handler)})),customDirectives:(e.customDirectives??[]).map((r)=>({name:r.name,hasEndTag:r.hasEndTag===!0,rawParams:r.rawParams===!0,handler:String(r.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function Zt(e,t){try{if(!t.cachePath)return null;let r=l.resolve(t.cachePath),s=l.join(r,`${Dn(e)}.html`),i=l.join(r,`${Dn(e)}.meta.json`);if(!await n(s)||!await n(i))return null;let g=await Bun.file(i).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==he())return null;if(a.optionsSignature!==C(t))return null;if((await c.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let p of a.dependencies)if(await n(p)){if((await c.promises.stat(p)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(s).text()}catch(r){return console.warn(`Cache error for ${e}:`,r),null}}async function Qt(e,t,r,s){try{if(!s.cachePath)return;let i=l.resolve(s.cachePath);await c.promises.mkdir(i,{recursive:!0});let g=l.join(i,`${Dn(e)}.html`),a=l.join(i,`${Dn(e)}.meta.json`),h=await c.promises.stat(e);await Bun.write(g,t);let p={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(r),cacheVersion:s.cacheVersion,engine:he(),optionsSignature:C(s),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(p,null,2)),Pa.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:r})}catch(i){console.warn(`Failed to cache template ${e}:`,i)}}var E=16;function Dn(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,E)}
3
- export{Pa,lu,uu,du,pu,Ia,Da,fu,gu,mu,hu,Zt,Qt,Dn};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ri,Ai,Pi,Oa,Ma}from"./chunk-q9bdh4s5.js";export{Ai as auditBuildOutput,Ri as auditConfig,Pi as calculateAuditResult,Ma as formatAuditResult,Oa as runPwaAudit};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{yt,Vr,Ur,Wr,Eu,qr}from"./chunk-hepd9qgx.js";import"./chunk-ak1cgcah.js";import"./chunk-ngc2wke4.js";import"./chunk-czxt605c.js";export{Ur as buildServerApi,Eu as createServerApi,yt as discoverServerApi,Vr as generateApiTypes,qr as isServerApiSource,Wr as productionApiDispatcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xt,sc,ic,oc,ac,cc,d,lc,os,uc,qi,Xi}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{xt as STX_ENGINE_BINDING_NAMES,os as convertToCommonJS,qi as extractScriptFromTemplate,d as extractVariables,Xi as hasVariables,lc as isCompleteImport,cc as isMissingBindingFailure,oc as isModuleResolutionFailure,ac as isSyntaxFailure,uc as splitDeclaration,sc as stripTypeScript,ic as withoutStxReferrer};
@@ -1,30 +0,0 @@
1
- // @bun
2
- import{Fi,Jr,vt,b,Be,Fe,zn,d,on}from"./chunk-3efw27as.js";import{G,xe}from"./chunk-b98be3yp.js";import{O}from"./chunk-px7fvbj6.js";var D=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function F(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(D.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var H=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function ti(t){let n=[],e=[],r=[],o=0;while(o<t.length){let s=t.indexOf("<",o);if(s===-1)break;let a=xe(t,s);if(a>s){o=a;continue}let i=G(t,s);if(i>s){let c=t.slice(s,i),u=H.exec(c);if(u){let l=F(u[1],u[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}o=i;continue}o=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function V(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function B(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,o=r.match(/^[a-z][\w-]*/i);if(o)e.tag=o[0].toLowerCase(),r=r.slice(o[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let i=r.match(/^\.([\w-]+)/);if(i){e.className=i[1],r=r.slice(i[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function q(t,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(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function T(t,n="main"){let e=B(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,o=V(t),s;while((s=r.exec(t))!==null){if(P(s.index,o))continue;let a=s[1].toLowerCase(),i=s[2]||"";if(i.trimEnd().endsWith("/")||L.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!q(i,e))continue;let c=s[0],u=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,p;while((p=l.exec(t))!==null){if(P(p.index,o))continue;let h=p[1]==="/";if(!h&&(p[2]||"").trimEnd().endsWith("/"))continue;if(f+=h?-1:1,f===0)return{openTag:c,openIndex:s.index,start:u,end:p.index,tagName:a}}return null}return null}var Pe="private, no-store";function ni(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function se(t){return t.headers.get("X-STX-Router")==="true"}function z(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function C(t){return{Vary:z(t,"X-STX-Router")}}import E from"path";var U="stx-page-head:",W=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function X(){let t=O()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-jk4njz0w.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function ri(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Sr(t,n){try{let e=await Bun.file(t).text(),r=e,o=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(o)r=o[1].trim();let s=ti(e),a=[...s.client.map((m)=>m.fullTag),...s.signals.map((m)=>m.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(e))!==null)i.push(u[0]);let l=r;for(let m of s.server)l=l.replace(m.fullTag,"");for(let m of s.client)l=l.replace(m.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 ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:p,extractVariables:h,defaultConfig:x,loadStxConfig:y}=await import("./chunk-fbcv4fes.js"),R=await y(),g={__filename:t,__dirname:E.dirname(t)};for(let m of a){let A=m.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!m.includes("client")&&!m.includes('type="module"'))await h(A[1],g,t)}let S=await p(l,g,t,{...x,...R,...n},new Set),w=S.indexOf(f);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,w),afterSlot:S.substring(w+f.length),filePath:t,shellScripts:a,shellStyles:i}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function En(t,n,e){let r,o="",s=n.match(W);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();o=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",i=X(),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
- ${o?` ${o}
9
- `:""} ${t.shellStyles.join(`
10
- `)}
11
- </head>
12
- <body>
13
- ${t.beforeSlot}
14
- <div data-stx-content>${n}</div>
15
- ${t.afterSlot}
16
- ${t.shellScripts.filter((l)=>!l.includes("server")).join(`
17
- `)}
18
- ${c}
19
- ${i}
20
- </body>
21
- </html>`}function me(t,n={}){let e=t.trim();if(!on(e))return t;let r=[],o=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(o){let c=o[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 p=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(p)r.push(p[0])}if(n.preserveHead&&o){let c=[],u=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=u.exec(o[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${U}${Buffer.from(c.join(`
22
- `),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,u=e.slice(c,a).trim();if(r.length>0)return r.join(`
23
- `)+`
24
- `+u;return u}let i=e;if(i=i.replace(/<!DOCTYPE\b[^>]*>/i,""),i=i.replace(/<html\b[^>]*>/i,""),i=i.replace(/<\/html\s*>/i,""),o)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 N=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function J(t,n,e,r){if(!N.test(n))return!1;let o=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(o)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let i=t.indexOf(a);i!==-1;i=t.indexOf(a,i+a.length))if(i>=e&&i<r)return!1;return!0}function si(t){return se(t)}function ie(t,n="main"){let e=t.trim(),r=[],o=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let y=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,g;while((g=R.exec(y))!==null)r.push(g[0]);let S=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((g=S.exec(y))!==null){if(N.test(g[0])||g[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(g[0]))continue;o.push(g[0])}}let a=T(e,n);if(!a)return me(t);let{tagName:i,start:c,end:u}=a,l=e.slice(c,u).trim(),f=[],p=e.match(/<body\b[^>]*>/i),h=e.lastIndexOf("</body>");if(p&&p.index!==void 0&&h!==-1){let R=[[p.index+p[0].length,a.openIndex],[u+`</${i}>`.length,h]],g=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[S,w]of R){if(S>=w)continue;let m=e.slice(S,w),A;g.lastIndex=0;while((A=g.exec(m))!==null){if(J(e,A[0],c,u))continue;f.push(A[0])}}}let x=[];if(r.length>0)x.push(r.join(`
26
- `));if(o.length>0)x.push(o.join(`
27
- `));if(f.length>0)x.push(f.join(`
28
- `));return x.push(l),x.join(`
29
- `)}import _ from"fs";import I from"path";function ii(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function oi(t,n){let e=I.join(n,"manifest.json");_.writeFileSync(e,JSON.stringify(t,null,2))}function ai(t){let n=I.join(t,"manifest.json");if(!_.existsSync(n))return null;try{let e=_.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function k(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function K(t){let n=t.headers.get("content-type")||"",e={},r=(o,s)=>{let a=e[o];if(a===void 0)e[o]=s;else if(Array.isArray(a))a.push(s);else e[o]=[a,s]};if(n.includes("multipart/form-data")){let o=await t.formData();for(let[s,a]of o.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[o,s]of new URLSearchParams(await t.text()).entries())r(o,s);return e}return e}function kr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function j(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!kr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let o={};try{o=await K(e)}catch{}let s=await t.action({request:e,form:o,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,i=Y(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(t,f),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function Y(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(k(e,r));continue}if(r&&typeof r==="object"){let o=r;if(typeof o.value!=="string")continue;n.push(k(e,o.value,o))}}return n}function ci(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let o of n)r.append("Set-Cookie",o);for(let[o,s]of Object.entries(e??{}))if(o.toLowerCase()!=="location")r.set(o,s);return new Response(null,{status:303,headers:r})}async function Mt(t,n={}){let{html:e,context:r,redirect:o,cookies:s}=await Z(t,n),a=Be(r),i=Fe(r);if(o)return{html:e,redirect:o,cookies:s,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-gc1drn2p.js"),u=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-pdb5fw3r.js"),{defaultConfig:p}=await import("./chunk-hpgr4qgp.js"),h=r.streamBoundaries||{},x={...p,autoShell:!1},y=Object.keys(l).map((g)=>({id:g,render:async()=>{let S=typeof h[g]==="function"?await h[g]():void 0;return f(l[g],{...r,$boundary:S},t.sourceFile,x,new Set)}})),R=new Set(y.map((g)=>g.id));u=[...(u||[]).filter((g)=>!R.has(g.id)),...y]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:s,status:a,headers:i}}async function Z(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!Jr(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await d(a,e,t.sourceFile)}catch(i){if(n.__stx_strict_hydration)throw i;console.warn(`[stx] Server script error in ${t.sourceFile}:`,i)}let r=await j(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),o=(a)=>{let i=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=zn(e);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:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Jr(t.html))return{html:o(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,i]of Object.entries(t.placeholders))if(i.expression)try{let c=b(i.expression,e);if(i.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?vt(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:o(Fi(t.html,s)),context:e,cookies:r.cookies}}
30
- export{ti,Pe,ni,se,C,ri,Sr,En,me,si,ie,ii,oi,ai,kr,ci,Mt};
@@ -1,18 +0,0 @@
1
- // @bun
2
- import{Nn,Ne,Le,ye,zi,Bn,ee,X,sn,d,r,A}from"./chunk-3efw27as.js";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let n=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,n);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:n,content:m}=Nn(o),c=await(e.renderer??((s)=>Ne(s)))(m);return{html:_(c),frontmatter:n??{}}}import{dirname as C,resolve as R}from"path";function k(o){let e=o,n=ee(o);if(n)e=n.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){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>${(e||"stx").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</title>
8
- </head>
9
- <body>
10
- ${o}
11
- </body>
12
- </html>`}async function $i(o,e={}){let n=R(o),m=Bun.file(n);if(!await m.exists())throw Error(`Template file not found: ${n}`);let a=await m.text(),c=null;if(h(n)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};sn(l);let f=await S(a,n,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,n,e)}async function S(o,e,n={}){let{templateContent:m,serverScripts:a,clientScripts:c}=k(o),s={...A,...n.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:n.injectCSS===!0,__stxServeContext:void 0,...Bn(n.context??{}),definePageMeta:()=>{},...n.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await r(t,p,e,s,u),zi(p,n.context),n.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
13
- ${c.join(`
14
- `)}`}else{if(n.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Le(p),g=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await ye(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
15
- `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
16
- $1`);else t+=`
17
- ${g}`}t=await X(t)}if(n.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,n.title)}if(n.injectCSS)try{let{injectCss:i}=await import("./chunk-z23kaxq6.js");t=await i(t)}catch{}return t}
18
- export{$i};