@stacksjs/stx 0.2.882 → 0.2.883

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 (80) hide show
  1. package/dist/{chunk-75yst7df.js → chunk-0f6k5r31.js} +3 -3
  2. package/dist/chunk-0fmrrsbp.js +2 -0
  3. package/dist/{chunk-65899mj8.js → chunk-0rc5tg89.js} +1 -1
  4. package/dist/{chunk-8vb1m3t3.js → chunk-1r1kfskk.js} +1 -1
  5. package/dist/{chunk-h0nsb8b0.js → chunk-21tx0mbz.js} +1 -1
  6. package/dist/{chunk-v65efeh1.js → chunk-24f59184.js} +1 -1
  7. package/dist/{chunk-yfphz58r.js → chunk-26yzqev3.js} +5 -5
  8. package/dist/{chunk-nmz9j39s.js → chunk-29btwpda.js} +2 -2
  9. package/dist/chunk-2d170z61.js +2 -0
  10. package/dist/{chunk-3869n9nd.js → chunk-32z3g0y1.js} +1 -1
  11. package/dist/{chunk-a81bwn7b.js → chunk-3ahqdb2n.js} +1 -1
  12. package/dist/{chunk-nghybhas.js → chunk-3mepf96h.js} +1 -1
  13. package/dist/{chunk-n163nwke.js → chunk-6dq3qdg2.js} +1 -1
  14. package/dist/{chunk-mhdkk9a4.js → chunk-7hf1xyrb.js} +1 -1
  15. package/dist/{chunk-kx4svden.js → chunk-7psdag9t.js} +1 -1
  16. package/dist/{chunk-kjz7g83q.js → chunk-8a09r8xy.js} +4 -4
  17. package/dist/{chunk-zen0ef4k.js → chunk-8cnavhtr.js} +1 -1
  18. package/dist/{chunk-47bsv8xy.js → chunk-8hc7mec0.js} +1 -1
  19. package/dist/{chunk-4adb8bmp.js → chunk-90zpw7zw.js} +1 -1
  20. package/dist/{chunk-e9hm254p.js → chunk-99956f90.js} +4 -4
  21. package/dist/{chunk-cn2bgt0w.js → chunk-9y2n8wm6.js} +1 -1
  22. package/dist/chunk-a6cwm61q.js +2 -0
  23. package/dist/chunk-a6mjqetx.js +2 -0
  24. package/dist/{chunk-22mdphq2.js → chunk-an4vtgem.js} +2 -2
  25. package/dist/{chunk-0k7khseq.js → chunk-av1acvah.js} +2 -2
  26. package/dist/chunk-awywwbc5.js +3 -0
  27. package/dist/{chunk-s9xavhdb.js → chunk-cb2gzs3m.js} +9 -9
  28. package/dist/{chunk-93fvjs6g.js → chunk-ckb8yk6a.js} +1 -1
  29. package/dist/{chunk-99spzsmw.js → chunk-dzpm2n8g.js} +1 -1
  30. package/dist/{chunk-4hfsbdqa.js → chunk-e5kygw75.js} +1 -1
  31. package/dist/chunk-fb5vv2q5.js +2 -0
  32. package/dist/{chunk-cekzqze8.js → chunk-fk45k15v.js} +1 -1
  33. package/dist/{chunk-6vr0yfbt.js → chunk-gc65patn.js} +1 -1
  34. package/dist/{chunk-e44br2vs.js → chunk-gw6v6n8y.js} +2 -2
  35. package/dist/{chunk-7z94thkd.js → chunk-hnnargm3.js} +1 -1
  36. package/dist/{chunk-qxthb2a1.js → chunk-htrptrn9.js} +1 -1
  37. package/dist/{chunk-8s365b62.js → chunk-jr61mjwn.js} +1 -1
  38. package/dist/{chunk-radvtjwt.js → chunk-kyb5nyt8.js} +2 -2
  39. package/dist/{chunk-v99zjh93.js → chunk-myfsnf67.js} +1 -1
  40. package/dist/chunk-pnw1n18p.js +2 -0
  41. package/dist/{chunk-qpybh7ss.js → chunk-ptg2karz.js} +4 -4
  42. package/dist/{chunk-bgddx531.js → chunk-r04j085h.js} +1 -1
  43. package/dist/chunk-rf5tatrc.js +2 -0
  44. package/dist/{chunk-a852vdv3.js → chunk-rk98082b.js} +1 -1
  45. package/dist/{chunk-30z4s1n3.js → chunk-rxm46f9z.js} +2 -2
  46. package/dist/{chunk-9zqggj7t.js → chunk-se53e743.js} +1 -1
  47. package/dist/{chunk-d0c5q7b7.js → chunk-sqjv4kxc.js} +1 -1
  48. package/dist/{chunk-678nhepd.js → chunk-tct0jrp1.js} +1 -1
  49. package/dist/{chunk-j58b7xen.js → chunk-tzmqvsmf.js} +1 -1
  50. package/dist/{chunk-j7bkrvey.js → chunk-vsraamv3.js} +1 -1
  51. package/dist/{chunk-rn2kk4r8.js → chunk-vz6dtfe9.js} +1 -1
  52. package/dist/{chunk-kzagptvq.js → chunk-w2p9mhef.js} +1 -1
  53. package/dist/{chunk-vtgqgx8t.js → chunk-w7476ea6.js} +1 -1
  54. package/dist/{chunk-qjqvhke7.js → chunk-w9zs57z0.js} +1 -1
  55. package/dist/{chunk-5v93fj91.js → chunk-wxa1w308.js} +1 -1
  56. package/dist/{chunk-9zc1cnw8.js → chunk-x2a5phpm.js} +1 -1
  57. package/dist/{chunk-3jndqseh.js → chunk-x3py9q5v.js} +6 -6
  58. package/dist/{chunk-x5608pnk.js → chunk-x8s9487t.js} +1 -1
  59. package/dist/chunk-xncrk7dz.js +2 -0
  60. package/dist/{chunk-c3413bgh.js → chunk-xynq9fcr.js} +1 -1
  61. package/dist/{chunk-whmk0m8x.js → chunk-yaenczev.js} +4 -4
  62. package/dist/{chunk-93b6syb0.js → chunk-yc9bpftb.js} +1 -1
  63. package/dist/{chunk-pxemb9dg.js → chunk-ykzwrxpn.js} +1 -1
  64. package/dist/{chunk-5yga68j4.js → chunk-ytbed3rp.js} +1 -1
  65. package/dist/cli.js +7 -7
  66. package/dist/component-renderer.js +15 -2
  67. package/dist/craft-entry.js +1 -1
  68. package/dist/craft.js +1 -1
  69. package/dist/pwa.js +1 -1
  70. package/dist/ssg.js +2 -2
  71. package/package.json +5 -5
  72. package/dist/chunk-3abd3gw8.js +0 -2
  73. package/dist/chunk-5508z01x.js +0 -2
  74. package/dist/chunk-cn6dqyfh.js +0 -2
  75. package/dist/chunk-ddws4zp2.js +0 -3
  76. package/dist/chunk-ktk4eg8c.js +0 -2
  77. package/dist/chunk-sb93fb2w.js +0 -2
  78. package/dist/chunk-twewtvyt.js +0 -2
  79. package/dist/chunk-x7asbgvc.js +0 -2
  80. package/dist/chunk-xc6w4x0w.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{d,m,N,p,ee}from"./chunk-295bykzd.js";import{T}from"./chunk-s29hp1qw.js";import{G,Ws,Ue,j,Ht,Dr,Ge,Xe,s,y,Oe,P}from"./chunk-3jndqseh.js";import{wt}from"./chunk-00tq7ghn.js";import{M}from"./chunk-hxhmhw23.js";import{fe}from"./chunk-d2pexm3z.js";import{U,ct}from"./chunk-care745q.js";import{I,Ln}from"./chunk-ws2h92mm.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let b=c[r];if(b==="("||b==="["||b==="{")a++;else if(b===")"||b==="]"||b==="}")a--;else if(b===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,b=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=b.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,W=t+1;while(W<r.length&&C>0){if(r[W]==="(")C++;else if(r[W]===")")C--;W++}if(C!==0)break;let ie=r.substring(t+1,W-1),B=`${a}(${ie})`;r=r.substring(0,u)+B+r.substring(W),b.lastIndex=u+B.length,n=b.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,b=0,n=0,u=e.length,t=(B)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===B){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let B=1;while(n<u&&B>0)if(e[n]==="{")B++,n++;else if(e[n]==="}")B--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},W=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
