@stacksjs/stx 0.2.561 → 0.2.562

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 (140) hide show
  1. package/dist/caching.js +12 -5
  2. package/dist/chunk-0cdm7t05.js +2 -0
  3. package/dist/chunk-0m8bd1e4.js +2 -0
  4. package/dist/chunk-15y79nz5.js +2 -0
  5. package/dist/chunk-17vy71v0.js +2 -0
  6. package/dist/chunk-1ee1t21e.js +2 -0
  7. package/dist/{chunk-f029nw9a.js → chunk-1w8ssr90.js} +4 -4
  8. package/dist/{chunk-mdgvzf07.js → chunk-1ycy7mqy.js} +1 -1
  9. package/dist/{chunk-km7sb7bj.js → chunk-1zeqghsw.js} +3 -3
  10. package/dist/{chunk-e4mbr4az.js → chunk-31ez1sq0.js} +1 -1
  11. package/dist/{chunk-gfqka4zx.js → chunk-36rd7j1d.js} +3 -3
  12. package/dist/chunk-38qks2pt.js +2 -0
  13. package/dist/{chunk-59nq020j.js → chunk-3jhckfnp.js} +2 -2
  14. package/dist/chunk-40fqmb3q.js +2 -0
  15. package/dist/chunk-4265g93g.js +2 -0
  16. package/dist/{chunk-q97v1714.js → chunk-54mnmxg9.js} +1 -1
  17. package/dist/chunk-56mkcxvb.js +2 -0
  18. package/dist/chunk-5pk0s92z.js +2 -0
  19. package/dist/{chunk-hbb208xt.js → chunk-5yc38gvt.js} +2 -2
  20. package/dist/chunk-68ph8r20.js +2 -0
  21. package/dist/{chunk-tc9r6wc2.js → chunk-6dw8aa34.js} +1 -1
  22. package/dist/chunk-6va8wt88.js +2 -0
  23. package/dist/{chunk-d37enreq.js → chunk-7gdvp6py.js} +2 -2
  24. package/dist/chunk-7qwwm3se.js +2 -0
  25. package/dist/chunk-89s1ekq9.js +2 -0
  26. package/dist/chunk-8xn3kd90.js +2 -0
  27. package/dist/chunk-97w2jbj4.js +2 -0
  28. package/dist/{chunk-w5nw5cj6.js → chunk-9dgd1p9a.js} +2 -2
  29. package/dist/chunk-9skdekv5.js +2 -0
  30. package/dist/chunk-ac8a280a.js +2 -0
  31. package/dist/{chunk-4kj8a2bn.js → chunk-avw3nvd4.js} +1 -1
  32. package/dist/{chunk-qnf9tr0r.js → chunk-bqdsc6rm.js} +1 -1
  33. package/dist/chunk-cp4dr9ch.js +2 -0
  34. package/dist/chunk-d235xyhd.js +2 -0
  35. package/dist/{chunk-9bxwy4f9.js → chunk-dagve9rb.js} +1 -1
  36. package/dist/{chunk-b11qrqzz.js → chunk-dpawcmgr.js} +3 -3
  37. package/dist/{chunk-ahhav65p.js → chunk-dz7v901d.js} +1 -1
  38. package/dist/chunk-e099d50m.js +2 -0
  39. package/dist/{chunk-6kkt5fjx.js → chunk-e4407hzw.js} +5 -5
  40. package/dist/{chunk-m5s1wcn9.js → chunk-f9m24nfx.js} +1 -1
  41. package/dist/{chunk-m6m19hwd.js → chunk-g12j8ahm.js} +4 -4
  42. package/dist/{chunk-cngtf95k.js → chunk-g6cwhsb4.js} +2 -2
  43. package/dist/{chunk-b156xw15.js → chunk-h23bjqn1.js} +2 -2
  44. package/dist/{chunk-frgpx23w.js → chunk-hj67a88k.js} +2 -2
  45. package/dist/chunk-hrahv6v0.js +2 -0
  46. package/dist/chunk-hv2kxb94.js +2 -0
  47. package/dist/chunk-j9c0yam7.js +2 -0
  48. package/dist/{chunk-cv1q9fq8.js → chunk-jjwg83xv.js} +1 -1
  49. package/dist/chunk-jvt7ddp6.js +2 -0
  50. package/dist/{chunk-tkmcyr0k.js → chunk-jxc48ga1.js} +2 -2
  51. package/dist/chunk-k376bs13.js +2 -0
  52. package/dist/{chunk-qrqw667n.js → chunk-k6tnvpje.js} +179 -180
  53. package/dist/{chunk-3cq4g0t1.js → chunk-kns6nhdw.js} +1 -1
  54. package/dist/{chunk-05hr7567.js → chunk-kww6tjzk.js} +6 -6
  55. package/dist/{chunk-gjx5256r.js → chunk-m5fw8jq1.js} +5 -5
  56. package/dist/chunk-m7jmpech.js +2 -0
  57. package/dist/chunk-m7ktr4xn.js +2 -0
  58. package/dist/chunk-m9wr2crk.js +2 -0
  59. package/dist/{chunk-4zb2ga7p.js → chunk-mtdx75j5.js} +2 -2
  60. package/dist/chunk-mx785pkc.js +2 -0
  61. package/dist/{chunk-7ze47qgv.js → chunk-nd8v4xgb.js} +5 -5
  62. package/dist/{chunk-xya3vdqy.js → chunk-nda4xq79.js} +2 -2
  63. package/dist/{chunk-0fatkxpr.js → chunk-p2mxsjv1.js} +3 -3
  64. package/dist/{chunk-skbbk6va.js → chunk-p56ymk3z.js} +5 -5
  65. package/dist/{chunk-whykvbys.js → chunk-peeseskn.js} +2 -2
  66. package/dist/{chunk-g84ctpqq.js → chunk-pp9jgyb6.js} +1 -1
  67. package/dist/{chunk-n9y4ssn1.js → chunk-qd7bqhm3.js} +1 -1
  68. package/dist/{chunk-39tkfkp7.js → chunk-qmza4327.js} +3 -3
  69. package/dist/{chunk-v2rhpdw3.js → chunk-qprkb5qe.js} +1 -1
  70. package/dist/chunk-r90xczch.js +2 -0
  71. package/dist/{chunk-n5swm2mb.js → chunk-rdfgqvrh.js} +3 -3
  72. package/dist/{chunk-77j26p6r.js → chunk-s040j1bv.js} +2 -2
  73. package/dist/{chunk-h0e3ps74.js → chunk-sa18andz.js} +2 -2
  74. package/dist/chunk-schxd5k5.js +2 -0
  75. package/dist/{chunk-v39ysweq.js → chunk-w8q1xp9e.js} +2 -2
  76. package/dist/{chunk-dp163aad.js → chunk-wwx0stf6.js} +3 -3
  77. package/dist/chunk-wzymzex7.js +2 -0
  78. package/dist/chunk-x2baq8dk.js +2 -0
  79. package/dist/{chunk-yp1360pq.js → chunk-x8rx0s3h.js} +1 -1
  80. package/dist/{chunk-kch9a9v1.js → chunk-xab6b4mt.js} +2 -2
  81. package/dist/{chunk-8tpey96f.js → chunk-xb739v4r.js} +2 -2
  82. package/dist/chunk-xcegeyn7.js +2 -0
  83. package/dist/{chunk-bj958h8d.js → chunk-xefvwnwh.js} +2 -2
  84. package/dist/{chunk-f1n5napx.js → chunk-xj45mw7v.js} +2 -2
  85. package/dist/{chunk-yq1mvakj.js → chunk-y0pbnxjg.js} +2 -2
  86. package/dist/chunk-y2gbm7j3.js +2 -0
  87. package/dist/{chunk-9cc4fdtt.js → chunk-ygs733hw.js} +2 -2
  88. package/dist/{chunk-wy4hfmjs.js → chunk-yn3kp3qy.js} +5 -5
  89. package/dist/{chunk-vvkfde23.js → chunk-yp00nht2.js} +2 -2
  90. package/dist/{chunk-5141wftw.js → chunk-z9q5p39g.js} +1 -1
  91. package/dist/chunk-zh0jbzvk.js +2 -0
  92. package/dist/chunk-zh4saqzm.js +2 -0
  93. package/dist/chunk-zpf9he2x.js +2 -0
  94. package/dist/cli.js +11 -11
  95. package/dist/craft-entry.js +2 -2
  96. package/dist/craft.js +2 -2
  97. package/dist/dev-server/ts-css.d.ts +1 -10
  98. package/dist/dev-server/ts-css.js +14 -7
  99. package/dist/pwa.js +3 -3
  100. package/dist/ssg.js +2 -2
  101. package/package.json +5 -5
  102. package/dist/chunk-12dkj7xn.js +0 -2
  103. package/dist/chunk-13xhvx68.js +0 -2
  104. package/dist/chunk-29r6af6f.js +0 -2
  105. package/dist/chunk-3220kken.js +0 -2
  106. package/dist/chunk-49ms9skq.js +0 -2
  107. package/dist/chunk-4bdshma4.js +0 -2
  108. package/dist/chunk-550whbab.js +0 -2
  109. package/dist/chunk-5fwphmtr.js +0 -2
  110. package/dist/chunk-66f3w7rx.js +0 -2
  111. package/dist/chunk-6cq0ggmf.js +0 -2
  112. package/dist/chunk-7pewegtw.js +0 -2
  113. package/dist/chunk-7qqx3ja8.js +0 -2
  114. package/dist/chunk-abtgtvs7.js +0 -2
  115. package/dist/chunk-b8j7qsct.js +0 -2
  116. package/dist/chunk-e5vc83gz.js +0 -2
  117. package/dist/chunk-ej5w5a5x.js +0 -2
  118. package/dist/chunk-ft447y2j.js +0 -2
  119. package/dist/chunk-fvdm6dta.js +0 -2
  120. package/dist/chunk-hd47q9s0.js +0 -2
  121. package/dist/chunk-j1jh32tw.js +0 -2
  122. package/dist/chunk-knr41h7p.js +0 -2
  123. package/dist/chunk-m9cmc6np.js +0 -2
  124. package/dist/chunk-m9r4x7e6.js +0 -2
  125. package/dist/chunk-mbwdn96z.js +0 -2
  126. package/dist/chunk-mqje968d.js +0 -2
  127. package/dist/chunk-n6v7nqgb.js +0 -2
  128. package/dist/chunk-nt0j3fm8.js +0 -2
  129. package/dist/chunk-pq8mz4ma.js +0 -2
  130. package/dist/chunk-q0n8vb38.js +0 -2
  131. package/dist/chunk-q8p16y1h.js +0 -2
  132. package/dist/chunk-qnqb8s28.js +0 -2
  133. package/dist/chunk-qtnqmw1n.js +0 -2
  134. package/dist/chunk-qyj6zygv.js +0 -2
  135. package/dist/chunk-ry8v73j8.js +0 -2
  136. package/dist/chunk-shq0hp3a.js +0 -2
  137. package/dist/chunk-srs912da.js +0 -2
  138. package/dist/chunk-tgfpk4ng.js +0 -2
  139. package/dist/chunk-xhay04n8.js +0 -2
  140. package/dist/chunk-y2gaadz3.js +0 -2
