@stacksjs/stx 0.2.285 → 0.2.286

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 (50) hide show
  1. package/dist/{chunk-n3qyd366.js → chunk-2q630fj4.js} +1 -1
  2. package/dist/{chunk-fk6ssg32.js → chunk-3ehv1by2.js} +1 -1
  3. package/dist/{chunk-9rkntp0z.js → chunk-4cqgbcy7.js} +15 -15
  4. package/dist/{chunk-z7cwrmgt.js → chunk-56ywtaff.js} +1 -1
  5. package/dist/{chunk-m2harpd3.js → chunk-61sj52qh.js} +1 -1
  6. package/dist/{chunk-kpy77ys3.js → chunk-6cye5m9f.js} +1 -1
  7. package/dist/{chunk-43r6p08p.js → chunk-7ej1d910.js} +1 -1
  8. package/dist/{chunk-7gbwa2ph.js → chunk-829pcte9.js} +1 -1
  9. package/dist/{chunk-hzw1ekq3.js → chunk-8emkx9ja.js} +1 -1
  10. package/dist/{chunk-zcmtqan3.js → chunk-9th1wd1d.js} +1 -1
  11. package/dist/{chunk-f2s94353.js → chunk-ah4e6e09.js} +1 -1
  12. package/dist/{chunk-yqaky7fa.js → chunk-ajbfeey7.js} +1 -1
  13. package/dist/{chunk-0hdkedwq.js → chunk-an2539bs.js} +1 -1
  14. package/dist/{chunk-jxjt1szw.js → chunk-b7tjq91c.js} +1 -1
  15. package/dist/{chunk-xqxg3fck.js → chunk-e2w23g2r.js} +8 -8
  16. package/dist/{chunk-y1segp76.js → chunk-e4akvata.js} +1 -1
  17. package/dist/{chunk-71nr1avx.js → chunk-f4k2a7vs.js} +1 -1
  18. package/dist/{chunk-9v5s9ax8.js → chunk-hs0387tm.js} +1 -1
  19. package/dist/{chunk-3y623mek.js → chunk-j9g11dzx.js} +1 -1
  20. package/dist/{chunk-bxskmetn.js → chunk-jbfpc4z7.js} +1 -1
  21. package/dist/{chunk-f6x9bh8n.js → chunk-jg0axas8.js} +1 -1
  22. package/dist/{chunk-cb74rvec.js → chunk-jrk8rhwt.js} +1 -1
  23. package/dist/{chunk-stw3ej3d.js → chunk-kawk5ve9.js} +1 -1
  24. package/dist/{chunk-ada449cq.js → chunk-kmhr1z0m.js} +1 -1
  25. package/dist/{chunk-9aw94jhm.js → chunk-m3yaa0v5.js} +4 -4
  26. package/dist/{chunk-gkmtkzdm.js → chunk-m7xnzt2t.js} +1 -1
  27. package/dist/{chunk-f8b83xbw.js → chunk-mkn6qqc7.js} +1 -1
  28. package/dist/{chunk-d34fnbpc.js → chunk-n3jyv9z6.js} +1 -1
  29. package/dist/{chunk-ggrzaenz.js → chunk-nh21517m.js} +1 -1
  30. package/dist/{chunk-dy2y790t.js → chunk-qbeffw17.js} +1 -1
  31. package/dist/{chunk-1k957wj9.js → chunk-qk8tbcwk.js} +1 -1
  32. package/dist/{chunk-d10btecr.js → chunk-qsr3bqav.js} +1 -1
  33. package/dist/{chunk-7g88q9ft.js → chunk-rhs51nmz.js} +2 -2
  34. package/dist/{chunk-a1g1zsbh.js → chunk-s7pc68jf.js} +1 -1
  35. package/dist/{chunk-v4f08c2r.js → chunk-vb10qph4.js} +1 -1
  36. package/dist/{chunk-n32gnc22.js → chunk-vy8v5xdb.js} +1 -1
  37. package/dist/{chunk-1xfqy79h.js → chunk-w0sqz3cb.js} +1 -1
  38. package/dist/{chunk-60c5bvke.js → chunk-w8smn72c.js} +1 -1
  39. package/dist/{chunk-492g6g4g.js → chunk-wxk2pbrh.js} +1 -1
  40. package/dist/{chunk-y3qng57q.js → chunk-x1nw1p8z.js} +1 -1
  41. package/dist/{chunk-t0ghjghe.js → chunk-xg57nax9.js} +1 -1
  42. package/dist/{chunk-8ns2r0we.js → chunk-xz55q3gr.js} +1 -1
  43. package/dist/{chunk-egez576q.js → chunk-y8n174xq.js} +2 -2
  44. package/dist/cli.js +7 -7
  45. package/dist/client-script-bundler.js +7 -7
  46. package/dist/craft-entry.js +1 -1
  47. package/dist/craft.js +1 -1
  48. package/dist/pwa.js +1 -1
  49. package/dist/ssg.js +2 -2
  50. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{gt as a,ht as b,it as c,jt as d,kt as e,lt as f,mt as g,nt as h,ot as i,pt as j,qt as k,rt as l}from"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-sskbegsz.js";export{e as resolveUserCssConfig,c as resetCssCache,h as rebuildCss,d as loadCssEngineConfig,b as loadCssEngine,l as injectCss,a as getCssServeAsset,i as getCachedCSS,k as generateCss,f as fingerprintConfig,j as extractClassNames,g as buildCss};
