@stacksjs/stx 0.2.514 → 0.2.516

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 (61) hide show
  1. package/dist/{chunk-ntx4axaf.js → chunk-012h75ke.js} +1 -1
  2. package/dist/{chunk-y3480mx8.js → chunk-0wsywdaq.js} +1 -1
  3. package/dist/{chunk-rgh54rqz.js → chunk-0x2qent6.js} +1 -1
  4. package/dist/{chunk-x1v0qyf9.js → chunk-0zv8ftnn.js} +1 -1
  5. package/dist/{chunk-x4xxfpn7.js → chunk-10xg8gds.js} +1 -1
  6. package/dist/chunk-1jwjtcvd.js +2 -0
  7. package/dist/{chunk-jf59xwba.js → chunk-2afm5p56.js} +1 -1
  8. package/dist/{chunk-h5nv63qx.js → chunk-2e3x5h3x.js} +1 -1
  9. package/dist/{chunk-bvq2hx8a.js → chunk-2yjes3gp.js} +1 -1
  10. package/dist/{chunk-a59nwgg6.js → chunk-38jkc8p6.js} +1 -1
  11. package/dist/{chunk-2bdxrryj.js → chunk-3f9999cj.js} +1 -1
  12. package/dist/{chunk-z6gbf119.js → chunk-5e6bhs6v.js} +1 -1
  13. package/dist/{chunk-pjayjj2m.js → chunk-6stn6vtm.js} +1 -1
  14. package/dist/{chunk-mwac03ak.js → chunk-833fqs6p.js} +1 -1
  15. package/dist/{chunk-qfx532hv.js → chunk-8p3knpcz.js} +2 -2
  16. package/dist/{chunk-jc25dv0f.js → chunk-8xz090ne.js} +1 -1
  17. package/dist/{chunk-xs48j158.js → chunk-9afwh767.js} +18 -18
  18. package/dist/{chunk-2hsp5gee.js → chunk-a80pc7yk.js} +1 -1
  19. package/dist/{chunk-03mkxevd.js → chunk-aad7fmvp.js} +1 -1
  20. package/dist/{chunk-zsdhaj58.js → chunk-add8tq7t.js} +8 -0
  21. package/dist/{chunk-shqtn2bj.js → chunk-b3mfy2eb.js} +2 -2
  22. package/dist/{chunk-qm8atahn.js → chunk-bg48xvb7.js} +1 -1
  23. package/dist/{chunk-hnz2zh9q.js → chunk-d2w32ck9.js} +1 -1
  24. package/dist/chunk-dpg7gtv5.js +2 -0
  25. package/dist/{chunk-4njn89w1.js → chunk-f1cm6kh5.js} +2 -2
  26. package/dist/{chunk-7smpjzzh.js → chunk-frfjy37k.js} +1 -1
  27. package/dist/{chunk-sqf60k0y.js → chunk-g2990jbf.js} +1 -1
  28. package/dist/{chunk-6bay462v.js → chunk-hkwjanc9.js} +1 -1
  29. package/dist/{chunk-518kr9jb.js → chunk-hv92fwyw.js} +1 -1
  30. package/dist/{chunk-jg62944p.js → chunk-jjhn731j.js} +1 -1
  31. package/dist/{chunk-2yegk32c.js → chunk-jz87m1j8.js} +1 -1
  32. package/dist/{chunk-a9anp4pr.js → chunk-mge6kj6e.js} +1 -1
  33. package/dist/{chunk-5pzhcesm.js → chunk-mzdjpm84.js} +1 -1
  34. package/dist/{chunk-6tmbgcv9.js → chunk-p4k99dkk.js} +1 -1
  35. package/dist/{chunk-fjet17jc.js → chunk-pmctmsqq.js} +1 -1
  36. package/dist/{chunk-epbnttw5.js → chunk-pvvd41f9.js} +1 -1
  37. package/dist/{chunk-4a9tt7cd.js → chunk-q3z8c54t.js} +1 -1
  38. package/dist/{chunk-dhrzmvbj.js → chunk-r17fgrax.js} +1 -1
  39. package/dist/{chunk-zgg589w4.js → chunk-s78m3jpp.js} +1 -1
  40. package/dist/{chunk-4yrk774b.js → chunk-s84ygk4m.js} +1 -1
  41. package/dist/chunk-sfx3zz08.js +2 -0
  42. package/dist/{chunk-dq6v78fd.js → chunk-t768bb57.js} +1 -1
  43. package/dist/{chunk-qavbh6vm.js → chunk-trzwxf9q.js} +1 -1
  44. package/dist/{chunk-7tzf1e7f.js → chunk-ts8an4wm.js} +1 -1
  45. package/dist/{chunk-vdzhw78w.js → chunk-vad0zphe.js} +1 -1
  46. package/dist/{chunk-5a4wj7t4.js → chunk-vxzt9dhb.js} +1 -1
  47. package/dist/{chunk-fp7dzqze.js → chunk-y08ncpqj.js} +1 -1
  48. package/dist/{chunk-skve9q8q.js → chunk-ytcqk6np.js} +1 -1
  49. package/dist/{chunk-zvg1nqgw.js → chunk-yybzcsjv.js} +1 -1
  50. package/dist/{chunk-q9kq007t.js → chunk-zffc870e.js} +5 -5
  51. package/dist/cli.js +8 -8
  52. package/dist/craft-entry.js +1 -1
  53. package/dist/craft.js +1 -1
  54. package/dist/native/runtime/craft-bridge.js +1 -1
  55. package/dist/pwa.js +1 -1
  56. package/dist/signals.js +8 -0
  57. package/dist/ssg.js +2 -2
  58. package/package.json +5 -5
  59. package/dist/chunk-1wbmg22q.js +0 -2
  60. package/dist/chunk-md8m0mpb.js +0 -2
  61. package/dist/chunk-xqgzwexs.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{W,Gr,Jr,Za,vt,Ho,Yr,Vo,Rd,Le,Zr,he}from"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import{vi,s}from"./chunk-x8mp9yvn.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{W as BROWSER_CORE_IMPORTS,Za as STX_AUTO_IMPORTS,Gr as extractAndStripCssImports,Le as extractBridgeData,vi as findInterpolationEnd,Vo as generateAutoImportDestructuring,Rd as generateBrowserAutoImportDestructuring,Zr as generateServerDataBridge,vt as injectBrowserCoreAutoImports,he as processClientScript,Yr as referencesName,Jr as renderVendorStyleTags,s as stripCommentsAndLiterals,Ho as transformAutoImports};