package/dist/caching.js CHANGED
@@ -64,17 +64,24 @@ export async function getServeClientAsset(kind, debug = !1) {
64
64
  }
65
65
  return { content, hash: memo.hash, url: `/_stx/${kind}.${memo.hash}.js` };
66
66
  }
67
- const MODULE_BUNDLE_LIMIT = 500, _moduleBundles = new Map;
67
+ const MODULE_BUNDLE_LIMIT = 500, MODULE_BUNDLE_BYTES = 33554432, _moduleBundles = new Map;
68
+ let _moduleBundleBytes = 0;
68
69
  function moduleBundleFile(hash) {
69
70
  return stateDir(process.cwd(), "module-bundles", `${hash}.js`);
70
71
  }
71
72
  export function registerServeModuleBundle(code) {
72
- const hash = Bun.hash(code).toString(16).padStart(16, "0").slice(0, 16), known = _moduleBundles.has(hash);
73
- if (known)
73
+ const hash = Bun.hash(code).toString(16).padStart(16, "0").slice(0, 16), previous = _moduleBundles.get(hash), known = previous !== void 0;
74
+ if (known) {
74
75
  _moduleBundles.delete(hash);
76
+ _moduleBundleBytes -= previous.length * 2;
77
+ }
75
78
  _moduleBundles.set(hash, code);
76
- while (_moduleBundles.size > MODULE_BUNDLE_LIMIT)
77
- _moduleBundles.delete(_moduleBundles.keys().next().value);
79
+ _moduleBundleBytes += code.length * 2;
80
+ while (_moduleBundles.size > 1 && (_moduleBundles.size > MODULE_BUNDLE_LIMIT || _moduleBundleBytes > MODULE_BUNDLE_BYTES)) {
81
+ const oldest = _moduleBundles.keys().next().value;
82
+ _moduleBundleBytes -= _moduleBundles.get(oldest).length * 2;
83
+ _moduleBundles.delete(oldest);
84
+ }
78
85
  if (!known)
79
86
  try {
80
87
  const file = moduleBundleFile(hash);
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{nl}from"./chunk-dpawcmgr.js";import"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{nl as startInteractive};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Tt,Sc,kc,Cc,_c,Ec,d,Tc,hs,$c,pi,fi}from"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{Tt as STX_ENGINE_BINDING_NAMES,hs as convertToCommonJS,pi as extractScriptFromTemplate,d as extractVariables,fi as hasVariables,Tc as isCompleteImport,Ec as isMissingBindingFailure,Cc as isModuleResolutionFailure,_c as isSyntaxFailure,$c as splitDeclaration,Sc as stripTypeScript,kc as withoutStxReferrer};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{R,Fc,o,A,nu,ru}from"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{A as config,R as defaultConfig,nu as defineStxConfig,o as loadStxConfig,Fc as resolveStxDirectories,ru as validateConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ro,Ao,Po,Rd}from"./chunk-kww6tjzk.js";import"./chunk-3jhckfnp.js";import"./chunk-tqnh98j7.js";import"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{Ro as buildNative,Rd as default,Po as getAvailableFormats,Ao as getAvailableTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{id,ad}from"./chunk-36rd7j1d.js";import"./chunk-9dgd1p9a.js";import"./chunk-rdfgqvrh.js";import"./chunk-azb58ven.js";import"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{ad as clearStoreCache,id as getStoreScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{b,d,n,g,R}from"./chunk-qrqw667n.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function gd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
2
+ import{b,d,n,g,R}from"./chunk-k6tnvpje.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function fd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
5
5
  <script>
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function md(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Ha),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Co(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function hd(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function yd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function bd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function wd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ua={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Va={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
46
+ </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function gd(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Ha),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Co(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function md(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function hd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function yd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function bd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ua={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Va={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${m?`{${m}}`:"{}"}
50
50
  </script>
51
- </div>`}};function vd(e={}){let t=[];if(e.streaming?.enabled)t.push(Ua);if(e.hydration?.enabled)t.push(Va);return t}async function xd(e,t,o,s={}){return e}function Sd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function kd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function wd(e={}){let t=[];if(e.streaming?.enabled)t.push(Ua);if(e.hydration?.enabled)t.push(Va);return t}async function vd(e,t,o,s={}){return e}function xd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function Sd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{gd,Co,Ha,md,hd,yd,bd,wd,Ua,Va,vd,xd,Sd,kd};
194
+ export{fd,Co,Ha,gd,md,hd,yd,bd,Ua,Va,wd,vd,xd,Sd};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Rt,C}from"./chunk-e124cgb6.js";import m from"fs";import e from"path";async function pn(r,o,i){if(r.__stx_runtime_config)return;let n=Rt();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-e5vc83gz.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ts(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{Rt,C}from"./chunk-e124cgb6.js";import m from"fs";import e from"path";async function pn(r,o,i){if(r.__stx_runtime_config)return;let n=Rt();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-15y79nz5.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ts(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import S from"fs";import _ from"path";function Sr(e){let{token:t,baseUrl:i="https://api.netlify.com/api/v1"}=e;async function s(n,r,l={}){let p=`${i}${r}`,f={Authorization:`Bearer ${t}`,"User-Agent":"stx-deploy/1.0"},u;if(l.rawBody)f["Content-Type"]=l.contentType||"application/octet-stream",u=l.rawBody;else if(l.body)f["Content-Type"]="application/json",u=JSON.stringify(l.body);let o=await fetch(p,{method:n,headers:f,body:u});if(!o.ok){let g=Error(`Netlify API error: ${o.status} ${o.statusText}`);g.status=o.status;try{let b=await o.json();g.message=b.message||g.message,g.code=b.code,g.details=b}catch{}throw g}let a=await o.text();if(!a)return{};return JSON.parse(a)}return{async getSite(n){return s("GET",`/sites/${n}`)},async listSites(){return s("GET","/sites")},async createSite(n){let r={};if(n)r.name=n;return s("POST","/sites",{body:r})},async createDeploy(n,r){let l={files:r.files,draft:r.draft??!0,async:r.async??!0};if(r.title)l.title=r.title;if(r.branch)l.branch=r.branch;if(r.functions)l.functions=r.functions;return s("POST",`/sites/${n}/deploys`,{body:l})},async uploadFile(n,r,l){let p=r.startsWith("/")?r.slice(1):r;await s("PUT",`/deploys/${n}/files/${p}`,{rawBody:l,contentType:"application/octet-stream"})},async uploadFiles(n,r){let p=[...r],f=async()=>{while(p.length>0){let o=p.shift();if(o)await this.uploadFile(n,o.path,o.content)}},u=Array.from({length:Math.min(5,r.length)},()=>f());await Promise.all(u)},async getDeploy(n){return s("GET",`/deploys/${n}`)},async waitForDeploy(n,r={}){let{timeout:l=300000,pollInterval:p=2000,onProgress:f}=r,u=Date.now();while(!0){let o=await this.getDeploy(n);if(f)f(o);if(o.state==="ready")return o;if(o.state==="error"){let a=Error(`Deploy failed: ${o.error_message||"Unknown error"}`);throw a.status=500,a.details=o,a}if(Date.now()-u>l){let a=Error(`Deploy timed out after ${l}ms`);throw a.status=408,a.details=o,a}await new Promise((a)=>setTimeout(a,p))}},async lockDeploy(n){return s("POST",`/deploys/${n}/lock`)},async unlockDeploy(n){return s("POST",`/deploys/${n}/unlock`)}}}async function no(e){let t=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(t)).map((s)=>s.toString(16).padStart(2,"0")).join("")}async function Rn(e,t={}){let{ignore:i=["node_modules",".git",".env*","*.map"]}=t,s=[],n=new Bun.Glob("**/*");for await(let r of n.scan({cwd:e,onlyFiles:!0,dot:!1})){if(i.some((a)=>{if(a.includes("*"))return new RegExp(`^${a.replace(/\*/g,".*")}$`).test(r);return r.includes(a)}))continue;let p=`${e}/${r}`,u=await Bun.file(p).arrayBuffer(),o=await no(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function kr(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function Cr(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function Mt(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;if(e<1073741824)return`${(e/1048576).toFixed(1)} MB`;return`${(e/1073741824).toFixed(1)} GB`}function pt(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function ro(e){let t=[];if(t.push("[build]"),t.push(` command = "${d(e.build.command)}"`),t.push(` publish = "${d(e.build.publish)}"`),e.build.functions)t.push(` functions = "${d(e.build.functions)}"`);if(e.build.edge_functions)t.push(` edge_functions = "${d(e.build.edge_functions)}"`);if(e.build.environment&&Object.keys(e.build.environment).length>0){t.push(""),t.push("[build.environment]");for(let[i,s]of Object.entries(e.build.environment))t.push(` ${i} = "${d(s)}"`)}if(e.functions){if(t.push(""),t.push("[functions]"),e.functions.directory)t.push(` directory = "${d(e.functions.directory)}"`);if(e.functions.node_bundler)t.push(` node_bundler = "${e.functions.node_bundler}"`);if(e.functions.external_node_modules&&e.functions.external_node_modules.length>0)t.push(` external_node_modules = [${e.functions.external_node_modules.map((i)=>`"${i}"`).join(", ")}]`)}if(e.edge_functions&&e.edge_functions.length>0){t.push("");for(let i of e.edge_functions)t.push("[[edge_functions]]"),t.push(` function = "${d(i.function)}"`),t.push(` path = "${d(i.path)}"`)}if(e.redirects&&e.redirects.length>0){t.push("");for(let i of e.redirects){if(t.push("[[redirects]]"),t.push(` from = "${d(i.from)}"`),t.push(` to = "${d(i.to)}"`),i.status!==void 0)t.push(` status = ${i.status}`);if(i.force!==void 0)t.push(` force = ${i.force}`);if(i.conditions&&Object.keys(i.conditions).length>0){t.push(" [redirects.conditions]");for(let[s,n]of Object.entries(i.conditions))t.push(` ${s} = "${d(n)}"`)}}}if(e.headers&&e.headers.length>0){t.push("");for(let i of e.headers){t.push("[[headers]]"),t.push(` for = "${d(i.for)}"`),t.push(" [headers.values]");for(let[s,n]of Object.entries(i.values))t.push(` ${s} = "${d(n)}"`)}}if(e.plugins&&e.plugins.length>0){t.push("");for(let i of e.plugins)if(t.push("[[plugins]]"),t.push(` package = "${d(i.package)}"`),i.inputs&&Object.keys(i.inputs).length>0){t.push(" [plugins.inputs]");for(let[s,n]of Object.entries(i.inputs))if(typeof n==="string")t.push(` ${s} = "${d(n)}"`);else if(typeof n==="boolean"||typeof n==="number")t.push(` ${s} = ${n}`)}}if(e.context&&Object.keys(e.context).length>0)for(let[i,s]of Object.entries(e.context)){if(t.push(""),t.push(`[context.${i}]`),s.command)t.push(` command = "${d(s.command)}"`);if(s.publish)t.push(` publish = "${d(s.publish)}"`);if(s.environment&&Object.keys(s.environment).length>0){t.push(` [context.${i}.environment]`);for(let[n,r]of Object.entries(s.environment))t.push(` ${n} = "${d(r)}"`)}}return t.join(`
3
3
  `)+`
4
- `}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function An(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Pn(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function _r(e,t){let i=await An(e),s=t||Pn(i),n=ro(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function Er(e){return m.existsSync(y.join(e,"netlify.toml"))}async function ol(e={}){let t=Date.now(),i=[],s=e.cwd||process.cwd(),n=(c)=>{i.push(c)},r=(c)=>{if(e.onProgress)e.onProgress(c)},l=_.resolve(s,e.directory||"dist"),p=e.token||process.env.NETLIFY_AUTH_TOKEN,f=e.siteId||process.env.NETLIFY_SITE_ID;if(!p)throw new Ae(`No Netlify auth token found.
4
+ `}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function An(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Pn(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function _r(e,t){let i=await An(e),s=t||Pn(i),n=ro(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function Er(e){return m.existsSync(y.join(e,"netlify.toml"))}async function sl(e={}){let t=Date.now(),i=[],s=e.cwd||process.cwd(),n=(c)=>{i.push(c)},r=(c)=>{if(e.onProgress)e.onProgress(c)},l=_.resolve(s,e.directory||"dist"),p=e.token||process.env.NETLIFY_AUTH_TOKEN,f=e.siteId||process.env.NETLIFY_SITE_ID;if(!p)throw new Ae(`No Netlify auth token found.
5
5
 
6
6
  To deploy to Netlify:
7
7
  1. Create account at https://app.netlify.com
@@ -21,10 +21,10 @@ Run \`stx build\` first or specify a different directory with --directory`,"NO_B
21
21
 
22
22
  Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await Rn(l),w=pt(c);return n(`Would deploy ${c.length} files (${Mt(w)})`),n(`From: ${l}`),n(`To: Site ${f}`),n(`Mode: ${e.production?"production":"draft"}`),{success:!0,url:`https://${f}.netlify.app (dry-run)`,deployId:"dry-run",logs:i,duration:Date.now()-t,filesUploaded:c.length,totalSize:w}}let o=Sr({token:p});r({stage:"collect",message:"Verifying site..."});try{let c=await o.getSite(f);n(`Deploying to: ${c.name} (${c.url})`)}catch(c){if(c.status===404)throw new Ae(`Site not found: ${f}
23
23
 
24
- Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await Rn(l),g=pt(a);if(n(`Found ${a.length} files (${Mt(g)})`),a.length===0)throw new Ae(`No files found in ${l}`,"NO_FILES");let b=kr(a);r({stage:"upload",message:"Creating deploy...",percent:0});let D=await o.createDeploy(f,{title:e.message||"Deploy from stx CLI",draft:!e.production,files:b});n(`Created deploy: ${D.id}`);let h=Cr(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=pt(h);for(let x of h){await o.uploadFile(D.id,x.path,x.content),c++;let C=Math.round(c/h.length*100);r({stage:"upload",message:`Uploading: ${x.path}`,percent:C,details:{uploaded:c,total:h.length}})}n(`Uploaded ${Mt(w)}`)}else n("All files already on CDN (no upload needed)");r({stage:"process",message:"Processing deploy..."});let N=await o.waitForDeploy(D.id,{onProgress:(c)=>{r({stage:"process",message:`Status: ${c.state}`,details:c})}}),P=Date.now()-t;if(r({stage:"done",message:"Deploy complete!"}),n(`Deploy complete in ${(P/1000).toFixed(1)}s`),n(`URL: ${N.deploy_ssl_url}`),e.production)n(`Site: ${N.ssl_url}`);if(e.open){let c=e.production?N.ssl_url:N.deploy_ssl_url;I(c)}return{success:!0,url:N.deploy_ssl_url,siteUrl:e.production?N.ssl_url:void 0,deployId:N.id,logs:i,duration:P,filesUploaded:h.length,totalSize:pt(h)}}async function il(e={}){let t=e.directory||process.cwd(),i;if(Er(t))i=_.join(t,"netlify.toml");else{let s=await An(t);i=await _r(t,Pn(s))}if(e.siteId){let s=_.join(t,".env.local"),n="";if(await Bun.file(s).exists()){if(n=await Bun.file(s).text(),n=n.split(`
24
+ Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await Rn(l),g=pt(a);if(n(`Found ${a.length} files (${Mt(g)})`),a.length===0)throw new Ae(`No files found in ${l}`,"NO_FILES");let b=kr(a);r({stage:"upload",message:"Creating deploy...",percent:0});let D=await o.createDeploy(f,{title:e.message||"Deploy from stx CLI",draft:!e.production,files:b});n(`Created deploy: ${D.id}`);let h=Cr(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=pt(h);for(let x of h){await o.uploadFile(D.id,x.path,x.content),c++;let C=Math.round(c/h.length*100);r({stage:"upload",message:`Uploading: ${x.path}`,percent:C,details:{uploaded:c,total:h.length}})}n(`Uploaded ${Mt(w)}`)}else n("All files already on CDN (no upload needed)");r({stage:"process",message:"Processing deploy..."});let N=await o.waitForDeploy(D.id,{onProgress:(c)=>{r({stage:"process",message:`Status: ${c.state}`,details:c})}}),P=Date.now()-t;if(r({stage:"done",message:"Deploy complete!"}),n(`Deploy complete in ${(P/1000).toFixed(1)}s`),n(`URL: ${N.deploy_ssl_url}`),e.production)n(`Site: ${N.ssl_url}`);if(e.open){let c=e.production?N.ssl_url:N.deploy_ssl_url;I(c)}return{success:!0,url:N.deploy_ssl_url,siteUrl:e.production?N.ssl_url:void 0,deployId:N.id,logs:i,duration:P,filesUploaded:h.length,totalSize:pt(h)}}async function ol(e={}){let t=e.directory||process.cwd(),i;if(Er(t))i=_.join(t,"netlify.toml");else{let s=await An(t);i=await _r(t,Pn(s))}if(e.siteId){let s=_.join(t,".env.local"),n="";if(await Bun.file(s).exists()){if(n=await Bun.file(s).text(),n=n.split(`
25
25
  `).filter((r)=>!r.startsWith("NETLIFY_SITE_ID=")).join(`
26
26
  `),n&&!n.endsWith(`
27
27
  `))n+=`
28
28
  `}n+=`NETLIFY_SITE_ID=${e.siteId}
29
29
  `,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class Ae extends Error{code;constructor(e,t){super(e);this.name="DeployError",this.code=t}}function I(e){let t=process.platform,i=t==="darwin"?"open":t==="win32"?"start":"xdg-open";Bun.spawn([i,e],{stdio:["ignore","ignore","ignore"]})}
30
- export{Sr,no,Rn,kr,Cr,Mt,pt,ro,An,Pn,_r,Er,ol,il,Ae};
30
+ export{Sr,no,Rn,kr,Cr,Mt,pt,ro,An,Pn,_r,Er,sl,ol,Ae};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Rs,As,Ps,Is,nr,rr,su,ou,iu,au,sr,cu}from"./chunk-g84ctpqq.js";import"./chunk-cngtf95k.js";import"./chunk-a5kaw8sc.js";export{cu as generateDefaultRobotsTxt,sr as generateRobotsTxt,ou as generateSitemap,iu as generateSitemapIndex,Is as injectSeoTags,nr as metaDirective,Rs as processMetaDirectives,Ps as processSeoDirective,As as processStructuredData,su as registerSeoDirectives,au as scanForSitemapEntries,rr as structuredDataDirective};
2
+ import{Rs,As,Ps,Is,nr,rr,su,ou,iu,au,sr,cu}from"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";export{cu as generateDefaultRobotsTxt,sr as generateRobotsTxt,ou as generateSitemap,iu as generateSitemapIndex,Is as injectSeoTags,nr as metaDirective,Rs as processMetaDirectives,Ps as processSeoDirective,As as processStructuredData,su as registerSeoDirectives,au as scanForSitemapEntries,rr as structuredDataDirective};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{y}from"./chunk-r4199q6x.js";import{I,It}from"./chunk-6v1gwdbv.js";import{w,We,L,o}from"./chunk-qrqw667n.js";import{ae,wt,vt}from"./chunk-w5nw5cj6.js";import{Oe,Kt,gt,H}from"./chunk-mjdyyekx.js";import f from"path";var l=new Map;function v(a,s){for(let n of a.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(n[1])s.add(n[1]);for(let n of a.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let r of(n[1]??"").split(",")){let i=((r.includes(":")?r.split(":").pop():r)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(i))s.add(i)}for(let n of a.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let r of(n[1]??"").split(",")){let c=r.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(c))s.add(c)}}async function ad(a){let s;if(a)s=f.resolve(a);else{let t=await o();s=f.resolve(t.root||process.cwd(),t.storesDir||"stores")}let n=new Bun.Glob("*.ts"),r=[];try{for await(let t of n.scan({cwd:s,absolute:!0})){let e=f.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return H(l,s,"",""),null}let c=()=>[...new Set([...r,...r.flatMap((t)=>ae(t))])],i=Oe(c()),d=gt(l,s,i);if(d!==void 0)return d||null;if(r.length===0)return H(l,s,i,""),null;let p=[];for(let t of r){let e=await Bun.file(t).text();p.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}p.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let h=p.map((t)=>t.file),u=[],m=new Set,b=L({loader:"ts",target:"browser",define:w()});for(let t of h)try{let e=await Bun.file(t).text(),x=f.basename(t,".ts");if(v(e,m),wt(e))e=await vt(e,t,{projectRoot:process.cwd(),externalizeUserModules:!1});e=We(e),e=I(e),e=It(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=b.transformSync(e),u.push(`// Store: ${x}
2
+ import{y}from"./chunk-r4199q6x.js";import{I,It}from"./chunk-6v1gwdbv.js";import{w,We,L,o}from"./chunk-k6tnvpje.js";import{ae,wt,vt}from"./chunk-9dgd1p9a.js";import{Oe,Kt,gt,H}from"./chunk-mjdyyekx.js";import f from"path";var l=new Map;function v(a,s){for(let n of a.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(n[1])s.add(n[1]);for(let n of a.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let r of(n[1]??"").split(",")){let i=((r.includes(":")?r.split(":").pop():r)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(i))s.add(i)}for(let n of a.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let r of(n[1]??"").split(",")){let c=r.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(c))s.add(c)}}async function id(a){let s;if(a)s=f.resolve(a);else{let t=await o();s=f.resolve(t.root||process.cwd(),t.storesDir||"stores")}let n=new Bun.Glob("*.ts"),r=[];try{for await(let t of n.scan({cwd:s,absolute:!0})){let e=f.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return H(l,s,"",""),null}let c=()=>[...new Set([...r,...r.flatMap((t)=>ae(t))])],i=Oe(c()),d=gt(l,s,i);if(d!==void 0)return d||null;if(r.length===0)return H(l,s,i,""),null;let p=[];for(let t of r){let e=await Bun.file(t).text();p.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}p.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let h=p.map((t)=>t.file),u=[],m=new Set,b=L({loader:"ts",target:"browser",define:w()});for(let t of h)try{let e=await Bun.file(t).text(),x=f.basename(t,".ts");if(v(e,m),wt(e))e=await vt(e,t,{projectRoot:process.cwd(),externalizeUserModules:!1});e=We(e),e=I(e),e=It(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=b.transformSync(e),u.push(`// Store: ${x}
3
3
  ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(u.length===0)return H(l,s,i,""),null;let g=u.join(`
4
4
 
5
5
  `),S=`;(function(){
@@ -7,5 +7,5 @@ var __stx = window.stx || {};
7
7
  ${y.filter((t)=>!m.has(t)&&new RegExp(`\\b${t}\\b`).test(g)).map((t)=>`var ${t} = __stx[${JSON.stringify(t)}];`).join(`
8
8
  `)}
9
9
  ${g}
10
- })();`;return i=Oe(c()),H(l,s,i,S),S}function cd(){l.clear(),Kt()}
11
- export{ad,cd};
10
+ })();`;return i=Oe(c()),H(l,s,i,S),S}function ad(){l.clear(),Kt()}
11
+ export{id,ad};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zn,sc,Dd,oc,Md,ic,Hn,b,Ct,be,ac,rs,cc,Nd,G,lc,Ld,x,jd}from"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{lc as applyFilters,Md as clearCustomFilters,ac as clientLoopScopes,zn as defaultFilters,b as escapeHtml,Ct as escapeHtmlValue,x as evaluateExpression,ic as findMustacheEnd,oc as getAllFilters,cc as interpolateScriptAttributes,rs as interpolateScriptExpressions,Nd as interpolateScriptsInTemplate,G as processExpressions,sc as registerFilter,Dd as registerFilters,Hn as replaceInterpolations,Ld as resetRejectedExpressionWarnings,jd as unescapeHtml,be as usesSignalsInScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fn,Le,Be,ye,ei,Wn,Q,K,ln,d,n,R}from"./chunk-qrqw667n.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);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:r,content:m}=Fn(o),c=await(e.renderer??((s)=>Le(s)))(m);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Q(o);if(r)e=r.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 M(o,e){return`<!DOCTYPE html>
2
+ import{Fn,Le,Be,ye,ei,Wn,Q,K,ln,d,n,R}from"./chunk-k6tnvpje.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);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:r,content:m}=Fn(o),c=await(e.renderer??((s)=>Le(s)))(m);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Q(o);if(r)e=r.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 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=Be(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
15
  `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
16
16
  $1`);else t+=`
17
- ${g}`}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-12dkj7xn.js");t=await i(t)}catch{}return t}
17
+ ${g}`}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-4265g93g.js");t=await i(t)}catch{}return t}
18
18
  export{Do};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ko,La,Gt,Ll,ja,Ba,Fa,jl}from"./chunk-7gdvp6py.js";export{Gt as Validator,La as defineForm,ja as processErrorDirective,Ba as processErrorsDirective,jl as processFormValidationDirectives,Fa as processHasErrorsDirective,ko as useForm,Ll as v};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qd,Zo,Gd,Qo,fc,gc,_t,an,Kd,mc,hc,Xd,f}from"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{_t as buildCss,mc as extractClassNames,gc as fingerprintConfig,hc as generateCss,Kd as getCachedCSS,qd as getCssServeAsset,f as injectCss,Zo as loadCssEngine,Qo as loadCssEngineConfig,an as rebuildCss,Gd as resetCssCache,fc as resolveUserCssConfig,Xd as withLinkedModuleBundles};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ss,os,is,Jd,qn,Yd}from"./chunk-qrqw667n.js";export{qn as clearImageDeliveryCatalog,Jd as deliveredImage,is as efficientDeliverySources,ss as getImageDelivery,os as isTransparentImage,Yd as prepareImageDelivery};
2
+ import{ss,os,is,Jd,qn,Yd}from"./chunk-k6tnvpje.js";export{qn as clearImageDeliveryCatalog,Jd as deliveredImage,is as efficientDeliverySources,ss as getImageDelivery,os as isTransparentImage,Yd as prepareImageDelivery};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{pl,fl,gl,ml,la,hl,yl,bl,wl,vl,xl,Sl}from"./chunk-yp00nht2.js";export{xl as Broadcast,Sl as BroadcastServer,la as broadcast,wl as broadcastPresence,bl as broadcastPrivate,vl as channel,pl as getBroadcastServer,ml as loadChannels,fl as startBroadcasting,gl as stopBroadcasting,hl as toUser,yl as toUsers};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{pa,_l,fa,ga,El,Tl}from"./chunk-5yc38gvt.js";import"./chunk-k6tnvpje.js";import"./chunk-x8rx0s3h.js";import"./chunk-mtdx75j5.js";import"./chunk-ff61d2wr.js";import"./chunk-1ycy7mqy.js";import"./chunk-e124cgb6.js";import"./chunk-pp9jgyb6.js";import"./chunk-g6cwhsb4.js";import"./chunk-a5kaw8sc.js";import"./chunk-6v1gwdbv.js";import"./chunk-r4199q6x.js";import"./chunk-h23bjqn1.js";import"./chunk-1xgs9gd5.js";export{Tl as applySlots,El as extractSlotContent,_l as parseSlotElement,pa as parseSlots,ga as processSlots,fa as renderSlot};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{p,c}from"./chunk-a5kaw8sc.js";import{b}from"./chunk-qrqw667n.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(u);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:l,element:m}),e=s;else o.push({start:n,end:h,slotName:l,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let l=t.toLowerCase().indexOf(`</${u}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let m=y(t,s);if(m!==-1){let h=l[1]||l[2]||l[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:l[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function pa(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function El(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function fa(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((l)=>l.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return c(t,Object.keys(o))(...Object.values(o))}catch{return}}async function ga(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",l=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(l))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await fa(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function Tl(t){let o=pa(t);return{defaultSlot:o.default,namedSlots:o.named}}async function $l(t,o,i,r){return await ga(t,{default:o,named:i},r)}
3
- export{pa,El,fa,ga,Tl,$l};
2
+ import{p,c}from"./chunk-a5kaw8sc.js";import{b}from"./chunk-k6tnvpje.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(u);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:l,element:m}),e=s;else o.push({start:n,end:h,slotName:l,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let l=t.toLowerCase().indexOf(`</${u}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let m=y(t,s);if(m!==-1){let h=l[1]||l[2]||l[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:l[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function pa(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function _l(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function fa(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((l)=>l.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return c(t,Object.keys(o))(...Object.values(o))}catch{return}}async function ga(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",l=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(l))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await fa(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function El(t){let o=pa(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Tl(t,o,i,r){return await ga(t,{default:o,named:i},r)}
3
+ export{pa,_l,fa,ga,El,Tl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{De,Xt,cd}from"./chunk-p2mxsjv1.js";import{U,Mn,Jt,zr,Hr,Nn,ld,dd,ud,Yt,Zt,Ur,Ln,pd}from"./chunk-w8q1xp9e.js";import"./chunk-r4199q6x.js";export{zr as batch,cd as default,Mn as derived,Jt as effect,De as generateSignalsRuntime,Xt as generateSignalsRuntimeDev,Zt as isDerived,Yt as isSignal,Nn as onDestroy,Hr as onMount,Ln as peek,ud as pendingLifecycleCounts,dd as runDestroyCallbacks,ld as runMountCallbacks,U as state,Ur as untrack,pd as useOptimistic};