2
+ import{d,m,N,p,ee}from"./chunk-295bykzd.js";import{T}from"./chunk-s29hp1qw.js";import{G,Ws,Ue,j,Ht,Dr,Ge,Xe,s,y,Oe,P}from"./chunk-x3py9q5v.js";import{wt}from"./chunk-00tq7ghn.js";import{M}from"./chunk-hxhmhw23.js";import{fe}from"./chunk-d2pexm3z.js";import{U,ct}from"./chunk-care745q.js";import{I,Ln}from"./chunk-ws2h92mm.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let b=c[r];if(b==="("||b==="["||b==="{")a++;else if(b===")"||b==="]"||b==="}")a--;else if(b===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,b=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=b.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,W=t+1;while(W<r.length&&C>0){if(r[W]==="(")C++;else if(r[W]===")")C--;W++}if(C!==0)break;let ie=r.substring(t+1,W-1),B=`${a}(${ie})`;r=r.substring(0,u)+B+r.substring(W),b.lastIndex=u+B.length,n=b.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,b=0,n=0,u=e.length,t=(B)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===B){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let B=1;while(n<u&&B>0)if(e[n]==="{")B++,n++;else if(e[n]==="}")B--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},W=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
3
3
  `)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(b!==0)return;let B=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(B){let H=B[2];if(!r.has(H))a.push(H),r.add(H);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let H=se[1];if(!r.has(H))a.push(H),r.add(H);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let H=Y[1];if(!r.has(H))a.push(H),r.add(H)}};while(n<u){if(W())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){C();continue}if(e[n]==="{"){b++,n++;continue}if(e[n]==="}"){b--,n++;continue}if(b===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
4
4
  (function() {
5
5
  ${wt("var",a)}
@@ -44,10 +44,10 @@ ${n}
44
44
  }
45
45
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
46
46
  }
47
- })();`;return a+c+r}function Me(c,e){if(U(c)){let n=U(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ct(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Ht(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],W=r[2];return{html:`${t}${C} data-stx-scope="${e}"${W}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Te=0;function ue(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Te}`}var le=new Set,pe=new Set;function sy(){le.clear(),pe.clear()}var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ag(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],W=u[3]==="/"||Ae.has(C.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(C);if(!W)b++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var at=new T(500),Ac=new Set;function oy(){Ac.clear()}function Ce(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Ac}async function xs(c,e,a,r,b,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=Ce(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let D=o[1],z=W(D,u,a),E="";if(z&&await Bun.file(z).exists())b.add(z),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let D=t.substring(x+1,o-1),z=ae(D,0);if(z===-1){h.lastIndex=o;continue}let E=D.substring(0,z).trim(),V=D.substring(z+1).trim(),F=V.match(/^\s*['"]([^'"]+)['"]/);if(!F){h.lastIndex=o;continue}let _=F[1],q=V.substring(F[0].length),O,R=ae(q,0);if(R!==-1)O=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let te=v?!L:L,re="";if(te){let oe=W(_,u,a);if(oe&&await Bun.file(oe).exists())b.add(oe);re=`@include('${_}'${O?`, ${O}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),te=y("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+te+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),D=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!D){f.lastIndex=0,t=t.replace(o,"");continue}let[,z,E,V,F]=D;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let O="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(z,k,c,h);O+=L}else if(F)O=await se(F,{},c,h);t=t.substring(0,h)+O+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),D=l.match(/^\s*(\[[^\]]+\])/);if(!D){f.lastIndex=0,t=t.replace(o,"");continue}let z=D[1],E=l.slice(D[0].length),V,F=E.match(/^\s*,\s*\{/);if(F){E=E.slice(F[0].length-1);let O=1,R=1;while(R<E.length&&O>0){if(E[R]==="{")O++;else if(E[R]==="}"){if(O--,O===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let O=JSON.parse(z.replace(/'/g,'"')),R={};if(V)try{R=N(V,e)}catch(L){let te=L instanceof Error?L.message:String(L);if(r.debug){let re=y("Include",`Error parsing includeFirst variables: ${te}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of O){let te=W(L,u,a);if(!te)continue;if(await s(te)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=y("Include",`None of the includeFirst paths exist: ${z}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(O){let R=O instanceof Error?O.message:String(O),k=y("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function W(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let F of r._layerPartialDirs??[]){let _=A.resolve(F,g);if(_.startsWith(`${A.resolve(F)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),D=o.startsWith(i+A.sep)||o===i,z=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((O)=>O.startsWith(".")&&O!=="."&&O!==".."))E=!0}if(!D&&!z&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function se(f,v={},h,g){let i=W(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let K=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-3abd3gw8.js");l=S(l,e)}if(l&&(r.debug||!I()&&!Ln()))try{let{warnUnbalancedTags:S}=await import("./chunk-w5zzwe2f.js");S(l,i)}catch{}try{let{processESImports:S}=await import("./chunk-nghybhas.js");l=await S(l,e,i,r,b)}catch(S){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,S instanceof Error?S.message:S)}let o=l,D=j(o);if(D)o=D.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(S,K,w)=>{if(!me(K))return"";return F.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Oe(l,i);for(let[S,K]of Object.entries(v))_[S]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,O=[...l.matchAll(q)].sort((S,K)=>{let w=(S[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,te=!1;for(let S of O){let K=S[1]||"",w=S[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ge(K);if(!X&&!/\bsrc\s*=/i.test(K))Ue(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-j58b7xen.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-pxemb9dg.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Xe(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-pxemb9dg.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-9zc1cnw8.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-678nhepd.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-pxemb9dg.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
47
+ })();`;return a+c+r}function Me(c,e){if(U(c)){let n=U(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ct(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Ht(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],W=r[2];return{html:`${t}${C} data-stx-scope="${e}"${W}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Te=0;function ue(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Te}`}var le=new Set,pe=new Set;function sy(){le.clear(),pe.clear()}var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ag(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],W=u[3]==="/"||Ae.has(C.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(C);if(!W)b++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var at=new T(500),Ac=new Set;function oy(){Ac.clear()}function Ce(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Ac}async function xs(c,e,a,r,b,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=Ce(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let D=o[1],z=W(D,u,a),E="";if(z&&await Bun.file(z).exists())b.add(z),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let D=t.substring(x+1,o-1),z=ae(D,0);if(z===-1){h.lastIndex=o;continue}let E=D.substring(0,z).trim(),V=D.substring(z+1).trim(),F=V.match(/^\s*['"]([^'"]+)['"]/);if(!F){h.lastIndex=o;continue}let _=F[1],q=V.substring(F[0].length),O,R=ae(q,0);if(R!==-1)O=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let te=v?!L:L,re="";if(te){let oe=W(_,u,a);if(oe&&await Bun.file(oe).exists())b.add(oe);re=`@include('${_}'${O?`, ${O}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),te=y("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+te+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),D=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!D){f.lastIndex=0,t=t.replace(o,"");continue}let[,z,E,V,F]=D;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let O="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(z,k,c,h);O+=L}else if(F)O=await se(F,{},c,h);t=t.substring(0,h)+O+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),D=l.match(/^\s*(\[[^\]]+\])/);if(!D){f.lastIndex=0,t=t.replace(o,"");continue}let z=D[1],E=l.slice(D[0].length),V,F=E.match(/^\s*,\s*\{/);if(F){E=E.slice(F[0].length-1);let O=1,R=1;while(R<E.length&&O>0){if(E[R]==="{")O++;else if(E[R]==="}"){if(O--,O===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let O=JSON.parse(z.replace(/'/g,'"')),R={};if(V)try{R=N(V,e)}catch(L){let te=L instanceof Error?L.message:String(L);if(r.debug){let re=y("Include",`Error parsing includeFirst variables: ${te}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of O){let te=W(L,u,a);if(!te)continue;if(await s(te)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=y("Include",`None of the includeFirst paths exist: ${z}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(O){let R=O instanceof Error?O.message:String(O),k=y("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function W(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let F of r._layerPartialDirs??[]){let _=A.resolve(F,g);if(_.startsWith(`${A.resolve(F)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),D=o.startsWith(i+A.sep)||o===i,z=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((O)=>O.startsWith(".")&&O!=="."&&O!==".."))E=!0}if(!D&&!z&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function se(f,v={},h,g){let i=W(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let K=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-2d170z61.js");l=S(l,e)}if(l&&(r.debug||!I()&&!Ln()))try{let{warnUnbalancedTags:S}=await import("./chunk-w5zzwe2f.js");S(l,i)}catch{}try{let{processESImports:S}=await import("./chunk-3mepf96h.js");l=await S(l,e,i,r,b)}catch(S){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,S instanceof Error?S.message:S)}let o=l,D=j(o);if(D)o=D.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(S,K,w)=>{if(!me(K))return"";return F.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Oe(l,i);for(let[S,K]of Object.entries(v))_[S]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,O=[...l.matchAll(q)].sort((S,K)=>{let w=(S[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,te=!1;for(let S of O){let K=S[1]||"",w=S[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ge(K);if(!X&&!/\bsrc\s*=/i.test(K))Ue(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-tzmqvsmf.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-ykzwrxpn.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Xe(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-ykzwrxpn.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-x2a5phpm.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-tct0jrp1.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-ykzwrxpn.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
48
48
  ${w}`}if(de&&!X){L=!0,k=ue(i,e);let Z=M(w),Q=ge(Z,k);R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}">${Q}</script>
49
- `;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-v65efeh1.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=ue(i,e);let Q=M(w),ne=ge(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))te=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
- `}}if(F.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-j58b7xen.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=F[Number(w)];return`<script${X.attrs}>${S(X.body,_,f)}</script>`})}if(k){let S=Me(o,k);if(o=S.html,S.mergedIntoExisting){let w=k,X=S.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!S.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(S.stamped&&S.root!=="body"&&(L||te)&&!pe.has(i)){let w=ag(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=S.stamped&&S.root!==null&&Dr(S.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await xs(o,_,i,r,b,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-zen0ef4k.js"),J=re(o,_,i,void 0,!0);J=fe(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-ywnqjqns.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
49
+ `;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-24f59184.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=ue(i,e);let Q=M(w),ne=ge(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))te=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
+ `}}if(F.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-tzmqvsmf.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=F[Number(w)];return`<script${X.attrs}>${S(X.body,_,f)}</script>`})}if(k){let S=Me(o,k);if(o=S.html,S.mergedIntoExisting){let w=k,X=S.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!S.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(S.stamped&&S.root!=="body"&&(L||te)&&!pe.has(i)){let w=ag(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=S.stamped&&S.root!==null&&Dr(S.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await xs(o,_,i,r,b,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-8cnavhtr.js"),J=re(o,_,i,void 0,!0);J=fe(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-ywnqjqns.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
51
51
  `+V;if(R)J+=`
52
52
  `+R;return J}catch(l){if(l instanceof ee)throw l;let o=l instanceof Error?l.message:String(l);return B(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],D,z=x.substring(l[0].length),E=ae(z,0);if(E!==-1)D=z.substring(E+1).trim();let V={};if(D)try{V=N(D,e)}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.replace(i,y("Include",`Error parsing include variables for ${o}: ${q}`,a,c,f)),Y.lastIndex=0;continue}let F=await se(o,V,c,f);t=t.substring(0,f)+F+t.substring(g),Y.lastIndex=0}return t}function Ss(c,e){let a=c;function r(b,n,u,t){let C=b,W=!0;while(W){W=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),B=C.match(ie);if(!B||B.index===void 0)break;let se=B.index,Y=B[1],H=se+B[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),D=l.match(v),z=o?g+o.index:1/0,E=D?g+D.index:1/0;if(z<E)h++,g=z+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),W=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function ks(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
53
53
  `)})}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Es,lg,si,ug}from"./chunk-a852vdv3.js";import"./chunk-d2pexm3z.js";import"./chunk-22mdphq2.js";import"./chunk-whmk0m8x.js";import"./chunk-cb0c6959.js";import"./chunk-0k7khseq.js";import"./chunk-qxthb2a1.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import{Vt}from"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{ug as declareBareLoopHead,Vt as parseLoopBinding,lg as processLoops,si as processLoopsAsync,Es as reportDeferredLoopWarnings};
2
+ import{Es,lg,si,ug}from"./chunk-rk98082b.js";import"./chunk-d2pexm3z.js";import"./chunk-an4vtgem.js";import"./chunk-yaenczev.js";import"./chunk-cb0c6959.js";import"./chunk-av1acvah.js";import"./chunk-htrptrn9.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import{Vt}from"./chunk-x3py9q5v.js";import"./chunk-xynq9fcr.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{ug as declareBareLoopHead,Vt as parseLoopBinding,lg as processLoops,si as processLoopsAsync,Es as reportDeferredLoopWarnings};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-00tq7ghn.js";import"./chunk-hxhmhw23.js";import"./chunk-s29hp1qw.js";import"./chunk-a60ztvnp.js";import{S,_,A,oe}from"./chunk-3jndqseh.js";import"./chunk-295bykzd.js";import"./chunk-6t04tqvh.js";import"./chunk-c3413bgh.js";import{br}from"./chunk-7mcs59pr.js";import{existsSync as C}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var u=new Map,h=S(64),w=new Set,v=0,E=new Set(b);function z(){u.clear(),h.clear()}function R(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function P(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function I(s){if(!s)return[];let o=_(s,v),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of E){if(w.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function M(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=br("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=I(s);if(t.length===0)return null;let i=o??M();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=oe({loader:"ts",target:"browser",define:A()}),k=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=R(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
2
+ import"./chunk-00tq7ghn.js";import"./chunk-hxhmhw23.js";import"./chunk-s29hp1qw.js";import"./chunk-a60ztvnp.js";import{S,_,A,oe}from"./chunk-x3py9q5v.js";import"./chunk-295bykzd.js";import"./chunk-6t04tqvh.js";import"./chunk-xynq9fcr.js";import{br}from"./chunk-7mcs59pr.js";import{existsSync as C}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var u=new Map,h=S(64),w=new Set,v=0,E=new Set(b);function z(){u.clear(),h.clear()}function R(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function P(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function I(s){if(!s)return[];let o=_(s,v),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of E){if(w.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function M(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=br("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=I(s);if(t.length===0)return null;let i=o??M();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=oe({loader:"ts",target:"browser",define:A()}),k=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=R(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
3
3
  ${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let x=t.filter((n)=>!d.has(n)&&!P(s,n));if(x.length>0)console.warn(`[stx] could not bundle ${x.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return u.set(r,""),null;let O=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
4
4
  `),y=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
5
  ;(function(){
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fg,dy,py,fy,gy,gg,mg,my,hy,fi,yy,Sr,kr,Os}from"./chunk-cn2bgt0w.js";import{ft}from"./chunk-6c1vm6bs.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{gy as __setSignalsGeneratorsForTest,ft as cacheEngineFingerprint,kr as cacheTemplate,Sr as checkCache,yy as clearDevCaches,mg as getCachedRouterScript,gg as getCachedSignalsRuntime,my as getServeClientAsset,fi as getServeModuleBundle,Os as hashFilePath,py as invalidateFileCache,fy as invalidateFileCacheByDir,dy as readFileCached,hy as registerServeModuleBundle,fg as templateCache};
2
+ import{fg,dy,py,fy,gy,gg,mg,my,hy,fi,yy,Sr,kr,Os}from"./chunk-9y2n8wm6.js";import{ft}from"./chunk-6c1vm6bs.js";import"./chunk-x3py9q5v.js";import"./chunk-xynq9fcr.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{gy as __setSignalsGeneratorsForTest,ft as cacheEngineFingerprint,kr as cacheTemplate,Sr as checkCache,yy as clearDevCaches,mg as getCachedRouterScript,gg as getCachedSignalsRuntime,my as getServeClientAsset,fi as getServeModuleBundle,Os as hashFilePath,py as invalidateFileCache,fy as invalidateFileCacheByDir,dy as readFileCached,hy as registerServeModuleBundle,fg as templateCache};