2
+ import{W,Gr,Jr,Za,vt,Ho,Yr,Vo,Rd,Le,Zr,he}from"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import{vi,s}from"./chunk-x8mp9yvn.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{W as BROWSER_CORE_IMPORTS,Za as STX_AUTO_IMPORTS,Gr as extractAndStripCssImports,Le as extractBridgeData,vi as findInterpolationEnd,Vo as generateAutoImportDestructuring,Rd as generateBrowserAutoImportDestructuring,Zr as generateServerDataBridge,vt as injectBrowserCoreAutoImports,he as processClientScript,Yr as referencesName,Jr as renderVendorStyleTags,s as stripCommentsAndLiterals,Ho as transformAutoImports};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{M,ce}from"./chunk-xs48j158.js";import{de,C,Xe}from"./chunk-6k4f583z.js";import{Qe,G,ke}from"./chunk-1aw9qbdf.js";import{Ae,ne,_,re,fo,Er,go,Ot}from"./chunk-4njn89w1.js";import{Kr}from"./chunk-7tzf1e7f.js";import{Mt}from"./chunk-2etevws0.js";import F from"zlib";import{promisify as Z}from"util";var ee=Z(F.brotliCompress),te=Z(F.gzip),se=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],oe=["text/event-stream","multipart/x-mixed-replace"],ae=1024;function ie(t){if(!t)return!1;let e=t.toLowerCase();if(oe.some((o)=>e.startsWith(o)))return!1;return se.some((o)=>e.startsWith(o))}function pe(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ue(t){if(!t)return null;let e=pe(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var J=33554432,H=new Map,U=0;function le(t,e){if(e.length>J/8)return;H.set(t,e),U+=e.length;for(let[o,r]of H){if(U<=J)break;H.delete(o),U-=r.length}}async function It(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ie(e.headers.get("content-type")))return e;let r=ue(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:Q(e.headers)});if(a.length<(o.threshold??ae))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=H.get(g);if(!l)l=r==="br"?await ee(a,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await te(a),le(g,l);if(l.length>=a.length)return f();let m=Q(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function Q(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}import K from"fs";import P from"path";var{serve:me}=globalThis.Bun;class q{now;entries=new M(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,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",_(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${ne(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await o();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let B=await s.clone().arrayBuffer();if(B.byteLength>1048576)return null;s.headers.set("Vary",_(s.headers.get("Vary")).Vary);let n={body:B,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return a();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let E=await v;return E?l(E):a()}}var fe={".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 Qc(t={}){let e=P.resolve(t.outputDir||".output"),o=t.port??3000,r=fo(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=Mt(r.routeRules),f=new q,h=Kr(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?C(l):void 0,b=new Map,k=new Map,v=new Map,E=new Map;for(let n of r.routes)try{let y=P.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Xe(i.html,m);b.set(n.pattern,i),v.set(n.pattern,ke(i.html)),E.set(n.pattern,ce(i.html));let X=P.join(e,n.fragmentPath);if(await Bun.file(X).exists()){let A=await Bun.file(X).text();k.set(n.pattern,m?Xe(A,m):A)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=G(n.pattern,{page:!0});S.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let B=me({port:o,async fetch(n){return It(n,await de(m??C(),async()=>{let i=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?.[i])return t.apiRoutes[i](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(K.existsSync(u)&&K.statSync(u).isFile()){let R=P.extname(u).toLowerCase(),L=fe[R]||"application/octet-stream",N=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":N?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=ne(n),w=null,W={};if(w=s.get(i)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let c=i.match(p);if(c){w=d,u.forEach((R,L)=>{W[R]=c[L+1]});break}}if(!w){let p=Qe(i)?null:s.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,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=a(i),Y=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=k.get(w.pattern);if(c){let R=v.get(w.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(w.pattern)?{"X-STX-Runtime":E.get(w.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},..._(),...O.cache?{}:{"Cache-Control":Ae}}})}}let d=Er(n.method),u=b.get(w.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=b.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.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",..._(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:L,cookies:N,status:I,headers:D}=await Ot(u,{params:W,request:n,method:n.method,__stx_strict_hydration:Y,__stx_runtime_config:m});if(L)return go(L,N,D);if(R&&R.length>0){let{renderStreamingPage:T,streamToResponse:z}=await import("./chunk-fp7dzqze.js"),j=new Headers({..._(),...D,"Cache-Control":"private, no-store"});for(let V of N??[])j.append("Set-Cookie",V);if(A&&!d){let V=ke(c);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",ce(c)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(T(A&&!d?re(c,r.routerContainer||"main"):c,R,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let x=new Headers({"Content-Type":"text/html",..._(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let T of N??[])x.append("Set-Cookie",T);for(let[T,z]of Object.entries(D??{}))x.set(T,z);if(x.set("Vary",_(x.get("Vary")).Vary),A&&!d){let T=ke(c);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",ce(c)?"true":"false"),x.set("X-STX-Layout",T.layout),x.set("X-STX-Layout-Group",T.group),new Response(re(c,r.routerContainer||"main"),{status:I??u.status??200,headers:x})}return new Response(c,{status:I??u.status??200,headers:x})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),Y)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:${B.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:B.port,stop:()=>{f.invalidate(),B.stop()},invalidate:(n)=>f.invalidate(n)}}
2
+ import{M,ce}from"./chunk-9afwh767.js";import{de,C,Xe}from"./chunk-6k4f583z.js";import{Qe,G,ke}from"./chunk-1aw9qbdf.js";import{Ae,ne,_,re,fo,Er,go,Ot}from"./chunk-f1cm6kh5.js";import{Kr}from"./chunk-ts8an4wm.js";import{Mt}from"./chunk-2etevws0.js";import F from"zlib";import{promisify as Z}from"util";var ee=Z(F.brotliCompress),te=Z(F.gzip),se=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],oe=["text/event-stream","multipart/x-mixed-replace"],ae=1024;function ie(t){if(!t)return!1;let e=t.toLowerCase();if(oe.some((o)=>e.startsWith(o)))return!1;return se.some((o)=>e.startsWith(o))}function pe(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ue(t){if(!t)return null;let e=pe(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var J=33554432,H=new Map,U=0;function le(t,e){if(e.length>J/8)return;H.set(t,e),U+=e.length;for(let[o,r]of H){if(U<=J)break;H.delete(o),U-=r.length}}async function It(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ie(e.headers.get("content-type")))return e;let r=ue(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:Q(e.headers)});if(a.length<(o.threshold??ae))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=H.get(g);if(!l)l=r==="br"?await ee(a,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await te(a),le(g,l);if(l.length>=a.length)return f();let m=Q(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function Q(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}import K from"fs";import P from"path";var{serve:me}=globalThis.Bun;class q{now;entries=new M(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,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",_(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${ne(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await o();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let B=await s.clone().arrayBuffer();if(B.byteLength>1048576)return null;s.headers.set("Vary",_(s.headers.get("Vary")).Vary);let n={body:B,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return a();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let E=await v;return E?l(E):a()}}var fe={".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 Qc(t={}){let e=P.resolve(t.outputDir||".output"),o=t.port??3000,r=fo(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=Mt(r.routeRules),f=new q,h=Kr(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?C(l):void 0,b=new Map,k=new Map,v=new Map,E=new Map;for(let n of r.routes)try{let y=P.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Xe(i.html,m);b.set(n.pattern,i),v.set(n.pattern,ke(i.html)),E.set(n.pattern,ce(i.html));let X=P.join(e,n.fragmentPath);if(await Bun.file(X).exists()){let A=await Bun.file(X).text();k.set(n.pattern,m?Xe(A,m):A)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=G(n.pattern,{page:!0});S.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let B=me({port:o,async fetch(n){return It(n,await de(m??C(),async()=>{let i=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?.[i])return t.apiRoutes[i](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(K.existsSync(u)&&K.statSync(u).isFile()){let R=P.extname(u).toLowerCase(),L=fe[R]||"application/octet-stream",N=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":N?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=ne(n),w=null,W={};if(w=s.get(i)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let c=i.match(p);if(c){w=d,u.forEach((R,L)=>{W[R]=c[L+1]});break}}if(!w){let p=Qe(i)?null:s.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,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=a(i),Y=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=k.get(w.pattern);if(c){let R=v.get(w.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(w.pattern)?{"X-STX-Runtime":E.get(w.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},..._(),...O.cache?{}:{"Cache-Control":Ae}}})}}let d=Er(n.method),u=b.get(w.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=b.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.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",..._(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:L,cookies:N,status:I,headers:D}=await Ot(u,{params:W,request:n,method:n.method,__stx_strict_hydration:Y,__stx_runtime_config:m});if(L)return go(L,N,D);if(R&&R.length>0){let{renderStreamingPage:T,streamToResponse:z}=await import("./chunk-y08ncpqj.js"),j=new Headers({..._(),...D,"Cache-Control":"private, no-store"});for(let V of N??[])j.append("Set-Cookie",V);if(A&&!d){let V=ke(c);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",ce(c)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(T(A&&!d?re(c,r.routerContainer||"main"):c,R,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let x=new Headers({"Content-Type":"text/html",..._(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let T of N??[])x.append("Set-Cookie",T);for(let[T,z]of Object.entries(D??{}))x.set(T,z);if(x.set("Vary",_(x.get("Vary")).Vary),A&&!d){let T=ke(c);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",ce(c)?"true":"false"),x.set("X-STX-Layout",T.layout),x.set("X-STX-Layout-Group",T.group),new Response(re(c,r.routerContainer||"main"),{status:I??u.status??200,headers:x})}return new Response(c,{status:I??u.status??200,headers:x})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),Y)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:${B.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:B.port,stop:()=>{f.invalidate(),B.stop()},invalidate:(n)=>f.invalidate(n)}}
3
3
  export{It,Qc};
@@ -4217,6 +4217,14 @@ catch (e2) {
4217
4217
  });
4218
4218
 
4219
4219
  roots.forEach(function(root) {
4220
+ // Still inside a conditional or loop this walk has not bound: the
4221
+ // directive decides whether the component is on the page at all, and
4222
+ // hydrates it through this same function when it is. Mounting it from
4223
+ // here is what ran a hidden pane's onMount when an enclosing :if opened
4224
+ // (stacksjs/stx#2071): the walk reached the pane's root while the pane's
4225
+ // own :if was still an attribute, so its condition was never asked. The
4226
+ // setup half above already leaves these roots alone.
4227
+ if (hasPendingStructuralAncestor(root)) return;
4220
4228
  var scopeId = root.getAttribute('data-stx-scope');
4221
4229
  var scopeVars = scopeId && window.stx._scopes && window.stx._scopes[scopeId];
4222
4230
  var resolvedCallerScope = resolveComponentCallerScope(root, callerScope);
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{jn,Me,Le,he,Jo,Vn,Z,K,an,u,n,R}from"./chunk-xs48j158.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(s,p){let m;while((m=s.exec(o))!==null){let t=m.index,i=t+m[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:r,content:g}=jn(o),c=await(e.renderer??((s)=>Me(s)))(g);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Z(o);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),m;while((m=g.exec(o))!==null){let i=m[1],l=m[2],f=m[0],d=i.includes("server");if(p(l))s.push(f);else if(d)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 d=l.index+l[0].length,x=t.indexOf("</script>",d);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let d=f.length-1;d>=0;d--)t=t.substring(0,f[d].start)+t.substring(f[d].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function M(o,e){return`<!DOCTYPE html>
2
+ import{jn,Me,Le,he,Jo,Vn,Z,K,an,u,n,R}from"./chunk-9afwh767.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(s,p){let m;while((m=s.exec(o))!==null){let t=m.index,i=t+m[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:r,content:g}=jn(o),c=await(e.renderer??((s)=>Me(s)))(g);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Z(o);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),m;while((m=g.exec(o))!==null){let i=m[1],l=m[2],f=m[0],d=i.includes("server");if(p(l))s.push(f);else if(d)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 d=l.index+l[0].length,x=t.indexOf("</script>",d);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let d=f.length-1;d>=0;d--)t=t.substring(0,f[d].start)+t.substring(f[d].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function M(o,e){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -14,5 +14,5 @@ ${c.join(`
14
14
  `)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Le(p),d=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await he(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
15
15
  `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${d}
16
16
  $1`);else t+=`
17
- ${d}`}t=await K(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-518kr9jb.js");t=await i(t)}catch{}return t}
17
+ ${d}`}t=await K(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-hv92fwyw.js");t=await i(t)}catch{}return t}
18
18
  export{Io};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Bn,Qa,Ad,ec,Pd,tc,Fn,b,St,ye,nc,es,rc,Id,q,sc,Dd,x,Od}from"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{sc as applyFilters,Pd as clearCustomFilters,nc as clientLoopScopes,Bn as defaultFilters,b as escapeHtml,St as escapeHtmlValue,x as evaluateExpression,tc as findMustacheEnd,ec as getAllFilters,rc as interpolateScriptAttributes,es as interpolateScriptExpressions,Id as interpolateScriptsInTemplate,q as processExpressions,Qa as registerFilter,Ad as registerFilters,Fn as replaceInterpolations,Dd as resetRejectedExpressionWarnings,Od as unescapeHtml,ye as usesSignalsInScript};
2
+ import{Bn,Qa,Ad,ec,Pd,tc,Fn,b,St,ye,nc,es,rc,Id,q,sc,Dd,x,Od}from"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{sc as applyFilters,Pd as clearCustomFilters,nc as clientLoopScopes,Bn as defaultFilters,b as escapeHtml,St as escapeHtmlValue,x as evaluateExpression,tc as findMustacheEnd,ec as getAllFilters,rc as interpolateScriptAttributes,es as interpolateScriptExpressions,Id as interpolateScriptsInTemplate,q as processExpressions,Qa as registerFilter,Ad as registerFilters,Fn as replaceInterpolations,Dd as resetRejectedExpressionWarnings,Od as unescapeHtml,ye as usesSignalsInScript};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{De,Kt}from"./chunk-zsdhaj58.js";import{Ce}from"./chunk-1aw9qbdf.js";import{Uo,Wo,f,Ct,Q,N,n,R,o}from"./chunk-xs48j158.js";import{C}from"./chunk-6k4f583z.js";import{Cs}from"./chunk-dq6v78fd.js";import{pn,fn,gn,hn,pe}from"./chunk-gynes6rm.js";import{ki}from"./chunk-kp4mzspk.js";import{me,re,uo,po,Ot}from"./chunk-4njn89w1.js";import{wt,qr}from"./chunk-7tzf1e7f.js";import{Mt}from"./chunk-2etevws0.js";import{ft,Yt,Zt}from"./chunk-g7ey7mtw.js";import{createHash as ee}from"crypto";function J(i){return ee("sha256").update(i).digest("hex").slice(0,8)}function U(i=!1){let l=i?Kt():De(),a=J(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function V(){let i=Ce(),l=J(i);return{content:i,filename:`router.${l}.js`,hash:l}}import m from"fs";import c from"path";import q from"path";import{createHash as te}from"crypto";function se(i={}){let l=new Set;return{context:new Proxy(i,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(i,l,a={}){let r=q.resolve(i),e=await Bun.file(r).text(),S=te("sha256").update(e).digest("hex").slice(0,16);Uo();let _={};try{_=await o(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let v=g[1];if(/\bserver\b/.test(v))y.push(g[2])}let u=new Set(y.flatMap((v)=>Q(v))),{context:A}=se({__filename:r,__dirname:q.dirname(r),__stx_serverDeclared:u}),w=new Set,P={...R,..._,...a,buildMode:"compile",strict:!1},b=await n(e,A,r,P,w),T=me(b),B=Wo();return{route:l,sourceFile:i,html:b,fragment:T,placeholders:B,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:Ct(e),streamTemplates:A.__streamTemplates}}var ne=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(i,l){let a=0,r=0;if(!m.existsSync(i))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(ne.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),a++,r+=m.statSync(u).size}}}return e(i,l),{copied:a,bytes:r}}async function al(i={}){let l=Date.now(),a=c.resolve(i.root||process.cwd()),r=c.resolve(a,i.outputDir||".output");console.log("[stx build] Starting production build...");let e=await o(a),S=c.resolve(a,i.componentsDir??e.componentsDir??"components"),_=c.resolve(a,i.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,i.layoutsDir??e.layoutsDir??"layouts"),d=i.publicDir??e.publicDir??"public",g=pe(e.app?.head,{known:hn,source:"app.head"}),u=e.app?.colorMode,A=e.router?.container||"main",w=i.routeRules??e.routeRules??{},P=Mt(w),b=i.serverApi??e.serverApi,T=typeof b==="object"?b:{};if(b)wt(a,T);if(e.runtimeConfig)C(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let B=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of B)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let v=N(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],M=v.filter((s)=>!Y.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${M.length} page routes (${v.length-M.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let D=U(i.debug),x=V();await Bun.write(c.join(r,"public","__stx",D.filename),D.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${D.filename} (${(D.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],E=[];for(let s of M){let h=P(s.pattern),k=h.rendering==="prerender";if(k&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:i.debug});if(O.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,D.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=gn(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=pn(t.html,u);if(g.htmlAttrs)t.html=fn(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let W=p[1];t.html=t.html.replace(" "+W,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${W}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await f(t.html),k){let p=await Ot(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=re(t.html,A);let z=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),G=c.join("server","pages",`${z}.compiled.json`),I=c.join("server","fragments",`${z}.html`);await Bun.write(c.join(r,G),JSON.stringify(t,null,2)),await Bun.write(c.join(r,I),t.fragment),E.push({pattern:s.pattern,compiledPath:G,fragmentPath:I,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:k}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let H=c.resolve(a,d);if(m.existsSync(H)){let{copied:s,bytes:h}=Z(H,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let F=Zt(a);if(F){let{copied:s,bytes:h}=Z(F,c.join(r,"public",Yt));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${ft}/`)}let K={runtime:D.filename,router:x.filename},j=uo(E,K,r);if(j.routeRules=w,j.routerContainer=A,b)j.apiRoutes=await qr(a,r,T);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Cs(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(ki(e._layerGraph),null,2));po(j,r);let L=Date.now()-l;return console.log(`
2
+ import{De,Kt}from"./chunk-add8tq7t.js";import{Ce}from"./chunk-1aw9qbdf.js";import{Uo,Wo,f,Ct,Q,N,n,R,o}from"./chunk-9afwh767.js";import{C}from"./chunk-6k4f583z.js";import{Cs}from"./chunk-t768bb57.js";import{pn,fn,gn,hn,pe}from"./chunk-gynes6rm.js";import{ki}from"./chunk-kp4mzspk.js";import{me,re,uo,po,Ot}from"./chunk-f1cm6kh5.js";import{wt,qr}from"./chunk-ts8an4wm.js";import{Mt}from"./chunk-2etevws0.js";import{ft,Yt,Zt}from"./chunk-g7ey7mtw.js";import{createHash as ee}from"crypto";function J(i){return ee("sha256").update(i).digest("hex").slice(0,8)}function U(i=!1){let l=i?Kt():De(),a=J(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function V(){let i=Ce(),l=J(i);return{content:i,filename:`router.${l}.js`,hash:l}}import m from"fs";import c from"path";import q from"path";import{createHash as te}from"crypto";function se(i={}){let l=new Set;return{context:new Proxy(i,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(i,l,a={}){let r=q.resolve(i),e=await Bun.file(r).text(),S=te("sha256").update(e).digest("hex").slice(0,16);Uo();let _={};try{_=await o(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let v=g[1];if(/\bserver\b/.test(v))y.push(g[2])}let u=new Set(y.flatMap((v)=>Q(v))),{context:A}=se({__filename:r,__dirname:q.dirname(r),__stx_serverDeclared:u}),w=new Set,P={...R,..._,...a,buildMode:"compile",strict:!1},b=await n(e,A,r,P,w),T=me(b),B=Wo();return{route:l,sourceFile:i,html:b,fragment:T,placeholders:B,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:Ct(e),streamTemplates:A.__streamTemplates}}var ne=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(i,l){let a=0,r=0;if(!m.existsSync(i))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(ne.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),a++,r+=m.statSync(u).size}}}return e(i,l),{copied:a,bytes:r}}async function al(i={}){let l=Date.now(),a=c.resolve(i.root||process.cwd()),r=c.resolve(a,i.outputDir||".output");console.log("[stx build] Starting production build...");let e=await o(a),S=c.resolve(a,i.componentsDir??e.componentsDir??"components"),_=c.resolve(a,i.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,i.layoutsDir??e.layoutsDir??"layouts"),d=i.publicDir??e.publicDir??"public",g=pe(e.app?.head,{known:hn,source:"app.head"}),u=e.app?.colorMode,A=e.router?.container||"main",w=i.routeRules??e.routeRules??{},P=Mt(w),b=i.serverApi??e.serverApi,T=typeof b==="object"?b:{};if(b)wt(a,T);if(e.runtimeConfig)C(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let B=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of B)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let v=N(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],M=v.filter((s)=>!Y.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${M.length} page routes (${v.length-M.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let D=U(i.debug),x=V();await Bun.write(c.join(r,"public","__stx",D.filename),D.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${D.filename} (${(D.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],E=[];for(let s of M){let h=P(s.pattern),k=h.rendering==="prerender";if(k&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:i.debug});if(O.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,D.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=gn(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=pn(t.html,u);if(g.htmlAttrs)t.html=fn(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let W=p[1];t.html=t.html.replace(" "+W,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${W}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await f(t.html),k){let p=await Ot(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=re(t.html,A);let z=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),G=c.join("server","pages",`${z}.compiled.json`),I=c.join("server","fragments",`${z}.html`);await Bun.write(c.join(r,G),JSON.stringify(t,null,2)),await Bun.write(c.join(r,I),t.fragment),E.push({pattern:s.pattern,compiledPath:G,fragmentPath:I,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:k}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let H=c.resolve(a,d);if(m.existsSync(H)){let{copied:s,bytes:h}=Z(H,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let F=Zt(a);if(F){let{copied:s,bytes:h}=Z(F,c.join(r,"public",Yt));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${ft}/`)}let K={runtime:D.filename,router:x.filename},j=uo(E,K,r);if(j.routeRules=w,j.routerContainer=A,b)j.apiRoutes=await qr(a,r,T);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Cs(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(ki(e._layerGraph),null,2));po(j,r);let L=Date.now()-l;return console.log(`
3
3
  [stx build] Done in ${L}ms \u2014 ${O.length} pages compiled`),{pageCount:O.length,assets:K,outputDir:r,duration:L}}
4
4
  export{al};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{nd,rd}from"./chunk-5e6bhs6v.js";import"./chunk-0x2qent6.js";import"./chunk-ts8an4wm.js";import"./chunk-2hc5mbw8.js";import"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{rd as clearStoreCache,nd as getStoreScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Tt}from"./chunk-gynes6rm.js";import{qo,Qr,Y,je,St,x,Fe,ze,Kn,u}from"./chunk-xs48j158.js";import{O}from"./chunk-hktvv0hd.js";import v from"path";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 io(t){let n=[],e=[],r=[],o=0;while(o<t.length){let s=t.indexOf("<",o);if(s===-1)break;let a=je(t,s);if(a>s){o=a;continue}let i=Y(t,s);if(i>s){let c=t.slice(s,i),f=H.exec(c);if(f){let l=F(f[1],f[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],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,d;while((d=l.exec(t))!==null){if(P(d.index,o))continue;let h=d[1]==="/";if(!h&&(d[2]||"").trimEnd().endsWith("/"))continue;if(g+=h?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:d.index,tagName:a}}return null}return null}var Ae="private, no-store";function ao(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 ne(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 _(t){return{Vary:z(t,"X-STX-Router")}}var G="stx-page-head:",U=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,A={dev:null,prod:null};function W(){let t=O()?"dev":"prod",n=A[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-9c86wgnk.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;A[t]=`<script>${r()}</script>`}catch{A[t]=""}return A[t]}async function co(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=v.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=v.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Cr(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=io(e),a=[...s.client.map((m)=>m.fullTag),...s.signals.map((m)=>m.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)i.push(f[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 g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:d,extractVariables:h,defaultConfig:S,loadStxConfig:b}=await import("./chunk-md8m0mpb.js"),R=await b(),p={__filename:t,__dirname:v.dirname(t)};for(let m of a){let C=m.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!m.includes("client")&&!m.includes('type="module"'))await h(C[1],p,t)}let y=await d(l,p,t,{...S,...R,...n},new Set),w=y.indexOf(g);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:y.substring(0,w),afterSlot:y.substring(w+g.length),filePath:t,shellScripts:a,shellStyles:i}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function An(t,n,e){let r,o="",s=n.match(U);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();o=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",i=W(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{Tt}from"./chunk-gynes6rm.js";import{qo,Qr,Y,je,St,x,Fe,ze,Kn,u}from"./chunk-9afwh767.js";import{O}from"./chunk-hktvv0hd.js";import v from"path";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 io(t){let n=[],e=[],r=[],o=0;while(o<t.length){let s=t.indexOf("<",o);if(s===-1)break;let a=je(t,s);if(a>s){o=a;continue}let i=Y(t,s);if(i>s){let c=t.slice(s,i),f=H.exec(c);if(f){let l=F(f[1],f[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],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,d;while((d=l.exec(t))!==null){if(P(d.index,o))continue;let h=d[1]==="/";if(!h&&(d[2]||"").trimEnd().endsWith("/"))continue;if(g+=h?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:d.index,tagName:a}}return null}return null}var Ae="private, no-store";function ao(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 ne(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 _(t){return{Vary:z(t,"X-STX-Router")}}var G="stx-page-head:",U=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,A={dev:null,prod:null};function W(){let t=O()?"dev":"prod",n=A[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-9c86wgnk.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;A[t]=`<script>${r()}</script>`}catch{A[t]=""}return A[t]}async function co(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=v.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=v.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Cr(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=io(e),a=[...s.client.map((m)=>m.fullTag),...s.signals.map((m)=>m.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)i.push(f[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 g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:d,extractVariables:h,defaultConfig:S,loadStxConfig:b}=await import("./chunk-1jwjtcvd.js"),R=await b(),p={__filename:t,__dirname:v.dirname(t)};for(let m of a){let C=m.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!m.includes("client")&&!m.includes('type="module"'))await h(C[1],p,t)}let y=await d(l,p,t,{...S,...R,...n},new Set),w=y.indexOf(g);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:y.substring(0,w),afterSlot:y.substring(w+g.length),filePath:t,shellScripts:a,shellStyles:i}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function An(t,n,e){let r,o="",s=n.match(U);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();o=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",i=W(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -26,5 +26,5 @@ ${i}
26
26
  `));if(o.length>0)S.push(o.join(`
27
27
  `));if(g.length>0)S.push(g.join(`
28
28
  `));return S.push(l),S.join(`
29
- `)}function E(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 J(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 Er(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function I(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Er(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let o={};try{o=await J(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=K(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function K(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(E(e,r));continue}if(r&&typeof r==="object"){let o=r;if(typeof o.value!=="string")continue;n.push(E(e,o.value,o))}}return n}function go(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})}import k from"fs";import j from"path";function uo(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function po(t,n){let e=j.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function fo(t){let n=j.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.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}}async function Ot(t,n={}){let{html:e,context:r,redirect:o,cookies:s}=await Z(t,n),a=Fe(r),i=ze(r);if(o)return{html:e,redirect:o,cookies:s,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-fp7dzqze.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-skve9q8q.js"),{defaultConfig:d}=await import("./chunk-x4xxfpn7.js"),h=r.streamBoundaries||{},S={...d,autoShell:!1},b=Object.keys(l).map((p)=>({id:p,render:async()=>{let y=typeof h[p]==="function"?await h[p]():void 0;return g(l[p],{...r,$boundary:y},t.sourceFile,S,new Set)}})),R=new Set(b.map((p)=>p.id));f=[...(f||[]).filter((p)=>!R.has(p.id)),...b]}return{html:e,boundaries:f&&f.length>0?f: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&&!Qr(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(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 I(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=Kn(e);if(!c)return i;let f=i.indexOf("</head>");return f<0?c+i:i.slice(0,f)+c+i.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Qr(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=x(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?St(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:o(qo(t.html,s)),context:e,cookies:r.cookies}}
29
+ `)}function E(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 J(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 Er(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function I(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Er(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let o={};try{o=await J(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=K(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function K(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(E(e,r));continue}if(r&&typeof r==="object"){let o=r;if(typeof o.value!=="string")continue;n.push(E(e,o.value,o))}}return n}function go(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})}import k from"fs";import j from"path";function uo(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function po(t,n){let e=j.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function fo(t){let n=j.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.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}}async function Ot(t,n={}){let{html:e,context:r,redirect:o,cookies:s}=await Z(t,n),a=Fe(r),i=ze(r);if(o)return{html:e,redirect:o,cookies:s,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-y08ncpqj.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-ytcqk6np.js"),{defaultConfig:d}=await import("./chunk-10xg8gds.js"),h=r.streamBoundaries||{},S={...d,autoShell:!1},b=Object.keys(l).map((p)=>({id:p,render:async()=>{let y=typeof h[p]==="function"?await h[p]():void 0;return g(l[p],{...r,$boundary:y},t.sourceFile,S,new Set)}})),R=new Set(b.map((p)=>p.id));f=[...(f||[]).filter((p)=>!R.has(p.id)),...b]}return{html:e,boundaries:f&&f.length>0?f: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&&!Qr(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(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 I(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=Kn(e);if(!c)return i;let f=i.indexOf("</head>");return f<0?c+i:i.slice(0,f)+c+i.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Qr(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=x(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?St(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:o(qo(t.html,s)),context:e,cookies:r.cookies}}
30
30
  export{io,Ae,ao,ne,_,co,Cr,An,me,lo,re,uo,po,fo,Er,go,Ot};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ne,oc,Md,Nd,Ld,jd,ic,ac,Bd,Fd,Ko,zd,nn,rn,zn}from"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{jd as __setSignalsGeneratorsForTest,Ne as cacheEngineFingerprint,rn as cacheTemplate,nn as checkCache,zd as clearDevCaches,ac as getCachedRouterScript,ic as getCachedSignalsRuntime,Bd as getServeClientAsset,Ko as getServeModuleBundle,zn as hashFilePath,Nd as invalidateFileCache,Ld as invalidateFileCacheByDir,Md as readFileCached,Fd as registerServeModuleBundle,oc as templateCache};
2
+ import{Ne,oc,Md,Nd,Ld,jd,ic,ac,Bd,Fd,Ko,zd,nn,rn,zn}from"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{jd as __setSignalsGeneratorsForTest,Ne as cacheEngineFingerprint,rn as cacheTemplate,nn as checkCache,zd as clearDevCaches,ac as getCachedRouterScript,ic as getCachedSignalsRuntime,Bd as getServeClientAsset,Ko as getServeModuleBundle,zn as hashFilePath,Nd as invalidateFileCache,Ld as invalidateFileCacheByDir,Md as readFileCached,Fd as registerServeModuleBundle,oc as templateCache};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{o}from"./chunk-xs48j158.js";import{$r}from"./chunk-2etevws0.js";import p from"path";async function wl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if($r(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-ntx4axaf.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
2
+ import{o}from"./chunk-9afwh767.js";import{$r}from"./chunk-2etevws0.js";import p from"path";async function wl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if($r(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-012h75ke.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
3
3
  export{wl};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Qc}from"./chunk-03mkxevd.js";import"./chunk-4njn89w1.js";import"./chunk-7tzf1e7f.js";import"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{Qc as startProductionServer};
2
+ import{Qc}from"./chunk-aad7fmvp.js";import"./chunk-f1cm6kh5.js";import"./chunk-ts8an4wm.js";import"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{Qc as startProductionServer};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Hd,Xo,Vd,Go,cc,lc,kt,sn,Ud,dc,uc,pc,f}from"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{kt as buildCss,dc as extractClassNames,lc as fingerprintConfig,uc as generateCss,Ud as getCachedCSS,Hd as getCssServeAsset,f as injectCss,Xo as loadCssEngine,Go as loadCssEngineConfig,sn as rebuildCss,Vd as resetCssCache,cc as resolveUserCssConfig,pc as withLinkedModuleBundles};
2
+ import{Hd,Xo,Vd,Go,cc,lc,kt,sn,Ud,dc,uc,pc,f}from"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{kt as buildCss,dc as extractClassNames,lc as fingerprintConfig,uc as generateCss,Ud as getCachedCSS,Hd as getCssServeAsset,f as injectCss,Xo as loadCssEngine,Go as loadCssEngineConfig,sn as rebuildCss,Vd as resetCssCache,cc as resolveUserCssConfig,pc as withLinkedModuleBundles};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{xt,gs,di,Ec}from"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{Ec as declareBareLoopHead,xt as parseLoopBinding,di as processLoops,gs as reportDeferredLoopWarnings};
2
+ import{xt,gs,di,Ec}from"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{Ec as declareBareLoopHead,xt as parseLoopBinding,di as processLoops,gs as reportDeferredLoopWarnings};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{q,n}from"./chunk-xs48j158.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
2
+ import{q,n}from"./chunk-9afwh767.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{wl}from"./chunk-sqf60k0y.js";import"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{wl as buildApp};
2
+ import{wl}from"./chunk-g2990jbf.js";import"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{wl as buildApp};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Et,bc,wc,vc,xc,Sc,u,kc,ps,Cc,ci,li}from"./chunk-xs48j158.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-dq6v78fd.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{Et as STX_ENGINE_BINDING_NAMES,ps as convertToCommonJS,ci as extractScriptFromTemplate,u as extractVariables,li as hasVariables,kc as isCompleteImport,Sc as isMissingBindingFailure,vc as isModuleResolutionFailure,xc as isSyntaxFailure,Cc as splitDeclaration,bc as stripTypeScript,wc as withoutStxReferrer};
2
+ import{Et,bc,wc,vc,xc,Sc,u,kc,ps,Cc,ci,li}from"./chunk-9afwh767.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-t768bb57.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{Et as STX_ENGINE_BINDING_NAMES,ps as convertToCommonJS,ci as extractScriptFromTemplate,u as extractVariables,li as hasVariables,kc as isCompleteImport,Sc as isMissingBindingFailure,vc as isModuleResolutionFailure,xc as isSyntaxFailure,Cc as splitDeclaration,bc as stripTypeScript,wc as withoutStxReferrer};