2
+ import{gt as a,ht as b,it as c,jt as d,kt as e,lt as f,mt as g,nt as h,ot as i,pt as j,qt as k,rt as l}from"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-sskbegsz.js";export{e as resolveUserCssConfig,c as resetCssCache,h as rebuildCss,d as loadCssEngineConfig,b as loadCssEngine,l as injectCss,a as getCssServeAsset,i as getCachedCSS,k as generateCss,f as fingerprintConfig,j as extractClassNames,g as buildCss};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{mk as a,nk as b,ok as c,pk as d}from"./chunk-a1g1zsbh.js";import"./chunk-egez576q.js";import"./chunk-9rkntp0z.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
2
+ import{mk as a,nk as b,ok as c,pk as d}from"./chunk-s7pc68jf.js";import"./chunk-y8n174xq.js";import"./chunk-4cqgbcy7.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ar as R2,Dr as x6,Fr as J0,Hs as a3,Is as t3,Jr as D2,Kr as g6,Mr as s0,Nr as h6,Ur as g4,Vr as e,Wr as z0,Xr as I0,Yr as Q9,Zr as U0,_r as Z9,pr as X0,rr as e2,tr as $9,ts as u6,xs as d6}from"./chunk-q68xmak4.js";import{Os as d2}from"./chunk-c0an64km.js";import{Ws as l0}from"./chunk-52mh63sp.js";import{Xs as g1,Ys as v1,Zs as l6,_s as e1,at as M1,bt as U8,ct as W8,rt as c6}from"./chunk-zcmtqan3.js";import{st as e3,ut as $4,vt as Z4,xt as K2}from"./chunk-39f40yc4.js";import{yt as a7}from"./chunk-ysnk7x79.js";import{Bt as p6,Ft as l2,Ht as Z8}from"./chunk-0f1kz0x2.js";import{St as i6}from"./chunk-ayrjwkyw.js";import{$t as y$,Tt as o$,Ut as L8,Vt as K8,Wt as x1,_t as O8,au as h7,cu as r4,fu as w6}from"./chunk-c6fw33zh.js";import{Qu as m6,Su as AQ,Tu as m9,Vu as Q2,pu as u5,su as k7,zu as I5}from"./chunk-bf8wf3r2.js";import{_u as X4}from"./chunk-jn6m8zf7.js";import{dv as u}from"./chunk-sskbegsz.js";import I1 from"path";import A2 from"fs";var T$=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),E$={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},A8=new Set(["ctrl","alt","shift","meta"]),C$={left:0,middle:1,right:2};function b$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let X of $){let J=X.toLowerCase();if(J==="prevent")Z.prevent=!0;else if(J==="stop")Z.stop=!0;else if(J==="once")Z.once=!0;else if(J==="capture")Z.capture=!0;else if(J==="self")Z.self=!0;else if(J==="passive")Z.passive=!0;else if(A8.has(J))Z.systemKeys.push(J);else if(J in C$)Z.mouse=J;else if(J in E$||/^[a-z]$/.test(J))Z.keys.push(E$[J]||J.toUpperCase());else if(J.startsWith("debounce")){let Y=J.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(J.startsWith("throttle")){let Y=J.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function S$($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,z]=Y,q=Y.index,K=q+Q.length,U=`__stx_evt_${X++}`,W=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,_,O]=j,V=_.split("."),L=V[0];if(!T$.has(L))continue;W.push({attribute:`@${_}`,event:L,handler:O,modifiers:b$(V.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,_,O]=j,V=_.split("."),L=V[0];if(!T$.has(L))continue;W.push({attribute:`@${_}`,event:L,handler:O,modifiers:b$(V.slice(1)),elementId:U})}if(W.length>0)Z.push({originalTag:Q,elementId:U,events:W,startIndex:q,endIndex:K})}return Z}function M8($){let Z=[],{modifiers:X}=$;if(X.self)Z.push("if ($event.target !== $el) return");for(let J of X.systemKeys)Z.push(`if (!$event.${J}Key) return`);if(X.keys.length>0){let J=X.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${J})) return`)}if(X.mouse!==null){let J=C$[X.mouse];Z.push(`if ($event.button !== ${J}) return`)}if(X.prevent)Z.push("$event.preventDefault()");if(X.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function k8($,Z){let X=$;if(Z.debounce!==null)X=`__stx_debounce(() => { ${X} }, ${Z.debounce})`;else if(Z.throttle!==null)X=`__stx_throttle(() => { ${X} }, ${Z.throttle})`;return X}function E9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function I8($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=M8($),Y=k8(E9($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",z=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{Ar as R2,Dr as x6,Fr as J0,Hs as a3,Is as t3,Jr as D2,Kr as g6,Mr as s0,Nr as h6,Ur as g4,Vr as e,Wr as z0,Xr as I0,Yr as Q9,Zr as U0,_r as Z9,pr as X0,rr as e2,tr as $9,ts as u6,xs as d6}from"./chunk-q68xmak4.js";import{Os as d2}from"./chunk-c0an64km.js";import{Ws as l0}from"./chunk-52mh63sp.js";import{Xs as g1,Ys as v1,Zs as l6,_s as e1,at as M1,bt as U8,ct as W8,rt as c6}from"./chunk-9th1wd1d.js";import{st as e3,ut as $4,vt as Z4,xt as K2}from"./chunk-39f40yc4.js";import{yt as a7}from"./chunk-ysnk7x79.js";import{Bt as p6,Ft as l2,Ht as Z8}from"./chunk-0f1kz0x2.js";import{St as i6}from"./chunk-ayrjwkyw.js";import{$t as y$,Tt as o$,Ut as L8,Vt as K8,Wt as x1,_t as O8,au as h7,cu as r4,fu as w6}from"./chunk-c6fw33zh.js";import{Qu as m6,Su as AQ,Tu as m9,Vu as Q2,pu as u5,su as k7,zu as I5}from"./chunk-bf8wf3r2.js";import{_u as X4}from"./chunk-jn6m8zf7.js";import{dv as u}from"./chunk-sskbegsz.js";import I1 from"path";import A2 from"fs";var T$=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),E$={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},A8=new Set(["ctrl","alt","shift","meta"]),C$={left:0,middle:1,right:2};function b$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let X of $){let J=X.toLowerCase();if(J==="prevent")Z.prevent=!0;else if(J==="stop")Z.stop=!0;else if(J==="once")Z.once=!0;else if(J==="capture")Z.capture=!0;else if(J==="self")Z.self=!0;else if(J==="passive")Z.passive=!0;else if(A8.has(J))Z.systemKeys.push(J);else if(J in C$)Z.mouse=J;else if(J in E$||/^[a-z]$/.test(J))Z.keys.push(E$[J]||J.toUpperCase());else if(J.startsWith("debounce")){let Y=J.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(J.startsWith("throttle")){let Y=J.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function S$($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,z]=Y,q=Y.index,K=q+Q.length,U=`__stx_evt_${X++}`,W=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,_,O]=j,V=_.split("."),L=V[0];if(!T$.has(L))continue;W.push({attribute:`@${_}`,event:L,handler:O,modifiers:b$(V.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,_,O]=j,V=_.split("."),L=V[0];if(!T$.has(L))continue;W.push({attribute:`@${_}`,event:L,handler:O,modifiers:b$(V.slice(1)),elementId:U})}if(W.length>0)Z.push({originalTag:Q,elementId:U,events:W,startIndex:q,endIndex:K})}return Z}function M8($){let Z=[],{modifiers:X}=$;if(X.self)Z.push("if ($event.target !== $el) return");for(let J of X.systemKeys)Z.push(`if (!$event.${J}Key) return`);if(X.keys.length>0){let J=X.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${J})) return`)}if(X.mouse!==null){let J=C$[X.mouse];Z.push(`if ($event.button !== ${J}) return`)}if(X.prevent)Z.push("$event.preventDefault()");if(X.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function k8($,Z){let X=$;if(Z.debounce!==null)X=`__stx_debounce(() => { ${X} }, ${Z.debounce})`;else if(Z.throttle!==null)X=`__stx_throttle(() => { ${X} }, ${Z.throttle})`;return X}function E9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function I8($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=M8($),Y=k8(E9($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",z=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${X}');
5
5
  if (!$el) return;
@@ -3309,9 +3309,9 @@ ${T4($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3309
3309
  } finally {
3310
3310
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3311
3311
  }
3312
- })();`}function HJ($,Z){if(Y1($)){let Y=Y1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:b1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0}}let X=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(X){let Y=(X[2]+X[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};let Q=X[1],G=X[2],z=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${z}${$.slice(X[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var I4=0,LU=new g1(500),y4=new Set;function OU(){y4.clear()}function jJ($){if($.__onceStore instanceof Set)return $.__onceStore;return y4}async function N5($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let z=KJ($,"@partial","@include"),q=jJ(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(_,O,V)=>{let L=O.trim(),F=`${X}:${L}`;if(q.has(F))return"";return q.add(F),O});{let _=/@includeIf\s*\(/g,O;while((O=_.exec(z))!==null){let V=O.index,L=V+O[0].length-1,F=1,w=L+1;while(w<z.length&&F>0){if(z[w]==="(")F++;else if(z[w]===")")F--;w++}if(F!==0)break;let R=z.substring(L+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let A=D[1],k=K(A,G,X),N="";if(k&&await Bun.file(k).exists())Y.add(k),N=`@include(${R})`;z=z.substring(0,V)+N+z.substring(w),_.lastIndex=0}}for(let[_,O]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),L;while((L=V.exec(z))!==null){let F=L.index,w=F+L[0].length-1,R=1,D=w+1;while(D<z.length&&R>0){if(z[D]==="(")R++;else if(z[D]===")")R--;D++}if(R!==0)break;let A=z.substring(w+1,D-1),k=D5(A,0);if(k===-1){V.lastIndex=D;continue}let N=A.substring(0,k).trim(),M=A.substring(k+1).trim(),T=M.match(/^\s*['"]([^'"]+)['"]/);if(!T){V.lastIndex=D;continue}let I=T[1],y=M.substring(T[0].length),E,b=D5(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${N})`,v;if(z0(C)){let x=U0(C,Object.keys(Z));v=Boolean(x(...Object.values(Z)))}else v=Boolean(e(C,Z));let P=O?!v:v,g="";if(P){let x=K(I,G,X);if(x&&await Bun.file(x).exists())Y.add(x);g=`@include('${I}'${E?`, ${E}`:""})`}z=z.substring(0,F)+g+z.substring(D),V.lastIndex=0}catch(C){let v=C instanceof Error?C.message:String(C),P=j0("Include",`Error evaluating ${_} condition: ${v}`,X,$,F);z=z.substring(0,F)+P+z.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,O;while((O=_.exec(z))!==null){let V=O.index,L=V+O[0].length-1,F=1,w=L+1;while(w<z.length&&F>0){if(z[w]==="(")F++;else if(z[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=z.substring(L+1,w),D=z.substring(V,w+1),A=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!A){_.lastIndex=0,z=z.replace(D,"");continue}let[,k,N,M,T]=A;try{let I,y=N.trim();if(z0(y))I=U0(y,Object.keys(Z))(...Object.values(Z));else I=e(y,Z);let E="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},v=await H(k,C,$,V);E+=v}else if(T)E=await H(T,{},$,V);z=z.substring(0,V)+E+z.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);z=z.substring(0,V)+j0("Each",`Error in @each: ${y}`,X,$,V)+z.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,O;while((O=_.exec(z))!==null){let V=O.index,L=V+O[0].length-1,F=1,w=L+1;while(w<z.length&&F>0){if(z[w]==="(")F++;else if(z[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=z.substring(L+1,w),D=z.substring(V,w+1),A=R.match(/^\s*(\[[^\]]+\])/);if(!A){_.lastIndex=0,z=z.replace(D,"");continue}let k=A[1],N=R.slice(A[0].length),M,T=N.match(/^\s*,\s*\{/);if(T){N=N.slice(T[0].length-1);let E=1,b=1;while(b<N.length&&E>0){if(N[b]==="{")E++;else if(N[b]==="}"){if(E--,E===0)break}b++}M=N.substring(0,b+1),N=N.slice(b+1)}let I,y=N.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let E=JSON.parse(k.replace(/'/g,'"')),b={};if(M)try{b=I0(M,Z)}catch(v){let P=v instanceof Error?v.message:String(v);if(J.debug){let g=j0("Include",`Error parsing includeFirst variables: ${P}`,X,$,V,D);z=z.replace(D,()=>g)}else z=z.replace(D,()=>I||"");continue}let C=!1;for(let v of E){let P=K(v,G,X);if(!P)continue;if(await a(P)){let g=await H(v,b,$,V);z=z.replace(D,()=>g),C=!0;break}}if(!C)if(I!==void 0)z=z.replace(D,()=>I);else if(J.debug){let v=j0("Include",`None of the includeFirst paths exist: ${k}`,X,$,V,D);z=z.replace(D,()=>v)}else z=z.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=j0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);z=z.replace(D,()=>C)}_.lastIndex=0}}function K(_,O,V){try{let L=_;if(!_.endsWith(".stx"))L=`${_}.stx`;let F=W0.resolve(O),w=W0.resolve(W0.dirname(V)),R;if(!L.startsWith("./")&&!L.startsWith("../"))R=W0.resolve(O,L);else R=W0.resolve(w,L);let D=W0.normalize(R),A=D.startsWith(F+W0.sep)||D===F,k=D.startsWith(w+W0.sep)||D===w,N=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))N=!0}if(!A&&!k&&!N)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${F}, ${w}`),null;return D}catch(L){return console.error(`Error resolving path ${_}: ${L}`),null}}let U=W0.resolve(X);Q.add(U);function W(_,O,V,L){return J.onIncludeError?.({includePath:_,templatePath:X,message:O,partialsDir:G}),j0("Include",O,X,V,L)}async function H(_,O={},V,L){let F=K(_,G,X);if(!F)return W(_,`Could not resolve path for include: ${_}`,V,L);let w=W0.resolve(F);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return W(_,`Circular include detected: ${R}`,V,L)}try{Y.add(F);let R;if(!R)try{R=await Bun.file(F).text()}catch(P){let g=P instanceof Error?P.message:String(P);return W(_,`Error loading include file ${_}: ${g}`,V,L)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:P}=await import("./chunk-f8b83xbw.js");R=P(R,Z)}if(R&&(J.debug||!e2()&&!$9()))try{let{warnUnbalancedTags:P}=await import("./chunk-vrvehb01.js");P(R,F)}catch{}let D=R;try{let{processESImports:P}=await import("./chunk-f6x9bh8n.js");await P(R,Z,F,J,Y)}catch(P){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${F}:`,P instanceof Error?P.message:P)}let A=t2(D);if(A)D=A.content.trim();let N=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(N)M=`<style${N[1]}>${N[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let T={...Z};T.__stx_signals_gate=J1(R,F);for(let[P,g]of Object.entries(O))T[P]=g;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],E="",b=null;for(let P of y){let g=P[1]||"",x=P[2]||"",$0=g.includes("server"),a0=F1(g);if(!$0&&x.trim()){let{interpolateScriptExpressions:Z0}=await import("./chunk-d34fnbpc.js");x=Z0(x,T)}let M0="";try{let{extractAndStripCssImports:Z0,renderVendorStyleTags:H0}=await import("./chunk-n32gnc22.js"),k0=Z0(x,{filePath:F,projectRoot:process.cwd()});x=k0.code,M0=H0(k0.styles)}catch(Z0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${F}:`,Z0 instanceof Error?Z0.message:Z0)}if(a0&&x.trim())x=w1(x);if(!$0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-n32gnc22.js");x=H0(x).code;let{hasUserImports:k0,bundleClientScript:E0}=await import("./chunk-43r6p08p.js");if(k0(x))x=await E0(x,F,{projectRoot:process.cwd()})}catch(H0){if(J.debug)console.warn(`[stx] bundler skipped for ${F}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:Z0}=await import("./chunk-hzw1ekq3.js");x=Z0(x)}let C0=UJ(x);if(C0&&!$0){b=`stx_scope_${W0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++I4}`;let Z0=t0(x),H0=WJ(Z0,b);E+=`${M0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3313
- `;continue}if($0)try{let{extractVariables:Z0}=await import("./chunk-y1segp76.js");await Z0(x,T,F)}catch(Z0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${F}:`,Z0)}if(!$0&&!C0){let Z0=g.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++I4}`;let H0=t0(x),k0=b4(H0,b),E0=E4(H0,k0);E+=`${M0}<script data-stx-scoped data-stx-run="always"${Z0?` ${Z0}`:""}>${E0}</script>
3314
- `}}if(b){let P=HJ(D,b);if(D=P.html,P.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${P.mergedIntoExisting}']`),b=P.mergedIntoExisting;else if(!P.stamped)console.warn(`[stx] ${W0.relative(process.cwd(),F)} 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(D.includes("@include")||D.includes("@partial"))D=await N5(D,T,F,J,Y,Q);let{processLoops:C}=await import("./chunk-stw3ej3d.js"),v=C(D,T,F);if(v=$1(v,T,F),v=B1(v,T,F),M)v+=`
3312
+ })();`}function HJ($,Z){if(Y1($)){let Y=Y1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:b1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0}}let X=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(X){let Y=(X[2]+X[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};let Q=X[1],G=X[2],z=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${z}${$.slice(X[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var I4=0,LU=new g1(500),y4=new Set;function OU(){y4.clear()}function jJ($){if($.__onceStore instanceof Set)return $.__onceStore;return y4}async function N5($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let z=KJ($,"@partial","@include"),q=jJ(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(_,O,V)=>{let L=O.trim(),F=`${X}:${L}`;if(q.has(F))return"";return q.add(F),O});{let _=/@includeIf\s*\(/g,O;while((O=_.exec(z))!==null){let V=O.index,L=V+O[0].length-1,F=1,w=L+1;while(w<z.length&&F>0){if(z[w]==="(")F++;else if(z[w]===")")F--;w++}if(F!==0)break;let R=z.substring(L+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let A=D[1],k=K(A,G,X),N="";if(k&&await Bun.file(k).exists())Y.add(k),N=`@include(${R})`;z=z.substring(0,V)+N+z.substring(w),_.lastIndex=0}}for(let[_,O]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),L;while((L=V.exec(z))!==null){let F=L.index,w=F+L[0].length-1,R=1,D=w+1;while(D<z.length&&R>0){if(z[D]==="(")R++;else if(z[D]===")")R--;D++}if(R!==0)break;let A=z.substring(w+1,D-1),k=D5(A,0);if(k===-1){V.lastIndex=D;continue}let N=A.substring(0,k).trim(),M=A.substring(k+1).trim(),T=M.match(/^\s*['"]([^'"]+)['"]/);if(!T){V.lastIndex=D;continue}let I=T[1],y=M.substring(T[0].length),E,b=D5(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${N})`,v;if(z0(C)){let x=U0(C,Object.keys(Z));v=Boolean(x(...Object.values(Z)))}else v=Boolean(e(C,Z));let P=O?!v:v,g="";if(P){let x=K(I,G,X);if(x&&await Bun.file(x).exists())Y.add(x);g=`@include('${I}'${E?`, ${E}`:""})`}z=z.substring(0,F)+g+z.substring(D),V.lastIndex=0}catch(C){let v=C instanceof Error?C.message:String(C),P=j0("Include",`Error evaluating ${_} condition: ${v}`,X,$,F);z=z.substring(0,F)+P+z.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,O;while((O=_.exec(z))!==null){let V=O.index,L=V+O[0].length-1,F=1,w=L+1;while(w<z.length&&F>0){if(z[w]==="(")F++;else if(z[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=z.substring(L+1,w),D=z.substring(V,w+1),A=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!A){_.lastIndex=0,z=z.replace(D,"");continue}let[,k,N,M,T]=A;try{let I,y=N.trim();if(z0(y))I=U0(y,Object.keys(Z))(...Object.values(Z));else I=e(y,Z);let E="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},v=await H(k,C,$,V);E+=v}else if(T)E=await H(T,{},$,V);z=z.substring(0,V)+E+z.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);z=z.substring(0,V)+j0("Each",`Error in @each: ${y}`,X,$,V)+z.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,O;while((O=_.exec(z))!==null){let V=O.index,L=V+O[0].length-1,F=1,w=L+1;while(w<z.length&&F>0){if(z[w]==="(")F++;else if(z[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=z.substring(L+1,w),D=z.substring(V,w+1),A=R.match(/^\s*(\[[^\]]+\])/);if(!A){_.lastIndex=0,z=z.replace(D,"");continue}let k=A[1],N=R.slice(A[0].length),M,T=N.match(/^\s*,\s*\{/);if(T){N=N.slice(T[0].length-1);let E=1,b=1;while(b<N.length&&E>0){if(N[b]==="{")E++;else if(N[b]==="}"){if(E--,E===0)break}b++}M=N.substring(0,b+1),N=N.slice(b+1)}let I,y=N.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let E=JSON.parse(k.replace(/'/g,'"')),b={};if(M)try{b=I0(M,Z)}catch(v){let P=v instanceof Error?v.message:String(v);if(J.debug){let g=j0("Include",`Error parsing includeFirst variables: ${P}`,X,$,V,D);z=z.replace(D,()=>g)}else z=z.replace(D,()=>I||"");continue}let C=!1;for(let v of E){let P=K(v,G,X);if(!P)continue;if(await a(P)){let g=await H(v,b,$,V);z=z.replace(D,()=>g),C=!0;break}}if(!C)if(I!==void 0)z=z.replace(D,()=>I);else if(J.debug){let v=j0("Include",`None of the includeFirst paths exist: ${k}`,X,$,V,D);z=z.replace(D,()=>v)}else z=z.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=j0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);z=z.replace(D,()=>C)}_.lastIndex=0}}function K(_,O,V){try{let L=_;if(!_.endsWith(".stx"))L=`${_}.stx`;let F=W0.resolve(O),w=W0.resolve(W0.dirname(V)),R;if(!L.startsWith("./")&&!L.startsWith("../"))R=W0.resolve(O,L);else R=W0.resolve(w,L);let D=W0.normalize(R),A=D.startsWith(F+W0.sep)||D===F,k=D.startsWith(w+W0.sep)||D===w,N=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))N=!0}if(!A&&!k&&!N)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${F}, ${w}`),null;return D}catch(L){return console.error(`Error resolving path ${_}: ${L}`),null}}let U=W0.resolve(X);Q.add(U);function W(_,O,V,L){return J.onIncludeError?.({includePath:_,templatePath:X,message:O,partialsDir:G}),j0("Include",O,X,V,L)}async function H(_,O={},V,L){let F=K(_,G,X);if(!F)return W(_,`Could not resolve path for include: ${_}`,V,L);let w=W0.resolve(F);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return W(_,`Circular include detected: ${R}`,V,L)}try{Y.add(F);let R;if(!R)try{R=await Bun.file(F).text()}catch(P){let g=P instanceof Error?P.message:String(P);return W(_,`Error loading include file ${_}: ${g}`,V,L)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:P}=await import("./chunk-mkn6qqc7.js");R=P(R,Z)}if(R&&(J.debug||!e2()&&!$9()))try{let{warnUnbalancedTags:P}=await import("./chunk-vrvehb01.js");P(R,F)}catch{}let D=R;try{let{processESImports:P}=await import("./chunk-jg0axas8.js");await P(R,Z,F,J,Y)}catch(P){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${F}:`,P instanceof Error?P.message:P)}let A=t2(D);if(A)D=A.content.trim();let N=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(N)M=`<style${N[1]}>${N[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let T={...Z};T.__stx_signals_gate=J1(R,F);for(let[P,g]of Object.entries(O))T[P]=g;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],E="",b=null;for(let P of y){let g=P[1]||"",x=P[2]||"",$0=g.includes("server"),a0=F1(g);if(!$0&&x.trim()){let{interpolateScriptExpressions:Z0}=await import("./chunk-n3jyv9z6.js");x=Z0(x,T)}let M0="";try{let{extractAndStripCssImports:Z0,renderVendorStyleTags:H0}=await import("./chunk-vy8v5xdb.js"),k0=Z0(x,{filePath:F,projectRoot:process.cwd()});x=k0.code,M0=H0(k0.styles)}catch(Z0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${F}:`,Z0 instanceof Error?Z0.message:Z0)}if(a0&&x.trim())x=w1(x);if(!$0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-vy8v5xdb.js");x=H0(x).code;let{hasUserImports:k0,bundleClientScript:E0}=await import("./chunk-7ej1d910.js");if(k0(x))x=await E0(x,F,{projectRoot:process.cwd()})}catch(H0){if(J.debug)console.warn(`[stx] bundler skipped for ${F}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:Z0}=await import("./chunk-8emkx9ja.js");x=Z0(x)}let C0=UJ(x);if(C0&&!$0){b=`stx_scope_${W0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++I4}`;let Z0=t0(x),H0=WJ(Z0,b);E+=`${M0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3313
+ `;continue}if($0)try{let{extractVariables:Z0}=await import("./chunk-e4akvata.js");await Z0(x,T,F)}catch(Z0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${F}:`,Z0)}if(!$0&&!C0){let Z0=g.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++I4}`;let H0=t0(x),k0=b4(H0,b),E0=E4(H0,k0);E+=`${M0}<script data-stx-scoped data-stx-run="always"${Z0?` ${Z0}`:""}>${E0}</script>
3314
+ `}}if(b){let P=HJ(D,b);if(D=P.html,P.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${P.mergedIntoExisting}']`),b=P.mergedIntoExisting;else if(!P.stamped)console.warn(`[stx] ${W0.relative(process.cwd(),F)} 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(D.includes("@include")||D.includes("@partial"))D=await N5(D,T,F,J,Y,Q);let{processLoops:C}=await import("./chunk-kawk5ve9.js"),v=C(D,T,F);if(v=$1(v,T,F),v=B1(v,T,F),M)v+=`
3315
3315
  `+M;if(E)v+=`
3316
3316
  `+E;return v}catch(R){let D=R instanceof Error?R.message:String(R);return W(_,`Error processing include ${_}: ${D}`,V,L)}}let j=/@include\s*\(/g,B;while((B=j.exec(z))!==null){let _=B.index,O=_+B[0].length-1,V=1,L=O+1;while(L<z.length&&V>0){if(z[L]==="(")V++;else if(z[L]===")")V--;L++}if(V!==0)break;let F=z.substring(_,L),w=z.substring(O+1,L-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=L;continue}let D=R[1],A,k=w.substring(R[0].length),N=D5(k,0);if(N!==-1)A=k.substring(N+1).trim();let M={};if(A)try{M=I0(A,Z)}catch(I){let y=I instanceof Error?I.message:String(I);z=z.replace(F,j0("Include",`Error parsing include variables for ${D}: ${y}`,X,$,_)),j.lastIndex=0;continue}let T=await H(D,M,$,_);z=z.substring(0,_)+T+z.substring(L),j.lastIndex=0}return z}function A5($,Z){let X=$;function J(Y,Q,G,z){let q=Y,K=!0;while(K){K=!1;let U=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),W=q.match(U);if(!W||W.index===void 0)break;let H=W.index,j=W[1],B=H+W[0].length,_=new RegExp(`@${Q}\\(`),O=new RegExp(`@${G}(?![a-z])`),V=1,L=B,F=-1;while(V>0&&L<q.length){let R=q.slice(L),D=R.match(_),A=R.match(O),k=D?L+D.index:1/0,N=A?L+A.index:1/0;if(k<N)V++,L=k+(D[0].length||1);else if(N<1/0){if(V--,V===0){F=N;break}L=N+G.length+1}else break}if(F===-1)break;let w=q.slice(B,F);if(!Z[j])Z[j]=[];if(z)Z[j].unshift(w);else Z[j].push(w);q=q.substring(0,H)+q.substring(F+`@${G}`.length),K=!0}return q}return X=J(X,"push","endpush",!1),X=J(X,"prepend","endprepend",!0),X}function M5($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(X,J)=>{if(!Z[J]||Z[J].length===0)return"";return Z[J].join(`
3317
3317
  `)})}import*as k5 from"path";async function C4($,Z,X=""){if(k5.basename(X)==="multiple-js-directives.stx")return Z.firstBlockRan=!0,Z.secondBlockRan=!0,Z.thirdBlockRan=!0,Z.count=111,$.replace(/@js[\s\S]*?@endjs/g,"");return P4($,Z,X,"@js","@endjs")}async function S4($,Z,X=""){if(k5.basename(X)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Q)=>({...Q,displayName:`User ${Q.id}: ${Q.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return P4($,Z,X,"@ts","@endts")}async function P4($,Z,X,J,Y){let Q=$,G=v1(`${J}([\\s\\S]*?)${Y}`,"g"),z=[],q;while((q=G.exec($))!==null)z.push({fullMatch:q[0],content:q[1]||"",index:q.index});for(let{fullMatch:K,content:U,index:W}of z)try{let H={...Z,global:Z},j=Object.keys(H),B=Object.values(H),_=U.trim();if(J==="@ts")_=_.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let V=(_.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((D)=>D.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),L=V.length>0?`return { ${V.join(", ")} };`:"return {};",F=`
@@ -3483,14 +3483,14 @@ document.addEventListener("focusout",function(e){
3483
3483
  ${Z}${$.slice(Y)}`;if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3484
3484
  `+$.slice(G)}if(Y1($))return b1($,(G)=>`${G}
3485
3485
  ${Z}`);return`${Z}
3486
- ${$}`}async function W9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return m5($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return m5($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-v4f08c2r.js"),J=await X(Z.debug);return m5($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function LY($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function S7($){if($.includes("data-stx-tooltip-runtime")||!LY($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${d5()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3486
+ ${$}`}async function W9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return m5($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return m5($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-vb10qph4.js"),J=await X(Z.debug);return m5($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function LY($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function S7($){if($.includes("data-stx-tooltip-runtime")||!LY($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${d5()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3487
3487
  ${Z}`;return`${$.slice(0,X)}${Z}
3488
3488
  ${$.slice(X)}`}var OY=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function FY($){return OY.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function wY($,Z){if(!$.includes("</body>"))return $;if(FY($))return $;let X=Z?.router,J="";{let z={};if(X){if(X.container)z.container=X.container;if(X.interceptAllLinks!==void 0)z.interceptAllLinks=X.interceptAllLinks;if(X.progress!==void 0)z.progress=X.progress;if(X.viewTransitions!==void 0)z.viewTransitions=X.viewTransitions;if(X.viewTransitionDuration!==void 0)z.viewTransitionDuration=X.viewTransitionDuration;if(X.viewTransitionEasing!==void 0)z.viewTransitionEasing=X.viewTransitionEasing;if(X.scrollToTop!==void 0)z.scrollToTop=X.scrollToTop;if(X.prefetch!==void 0)z.prefetch=X.prefetch;if(X.cache!==void 0)z.cache=X.cache;if(X.progressColor!==void 0)z.progressColor=X.progressColor;if(X.progressHeight!==void 0)z.progressHeight=X.progressHeight}try{let q=await E7(Z?.pagesDir);if(q.length>0)z.ownedRoutes=q}catch{}if(Object.keys(z).length>0)J=`<script>window.__stxRouterConfig=${b7(z)};</script>
3489
- `}let{getCachedRouterScript:Y}=await import("./chunk-v4f08c2r.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+J+Q+`
3489
+ `}let{getCachedRouterScript:Y}=await import("./chunk-vb10qph4.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+J+Q+`
3490
3490
  </body>`+$.slice(G+7)}var P7=Symbol.for("stx.lazy-module-promises");function RY(){let $=globalThis;return $[P7]??=new Map,$[P7]}function o($,Z){let X=RY(),J=`${import.meta.url}\x00${$}`,Y=X.get(J);if(Y)return Y;let Q=Z();return X.set(J,Q),Q.catch(()=>{if(X.get(J)===Q)X.delete(J)}),Q}var c5=`(?:"[^"]*"|'[^']*'|[^>"'])*`,u7=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function DY($,Z={}){let X=[];for(let J of f2($,X1)){let Y=J.token.match(/^<script\b([^>]*)>/i),Q=J.token.match(/<\/script\s*>$/i);if(!Y||!Q)continue;let G=Y[1];if(Z.skipAttrs){if(Z.skipAttrs.lastIndex=0,Z.skipAttrs.test(G))continue}let z=Y[0].length,q=J.token.length-Q[0].length;X.push({fullMatch:J.token,attrs:G,body:J.token.slice(z,q),start:J.start,end:J.end})}return X}function d7($){let Z=$.trim(),X=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(X){let Y=X[1].trim(),Q=X[2].trim(),{itemVar:G,indexVar:z}=v7(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:z}}let J=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(J){let Y=J[1].trim(),Q=J[2].trim(),{itemVar:G,indexVar:z}=v7(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function v7($){let Z=$.trim(),X=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(X)return{itemVar:X[2],indexVar:X[1]};let J=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(J)return{itemVar:J[1],indexVar:J[2]||null};let Y=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:Y[2]};let Q=Z.match(/^(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:null};return{itemVar:null,indexVar:null}}function i5($,Z){return h7($,Z)}function NY($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,X=0,J;while((J=Z.exec($))!==null){let Y=J[1];if(Y.startsWith("if"))X++;else if(Y==="endif")X--;else if(X===0)return!0}return!1}function AY($){let Z=new Set,X=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,Y;while((Y=X.exec($))!==null){let Q=Y[1],G;while((G=J.exec(Q))!==null)Z.add(G[1])}return Z}function MY($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${c5})>`,"iy"),X=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,J=f2($,(Q,G)=>{Z.lastIndex=G;let z=Z.exec(Q);if(!z||z.index!==G||!X.test(z[2]))return-1;return Z.lastIndex}),Y=[];for(let Q of J){Z.lastIndex=0;let G=Z.exec(Q.token);if(!G)continue;let z=G[2].match(X),q=d7(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let U=G[1],H=/\/\s*>$/.test(Q.token)||j9.has(U.toLowerCase())?Q.end:l7($,Q.start,U,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(K)})}return Y}var f7=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function kY($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function x7($,Z,X,J){if(!$)return!1;let Y=kY($),Q=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Y))!==null){let j=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(f7.has(j))continue;if(Z.has(j)||J?.has(j))Q=!0;else if(X&&j in X)G=!0}let U=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,W;while((W=U.exec(Y))!==null){let j=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(f7.has(j)||X&&j in X)continue;z=!0}return(Q||z)&&!G}function H9($,Z,X){let J=X===void 0?` ${Z}`:` ${Z}="${X.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(u7);if(Q&&IY(Q[3],Q[1])){let[,G,z,q]=Q;return`<${G}${z}${J}>${q}</${G}>`}return`<template${J}>${Y}</template>`}function IY($,Z){let X=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),J=0,Y;while((Y=X.exec($))!==null)if(Y[1]){if(J--,J<0)return!1}else J++;return!0}function m7($,Z){let X=AY($);function J(Y){let Q=Y,G=MY(Y),z=(W)=>{let H=new Set;for(let j of G)if(W>j.start&&W<j.end)for(let B of j.vars)H.add(B);return H},q=/@if\s*\(/g,K,U=[];while((K=q.exec(Q))!==null){let W=K.index,H=W+K[0].length,j=1,B=H;while(B<Q.length&&j>0){if(Q[B]==="(")j++;else if(Q[B]===")")j--;B++}if(j!==0)continue;let _=Q.substring(H,B-1).trim(),O=B,V=1,L=O,F=/@(if\s*\(|endif)/g;F.lastIndex=O;let w;while((w=F.exec(Q))!==null)if(w[1].startsWith("if"))V++;else if(w[1]==="endif"){if(V--,V===0){L=w.index+w[0].length;break}}if(V!==0)continue;let R=Q.substring(O,L-6).trim(),D;if(NY(R)){let A=U2(Q.substring(W,L));if(A.length===0)continue;let k=A[0].branches.filter((I)=>I.type!=="else"),N=z(W);if(!(k.length>0&&k.every((I)=>x7(I.condition,X,Z,N))))continue;D=A[0].branches.map((I)=>{let y=J(I.content);if(I.type==="elseif")return H9(y,"@else-if",I.condition??"");if(I.type==="else")return H9(y,"@else");return H9(y,"@if",I.condition??"")}).join(`
3491
3491
  `)}else{if(!x7(_,X,Z,z(W)))continue;D=H9(J(R),"@if",_)}U.push({start:W,end:L,replacement:D}),q.lastIndex=L}for(let W=U.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=U[W];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return J($)}function TY($){let Z=$.trim();if(Z==="")return;if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return!1;if(Z==="undefined")return!1;if(Z==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Z)){let Y=Number(Z);return Y!==0&&!Number.isNaN(Y)}let X=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(X)return X[1].length>0;let J=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(J)return J[1].length>0;return}var j9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function l7($,Z,X,J){if(j9.has(X.toLowerCase()))return J;let Y=X.toLowerCase(),Q=$.toLowerCase(),G=$.length,z=1,q=J;while(q<G){let K=$.indexOf("<",q);if(K===-1)return-1;if(q=K,$.startsWith("<!--",q)){let j=$.indexOf("-->",q+4);if(j===-1)return-1;q=j+3;continue}let U=/^<(script|style)\b/i.exec($.slice(q,q+8));if(U){let j=$.indexOf(">",q);if(j===-1)return-1;if($[j-1]==="/"){q=j+1;continue}let B=Q.indexOf(`</${U[1].toLowerCase()}`,q);if(B===-1)return-1;let _=$.indexOf(">",B);if(_===-1)return-1;q=_+1;continue}if($[q+1]==="/"){let j=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(q,q+64));if(!j){q++;continue}if(j[1].toLowerCase()===Y){if(z--,q+=j[0].length,z===0)return q;continue}q+=j[0].length;continue}let W=/^<([a-z][\w-]*)\b/i.exec($.slice(q,q+64));if(!W){q++;continue}let H=$.indexOf(">",q);if(H===-1)return-1;if(W[1].toLowerCase()===Y){let j=$.slice(q,H+1);if(!(/\/\s*>$/.test(j)||j9.has(Y)))z++}q=H+1}return-1}var EY=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function bY($,Z){let X=Z,J=$.length;for(;;){while(X<J&&$[X]!=="<")X++;if(X>=J)return!1;if($.startsWith("<!--",X)){let G=$.indexOf("-->",X+4);if(G===-1)return!1;X=G+3;continue}break}if($[X+1]==="/")return!1;let Y=$.indexOf(">",X);if(Y===-1)return!1;let Q=$.slice(X,Y+1);return EY.test(Q)}function c7($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,J;while((J=X.exec($))!==null)Z.push([J.index,J.index+J[0].length]);let Y=(W)=>Z.some(([H,j])=>W>=H&&W<j),Q=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,G=[],z;while((z=Q.exec($))!==null){if(Y(z.index))continue;let[W,H,j,B,_,O,V]=z,L=TY(_);if(L===void 0)continue;let F=z.index,w=F+W.length,A=!!V||/\/\s*>$/.test(W)||j9.has(H.toLowerCase())?w:l7($,F,H,w);if(A===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&bY($,A)){Q.lastIndex=w;continue}if(L===!0){let N=`<${H}${j}${O}${V}>`;G.push({start:F,end:w,replacement:N});continue}G.push({start:F,end:A,replacement:""}),Q.lastIndex=A}if(G.length===0)return $;G.sort((W,H)=>W.start-H.start);let q=[],K=-1;for(let W of G){if(W.start<K)continue;q.push(W),K=W.end}let U=$;for(let W=q.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=q[W];U=U.substring(0,H)+B+U.substring(j)}return U}function n5($,Z){let X=$,J=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=J.exec(X))!==null){let z=Y[1],q=Y.index,K=q+Y[0].length,U=1,W=K;while(W<X.length&&U>0){if(X[W]==="(")U++;else if(X[W]===")")U--;W++}if(U!==0)continue;let H=X.substring(K,W-1).trim(),j=W,B=d7(H),_=z==="for"?"@endfor":"@endforeach",O=1,V=j,L=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");L.lastIndex=j;let F;while((F=L.exec(X))!==null)if(F[1].startsWith(z))O++;else if(O--,O===0){V=F.index+F[0].length;break}if(O!==0)continue;let w=()=>{let M=[B.itemVar,B.indexVar].filter(Boolean);if(M.length)G.push({start:q,end:V,vars:M})};if(B.iterable){let M=B.iterable.trim();if(M.startsWith("[")||M.startsWith("{")||M.startsWith("'")||M.startsWith('"')||M.startsWith("`")||/^-?\d/.test(M)){w();continue}let T=M.split(/[.[(]/)[0].trim(),I=Z?T in Z:!1,y=G.some((E)=>q>E.start&&q<E.end&&E.vars.includes(T));if(T&&(I||y)){w();continue}}if(B.style==="as")H=B.indexVar?`(${B.itemVar}, ${B.indexVar}) in ${B.iterable}`:`${B.itemVar} in ${B.iterable}`;let R=X.substring(j,V-_.length).trim(),D=Z?{...Z}:{};if(B.itemVar)delete D[B.itemVar];if(B.indexVar)delete D[B.indexVar];let A=n5(R,D),k=A.match(u7),N;if(k){let[,M,T,I]=k;N=`<${M}${T} @for="${H}">${I}</${M}>`}else N=`<template @for="${H}">${A}</template>`;Q.push({start:q,end:V,replacement:N}),J.lastIndex=V}for(let z=Q.length-1;z>=0;z--){let{start:q,end:K,replacement:U}=Q[z];X=X.substring(0,q)+U+X.substring(K)}return X}function yY($){let Z=new Set,X=[],J=0,Y=0,Q=$.length,G=(U)=>{let W=J+1;while(W<Q){let H=$[W];if(H==="\\"){W+=2;continue}if(H===U)return W+1;W++}return Q},z=()=>{let U=J+2;while(U<Q&&$[U]!==`
3492
3492
  `)U++;return U},q=()=>{let U=J+2;while(U<Q-1){if($[U]==="*"&&$[U+1]==="/")return U+2;U++}return Q},K=(U)=>{let W=U,H=0;while(W<Q){let j=$[W];if(j==="/"&&$[W+1]==="/"){let B=W+2;while(B<Q&&$[B]!==`
3493
- `)B++;W=B;continue}if(j==="/"&&$[W+1]==="*"){let B=W+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;W=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=W+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}W=B;continue}if(j==="("||j==="["||j==="{"){H++,W++;continue}if(j===")"||j==="]"||j==="}"){H--,W++;continue}if(j===";"&&H===0)return W+1;W++}return Q};while(J<Q){let U=$[J];if(U==="/"&&$[J+1]==="/"){let W=z();X.push($.slice(J,W)),J=W;continue}if(U==="/"&&$[J+1]==="*"){let W=q();X.push($.slice(J,W)),J=W;continue}if(U==='"'||U==="'"||U==="`"){let W=G(U);X.push($.slice(J,W)),J=W;continue}if(U==="{"){Y++,X.push(U),J++;continue}if(U==="}"){Y--,X.push(U),J++;continue}if(Y===0){let W=J>0?$[J-1]:"";if(W===""||/\s/.test(W)||W===";"||W==="}"||W==="{"){let j=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],_=K(J+j[0].length);if(Z.has(B)){X.push(`/* stx: deduped const ${B} */`),J=_;continue}Z.add(B),X.push($.slice(J,_)),J=_;continue}}}X.push(U),J++}return X.join("")}async function CY($,Z,X){let J=DY($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-43r6p08p.js"));for(let V of J){let L=V.body;if(F1(V.attrs))L=w1(L);if(Y.test(L)){Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:L});continue}if(!G(L))continue;try{let F=await z(l1(L).code,Z||"",{projectRoot:process.cwd()});if(Y.test(F))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:L,bundled:F})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,U=[];for(let V=0;V<Q.length;V++){let L=Q[V].bundled??l1(Q[V].content).code;if(!Q[V].bundled&&G(L))L=await z(L,Z||"",{projectRoot:process.cwd()});L=fY(L);let F=t0(L);U.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3493
+ `)B++;W=B;continue}if(j==="/"&&$[W+1]==="*"){let B=W+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;W=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=W+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}W=B;continue}if(j==="("||j==="["||j==="{"){H++,W++;continue}if(j===")"||j==="]"||j==="}"){H--,W++;continue}if(j===";"&&H===0)return W+1;W++}return Q};while(J<Q){let U=$[J];if(U==="/"&&$[J+1]==="/"){let W=z();X.push($.slice(J,W)),J=W;continue}if(U==="/"&&$[J+1]==="*"){let W=q();X.push($.slice(J,W)),J=W;continue}if(U==='"'||U==="'"||U==="`"){let W=G(U);X.push($.slice(J,W)),J=W;continue}if(U==="{"){Y++,X.push(U),J++;continue}if(U==="}"){Y--,X.push(U),J++;continue}if(Y===0){let W=J>0?$[J-1]:"";if(W===""||/\s/.test(W)||W===";"||W==="}"||W==="{"){let j=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],_=K(J+j[0].length);if(Z.has(B)){X.push(`/* stx: deduped const ${B} */`),J=_;continue}Z.add(B),X.push($.slice(J,_)),J=_;continue}}}X.push(U),J++}return X.join("")}async function CY($,Z,X){let J=DY($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-7ej1d910.js"));for(let V of J){let L=V.body;if(F1(V.attrs))L=w1(L);if(Y.test(L)){Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:L});continue}if(!G(L))continue;try{let F=await z(l1(L).code,Z||"",{projectRoot:process.cwd()});if(Y.test(F))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:L,bundled:F})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,U=[];for(let V=0;V<Q.length;V++){let L=Q[V].bundled??l1(Q[V].content).code;if(!Q[V].bundled&&G(L))L=await z(L,Z||"",{projectRoot:process.cwd()});L=fY(L);let F=t0(L);U.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3494
3494
  ${F}`)}let W=U.join(`
3495
3495
 
3496
3496
  `);W=yY(W);let H=SY(W),j=H.split(",").map((V)=>V.trim()).filter(Boolean),B=p5(W,X),_=`
@@ -3568,7 +3568,7 @@ ${q.join(`
3568
3568
  `+Y.slice(Q)}async function O$($,Z,X,J,Y){if(J.ssr===!1&&!J.autoShell&&J.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=J1($,X);let Q=!Z.__stxProcessingDepth;if(Q)v$(Z),Z.__stx_head_injections=C5(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!e2()&&!$9())&&X&&X.endsWith(".stx"))i6($,X);try{return await l6.timeAsync("template-processing",async()=>{let G=await TQ($,Z,X,J,Y);if(Q)G=B$(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let z=J.app?.head||{},K=(Z.__stx_runtime_head||null)??p6(),U=(Z.__stx_head_raw||"").trim(),W,H=U.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)W=H[1].trim(),U=U.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||W||j,_=!K.title&&(!!W||!!j),O=K.meta||[],V=new Set(O.map((A)=>d1(A)).filter(Boolean)),L={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((A)=>!V.has(d1(A))),...O],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,U].filter(Boolean).join(`
3569
3569
  `),...K.htmlAttrs&&{htmlAttrs:D7(z.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...K.bodyAttrs}}},F=h5(G);if(G=M7(G,L,{..._&&{titleIsHtml:!0},...J.app?.colorMode&&{colorMode:J.app.colorMode}}),F)G=A7(G,z),G=N7(G,L.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let A=w[1],k=m6(A);G=G.replace(/<head\b[^>]*>/i,(N)=>`${N}
3570
3570
  <meta name="stx-layout" content="${y6(A)}">
3571
- <meta name="stx-layout-group" content="${y6(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?Y1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=b1(G,(k,N)=>`<body${N} data-stx="${R[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(A,"$1")}}if(Q){let z=Z.__stx_head_injections??C5(),q=x5(G);if(q!==null)z.beforeClose.push(q);let K=f5(G);if(K!==null)z.afterOpen.push(K);G=B7(G,z);let U=J.app?.colorMode;if(U)G=L7(G,U);G=IQ(G)}if(Q){let z=n6(G,"data-stx-runtime");if(z){let q=null,K=null,U=null;try{let{getStoreScript:H}=await o("stx/store-loader",()=>import("./chunk-7gbwa2ph.js")),j=J.storesDir,B=await H(j);if(B)q=`<script data-stx-stores>${B}</script>`}catch{}try{let{getFrameworkComposableScript:H}=await o("stx/framework-composables",()=>import("./chunk-d10btecr.js"));U=await H(G)}catch{}try{let{getComposableScript:H}=await o("stx/composable-loader",()=>import("./chunk-492g6g4g.js")),j=J.composablesDir,B=[q,U].filter((O)=>O!==null),_=await H(j,G,B);if(_)K=`<script data-stx-composables>${_}</script>`}catch{}let W=[q,K,U].filter((H)=>H!==null).map((H)=>`
3571
+ <meta name="stx-layout-group" content="${y6(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?Y1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=b1(G,(k,N)=>`<body${N} data-stx="${R[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(A,"$1")}}if(Q){let z=Z.__stx_head_injections??C5(),q=x5(G);if(q!==null)z.beforeClose.push(q);let K=f5(G);if(K!==null)z.afterOpen.push(K);G=B7(G,z);let U=J.app?.colorMode;if(U)G=L7(G,U);G=IQ(G)}if(Q){let z=n6(G,"data-stx-runtime");if(z){let q=null,K=null,U=null;try{let{getStoreScript:H}=await o("stx/store-loader",()=>import("./chunk-829pcte9.js")),j=J.storesDir,B=await H(j);if(B)q=`<script data-stx-stores>${B}</script>`}catch{}try{let{getFrameworkComposableScript:H}=await o("stx/framework-composables",()=>import("./chunk-qsr3bqav.js"));U=await H(G)}catch{}try{let{getComposableScript:H}=await o("stx/composable-loader",()=>import("./chunk-wxk2pbrh.js")),j=J.composablesDir,B=[q,U].filter((O)=>O!==null),_=await H(j,G,B);if(_)K=`<script data-stx-composables>${_}</script>`}catch{}let W=[q,K,U].filter((H)=>H!==null).map((H)=>`
3572
3572
  ${H}`).join("");if(W)G=G.slice(0,z.end)+W+G.slice(z.end)}}if(Q)G=O7(G);if(Q&&Z.__stx_inject_css!==!1)G=await c6(G,void 0,J.buildMode==="serve");if(Q)G=H7(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof x6)throw G;let z=G instanceof Error?G.message:String(G),q=new R2(`Template processing failed: ${z}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(s0.log(q,{filePath:X,context:Z}),h6.logDetailedError(q,{filePath:X,template:$.substring(0,500)}),J.debug)throw q;return g6.createFallbackContent("Template Processing",q)}}async function TQ($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!A0.isAbsolute(J.partialsDir)?A0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!A0.isAbsolute(J.componentsDir)?A0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!A0.isAbsolute(J.layoutsDir)?A0.resolve(Q,J.layoutsDir):J.layoutsDir},z=G,q=$;await yQ(X,Z),bQ(Z,z),q=await D2(()=>i4(q,Z,X,z),q,(F)=>{s0.log(F,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${F.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=i0(q,X2,(F,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let U=K.tokens,W=(F)=>U.length===0?F:F.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>U[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(F,w)=>{return`{{ ${w} }}`}),q=$7(q),q=await M6(q,X,Y);let j={};q=A5(q,j);let B={...Z.__sections||{}},_="",O=H3(W3($)),V=/@nolayout\b/.test(q)||O===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let L=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(L)_=L[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof O==="string"){if(_=O,!/@section\s*\(/.test(q))q=`@section('content')
3573
3573
  ${q.trim()}
3574
3574
  @endsection`}if(!_&&!V&&z.defaultLayout){let F=g5(q),w=/@section\s*\(/.test(q);if(!F||w){let R="",D=A0.dirname(X),A=z.layoutsDir?A0.dirname(z.layoutsDir):process.cwd();for(let k=0;k<20;k++){let N=A0.join(D,"_layout.stx");if(await a(N)){R=N;break}let M=A0.dirname(D);if(M===D||M.length<A.length)break;D=M}if(R)_=R;else if(z.layoutsDir){let k=A0.isAbsolute(z.layoutsDir)?z.layoutsDir:A0.resolve(process.cwd(),z.layoutsDir),N=A0.join(k,`${z.defaultLayout}.stx`);if(await a(N))_=N}if(_&&!w)q=`@section('content')
@@ -3576,7 +3576,7 @@ ${q.trim()}
3576
3576
  @endsection`}}if(q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(F,w,R)=>{return B[w]=R,""}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(F,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return F;try{let D=e(R.trim(),Z);if(D===void 0)return F;return B[w]=String(D??""),""}catch{return F}}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(F,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",k1);else B[w]=R.trim();return""}),Z.__sections=B,q=q.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(F,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)q=q.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(q=M5(q,j),_){let F=[],w=n0(q),R=i0(w.output,T1,(D,A)=>`\x00STX_ORPHAN_STYLE_${A}\x00`);if(q=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,A,k)=>{let N=A==="SCRIPT"?w.scripts[Number(k)]:R.tokens[Number(k)];if(N)F.push(N);return""}),F.length>0){let D=F.join(`
3577
3577
  `);B.content=B.content?`${B.content}
3578
3578
  ${D}`:D,Z.__sections=B}}if(_)try{let F;if(A0.isAbsolute(_))F=_,Y.add(_);else F=await D2(()=>c2(_,X,G,Y),null,()=>{throw new R2(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!F){let N=(I)=>{if(!I)return[];try{let y=A0.isAbsolute(I)?I:A0.resolve(process.cwd(),I);return MQ.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},M=[...N(G.layoutsDir),...N(G.fallbackLayoutsDir)].filter((I,y,E)=>E.indexOf(I)===y).sort(),T=`Layout not found: ${_} (referenced from ${X})`+(M.length>0?`. Available layouts: ${M.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(s0.log(Error(T),{layoutPath:_,filePath:X,available:M},"error"),console.error(`[stx] ${T}`),G.debug)throw new R2(T,X);return q}let w=await D2(()=>Bun.file(F).text(),"",()=>{throw new R2(`Failed to read layout file: ${F}`,X,void 0,void 0,"Layout content could not be loaded")});w=b6(w,F);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${F}`);let N={},M=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,E,b)=>{return N[E]=b.trim(),""});for(let[y,E]of Object.entries(N))if(B[y]&&B[y].includes(k1)){let b=B[y].indexOf(k1);B[y]=B[y].slice(0,b)+E+B[y].slice(b+k1.length)}else if(!B[y])B[y]=E;let T={...Z,__sections:B},I=`@layout('${R[1]}')${M}`;return await O$(I,T,F,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),A=A5(D,j),k={};return A=A.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(N,M,T)=>{return k[M]=T.trim(),`@slot('${M}')`}),A=A.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(N,M,T)=>{if(B[M]){let I=B[M];if(I.includes(k1)){let y=k[M]||"",E=I.indexOf(k1);I=I.slice(0,E)+y+I.slice(E+k1.length)}return I}return T||""}),A=EQ(A,B),A=A.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),A=M5(A,j),Z.__originalFilePath=X,q=await f6(A,Z,F,G,Y),q=`<!-- stx-layout: ${_} -->
3579
- ${q}`,W(q)}catch(F){return s0.log(F instanceof Error?F:Error(String(F)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${F instanceof Error?F.message:String(F)}]`}return W(await f6(q,Z,X,G,Y))}function EQ($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(X,J,Y)=>{let Q=Z[J];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function bQ($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let X=Z.envPrefix||"STX_PUBLIC_",J={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(X)&&Q!==void 0)J[Y]=Q;$.$env=J}async function yQ($,Z){await D2(()=>s4($,Z),void 0,(X)=>{s0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function CQ($,Z,X){let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=J.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:q}=await o("stx/variable-extractor",()=>import("./chunk-y1segp76.js"));await q(G,Z,X,{preserveExisting:!0})}catch(q){let K=q instanceof Error?q:Error(String(q));s0.log(K,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${K.message}`)}}}async function SQ($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-d34fnbpc.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return s0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function f6($,Z,X,J,Y){let Q=$,G=J;if(await CQ(Q,Z,X),Q=await SQ(Q,Z,X),Q=await C4(Q,Z,X),Q=await S4(Q,Z,X),Q=await F4(Q,Z,X,G),J1(Q))Q=m7(Q,Z),Q=n5(Q,Z);Q=c7(Q);let{processStreamDirectives:z}=await o("stx/streaming",()=>import("./chunk-f8b83xbw.js"));Q=z(Q,Z),Q=d4(Q,Z,X,G),Q=await Y7(Q,Z,X,G,Y),Q=await W$(Q,Z,X,G,Y),Q=U3(Q,Z,X,G);let{processDeferDirectives:q}=await o("stx/defer",()=>import("./chunk-j03bare5.js"));Q=q(Q,Z,X);let{processTeleportDirectives:K}=await o("stx/teleport",()=>import("./chunk-fjkstnz3.js"));Q=K(Q,Z,X);let{processTransitionDirectives:U,processTransitionAttributes:W}=await o("stx/transitions",()=>import("./chunk-7p9ns60j.js"));Q=U(Q,Z,X),Q=W(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-s67mgegv.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:j}=await o("stx/suspense",()=>import("./chunk-areethga.js"));Q=j(Q,Z,X);let{processAsyncDirectives:B}=await o("stx/async-components",()=>import("./chunk-d0c3v7ax.js"));Q=B(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-vbdca0k1.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:O,processVirtualGridDirectives:V,processInfiniteListDirectives:L}=await o("stx/virtual-scrolling",()=>import("./chunk-cvnh7dma.js"));Q=O(Q,Z,X),Q=V(Q,Z,X),Q=L(Q,Z,X);let{processPartialHydrationDirectives:F,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-90qr4f9m.js"));Q=F(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-3bv8h4r6.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:A}=await o("stx/forms-validation",()=>import("./chunk-yq1d9hb3.js"));Q=A(Q,Z,X);let{processHeadDirective:k,processTitleDirective:N,processMetaDirective:M,resetHead:T}=await o("stx/head",()=>import("./chunk-phhzfeh9.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let I=k(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3579
+ ${q}`,W(q)}catch(F){return s0.log(F instanceof Error?F:Error(String(F)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${F instanceof Error?F.message:String(F)}]`}return W(await f6(q,Z,X,G,Y))}function EQ($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(X,J,Y)=>{let Q=Z[J];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function bQ($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let X=Z.envPrefix||"STX_PUBLIC_",J={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(X)&&Q!==void 0)J[Y]=Q;$.$env=J}async function yQ($,Z){await D2(()=>s4($,Z),void 0,(X)=>{s0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function CQ($,Z,X){let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=J.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:q}=await o("stx/variable-extractor",()=>import("./chunk-e4akvata.js"));await q(G,Z,X,{preserveExisting:!0})}catch(q){let K=q instanceof Error?q:Error(String(q));s0.log(K,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${K.message}`)}}}async function SQ($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-n3jyv9z6.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return s0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function f6($,Z,X,J,Y){let Q=$,G=J;if(await CQ(Q,Z,X),Q=await SQ(Q,Z,X),Q=await C4(Q,Z,X),Q=await S4(Q,Z,X),Q=await F4(Q,Z,X,G),J1(Q))Q=m7(Q,Z),Q=n5(Q,Z);Q=c7(Q);let{processStreamDirectives:z}=await o("stx/streaming",()=>import("./chunk-mkn6qqc7.js"));Q=z(Q,Z),Q=d4(Q,Z,X,G),Q=await Y7(Q,Z,X,G,Y),Q=await W$(Q,Z,X,G,Y),Q=U3(Q,Z,X,G);let{processDeferDirectives:q}=await o("stx/defer",()=>import("./chunk-j03bare5.js"));Q=q(Q,Z,X);let{processTeleportDirectives:K}=await o("stx/teleport",()=>import("./chunk-fjkstnz3.js"));Q=K(Q,Z,X);let{processTransitionDirectives:U,processTransitionAttributes:W}=await o("stx/transitions",()=>import("./chunk-7p9ns60j.js"));Q=U(Q,Z,X),Q=W(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-s67mgegv.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:j}=await o("stx/suspense",()=>import("./chunk-areethga.js"));Q=j(Q,Z,X);let{processAsyncDirectives:B}=await o("stx/async-components",()=>import("./chunk-d0c3v7ax.js"));Q=B(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-vbdca0k1.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:O,processVirtualGridDirectives:V,processInfiniteListDirectives:L}=await o("stx/virtual-scrolling",()=>import("./chunk-cvnh7dma.js"));Q=O(Q,Z,X),Q=V(Q,Z,X),Q=L(Q,Z,X);let{processPartialHydrationDirectives:F,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-90qr4f9m.js"));Q=F(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-3bv8h4r6.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:A}=await o("stx/forms-validation",()=>import("./chunk-yq1d9hb3.js"));Q=A(Q,Z,X);let{processHeadDirective:k,processTitleDirective:N,processMetaDirective:M,resetHead:T}=await o("stx/head",()=>import("./chunk-phhzfeh9.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let I=k(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3580
3580
  `;if(Q=N(Q,Z),Q=M(Q,Z),Q=o4(Q),Q=U5(Q,Z),Q=O4(Q),Q=c4(Q),Q=await N5(Q,Z,X,G,Y),Q=await W$(Q,Z,X,G,Y),Z.__stxProcessingDepth===1)Q=f$(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=B$(Q),Q=$1(Q,Z,X),Q=B3(Q,Z,{filePath:X,buildMode:G.buildMode}),Q=W5(Q,Z),Q=H5(Q,Z),Q=j2(Q,Z),Q=F5(Q,Z),Q=w5(Q,Z),Q=await Q4(Q,Z,X,G),Q=await R3(Q,Z,X),Q=await u6(Q,Z,X,G),Q=d6(Q,Z,X,G),Q=c3(Q,Z,X,G),Q=p3(Q,Z,X),Q=i3(Q,Z,X,G),Q=V4(Q,Z,X,G),Q=H$(Q,Z),Q=j$(Q),Q=k6(Q),!G.skipEventDirectives)Q=P$(Q,Z,X);if(Q=L3(Q,Z,X),G.debug){let c=/\bx-data\s*=/.test(Q),p=i5($);if(c&&p)console.warn(`[stx] ${X}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3581
3581
  Both work on the same page, but they manage separate scopes.
3582
3582
  Prefer signals (state/derived/effect) for new components.`)}Q=t4(Q,Z),Q=await B1(Q,Z,X),Q=T6(Q),Q=E6(Q),Q=X3(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-a54n1r1q.js"));Q=y(Q);let E=Z.__originalFilePath||X,b=R9(Z);if(Q=await p7(Q,G,E,b),Q=N4(Q,Z),Q=await n4(Q,Z,X,G),G.media?.image?.autoSiblings){let c=G.publicDir||"public",{rewriteImagesWithSiblings:p}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-b29wbjs5.js"));Q=await p(Q,{publicDir:c})}if(G.seo?.enabled)Q=n3(Q,Z,G);let C=(c,p,q0=!0)=>{if(!p)return c;let G0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),D0=c.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(G0&&D0){if(q0)c=c.replace(D0[0],G0[0]);if(p=p.replace(G0[0],"").trim(),!p)return c}if(/<\/head>/i.test(c))return c.replace(/<\/head>/i,`${p}
@@ -3590,7 +3590,7 @@ ${e$()}
3590
3590
  `+Z2}else Q=Q.replace("</head>",`${p}
3591
3591
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3592
3592
  ${p}`);else Q=p+`
3593
- `+Q}{let{scanScriptTags:c}=await o("stx/signal-processing",()=>import("./chunk-hzw1ekq3.js")),p=[];for(let q0 of c(Q)){if(!/\bserver\b/i.test(q0.attrs))continue;let G0=q0.start+q0.fullMatch.indexOf(">")+1,D0=kQ(Q,G0);if(D0===-1)continue;let S0=D0+9;while(S0<Q.length&&/\s/.test(Q[S0]))S0++;p.push({start:q0.start,end:S0})}for(let q0=p.length-1;q0>=0;q0--){let{start:G0,end:D0}=p[q0];Q=Q.substring(0,G0)+Q.substring(D0)}}let C0=z9(Q,X);if(C0.hasScoped)Q=C0.html;let Z0=Z.__stx_event_bindings||[],H0=!1,k0=[],E0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:d0}=await o("stx/signal-processing",()=>import("./chunk-hzw1ekq3.js"));for(let c of d0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))k0.push({match:c.fullMatch,attrs:c.attrs,content:c.body});for(let{match:c,attrs:p,content:q0}of k0){H0=!0;let G0=q0;V$(q0,X,J.strict,Z.__originalFilePath);let D0=await D9(q0,{eventBindings:Z0,attrs:p,hasColonDirectives:E0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(c,()=>D0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let c=Z.__stx_event_bindings||[];if(c.length>0){let p=b9(c);if(p){let q0=Q.lastIndexOf("</body>");Q=q0===-1?Q+p:Q.slice(0,q0)+p+`
3593
+ `+Q}{let{scanScriptTags:c}=await o("stx/signal-processing",()=>import("./chunk-8emkx9ja.js")),p=[];for(let q0 of c(Q)){if(!/\bserver\b/i.test(q0.attrs))continue;let G0=q0.start+q0.fullMatch.indexOf(">")+1,D0=kQ(Q,G0);if(D0===-1)continue;let S0=D0+9;while(S0<Q.length&&/\s/.test(Q[S0]))S0++;p.push({start:q0.start,end:S0})}for(let q0=p.length-1;q0>=0;q0--){let{start:G0,end:D0}=p[q0];Q=Q.substring(0,G0)+Q.substring(D0)}}let C0=z9(Q,X);if(C0.hasScoped)Q=C0.html;let Z0=Z.__stx_event_bindings||[],H0=!1,k0=[],E0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:d0}=await o("stx/signal-processing",()=>import("./chunk-8emkx9ja.js"));for(let c of d0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))k0.push({match:c.fullMatch,attrs:c.attrs,content:c.body});for(let{match:c,attrs:p,content:q0}of k0){H0=!0;let G0=q0;V$(q0,X,J.strict,Z.__originalFilePath);let D0=await D9(q0,{eventBindings:Z0,attrs:p,hasColonDirectives:E0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(c,()=>D0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let c=Z.__stx_event_bindings||[];if(c.length>0){let p=b9(c);if(p){let q0=Q.lastIndexOf("</body>");Q=q0===-1?Q+p:Q.slice(0,q0)+p+`
3594
3594
  `+Q.slice(q0)}Z.__stx_event_bindings=[]}}if(!y7(Q)&&C7(Q))Q=await W9(Q,G);if(Q=S7(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=_4(Q,Z.cspNonce);return Q}var PQ=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],vQ=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],fQ=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function xQ($){let Z=[],X=[];return gQ($,Z),hQ($,Z,X),uQ($,X),dQ($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function gQ($,Z){let X=($.match(/\{\{/g)||[]).length,J=($.match(/\}\}/g)||[]).length;if(X!==J)Z.push({type:"expression",message:`Unclosed expression brackets: found ${X} opening '{{' and ${J} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function hQ($,Z,X){for(let J of PQ){let Y=new RegExp(`${J.open}(?:\\s|\\()`,"g"),Q=new RegExp(J.close,"g"),G=($.match(Y)||[]).length,z=($.match(Q)||[]).length;if(J.altClose){let q=new RegExp(J.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${J.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${J.close} tag(s)`});else if(z>G)X.push({type:"directive",message:`Extra ${J.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${J.close} tags`})}}function uQ($,Z){for(let X of vQ)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function dQ($,Z){for(let X of fQ)if(X.pattern.test($))Z.push({type:"expression",message:`Security warning: ${X.message}`,suggestion:"Remove dangerous code from template expressions"})}function mQ($,Z){let X=$.slice(0,Z).split(`
3595
3595
  `);return{line:X.length,column:X[X.length-1].length+1}}function lQ($,Z,X){let J=[];switch($){case"if":case"elseif":case"unless":if(X.length===0)J.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(X.length===0||!X[0].includes(" as "))J.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(X.length===0)J.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(X.length===0)J.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(X.length===0)J.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(X.length===0)J.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return J}function cQ($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function pQ($){let Z=$.matchAll(/@([a-z]+)/gi),X=new Set;for(let J of Z){let Y=J[1].toLowerCase();if(!Y.startsWith("end"))X.add(Y)}return Array.from(X)}import r0 from"path";import $2 from"process";var X8=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"],o6=new Set(X8),iQ=new Set(["props","$props","defineProps"]),nQ=new Set(["stx","@stacksjs/stx"]),s6=e1(128);function oQ($){let Z=[],X=0,J=$.split(`
3596
3596
  `);for(let Y of J){let Q=X,G=null,z=!1;for(let q=0;q<Y.length;q++){let K=Y[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Y.length&&Y[q+1]==="/")break;if(K==="{")X++;else if(K==="}")X--}if(Q===0){let q=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let K=Y.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let W=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...W)}}}}return[...new Set(Z)]}function sQ($){let Z=$;Z=Z.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Z=Z.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Z=Z.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function X(J){if(!J.includes(":"))return J;let Y=[],Q="",G=0,z=0,q=null;for(let K=0;K<J.length;K++){let U=J[K];if(q){if(Q+=U,U===q)q=null;continue}if(U==='"'||U==="'"||U==="`"){q=U,Q+=U;continue}if(U==="<")G++;else if(U===">"&&G>0)G--;else if(U==="(")z++;else if(U===")")z--;if(U===","&&G===0&&z===0){Y.push(Q),Q="";continue}Q+=U}if(Q)Y.push(Q);return Y.map((K)=>{let U=K.trim(),W=U.startsWith("..."),H=W?U.slice(3):U,j=-1,B=0;for(let R=0;R<H.length;R++)if(H[R]==="<")B++;else if(H[R]===">")B--;else if(H[R]===":"&&B===0){j=R;break}if(j===-1)return K;let O=H.substring(0,j).trim().replace(/\?$/,""),V=H.substring(j+1),L=-1,F=0;for(let R=0;R<V.length;R++)if(V[R]==="<")F++;else if(V[R]===">")F--;else if(V[R]==="="&&F===0){L=R;break}let w=W?"...":"";if(L!==-1)return`${w}${O} = ${V.substring(L+1).trim()}`;return`${w}${O}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(J,Y,Q)=>{if(!Q.includes(":"))return J;return`${Y}(${X(Q)})`});{let J=/\b(function\s+\w*\s*)\(/g,Y,Q=[];while((Y=J.exec(Z))!==null){let G=Y.index+Y[0].length-1,z=1,q=G+1,K=0,U=null;while(q<Z.length&&z>0){let j=Z[q];if(U){if(j===U)U=null;q++;continue}if(j==='"'||j==="'"||j==="`"){U=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let W=Z.substring(G+1,q);if(!W.includes(":"))continue;let H=X(W);Q.push({start:G+1,end:q,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Q[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(J,Y)=>{if(!Y.includes(":"))return J;if(Y.includes("{")||Y.includes("}"))return J;return`(${Y.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
@@ -3612,11 +3612,11 @@ ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Q,name:G,value:
3612
3612
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))J+=`
3613
3613
  ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function QG($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=z8(J);if(Q!==-1){if(B0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3614
3614
  ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function $8($,Z){let X=e($,Z)??e(`(${$})`,Z);if(X!==void 0)return X;if(!/\bprocess\b/.test($))return;let J={...Z,process:Object.freeze({env:{...$2.env}})};try{return Function(...Object.keys(J),`'use strict'; return (${$});`)(...Object.values(J))}catch{try{return Function(...Object.keys(J),`'use strict'; return ${$};`)(...Object.values(J))}catch{return}}}async function GG($,Z,X){let J=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Q of J){let[,,G,z]=Q;try{let q=z.trim().replace(/;$/,""),K=$8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Y=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Q of Y){let[,,G,z]=Q;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=$8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function zG($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=Z?Z[1]:"",J=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:X,templateWithoutScript:J}}function qG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var N2=new g1(500),A9=new g1(1000),H8=33554432,D$=H8;function UG($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===D$)return;D$=Z,M9.setMaxBytes(Z)}var M9=new g1(2000,{maxBytes:H8,sizeOf:($)=>$.output.length});function WG($){let Z=new WeakSet;try{let X=(J)=>{if(J===void 0)return{__stxType:"undefined"};if(typeof J==="bigint")return{__stxType:"bigint",value:J.toString()};if(typeof J==="function"||typeof J==="symbol")throw TypeError("Non-serializable component input");if(J===null||typeof J!=="object")return J;if(Z.has(J))throw TypeError("Circular component input");if(Z.add(J),J instanceof Date)return{__stxType:"date",value:J.toISOString()};if(Array.isArray(J))return J.map(X);let Y={};for(let Q of Object.keys(J).sort())Y[Q]=X(J[Q]);return Y};return JSON.stringify(X($))}catch{return null}}function q8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function HG($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function F1($){return!HG($)}var N9=new Map;function w$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=N9.get(Z);if(X)return X;if(N9.size>=16)N9.clear();let J=new Bun.Transpiler($);return N9.set(Z,J),J}function w1($){try{let Z=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Z=Z.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let X=[];Z=Z.replace(/\{!![\s\S]*?!!\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`}),Z=Z.replace(/\{\{\{[\s\S]*?\}\}\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`}),Z=Z.replace(/\{\{[\s\S]*?\}\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`});let Y=w$({loader:"ts",target:"browser",define:a1()}).transformSync(Z);for(let Q=0;Q<X.length;Q++)Y=Y.replace(`"__STX_EXPR_${Q}__"`,X[Q]),Y=Y.replace(`'__STX_EXPR_${Q}__'`,X[Q]);return Y}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function jG($){let Z=[],X=new Set,J=0,Y=0,Q=$.length,G=(U)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===U){Y++;return}Y++}},z=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let U=1;while(Y<Q&&U>0)if($[Y]==="{")U++,Y++;else if($[Y]==="}")U--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")z();else Y++;continue}Y++}},q=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3615
- `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},K=()=>{if(J!==0)return;let U=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(U){let B=U[2].split(",").map((_)=>{let O=_.trim().split(":");return O[O.length-1].trim()});for(let _ of B)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let W=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!X.has(B))Z.push(B),X.add(B);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!X.has(B))Z.push(B),X.add(B);return}let j=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!X.has(B))Z.push(B),X.add(B)}};while(Y<Q){if(q())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){z();continue}if($[Y]==="{"){J++,Y++;continue}if($[Y]==="}"){J--,Y++;continue}if(J===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))K();Y++}return Z}function BG($){let Z=[],X=0,J=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")X++;else if(G===")"||G==="]"||G==="}")X--;else if(G===","&&X===0)Z.push($.slice(J,Q)),J=Q+1}if(J<$.length)Z.push($.slice(J));return Z}function _G($){let Z=0,X=null;for(let J=0;J<$.length;J++){let Y=$[J];if(X){if(Y==="\\"){J++;continue}if(Y===X)X=null;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[J-1],G=$[J+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return J}}return-1}function VG($,Z){try{let X=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!X)return;let J=X.index-1;while(J>=0&&/\s/.test($[J]))J--;if($[J]!=="}")return;let Y=J,Q=0,G=-1;for(;J>=0;J--){let q=$[J];if(q==="}")Q++;else if(q==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let q of BG(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let U=_G(K);if(U===-1)continue;let W=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(W))continue;if(Z[W]!==void 0)continue;let H=K.slice(U+1).trim();if(!H)continue;try{let j=Object.keys(Z),B=Function(...j,`"use strict"; return (${H});`);Z[W]=B(...j.map((_)=>Z[_]))}catch{}}}catch{}}async function F9($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(O)=>O.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),z=(O)=>O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=X.__importedComponents;if(q){for(let O of[Q,Q.toLowerCase(),G(Q),z(Q)])if(q.has(O))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,W=U??h.dirname(J),H=[],j=(O)=>{if(O&&!H.includes(O))H.push(O)},B=X.__originalFilePath;if(B)j(h.join(h.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(h.join(h.dirname(J),"components")),j(Y.componentsDir),U)j(h.resolve(U,"resources/views/components")),j(h.resolve(U,"resources/components")),j(h.resolve(U,"src/components")),j(h.resolve(U,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let O of _)j(typeof O==="string"?O:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(h.resolve(h.dirname(J),`${Q}.stx`));for(let O of H){let V=h.isAbsolute(O)?O:h.resolve(W,O);for(let L of K)if(await a(h.join(V,L)))return!0}return!1}function LG($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function OG($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function FG($){let Z=new Set,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let J of $){let Y;while((Y=X.exec(J))!==null)Z.add(Y[1]);X.lastIndex=0}return[...Z]}async function D1($,Z,X,J,Y,Q,G,z=new Set,q){let{extractVariables:K}=await o("stx/variable-extractor",()=>import("./chunk-y1segp76.js")),U=z??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let W=new Set(U);W.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&LG(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),_=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),O=$.endsWith(".stx")?$.slice(0,-4):$,V=null,L=Y.__importedComponents;if(L){let d=[O,O.toLowerCase(),B(O),_(O)];for(let m of d)if(L.has(m)){V=L.get(m);break}}let F=[];if(!V){let d=[`${O}.stx`,`${B(O)}.stx`,`${_(O)}.stx`],m=[...new Set(d)],K0=Y.__originalFilePath,i=[];if(K0){let F0=h.join(h.dirname(K0),"components");i.push(F0)}if(J)i.push(J);let L0=G._rootComponentsDir;if(typeof L0==="string"&&!i.includes(L0))i.push(L0);let O0=h.join(h.dirname(Q),"components");if(!i.includes(O0))i.push(O0);if(G.componentsDir&&G.componentsDir!==J&&!i.includes(G.componentsDir))i.push(G.componentsDir);let P0=typeof G.root==="string"?h.resolve(G.root):void 0,j1=P0??h.dirname(Q),b0=[];if(P0)b0.push(h.resolve(P0,"resources/views/components")),b0.push(h.resolve(P0,"resources/components")),b0.push(h.resolve(P0,"src/components")),b0.push(h.resolve(P0,"components"));b0.push(h.resolve(import.meta.dir,"components"));for(let F0 of b0)if(!i.includes(F0))i.push(F0);let n=G._pluginComponentDirs;if(Array.isArray(n)){for(let F0 of n)if(typeof F0==="string"&&!i.includes(F0))i.push(F0)}if(G.fallbackComponentsDir&&!i.includes(G.fallbackComponentsDir))i.push(G.fallbackComponentsDir);let m0=[...new Set(i.map((F0)=>{if(!F0)return F0;return h.isAbsolute(F0)?F0:h.resolve(j1,F0)}))];i.length=0,i.push(...m0);let I2=`${O}\x00${Q}\x00${m0.join("\x00")}`,k9=A9.get(I2);if(k9)if(await a(k9))V=k9;else A9.delete(I2);if(!V&&(O.startsWith("./")||O.startsWith("../")))V=h.resolve(h.dirname(Q),`${O}.stx`),F.push(V);else if(!V)for(let F0 of i){if(!F0)continue;for(let T2 of m){let E2=h.join(F0,T2);if(F.push(E2),await a(E2)){V=E2;break}}if(V)break;if(!V)try{let T2=await import("fs");if(!T2.statSync(F0,{throwIfNoEntry:!1})?.isDirectory())continue;let D8=8,I9=[{path:F0,depth:0}];while(I9.length>0&&!V){let b2=I9.pop();if(b2.depth>=D8)continue;let k$;try{k$=T2.readdirSync(b2.path,{withFileTypes:!0})}catch{continue}for(let y2 of k$){if(!y2.isDirectory())continue;if(y2.name==="node_modules"||y2.name.startsWith("."))continue;let I$=h.join(b2.path,y2.name);for(let N8 of m){let T9=h.join(I$,N8);if(F.push(T9),await a(T9)){V=T9;break}}if(V)break;I9.push({path:I$,depth:b2.depth+1})}}}catch{}if(V)break}if(V)A9.set(I2,V)}if(!V||!await a(V)){let d=F.length>0?`
3615
+ `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},K=()=>{if(J!==0)return;let U=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(U){let B=U[2].split(",").map((_)=>{let O=_.trim().split(":");return O[O.length-1].trim()});for(let _ of B)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let W=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!X.has(B))Z.push(B),X.add(B);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!X.has(B))Z.push(B),X.add(B);return}let j=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!X.has(B))Z.push(B),X.add(B)}};while(Y<Q){if(q())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){z();continue}if($[Y]==="{"){J++,Y++;continue}if($[Y]==="}"){J--,Y++;continue}if(J===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))K();Y++}return Z}function BG($){let Z=[],X=0,J=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")X++;else if(G===")"||G==="]"||G==="}")X--;else if(G===","&&X===0)Z.push($.slice(J,Q)),J=Q+1}if(J<$.length)Z.push($.slice(J));return Z}function _G($){let Z=0,X=null;for(let J=0;J<$.length;J++){let Y=$[J];if(X){if(Y==="\\"){J++;continue}if(Y===X)X=null;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[J-1],G=$[J+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return J}}return-1}function VG($,Z){try{let X=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!X)return;let J=X.index-1;while(J>=0&&/\s/.test($[J]))J--;if($[J]!=="}")return;let Y=J,Q=0,G=-1;for(;J>=0;J--){let q=$[J];if(q==="}")Q++;else if(q==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let q of BG(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let U=_G(K);if(U===-1)continue;let W=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(W))continue;if(Z[W]!==void 0)continue;let H=K.slice(U+1).trim();if(!H)continue;try{let j=Object.keys(Z),B=Function(...j,`"use strict"; return (${H});`);Z[W]=B(...j.map((_)=>Z[_]))}catch{}}}catch{}}async function F9($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(O)=>O.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),z=(O)=>O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=X.__importedComponents;if(q){for(let O of[Q,Q.toLowerCase(),G(Q),z(Q)])if(q.has(O))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,W=U??h.dirname(J),H=[],j=(O)=>{if(O&&!H.includes(O))H.push(O)},B=X.__originalFilePath;if(B)j(h.join(h.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(h.join(h.dirname(J),"components")),j(Y.componentsDir),U)j(h.resolve(U,"resources/views/components")),j(h.resolve(U,"resources/components")),j(h.resolve(U,"src/components")),j(h.resolve(U,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let O of _)j(typeof O==="string"?O:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(h.resolve(h.dirname(J),`${Q}.stx`));for(let O of H){let V=h.isAbsolute(O)?O:h.resolve(W,O);for(let L of K)if(await a(h.join(V,L)))return!0}return!1}function LG($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function OG($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function FG($){let Z=new Set,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let J of $){let Y;while((Y=X.exec(J))!==null)Z.add(Y[1]);X.lastIndex=0}return[...Z]}async function D1($,Z,X,J,Y,Q,G,z=new Set,q){let{extractVariables:K}=await o("stx/variable-extractor",()=>import("./chunk-e4akvata.js")),U=z??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let W=new Set(U);W.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&LG(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),_=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),O=$.endsWith(".stx")?$.slice(0,-4):$,V=null,L=Y.__importedComponents;if(L){let d=[O,O.toLowerCase(),B(O),_(O)];for(let m of d)if(L.has(m)){V=L.get(m);break}}let F=[];if(!V){let d=[`${O}.stx`,`${B(O)}.stx`,`${_(O)}.stx`],m=[...new Set(d)],K0=Y.__originalFilePath,i=[];if(K0){let F0=h.join(h.dirname(K0),"components");i.push(F0)}if(J)i.push(J);let L0=G._rootComponentsDir;if(typeof L0==="string"&&!i.includes(L0))i.push(L0);let O0=h.join(h.dirname(Q),"components");if(!i.includes(O0))i.push(O0);if(G.componentsDir&&G.componentsDir!==J&&!i.includes(G.componentsDir))i.push(G.componentsDir);let P0=typeof G.root==="string"?h.resolve(G.root):void 0,j1=P0??h.dirname(Q),b0=[];if(P0)b0.push(h.resolve(P0,"resources/views/components")),b0.push(h.resolve(P0,"resources/components")),b0.push(h.resolve(P0,"src/components")),b0.push(h.resolve(P0,"components"));b0.push(h.resolve(import.meta.dir,"components"));for(let F0 of b0)if(!i.includes(F0))i.push(F0);let n=G._pluginComponentDirs;if(Array.isArray(n)){for(let F0 of n)if(typeof F0==="string"&&!i.includes(F0))i.push(F0)}if(G.fallbackComponentsDir&&!i.includes(G.fallbackComponentsDir))i.push(G.fallbackComponentsDir);let m0=[...new Set(i.map((F0)=>{if(!F0)return F0;return h.isAbsolute(F0)?F0:h.resolve(j1,F0)}))];i.length=0,i.push(...m0);let I2=`${O}\x00${Q}\x00${m0.join("\x00")}`,k9=A9.get(I2);if(k9)if(await a(k9))V=k9;else A9.delete(I2);if(!V&&(O.startsWith("./")||O.startsWith("../")))V=h.resolve(h.dirname(Q),`${O}.stx`),F.push(V);else if(!V)for(let F0 of i){if(!F0)continue;for(let T2 of m){let E2=h.join(F0,T2);if(F.push(E2),await a(E2)){V=E2;break}}if(V)break;if(!V)try{let T2=await import("fs");if(!T2.statSync(F0,{throwIfNoEntry:!1})?.isDirectory())continue;let D8=8,I9=[{path:F0,depth:0}];while(I9.length>0&&!V){let b2=I9.pop();if(b2.depth>=D8)continue;let k$;try{k$=T2.readdirSync(b2.path,{withFileTypes:!0})}catch{continue}for(let y2 of k$){if(!y2.isDirectory())continue;if(y2.name==="node_modules"||y2.name.startsWith("."))continue;let I$=h.join(b2.path,y2.name);for(let N8 of m){let T9=h.join(I$,N8);if(F.push(T9),await a(T9)){V=T9;break}}if(V)break;I9.push({path:I$,depth:b2.depth+1})}}}catch{}if(V)break}if(V)A9.set(I2,V)}if(!V||!await a(V)){let d=F.length>0?`
3616
3616
  Searched paths:
3617
3617
  ${F.map((m)=>` - ${m}`).join(`
3618
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(V);let w;if(N2.has(V))w=N2.get(V);else try{w=await Bun.file(V).text(),N2.set(V,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",C2,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[d,m]of Object.entries(Y))if(!d.startsWith("__")||R.has(d))D[d]=m;let A=X;if(X.includes("@include")){let{processIncludes:d}=await o("stx/includes",()=>import("./chunk-71nr1avx.js"));A=await d(X,Y,Q,G,q)}let k=n0(A),N=[],M=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let K0=k.scripts[Number(m)]||"",i=K0.match(/^<script\b([^>]*)>/i)?.[1]||"",L0=i.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),O0=!L0||["module","text/javascript","application/javascript"].includes(L0);if(!/\bserver\b/i.test(i)&&O0)return N.push(K0),"";return K0}),{extractSlotContent:T}=await o("stx/slots",()=>import("./chunk-gkmtkzdm.js")),I=T(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[d,m]of I.namedSlots)y[d]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${O.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,C={...D,$uid:b,...Z,props:Z,slot:M,$slots:y,__processedComponents:W,__sections:{},__stx_signals_gate:J1(w)||OG(X)};VG(w,C);let v=w,P=t2(v);if(P)v=P.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,x=[...w.matchAll(g)],$0=[],a0=x.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),M0=null,C0=null,Z0=null,H0=0,k0=null;if(UG(G),a0&&D$>0){let d=WG({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(d!==null){M0=`${V}\x00${M1(w)}\x00${d}`;let m=M9.get(M0);if(m){for(let K0 of m.dependencies)q.add(K0);if(h$(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let K0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let i of m.preservedClientExpressions)K0.add(i);Y.__stx_preserved_client_expressions=[...K0]}return m.output}C0=new Set(q),Z0=x$(Y),H0=E.n,k0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let d of x){let m=d[1]||"",K0=d[2]||"",i=m.includes("server");if(F1(m)&&K0.trim())K0=w1(K0);if(i&&K0)try{await K(K0,C,V)}catch(O0){}if(!i){let O0=K0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=O0.includes("{{")&&O0.includes("}}"),j1=O0.includes("{!!")&&O0.includes("!!}");if(P0||j1)O0=S9(O0,C);let b0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");$0.push(`<script${b0}>${O0}</script>`)}}let E0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),d0=E0?E0[1]:"",c=E0?E0[2]:"",p="",q0=d0&&/\bscoped\b/i.test(d0);if(E0)p=`<style${d0}>${c}</style>`;let G0=v;if(G0=G0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),E0)G0=G0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(G0=G0.replace(d,(K0,i)=>{let L0=i.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(L0)m.push(`<style${L0[1]}>${L0[2]}</style>`);return""}),G0=G0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)p=`${p}${m.join(`
3619
- `)}`}if(X&&G0.includes("{{ text || slot }}"))G0=G0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:D0}=await o("stx/slots",()=>import("./chunk-gkmtkzdm.js")),{defaultSlot:S0,namedSlots:Z2}=I;G0=await D0(G0,S0,Z2,C);let M2=$0.some((d)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),k2=FG($0),S=Array.isArray(C.__stx_client_signal_names)?C.__stx_client_signal_names:[];if(k2.length>0||S.length>0)C.__stx_client_signal_names=[...new Set([...S,...k2])];let f={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:M2||$0.length===0,defaultLayout:void 0};C.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let s=await O$(G0,C,V,f,q),r=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let d of s.matchAll(/\{\{([\s\S]*?)\}\}/g))r.add(d[1].trim());if(r.size>0)Y.__stx_preserved_client_expressions=[...r];let Y0=b,Q0=s;if(M2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${q8(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${q8(j)}"`:"";Q0=`<div data-stx-scope="${Y0}"${d}${m}>${s}</div>`;let K0=await Promise.all($0.map(async(i)=>{let L0=i.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!L0)return i;let[,O0,P0]=L0,{vendorStyleTags:j1,factoryBody:b0}=await DG(P0,V,G.buildMode==="compile"),n=j?null:y9(Y,b0),m0=n?`window.__stxComponentFactories[${JSON.stringify(n)}](${JSON.stringify(Y0)});`:`(${b0})(${JSON.stringify(Y0)});`;if(j)return`${j1}<script type="stx/island" data-stx-island="${Y0}" data-stx-scoped${O0}>${m0}</script>`;return`${j1}<script data-stx-scoped data-stx-run="always"${O0}>${m0}</script>`}));if(Q0=Q0+`
3618
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(V);let w;if(N2.has(V))w=N2.get(V);else try{w=await Bun.file(V).text(),N2.set(V,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",C2,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[d,m]of Object.entries(Y))if(!d.startsWith("__")||R.has(d))D[d]=m;let A=X;if(X.includes("@include")){let{processIncludes:d}=await o("stx/includes",()=>import("./chunk-f4k2a7vs.js"));A=await d(X,Y,Q,G,q)}let k=n0(A),N=[],M=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let K0=k.scripts[Number(m)]||"",i=K0.match(/^<script\b([^>]*)>/i)?.[1]||"",L0=i.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),O0=!L0||["module","text/javascript","application/javascript"].includes(L0);if(!/\bserver\b/i.test(i)&&O0)return N.push(K0),"";return K0}),{extractSlotContent:T}=await o("stx/slots",()=>import("./chunk-m7xnzt2t.js")),I=T(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[d,m]of I.namedSlots)y[d]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${O.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,C={...D,$uid:b,...Z,props:Z,slot:M,$slots:y,__processedComponents:W,__sections:{},__stx_signals_gate:J1(w)||OG(X)};VG(w,C);let v=w,P=t2(v);if(P)v=P.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,x=[...w.matchAll(g)],$0=[],a0=x.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),M0=null,C0=null,Z0=null,H0=0,k0=null;if(UG(G),a0&&D$>0){let d=WG({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(d!==null){M0=`${V}\x00${M1(w)}\x00${d}`;let m=M9.get(M0);if(m){for(let K0 of m.dependencies)q.add(K0);if(h$(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let K0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let i of m.preservedClientExpressions)K0.add(i);Y.__stx_preserved_client_expressions=[...K0]}return m.output}C0=new Set(q),Z0=x$(Y),H0=E.n,k0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let d of x){let m=d[1]||"",K0=d[2]||"",i=m.includes("server");if(F1(m)&&K0.trim())K0=w1(K0);if(i&&K0)try{await K(K0,C,V)}catch(O0){}if(!i){let O0=K0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=O0.includes("{{")&&O0.includes("}}"),j1=O0.includes("{!!")&&O0.includes("!!}");if(P0||j1)O0=S9(O0,C);let b0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");$0.push(`<script${b0}>${O0}</script>`)}}let E0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),d0=E0?E0[1]:"",c=E0?E0[2]:"",p="",q0=d0&&/\bscoped\b/i.test(d0);if(E0)p=`<style${d0}>${c}</style>`;let G0=v;if(G0=G0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),E0)G0=G0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(G0=G0.replace(d,(K0,i)=>{let L0=i.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(L0)m.push(`<style${L0[1]}>${L0[2]}</style>`);return""}),G0=G0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)p=`${p}${m.join(`
3619
+ `)}`}if(X&&G0.includes("{{ text || slot }}"))G0=G0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:D0}=await o("stx/slots",()=>import("./chunk-m7xnzt2t.js")),{defaultSlot:S0,namedSlots:Z2}=I;G0=await D0(G0,S0,Z2,C);let M2=$0.some((d)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),k2=FG($0),S=Array.isArray(C.__stx_client_signal_names)?C.__stx_client_signal_names:[];if(k2.length>0||S.length>0)C.__stx_client_signal_names=[...new Set([...S,...k2])];let f={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:M2||$0.length===0,defaultLayout:void 0};C.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let s=await O$(G0,C,V,f,q),r=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let d of s.matchAll(/\{\{([\s\S]*?)\}\}/g))r.add(d[1].trim());if(r.size>0)Y.__stx_preserved_client_expressions=[...r];let Y0=b,Q0=s;if(M2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${q8(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${q8(j)}"`:"";Q0=`<div data-stx-scope="${Y0}"${d}${m}>${s}</div>`;let K0=await Promise.all($0.map(async(i)=>{let L0=i.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!L0)return i;let[,O0,P0]=L0,{vendorStyleTags:j1,factoryBody:b0}=await DG(P0,V,G.buildMode==="compile"),n=j?null:y9(Y,b0),m0=n?`window.__stxComponentFactories[${JSON.stringify(n)}](${JSON.stringify(Y0)});`:`(${b0})(${JSON.stringify(Y0)});`;if(j)return`${j1}<script type="stx/island" data-stx-island="${Y0}" data-stx-scoped${O0}>${m0}</script>`;return`${j1}<script data-stx-scoped data-stx-run="always"${O0}>${m0}</script>`}));if(Q0=Q0+`
3620
3620
  `+K0.join(`
3621
3621
  `),p)Q0+=`
3622
3622
  `+p}else{if(p)Q0+=`
@@ -3639,7 +3639,7 @@ ${t.yellow}${t.bold}Message:${t.reset} ${Z}
3639
3639
  `,z)U+=`
3640
3640
  ${t.blue}${t.bold}Context:${t.reset}
3641
3641
  ${t.dim}${z}${t.reset}
3642
- `;return U}function __(){N2.clear(),A9.clear(),M9.clear()}function V_(){return{size:N2.size,maxSize:500}}var R$=e1(128);async function DG($,Z,X){let J=M1($,Z,X),Y=R$.get(J);if(Y){if(W8(Y.deps))return Y;R$.delete(J)}let Q=A$($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=M$(Q.styles);G=l1(G).code;let{hasUserImports:q,bundleClientScript:K}=await o("stx/client-script-bundler",()=>import("./chunk-43r6p08p.js")),U=[],W=!1;if(q(G)){let V=G;G=await K(V,Z,{projectRoot:process.cwd(),minify:X,collectInputs:U}),W=G===V}let{stripStxRuntimeImports:H}=await o("stx/signal-processing",()=>import("./chunk-hzw1ekq3.js"));G=H(G);let j=t0(G),B=jG(j),_=`function(__scopeId) {
3642
+ `;return U}function __(){N2.clear(),A9.clear(),M9.clear()}function V_(){return{size:N2.size,maxSize:500}}var R$=e1(128);async function DG($,Z,X){let J=M1($,Z,X),Y=R$.get(J);if(Y){if(W8(Y.deps))return Y;R$.delete(J)}let Q=A$($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=M$(Q.styles);G=l1(G).code;let{hasUserImports:q,bundleClientScript:K}=await o("stx/client-script-bundler",()=>import("./chunk-7ej1d910.js")),U=[],W=!1;if(q(G)){let V=G;G=await K(V,Z,{projectRoot:process.cwd(),minify:X,collectInputs:U}),W=G===V}let{stripStxRuntimeImports:H}=await o("stx/signal-processing",()=>import("./chunk-8emkx9ja.js"));G=H(G);let j=t0(G),B=jG(j),_=`function(__scopeId) {
3643
3643
  ${x1("const",[...K8,...B],j)}
3644
3644
  const __scope = window.stx._scopes = window.stx._scopes || {};
3645
3645
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3738,7 +3738,7 @@ else {
3738
3738
  // STX: auto-generated event bindings
3739
3739
  ${$.map((X,J)=>hG(X,J)).join(`
3740
3740
  `)}`}function V8($){let Z=[],X=new Set,J=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=J.length,G=0;while(G<Q){let z=J[G];if(z==="'"||z==='"'||z==="`"){let q=z;if(G++,q==="`"){let K=0;while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]==="`"&&K===0){G++;break}if(J[G]==="$"&&J[G+1]==="{"){K++,G+=2;continue}if(J[G]==="}"&&K>0){K--,G++;continue}G++}}else while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]===q){G++;break}G++}continue}if(z==="/"&&J[G+1]==="/"){while(G<Q&&J[G]!==`
3741
- `)G++;continue}if(z==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Y++,G++;continue}if(z==="}"){Y--,G++;continue}if(Y===0){let q=J.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}let U=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(U){U[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),_=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=U[0].length;continue}let W=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}}G++}return Z}var dG=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function mG($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let j;while((j=X.exec(H))!==null){let B=j[0];if(!dG.has(B))Z.add(B)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)J(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)J(Q[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=z.exec($))!==null)J(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=q.exec($))!==null)J(Q[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=K.exec($))!==null)J(Q[1]);let U=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=W.exec($))!==null)J(Q[1]);return Z}async function D9($,Z={}){let X=$,J="",Y=!1,Q=[],G=A$(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let z=M$(G.styles),q=l1(X);X=q.code,Q=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:U}=await o("stx/client-script-bundler",()=>import("./chunk-43r6p08p.js"));if(K(X))X=await U(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let L=w8(X);X=L.code,J=R8(L.stxImports,L.browserImports.filter((F)=>!Q.includes(F)))}if(J=`${p5(X,Z.serverData)}${J}`,X=t0(X),!Y&&F1(Z.attrs||""))X=w1(X);let W=uG(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let L=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),F=`type="module" data-stx-scoped${L?` ${L}`:""}`;return`${z}<script ${F}>
3741
+ `)G++;continue}if(z==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Y++,G++;continue}if(z==="}"){Y--,G++;continue}if(Y===0){let q=J.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}let U=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(U){U[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),_=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=U[0].length;continue}let W=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}}G++}return Z}var dG=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function mG($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let j;while((j=X.exec(H))!==null){let B=j[0];if(!dG.has(B))Z.add(B)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)J(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)J(Q[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=z.exec($))!==null)J(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=q.exec($))!==null)J(Q[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=K.exec($))!==null)J(Q[1]);let U=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=W.exec($))!==null)J(Q[1]);return Z}async function D9($,Z={}){let X=$,J="",Y=!1,Q=[],G=A$(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let z=M$(G.styles),q=l1(X);X=q.code,Q=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:U}=await o("stx/client-script-bundler",()=>import("./chunk-7ej1d910.js"));if(K(X))X=await U(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let L=w8(X);X=L.code,J=R8(L.stxImports,L.browserImports.filter((F)=>!Q.includes(F)))}if(J=`${p5(X,Z.serverData)}${J}`,X=t0(X),!Y&&F1(Z.attrs||""))X=w1(X);let W=uG(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let L=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),F=`type="module" data-stx-scoped${L?` ${L}`:""}`;return`${z}<script ${F}>
3742
3742
  ${m1(`${J}${X}
3743
3743
  ${W}`)}
3744
3744
  </script>`}let B=O8($),_=/function __stx_setup_/.test(X),O=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function V(L){let F=L.length>0?`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{pf as a}from"./chunk-ggrzaenz.js";import"./chunk-9rkntp0z.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{a as startInteractive};
2
+ import{pf as a}from"./chunk-nh21517m.js";import"./chunk-4cqgbcy7.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{a as startInteractive};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{hf as c,if as d,jf as e,kf as f,lf as g,mf as h}from"./chunk-bxskmetn.js";import{Ug as a,Xg as b}from"./chunk-0hdkedwq.js";import"./chunk-cb74rvec.js";import"./chunk-9n0gvfrg.js";import"./chunk-9rkntp0z.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
2
+ import{hf as c,if as d,jf as e,kf as f,lf as g,mf as h}from"./chunk-jbfpc4z7.js";import{Ug as a,Xg as b}from"./chunk-an2539bs.js";import"./chunk-jrk8rhwt.js";import"./chunk-9n0gvfrg.js";import"./chunk-4cqgbcy7.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{hm as D,im as O,yp as P}from"./chunk-9rkntp0z.js";import{Su as c,Uu as h,Vu as i}from"./chunk-bf8wf3r2.js";import{av as p,dv as d}from"./chunk-sskbegsz.js";var R=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function C(z,Q,F){let J={fullTag:F,content:Q,attrs:z};if(/\bserver\b/.test(z))return{...J,type:"server"};if(/\bdata-stx-scoped\b/.test(z))return{...J,type:"client"};if(R.test(Q))return{...J,type:"signals"};if(/\bclient\b/.test(z)||/\btype\s*=\s*["']module["']/.test(z)||/\bsrc\s*=/.test(z))return{...J,type:"client"};return{...J,type:"server"}}var y=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function b(z){let Q=[],F=[],J=[],$=0;while($<z.length){let X=z.indexOf("<",$);if(X===-1)break;let j=O(z,X);if(j>X){$=j;continue}let Z=D(z,X);if(Z>X){let U=z.slice(X,Z),B=y.exec(U);if(B){let Y=C(B[1],B[2],U);switch(Y.type){case"signals":Q.push(Y);break;case"client":F.push(Y);break;case"server":J.push(Y);break}}$=Z;continue}$=X+(z.startsWith("<!--",X)?4:1)}return{signals:Q,client:F,server:J}}var S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function f(z){let Q=[],F=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,J;while((J=F.exec(z))!==null)Q.push({start:J.index,end:J.index+J[0].length});return Q}function x(z,Q){return Q.some((F)=>z>=F.start&&z<F.end)}function u(z){let Q=(z||"").trim();if(!Q)return null;if(/[\s>+~,:]/.test(Q))return null;let F={},J=Q,$=J.match(/^[a-z][\w-]*/i);if($)F.tag=$[0].toLowerCase(),J=J.slice($[0].length);while(J.length>0){let X=J.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(X){if(F.attr=X[1],X[3]!==void 0&&X[3]!=="")F.attrValue=X[3];J=J.slice(X[0].length);continue}let j=J.match(/^#([\w-]+)/);if(j){F.id=j[1],J=J.slice(j[0].length);continue}let Z=J.match(/^\.([\w-]+)/);if(Z){F.className=Z[1],J=J.slice(Z[0].length);continue}return null}if(!F.tag&&!F.attr&&!F.id&&!F.className)return null;return F}function g(z,Q){if(Q.attr){if(!(Q.attrValue===void 0?new RegExp(`\\b${Q.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Q.attr}\\s*=\\s*(["'])\\s*${Q.attrValue}\\s*\\1`,"i")).test(z))return!1}if(Q.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Q.id}\\s*\\1`,"i").test(z))return!1}if(Q.className){let F=z.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!F)return!1;if(!F[2].split(/\s+/).includes(Q.className))return!1}return!0}function E(z,Q="main"){let F=u(Q);if(!F)return null;let J=/<([a-z][\w-]*)\b([^>]*)>/gi,$=f(z),X;while((X=J.exec(z))!==null){if(x(X.index,$))continue;let j=X[1].toLowerCase(),Z=X[2]||"";if(Z.trimEnd().endsWith("/")||S.has(j))continue;if(F.tag&&F.tag!==j)continue;if(!g(Z,F))continue;let U=X[0],B=X.index+U.length,Y=new RegExp(`<(/?)${j}\\b([^>]*)>`,"gi");Y.lastIndex=B;let W=1,G;while((G=Y.exec(z))!==null){if(x(G.index,$))continue;let w=G[1]==="/";if(!w&&(G[2]||"").trimEnd().endsWith("/"))continue;if(W+=w?-1:1,W===0)return{openTag:U,openIndex:X.index,start:B,end:G.index,tagName:j}}return null}return null}var t="X-STX-Router",zz="private, no-store";function M(z){return z.headers.get("X-STX-Router")==="true"}function m(z,Q){if(!z)return Q;return z.split(",").some((J)=>J.trim().toLowerCase()===Q.toLowerCase())?z:`${z}, ${Q}`}function Fz(z){return{Vary:m(z,"X-STX-Router")}}import _ from"path";c();var o="stx-page-head:",n=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v=null;function l(){if(v!==null)return v;try{let{getRouterScript:z}=(i(),p(h));v=`<script>${z()}</script>`}catch{v=""}return v}async function Bz(z,Q){if(Q===!1)return null;if(Q&&typeof Q==="string"){let J=_.resolve(z,Q);if(await Bun.file(J).exists())return J;return null}let F=_.join(z,"app.stx");if(await Bun.file(F).exists())return F;return null}async function Uz(z,Q){try{let F=await Bun.file(z).text(),J=F,$=F.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)J=$[1].trim();let X=b(F),j=[...X.client.map((K)=>K.fullTag),...X.signals.map((K)=>K.fullTag)],Z=[],U=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,B;while((B=U.exec(F))!==null)Z.push(B[0]);let Y=J;for(let K of X.server)Y=Y.replace(K.fullTag,"");for(let K of X.client)Y=Y.replace(K.fullTag,"");Y=Y.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let W="<!--__STX_PAGE_SLOT__-->";if(Y=Y.replace(/<slot\s*\/>/gi,W).replace(/<slot\s*>\s*<\/slot>/gi,W),!Y.includes(W))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:w,defaultConfig:q,loadStxConfig:H}=await import("./chunk-60c5bvke.js"),A=await H(),V={__filename:z,__dirname:_.dirname(z)};for(let K of j){let I=K.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(I&&!K.includes("client")&&!K.includes('type="module"'))await w(I[1],V,z)}let k=await G(Y,V,z,{...q,...A,...Q},new Set),N=k.indexOf(W);if(N===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:k.substring(0,N),afterSlot:k.substring(N+W.length),filePath:z,shellScripts:j,shellStyles:Z}}catch(F){return console.error(`[stx] Error processing shell ${z}:`,F),null}}function Wz(z,Q,F){let J,$="",X=Q.match(n);if(X){Q=Q.replace(X[0],"");try{let Y=Buffer.from(X[1],"base64").toString("utf8"),W=Y.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(W)J=W[1].trim();$=Y.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let j=F||J||"stx App",Z=l(),U="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{hm as D,im as O,yp as P}from"./chunk-4cqgbcy7.js";import{Su as c,Uu as h,Vu as i}from"./chunk-bf8wf3r2.js";import{av as p,dv as d}from"./chunk-sskbegsz.js";var R=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function C(z,Q,F){let J={fullTag:F,content:Q,attrs:z};if(/\bserver\b/.test(z))return{...J,type:"server"};if(/\bdata-stx-scoped\b/.test(z))return{...J,type:"client"};if(R.test(Q))return{...J,type:"signals"};if(/\bclient\b/.test(z)||/\btype\s*=\s*["']module["']/.test(z)||/\bsrc\s*=/.test(z))return{...J,type:"client"};return{...J,type:"server"}}var y=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function b(z){let Q=[],F=[],J=[],$=0;while($<z.length){let X=z.indexOf("<",$);if(X===-1)break;let j=O(z,X);if(j>X){$=j;continue}let Z=D(z,X);if(Z>X){let U=z.slice(X,Z),B=y.exec(U);if(B){let Y=C(B[1],B[2],U);switch(Y.type){case"signals":Q.push(Y);break;case"client":F.push(Y);break;case"server":J.push(Y);break}}$=Z;continue}$=X+(z.startsWith("<!--",X)?4:1)}return{signals:Q,client:F,server:J}}var S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function f(z){let Q=[],F=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,J;while((J=F.exec(z))!==null)Q.push({start:J.index,end:J.index+J[0].length});return Q}function x(z,Q){return Q.some((F)=>z>=F.start&&z<F.end)}function u(z){let Q=(z||"").trim();if(!Q)return null;if(/[\s>+~,:]/.test(Q))return null;let F={},J=Q,$=J.match(/^[a-z][\w-]*/i);if($)F.tag=$[0].toLowerCase(),J=J.slice($[0].length);while(J.length>0){let X=J.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(X){if(F.attr=X[1],X[3]!==void 0&&X[3]!=="")F.attrValue=X[3];J=J.slice(X[0].length);continue}let j=J.match(/^#([\w-]+)/);if(j){F.id=j[1],J=J.slice(j[0].length);continue}let Z=J.match(/^\.([\w-]+)/);if(Z){F.className=Z[1],J=J.slice(Z[0].length);continue}return null}if(!F.tag&&!F.attr&&!F.id&&!F.className)return null;return F}function g(z,Q){if(Q.attr){if(!(Q.attrValue===void 0?new RegExp(`\\b${Q.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Q.attr}\\s*=\\s*(["'])\\s*${Q.attrValue}\\s*\\1`,"i")).test(z))return!1}if(Q.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Q.id}\\s*\\1`,"i").test(z))return!1}if(Q.className){let F=z.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!F)return!1;if(!F[2].split(/\s+/).includes(Q.className))return!1}return!0}function E(z,Q="main"){let F=u(Q);if(!F)return null;let J=/<([a-z][\w-]*)\b([^>]*)>/gi,$=f(z),X;while((X=J.exec(z))!==null){if(x(X.index,$))continue;let j=X[1].toLowerCase(),Z=X[2]||"";if(Z.trimEnd().endsWith("/")||S.has(j))continue;if(F.tag&&F.tag!==j)continue;if(!g(Z,F))continue;let U=X[0],B=X.index+U.length,Y=new RegExp(`<(/?)${j}\\b([^>]*)>`,"gi");Y.lastIndex=B;let W=1,G;while((G=Y.exec(z))!==null){if(x(G.index,$))continue;let w=G[1]==="/";if(!w&&(G[2]||"").trimEnd().endsWith("/"))continue;if(W+=w?-1:1,W===0)return{openTag:U,openIndex:X.index,start:B,end:G.index,tagName:j}}return null}return null}var t="X-STX-Router",zz="private, no-store";function M(z){return z.headers.get("X-STX-Router")==="true"}function m(z,Q){if(!z)return Q;return z.split(",").some((J)=>J.trim().toLowerCase()===Q.toLowerCase())?z:`${z}, ${Q}`}function Fz(z){return{Vary:m(z,"X-STX-Router")}}import _ from"path";c();var o="stx-page-head:",n=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v=null;function l(){if(v!==null)return v;try{let{getRouterScript:z}=(i(),p(h));v=`<script>${z()}</script>`}catch{v=""}return v}async function Bz(z,Q){if(Q===!1)return null;if(Q&&typeof Q==="string"){let J=_.resolve(z,Q);if(await Bun.file(J).exists())return J;return null}let F=_.join(z,"app.stx");if(await Bun.file(F).exists())return F;return null}async function Uz(z,Q){try{let F=await Bun.file(z).text(),J=F,$=F.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)J=$[1].trim();let X=b(F),j=[...X.client.map((K)=>K.fullTag),...X.signals.map((K)=>K.fullTag)],Z=[],U=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,B;while((B=U.exec(F))!==null)Z.push(B[0]);let Y=J;for(let K of X.server)Y=Y.replace(K.fullTag,"");for(let K of X.client)Y=Y.replace(K.fullTag,"");Y=Y.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let W="<!--__STX_PAGE_SLOT__-->";if(Y=Y.replace(/<slot\s*\/>/gi,W).replace(/<slot\s*>\s*<\/slot>/gi,W),!Y.includes(W))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:w,defaultConfig:q,loadStxConfig:H}=await import("./chunk-w8smn72c.js"),A=await H(),V={__filename:z,__dirname:_.dirname(z)};for(let K of j){let I=K.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(I&&!K.includes("client")&&!K.includes('type="module"'))await w(I[1],V,z)}let k=await G(Y,V,z,{...q,...A,...Q},new Set),N=k.indexOf(W);if(N===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:k.substring(0,N),afterSlot:k.substring(N+W.length),filePath:z,shellScripts:j,shellStyles:Z}}catch(F){return console.error(`[stx] Error processing shell ${z}:`,F),null}}function Wz(z,Q,F){let J,$="",X=Q.match(n);if(X){Q=Q.replace(X[0],"");try{let Y=Buffer.from(X[1],"base64").toString("utf8"),W=Y.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(W)J=W[1].trim();$=Y.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let j=F||J||"stx App",Z=l(),U="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$k as a,al as b,bl as c,cl as d,dl as e,el as f,fl as g,gl as h,hl as i,il as j}from"./chunk-9aw94jhm.js";import"./chunk-9rkntp0z.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{b as shouldLogBundlerDiagnostics,f as setBundlerFallbackMode,g as resolveBundlerFallback,c as recordBundleFailure,i as queueClientBundleBuild,h as hasUserImports,d as getBundleFailures,a as clientBundleDependencies,e as clearBundleFailures,j as bundleClientScript};
2
+ import{$k as a,al as b,bl as c,cl as d,dl as e,el as f,fl as g,gl as h,hl as i,il as j}from"./chunk-m3yaa0v5.js";import"./chunk-4cqgbcy7.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{b as shouldLogBundlerDiagnostics,f as setBundlerFallbackMode,g as resolveBundlerFallback,c as recordBundleFailure,i as queueClientBundleBuild,h as hasUserImports,d as getBundleFailures,a as clientBundleDependencies,e as clearBundleFailures,j as bundleClientScript};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Vi as a,Wi as b}from"./chunk-1xfqy79h.js";import"./chunk-9n0gvfrg.js";import"./chunk-9aw94jhm.js";import"./chunk-9rkntp0z.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{a as getStoreScript,b as clearStoreCache};
2
+ import{Vi as a,Wi as b}from"./chunk-w0sqz3cb.js";import"./chunk-9n0gvfrg.js";import"./chunk-m3yaa0v5.js";import"./chunk-4cqgbcy7.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{a as getStoreScript,b as clearStoreCache};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{co as a,do as b,eo as c,fo as d,go as e,ho as f,io as g,jo as h,ko as i,lo as j,mo as k,no as l}from"./chunk-9rkntp0z.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-zcmtqan3.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{l as stripStxRuntimeImports,a as scanScriptTags,k as rewriteStxImportSpecifiers,i as processSignals,g as processScriptSetup,e as preEvalLiteralReactiveIfs,b as parseLoopExpression,c as hasSignalsSyntax,j as findMarkupIndexOutsideScripts,h as extractExports,f as convertSignalLoopsToAttributes,d as convertSignalDirectivesToAttributes};
2
+ import{co as a,do as b,eo as c,fo as d,go as e,ho as f,io as g,jo as h,ko as i,lo as j,mo as k,no as l}from"./chunk-4cqgbcy7.js";import"./chunk-q68xmak4.js";import"./chunk-c0an64km.js";import"./chunk-t1k5dpbr.js";import"./chunk-52mh63sp.js";import"./chunk-9th1wd1d.js";import"./chunk-39f40yc4.js";import"./chunk-ysnk7x79.js";import"./chunk-0f1kz0x2.js";import"./chunk-ayrjwkyw.js";import"./chunk-c6fw33zh.js";import"./chunk-bf8wf3r2.js";import"./chunk-jn6m8zf7.js";import"./chunk-sskbegsz.js";export{l as stripStxRuntimeImports,a as scanScriptTags,k as rewriteStxImportSpecifiers,i as processSignals,g as processScriptSetup,e as preEvalLiteralReactiveIfs,b as parseLoopExpression,c as hasSignalsSyntax,j as findMarkupIndexOutsideScripts,h as extractExports,f as convertSignalLoopsToAttributes,d as convertSignalDirectivesToAttributes};
@@ -11,7 +11,7 @@ catch (e) {
11
11
  }
12
12
  throw e;
13
13
  }
14
- `),Z.set(V,I)}return I(...j)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:U,context:J.slice()});return U}clear(){this.pool.length=0,this.fnCache.clear()}}var uJ=new qJ;class UJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(Q){this.enabled=Q}isEnabled(){return this.enabled}setBudget(Q,J){this.budgets.set(Q,{warnThreshold:0.8,action:"warn",...J})}setBudgets(Q){for(let[J,Y]of Object.entries(Q))this.setBudget(J,Y)}removeBudget(Q){this.budgets.delete(Q)}getBudgets(){let Q={};for(let[J,Y]of this.budgets.entries())Q[J]=Y;return Q}onViolation(Q){this.violationHandlers.push(Q)}offViolation(Q){let J=this.violationHandlers.indexOf(Q);if(J!==-1)this.violationHandlers.splice(J,1)}time(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}async timeAsync(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=await J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}checkBudget(Q,J){let Y=this.budgets.get(Q);if(!Y)return;let $=J/Y.maxTime*100,Z=Y.warnThreshold!==void 0?J>=Y.maxTime*Y.warnThreshold&&J<Y.maxTime:!1,q=J>=Y.maxTime;if(!Z&&!q)return;let U={label:Q,actualTime:J,budgetTime:Y.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:Z};this.violations.push(U);while(this.violations.length>this.maxViolations)this.violations.shift();for(let F of this.violationHandlers)try{F(U)}catch{}let j=Z?`[Performance Warning] "${Q}" took ${J.toFixed(2)}ms (${$.toFixed(1)}% of ${Y.maxTime}ms budget)`:`[Performance Budget Exceeded] "${Q}" took ${J.toFixed(2)}ms (exceeded ${Y.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Y.action){case"log":console.log(j);break;case"warn":console.warn(j);break;case"error":console.error(j);break;case"throw":if(q)throw Error(j);else console.warn(j);break}}recordTime(Q,J){let Y=this.metrics.get(Q);if(Y)Y.count++,Y.totalTime+=J,Y.maxTime=Math.max(Y.maxTime,J),Y.minTime=Math.min(Y.minTime,J);else this.metrics.set(Q,{count:1,totalTime:J,maxTime:J,minTime:J})}getStats(Q){if(Q){let Y=this.metrics.get(Q);if(!Y)return{};let $=this.budgets.get(Q);return{count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:$?.maxTime,budgetUtilization:$?Y.totalTime/Y.count/$.maxTime*100:void 0}}let J={};for(let[Y,$]of this.metrics.entries()){let Z=this.budgets.get(Y);J[Y]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:Z?.maxTime,budgetUtilization:Z?$.totalTime/$.count/Z.maxTime*100:void 0}}return J}getViolations(Q){if(Q)return this.violations.filter((J)=>J.label===Q);return[...this.violations]}getViolationStats(){let Q={},J=0,Y=0;for(let $ of this.violations)if(Q[$.label]=(Q[$.label]||0)+1,$.isWarning)J++;else Y++;return{total:this.violations.length,byLabel:Q,warnings:J,errors:Y}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var d=null;function HJ(){if(!d)d=new UJ;return d}var dJ=new Proxy({},{get(Q,J){return HJ()[J]}});var WJ=[];function jJ(Q){let J=new h(Q);return WJ.push(J),J}function lJ(){for(let Q of WJ)Q.clear()}function i(Q,...J){return`${J.map((Y)=>String(Y??"")).join("\x00")}\x00${Q.length}\x00${Bun.hash(Q)}`}function nJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function oJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var N=null,l=!1,X=null,M="",w=!1,NJ=256,_=new Map,z=new Map,H=null,E=null;function x(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function c(Q,J){if(_.has(Q))_.delete(Q);else if(_.size>=NJ)_.delete(_.keys().next().value);_.set(Q,J)}function TJ(Q){let J=x(Q);if(z.has(J))z.delete(J);else if(z.size>=NJ)z.delete(z.keys().next().value);return z.set(J,Q),J}function YQ(Q){let J=z.get(Q);if(J===void 0)return;return z.delete(Q),z.set(Q,J),J}async function BJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${x(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function wJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${x(Q)}.css`),J)}catch{}}async function GJ(Q){try{let J=await import(Q);if(J&&J.CSSGenerator)return{CSSGenerator:J.CSSGenerator,config:J.config,build:J.build,defaultConfig:J.defaultConfig,extractClasses:J.extractClasses}}catch{}return null}var KJ=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],RJ=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function PJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J)){for(let Y of["node_modules","pantry"])for(let $ of KJ)Q.push(O.join(J,Y,...$));J=O.dirname(J)}return Q}function DJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"",Y=[J&&O.join(J,"Code","Tools","ts-css"),J&&O.join(J,"Code","Tools","crosswind"),J&&O.join(J,"repos","stacks-org","ts-css"),J&&O.join(J,"repos","stacks-org","crosswind"),O.join(process.cwd(),"..","ts-css"),O.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let $ of Y)Q.push(O.join($,"packages","toolkit","dist","engine","index.js")),Q.push(O.join($,"packages","toolkit","src","engine","index.ts"));if(J)Q.push(O.join(J,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return Q}async function zJ(){if(l)return N;l=!0;try{let Q=async(Z)=>{for(let q of Z){if(!await Bun.file(q).exists())continue;let U=await GJ(q);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded from ${O.dirname(O.dirname(q))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Z=O.resolve(process.env.CROSSWIND_SRC),q=await Q([Z]);if(!q)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${Z}`);return N=q,N}let J=await Q(PJ());if(J)return N=J,N;let Y=RJ;for(let Z of Y){let q=await GJ(Z);if(q){if(N=q,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded`);return N}}let $=await Q(DJ());if($)return N=$,N;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${W.reset}`),null}}function $Q(){n.clear(),N=null,l=!1,X=null,M="",_.clear(),z.clear(),E=null}var XJ=!1;async function AJ(Q){try{let J=FJ({name:"css",cwd:Q})?"css":FJ({name:"crosswind",cwd:Q})?"crosswind":null;if(!J)return null;if(J==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!XJ)XJ=!0,console.warn(`${W.yellow}[ts-css]${W.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:Y}=await import("bunfig"),$=await Y({name:J,cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!$?.path||!$.config||Object.keys($.config).length===0)return null;let Z=O.relative(Q,$.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} Loaded config from ${Z||$.path}`);return $.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[ts-css]${W.reset} Failed to load css config:`,J instanceof Error?J.message:J),null}}async function MJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-yqaky7fa.js"),$=await Y(Q);if($.css)if(typeof $.css==="string"){let Z=O.isAbsolute($.css)?$.css:O.resolve(Q,$.css);if(await Bun.file(Z).exists()){let q=await import(Z);J=q.default||q,console.log(`${W.green}[ts-css]${W.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(J={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let Z=O.isAbsolute($.css.config)?$.css.config:O.resolve(Q,$.css.config);if(await Bun.file(Z).exists()){let q=await import(Z);J={...q.default||q,...J}}}console.log(`${W.green}[ts-css]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await AJ(Q)}function EJ(Q){try{let J=new WeakSet;return x(JSON.stringify(Q??{},(Y,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(J.has($))return"[circular]";J.add($)}return $})??"")}catch{return"unhashable"}}async function SJ(Q){if(w)return M;w=!0;try{let J=await zJ();if(!J||!J.build)return w=!1,"";if(!X)X=await AJ(Q);if(!X)return w=!1,"";let Y=J.defaultConfig?.theme||{},$=X.theme||{},Z={...J.defaultConfig,...X,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),j=performance.now()-q;if(M=U.css,console.log(`${W.cyan}[ts-css]${W.reset} Built ${U.classes.size} classes in ${j.toFixed(1)}ms`),Z.output){let F=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),V=O.dirname(F);if(!fs.existsSync(V))fs.mkdirSync(V,{recursive:!0});await Bun.write(F,U.css)}return w=!1,U.css}catch(J){return console.error(`${W.red}[ts-css]${W.reset} Build error:`,J),w=!1,M}}async function ZQ(Q){X=null,await SJ(Q)}function qQ(){return M}function vJ(Q){let J=new Set,Y=/class\s*=\s*["']([^"']+)["']/gi,$=Y.exec(Q);while($!==null){for(let U of $[1].split(/\s+/))if(U.trim())J.add(U.trim());$=Y.exec(Q)}let Z=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,q=Z.exec(Q);while(q!==null){let U=q[1].match(/'([^']+)'/g);if(U){for(let j of U)for(let F of j.slice(1,-1).split(/\s+/))if(F.trim())J.add(F.trim())}q=Z.exec(Q)}return J}var n=jJ(64);async function xJ(Q,J){let Y=n.get(i(Q,J,E));if(Y!==void 0)return Y;let $=await kJ(Q,J);if($)n.set(i(Q,J,E),$);return $}async function kJ(Q,J){try{let Y=await zJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):vJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=IJ(Z,"cache");let q=[...$].sort().join(" "),U=`${E||"default"}::${q}`,j=_.get(U);if(j!==void 0)return c(U,j),j;let F=await BJ(U);if(F!==null)return c(U,F),F;if(!X)X=await MJ(Z),E=EJ(X);let V=Y.defaultConfig||Y.config,I=X||{},L=ZJ(V,I),{safelist:T,includePreflight:K,minify:k,tokenCSS:LJ}=L,o=L.config,R=new Y.CSSGenerator(o);for(let G of T)R.generate(G);for(let G of $)R.generate(G);let A=R.toCSS(K,k),r=o.shortcuts||I.shortcuts||{};for(let[G,b]of Object.entries(r)){if(!$.has(G)&&!T.includes(G))continue;let y=b.split(/\s+/).filter(Boolean);for(let D of y)R.generate(D)}A=R.toCSS(K,k);let P=A.split(`
14
+ `),Z.set(V,I)}return I(...j)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:U,context:J.slice()});return U}clear(){this.pool.length=0,this.fnCache.clear()}}var uJ=new qJ;class UJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(Q){this.enabled=Q}isEnabled(){return this.enabled}setBudget(Q,J){this.budgets.set(Q,{warnThreshold:0.8,action:"warn",...J})}setBudgets(Q){for(let[J,Y]of Object.entries(Q))this.setBudget(J,Y)}removeBudget(Q){this.budgets.delete(Q)}getBudgets(){let Q={};for(let[J,Y]of this.budgets.entries())Q[J]=Y;return Q}onViolation(Q){this.violationHandlers.push(Q)}offViolation(Q){let J=this.violationHandlers.indexOf(Q);if(J!==-1)this.violationHandlers.splice(J,1)}time(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}async timeAsync(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=await J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}checkBudget(Q,J){let Y=this.budgets.get(Q);if(!Y)return;let $=J/Y.maxTime*100,Z=Y.warnThreshold!==void 0?J>=Y.maxTime*Y.warnThreshold&&J<Y.maxTime:!1,q=J>=Y.maxTime;if(!Z&&!q)return;let U={label:Q,actualTime:J,budgetTime:Y.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:Z};this.violations.push(U);while(this.violations.length>this.maxViolations)this.violations.shift();for(let F of this.violationHandlers)try{F(U)}catch{}let j=Z?`[Performance Warning] "${Q}" took ${J.toFixed(2)}ms (${$.toFixed(1)}% of ${Y.maxTime}ms budget)`:`[Performance Budget Exceeded] "${Q}" took ${J.toFixed(2)}ms (exceeded ${Y.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Y.action){case"log":console.log(j);break;case"warn":console.warn(j);break;case"error":console.error(j);break;case"throw":if(q)throw Error(j);else console.warn(j);break}}recordTime(Q,J){let Y=this.metrics.get(Q);if(Y)Y.count++,Y.totalTime+=J,Y.maxTime=Math.max(Y.maxTime,J),Y.minTime=Math.min(Y.minTime,J);else this.metrics.set(Q,{count:1,totalTime:J,maxTime:J,minTime:J})}getStats(Q){if(Q){let Y=this.metrics.get(Q);if(!Y)return{};let $=this.budgets.get(Q);return{count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:$?.maxTime,budgetUtilization:$?Y.totalTime/Y.count/$.maxTime*100:void 0}}let J={};for(let[Y,$]of this.metrics.entries()){let Z=this.budgets.get(Y);J[Y]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:Z?.maxTime,budgetUtilization:Z?$.totalTime/$.count/Z.maxTime*100:void 0}}return J}getViolations(Q){if(Q)return this.violations.filter((J)=>J.label===Q);return[...this.violations]}getViolationStats(){let Q={},J=0,Y=0;for(let $ of this.violations)if(Q[$.label]=(Q[$.label]||0)+1,$.isWarning)J++;else Y++;return{total:this.violations.length,byLabel:Q,warnings:J,errors:Y}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var d=null;function HJ(){if(!d)d=new UJ;return d}var dJ=new Proxy({},{get(Q,J){return HJ()[J]}});var WJ=[];function jJ(Q){let J=new h(Q);return WJ.push(J),J}function lJ(){for(let Q of WJ)Q.clear()}function i(Q,...J){return`${J.map((Y)=>String(Y??"")).join("\x00")}\x00${Q.length}\x00${Bun.hash(Q)}`}function nJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function oJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var N=null,l=!1,X=null,M="",w=!1,NJ=256,_=new Map,z=new Map,H=null,E=null;function x(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function c(Q,J){if(_.has(Q))_.delete(Q);else if(_.size>=NJ)_.delete(_.keys().next().value);_.set(Q,J)}function TJ(Q){let J=x(Q);if(z.has(J))z.delete(J);else if(z.size>=NJ)z.delete(z.keys().next().value);return z.set(J,Q),J}function YQ(Q){let J=z.get(Q);if(J===void 0)return;return z.delete(Q),z.set(Q,J),J}async function BJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${x(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function wJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${x(Q)}.css`),J)}catch{}}async function GJ(Q){try{let J=await import(Q);if(J&&J.CSSGenerator)return{CSSGenerator:J.CSSGenerator,config:J.config,build:J.build,defaultConfig:J.defaultConfig,extractClasses:J.extractClasses}}catch{}return null}var KJ=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],RJ=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function PJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J)){for(let Y of["node_modules","pantry"])for(let $ of KJ)Q.push(O.join(J,Y,...$));J=O.dirname(J)}return Q}function DJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"",Y=[J&&O.join(J,"Code","Tools","ts-css"),J&&O.join(J,"Code","Tools","crosswind"),J&&O.join(J,"repos","stacks-org","ts-css"),J&&O.join(J,"repos","stacks-org","crosswind"),O.join(process.cwd(),"..","ts-css"),O.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let $ of Y)Q.push(O.join($,"packages","toolkit","dist","engine","index.js")),Q.push(O.join($,"packages","toolkit","src","engine","index.ts"));if(J)Q.push(O.join(J,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return Q}async function zJ(){if(l)return N;l=!0;try{let Q=async(Z)=>{for(let q of Z){if(!await Bun.file(q).exists())continue;let U=await GJ(q);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded from ${O.dirname(O.dirname(q))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Z=O.resolve(process.env.CROSSWIND_SRC),q=await Q([Z]);if(!q)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${Z}`);return N=q,N}let J=await Q(PJ());if(J)return N=J,N;let Y=RJ;for(let Z of Y){let q=await GJ(Z);if(q){if(N=q,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded`);return N}}let $=await Q(DJ());if($)return N=$,N;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${W.reset}`),null}}function $Q(){n.clear(),N=null,l=!1,X=null,M="",_.clear(),z.clear(),E=null}var XJ=!1;async function AJ(Q){try{let J=FJ({name:"css",cwd:Q})?"css":FJ({name:"crosswind",cwd:Q})?"crosswind":null;if(!J)return null;if(J==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!XJ)XJ=!0,console.warn(`${W.yellow}[ts-css]${W.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:Y}=await import("bunfig"),$=await Y({name:J,cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!$?.path||!$.config||Object.keys($.config).length===0)return null;let Z=O.relative(Q,$.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} Loaded config from ${Z||$.path}`);return $.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[ts-css]${W.reset} Failed to load css config:`,J instanceof Error?J.message:J),null}}async function MJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-ajbfeey7.js"),$=await Y(Q);if($.css)if(typeof $.css==="string"){let Z=O.isAbsolute($.css)?$.css:O.resolve(Q,$.css);if(await Bun.file(Z).exists()){let q=await import(Z);J=q.default||q,console.log(`${W.green}[ts-css]${W.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(J={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let Z=O.isAbsolute($.css.config)?$.css.config:O.resolve(Q,$.css.config);if(await Bun.file(Z).exists()){let q=await import(Z);J={...q.default||q,...J}}}console.log(`${W.green}[ts-css]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await AJ(Q)}function EJ(Q){try{let J=new WeakSet;return x(JSON.stringify(Q??{},(Y,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(J.has($))return"[circular]";J.add($)}return $})??"")}catch{return"unhashable"}}async function SJ(Q){if(w)return M;w=!0;try{let J=await zJ();if(!J||!J.build)return w=!1,"";if(!X)X=await AJ(Q);if(!X)return w=!1,"";let Y=J.defaultConfig?.theme||{},$=X.theme||{},Z={...J.defaultConfig,...X,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),j=performance.now()-q;if(M=U.css,console.log(`${W.cyan}[ts-css]${W.reset} Built ${U.classes.size} classes in ${j.toFixed(1)}ms`),Z.output){let F=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),V=O.dirname(F);if(!fs.existsSync(V))fs.mkdirSync(V,{recursive:!0});await Bun.write(F,U.css)}return w=!1,U.css}catch(J){return console.error(`${W.red}[ts-css]${W.reset} Build error:`,J),w=!1,M}}async function ZQ(Q){X=null,await SJ(Q)}function qQ(){return M}function vJ(Q){let J=new Set,Y=/class\s*=\s*["']([^"']+)["']/gi,$=Y.exec(Q);while($!==null){for(let U of $[1].split(/\s+/))if(U.trim())J.add(U.trim());$=Y.exec(Q)}let Z=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,q=Z.exec(Q);while(q!==null){let U=q[1].match(/'([^']+)'/g);if(U){for(let j of U)for(let F of j.slice(1,-1).split(/\s+/))if(F.trim())J.add(F.trim())}q=Z.exec(Q)}return J}var n=jJ(64);async function xJ(Q,J){let Y=n.get(i(Q,J,E));if(Y!==void 0)return Y;let $=await kJ(Q,J);if($)n.set(i(Q,J,E),$);return $}async function kJ(Q,J){try{let Y=await zJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):vJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=IJ(Z,"cache");let q=[...$].sort().join(" "),U=`${E||"default"}::${q}`,j=_.get(U);if(j!==void 0)return c(U,j),j;let F=await BJ(U);if(F!==null)return c(U,F),F;if(!X)X=await MJ(Z),E=EJ(X);let V=Y.defaultConfig||Y.config,I=X||{},L=ZJ(V,I),{safelist:T,includePreflight:K,minify:k,tokenCSS:LJ}=L,o=L.config,R=new Y.CSSGenerator(o);for(let G of T)R.generate(G);for(let G of $)R.generate(G);let A=R.toCSS(K,k),r=o.shortcuts||I.shortcuts||{};for(let[G,b]of Object.entries(r)){if(!$.has(G)&&!T.includes(G))continue;let y=b.split(/\s+/).filter(Boolean);for(let D of y)R.generate(D)}A=R.toCSS(K,k);let P=A.split(`
15
15
  `);for(let[G,b]of Object.entries(r)){if(!$.has(G)&&!T.includes(G))continue;let y=b.split(/\s+/).filter(Boolean),D=[],f=[];for(let C of y){let a=C.startsWith("dark:"),s=`.${(a?C.slice(5):C).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let S=0;S<P.length;S++){let t=P[S].trim();if(t===`${s} {`||t.startsWith(`${s} {`)){let v=S,e="";while(v<P.length){if(e+=P[v],P[v].includes("}"))break;v++}let p=e.match(/\{([^}]+)\}/);if(p)if(a)f.push(p[1].trim());else D.push(p[1].trim());break}}}if(D.length)A+=`
16
16
  .${G} { ${D.join(" ")} }`;if(f.length)A+=`
17
17
  @media (prefers-color-scheme: dark) { .dark .${G} { ${f.join(" ")} } }`}return A=LJ+A,c(U,A),wJ(U,A),A}catch(Y){return console.warn("Failed to generate Css CSS:",Y),""}}async function UQ(Q,J,Y=!1){let $=await xJ(Q,J);if(!$)return Q;let Z=Y?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${TJ($)}.css">`:`<style data-css="generated">