@stacksjs/stx 0.2.270 → 0.2.271

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/builtins/stx-image.js +6 -5
  2. package/dist/{chunk-8ee6xtdz.js → chunk-01vsryag.js} +1 -1
  3. package/dist/{chunk-sqcpcnyf.js → chunk-096ejm6e.js} +1 -1
  4. package/dist/{chunk-zvygp42b.js → chunk-0j58q0tb.js} +1 -1
  5. package/dist/{chunk-11x9r23q.js → chunk-1znt2vmy.js} +1 -1
  6. package/dist/{chunk-6sha41vn.js → chunk-2ahsmwdq.js} +1 -1
  7. package/dist/{chunk-2qddseth.js → chunk-33g7nspw.js} +1 -1
  8. package/dist/{chunk-yw1yt8b1.js → chunk-3kvdh9da.js} +1 -1
  9. package/dist/{chunk-dyqh15py.js → chunk-3wshezq4.js} +1 -1
  10. package/dist/{chunk-kkrg94ay.js → chunk-41f7v4ja.js} +1 -1
  11. package/dist/{chunk-cvkjsa0m.js → chunk-45gasjkt.js} +1 -1
  12. package/dist/{chunk-bab9k1e8.js → chunk-6s3yxjmr.js} +1 -1
  13. package/dist/{chunk-578te43w.js → chunk-7n39346x.js} +8 -8
  14. package/dist/{chunk-bxv3k5w8.js → chunk-8tkdj47d.js} +2 -2
  15. package/dist/{chunk-xn65rbw3.js → chunk-9jtdrj58.js} +1 -1
  16. package/dist/{chunk-ggem4nm2.js → chunk-ahzzwebg.js} +1 -1
  17. package/dist/{chunk-qkhw6tdx.js → chunk-br9c5dsn.js} +1 -1
  18. package/dist/{chunk-dtnfedg1.js → chunk-c29x3wtz.js} +1 -1
  19. package/dist/{chunk-bkavpp75.js → chunk-c2dtn0n1.js} +1 -1
  20. package/dist/{chunk-v413wmmr.js → chunk-cfnvwm5n.js} +1 -1
  21. package/dist/{chunk-v2rx1rey.js → chunk-e9bqsjvn.js} +1 -1
  22. package/dist/{chunk-f0z8dy89.js → chunk-grt377yc.js} +1 -1
  23. package/dist/{chunk-f9decgn9.js → chunk-gz8nrsc7.js} +1 -1
  24. package/dist/{chunk-qhd9ctad.js → chunk-hw7ddxy8.js} +1 -1
  25. package/dist/{chunk-7x4xbgp7.js → chunk-j30wnqkt.js} +1 -1
  26. package/dist/{chunk-1mr82303.js → chunk-j6aga9pq.js} +1 -1
  27. package/dist/{chunk-2a689vdq.js → chunk-jnc3kfpb.js} +1 -1
  28. package/dist/{chunk-5a07gxnz.js → chunk-jrfehndk.js} +1 -1
  29. package/dist/{chunk-wyhp2hnm.js → chunk-jrn6x9kv.js} +1 -1
  30. package/dist/{chunk-v5vqxa3e.js → chunk-mr7m83w1.js} +1 -1
  31. package/dist/{chunk-7fs8qzdd.js → chunk-myk6g2bz.js} +1 -1
  32. package/dist/{chunk-ntfmdx5n.js → chunk-n3dk9t9f.js} +93 -93
  33. package/dist/{chunk-4r06061f.js → chunk-pj5m421t.js} +1 -1
  34. package/dist/{chunk-nsf6d5dq.js → chunk-qttfc5w6.js} +1 -1
  35. package/dist/{chunk-mw1szffx.js → chunk-r8h8t77y.js} +1 -1
  36. package/dist/{chunk-man5awsh.js → chunk-rcfaqy69.js} +1 -1
  37. package/dist/{chunk-mjmm6wts.js → chunk-snvv4jtd.js} +1 -1
  38. package/dist/{chunk-8hpqcwwc.js → chunk-t1njgvy0.js} +2 -2
  39. package/dist/{chunk-eb17vwke.js → chunk-wfrwbykj.js} +1 -1
  40. package/dist/{chunk-kzj42dav.js → chunk-wsbd9kpe.js} +1 -1
  41. package/dist/{chunk-b70jwwhd.js → chunk-xyrm7ew9.js} +1 -1
  42. package/dist/{chunk-kerjvqz9.js → chunk-yr4s841y.js} +1 -1
  43. package/dist/{chunk-ertf9176.js → chunk-z3cme6c9.js} +1 -1
  44. package/dist/{chunk-g7gr6pvb.js → chunk-zjpbeebd.js} +1 -1
  45. package/dist/cli.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,5 +1,5 @@
1
1
  // @bun
2
- import{As as y6,Bs as S6,qs as H2}from"./chunk-1bwwtctk.js";import{Hs as t5}from"./chunk-q9zsjgpf.js";import{Ps as c0}from"./chunk-txys90mf.js";import{Qs as p1,Rs as m1,Ss as B2,Ts as G5,Vs as b1,Ws as P2,Xs as v2,lt as _2}from"./chunk-8ee6xtdz.js";import{mt as C6,ot as P6,pt as v6,rt as L5}from"./chunk-1spzqjve.js";import{st as P8}from"./chunk-x9s335jt.js";import{Bt as M2,vt as V2,zt as G$}from"./chunk-t7b39wwk.js";import{Mt as O2}from"./chunk-w18t3nmy.js";import{$t as e8,Nt as L7,Ot as u2,Pt as C2,Qt as c1,Ut as d2,Vt as a4,Wt as R8,Yt as C9}from"./chunk-yvpagchj.js";import{Ku as j2,Mu as uG,Nu as X3,Pu as j5,ju as W4,mu as W8,tu as $4}from"./chunk-rhbq1var.js";import{Uu as f6}from"./chunk-2c2z8n54.js";import{Zu as f}from"./chunk-71gwef4q.js";import S1 from"path";import S5 from"fs";var s4=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"]),o4={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"},n2=new Set(["ctrl","alt","shift","meta"]),t4={left:0,middle:1,right:2};function r4($){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(n2.has(J))Z.systemKeys.push(J);else if(J in t4)Z.mouse=J;else if(J in o4||/^[a-z]$/.test(J))Z.keys.push(o4[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 e4($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,q]=Y,W=Y.index,K=W+Q.length,U=`__stx_evt_${X++}`,z=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(q))!==null){let[,_,L]=j,V=_.split("."),O=V[0];if(!s4.has(O))continue;z.push({attribute:`@${_}`,event:O,handler:L,modifiers:r4(V.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(q))!==null){let[,_,L]=j,V=_.split("."),O=V[0];if(!s4.has(O))continue;z.push({attribute:`@${_}`,event:O,handler:L,modifiers:r4(V.slice(1)),elementId:U})}if(z.length>0)Z.push({originalTag:Q,elementId:U,events:z,startIndex:W,endIndex:K})}return Z}function s2($){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=t4[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 o2($,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 m$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function r2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=s2($),Y=o2(m$($.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(", ")} }`:"",q=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{As as y6,Bs as S6,qs as H2}from"./chunk-1bwwtctk.js";import{Hs as t5}from"./chunk-q9zsjgpf.js";import{Ps as c0}from"./chunk-txys90mf.js";import{Qs as p1,Rs as m1,Ss as B2,Ts as G5,Vs as b1,Ws as P2,Xs as v2,lt as _2}from"./chunk-01vsryag.js";import{mt as C6,ot as P6,pt as v6,rt as L5}from"./chunk-1spzqjve.js";import{st as P8}from"./chunk-x9s335jt.js";import{Bt as M2,vt as V2,zt as G$}from"./chunk-t7b39wwk.js";import{Mt as O2}from"./chunk-w18t3nmy.js";import{$t as e8,Nt as L7,Ot as u2,Pt as C2,Qt as c1,Ut as d2,Vt as a4,Wt as R8,Yt as C9}from"./chunk-yvpagchj.js";import{Ku as j2,Mu as dG,Nu as X3,Pu as j5,ju as W4,mu as W8,tu as $4}from"./chunk-rhbq1var.js";import{Uu as f6}from"./chunk-2c2z8n54.js";import{Zu as f}from"./chunk-71gwef4q.js";import S1 from"path";import S5 from"fs";var s4=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"]),o4={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"},n2=new Set(["ctrl","alt","shift","meta"]),t4={left:0,middle:1,right:2};function r4($){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(n2.has(J))Z.systemKeys.push(J);else if(J in t4)Z.mouse=J;else if(J in o4||/^[a-z]$/.test(J))Z.keys.push(o4[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 e4($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,q]=Y,W=Y.index,K=W+Q.length,U=`__stx_evt_${X++}`,z=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(q))!==null){let[,_,L]=j,V=_.split("."),O=V[0];if(!s4.has(O))continue;z.push({attribute:`@${_}`,event:O,handler:L,modifiers:r4(V.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(q))!==null){let[,_,L]=j,V=_.split("."),O=V[0];if(!s4.has(O))continue;z.push({attribute:`@${_}`,event:O,handler:L,modifiers:r4(V.slice(1)),elementId:U})}if(z.length>0)Z.push({originalTag:Q,elementId:U,events:z,startIndex:W,endIndex:K})}return Z}function s2($){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=t4[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 o2($,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 m$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function r2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=s2($),Y=o2(m$($.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(", ")} }`:"",q=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;
@@ -112,9 +112,9 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function a2($){let Z=e4($);if(Z.length===0)return{template:$,bindings:[]};let X=$,J=[];for(let Y=Z.length-1;Y>=0;Y--){let Q=Z[Y],G=Q.originalTag;if(!G.includes(" id="))G=G.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${Q.elementId}"`);else{let q=G.match(/id=["']([^"']+)["']/);if(q)for(let W of Q.events)W.elementId=q[1]}for(let q of Q.events){let W=q.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`\\s*${W}\\s*=\\s*"[^"]*"`,"g"),U=new RegExp(`\\s*${W}\\s*=\\s*'[^']*'`,"g");G=G.replace(K,""),G=G.replace(U,"")}X=X.slice(0,Q.startIndex)+G+X.slice(Q.endIndex),J.push(...Q.events)}return{template:X,bindings:J}}function $7($,Z,X){if(a4($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:q,bindings:W}=a2($),K=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...K,...W],q}let J=e4($);if(J.length===0)return $;let Y=$;for(let q=J.length-1;q>=0;q--){let W=J[q],K=W.originalTag;if(!K.includes(" id="))K=K.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${W.elementId}"`);else{let U=K.match(/id=["']([^"']+)["']/);if(U)for(let z of W.events)z.elementId=U[1]}for(let U of W.events){let z=U.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${z}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${z}\\s*=\\s*'[^']*'`,"g");K=K.replace(H,""),K=K.replace(j,"")}Y=Y.slice(0,W.startIndex)+K+Y.slice(W.endIndex)}let Q=l$(J.flatMap((q)=>q.events)),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
115
- `+Y.slice(G);else Y+=Q;return Y}function GW($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}function $1($){let Z=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;$=$.replace(Z,(J,Y)=>{return`const { ${Y.split(",").map((G)=>G.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
115
+ `+Y.slice(G);else Y+=Q;return Y}function qW($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}function $1($){let Z=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;$=$.replace(Z,(J,Y)=>{return`const { ${Y.split(",").map((G)=>G.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
116
116
  `});let X=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return $=$.replace(X,(J,Y)=>{return`const { ${Y.split(",").map((G)=>G.trim()).filter(Boolean).join(", ")} } = window.__composables
117
- `}),$}function WW($){return $.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}import Mq from"fs";import h from"path";import{createHash as t2}from"crypto";var u5="__stx_component_client_factories";function d5($){let Z=$[u5];return Z instanceof Map?Z:null}function Z7($){$[u5]=new Map}function c$($,Z){let X=d5($);if(!X)return null;let J=t2("sha256").update(Z).digest("hex").slice(0,16),Y=X.get(J);if(Y)Y.instances++;else X.set(J,{body:Z,instances:1});return J}function X7($,Z){let X=d5(Z);if(!X?.size)return $;let J=$;for(let[W,K]of X){if(K.instances!==1)continue;let U=new RegExp(`window\\.__stxComponentFactories\\[${JSON.stringify(W)}\\]\\(("[^"]+")\\);`,"g");J=J.replace(U,(z,H)=>`(${K.body})(${H});`)}let Y=[...X].filter(([,W])=>W.instances>1);if(Y.length===0)return J;let G=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
117
+ `}),$}function KW($){return $.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}import kq from"fs";import h from"path";import{createHash as t2}from"crypto";var u5="__stx_component_client_factories";function d5($){let Z=$[u5];return Z instanceof Map?Z:null}function Z7($){$[u5]=new Map}function c$($,Z){let X=d5($);if(!X)return null;let J=t2("sha256").update(Z).digest("hex").slice(0,16),Y=X.get(J);if(Y)Y.instances++;else X.set(J,{body:Z,instances:1});return J}function X7($,Z){let X=d5(Z);if(!X?.size)return $;let J=$;for(let[W,K]of X){if(K.instances!==1)continue;let U=new RegExp(`window\\.__stxComponentFactories\\[${JSON.stringify(W)}\\]\\(("[^"]+")\\);`,"g");J=J.replace(U,(z,H)=>`(${K.body})(${H});`)}let Y=[...X].filter(([,W])=>W.instances>1);if(Y.length===0)return J;let G=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
118
118
  (function() {
119
119
  const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
120
120
  ${Y.map(([W,K])=>` try { factories[${JSON.stringify(W)}] = factories[${JSON.stringify(W)}] || ${K.body}; }
@@ -134,7 +134,7 @@ catch (e) {
134
134
  }
135
135
  throw e;
136
136
  }
137
- `),q=G([]);if(Q.length===Z.length)return G7(q,Q,G);return G7((...K)=>{let U=Array(Y.length);for(let z=0;z<Y.length;z++)U[z]=K[Y[z]];return q(...U)},Q,G,(K)=>{q=G(K)})}function G7($,Z,X,J){let Q=/^(\w+) is not defined$/,G=$,q=[],W=new Set(Z);return(...K)=>{for(let U=0;U<=8;U++)try{return G(...K)}catch(z){let H=z instanceof Error?z.message:"",j=Q.exec(H);if(!(z instanceof ReferenceError)||!j)return;let B=j[1];if(W.has(B)||U7.has(B))return;W.add(B),q.push(B),G=X(q),J?.(q)}return}}function c5($){let Z=$.trim(),X=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let J of X)if(J.test(Z))return!1;return!0}var z7=0,p5=new Map;function jW(){z7=0,p5.clear()}function i5($,Z){let X=z7++,J=`<!--__STX_${$.toUpperCase()}_${X}__-->`;return p5.set(J,{type:$,expression:Z}),J}function BW(){let $={};for(let[Z,X]of p5)$[Z]={type:X.type,expression:X.expression};return $}function _W($){let Z={},X=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,J;while((J=X.exec($))!==null){let Y=J[0],Q=J[1].toLowerCase(),G=p5.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function VW($,Z){let X=$;for(let[J,Y]of Z)X=X.split(J).join(Y);return X}function OW($){return $.includes("<!--__STX_")}var H7=/<script\b[^>]*>/iy,j7=/<\/script\s*>/ig,B7=/<style\b[^>]*>/iy,_7=/<\/style\s*>/ig;function V7($,Z,X,J){X.lastIndex=Z;let Y=X.exec($);if(!Y||Y.index!==Z)return-1;J.lastIndex=X.lastIndex;let Q=J.exec($);if(!Q)return-1;return Q.index+Q[0].length}function Q1($,Z){return V7($,Z,H7,j7)}function C1($,Z){return V7($,Z,B7,_7)}function U5($,Z){if(!$.startsWith("<!--",Z))return-1;let X=$.indexOf("-->",Z+4);if(X===-1)return-1;return X+3}function GZ($,Z){if($.startsWith("<!--",Z)){let X=U5($,Z);return X===-1?$.length:X}for(let[X,J]of[[H7,j7],[B7,_7]]){X.lastIndex=Z;let Y=X.exec($);if(!Y||Y.index!==Z)continue;J.lastIndex=X.lastIndex;let Q=J.exec($);return Q?Q.index+Q[0].length:$.length}return-1}function n5($,Z){let X=[],J=0,Y=$.length,Q=!1,G=null;while(J<Y){let q=$[J];if(Q){if(G){if(q===G)G=null}else if(q==='"'||q==="'")G=q;else if(q===">")Q=!1;J++;continue}if(q!=="<"){J++;continue}let W=Z($,J);if(W>J){X.push({start:J,end:W,token:$.slice(J,W)}),J=W;continue}let K=GZ($,J);if(K>J){J=K;continue}if(/^<\/?[a-zA-Z]/.test($.slice(J,J+2)))Q=!0;J++}return X}function o0($,Z,X){let J=n5($,Z);if(J.length===0)return{output:$,tokens:[]};let Y=J.map((q)=>q.token),Q="",G=0;for(let q=0;q<J.length;q++){let W=J[q];Q+=$.slice(G,W.start),Q+=X(W.token,q),G=W.end}return Q+=$.slice(G),{output:Q,tokens:Y}}function r0($){let{output:Z,tokens:X}=o0($,Q1,(J,Y)=>`\x00STX_SCRIPT_${Y}\x00`);return{output:Z,scripts:X}}function P1($,Z){if(Z.length===0)return $;return $.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(X,J)=>Z[+J]??"")}var z5={},O7=new Map;function qZ($){let Z=O7.get($);if(!Z){let X=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${X}(?!\\w)`,"g"),O7.set($,Z)}return Z.lastIndex=0,Z}var s5={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let X=String($);return X.charAt(0).toUpperCase()+X.slice(1)},number:($,Z,X=0)=>{if($===void 0||$===null)return"";try{let J=Number($);return Number.isNaN(J)?"":J.toFixed(Number.parseInt(String(X),10))}catch{return""}},fmt:($,Z,X="en-US")=>{if($===void 0||$===null)return"";try{let J=Number($);if(Number.isNaN(J))return String($);return J.toLocaleString(X)}catch{return String($)}},join:($,Z,X=",")=>{if(!Array.isArray($))return"";return $.join(String(X))},escape:($,Z)=>{if($===void 0||$===null)return"";return w7(String($))},translate:($,Z,X={})=>{if(!Z||!Z.__translations)return $;let J=Z.__translations,Y=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=J;for(let W of Q){if(G===void 0||G===null)break;G=G[W]}if(G===void 0||G===null)return Y?$:"";let q=String(G);return Object.entries(X).forEach(([W,K])=>{q=q.replace(qZ(W),String(K))}),q},t:($,Z,X={})=>{return s5.translate($,Z,X)},truncate:($,Z,X=50,J="...")=>{if($===void 0||$===null)return"";let Y=String($);if(Y.length<=X)return Y;if(X<=J.length)return J.substring(0,X);return Y.substring(0,X-J.length)+J},date:($,Z,X="short",J="en-US")=>{if($===void 0||$===null)return"";try{let Y=$ instanceof Date?$:new Date($);if(Number.isNaN(Y.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(X==="iso")return Y.toISOString();return new Intl.DateTimeFormat(J,Q[X]||Q.short).format(Y)}catch{return String($)}},currency:($,Z,X="USD",J="en-US")=>{if($===void 0||$===null)return"";try{let Y=Number($);if(Number.isNaN(Y))return String($);return new Intl.NumberFormat(J,{style:"currency",currency:X}).format(Y)}catch{return String($)}},pluralize:($,Z,X,J)=>{let Y=Number($);if(Number.isNaN(Y))return X;let Q=J||`${X}s`;return Y===1?X:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let X=String($);return X.charAt(X.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,X=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return X?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,X="")=>{return $===void 0||$===null||$===""?X:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,X=0,J)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(X,J);return $},replace:($,Z,X,J="")=>{if($===void 0||$===null)return"";let Y=X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Y,"g"),()=>J)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let X=Number($);return Number.isNaN(X)?0:Math.abs(X)},round:($,Z,X=0)=>{let J=Number($);if(Number.isNaN(J))return 0;let Y=10**X;return Math.round(J*Y)/Y}};function WZ($,Z){if($ in s5)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);z5[$]=Z}function kW($){for(let[Z,X]of Object.entries($))WZ(Z,X)}function KZ(){return{...s5,...z5}}function IW(){for(let $ of Object.keys(z5))delete z5[$]}function i$($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function w7($){return i$($).replace(/\{{2,}/g,(Z)=>UZ(Z.length)).replace(/\{(?=!)/g,`&#123;${R7}`)}var R7="&#8288;";function UZ($){return Array.from({length:$},()=>"&#123;").join(R7)}function G1($,Z){let{scripts:X}=r0($);for(let J of X){let Y=J.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);if(!Y||/\bserver\b|\bsrc\s*=/.test(Y[1]))continue;let Q=Y[2];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(Q))return!0;if(L7(Q,Z))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test($))return!0;return!1}function F7($,Z){let X=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],J=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Y="",Q=!1,G=0;for(let K=0;K<J.length;K++){let U=J[K];if(!Q&&U==="`"){Q=!0,G=0;continue}if(Q){if(U==="`"&&G===0){Q=!1;continue}if(U==="$"&&J[K+1]==="{"){G++,K++,Y+=" ";continue}if(U==="}"&&G>0){G--;continue}if(G>0){Y+=U;continue}continue}Y+=U}J=Y;let q=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,W;while((W=q.exec(J))!==null){let K=W[1];if(!J.substring(0,W.index).trimEnd().endsWith(".")){if(!X.includes(K)&&!(K in Z))return!1}}return!0}function zZ($,Z){let X=Z.__stx_serverDeclared;if(!X||X.size===0)return!1;let J=c0($);for(let Y of X)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(J))return!0;return!1}function n$($,Z){let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(J,Y)=>{try{let Q=f0(Y,Z);if(Q===void 0)return J;return Q===null?"":String(Q)}catch{return J}}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(J,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return J;try{let G=f0(Y,Z);if(G===void 0)return J;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return J}}),X}function HZ($,Z){if(!$.includes("{"))return $;let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(J,Y)=>{try{let Q=f0(Y,Z);if(Q===void 0)return J;return Q===null?"":String(Q)}catch{return J}}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(J,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return J;try{let G=f0(Y,Z);if(G===void 0)return J;if(G===null)return"";return String(G).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return J}}),X}function TW($,Z,X={}){let{output:J,scripts:Y}=r0($),Q=Y.map((G)=>{let q=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),W=G.match(/^<script\b[^>]*>/i),K=G.search(/<\/script\s*>$/i);if(!q||!W||K===-1)return G;let U=q[1],z=q[2];if(/\bdata-raw\b/.test(U))return G;if(X.skipServer&&/\bserver\b/.test(U))return G;let j=`<script${HZ(U,Z)}>`;if(/\bsrc\s*=/.test(U)||/\btype\s*=\s*["']application\/json["']/.test(U))return j+z+G.slice(K);return j+n$(z,Z)+G.slice(K)});return P1(J,Q)}function O1($,Z,X){let J=$,Y=(z,H)=>{let j=C1(z,H);if(j===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(z.slice(H,j))?-1:j},Q=(z,H,j,B)=>{let _=j.length,{output:L,tokens:V}=o0(z,H,(O,F)=>B(_+F));return j.push(...V),L},G=[];J=Q(J,Y,G,(z)=>`<!--__STX_STYLE_${z}__-->`);let q=[];J=Q(J,Q1,q,(z)=>`<!--__STX_SCRIPT_EXPR_${z}__-->`);let W=Z?.__stx_signals_gate===!0||G1($),K=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),U=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);J=J.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(z,H,j)=>{try{let B=f0(H,Z);return B!==void 0&&B!==null?String(B):""}catch(B){let _=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${_}`,X,$,j,z)}}),J=J.replace(/\{!!([\s\S]*?)!!\}/g,(z,H,j)=>{try{let B=f0(H,Z);if(B===void 0&&Z.__stx_buildMode==="compile")return i5("raw",H.trim());return B!==void 0&&B!==null?String(B):""}catch(B){if(Z.__stx_buildMode==="compile")return i5("raw",H.trim());let _=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${_}`,X,$,j,z)}}),J=Q(J,Q1,q,(z)=>`<!--__STX_SCRIPT_EXPR_${z}__-->`),J=Q(J,Y,G,(z)=>`<!--__STX_STYLE_${z}__-->`),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(z,H,j)=>{let B=H.trim();if(U.has(B))return z;let _=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=B.match(L)?.[1],F=O&&((O in Z)||_.includes(O)),w=Boolean(O&&K.has(O)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,D=B.match(R),N=D&&!_.includes(D[1])&&!(D[1]in Z);if(/^__[A-Z_]+__$/.test(B))return"";try{let k=f0(H,Z);if(w)return z;if(W&&!F7(B,Z))return z;if(Z.__stx_buildMode==="compile"&&!W&&(k===void 0||zZ(B,Z)))return i5("expr",B);return k!==void 0&&k!==null?w7(String(k)):""}catch(k){if(w)return z;if(W&&!F7(B,Z))return z;if(N)return z;let A=k instanceof Error?k.message:String(k);return j0("Expression",`Error evaluating: {{ ${B} }}: ${A}`,X,$,j,z)}});for(let z=0;z<q.length;z++)J=J.replace(`<!--__STX_SCRIPT_EXPR_${z}__-->`,()=>q[z]);for(let z=0;z<G.length;z++)J=J.replace(`<!--__STX_STYLE_${z}__-->`,()=>G[z]);return J}function jZ($,Z,X){if(!Z.trim())return $;let J=$,Y=Z.trim();while(Y.length>0){let Q=Y.match(/^(\w+)/);if(!Q)break;let G=Q[1];Y=Y.substring(G.length).trim();let q=z5[G]||s5[G];if(!q)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(KZ()).join(", ")}`);let W=[];if(Y.startsWith(":")){let K=Y.match(/^:([^|\s]+)/);if(K){let U=K[1].trim();try{let z=Number(U);W=[Number.isNaN(z)?U:z]}catch{W=[U]}Y=Y.substring(K[0].length).trim()}}else if(Y.startsWith("(")){let K=1,U=1;while(K>0&&U<Y.length){if(Y[U]==="(")K++;if(Y[U]===")")K--;U++}if(K===0){let z=Y.substring(1,U-1).trim();if(z)try{if(z.startsWith("{")&&z.endsWith("}"))W=[f0(`(${z})`,X,!0)];else{let H=[],j="",B=null,_=0,L=0,V=0,O=!1;for(let F=0;F<z.length;F++){let w=z[F];if(O){j+=w,O=!1;continue}if(w==="\\"){j+=w,O=!0;continue}if(B){if(j+=w,w===B)B=null;continue}if(w==='"'||w==="'"||w==="`"){B=w,j+=w;continue}if(w==="(")_++;else if(w===")")_--;else if(w==="[")L++;else if(w==="]")L--;else if(w==="{")V++;else if(w==="}")V--;if(w===","&&_===0&&L===0&&V===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);W=H.map((F)=>{let w=F.trim();return f0(w,X,!0)})}}catch{W=[z]}Y=Y.substring(U).trim()}}try{J=q(J,X,...W)}catch(K){let U=K instanceof Error?K.message:String(K);throw Error(`Error applying filter '${G}': ${U}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return J}function BZ($){let Z=!1,X="",J=0,Y=0,Q=0,G=!1;for(let q=0;q<$.length;q++){let W=$[q],K=$[q+1];if(Z&&G){G=!1;continue}if(Z&&W==="\\"){G=!0;continue}if(G=!1,(W==='"'||W==="'"||W==="`")&&!G){if(!Z)Z=!0,X=W;else if(W===X)Z=!1,X="";continue}if(Z&&X==="`"&&W==="$"&&K==="{"){let U=1;q+=2;while(q<$.length&&U>0){if($[q]==="{")U++;else if($[q]==="}")U--;if(U>0)q++}continue}if(Z)continue;if(W==="(")J++;else if(W===")")J--;else if(W==="[")Y++;else if(W==="]")Y--;else if(W==="{")Q++;else if(W==="}")Q--;if(W==="|"&&J===0&&Y===0&&Q===0){if(K==="|"){q++;continue}if(K==="="){q++;continue}return q}}return-1}function f0($,Z,X=!1){try{let J=$.trim(),Y=BZ(J);if(Y>0){let Q=J.substring(0,Y).trim(),G=J.substring(Y+1).trim(),q=f0(Q,Z,!0);return jZ(q,G,Z)}if(!q0(J)){if(!X)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${J}`);return e(J,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return W0(J,Q)(...G)}catch{return e(J,Z)}}catch(J){if(J instanceof ReferenceError){let Y=/(\b\w+)\s+is not defined/.exec(J.message);if(Y){let Q=Y[1],G=_Z(Q,Object.keys(Z));if(G&&G!==Q)J.message=`${J.message} \u2014 did you mean '${G}'?`}}if(!X)console.error(`Error evaluating expression: ${$}`,J);throw J}}function _Z($,Z){let X=null;for(let Y of Z){if(Y===$)continue;let Q=VZ($,Y);if(X===null||Q<X.dist)X={key:Y,dist:Q}}if(!X)return null;let J=Math.max($.length,X.key.length);if(X.dist<=2||X.dist/J<=0.35)return X.key;return null}function VZ($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[X,J]=$.length<Z.length?[$,Z]:[Z,$],Y=Array(X.length+1),Q=Array(X.length+1);for(let G=0;G<=X.length;G++)Y[G]=G;for(let G=1;G<=J.length;G++){Q[0]=G;for(let q=1;q<=X.length;q++){let W=X[q-1]===J[G-1]?0:1;Q[q]=Math.min(Q[q-1]+1,Y[q]+1,Y[q-1]+W)}for(let q=0;q<=X.length;q++)Y[q]=Q[q]}return Y[X.length]}function EW($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import dG from"fs";import M0 from"path";var s$=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],D7=/<body\b([^>]*)>/gi;function q1($){let Z=0,X,J=s$.map(()=>{return});while(Z<$.length){if(X===void 0||X!==null&&X.index<Z)D7.lastIndex=Z,X=D7.exec($);if(!X)return null;let Y=X.index,Q=-1,G=null;for(let W=0;W<s$.length;W++){let K=s$[W],U=J[W];if(U===void 0||U!==null&&U.index<Z)K.open.lastIndex=Z,U=K.open.exec($),J[W]=U;if(!U)continue;if(U.index<Y&&(Q===-1||U.index<Q))Q=U.index,G=K.close}if(Q===-1||!G)return{index:Y,tag:X[0],attrs:X[1]??""};G.lastIndex=Q;let q=G.exec($);if(!q)return null;Z=q.index+q[0].length}return null}function v1($,Z){let X=q1($);if(!X)return $;return $.slice(0,X.index)+Z(X.tag,X.attrs)+$.slice(X.index+X.tag.length)}var N7=null;function OZ($){if(!N7)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return N7}function SW($){let Z=OZ("onUpdate");if(Z)Z.updateHooks.push($)}function A7(){return`
137
+ `),q=G([]);if(Q.length===Z.length)return G7(q,Q,G);return G7((...K)=>{let U=Array(Y.length);for(let z=0;z<Y.length;z++)U[z]=K[Y[z]];return q(...U)},Q,G,(K)=>{q=G(K)})}function G7($,Z,X,J){let Q=/^(\w+) is not defined$/,G=$,q=[],W=new Set(Z);return(...K)=>{for(let U=0;U<=8;U++)try{return G(...K)}catch(z){let H=z instanceof Error?z.message:"",j=Q.exec(H);if(!(z instanceof ReferenceError)||!j)return;let B=j[1];if(W.has(B)||U7.has(B))return;W.add(B),q.push(B),G=X(q),J?.(q)}return}}function c5($){let Z=$.trim(),X=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let J of X)if(J.test(Z))return!1;return!0}var z7=0,p5=new Map;function BW(){z7=0,p5.clear()}function i5($,Z){let X=z7++,J=`<!--__STX_${$.toUpperCase()}_${X}__-->`;return p5.set(J,{type:$,expression:Z}),J}function _W(){let $={};for(let[Z,X]of p5)$[Z]={type:X.type,expression:X.expression};return $}function VW($){let Z={},X=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,J;while((J=X.exec($))!==null){let Y=J[0],Q=J[1].toLowerCase(),G=p5.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function OW($,Z){let X=$;for(let[J,Y]of Z)X=X.split(J).join(Y);return X}function FW($){return $.includes("<!--__STX_")}var H7=/<script\b[^>]*>/iy,j7=/<\/script\s*>/ig,B7=/<style\b[^>]*>/iy,_7=/<\/style\s*>/ig;function V7($,Z,X,J){X.lastIndex=Z;let Y=X.exec($);if(!Y||Y.index!==Z)return-1;J.lastIndex=X.lastIndex;let Q=J.exec($);if(!Q)return-1;return Q.index+Q[0].length}function Q1($,Z){return V7($,Z,H7,j7)}function C1($,Z){return V7($,Z,B7,_7)}function U5($,Z){if(!$.startsWith("<!--",Z))return-1;let X=$.indexOf("-->",Z+4);if(X===-1)return-1;return X+3}function GZ($,Z){if($.startsWith("<!--",Z)){let X=U5($,Z);return X===-1?$.length:X}for(let[X,J]of[[H7,j7],[B7,_7]]){X.lastIndex=Z;let Y=X.exec($);if(!Y||Y.index!==Z)continue;J.lastIndex=X.lastIndex;let Q=J.exec($);return Q?Q.index+Q[0].length:$.length}return-1}function n5($,Z){let X=[],J=0,Y=$.length,Q=!1,G=null;while(J<Y){let q=$[J];if(Q){if(G){if(q===G)G=null}else if(q==='"'||q==="'")G=q;else if(q===">")Q=!1;J++;continue}if(q!=="<"){J++;continue}let W=Z($,J);if(W>J){X.push({start:J,end:W,token:$.slice(J,W)}),J=W;continue}let K=GZ($,J);if(K>J){J=K;continue}if(/^<\/?[a-zA-Z]/.test($.slice(J,J+2)))Q=!0;J++}return X}function o0($,Z,X){let J=n5($,Z);if(J.length===0)return{output:$,tokens:[]};let Y=J.map((q)=>q.token),Q="",G=0;for(let q=0;q<J.length;q++){let W=J[q];Q+=$.slice(G,W.start),Q+=X(W.token,q),G=W.end}return Q+=$.slice(G),{output:Q,tokens:Y}}function r0($){let{output:Z,tokens:X}=o0($,Q1,(J,Y)=>`\x00STX_SCRIPT_${Y}\x00`);return{output:Z,scripts:X}}function P1($,Z){if(Z.length===0)return $;return $.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(X,J)=>Z[+J]??"")}var z5={},O7=new Map;function qZ($){let Z=O7.get($);if(!Z){let X=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${X}(?!\\w)`,"g"),O7.set($,Z)}return Z.lastIndex=0,Z}var s5={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let X=String($);return X.charAt(0).toUpperCase()+X.slice(1)},number:($,Z,X=0)=>{if($===void 0||$===null)return"";try{let J=Number($);return Number.isNaN(J)?"":J.toFixed(Number.parseInt(String(X),10))}catch{return""}},fmt:($,Z,X="en-US")=>{if($===void 0||$===null)return"";try{let J=Number($);if(Number.isNaN(J))return String($);return J.toLocaleString(X)}catch{return String($)}},join:($,Z,X=",")=>{if(!Array.isArray($))return"";return $.join(String(X))},escape:($,Z)=>{if($===void 0||$===null)return"";return w7(String($))},translate:($,Z,X={})=>{if(!Z||!Z.__translations)return $;let J=Z.__translations,Y=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=J;for(let W of Q){if(G===void 0||G===null)break;G=G[W]}if(G===void 0||G===null)return Y?$:"";let q=String(G);return Object.entries(X).forEach(([W,K])=>{q=q.replace(qZ(W),String(K))}),q},t:($,Z,X={})=>{return s5.translate($,Z,X)},truncate:($,Z,X=50,J="...")=>{if($===void 0||$===null)return"";let Y=String($);if(Y.length<=X)return Y;if(X<=J.length)return J.substring(0,X);return Y.substring(0,X-J.length)+J},date:($,Z,X="short",J="en-US")=>{if($===void 0||$===null)return"";try{let Y=$ instanceof Date?$:new Date($);if(Number.isNaN(Y.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(X==="iso")return Y.toISOString();return new Intl.DateTimeFormat(J,Q[X]||Q.short).format(Y)}catch{return String($)}},currency:($,Z,X="USD",J="en-US")=>{if($===void 0||$===null)return"";try{let Y=Number($);if(Number.isNaN(Y))return String($);return new Intl.NumberFormat(J,{style:"currency",currency:X}).format(Y)}catch{return String($)}},pluralize:($,Z,X,J)=>{let Y=Number($);if(Number.isNaN(Y))return X;let Q=J||`${X}s`;return Y===1?X:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let X=String($);return X.charAt(X.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,X=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return X?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,X="")=>{return $===void 0||$===null||$===""?X:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,X=0,J)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(X,J);return $},replace:($,Z,X,J="")=>{if($===void 0||$===null)return"";let Y=X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Y,"g"),()=>J)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let X=Number($);return Number.isNaN(X)?0:Math.abs(X)},round:($,Z,X=0)=>{let J=Number($);if(Number.isNaN(J))return 0;let Y=10**X;return Math.round(J*Y)/Y}};function WZ($,Z){if($ in s5)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);z5[$]=Z}function IW($){for(let[Z,X]of Object.entries($))WZ(Z,X)}function KZ(){return{...s5,...z5}}function TW(){for(let $ of Object.keys(z5))delete z5[$]}function i$($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function w7($){return i$($).replace(/\{{2,}/g,(Z)=>UZ(Z.length)).replace(/\{(?=!)/g,`&#123;${R7}`)}var R7="&#8288;";function UZ($){return Array.from({length:$},()=>"&#123;").join(R7)}function G1($,Z){let{scripts:X}=r0($);for(let J of X){let Y=J.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);if(!Y||/\bserver\b|\bsrc\s*=/.test(Y[1]))continue;let Q=Y[2];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(Q))return!0;if(L7(Q,Z))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test($))return!0;return!1}function F7($,Z){let X=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],J=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Y="",Q=!1,G=0;for(let K=0;K<J.length;K++){let U=J[K];if(!Q&&U==="`"){Q=!0,G=0;continue}if(Q){if(U==="`"&&G===0){Q=!1;continue}if(U==="$"&&J[K+1]==="{"){G++,K++,Y+=" ";continue}if(U==="}"&&G>0){G--;continue}if(G>0){Y+=U;continue}continue}Y+=U}J=Y;let q=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,W;while((W=q.exec(J))!==null){let K=W[1];if(!J.substring(0,W.index).trimEnd().endsWith(".")){if(!X.includes(K)&&!(K in Z))return!1}}return!0}function zZ($,Z){let X=Z.__stx_serverDeclared;if(!X||X.size===0)return!1;let J=c0($);for(let Y of X)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(J))return!0;return!1}function n$($,Z){let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(J,Y)=>{try{let Q=f0(Y,Z);if(Q===void 0)return J;return Q===null?"":String(Q)}catch{return J}}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(J,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return J;try{let G=f0(Y,Z);if(G===void 0)return J;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return J}}),X}function HZ($,Z){if(!$.includes("{"))return $;let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(J,Y)=>{try{let Q=f0(Y,Z);if(Q===void 0)return J;return Q===null?"":String(Q)}catch{return J}}),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(J,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return J;try{let G=f0(Y,Z);if(G===void 0)return J;if(G===null)return"";return String(G).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return J}}),X}function EW($,Z,X={}){let{output:J,scripts:Y}=r0($),Q=Y.map((G)=>{let q=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),W=G.match(/^<script\b[^>]*>/i),K=G.search(/<\/script\s*>$/i);if(!q||!W||K===-1)return G;let U=q[1],z=q[2];if(/\bdata-raw\b/.test(U))return G;if(X.skipServer&&/\bserver\b/.test(U))return G;let j=`<script${HZ(U,Z)}>`;if(/\bsrc\s*=/.test(U)||/\btype\s*=\s*["']application\/json["']/.test(U))return j+z+G.slice(K);return j+n$(z,Z)+G.slice(K)});return P1(J,Q)}function O1($,Z,X){let J=$,Y=(z,H)=>{let j=C1(z,H);if(j===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(z.slice(H,j))?-1:j},Q=(z,H,j,B)=>{let _=j.length,{output:L,tokens:V}=o0(z,H,(O,F)=>B(_+F));return j.push(...V),L},G=[];J=Q(J,Y,G,(z)=>`<!--__STX_STYLE_${z}__-->`);let q=[];J=Q(J,Q1,q,(z)=>`<!--__STX_SCRIPT_EXPR_${z}__-->`);let W=Z?.__stx_signals_gate===!0||G1($),K=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),U=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);J=J.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(z,H,j)=>{try{let B=f0(H,Z);return B!==void 0&&B!==null?String(B):""}catch(B){let _=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${_}`,X,$,j,z)}}),J=J.replace(/\{!!([\s\S]*?)!!\}/g,(z,H,j)=>{try{let B=f0(H,Z);if(B===void 0&&Z.__stx_buildMode==="compile")return i5("raw",H.trim());return B!==void 0&&B!==null?String(B):""}catch(B){if(Z.__stx_buildMode==="compile")return i5("raw",H.trim());let _=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${_}`,X,$,j,z)}}),J=Q(J,Q1,q,(z)=>`<!--__STX_SCRIPT_EXPR_${z}__-->`),J=Q(J,Y,G,(z)=>`<!--__STX_STYLE_${z}__-->`),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(z,H,j)=>{let B=H.trim();if(U.has(B))return z;let _=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=B.match(L)?.[1],F=O&&((O in Z)||_.includes(O)),w=Boolean(O&&K.has(O)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,D=B.match(R),N=D&&!_.includes(D[1])&&!(D[1]in Z);if(/^__[A-Z_]+__$/.test(B))return"";try{let k=f0(H,Z);if(w)return z;if(W&&!F7(B,Z))return z;if(Z.__stx_buildMode==="compile"&&!W&&(k===void 0||zZ(B,Z)))return i5("expr",B);return k!==void 0&&k!==null?w7(String(k)):""}catch(k){if(w)return z;if(W&&!F7(B,Z))return z;if(N)return z;let A=k instanceof Error?k.message:String(k);return j0("Expression",`Error evaluating: {{ ${B} }}: ${A}`,X,$,j,z)}});for(let z=0;z<q.length;z++)J=J.replace(`<!--__STX_SCRIPT_EXPR_${z}__-->`,()=>q[z]);for(let z=0;z<G.length;z++)J=J.replace(`<!--__STX_STYLE_${z}__-->`,()=>G[z]);return J}function jZ($,Z,X){if(!Z.trim())return $;let J=$,Y=Z.trim();while(Y.length>0){let Q=Y.match(/^(\w+)/);if(!Q)break;let G=Q[1];Y=Y.substring(G.length).trim();let q=z5[G]||s5[G];if(!q)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(KZ()).join(", ")}`);let W=[];if(Y.startsWith(":")){let K=Y.match(/^:([^|\s]+)/);if(K){let U=K[1].trim();try{let z=Number(U);W=[Number.isNaN(z)?U:z]}catch{W=[U]}Y=Y.substring(K[0].length).trim()}}else if(Y.startsWith("(")){let K=1,U=1;while(K>0&&U<Y.length){if(Y[U]==="(")K++;if(Y[U]===")")K--;U++}if(K===0){let z=Y.substring(1,U-1).trim();if(z)try{if(z.startsWith("{")&&z.endsWith("}"))W=[f0(`(${z})`,X,!0)];else{let H=[],j="",B=null,_=0,L=0,V=0,O=!1;for(let F=0;F<z.length;F++){let w=z[F];if(O){j+=w,O=!1;continue}if(w==="\\"){j+=w,O=!0;continue}if(B){if(j+=w,w===B)B=null;continue}if(w==='"'||w==="'"||w==="`"){B=w,j+=w;continue}if(w==="(")_++;else if(w===")")_--;else if(w==="[")L++;else if(w==="]")L--;else if(w==="{")V++;else if(w==="}")V--;if(w===","&&_===0&&L===0&&V===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);W=H.map((F)=>{let w=F.trim();return f0(w,X,!0)})}}catch{W=[z]}Y=Y.substring(U).trim()}}try{J=q(J,X,...W)}catch(K){let U=K instanceof Error?K.message:String(K);throw Error(`Error applying filter '${G}': ${U}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return J}function BZ($){let Z=!1,X="",J=0,Y=0,Q=0,G=!1;for(let q=0;q<$.length;q++){let W=$[q],K=$[q+1];if(Z&&G){G=!1;continue}if(Z&&W==="\\"){G=!0;continue}if(G=!1,(W==='"'||W==="'"||W==="`")&&!G){if(!Z)Z=!0,X=W;else if(W===X)Z=!1,X="";continue}if(Z&&X==="`"&&W==="$"&&K==="{"){let U=1;q+=2;while(q<$.length&&U>0){if($[q]==="{")U++;else if($[q]==="}")U--;if(U>0)q++}continue}if(Z)continue;if(W==="(")J++;else if(W===")")J--;else if(W==="[")Y++;else if(W==="]")Y--;else if(W==="{")Q++;else if(W==="}")Q--;if(W==="|"&&J===0&&Y===0&&Q===0){if(K==="|"){q++;continue}if(K==="="){q++;continue}return q}}return-1}function f0($,Z,X=!1){try{let J=$.trim(),Y=BZ(J);if(Y>0){let Q=J.substring(0,Y).trim(),G=J.substring(Y+1).trim(),q=f0(Q,Z,!0);return jZ(q,G,Z)}if(!q0(J)){if(!X)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${J}`);return e(J,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return W0(J,Q)(...G)}catch{return e(J,Z)}}catch(J){if(J instanceof ReferenceError){let Y=/(\b\w+)\s+is not defined/.exec(J.message);if(Y){let Q=Y[1],G=_Z(Q,Object.keys(Z));if(G&&G!==Q)J.message=`${J.message} \u2014 did you mean '${G}'?`}}if(!X)console.error(`Error evaluating expression: ${$}`,J);throw J}}function _Z($,Z){let X=null;for(let Y of Z){if(Y===$)continue;let Q=VZ($,Y);if(X===null||Q<X.dist)X={key:Y,dist:Q}}if(!X)return null;let J=Math.max($.length,X.key.length);if(X.dist<=2||X.dist/J<=0.35)return X.key;return null}function VZ($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[X,J]=$.length<Z.length?[$,Z]:[Z,$],Y=Array(X.length+1),Q=Array(X.length+1);for(let G=0;G<=X.length;G++)Y[G]=G;for(let G=1;G<=J.length;G++){Q[0]=G;for(let q=1;q<=X.length;q++){let W=X[q-1]===J[G-1]?0:1;Q[q]=Math.min(Q[q-1]+1,Y[q]+1,Y[q-1]+W)}for(let q=0;q<=X.length;q++)Y[q]=Q[q]}return Y[X.length]}function bW($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import mG from"fs";import M0 from"path";var s$=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],D7=/<body\b([^>]*)>/gi;function q1($){let Z=0,X,J=s$.map(()=>{return});while(Z<$.length){if(X===void 0||X!==null&&X.index<Z)D7.lastIndex=Z,X=D7.exec($);if(!X)return null;let Y=X.index,Q=-1,G=null;for(let W=0;W<s$.length;W++){let K=s$[W],U=J[W];if(U===void 0||U!==null&&U.index<Z)K.open.lastIndex=Z,U=K.open.exec($),J[W]=U;if(!U)continue;if(U.index<Y&&(Q===-1||U.index<Q))Q=U.index,G=K.close}if(Q===-1||!G)return{index:Y,tag:X[0],attrs:X[1]??""};G.lastIndex=Q;let q=G.exec($);if(!q)return null;Z=q.index+q[0].length}return null}function v1($,Z){let X=q1($);if(!X)return $;return $.slice(0,X.index)+Z(X.tag,X.attrs)+$.slice(X.index+X.tag.length)}var N7=null;function OZ($){if(!N7)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return N7}function CW($){let Z=OZ("onUpdate");if(Z)Z.updateHooks.push($)}function A7(){return`
138
138
  // STX Lifecycle Runtime
139
139
  (function() {
140
140
  if (typeof window === 'undefined') return;
@@ -482,7 +482,7 @@ else {
482
482
 
483
483
  console.log('[stx] Lifecycle runtime initialized');
484
484
  })();
485
- `}function o$($){return Symbol($)}var CW=o$("theme"),PW=o$("router"),vW=o$("i18n");import*as k7 from"crypto";function M7($){let Z=/\$(\w+)\./g,X=[],J;while((J=Z.exec($))!==null)if(!X.includes(J[1]))X.push(J[1]);return X}function FZ(){return`stx-${k7.randomBytes(4).toString("hex")}`}function LZ($){return/\$\w+\./.test($)}function wZ($){let Z=[],X=new Set,J=/<(\w+)([^>]*?)(\s*\/?>)/g,Y=$;return Y=Y.replace(J,(Q,G,q,W)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let K=[],U=!1,z=q,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...q.matchAll(H)];for(let L of j){let V=L[0],O=L[1],F=L[2];if(LZ(F)){U=!0;let w=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(K.push({attr:O,expr:R,fullMatch:V,originalAttr:O}),M7(R).forEach((N)=>X.add(N)),O==="text")z=z.replace(V,"");else if(O==="class")z=z.replace(V,'class=""');else if(O==="disabled"||O==="hidden")z=z.replace(V,"");else z=z.replace(V,`${O}=""`)}}}if(!U)return Q;let B=z.match(/\bid\s*=\s*"([^"]+)"/),_;if(B)_=B[1];else _=FZ(),z=` id="${_}"${z}`;for(let L of K)Z.push({elementId:_,attribute:L.attr,expression:L.expr,stores:M7(L.expr)});return`<${G}${z}${W}`}),{html:Y,bindings:Z,stores:X}}function RZ($,Z){if($.length===0)return"";let X=Array.from(Z),J=`
485
+ `}function o$($){return Symbol($)}var PW=o$("theme"),vW=o$("router"),fW=o$("i18n");import*as k7 from"crypto";function M7($){let Z=/\$(\w+)\./g,X=[],J;while((J=Z.exec($))!==null)if(!X.includes(J[1]))X.push(J[1]);return X}function FZ(){return`stx-${k7.randomBytes(4).toString("hex")}`}function LZ($){return/\$\w+\./.test($)}function wZ($){let Z=[],X=new Set,J=/<(\w+)([^>]*?)(\s*\/?>)/g,Y=$;return Y=Y.replace(J,(Q,G,q,W)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let K=[],U=!1,z=q,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...q.matchAll(H)];for(let L of j){let V=L[0],O=L[1],F=L[2];if(LZ(F)){U=!0;let w=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(K.push({attr:O,expr:R,fullMatch:V,originalAttr:O}),M7(R).forEach((N)=>X.add(N)),O==="text")z=z.replace(V,"");else if(O==="class")z=z.replace(V,'class=""');else if(O==="disabled"||O==="hidden")z=z.replace(V,"");else z=z.replace(V,`${O}=""`)}}}if(!U)return Q;let B=z.match(/\bid\s*=\s*"([^"]+)"/),_;if(B)_=B[1];else _=FZ(),z=` id="${_}"${z}`;for(let L of K)Z.push({elementId:_,attribute:L.attr,expression:L.expr,stores:M7(L.expr)});return`<${G}${z}${W}`}),{html:Y,bindings:Z,stores:X}}function RZ($,Z){if($.length===0)return"";let X=Array.from(Z),J=`
486
486
  <script>
487
487
  (function() {
488
488
  'use strict';
@@ -697,7 +697,7 @@ ${Z.inlineScript}
697
697
  `;if(!Z.scriptUrl)return"";let X=[];if(Z.scriptId)X.push(`id="${x0(Z.scriptId)}"`);if(Z.attributes)for(let[Y,Q]of Object.entries(Z.attributes))X.push(`${x0(Y)}="${x0(Q)}"`);return`
698
698
  <!-- Custom Analytics -->
699
699
  <script${X.length>0?` ${X.join(" ")}`:""} src="${x0(Z.scriptUrl)}" defer></script>
700
- `}function E7($,Z){let X=T7(Z);if(!X)return $;if(!$.includes("</head>")){let J=$.lastIndexOf("</body>");if(J!==-1)return $.slice(0,J)+X+$.slice(J);return $+X}return $.replace("</head>",`${X}</head>`)}function x0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var gW={name:"analytics",hasEndTag:!1,handler:async($,Z,X,J)=>{let Y=X.__stx_config||{};return T7(Y)}};var IZ={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function b7($){let Z=$.heatmap;if(!Z?.enabled)return"";let X={...IZ,...Z};return`
700
+ `}function E7($,Z){let X=T7(Z);if(!X)return $;if(!$.includes("</head>")){let J=$.lastIndexOf("</body>");if(J!==-1)return $.slice(0,J)+X+$.slice(J);return $+X}return $.replace("</head>",`${X}</head>`)}function x0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var hW={name:"analytics",hasEndTag:!1,handler:async($,Z,X,J)=>{let Y=X.__stx_config||{};return T7(Y)}};var IZ={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function b7($){let Z=$.heatmap;if(!Z?.enabled)return"";let X={...IZ,...Z};return`
701
701
  <!-- stx Heatmap - Privacy-Compliant Tracking -->
702
702
  <script>
703
703
  (function() {
@@ -1080,7 +1080,7 @@ else {
1080
1080
  };
1081
1081
  })();
1082
1082
  </script>
1083
- `}function y7($,Z){let X=b7(Z);if(!X)return $;let J=$.lastIndexOf("</body>");if(J!==-1)return $.slice(0,J)+X+$.slice(J);return $+X}var S7={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async($,Z,X,J)=>{let Y=X.__stx_config||{};if(Z.length>0){let Q=TZ(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return b7(Y)}};function TZ($){let Z={},X=$.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let J of X){let[Y,Q]=J.split("="),G=Q?.replace(/["']/g,"");switch(Y){case"endpoint":Z.endpoint=G;break;case"samplingRate":Z.samplingRate=Number.parseInt(G,10);break;case"batchSize":Z.batchSize=Number.parseInt(G,10);break;case"trackMouse":Z.trackMouse=G==="true";break;case"trackClicks":Z.trackClicks=G==="true";break;case"trackScroll":Z.trackScroll=G==="true";break;case"honorDnt":Z.honorDnt=G==="true";break;case"debugOverlay":Z.debugOverlay=G==="true";break}}return Z}class C7{sessions=new Map;addSession($){let Z=this.sessions.get($.sid);if(Z)Z.points.push(...$.points),Z.lastActivity=Math.max(Z.lastActivity,$.lastActivity);else this.sessions.set($.sid,$)}getPageData($){let Z=[];for(let X of this.sessions.values())if(X.page===$)Z.push(...X.points);return Z}getClickData($){return this.getPageData($).filter((Z)=>Z.type==="click")}getMovementData($){return this.getPageData($).filter((Z)=>Z.type==="move")}getScrollData($){let Z=this.getPageData($).filter((J)=>J.type==="scroll"),X=new Map;for(let J of Z)if(J.depth!==void 0)X.set(J.depth,(X.get(J.depth)||0)+1);return Array.from(X.entries()).map(([J,Y])=>({depth:J,count:Y})).sort((J,Y)=>J.depth-Y.depth)}getZoneStats($){let Z=new Map,X=this.getPageData($);for(let J of X)if(J.zone){let Y=Z.get(J.zone)||{clicks:0,hovers:0};if(J.type==="click")Y.clicks++;else if(J.type==="move")Y.hovers++;Z.set(J.zone,Y)}return Z}generateGridData($,Z=20){let X=this.getPageData($),J=[];for(let Q=0;Q<Z;Q++){J[Q]=[];for(let G=0;G<Z;G++)J[Q][G]=0}for(let Q of X){let G=Math.min(Math.floor(Q.x/100*Z),Z-1),q=Math.min(Math.floor(Q.y/100*Z),Z-1);J[q][G]+=Q.type==="click"?3:1}let Y=0;for(let Q of J)for(let G of Q)Y=Math.max(Y,G);return J.map((Q,G)=>Q.map((q,W)=>({x:W,y:G,intensity:Y>0?q/Y:0})))}exportJSON(){return JSON.stringify({sessions:Array.from(this.sessions.values()),exportedAt:new Date().toISOString()},null,2)}clear(){this.sessions.clear()}get sessionCount(){return this.sessions.size}get totalPoints(){let $=0;for(let Z of this.sessions.values())$+=Z.points.length;return $}}function uW(){return new C7}var EZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(EZ||={});var bZ;((J)=>{J.In="in";J.Out="out";J.Both="both"})(bZ||={});var yZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(yZ||={});var Z1={duration:300,delay:0,ease:"ease",direction:"both"};function SZ($,Z={}){let{duration:X,delay:J,ease:Y,direction:Q,custom:G}={...Z1,...Z};if($==="custom"&&G)return G;switch($){case"fade":return`${Q==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
1083
+ `}function y7($,Z){let X=b7(Z);if(!X)return $;let J=$.lastIndexOf("</body>");if(J!==-1)return $.slice(0,J)+X+$.slice(J);return $+X}var S7={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async($,Z,X,J)=>{let Y=X.__stx_config||{};if(Z.length>0){let Q=TZ(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return b7(Y)}};function TZ($){let Z={},X=$.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let J of X){let[Y,Q]=J.split("="),G=Q?.replace(/["']/g,"");switch(Y){case"endpoint":Z.endpoint=G;break;case"samplingRate":Z.samplingRate=Number.parseInt(G,10);break;case"batchSize":Z.batchSize=Number.parseInt(G,10);break;case"trackMouse":Z.trackMouse=G==="true";break;case"trackClicks":Z.trackClicks=G==="true";break;case"trackScroll":Z.trackScroll=G==="true";break;case"honorDnt":Z.honorDnt=G==="true";break;case"debugOverlay":Z.debugOverlay=G==="true";break}}return Z}class C7{sessions=new Map;addSession($){let Z=this.sessions.get($.sid);if(Z)Z.points.push(...$.points),Z.lastActivity=Math.max(Z.lastActivity,$.lastActivity);else this.sessions.set($.sid,$)}getPageData($){let Z=[];for(let X of this.sessions.values())if(X.page===$)Z.push(...X.points);return Z}getClickData($){return this.getPageData($).filter((Z)=>Z.type==="click")}getMovementData($){return this.getPageData($).filter((Z)=>Z.type==="move")}getScrollData($){let Z=this.getPageData($).filter((J)=>J.type==="scroll"),X=new Map;for(let J of Z)if(J.depth!==void 0)X.set(J.depth,(X.get(J.depth)||0)+1);return Array.from(X.entries()).map(([J,Y])=>({depth:J,count:Y})).sort((J,Y)=>J.depth-Y.depth)}getZoneStats($){let Z=new Map,X=this.getPageData($);for(let J of X)if(J.zone){let Y=Z.get(J.zone)||{clicks:0,hovers:0};if(J.type==="click")Y.clicks++;else if(J.type==="move")Y.hovers++;Z.set(J.zone,Y)}return Z}generateGridData($,Z=20){let X=this.getPageData($),J=[];for(let Q=0;Q<Z;Q++){J[Q]=[];for(let G=0;G<Z;G++)J[Q][G]=0}for(let Q of X){let G=Math.min(Math.floor(Q.x/100*Z),Z-1),q=Math.min(Math.floor(Q.y/100*Z),Z-1);J[q][G]+=Q.type==="click"?3:1}let Y=0;for(let Q of J)for(let G of Q)Y=Math.max(Y,G);return J.map((Q,G)=>Q.map((q,W)=>({x:W,y:G,intensity:Y>0?q/Y:0})))}exportJSON(){return JSON.stringify({sessions:Array.from(this.sessions.values()),exportedAt:new Date().toISOString()},null,2)}clear(){this.sessions.clear()}get sessionCount(){return this.sessions.size}get totalPoints(){let $=0;for(let Z of this.sessions.values())$+=Z.points.length;return $}}function dW(){return new C7}var EZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(EZ||={});var bZ;((J)=>{J.In="in";J.Out="out";J.Both="both"})(bZ||={});var yZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(yZ||={});var Z1={duration:300,delay:0,ease:"ease",direction:"both"};function SZ($,Z={}){let{duration:X,delay:J,ease:Y,direction:Q,custom:G}={...Z1,...Z};if($==="custom"&&G)return G;switch($){case"fade":return`${Q==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
1084
1084
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
1085
1085
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${Q==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
1086
1086
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1356,7 +1356,7 @@ ${W}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1356
1356
  --stx-spring-stiffness: ${Q.stiffness};
1357
1357
  --stx-spring-damping: ${Q.damping};
1358
1358
  --stx-spring-mass: ${Q.mass};
1359
- `.trim().replace(/\s+/g," ");return`<div id="${q}" class="stx-spring" style="${K}">${$}</div>`},description:"Applies spring physics animations to an element"};function mW($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1359
+ `.trim().replace(/\s+/g," ");return`<div id="${q}" class="stx-spring" style="${K}">${$}</div>`},description:"Applies spring physics animations to an element"};function lW($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1360
1360
  <script data-stx-scoped data-stx-run="always">
1361
1361
  (function() {
1362
1362
  const timeline = ${JSON.stringify($)};
@@ -1393,7 +1393,7 @@ else {
1393
1393
  runTimeline();
1394
1394
  }
1395
1395
  })();
1396
- </script>`}function lW($,Z,X){let J=gZ($,Z),Y=`
1396
+ </script>`}function cW($,Z,X){let J=gZ($,Z),Y=`
1397
1397
  .${$}-animation {
1398
1398
  animation-name: ${$};
1399
1399
  animation-duration: ${X.duration}ms;
@@ -1403,7 +1403,7 @@ else {
1403
1403
  animation-direction: ${X.direction||"normal"};
1404
1404
  animation-fill-mode: ${X.fill||"forwards"};
1405
1405
  }`;return`${J}
1406
- ${Y}`}function cW($){let Z=$.trim().split(/\s+/),X={duration:300};for(let J=0;J<Z.length;J++){let Y=Z[J];if(/^\d+(?:ms|s)?$/.test(Y)){let Q=Number.parseInt(Y,10);if(J===0)X.duration=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q;else X.delay=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q}else if(Y==="infinite"||/^\d+$/.test(Y))X.iterations=Y==="infinite"?"infinite":Number.parseInt(Y,10);else if(["normal","reverse","alternate","alternate-reverse"].includes(Y))X.direction=Y;else if(["none","forwards","backwards","both"].includes(Y))X.fill=Y;else X.easing=Y}return X}function pW(){return`
1406
+ ${Y}`}function pW($){let Z=$.trim().split(/\s+/),X={duration:300};for(let J=0;J<Z.length;J++){let Y=Z[J];if(/^\d+(?:ms|s)?$/.test(Y)){let Q=Number.parseInt(Y,10);if(J===0)X.duration=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q;else X.delay=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q}else if(Y==="infinite"||/^\d+$/.test(Y))X.iterations=Y==="infinite"?"infinite":Number.parseInt(Y,10);else if(["normal","reverse","alternate","alternate-reverse"].includes(Y))X.direction=Y;else if(["none","forwards","backwards","both"].includes(Y))X.fill=Y;else X.easing=Y}return X}function iW(){return`
1407
1407
  <script data-stx-scoped data-stx-run="once">
1408
1408
  window.__stxAnimation = {
1409
1409
  // Registry of animations
@@ -1475,7 +1475,7 @@ else {
1475
1475
  );
1476
1476
  }
1477
1477
  };
1478
- </script>`}function iW($){let Z=$.customDirectives||[];return Z.push(r$),Z.push(t$),Z.push(e$),Z.push(a$),Z.push(hZ),Z.push(dZ),Z.push(lZ),{...$,customDirectives:Z}}function f7($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function x7($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var cZ=100,pZ=599,Z3="__stxResponseStatus",H5="__stxResponseHeaders";function o5($){return typeof $==="number"&&Number.isInteger($)&&$>=cZ&&$<=pZ}function rW($){for(let Z of $.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let X=Z[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!X)continue;let J=Number(X[1]);if(o5(J))return J}return}function $3($,Z){if(!$||typeof $!=="object")return!1;let X=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!o5(X))return!1;return $[Z3]=X,!0}function iZ($,Z,X){if(!$||typeof $!=="object")return;let J=String(Z??"").trim();if(!J)return;$[H5]={...$[H5],[J]:String(X)}}function nZ($){let Z=$?.[Z3];return o5(Z)?Z:void 0}function sZ($){let Z=$?.[H5];if(!Z||typeof Z!=="object")return;let X=Object.entries(Z).map(([J,Y])=>[J,String(Y)]);return X.length>0?Object.fromEntries(X):void 0}function aW($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let X=nZ($);if(X!==void 0)Z[Z3]=X;let J=sZ($);if(J)Z[H5]={...Z[H5],...J}}function g7($){return{setResponseStatus:(Z)=>{$3($,Z)},notFound:(Z=404)=>{let X=o5(Z)&&Z>=400?Z:404;$3($,X)},setResponseHeader:(Z,X)=>{iZ($,Z,X)}}}function h7($,Z,X={}){if(!$.includes("@status"))return $;let{filePath:J,buildMode:Y}=X,Q=Y==="compile",G="",q=0,W=/@status\s*\(/g,K;while((K=W.exec($))!==null){let U=oZ($,K.index+K[0].length-1);if(U<0)break;let z=$.slice(K.index+K[0].length,U).trim(),H=/^\d+$/.test(z)?Number(z):e(z,Z),j=J?` in ${J}`:"";if(Q)console.warn(`[stx] @status(${z})${j} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${z}) from <script server> instead \u2014 that runs per request.`);else if(!$3(Z,H))console.warn(`[stx] @status(${z})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(q,K.index),q=U+1+($.slice(U+1).match(/^[^\S\n]*\n?/)?.[0].length??0),W.lastIndex=q}return q===0?$:G+$.slice(q)}function oZ($,Z){let X=1,J=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(J){if(G==="\\")Y=!0;else if(G===J)J=null;continue}if(G==='"'||G==="'"||G==="`"){J=G;continue}if(G==="(")X++;else if(G===")"&&--X===0)return Q}return-1}var rZ=0,aZ=0;function u7($,Z){let X=$.match(new RegExp(`${Z}\\s*=\\s*"([^"]*)"`,"i"));if(X)return X[1];let J=$.match(new RegExp(`${Z}\\s*=\\s*'([^']*)'`,"i"));if(J)return J[1];return null}function tZ($){let Z=[],X=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,J;while((J=X.exec($))!==null){let[Y,Q,G]=J,q=J.index,W=u7(G,"x-data");if(!W)continue;let K=`__stx_scope_${rZ++}`,U=u7(G,"x-init"),z=eZ($,Q,q+Y.length),H=$.slice(q,z.endIndex),j=$X(H);Z.push({id:K,selector:`[data-stx-scope="${K}"]`,stateExpr:W,initExpr:U,bindings:[],refs:j})}return Z}function eZ($,Z,X){let J=1,Y=X,Q=new RegExp(`<${Z}(?:\\s|>)`,"gi"),G=new RegExp(`</${Z}>`,"gi"),q=new RegExp(`<${Z}[^>]*/\\s*>`,"gi");while(J>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y,q.lastIndex=Y;let W=Q.exec($),K=G.exec($),U=q.exec($);if(U&&U.index<(W?.index??1/0)){Y=U.index+U[0].length;continue}if(!K)return{endIndex:$.length};if(W&&W.index<K.index)J++,Y=W.index+W[0].length;else{if(J--,J===0)return{endIndex:K.index+K[0].length};Y=K.index+K[0].length}}return{endIndex:$.length}}function $X($){let Z=new Map,X=$.replace(/x-data\s*=\s*"[^"]*"/gi,'x-data="__stripped__"').replace(/x-data\s*=\s*'[^']*'/gi,"x-data='__stripped__'"),J=/<[a-z][a-z0-9-]*\s+([^>]*x-ref\s*=\s*["']([^"']*)["'][^>]*)>/gi,Y;while((Y=J.exec(X))!==null){let[,Q,G]=Y,q=ZX(Q);Z.set(G,q)}return Z}function ZX($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${aZ++}`}function XX(){return`
1478
+ </script>`}function nW($){let Z=$.customDirectives||[];return Z.push(r$),Z.push(t$),Z.push(e$),Z.push(a$),Z.push(hZ),Z.push(dZ),Z.push(lZ),{...$,customDirectives:Z}}function f7($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function x7($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var cZ=100,pZ=599,Z3="__stxResponseStatus",H5="__stxResponseHeaders";function o5($){return typeof $==="number"&&Number.isInteger($)&&$>=cZ&&$<=pZ}function aW($){for(let Z of $.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let X=Z[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!X)continue;let J=Number(X[1]);if(o5(J))return J}return}function $3($,Z){if(!$||typeof $!=="object")return!1;let X=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!o5(X))return!1;return $[Z3]=X,!0}function iZ($,Z,X){if(!$||typeof $!=="object")return;let J=String(Z??"").trim();if(!J)return;$[H5]={...$[H5],[J]:String(X)}}function nZ($){let Z=$?.[Z3];return o5(Z)?Z:void 0}function sZ($){let Z=$?.[H5];if(!Z||typeof Z!=="object")return;let X=Object.entries(Z).map(([J,Y])=>[J,String(Y)]);return X.length>0?Object.fromEntries(X):void 0}function tW($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let X=nZ($);if(X!==void 0)Z[Z3]=X;let J=sZ($);if(J)Z[H5]={...Z[H5],...J}}function g7($){return{setResponseStatus:(Z)=>{$3($,Z)},notFound:(Z=404)=>{let X=o5(Z)&&Z>=400?Z:404;$3($,X)},setResponseHeader:(Z,X)=>{iZ($,Z,X)}}}function h7($,Z,X={}){if(!$.includes("@status"))return $;let{filePath:J,buildMode:Y}=X,Q=Y==="compile",G="",q=0,W=/@status\s*\(/g,K;while((K=W.exec($))!==null){let U=oZ($,K.index+K[0].length-1);if(U<0)break;let z=$.slice(K.index+K[0].length,U).trim(),H=/^\d+$/.test(z)?Number(z):e(z,Z),j=J?` in ${J}`:"";if(Q)console.warn(`[stx] @status(${z})${j} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${z}) from <script server> instead \u2014 that runs per request.`);else if(!$3(Z,H))console.warn(`[stx] @status(${z})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(q,K.index),q=U+1+($.slice(U+1).match(/^[^\S\n]*\n?/)?.[0].length??0),W.lastIndex=q}return q===0?$:G+$.slice(q)}function oZ($,Z){let X=1,J=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(J){if(G==="\\")Y=!0;else if(G===J)J=null;continue}if(G==='"'||G==="'"||G==="`"){J=G;continue}if(G==="(")X++;else if(G===")"&&--X===0)return Q}return-1}var rZ=0,aZ=0;function u7($,Z){let X=$.match(new RegExp(`${Z}\\s*=\\s*"([^"]*)"`,"i"));if(X)return X[1];let J=$.match(new RegExp(`${Z}\\s*=\\s*'([^']*)'`,"i"));if(J)return J[1];return null}function tZ($){let Z=[],X=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,J;while((J=X.exec($))!==null){let[Y,Q,G]=J,q=J.index,W=u7(G,"x-data");if(!W)continue;let K=`__stx_scope_${rZ++}`,U=u7(G,"x-init"),z=eZ($,Q,q+Y.length),H=$.slice(q,z.endIndex),j=$X(H);Z.push({id:K,selector:`[data-stx-scope="${K}"]`,stateExpr:W,initExpr:U,bindings:[],refs:j})}return Z}function eZ($,Z,X){let J=1,Y=X,Q=new RegExp(`<${Z}(?:\\s|>)`,"gi"),G=new RegExp(`</${Z}>`,"gi"),q=new RegExp(`<${Z}[^>]*/\\s*>`,"gi");while(J>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y,q.lastIndex=Y;let W=Q.exec($),K=G.exec($),U=q.exec($);if(U&&U.index<(W?.index??1/0)){Y=U.index+U[0].length;continue}if(!K)return{endIndex:$.length};if(W&&W.index<K.index)J++,Y=W.index+W[0].length;else{if(J--,J===0)return{endIndex:K.index+K[0].length};Y=K.index+K[0].length}}return{endIndex:$.length}}function $X($){let Z=new Map,X=$.replace(/x-data\s*=\s*"[^"]*"/gi,'x-data="__stripped__"').replace(/x-data\s*=\s*'[^']*'/gi,"x-data='__stripped__'"),J=/<[a-z][a-z0-9-]*\s+([^>]*x-ref\s*=\s*["']([^"']*)["'][^>]*)>/gi,Y;while((Y=J.exec(X))!==null){let[,Q,G]=Y,q=ZX(Q);Z.set(G,q)}return Z}function ZX($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${aZ++}`}function XX(){return`
1479
1479
  // STX Reactive Runtime - x-cloak and transition CSS
1480
1480
  (function() {
1481
1481
  var style = document.createElement('style');
@@ -1713,8 +1713,8 @@ ${_}
1713
1713
  `)}</p>`);if(Y=q.join(`
1714
1714
  `),J)Y=Y.replace(/\n/g,`<br />
1715
1715
  `);for(let U=0;U<Q.length;U++)Y=Y.replace(`\x00CODEBLOCK${U}\x00`,Q[U]);return Y=Y.replace(/<p>\s*<\/p>/g,""),Y.trim()}async function i7($,Z,X=""){let J=$,Y=[],Q=/@markdown(?:\([^)]*\))?/g,G;while((G=Q.exec($))!==null){let q=G.index,W=G[0].match(/@markdown\(([^)]*)\)/),K=W?W[1]:"",U=q+G[0].length,z=1,H=U,j=-1;while(z>0&&H<$.length){let L=$.indexOf("@markdown",H),V=$.indexOf("@endmarkdown",H);if(V===-1)break;if(L!==-1&&L<V&&L!==q){let O=$[L+9];if(O==="("||O===`
1716
- `||O==="\r"||O===" "||O===void 0)z++;H=L+9}else{if(z--,z===0){j=V;break}H=V+12}}if(j===-1)continue;let B=$.slice(U,j),_=$.slice(q,j+12);Y.push({fullMatch:_,options:K,content:B,index:q}),Q.lastIndex=j+12}for(let{fullMatch:q,options:W,content:K,index:U}of Y)try{let z={};if(W)W.split(",").forEach((B)=>{let _=B.trim();if(_)z[_]=!0});let H={gfm:z.gfm??!0,breaks:z.breaks??!1},j=B5(K.trim(),H);J=J.split(q).join(j)}catch(z){let H=z instanceof Error?z.message:String(z),j=j0("Markdown Directive",`Error processing markdown: ${H}`,X,$,U,q);J=J.split(q).join(j)}return J}async function n7($,Z,X,J){let Y={gfm:!0,breaks:!1};return Z.forEach((Q)=>{let G=Q.trim().replace(/['"]/g,"");if(G==="breaks")Y.breaks=!0;if(G==="no-gfm")Y.gfm=!1}),B5($.trim(),Y)}var F1=[320,480,640,768,1024,1280,1536,1920,2560],s7=[1,1.5,2,3],f1=["avif","webp","jpeg"],o7={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},qX={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function _5($,Z=F1,X={},J){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${K1($,{...X,w:Y,fm:J})} ${Y}w`}).join(", ")}function UK($,Z=320,X=2560,J=0.08,Y={},Q){let G=WX(Z,X,J);return _5($,G,Y,Q)}function WX($,Z,X=0.08){let J=[],Y=$;while(Y<Z)J.push(Math.round(Y)),Y*=1+X*2;if(J[J.length-1]!==Z)J.push(Z);return J}function J3($,Z,X=s7,J={},Y){return X.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${K1($,{...J,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function zK($,Z,X=s7,J=80,Y={},Q){let G={1:J,1.5:Math.round(J*0.9),2:Math.round(J*0.8),3:Math.round(J*0.7),4:Math.round(J*0.6),5:Math.round(J*0.5)};return X.sort((q,W)=>q-W).map((q)=>{let W=Math.round(Z*q),K=G[q]||Math.round(J*Math.max(0.5,1-q*0.1));return`${K1($,{...Y,w:W,q:K,dpr:q,fm:Q})} ${q}x`}).join(", ")}function Y3($,Z="100vw"){if(!$||Object.keys($).length===0)return Z;let J=Object.entries($).map(([Y,Q])=>{let G=/^\d+$/.test(Y)?`${Y}px`:Y;return{bp:G,size:Q,numericBp:Number.parseInt(G)||0}}).sort((Y,Q)=>Y.numericBp-Q.numericBp).map(({bp:Y,size:Q})=>`(max-width: ${Y}) ${Q}`);return J.push(Z),J.join(", ")}function HK($,Z="100vw"){if(!$||$.length===0)return Z;let J=[...$].sort((Y,Q)=>(Y.maxWidth||0)-(Q.maxWidth||0)).filter((Y)=>Y.maxWidth).map((Y)=>`(max-width: ${Y.maxWidth}px) ${Y.imageWidth}`);return J.push(Z),J.join(", ")}var jK={fullWidth:"100vw",halfDesktop:"(max-width: 768px) 100vw, 50vw",thirdDesktop:"(max-width: 768px) 100vw, 33.33vw",quarterDesktop:"(max-width: 480px) 100vw, (max-width: 768px) 50vw, 25vw",contentWidth:"(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 960px"};function K1($,Z={}){let X=Object.entries(Z).filter(([,Q])=>Q!==void 0&&Q!==null).map(([Q,G])=>{if(Array.isArray(G))return[Q,G.join(",")];return[Q,String(G)]});if(X.length===0)return $;let J=X.map(([Q,G])=>`${Q}=${encodeURIComponent(G)}`).join("&"),Y=$.includes("?")?"&":"?";return`${$}${Y}${J}`}function BK($){let[Z,X]=$.split("?"),J={};if(X)new URLSearchParams(X).forEach((Q,G)=>{if(/^\d+$/.test(Q))J[G]=Number.parseInt(Q,10);else if(/^\d+\.\d+$/.test(Q))J[G]=Number.parseFloat(Q);else if(Q==="true")J[G]=!0;else if(Q==="false")J[G]=!1;else J[G]=Q});return{src:Z,params:J}}function _K($){let{src:Z,widths:X,dprValues:J,fixedWidth:Y,formats:Q=f1,baseUrl:G="",params:q={}}=$,W=[];for(let K of Q){let U,z;if(Y!==void 0&&J)U=J3(Z,Y,J,q,K),z=J.map((H)=>({path:"",url:K1(Z,{...q,w:Math.round(Y*H),fm:K}),width:Math.round(Y*H),height:0,format:K,size:0,dpr:H}));else{let H=X||F1;U=_5(Z,H,q,K),z=H.map((j)=>({path:"",url:K1(Z,{...q,w:j,fm:K}),width:j,height:0,format:K,size:0}))}W.push({srcset:U,format:K,mimeType:o7[K],variants:z})}return W}function VK($,Z="100vw"){return $.map(({srcset:X,mimeType:J})=>`<source type="${J}" srcset="${X}" sizes="${Z}" />`).join(`
1717
- `)}function OK($,Z){if($.length===0)return;let X=[...$].sort((Y,Q)=>Y.width-Q.width),J=X.find((Y)=>Y.width>=Z);if(J)return J;return X[X.length-1]}function Q3($){return o7[$]||"application/octet-stream"}function FK($){return qX[$]||$}function LK($){switch($.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":return"jpeg";case"png":return"png";case"webp":return"webp";case"avif":return"avif";case"gif":return"gif";default:return}}var KX={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},G3=`
1716
+ `||O==="\r"||O===" "||O===void 0)z++;H=L+9}else{if(z--,z===0){j=V;break}H=V+12}}if(j===-1)continue;let B=$.slice(U,j),_=$.slice(q,j+12);Y.push({fullMatch:_,options:K,content:B,index:q}),Q.lastIndex=j+12}for(let{fullMatch:q,options:W,content:K,index:U}of Y)try{let z={};if(W)W.split(",").forEach((B)=>{let _=B.trim();if(_)z[_]=!0});let H={gfm:z.gfm??!0,breaks:z.breaks??!1},j=B5(K.trim(),H);J=J.split(q).join(j)}catch(z){let H=z instanceof Error?z.message:String(z),j=j0("Markdown Directive",`Error processing markdown: ${H}`,X,$,U,q);J=J.split(q).join(j)}return J}async function n7($,Z,X,J){let Y={gfm:!0,breaks:!1};return Z.forEach((Q)=>{let G=Q.trim().replace(/['"]/g,"");if(G==="breaks")Y.breaks=!0;if(G==="no-gfm")Y.gfm=!1}),B5($.trim(),Y)}var F1=[320,480,640,768,1024,1280,1536,1920,2560],s7=[1,1.5,2,3],f1=["avif","webp","jpeg"],o7={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},qX={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function _5($,Z=F1,X={},J){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${K1($,{...X,w:Y,fm:J})} ${Y}w`}).join(", ")}function zK($,Z=320,X=2560,J=0.08,Y={},Q){let G=WX(Z,X,J);return _5($,G,Y,Q)}function WX($,Z,X=0.08){let J=[],Y=$;while(Y<Z)J.push(Math.round(Y)),Y*=1+X*2;if(J[J.length-1]!==Z)J.push(Z);return J}function J3($,Z,X=s7,J={},Y){return X.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${K1($,{...J,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function HK($,Z,X=s7,J=80,Y={},Q){let G={1:J,1.5:Math.round(J*0.9),2:Math.round(J*0.8),3:Math.round(J*0.7),4:Math.round(J*0.6),5:Math.round(J*0.5)};return X.sort((q,W)=>q-W).map((q)=>{let W=Math.round(Z*q),K=G[q]||Math.round(J*Math.max(0.5,1-q*0.1));return`${K1($,{...Y,w:W,q:K,dpr:q,fm:Q})} ${q}x`}).join(", ")}function Y3($,Z="100vw"){if(!$||Object.keys($).length===0)return Z;let J=Object.entries($).map(([Y,Q])=>{let G=/^\d+$/.test(Y)?`${Y}px`:Y;return{bp:G,size:Q,numericBp:Number.parseInt(G)||0}}).sort((Y,Q)=>Y.numericBp-Q.numericBp).map(({bp:Y,size:Q})=>`(max-width: ${Y}) ${Q}`);return J.push(Z),J.join(", ")}function jK($,Z="100vw"){if(!$||$.length===0)return Z;let J=[...$].sort((Y,Q)=>(Y.maxWidth||0)-(Q.maxWidth||0)).filter((Y)=>Y.maxWidth).map((Y)=>`(max-width: ${Y.maxWidth}px) ${Y.imageWidth}`);return J.push(Z),J.join(", ")}var BK={fullWidth:"100vw",halfDesktop:"(max-width: 768px) 100vw, 50vw",thirdDesktop:"(max-width: 768px) 100vw, 33.33vw",quarterDesktop:"(max-width: 480px) 100vw, (max-width: 768px) 50vw, 25vw",contentWidth:"(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 960px"};function K1($,Z={}){let X=Object.entries(Z).filter(([,Q])=>Q!==void 0&&Q!==null).map(([Q,G])=>{if(Array.isArray(G))return[Q,G.join(",")];return[Q,String(G)]});if(X.length===0)return $;let J=X.map(([Q,G])=>`${Q}=${encodeURIComponent(G)}`).join("&"),Y=$.includes("?")?"&":"?";return`${$}${Y}${J}`}function _K($){let[Z,X]=$.split("?"),J={};if(X)new URLSearchParams(X).forEach((Q,G)=>{if(/^\d+$/.test(Q))J[G]=Number.parseInt(Q,10);else if(/^\d+\.\d+$/.test(Q))J[G]=Number.parseFloat(Q);else if(Q==="true")J[G]=!0;else if(Q==="false")J[G]=!1;else J[G]=Q});return{src:Z,params:J}}function VK($){let{src:Z,widths:X,dprValues:J,fixedWidth:Y,formats:Q=f1,baseUrl:G="",params:q={}}=$,W=[];for(let K of Q){let U,z;if(Y!==void 0&&J)U=J3(Z,Y,J,q,K),z=J.map((H)=>({path:"",url:K1(Z,{...q,w:Math.round(Y*H),fm:K}),width:Math.round(Y*H),height:0,format:K,size:0,dpr:H}));else{let H=X||F1;U=_5(Z,H,q,K),z=H.map((j)=>({path:"",url:K1(Z,{...q,w:j,fm:K}),width:j,height:0,format:K,size:0}))}W.push({srcset:U,format:K,mimeType:o7[K],variants:z})}return W}function OK($,Z="100vw"){return $.map(({srcset:X,mimeType:J})=>`<source type="${J}" srcset="${X}" sizes="${Z}" />`).join(`
1717
+ `)}function FK($,Z){if($.length===0)return;let X=[...$].sort((Y,Q)=>Y.width-Q.width),J=X.find((Y)=>Y.width>=Z);if(J)return J;return X[X.length-1]}function Q3($){return o7[$]||"application/octet-stream"}function LK($){return qX[$]||$}function wK($){switch($.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":return"jpeg";case"png":return"png";case"webp":return"webp";case"avif":return"avif";case"gif":return"gif";default:return}}var KX={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},G3=`
1718
1718
  .stx-img-placeholder {
1719
1719
  position: relative;
1720
1720
  overflow: hidden;
@@ -1743,9 +1743,9 @@ ${_}
1743
1743
  filter: blur(0);
1744
1744
  transform: scale(1);
1745
1745
  }
1746
- `.trim();async function q3(){try{return await import("ts-images")}catch{return null}}async function r7($,Z={}){let X={...KX,...Z},J=await q3();if(J)try{return await UX($,X,J)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return a7($,X)}async function UX($,Z,X){let{generatePlaceholder:J,generateThumbHash:Y}=X,G={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[Z.strategy]||"blur";if(Z.strategy==="thumbhash")return{dataURL:(await Y($)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let q=await J($,{width:Z.width,height:Z.height,quality:Z.quality,blurLevel:Z.blurLevel,strategy:G,base64Encode:!0});return{dataURL:q.dataURL,width:q.width,height:q.height,aspectRatio:q.aspectRatio,originalWidth:q.originalWidth,originalHeight:q.originalHeight,strategy:Z.strategy,dominantColor:q.dominantColor,css:q.css}}function a7($,Z){let X=Z.width||20,J=Z.height||X,Y="#e5e7eb",Q=`<svg xmlns="http://www.w3.org/2000/svg" width="${X}" height="${J}" viewBox="0 0 ${X} ${J}"><rect fill="#e5e7eb" width="${X}" height="${J}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Q)}`,width:X,height:J,aspectRatio:X/J,originalWidth:0,originalHeight:0,strategy:Z.strategy,dominantColor:"#e5e7eb"}}async function RK($){let Z=await q3();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await a7($,{strategy:"thumbhash",width:32,height:32})).dataURL}function DK($){let Z=$[0]|$[1]<<8|$[2]<<16,X=(Z&63)/63,J=(Z>>6&63)/31.5-1,Y=(Z>>12&63)/31.5-1,Q=(Z>>18&31)/31,G=Z>>23!==0,q=$[3]|$[4]<<8,W=(q>>3&63)/63,K=(q>>9&63)/63,U=q>>15!==0,z=Math.max(3,U?G?5:7:G?5:7),H=Math.max(3,U?G?5:7:G?5:7),j=32,B=32,_=Math.max(0,Math.min(255,Math.round((X+J)*255))),L=Math.max(0,Math.min(255,Math.round(X*255))),V=Math.max(0,Math.min(255,Math.round((X-J)*255))),O=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1746
+ `.trim();async function q3(){try{return await import("ts-images")}catch{return null}}async function r7($,Z={}){let X={...KX,...Z},J=await q3();if(J)try{return await UX($,X,J)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return a7($,X)}async function UX($,Z,X){let{generatePlaceholder:J,generateThumbHash:Y}=X,G={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[Z.strategy]||"blur";if(Z.strategy==="thumbhash")return{dataURL:(await Y($)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let q=await J($,{width:Z.width,height:Z.height,quality:Z.quality,blurLevel:Z.blurLevel,strategy:G,base64Encode:!0});return{dataURL:q.dataURL,width:q.width,height:q.height,aspectRatio:q.aspectRatio,originalWidth:q.originalWidth,originalHeight:q.originalHeight,strategy:Z.strategy,dominantColor:q.dominantColor,css:q.css}}function a7($,Z){let X=Z.width||20,J=Z.height||X,Y="#e5e7eb",Q=`<svg xmlns="http://www.w3.org/2000/svg" width="${X}" height="${J}" viewBox="0 0 ${X} ${J}"><rect fill="#e5e7eb" width="${X}" height="${J}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Q)}`,width:X,height:J,aspectRatio:X/J,originalWidth:0,originalHeight:0,strategy:Z.strategy,dominantColor:"#e5e7eb"}}async function DK($){let Z=await q3();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await a7($,{strategy:"thumbhash",width:32,height:32})).dataURL}function NK($){let Z=$[0]|$[1]<<8|$[2]<<16,X=(Z&63)/63,J=(Z>>6&63)/31.5-1,Y=(Z>>12&63)/31.5-1,Q=(Z>>18&31)/31,G=Z>>23!==0,q=$[3]|$[4]<<8,W=(q>>3&63)/63,K=(q>>9&63)/63,U=q>>15!==0,z=Math.max(3,U?G?5:7:G?5:7),H=Math.max(3,U?G?5:7:G?5:7),j=32,B=32,_=Math.max(0,Math.min(255,Math.round((X+J)*255))),L=Math.max(0,Math.min(255,Math.round(X*255))),V=Math.max(0,Math.min(255,Math.round((X-J)*255))),O=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1747
1747
  <rect fill="rgb(${_},${L},${V})" width="32" height="32"/>
1748
- </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(O)}`}async function NK($,Z=20,X=50){return r7($,{strategy:"blur",width:Z,quality:X,blurLevel:40})}async function AK($){let Z=await q3();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function MK($,Z=1,X=1){let J=`<svg xmlns="http://www.w3.org/2000/svg" width="${Z}" height="${X}"><rect fill="${$}" width="${Z}" height="${X}"/></svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(J)}`}function t7($,Z,X={}){let J=X.transitionDuration||300,Y=X.easing||"ease-out";return`
1748
+ </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(O)}`}async function AK($,Z=20,X=50){return r7($,{strategy:"blur",width:Z,quality:X,blurLevel:40})}async function MK($){let Z=await q3();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function kK($,Z=1,X=1){let J=`<svg xmlns="http://www.w3.org/2000/svg" width="${Z}" height="${X}"><rect fill="${$}" width="${Z}" height="${X}"/></svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(J)}`}function t7($,Z,X={}){let J=X.transitionDuration||300,Y=X.easing||"ease-out";return`
1749
1749
  #${$} {
1750
1750
  --stx-img-transition-duration: ${J}ms;
1751
1751
  --stx-img-transition-easing: ${Y};
@@ -1762,7 +1762,7 @@ ${_}
1762
1762
  #${$}.stx-img-loaded img {
1763
1763
  opacity: 1;
1764
1764
  }
1765
- `.trim()}function kK($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var x1=new Map;async function e7($,Z={}){let X=`${$}:${JSON.stringify(Z)}`;if(x1.has(X))return x1.get(X);let J=await r7($,Z);return x1.set(X,J),J}function IK(){x1.clear()}function TK(){return{size:x1.size,keys:Array.from(x1.keys())}}async function zX(){try{return await import("./chunk-kms7q66w.js")}catch($){if(!$6)console.warn("[stx-media] Image processor not available, some features disabled:",$),$6=!0;return null}}var $6=!1,W3=80,r5="async",a5="lazy",Z6=!1;async function V5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipOptimization){if(X.tsImagesConfig?.enabled&&!X.isDev)return VX(J,X)}if(X.processedResult?.processed)return z3($,X.processedResult,Z);if(X.responsiveVariants)return Y6($,X.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:q,sizes:W,widths:K=F1,dpr:U,formats:z=f1,quality:H=W3,params:j={},placeholder:B="none",placeholderOptions:_={},lazy:L=!0,priority:V=!1,loading:O=V?"eager":a5,decoding:F=r5,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:k}=$,A=$.class,M=$.style,T=$.id,I=$.data||{},{isDev:y=!1,baseUrl:E=""}=Z;if(y&&!Z.optimize)return BX($);let b,S,v=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!V)try{b=await e7(Y,{strategy:B,..._}),S=t7(v,b,_)}catch{}let x=U!==void 0&&G!==void 0,d;if(x)d=jX($,v,b,Z);else d=await HX($,v,b,Z);let g;if(V){let k0=z.includes("webp")?"webp":z[0],C0=_5(Y,K,{...j,q:H},k0),J0=typeof W==="object"?Y3(W):W||"100vw";g=`<link rel="preload" as="image" imagesrcset="${C0}" imagesizes="${J0}" />`}let X0=[];if(!Z6&&B!=="none")X0.push(G3),Z6=!0;if(S)X0.push(S);let e0=L?J6(v):void 0;return{html:d,preloadLink:g,css:X0.length>0?X0.join(`
1765
+ `.trim()}function IK($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var x1=new Map;async function e7($,Z={}){let X=`${$}:${JSON.stringify(Z)}`;if(x1.has(X))return x1.get(X);let J=await r7($,Z);return x1.set(X,J),J}function TK(){x1.clear()}function EK(){return{size:x1.size,keys:Array.from(x1.keys())}}async function zX(){try{return await import("./chunk-kms7q66w.js")}catch($){if(!$6)console.warn("[stx-media] Image processor not available, some features disabled:",$),$6=!0;return null}}var $6=!1,W3=80,r5="async",a5="lazy",Z6=!1;async function V5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipOptimization){if(X.tsImagesConfig?.enabled&&!X.isDev)return VX(J,X)}if(X.processedResult?.processed)return z3($,X.processedResult,Z);if(X.responsiveVariants)return Y6($,X.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:q,sizes:W,widths:K=F1,dpr:U,formats:z=f1,quality:H=W3,params:j={},placeholder:B="none",placeholderOptions:_={},lazy:L=!0,priority:V=!1,loading:O=V?"eager":a5,decoding:F=r5,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:k}=$,A=$.class,M=$.style,T=$.id,I=$.data||{},{isDev:y=!1,baseUrl:E=""}=Z;if(y&&!Z.optimize)return BX($);let b,S,v=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!V)try{b=await e7(Y,{strategy:B,..._}),S=t7(v,b,_)}catch{}let x=U!==void 0&&G!==void 0,d;if(x)d=jX($,v,b,Z);else d=await HX($,v,b,Z);let g;if(V){let k0=z.includes("webp")?"webp":z[0],C0=_5(Y,K,{...j,q:H},k0),X0=typeof W==="object"?Y3(W):W||"100vw";g=`<link rel="preload" as="image" imagesrcset="${C0}" imagesizes="${X0}" />`}let Q0=[];if(!Z6&&B!=="none")Q0.push(G3),Z6=!0;if(S)Q0.push(S);let e0=L?J6(v):void 0;return{html:d,preloadLink:g,css:Q0.length>0?Q0.join(`
1766
1766
  `):void 0,script:e0}}async function HX($,Z,X,J){let{src:Y,alt:Q,width:G,height:q,sizes:W,widths:K=F1,formats:U=f1,quality:z=W3,params:H={},lazy:j=!0,priority:B=!1,loading:_=B?"eager":a5,decoding:L=r5,fetchpriority:V,objectFit:O,objectPosition:F,crossorigin:w,referrerpolicy:R}=$,D=$.class,N=$.style,k=$.data||{},A=typeof W==="object"?Y3(W):W||"100vw",M=[];for(let y of U){let E=_5(Y,K,{...H,q:z},y),b=Q3(y);if(j&&!B)M.push(` <source type="${b}" data-srcset="${E}" data-sizes="${A}" />`);else M.push(` <source type="${b}" srcset="${E}" sizes="${A}" />`)}let T=K3({src:K1(Y,{...H,q:z}),alt:Q,width:G,height:q,loading:B?void 0:_,decoding:L,fetchpriority:B?"high":V,objectFit:O,objectPosition:F,crossorigin:w,referrerpolicy:R,className:X6(D,X),style:U3(N,O,F,X),lazy:j&&!B,data:k}),I;if(X){let y=`background-image: url('${X.dataURL}'); background-size: cover; background-position: center;`;I=`<div id="${Z}" class="stx-img-placeholder" style="${y}">
1767
1767
  <picture>
1768
1768
  ${M.join(`
@@ -1812,7 +1812,7 @@ ${M.join(`
1812
1812
 
1813
1813
  observer.observe(container);
1814
1814
  })();
1815
- `.trim()}function _X($){let Z=$.match(/<Img\s+([^>]*?)\/?>/);if(!Z)return null;let X=Z[1],J={},Y=/(:?)(\w+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]+)\}))?/g,Q;while((Q=Y.exec(X))!==null){let[,G,q,W,K,U]=Q,z=W??K??U??!0;if(G===":"&&typeof z==="string")try{J[q]=JSON.parse(z)}catch{J[q]=z}else switch(q){case"src":J.src=String(z);break;case"alt":J.alt=String(z);break;case"width":J.width=Number(z)||z;break;case"height":J.height=Number(z)||z;break;case"sizes":J.sizes=String(z);break;case"quality":J.quality=Number(z);break;case"placeholder":J.placeholder=z;break;case"lazy":J.lazy=z===!0||z==="true";break;case"priority":J.priority=z===!0||z==="true";break;case"class":J.class=String(z);break;case"style":J.style=String(z);break;case"id":J.id=String(z);break;case"loading":J.loading=z;break;case"decoding":J.decoding=z;break;case"fetchpriority":J.fetchpriority=z;break;case"objectFit":J.objectFit=z;break;case"objectPosition":J.objectPosition=String(z);break;case"crossorigin":J.crossorigin=z;break}}if(!J.src||!J.alt)return null;return J}async function SK($,Z={}){let X=/<Img\s+[^>]*?\/?>/g,J=[],Y=[],Q=[],G=$,q=[],W;while((W=X.exec($))!==null)q.push({match:W[0],index:W.index});for(let K=q.length-1;K>=0;K--){let{match:U}=q[K],z=_X(U);if(z){let H=await V5(z,Z);if(G=G.replace(U,H.html),H.preloadLink)J.push(H.preloadLink);if(H.css)Y.push(H.css);if(H.script)Q.push(H.script)}}return{html:G,preloadLinks:J,styles:Y,scripts:Q}}async function VX($,Z){let X=await zX();if(!X)return V5({...$,process:!1},Z);let J=Z.tsImagesConfig;if($.responsiveWidths&&$.responsiveWidths.length>0||$.widths&&$.widths.length>0||!$.width&&!$.dpr){let Q=await X.generateResponsiveVariants($.src,$,J);if(Q)return Y6($,Q,Z)}else{let Q=await X.processImage($.src,$,J);if(Q.processed)return z3($,Q,Z)}return V5({...$,process:!1},Z)}async function z3($,Z,X){let{alt:J,width:Y,height:Q,lazy:G=!0,priority:q=!1,objectFit:W,objectPosition:K,crossorigin:U,referrerpolicy:z}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,_=$.data||{},L=Z.variants||[],V=L.find((S)=>S.format==="jpeg")||L.find((S)=>S.format==="webp")||L[0],O=V?.url||$.src,F=L.filter((S)=>S.format===(V?.format||"jpeg")).map((S)=>`${S.url} ${S.width}w`).join(", "),w=new Map;for(let S of L){if(!w.has(S.format))w.set(S.format,[]);w.get(S.format).push(S)}let R=[],D=["avif","webp","jpeg","png"];for(let S of D){let v=w.get(S);if(v&&v.length>0){let x=v.map((g)=>`${g.url} ${g.width}w`).join(", "),d=Q3(S);if(G&&!q)R.push(` <source type="${d}" data-srcset="${x}" />`);else R.push(` <source type="${d}" srcset="${x}" />`)}}let N=[];if(G&&!q){if(N.push(`data-src="${p0(O)}"`),N.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),F)N.push(`data-srcset="${F}"`)}else if(N.push(`src="${p0(O)}"`),F)N.push(`srcset="${F}"`);N.push(`alt="${p0(J)}"`);let k=Y||Z.originalWidth,A=Q||Z.originalHeight;if(k)N.push(`width="${k}"`);if(A)N.push(`height="${A}"`);if(!q)N.push(`loading="${G?"lazy":"eager"}"`);if(N.push('decoding="async"'),q)N.push('fetchpriority="high"');if(U)N.push(`crossorigin="${U}"`);if(z)N.push(`referrerpolicy="${z}"`);let M=[];if(W)M.push(`object-fit: ${W}`);if(K)M.push(`object-position: ${K}`);if(Z.placeholder&&G)M.push("opacity: 0; transition: opacity 300ms ease-out");if(j)M.push(j);if(M.length>0)N.push(`style="${M.join("; ")}"`);let T=[];if(H)T.push(H);if(Z.placeholder)T.push("stx-img-blur");if(T.length>0)N.push(`class="${T.join(" ")}"`);if(G&&!q)N.push("data-stx-lazy");for(let[S,v]of Object.entries(_))N.push(`data-${S}="${p0(v)}"`);let I;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let S=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;I=`<div id="${B}" class="stx-img-placeholder" style="${S}">
1815
+ `.trim()}function _X($){let Z=$.match(/<Img\s+([^>]*?)\/?>/);if(!Z)return null;let X=Z[1],J={},Y=/(:?)(\w+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]+)\}))?/g,Q;while((Q=Y.exec(X))!==null){let[,G,q,W,K,U]=Q,z=W??K??U??!0;if(G===":"&&typeof z==="string")try{J[q]=JSON.parse(z)}catch{J[q]=z}else switch(q){case"src":J.src=String(z);break;case"alt":J.alt=String(z);break;case"width":J.width=Number(z)||z;break;case"height":J.height=Number(z)||z;break;case"sizes":J.sizes=String(z);break;case"quality":J.quality=Number(z);break;case"placeholder":J.placeholder=z;break;case"lazy":J.lazy=z===!0||z==="true";break;case"priority":J.priority=z===!0||z==="true";break;case"class":J.class=String(z);break;case"style":J.style=String(z);break;case"id":J.id=String(z);break;case"loading":J.loading=z;break;case"decoding":J.decoding=z;break;case"fetchpriority":J.fetchpriority=z;break;case"objectFit":J.objectFit=z;break;case"objectPosition":J.objectPosition=String(z);break;case"crossorigin":J.crossorigin=z;break}}if(!J.src||!J.alt)return null;return J}async function CK($,Z={}){let X=/<Img\s+[^>]*?\/?>/g,J=[],Y=[],Q=[],G=$,q=[],W;while((W=X.exec($))!==null)q.push({match:W[0],index:W.index});for(let K=q.length-1;K>=0;K--){let{match:U}=q[K],z=_X(U);if(z){let H=await V5(z,Z);if(G=G.replace(U,H.html),H.preloadLink)J.push(H.preloadLink);if(H.css)Y.push(H.css);if(H.script)Q.push(H.script)}}return{html:G,preloadLinks:J,styles:Y,scripts:Q}}async function VX($,Z){let X=await zX();if(!X)return V5({...$,process:!1},Z);let J=Z.tsImagesConfig;if($.responsiveWidths&&$.responsiveWidths.length>0||$.widths&&$.widths.length>0||!$.width&&!$.dpr){let Q=await X.generateResponsiveVariants($.src,$,J);if(Q)return Y6($,Q,Z)}else{let Q=await X.processImage($.src,$,J);if(Q.processed)return z3($,Q,Z)}return V5({...$,process:!1},Z)}async function z3($,Z,X){let{alt:J,width:Y,height:Q,lazy:G=!0,priority:q=!1,objectFit:W,objectPosition:K,crossorigin:U,referrerpolicy:z}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,_=$.data||{},L=Z.variants||[],V=L.find((S)=>S.format==="jpeg")||L.find((S)=>S.format==="webp")||L[0],O=V?.url||$.src,F=L.filter((S)=>S.format===(V?.format||"jpeg")).map((S)=>`${S.url} ${S.width}w`).join(", "),w=new Map;for(let S of L){if(!w.has(S.format))w.set(S.format,[]);w.get(S.format).push(S)}let R=[],D=["avif","webp","jpeg","png"];for(let S of D){let v=w.get(S);if(v&&v.length>0){let x=v.map((g)=>`${g.url} ${g.width}w`).join(", "),d=Q3(S);if(G&&!q)R.push(` <source type="${d}" data-srcset="${x}" />`);else R.push(` <source type="${d}" srcset="${x}" />`)}}let N=[];if(G&&!q){if(N.push(`data-src="${p0(O)}"`),N.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),F)N.push(`data-srcset="${F}"`)}else if(N.push(`src="${p0(O)}"`),F)N.push(`srcset="${F}"`);N.push(`alt="${p0(J)}"`);let k=Y||Z.originalWidth,A=Q||Z.originalHeight;if(k)N.push(`width="${k}"`);if(A)N.push(`height="${A}"`);if(!q)N.push(`loading="${G?"lazy":"eager"}"`);if(N.push('decoding="async"'),q)N.push('fetchpriority="high"');if(U)N.push(`crossorigin="${U}"`);if(z)N.push(`referrerpolicy="${z}"`);let M=[];if(W)M.push(`object-fit: ${W}`);if(K)M.push(`object-position: ${K}`);if(Z.placeholder&&G)M.push("opacity: 0; transition: opacity 300ms ease-out");if(j)M.push(j);if(M.length>0)N.push(`style="${M.join("; ")}"`);let T=[];if(H)T.push(H);if(Z.placeholder)T.push("stx-img-blur");if(T.length>0)N.push(`class="${T.join(" ")}"`);if(G&&!q)N.push("data-stx-lazy");for(let[S,v]of Object.entries(_))N.push(`data-${S}="${p0(v)}"`);let I;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let S=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;I=`<div id="${B}" class="stx-img-placeholder" style="${S}">
1816
1816
  <picture>
1817
1817
  ${R.join(`
1818
1818
  `)}
@@ -2034,7 +2034,7 @@ else {
2034
2034
  .ts-video-player__play-button svg {
2035
2035
  margin-left: 4px;
2036
2036
  }
2037
- `.trim();return{html:F,script:w,css:R}}function U6($){switch($.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function NX($){let Z=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let X of Z){let J=$.match(X);if(J)return J[1]}return null}function AX($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function D0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function gK($,Z,X){if(Z.src)return{src:String(Z.src),...Z};let J=$.trim();if(J.startsWith("@video(")||J.startsWith("("))J=J.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=J.indexOf(",");if(Y===-1)return{src:J.replace(/^['"]|['"]$/g,"")};let Q=J.slice(0,Y).trim().replace(/^['"]|['"]$/g,""),G=J.slice(Y+1).trim();try{let q=JSON.parse(G);return{src:Q,...q}}catch{return{src:Q}}}async function MX($,Z){let X=await q6();if(!X)return e5({...$,process:!1},Z);let J=Z.tsVideosConfig,Y=await X.processVideo($.src,$,J,$.onProcessProgress);if(Y.processed)return z6($,Y,Z);return e5({...$,process:!1},Z)}async function kX($,Z){let X=await q6();if(!X||!$.src)return;let J=typeof $.generatePoster==="object"?$.generatePoster:{timestamp:0},Y=Z.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await X.generatePoster($.src,J,Y.outputDir,Y.baseUrl||"/videos"))?.url}function z6($,Z,X){let{controls:J=W6,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:q=K6,playsinline:W=!0,lazy:K=!0,width:U,height:z,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,_=$.class,L=$.style,V=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,O=$.src,F=U6(O);if(Z.transcoded)O=Z.transcoded.url,F="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)O=Z.streaming.hls.manifestUrl,F="application/x-mpegURL";else if(Z.streaming?.dash)O=Z.streaming.dash.manifestUrl,F="application/dash+xml"}let R=Z.poster?.url||$.poster,D=[`id="${V}"`];if(J)D.push("controls");if(Y)D.push("autoplay");if(Q)D.push("muted");if(G)D.push("loop");if(W)D.push("playsinline");if(j)D.push("disablepictureinpicture");if(B)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(K){if(D.push(`data-preload="${q}"`),D.push('preload="none"'),R)D.push(`data-poster="${D0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${q}"`),R)D.push(`poster="${D0(R)}"`);let N=U||Z.metadata?.width,k=z||Z.metadata?.height;if(N)D.push(`width="${N}"`);if(k)D.push(`height="${k}"`);if(_)D.push(`class="${D0(_)}"`);if(L)D.push(`style="${D0(L)}"`);let M=` <source ${K?`data-src="${D0(O)}"`:`src="${D0(O)}"`} type="${F}" />`,T=`<video ${D.join(" ")}>
2037
+ `.trim();return{html:F,script:w,css:R}}function U6($){switch($.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function NX($){let Z=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let X of Z){let J=$.match(X);if(J)return J[1]}return null}function AX($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function D0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function hK($,Z,X){if(Z.src)return{src:String(Z.src),...Z};let J=$.trim();if(J.startsWith("@video(")||J.startsWith("("))J=J.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=J.indexOf(",");if(Y===-1)return{src:J.replace(/^['"]|['"]$/g,"")};let Q=J.slice(0,Y).trim().replace(/^['"]|['"]$/g,""),G=J.slice(Y+1).trim();try{let q=JSON.parse(G);return{src:Q,...q}}catch{return{src:Q}}}async function MX($,Z){let X=await q6();if(!X)return e5({...$,process:!1},Z);let J=Z.tsVideosConfig,Y=await X.processVideo($.src,$,J,$.onProcessProgress);if(Y.processed)return z6($,Y,Z);return e5({...$,process:!1},Z)}async function kX($,Z){let X=await q6();if(!X||!$.src)return;let J=typeof $.generatePoster==="object"?$.generatePoster:{timestamp:0},Y=Z.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await X.generatePoster($.src,J,Y.outputDir,Y.baseUrl||"/videos"))?.url}function z6($,Z,X){let{controls:J=W6,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:q=K6,playsinline:W=!0,lazy:K=!0,width:U,height:z,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,_=$.class,L=$.style,V=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,O=$.src,F=U6(O);if(Z.transcoded)O=Z.transcoded.url,F="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)O=Z.streaming.hls.manifestUrl,F="application/x-mpegURL";else if(Z.streaming?.dash)O=Z.streaming.dash.manifestUrl,F="application/dash+xml"}let R=Z.poster?.url||$.poster,D=[`id="${V}"`];if(J)D.push("controls");if(Y)D.push("autoplay");if(Q)D.push("muted");if(G)D.push("loop");if(W)D.push("playsinline");if(j)D.push("disablepictureinpicture");if(B)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(K){if(D.push(`data-preload="${q}"`),D.push('preload="none"'),R)D.push(`data-poster="${D0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${q}"`),R)D.push(`poster="${D0(R)}"`);let N=U||Z.metadata?.width,k=z||Z.metadata?.height;if(N)D.push(`width="${N}"`);if(k)D.push(`height="${k}"`);if(_)D.push(`class="${D0(_)}"`);if(L)D.push(`style="${D0(L)}"`);let M=` <source ${K?`data-src="${D0(O)}"`:`src="${D0(O)}"`} type="${F}" />`,T=`<video ${D.join(" ")}>
2038
2038
  ${M}
2039
2039
  Your browser does not support the video tag.
2040
2040
  </video>`;if(Z.spriteSheet)T=`<div class="stx-video-wrapper" data-sprite-sheet="${D0(Z.spriteSheet.url)}" data-sprite-cols="${Z.spriteSheet.columns}" data-sprite-interval="${Z.spriteSheet.interval}">
@@ -2156,15 +2156,15 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
2156
2156
  `;let U=$;if(!Q)U=U.replace(/<head[^>]*>/,`$&
2157
2157
  <title>${c(G)}</title>`);return U.replace(/<head[^>]*>/,`$&
2158
2158
  ${K}
2159
- `)}function c($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var rX=["og:","article:","book:","profile:","fb:","music:","video:"];function N6($){let Z=$.trim(),X=Z[0];if((X==="'"||X==='"'||X==="`")&&Z.length>1&&Z.at(-1)===X)return{value:Z.slice(1,-1),quoted:!0};return{value:Z,quoted:!1}}var R3={name:"meta",handler:($,Z,X,J)=>{if(Z.length<1)return $0("Meta","meta directive requires at least the meta name",l.INVALID_DIRECTIVE_SYNTAX);let Y=N6(Z[0]).value,Q;if(Z.length>1){let W=N6(Z[1]);Q=W.quoted?W.value:String(X?.[W.value]??W.value)}else{let W=Y.includes(":")?Y.slice(Y.indexOf(":")+1):Y,K=X?.openGraph;Q=String(X?.[W]??K?.[W]??"")}if(!Q)return"";let q=rX.some((W)=>Y.startsWith(W))?{property:Y,content:Q}:{name:Y,content:Q};if(X)X.__stx_runtime_head=G$(X.__stx_runtime_head??{},{meta:[q]});return""},hasEndTag:!1},D3={name:"structuredData",handler:($,Z,X,J)=>{if($.trim()==="")return $0("StructuredData","structuredData directive requires JSON-LD content",l.INVALID_DIRECTIVE_SYNTAX);try{let Y=JSON.parse($);if(!Y["@context"])Y["@context"]="https://schema.org";if(!Y["@type"])return $0("StructuredData","structuredData requires @type property",l.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Y)}</script>`}catch(Y){let Q=Y instanceof Error?Y.message:String(Y);return $0("StructuredData",Q,l.EVALUATION_ERROR)}},hasEndTag:!0};function _U(){return[R3,D3]}function VU($,Z){let X=Z.replace(/\/$/,""),J=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2159
+ `)}function c($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var rX=["og:","article:","book:","profile:","fb:","music:","video:"];function N6($){let Z=$.trim(),X=Z[0];if((X==="'"||X==='"'||X==="`")&&Z.length>1&&Z.at(-1)===X)return{value:Z.slice(1,-1),quoted:!0};return{value:Z,quoted:!1}}var R3={name:"meta",handler:($,Z,X,J)=>{if(Z.length<1)return $0("Meta","meta directive requires at least the meta name",l.INVALID_DIRECTIVE_SYNTAX);let Y=N6(Z[0]).value,Q;if(Z.length>1){let W=N6(Z[1]);Q=W.quoted?W.value:String(X?.[W.value]??W.value)}else{let W=Y.includes(":")?Y.slice(Y.indexOf(":")+1):Y,K=X?.openGraph;Q=String(X?.[W]??K?.[W]??"")}if(!Q)return"";let q=rX.some((W)=>Y.startsWith(W))?{property:Y,content:Q}:{name:Y,content:Q};if(X)X.__stx_runtime_head=G$(X.__stx_runtime_head??{},{meta:[q]});return""},hasEndTag:!1},D3={name:"structuredData",handler:($,Z,X,J)=>{if($.trim()==="")return $0("StructuredData","structuredData directive requires JSON-LD content",l.INVALID_DIRECTIVE_SYNTAX);try{let Y=JSON.parse($);if(!Y["@context"])Y["@context"]="https://schema.org";if(!Y["@type"])return $0("StructuredData","structuredData requires @type property",l.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Y)}</script>`}catch(Y){let Q=Y instanceof Error?Y.message:String(Y);return $0("StructuredData",Q,l.EVALUATION_ERROR)}},hasEndTag:!0};function VU(){return[R3,D3]}function OU($,Z){let X=Z.replace(/\/$/,""),J=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2160
2160
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
2161
2161
  ${$.map((Q)=>{let G=Q.startsWith("http")?Q:`${X}${Q.startsWith("/")?"":"/"}${Q}`;return` <sitemap>
2162
2162
  <loc>${tX(G)}</loc>
2163
2163
  <lastmod>${J}</lastmod>
2164
2164
  </sitemap>`}).join(`
2165
2165
  `)}
2166
- </sitemapindex>`}async function OU($,Z){let{extensions:X=[".stx",".html",".htm"],ignore:J=["_*",".*","node_modules","components","partials","layouts"]}=Z,Y=[],Q=X.length===1?`*${X[0]}`:`*{${X.join(",")}}`,G=new Bun.Glob(`**/${Q}`);for await(let q of G.scan($)){if(J.some((H)=>{if(H.startsWith("*"))return q.includes(H.slice(1));return q.startsWith(H)||q.includes(`/${H}`)}))continue;let K=q.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!K.startsWith("/"))K=`/${K}`;if(K!=="/"&&K.endsWith("/"))K=K.slice(0,-1);let U=`${$}/${q}`,z;try{let H=await Bun.file(U).stat();if(H)z=new Date(H.mtime).toISOString().split("T")[0]}catch{}Y.push({loc:K||"/",lastmod:z,priority:K==="/"?1:0.5})}return Y.sort((q,W)=>q.loc.localeCompare(W.loc)),Y}function aX($){let Z=[];for(let X of $.rules){if(Z.push(`User-agent: ${X.userAgent}`),X.allow)for(let J of X.allow)Z.push(`Allow: ${J}`);if(X.disallow)for(let J of X.disallow)Z.push(`Disallow: ${J}`);if(X.crawlDelay!==void 0)Z.push(`Crawl-delay: ${X.crawlDelay}`);Z.push("")}if($.sitemap){let X=Array.isArray($.sitemap)?$.sitemap:[$.sitemap];for(let J of X)Z.push(`Sitemap: ${J}`)}if($.host)Z.push(`Host: ${$.host}`);return Z.join(`
2167
- `).trim()}function FU($){return aX({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function tX($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import eX from"fs";import h0 from"path";async function AU($,Z){if(!$.webComponents?.enabled)return[];let X=$.webComponents.components||[],J=[];if(X.length>0){if($.debug)console.log(`Building ${X.length} web components...`);for(let Y of X)try{let Q=await $J(Y,$,Z);if(Q)J.push(Q)}catch(Q){if(console.error(`Error building web component ${Y.name}:`,Q),$.debug)throw Q}}return J}async function $J($,Z,X){let{name:J,file:Y,tag:Q,extends:G}=$;if(!J||!Y||!Q)return console.error("Invalid web component configuration, missing required fields:",$),null;let q=null;if(h0.isAbsolute(Y)&&await t(Y))q=Y;else if(Z.componentsDir){let _=h0.join(Z.componentsDir,Y);if(await t(_))q=_}if(!q)q=await q$(Y,process.cwd(),Z,X);if(!q)return console.error(`Web component source file not found: ${Y}`),null;let W=await Bun.file(q).text();X.add(q);let U=($.outputFormat||"js")==="ts",z=U?XJ({name:J,tag:Q,baseElement:G,source:W,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):ZJ({name:J,tag:Q,baseElement:G,source:W,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await eX.promises.mkdir(H,{recursive:!0});let j=U?"ts":"js",B=h0.join(H,`${Q}.${j}`);if(await Bun.write(B,z),Z.debug)console.log(`Built web component ${J} -> ${B}`);return B}function ZJ($){let{name:Z,tag:X,baseElement:J="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:q,attributes:W=[]}=$,K=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)K=K.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),K=K.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),K=K.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),K=K.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let U="";if(q)U=`<link rel="stylesheet" href="${q}">`;return`/**
2166
+ </sitemapindex>`}async function FU($,Z){let{extensions:X=[".stx",".html",".htm"],ignore:J=["_*",".*","node_modules","components","partials","layouts"]}=Z,Y=[],Q=X.length===1?`*${X[0]}`:`*{${X.join(",")}}`,G=new Bun.Glob(`**/${Q}`);for await(let q of G.scan($)){if(J.some((H)=>{if(H.startsWith("*"))return q.includes(H.slice(1));return q.startsWith(H)||q.includes(`/${H}`)}))continue;let K=q.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!K.startsWith("/"))K=`/${K}`;if(K!=="/"&&K.endsWith("/"))K=K.slice(0,-1);let U=`${$}/${q}`,z;try{let H=await Bun.file(U).stat();if(H)z=new Date(H.mtime).toISOString().split("T")[0]}catch{}Y.push({loc:K||"/",lastmod:z,priority:K==="/"?1:0.5})}return Y.sort((q,W)=>q.loc.localeCompare(W.loc)),Y}function aX($){let Z=[];for(let X of $.rules){if(Z.push(`User-agent: ${X.userAgent}`),X.allow)for(let J of X.allow)Z.push(`Allow: ${J}`);if(X.disallow)for(let J of X.disallow)Z.push(`Disallow: ${J}`);if(X.crawlDelay!==void 0)Z.push(`Crawl-delay: ${X.crawlDelay}`);Z.push("")}if($.sitemap){let X=Array.isArray($.sitemap)?$.sitemap:[$.sitemap];for(let J of X)Z.push(`Sitemap: ${J}`)}if($.host)Z.push(`Host: ${$.host}`);return Z.join(`
2167
+ `).trim()}function LU($){return aX({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function tX($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import eX from"fs";import h0 from"path";async function MU($,Z){if(!$.webComponents?.enabled)return[];let X=$.webComponents.components||[],J=[];if(X.length>0){if($.debug)console.log(`Building ${X.length} web components...`);for(let Y of X)try{let Q=await $J(Y,$,Z);if(Q)J.push(Q)}catch(Q){if(console.error(`Error building web component ${Y.name}:`,Q),$.debug)throw Q}}return J}async function $J($,Z,X){let{name:J,file:Y,tag:Q,extends:G}=$;if(!J||!Y||!Q)return console.error("Invalid web component configuration, missing required fields:",$),null;let q=null;if(h0.isAbsolute(Y)&&await t(Y))q=Y;else if(Z.componentsDir){let _=h0.join(Z.componentsDir,Y);if(await t(_))q=_}if(!q)q=await q$(Y,process.cwd(),Z,X);if(!q)return console.error(`Web component source file not found: ${Y}`),null;let W=await Bun.file(q).text();X.add(q);let U=($.outputFormat||"js")==="ts",z=U?XJ({name:J,tag:Q,baseElement:G,source:W,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):ZJ({name:J,tag:Q,baseElement:G,source:W,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await eX.promises.mkdir(H,{recursive:!0});let j=U?"ts":"js",B=h0.join(H,`${Q}.${j}`);if(await Bun.write(B,z),Z.debug)console.log(`Built web component ${J} -> ${B}`);return B}function ZJ($){let{name:Z,tag:X,baseElement:J="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:q,attributes:W=[]}=$,K=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)K=K.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),K=K.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),K=K.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),K=K.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let U="";if(q)U=`<link rel="stylesheet" href="${q}">`;return`/**
2168
2168
  * ${Z} Web Component
2169
2169
  * Auto-generated from stx component
2170
2170
  */
@@ -2411,9 +2411,9 @@ declare global {
2411
2411
 
2412
2412
  // Register the web component
2413
2413
  customElements.define('${X}', ${U});
2414
- `}var N3={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function A3($){let Z=$.split("").reduce((X,J)=>(X<<5)-X+J.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function JJ($,Z,X={}){let J={...N3,...X},Y=A3(Z);switch(J.strategy){case"shadow":return $;case"prefix":return QJ($,J.prefix||Z,J.preserveOriginal);case"attribute":return YJ($,Y,J.attributeName||"data-v",J.preserveOriginal);case"bem":return GJ($,Z,J.preserveOriginal);default:return $}}function YJ($,Z,X,J){let Y=`[${X}-${Z}]`;return $.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,(Q,G,q)=>{if(G.startsWith("@"))return Q;if(/^(?::root|:host|html|body)$/i.test(G))return Q;return`${J?`${G}${Y}`:`${G}${Y}`}${q}`})}function QJ($,Z,X){return $.replace(/\.([a-z_][\w-]*)/gi,(J,Y)=>{if(Y.startsWith(Z))return J;let Q=`${Z}__${Y}`;return X?`.${Q}`:`.${Q}`})}function GJ($,Z,X){let J=Z.replace(/[^a-z0-9]/gi,"-");return $.replace(/\.([a-z_][\w-]*)/gi,(Y,Q)=>{if(Q.includes("__")||Q.includes("--")){if(!Q.startsWith(J))return`.${J}__${Q}`;return Y}let G=`${J}__${Q}`;return X?`.${G}`:`.${G}`})}function qJ($,Z,X={}){let J={...N3,...X};if(J.strategy==="shadow")return $;if(J.strategy==="attribute"){let Y=A3(Z),G=`${J.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(q,W,K)=>{if(/^(?:script|style|!--)$/i.test(W))return q;let U=K.trimEnd().endsWith("/"),z=U?K.slice(0,-1):K;return`<${W}${z} ${G}${U?"/":""}>`})}if(J.strategy==="prefix"||J.strategy==="bem"){let Y=J.strategy==="bem"?Z.replace(/[^a-z0-9]/gi,"-"):J.prefix||Z;return $.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,(Q,G)=>{return`class="${G.split(/\s+/).map((W)=>{if(!W)return W;if(W.startsWith(Y))return W;return`${Y}__${W}`}).join(" ")}"`})}return $}function MU($,Z={}){let X={...N3,...Z},J=A3($);return`${X.attributeName||"data-v"}-${J}`}function kU($,Z,X={}){let J="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,q,W)=>{if(/\bscoped\b/i.test(q)||X.strategy!=="shadow")J+=`${JJ(W,Z,X)}
2414
+ `}var N3={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function A3($){let Z=$.split("").reduce((X,J)=>(X<<5)-X+J.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function JJ($,Z,X={}){let J={...N3,...X},Y=A3(Z);switch(J.strategy){case"shadow":return $;case"prefix":return QJ($,J.prefix||Z,J.preserveOriginal);case"attribute":return YJ($,Y,J.attributeName||"data-v",J.preserveOriginal);case"bem":return GJ($,Z,J.preserveOriginal);default:return $}}function YJ($,Z,X,J){let Y=`[${X}-${Z}]`;return $.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,(Q,G,q)=>{if(G.startsWith("@"))return Q;if(/^(?::root|:host|html|body)$/i.test(G))return Q;return`${J?`${G}${Y}`:`${G}${Y}`}${q}`})}function QJ($,Z,X){return $.replace(/\.([a-z_][\w-]*)/gi,(J,Y)=>{if(Y.startsWith(Z))return J;let Q=`${Z}__${Y}`;return X?`.${Q}`:`.${Q}`})}function GJ($,Z,X){let J=Z.replace(/[^a-z0-9]/gi,"-");return $.replace(/\.([a-z_][\w-]*)/gi,(Y,Q)=>{if(Q.includes("__")||Q.includes("--")){if(!Q.startsWith(J))return`.${J}__${Q}`;return Y}let G=`${J}__${Q}`;return X?`.${G}`:`.${G}`})}function qJ($,Z,X={}){let J={...N3,...X};if(J.strategy==="shadow")return $;if(J.strategy==="attribute"){let Y=A3(Z),G=`${J.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(q,W,K)=>{if(/^(?:script|style|!--)$/i.test(W))return q;let U=K.trimEnd().endsWith("/"),z=U?K.slice(0,-1):K;return`<${W}${z} ${G}${U?"/":""}>`})}if(J.strategy==="prefix"||J.strategy==="bem"){let Y=J.strategy==="bem"?Z.replace(/[^a-z0-9]/gi,"-"):J.prefix||Z;return $.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,(Q,G)=>{return`class="${G.split(/\s+/).map((W)=>{if(!W)return W;if(W.startsWith(Y))return W;return`${Y}__${W}`}).join(" ")}"`})}return $}function kU($,Z={}){let X={...N3,...Z},J=A3($);return`${X.attributeName||"data-v"}-${J}`}function IU($,Z,X={}){let J="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,q,W)=>{if(/\bscoped\b/i.test(q)||X.strategy!=="shadow")J+=`${JJ(W,Z,X)}
2415
2415
  `;else J+=`${W}
2416
- `;return""});return{html:qJ(Y,Z,X),css:J.trim()}}function u1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function IU($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:W={},events:K={},methods:U={},state:z={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(q),B=j.filter((k)=>q[k].attribute!==!1).map((k)=>q[k].attribute||u1(k)),_=j.map((k)=>{let A=q[k],M=A.default!==void 0?JSON.stringify(A.default):A.type==="string"?'""':A.type==="number"?"0":A.type==="boolean"?"false":A.type==="array"?"[]":"{}";return` this._${k} = ${M};`}).join(`
2416
+ `;return""});return{html:qJ(Y,Z,X),css:J.trim()}}function u1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function TU($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:W={},events:K={},methods:U={},state:z={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(q),B=j.filter((k)=>q[k].attribute!==!1).map((k)=>q[k].attribute||u1(k)),_=j.map((k)=>{let A=q[k],M=A.default!==void 0?JSON.stringify(A.default):A.type==="string"?'""':A.type==="number"?"0":A.type==="boolean"?"false":A.type==="array"?"[]":"{}";return` this._${k} = ${M};`}).join(`
2417
2417
  `),L=j.map((k)=>{let A=q[k],M=A.attribute!==!1?A.attribute||u1(k):null,T=A.reflect&&M?`
2418
2418
  if (value !== null && value !== undefined) {
2419
2419
  ${A.type==="boolean"?`if (value) { this.setAttribute('${M}', ''); }
@@ -2615,7 +2615,7 @@ customElements.define('${X}', ${H});
2615
2615
  // Export for module usage
2616
2616
  export { ${H} };
2617
2617
  export default ${H};
2618
- `}function TU($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:W={},events:K={},methods:U={},state:z={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(q),B=j.filter((A)=>q[A].attribute!==!1).map((A)=>q[A].attribute||u1(A)),_=(A)=>{switch(A){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},L=j.length>0?`
2618
+ `}function EU($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:W={},events:K={},methods:U={},state:z={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(q),B=j.filter((A)=>q[A].attribute!==!1).map((A)=>q[A].attribute||u1(A)),_=(A)=>{switch(A){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},L=j.length>0?`
2619
2619
  /**
2620
2620
  * Props interface for ${Z}
2621
2621
  */
@@ -2867,7 +2867,7 @@ declare global {
2867
2867
  customElements.define('${X}', ${H});
2868
2868
 
2869
2869
  export default ${H};
2870
- `}function EU(){return`/**
2870
+ `}function bU(){return`/**
2871
2871
  * ReactiveElement Mixin
2872
2872
  * Adds reactive properties and lifecycle management to web components
2873
2873
  */
@@ -2989,7 +2989,7 @@ else {
2989
2989
 
2990
2990
  export { ReactiveElement };
2991
2991
  export default ReactiveElement;
2992
- `}function bU(){return`/**
2992
+ `}function yU(){return`/**
2993
2993
  * stx Reactive Web Components Runtime
2994
2994
  * Provides base classes and utilities for reactive web components
2995
2995
  */
@@ -3259,12 +3259,12 @@ ${U}
3259
3259
  customElements.define('${Z}', ${G});
3260
3260
  `}async function T6($,Z,X,J){if(Z.length<1)return $0("WebComponent","@webcomponent directive requires at least the tag name parameter",l.INVALID_DIRECTIVE_SYNTAX);let Y=Z[0].replace(/['"]/g,""),G=(X.__stx_options||{}).componentsDir||"components",q=h0.isAbsolute(G)?[h0.join(G,`${Y}.stx`),h0.join(h0.dirname(J),`${Y}.stx`)]:[h0.join(h0.dirname(J),G,`${Y}.stx`),h0.join(process.cwd(),G,`${Y}.stx`),h0.join(h0.dirname(J),`${Y}.stx`)],W=null;for(let z of q)if(await t(z)){W=await Bun.file(z).text();break}if(!W)return $0("WebComponent",`Component file not found: ${Y}.stx`,l.FILE_NOT_FOUND);let K=WJ(W,Y);return`<script type="module">
3261
3261
  ${KJ(K)}
3262
- </script>`}var x6={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:C6,cachePath:".stx/cache",cacheVersion:"1.0.0",build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:n7,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:T6,hasEndTag:!1,description:"Include a web component in the template"},y6,S6,R3,D3,r$,t$,e$,a$,l7,S7,Q6,j3,...f6],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function zJ($,Z,X){let J=Z||"pages";if($)return{root:$,pagesDir:J};let Y=X||process.cwd(),Q=T0.join(Y,"resources","views"),G=T0.join(Y,"resources","layouts");if(W$.existsSync(Q)&&W$.existsSync(G))return{root:"resources",pagesDir:"views"};let q=T0.join(Y,"resources","views","pages");if(W$.existsSync(q))return{root:"resources/views",pagesDir:J};return{root:".",pagesDir:J}}var E6=new Set,K$=["partialsDir","componentsDir","layoutsDir"],M3=new WeakMap;function HJ($,Z){let X=Z.replace(/[\\/]+$/,"");if(!X||X===".")return!0;let J=$.replace(/\\/g,"/"),Y=X.replace(/\\/g,"/");return J===Y||J.startsWith(`${Y}/`)}function jJ($,Z){let X=!$.root,J=zJ($.root,$.pagesDir,Z);if($.root=J.root,$.pagesDir=J.pagesDir,X&&J.root!=="."){let Y=`${Z}::${J.root}`;if(!E6.has(Y))E6.add(Y),console.warn(`[stx] No "root" in config \u2014 inferred "${J.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!M3.has($)){let Y={};for(let Q of K$){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}M3.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of K$){let G=$[Q];if(typeof G!=="string"||!G)continue;if(T0.isAbsolute(G)||HJ(G,Y))continue;$[Q]=T0.join(Y,G)}}for(let Y of K$){let Q=$[Y];if(typeof Q!=="string"||!Q||T0.isAbsolute(Q))continue;$[Y]=T0.resolve(Z,Q)}return $}function BJ($,Z){let X=M3.get($);for(let J of K$){let Y=$[J];if(typeof Y!=="string"||!Y)continue;let Q=T0.isAbsolute(Y)?Y:T0.join(Z,Y);if(W$.existsSync(Q))continue;let G=X?.[J]??Y,q=$.root,W=!!q&&q!==".";console.warn(`[stx] ${String(J)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(W?`, resolved under root "${q}".`:"."))}}function _J($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function VJ($){if(P6($.stateDir),$.stateDir=v6(),$.cachePath=L5($.cachePath),$.build)$.build.cacheDir=L5($.build.cacheDir);if($.media?.cache)$.media.cache.directory=L5($.media.cache.directory);if($.story)$.story.outDir=L5($.story.outDir)}var d1=null,b6=new Map,U$=null;async function k3($){if(!$){if(d1)return d1;if(U$)return U$}let Z=$?T0.resolve($):process.cwd(),X=b6.get(Z);if(X)return X;let J=(async()=>{let Q=(await UJ({name:"stx",alias:"ui",cwd:Z,defaultConfig:x6,verbose:!1})).config;if(_J(Q),VJ(Q),jJ(Q,Z),BJ(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-ht4r7d1p.js"),q=[],W=[];for(let K of Q.plugins){let U=typeof K==="string"?K:K[0],z=typeof K==="string"?{}:K[1]||{};try{let H,j;try{H=await import(U),j=T0.dirname(f.resolve(U))}catch{let _=T0.resolve(process.cwd(),U);H=await import(_),j=T0.dirname(_)}let B=H.default||H;if(!G.has(B.name))await G.register(B,Q);if(B.components){let _=Array.isArray(B.components)?B.components:[B.components];for(let L of _)q.push(T0.resolve(j,L))}if(B.pages){let _=T0.resolve(j,B.pages),L=z.path||"/";W.push({dir:_,prefix:L})}if(B.setup){let _={addDirective:(L)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(L)},addRoute:(L,V)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[L]=V},addMiddleware:(L)=>{Q.middleware=Q.middleware||[],Q.middleware.push(L)},pluginDir:j,config:Q};await B.setup(z,_)}console.log(`[stx] Plugin loaded: ${B.name||U}`)}catch(H){console.warn(`[stx] Failed to load plugin ${U}:`,H.message)}}Q._pluginComponentDirs=q,Q._pluginPageDirs=W}return Q})();if(b6.set(Z,J),!$)U$=J,J.then((Y)=>{d1=Y}).catch(()=>{});return J}var g6=new Proxy(x6,{get($,Z){if(d1&&Z in d1)return d1[Z];if(!U$)k3().catch((X)=>{console.warn("[stx] Failed to load config file:",X?.message||X)});return $[Z]}});function iU($){return $}function nU($){let Z=[],X=[];if($.partialsDir!==void 0&&typeof $.partialsDir!=="string")Z.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if($.componentsDir!==void 0&&typeof $.componentsDir!=="string")Z.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if($.cache!==void 0&&typeof $.cache!=="boolean")Z.push({path:"cache",message:"cache must be a boolean",severity:"error"});if($.debug!==void 0&&typeof $.debug!=="boolean")Z.push({path:"debug",message:"debug must be a boolean",severity:"error"});if($.streaming){if($.streaming.bufferSize!==void 0){if(typeof $.streaming.bufferSize!=="number"||$.streaming.bufferSize<=0)Z.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if($.streaming.timeout!==void 0){if(typeof $.streaming.timeout!=="number"||$.streaming.timeout<=0)Z.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if($.streaming.strategy!==void 0){let J=["auto","manual","sections"];if(!J.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${J.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let J=["json","yaml","yml","js"];if(!J.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${J.join(", ")}`,severity:"error"})}}if($.animation){if($.animation.defaultDuration!==void 0){if(typeof $.animation.defaultDuration!=="number"||$.animation.defaultDuration<0)Z.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if($.animation.staggerDelay!==void 0){if(typeof $.animation.staggerDelay!=="number"||$.animation.staggerDelay<0)Z.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if($.a11y){if($.a11y.level!==void 0){let J=["AA","AAA"];if(!J.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${J.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let J=["progressive","islands"];if(!J.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${J.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let J=["none","eager","lazy"];if(!J.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${J.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`customDirectives[${Y}].name`,message:"Custom directive must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`customDirectives[${Y}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if($.middleware)if(!Array.isArray($.middleware))Z.push({path:"middleware",message:"middleware must be an array",severity:"error"});else $.middleware.forEach((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`middleware[${Y}].name`,message:"Middleware must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`middleware[${Y}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!J.timing||!["before","after"].includes(J.timing))Z.push({path:`middleware[${Y}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)X.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if($.seo?.enabled===!0&&!$.seo?.defaultConfig?.title)X.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if($.pwa){if($.pwa.enabled===!0&&!$.pwa.manifest?.name)Z.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if($.pwa.manifest?.display!==void 0){let J=["fullscreen","standalone","minimal-ui","browser"];if(!J.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let J=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!J.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.routes){let J=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Y,Q)=>{if(!Y.pattern||typeof Y.pattern!=="string")Z.push({path:`pwa.routes[${Q}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!J.includes(Y.strategy))Z.push({path:`pwa.routes[${Q}].strategy`,message:`PWA route strategy must be one of: ${J.join(", ")}`,severity:"error"});if(Y.maxAgeSeconds!==void 0&&(typeof Y.maxAgeSeconds!=="number"||Y.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Q}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Y.maxEntries!==void 0&&(typeof Y.maxEntries!=="number"||Y.maxEntries<1))Z.push({path:`pwa.routes[${Q}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if($.pwa.icons?.sizes){if(!Array.isArray($.pwa.icons.sizes))Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if($.pwa.icons.sizes.filter((Y)=>typeof Y!=="number"||Y<16||Y>1024).length>0)Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if($.pwa.icons?.purpose){let J=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Q)=>!J.includes(Q)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)X.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if($.pwa.enabled===!0&&!$.pwa.manifest?.themeColor)X.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:X}}var T3=new Map;async function LJ($,Z={}){try{if(!await t($))throw Error(`Markdown file not found: ${$}`);let J=(await OJ.promises.stat($)).mtime.getTime();if(Z.cache&&T3.has($)){let z=T3.get($);if(z.updatedAt>=J)return{content:z.content,data:z.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=p7(Y),q=Z.markdown||g6.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=B5(G,{gfm:!0});if(q.syntaxHighlighting?.enabled&&q.syntaxHighlighting?.serverSide)K=await wJ(K,q.syntaxHighlighting?.defaultTheme||"github-dark",q.syntaxHighlighting?.highlightUnknownLanguages||!1);let U={content:K,data:Q||{}};if(Z.cache)T3.set($,{...U,updatedAt:J});return U}catch(X){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,X);let J=X instanceof Error?X.message:String(X);return{content:j0("Markdown File",`Error reading/parsing markdown file: ${J}`,$,"",0,""),data:{}}}}var z$=null;async function wJ($,Z,X){let J=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!z$)try{z$=await FJ({theme:Z||"github-dark",cache:!0})}catch(q){return console.error("Failed to initialize ts-syntax-highlighter:",q),$}let Y=async(q,W,K,U)=>{let z=U.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(X?"text":"");if(!H)return q;try{if(!z$.getSupportedLanguages().includes(H))return q;return(await z$.highlight(z,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return q},Q=$,G=$.matchAll(J);for(let q of G){let[W,K,U,z]=q,H=await Y(W,K,U,z);Q=Q.replace(W,H)}return Q}async function h6($,Z,X="",J={}){return await RJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,q,W,K)=>{try{let U=q;if(!I3.isAbsolute(q))U=I3.resolve(I3.dirname(X),q);let z={};if(W)try{try{z=JSON.parse(W)}catch{if(J.debug)console.warn("Using safer alternative for parsing JS object literal");let O=W.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let F of O){let w=F.indexOf(":");if(w>0){let R=F.substring(0,w).trim(),D=F.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),k=D.startsWith("'")&&D.endsWith("'");if(N||k)D=D.substring(1,D.length-1);z[R]=D}}}}catch(V){if(J.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:H,data:j}=await LJ(U,J),B={...Z,...j,...z},_=H,L=/\{\{([^}]+)\}\}/g;return _=_.replace(L,(V,O)=>{let F=O.trim();return B[F]!==void 0?String(B[F]):V}),_}catch(U){let z=U instanceof Error?U.message:String(U);return j0("Markdown File",`Error including markdown file: ${z}`,X,$,K,G)}})}async function RJ($,Z,X){let J=[],Y;while((Y=Z.exec($))!==null){let q=Y[0],W=Y.index,K=Y;J.push(X(...K).then((U)=>({match:q,replacement:U,index:W})))}let Q=await Promise.all(J);Q.sort((q,W)=>W.index-q.index);let G=$;for(let{match:q,replacement:W}of Q)G=G.replace(q,()=>W);return G}function U1($,Z){try{let X=$.trim();if(q0(X))return W0(X,Object.keys(Z))(...Object.values(Z));else return e(X,Z)}catch{return!1}}class H${source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let $=this.pos,Z=this.line,X=this.column,J=this.source[this.pos];if(/\s/.test(J))return this.readWhitespace($,Z,X);if(J==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,X);if(J==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,X);if(J==='"'||J==="'")return this.readString(J,$,Z,X);if(J==="`")return this.readTemplateString($,Z,X);if(/\d/.test(J)||J==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,X);if(/[a-z_$]/i.test(J))return this.readIdentifier($,Z,X);if(J==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:X}}if(J==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:X}}if(J==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:X};if(J==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,X);let Y=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Q of Y)if(this.source.slice(this.pos,this.pos+Q.length)===Q)return this.advance(Q.length),{type:"OPERATOR",value:Q,start:$,end:this.pos,line:Z,column:X};if(/[+\-*/%<>=!&|^~?:]/.test(J))return this.advance(),{type:"OPERATOR",value:J,start:$,end:this.pos,line:Z,column:X};if(/[()[\]{},;.]/.test(J))return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X};return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X}}readWhitespace($,Z,X){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readLineComment($,Z,X){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3262
+ </script>`}var x6={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:C6,cachePath:".stx/cache",cacheVersion:"1.0.0",build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:n7,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:T6,hasEndTag:!1,description:"Include a web component in the template"},y6,S6,R3,D3,r$,t$,e$,a$,l7,S7,Q6,j3,...f6],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function zJ($,Z,X){let J=Z||"pages";if($)return{root:$,pagesDir:J};let Y=X||process.cwd(),Q=T0.join(Y,"resources","views"),G=T0.join(Y,"resources","layouts");if(W$.existsSync(Q)&&W$.existsSync(G))return{root:"resources",pagesDir:"views"};let q=T0.join(Y,"resources","views","pages");if(W$.existsSync(q))return{root:"resources/views",pagesDir:J};return{root:".",pagesDir:J}}var E6=new Set,K$=["partialsDir","componentsDir","layoutsDir"],M3=new WeakMap;function HJ($,Z){let X=Z.replace(/[\\/]+$/,"");if(!X||X===".")return!0;let J=$.replace(/\\/g,"/"),Y=X.replace(/\\/g,"/");return J===Y||J.startsWith(`${Y}/`)}function jJ($,Z){let X=!$.root,J=zJ($.root,$.pagesDir,Z);if($.root=J.root,$.pagesDir=J.pagesDir,X&&J.root!=="."){let Y=`${Z}::${J.root}`;if(!E6.has(Y))E6.add(Y),console.warn(`[stx] No "root" in config \u2014 inferred "${J.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!M3.has($)){let Y={};for(let Q of K$){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}M3.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of K$){let G=$[Q];if(typeof G!=="string"||!G)continue;if(T0.isAbsolute(G)||HJ(G,Y))continue;$[Q]=T0.join(Y,G)}}for(let Y of K$){let Q=$[Y];if(typeof Q!=="string"||!Q||T0.isAbsolute(Q))continue;$[Y]=T0.resolve(Z,Q)}return $}function BJ($,Z){let X=M3.get($);for(let J of K$){let Y=$[J];if(typeof Y!=="string"||!Y)continue;let Q=T0.isAbsolute(Y)?Y:T0.join(Z,Y);if(W$.existsSync(Q))continue;let G=X?.[J]??Y,q=$.root,W=!!q&&q!==".";console.warn(`[stx] ${String(J)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(W?`, resolved under root "${q}".`:"."))}}function _J($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function VJ($){if(P6($.stateDir),$.stateDir=v6(),$.cachePath=L5($.cachePath),$.build)$.build.cacheDir=L5($.build.cacheDir);if($.media?.cache)$.media.cache.directory=L5($.media.cache.directory);if($.story)$.story.outDir=L5($.story.outDir)}var d1=null,b6=new Map,U$=null;async function k3($){if(!$){if(d1)return d1;if(U$)return U$}let Z=$?T0.resolve($):process.cwd(),X=b6.get(Z);if(X)return X;let J=(async()=>{let Q=(await UJ({name:"stx",alias:"ui",cwd:Z,defaultConfig:x6,verbose:!1})).config;if(_J(Q),VJ(Q),jJ(Q,Z),BJ(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-ht4r7d1p.js"),q=[],W=[];for(let K of Q.plugins){let U=typeof K==="string"?K:K[0],z=typeof K==="string"?{}:K[1]||{};try{let H,j;try{H=await import(U),j=T0.dirname(f.resolve(U))}catch{let _=T0.resolve(process.cwd(),U);H=await import(_),j=T0.dirname(_)}let B=H.default||H;if(!G.has(B.name))await G.register(B,Q);if(B.components){let _=Array.isArray(B.components)?B.components:[B.components];for(let L of _)q.push(T0.resolve(j,L))}if(B.pages){let _=T0.resolve(j,B.pages),L=z.path||"/";W.push({dir:_,prefix:L})}if(B.setup){let _={addDirective:(L)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(L)},addRoute:(L,V)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[L]=V},addMiddleware:(L)=>{Q.middleware=Q.middleware||[],Q.middleware.push(L)},pluginDir:j,config:Q};await B.setup(z,_)}console.log(`[stx] Plugin loaded: ${B.name||U}`)}catch(H){console.warn(`[stx] Failed to load plugin ${U}:`,H.message)}}Q._pluginComponentDirs=q,Q._pluginPageDirs=W}return Q})();if(b6.set(Z,J),!$)U$=J,J.then((Y)=>{d1=Y}).catch(()=>{});return J}var g6=new Proxy(x6,{get($,Z){if(d1&&Z in d1)return d1[Z];if(!U$)k3().catch((X)=>{console.warn("[stx] Failed to load config file:",X?.message||X)});return $[Z]}});function nU($){return $}function sU($){let Z=[],X=[];if($.partialsDir!==void 0&&typeof $.partialsDir!=="string")Z.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if($.componentsDir!==void 0&&typeof $.componentsDir!=="string")Z.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if($.cache!==void 0&&typeof $.cache!=="boolean")Z.push({path:"cache",message:"cache must be a boolean",severity:"error"});if($.debug!==void 0&&typeof $.debug!=="boolean")Z.push({path:"debug",message:"debug must be a boolean",severity:"error"});if($.streaming){if($.streaming.bufferSize!==void 0){if(typeof $.streaming.bufferSize!=="number"||$.streaming.bufferSize<=0)Z.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if($.streaming.timeout!==void 0){if(typeof $.streaming.timeout!=="number"||$.streaming.timeout<=0)Z.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if($.streaming.strategy!==void 0){let J=["auto","manual","sections"];if(!J.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${J.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let J=["json","yaml","yml","js"];if(!J.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${J.join(", ")}`,severity:"error"})}}if($.animation){if($.animation.defaultDuration!==void 0){if(typeof $.animation.defaultDuration!=="number"||$.animation.defaultDuration<0)Z.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if($.animation.staggerDelay!==void 0){if(typeof $.animation.staggerDelay!=="number"||$.animation.staggerDelay<0)Z.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if($.a11y){if($.a11y.level!==void 0){let J=["AA","AAA"];if(!J.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${J.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let J=["progressive","islands"];if(!J.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${J.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let J=["none","eager","lazy"];if(!J.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${J.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`customDirectives[${Y}].name`,message:"Custom directive must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`customDirectives[${Y}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if($.middleware)if(!Array.isArray($.middleware))Z.push({path:"middleware",message:"middleware must be an array",severity:"error"});else $.middleware.forEach((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`middleware[${Y}].name`,message:"Middleware must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`middleware[${Y}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!J.timing||!["before","after"].includes(J.timing))Z.push({path:`middleware[${Y}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)X.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if($.seo?.enabled===!0&&!$.seo?.defaultConfig?.title)X.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if($.pwa){if($.pwa.enabled===!0&&!$.pwa.manifest?.name)Z.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if($.pwa.manifest?.display!==void 0){let J=["fullscreen","standalone","minimal-ui","browser"];if(!J.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let J=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!J.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.routes){let J=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Y,Q)=>{if(!Y.pattern||typeof Y.pattern!=="string")Z.push({path:`pwa.routes[${Q}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!J.includes(Y.strategy))Z.push({path:`pwa.routes[${Q}].strategy`,message:`PWA route strategy must be one of: ${J.join(", ")}`,severity:"error"});if(Y.maxAgeSeconds!==void 0&&(typeof Y.maxAgeSeconds!=="number"||Y.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Q}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Y.maxEntries!==void 0&&(typeof Y.maxEntries!=="number"||Y.maxEntries<1))Z.push({path:`pwa.routes[${Q}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if($.pwa.icons?.sizes){if(!Array.isArray($.pwa.icons.sizes))Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if($.pwa.icons.sizes.filter((Y)=>typeof Y!=="number"||Y<16||Y>1024).length>0)Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if($.pwa.icons?.purpose){let J=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Q)=>!J.includes(Q)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)X.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if($.pwa.enabled===!0&&!$.pwa.manifest?.themeColor)X.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:X}}var T3=new Map;async function LJ($,Z={}){try{if(!await t($))throw Error(`Markdown file not found: ${$}`);let J=(await OJ.promises.stat($)).mtime.getTime();if(Z.cache&&T3.has($)){let z=T3.get($);if(z.updatedAt>=J)return{content:z.content,data:z.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=p7(Y),q=Z.markdown||g6.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=B5(G,{gfm:!0});if(q.syntaxHighlighting?.enabled&&q.syntaxHighlighting?.serverSide)K=await wJ(K,q.syntaxHighlighting?.defaultTheme||"github-dark",q.syntaxHighlighting?.highlightUnknownLanguages||!1);let U={content:K,data:Q||{}};if(Z.cache)T3.set($,{...U,updatedAt:J});return U}catch(X){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,X);let J=X instanceof Error?X.message:String(X);return{content:j0("Markdown File",`Error reading/parsing markdown file: ${J}`,$,"",0,""),data:{}}}}var z$=null;async function wJ($,Z,X){let J=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!z$)try{z$=await FJ({theme:Z||"github-dark",cache:!0})}catch(q){return console.error("Failed to initialize ts-syntax-highlighter:",q),$}let Y=async(q,W,K,U)=>{let z=U.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(X?"text":"");if(!H)return q;try{if(!z$.getSupportedLanguages().includes(H))return q;return(await z$.highlight(z,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return q},Q=$,G=$.matchAll(J);for(let q of G){let[W,K,U,z]=q,H=await Y(W,K,U,z);Q=Q.replace(W,H)}return Q}async function h6($,Z,X="",J={}){return await RJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,q,W,K)=>{try{let U=q;if(!I3.isAbsolute(q))U=I3.resolve(I3.dirname(X),q);let z={};if(W)try{try{z=JSON.parse(W)}catch{if(J.debug)console.warn("Using safer alternative for parsing JS object literal");let O=W.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let F of O){let w=F.indexOf(":");if(w>0){let R=F.substring(0,w).trim(),D=F.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),k=D.startsWith("'")&&D.endsWith("'");if(N||k)D=D.substring(1,D.length-1);z[R]=D}}}}catch(V){if(J.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:H,data:j}=await LJ(U,J),B={...Z,...j,...z},_=H,L=/\{\{([^}]+)\}\}/g;return _=_.replace(L,(V,O)=>{let F=O.trim();return B[F]!==void 0?String(B[F]):V}),_}catch(U){let z=U instanceof Error?U.message:String(U);return j0("Markdown File",`Error including markdown file: ${z}`,X,$,K,G)}})}async function RJ($,Z,X){let J=[],Y;while((Y=Z.exec($))!==null){let q=Y[0],W=Y.index,K=Y;J.push(X(...K).then((U)=>({match:q,replacement:U,index:W})))}let Q=await Promise.all(J);Q.sort((q,W)=>W.index-q.index);let G=$;for(let{match:q,replacement:W}of Q)G=G.replace(q,()=>W);return G}function U1($,Z){try{let X=$.trim();if(q0(X))return W0(X,Object.keys(Z))(...Object.values(Z));else return e(X,Z)}catch{return!1}}class H${source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let $=this.pos,Z=this.line,X=this.column,J=this.source[this.pos];if(/\s/.test(J))return this.readWhitespace($,Z,X);if(J==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,X);if(J==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,X);if(J==='"'||J==="'")return this.readString(J,$,Z,X);if(J==="`")return this.readTemplateString($,Z,X);if(/\d/.test(J)||J==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,X);if(/[a-z_$]/i.test(J))return this.readIdentifier($,Z,X);if(J==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:X}}if(J==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:X}}if(J==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:X};if(J==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,X);let Y=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Q of Y)if(this.source.slice(this.pos,this.pos+Q.length)===Q)return this.advance(Q.length),{type:"OPERATOR",value:Q,start:$,end:this.pos,line:Z,column:X};if(/[+\-*/%<>=!&|^~?:]/.test(J))return this.advance(),{type:"OPERATOR",value:J,start:$,end:this.pos,line:Z,column:X};if(/[()[\]{},;.]/.test(J))return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X};return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X}}readWhitespace($,Z,X){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readLineComment($,Z,X){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3263
3263
  `)this.advance();return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readBlockComment($,Z,X){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readString($,Z,X,J){this.advance();while(this.pos<this.source.length){let Y=this.source[this.pos];if(Y==="\\"){this.advance(2);continue}if(Y===$){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(Z,this.pos),start:Z,end:this.pos,line:X,column:J}}readTemplateString($,Z,X){this.advance();let J=0,Y=256;while(this.pos<this.source.length){let Q=this.source[this.pos];if(Q==="\\"){this.advance(2);continue}if(Q==="$"&&this.peek(1)==="{"){if(J>=Y){this.pos=this.source.length;break}this.advance(2),J++;continue}if(Q==="{"&&J>0){J++,this.advance();continue}if(Q==="}"&&J>0){J--,this.advance();continue}if(Q==="`"&&J===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readNumber($,Z,X){if(this.source[this.pos]==="0"){let J=this.peek(1)?.toLowerCase();if(J==="x"||J==="o"||J==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readIdentifier($,Z,X){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readDirective($,Z,X){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}advance($=1){for(let Z=0;Z<$&&this.pos<this.source.length;Z++){if(this.source[this.pos]===`
3264
- `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function B0($,Z,X,J=0){let Y=0,Q=J,G=null,q=0,W=!1;while(Q<$.length){let K=$[Q];if(G&&W){W=!1,Q++;continue}if(G&&K==="\\"){W=!0,Q++;continue}if(W=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Q++;continue}if(K===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&K==="$"&&$[Q+1]==="{"){q++,Q+=2;continue}if(q>0&&K==="}"){q--,Q++;continue}if(K==="`"&&G==="`"&&q===0){G=null,Q++;continue}if(G){Q++;continue}if(K===Z)Y++;else if(K===X){if(Y--,Y===0)return Q}Q++}return-1}function u6($,Z){let X=Z,J={paren:0,bracket:0,brace:0},Y=null,Q=0;while(X<$.length){let G=$[X];if((X>0?$[X-1]:"")==="\\"&&Y){X++;continue}if((G==='"'||G==="'")&&!Y){Y=G,X++;continue}if(G===Y&&Y!=="`"){Y=null,X++;continue}if(G==="`"&&!Y){Y="`",X++;continue}if(G==="`"&&Y==="`"&&Q===0){Y=null,X++;continue}if(Y==="`"&&G==="$"&&$[X+1]==="{"){Q++,X+=2;continue}if(Q>0){if(G==="{")Q++;else if(G==="}")Q--;X++;continue}if(Y){X++;continue}if(J.paren===0&&J.bracket===0&&J.brace===0){if($.slice(X,X+2)==="}}"||$.slice(X,X+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")J.paren++;else if(G===")"){if(J.paren--,J.paren<0)break}else if(G==="[")J.bracket++;else if(G==="]"){if(J.bracket--,J.bracket<0)break}else if(G==="{")J.brace++;else if(G==="}"){if(J.brace--,J.brace<0)break}X++}return{expression:$.slice(Z,X),endPos:X}}function E3($){let Z=[],X="",J={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let q=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){X+=q;continue}if((q==='"'||q==="'")&&!Y){Y=q,X+=q;continue}if(q===Y&&Y!=="`"){Y=null,X+=q;continue}if(q==="`"&&!Y){Y="`",X+=q;continue}if(q==="`"&&Y==="`"&&Q===0){Y=null,X+=q;continue}if(Y==="`"&&q==="$"&&$[G+1]==="{"){Q++,X+=q+$[G+1],G++;continue}if(Q>0&&q==="{"){Q++,X+=q;continue}if(Q>0&&q==="}"){Q--,X+=q;continue}if(Y){X+=q;continue}if(q==="(")J.paren++;else if(q===")")J.paren--;else if(q==="[")J.bracket++;else if(q==="]")J.bracket--;else if(q==="{")J.brace++;else if(q==="}")J.brace--;if(q==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&J.paren===0&&J.bracket===0&&J.brace===0){Z.push(X.trim()),X="";continue}if(q==="|"&&$[G-1]==="\\"&&!Y){X=X.slice(0,-1)+q;continue}X+=q}if(X.trim())Z.push(X.trim());return Z}function z1($,Z){let X=DJ($,Z);return X.ok?{expression:X.expression,endPos:X.endPos}:null}function DJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return{ok:!1,reason:"missing-open-paren",pos:X};let J=B0($,"(",")",X);if(J===-1)return{ok:!1,reason:"unclosed-paren",pos:X};return{ok:!0,expression:$.slice(X+1,J),endPos:J+1}}function NJ($,Z){let X=$.lastIndexOf("<",Z);if(X===-1)return!1;return X>$.lastIndexOf(">",Z)}function R1($,Z,X,J){let Y=1,Q=J,G=new RegExp(`@${Z}\\s*\\(`,"g"),q=new RegExp(`@${X}(?![a-z])`,"g");while(Q<$.length&&Y>0){G.lastIndex=Q,q.lastIndex=Q;let W=G.exec($),K=q.exec($),U=W?W.index:1/0,z=K?K.index:1/0;if(U<z)Y++,Q=U+W[0].length;else if(z<1/0){if(Y--,Y===0)return z;Q=z+K[0].length}else break}return-1}function d6($,Z){let X=$.slice(Z).match(/^@if\s*/);if(!X)return null;let J=Z+X[0].length,Y=z1($,J);if(!Y)return null;let Q=Y.endPos,G=R1($,"if","endif",Q);if(G===-1)return null;let q=$.slice(Q,G),W=[],K=0,U="if",z=Y.expression,H=0,j=0;while(K<q.length){let B=q.indexOf("@",K);if(B===-1)break;K=B;let _=q.substring(B);if(NJ(q,B)){K++;continue}if(/^@if\s*\(/.test(_)){j++,K++;continue}if(/^@endif(?![a-z])/.test(_)){j--,K+=6;continue}if(j===0){let L=_.match(/^@elseif\s*/);if(L){W.push({type:U,condition:z,content:q.substring(H,K),start:Q+H,end:Q+K});let V=K+L[0].length,O=z1(q,V);if(!O){K++;continue}U="elseif",z=O.expression,K=O.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(_)){W.push({type:U,condition:z,content:q.substring(H,K),start:Q+H,end:Q+K}),U="else",z=void 0,K+=5,H=K;continue}}K++}return W.push({type:U,condition:z,content:q.slice(H),start:Q+H,end:Q+q.length}),{fullMatch:$.slice(Z,G+6),branches:W,start:Z,end:G+6}}function w5($){let Z=[],X=/@if\s*\(/g,J=X.exec($);while(J!==null){if(Z.some((G)=>J.index>G.start&&J.index<G.end)){J=X.exec($);continue}let Q=d6($,J.index);if(Q)Z.push(Q),X.lastIndex=Q.end;J=X.exec($)}return Z}function j$($,Z,X){let J=[],Y=new RegExp(`@${Z}\\s*\\(`,"g"),Q=Y.exec($);while(Q!==null){if(J.some((_)=>Q.index>_.start&&Q.index<_.end)){Q=Y.exec($);continue}let q=Q.index,W=q+Q[0].length-1,K=B0($,"(",")",W);if(K===-1){Q=Y.exec($);continue}let U=$.slice(W+1,K),z=K+1,H=R1($,Z,X,z);if(H===-1){Q=Y.exec($);continue}let j=$.slice(z,H),B=H+`@${X}`.length;J.push({fullMatch:$.slice(q,B),name:Z,params:U,content:j,start:q,end:B}),Y.lastIndex=B,Q=Y.exec($)}return J}function b3($,Z){let X=$.slice(Z).match(/^@switch\s*/);if(!X)return null;let J=Z+X[0].length,Y=z1($,J);if(!Y)return null;let Q=Y.endPos,G=R1($,"switch","endswitch",Q);if(G===-1)return null;let q=$.slice(Q,G),W=[],K=0,U=null,z=0;while(K<q.length){let H=q.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(z++,U)U.content+=j[0];K+=j[0].length;continue}if(B){if(z--,U)U.content+=B[0];K+=B[0].length;continue}if(z>0){if(U)U.content+=q[K];K++;continue}let _=H.match(/^@case\s*/),L=H.match(/^@default(?![a-z])/),V=H.match(/^@break(?![a-z])/);if(_&&H.startsWith("@case")){if(U)W.push(U);let O=K+_[0].length,F=z1(q,O);if(!F){K++;continue}U={type:"case",value:F.expression,content:""},K=F.endPos}else if(L&&H.startsWith("@default")){if(U)W.push(U);U={type:"default",content:""},K+=L[0].length}else if(V&&H.startsWith("@break"))K+=V[0].length;else{if(U)U.content+=q[K];K++}}if(U)W.push(U);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:W,start:Z,end:G+10}}function AJ($){let Z=[],X=0;while(X<$.length){let J=$.indexOf("{{",X),Y=$.indexOf("{!!",X),Q=!1,G;if(J===-1&&Y===-1)break;else if(J===-1)G=Y,Q=!0;else if(Y===-1)G=J,Q=!1;else if(Y<J)G=Y,Q=!0;else G=J,Q=!1;if(!Q&&$.slice(G,G+3)==="{{{")Q=!0;let q=Q?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",W=Q?q==="{{{"?"}}}":"!!}":"}}",K=G+q.length,U=MJ($,K,W);if(U===-1){X=G+1;continue}let z=$.slice(K,U).trim(),H=U+W.length;Z.push({fullMatch:$.slice(G,H),expression:z,start:G,end:H,isRaw:Q}),X=H}return Z}function MJ($,Z,X){let J=Z,Y=null,Q={paren:0,bracket:0,brace:0},G=0;while(J<$.length){let q=$[J];if((J>0?$[J-1]:"")==="\\"&&Y){J++;continue}if((q==='"'||q==="'")&&!Y){Y=q,J++;continue}if(q===Y&&Y!=="`"){Y=null,J++;continue}if(q==="`"&&!Y){Y="`",J++;continue}if(q==="`"&&Y==="`"&&G===0){Y=null,J++;continue}if(Y==="`"&&q==="$"&&$[J+1]==="{"){G++,J+=2;continue}if(G>0){if(q==="{")G++;else if(q==="}")G--;J++;continue}if(Y){J++;continue}if(q==="(")Q.paren++;else if(q===")")Q.paren--;else if(q==="[")Q.bracket++;else if(q==="]")Q.bracket--;else if(q==="{")Q.brace++;else if(q==="}")Q.brace--;if(Q.paren===0&&Q.bracket===0&&Q.brace<=0){if($.slice(J,J+X.length)===X)return J}J++}return-1}function kJ($){let Z=E3($);if(Z.length===0)return{baseExpression:"",filters:[]};let X=Z[0],J=[];for(let Y=1;Y<Z.length;Y++){let Q=IJ(Z[Y]);if(Q)J.push(Q)}return{baseExpression:X,filters:J}}function IJ($){let Z=$.trim();if(!Z)return null;let X=Z.indexOf("(");if(X===-1)return{name:Z,args:[]};let J=Z.slice(0,X).trim(),Y=X+1,Q=B0(Z,"(",")",X);if(Q===-1)return{name:J,args:[]};let G=Z.slice(Y,Q),q=c6(G);return{name:J,args:q}}function c6($){let Z=[],X="",J={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let q=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){X+=q;continue}if((q==='"'||q==="'")&&!Y){Y=q,X+=q;continue}if(q===Y&&Y!=="`"){Y=null,X+=q;continue}if(q==="`"&&!Y){Y="`",X+=q;continue}if(q==="`"&&Y==="`"&&Q===0){Y=null,X+=q;continue}if(Y==="`"&&q==="$"&&$[G+1]==="{"){Q++,X+="${",G++;continue}if(Q>0&&q==="{"){Q++,X+=q;continue}if(Q>0&&q==="}"){Q--,X+=q;continue}if(Y){X+=q;continue}if(q==="(")J.paren++;else if(q===")")J.paren--;else if(q==="[")J.bracket++;else if(q==="]")J.bracket--;else if(q==="{")J.brace++;else if(q==="}")J.brace--;if(q===","&&J.paren===0&&J.bracket===0&&J.brace===0){Z.push(X.trim()),X="";continue}X+=q}if(X.trim())Z.push(X.trim());return Z}function TJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return null;let J=B0($,"(",")",X);if(J===-1)return null;return{params:$.slice(X+1,J),endPos:J+1}}function EJ($){let Z=[],J=new H$($).tokenize().filter((Q)=>Q.type!=="WHITESPACE"&&Q.type!=="COMMENT"),Y=0;while(Y<J.length){let Q=J[Y],G=!1;if(Q.type==="IDENTIFIER"&&Q.value==="export"){if(G=!0,Y++,Y>=J.length)break}let q=J[Y];if(q.type==="IDENTIFIER"&&(q.value==="const"||q.value==="let"||q.value==="var")){let W=q.value;if(Y++,Y>=J.length)break;let K=J[Y];if(K.type==="IDENTIFIER"){let U=K.value;if(Y++,Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let z=Y<J.length?J[Y].start:$.length,H=m6(J,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:U,value:$.slice(z,H.endPos),exported:G,start:q.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let U=K.start,z=K.value==="{"?"}":"]",H=B0($,K.value,z,U);if(H!==-1){let j=$.slice(U,H+1);if(Y=l6(J,H+1),Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let B=Y<J.length?J[Y].start:$.length,_=m6(J,Y,$);Y=_.nextIndex;let L=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:L,value:`${$.slice(B,_.endPos)}; ${W} ${j} = ${L}`,exported:G,start:q.start,end:_.endPos})}}}}else if(q.type==="IDENTIFIER"&&q.value==="function"){let W=G?J[Y-1].start:q.start;if(Y++,Y>=J.length)break;let K=J[Y];if(K.type==="IDENTIFIER"){let U=K.value;Y++;let z=-1;while(Y<J.length){if(J[Y].type==="PUNCTUATION"&&J[Y].value==="{"){z=J[Y].start;break}Y++}if(z!==-1){let H=B0($,"{","}",z);if(H!==-1)Z.push({type:"function",name:U,value:$.slice(W,H+1).replace(/^export\s+/,""),exported:G,start:W,end:H+1}),Y=l6(J,H+1)}}}else Y++}return Z}function m6($,Z,X){let J=Z,Y={paren:0,bracket:0,brace:0},Q=Z<$.length?$[Z].start:X.length;while(J<$.length){let G=$[J];if(G.type==="PUNCTUATION"){if(G.value==="(")Y.paren++;else if(G.value===")")Y.paren--;else if(G.value==="[")Y.bracket++;else if(G.value==="]")Y.bracket--;else if(G.value==="{")Y.brace++;else if(G.value==="}")Y.brace--;if(G.value===";"&&Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=G.start,J++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=$[J-1]?.end??G.start;break}}Q=G.end,J++}return{nextIndex:J,endPos:Q}}function l6($,Z){for(let X=0;X<$.length;X++)if($[X].start>=Z)return X;return $.length}function bJ($,Z,X){let J=$,Y=!0;while(Y){Y=!1;let Q=J.match(/@switch\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,q=b3(J,G);if(!q)break;try{let W;if(q0(q.expression))W=W0(q.expression,Object.keys(Z))(...Object.values(Z));else W=e(q.expression,Z);let K="",U=!1;for(let z of q.cases)if(z.type==="default"){if(!U)K=z.content.trim()}else try{let H;if(z.value&&q0(z.value))H=W0(z.value,Object.keys(Z))(...Object.values(Z));else if(z.value)H=e(z.value,Z);if(W===H){K=z.content.trim(),U=!0;break}}catch{continue}J=J.substring(0,G)+K+J.substring(q.end),Y=!0}catch(W){let K=W instanceof Error?W.message:String(W),U=$0("Switch",`Error evaluating @switch expression: ${K}`,l.EVALUATION_ERROR);J=J.substring(0,G)+U+J.substring(q.end);break}}return J}function yJ($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(J)=>{return Z.push(J),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function SJ($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(X,J)=>Z[Number(J)]??X)}function X1($,Z,X){let{masked:J,scripts:Y}=yJ($);return SJ(CJ(J,Z,X),Y)}function CJ($,Z,X){let J=$;J=bJ(J,Z,X);{let Q=!0;while(Q){Q=!1;let G=J.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let q=G.index,W=z1(J,q+7);if(!W)break;let K=W.endPos,U=R1(J,"unless","endunless",K);if(U===-1){console.warn(`[stx] @unless directive at position ${q} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let z=J.slice(K,U),H=W.expression,j=-1;{let _=0,L=/@(?:if|unless)\s*\(/g,V=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,F=[],w;while((w=L.exec(z))!==null)F.push({pos:w.index,type:"open"});while((w=V.exec(z))!==null)F.push({pos:w.index,type:"close"});while((w=O.exec(z))!==null)F.push({pos:w.index,type:"else"});F.sort((R,D)=>R.pos-D.pos);for(let R of F)if(R.type==="open")_++;else if(R.type==="close")_--;else if(R.type==="else"&&_===0){j=R.pos;break}}let B;if(j!==-1){let _=z.slice(0,j),L=z.slice(j+5);B=`@if (${H})${L}@else ${_}@endif`}else B=`@if (!(${H}))${z}@endif`;J=J.substring(0,q)+B+J.substring(U+10),Q=!0}}J=S3(J,Z,X),J=C3(J,Z,X),J=y3(J,Z);let Y=()=>{let Q=w5(J);if(Q.length===0)return!1;for(let G=Q.length-1;G>=0;G--){let q=Q[G];try{let W="",K=!1;for(let U of q.branches){if(K)break;if(U.type==="else")W=U.content,K=!0;else try{let z;if(U.condition&&q0(U.condition))z=W0(U.condition,Object.keys(Z))(...Object.values(Z));else if(U.condition)z=e(U.condition,Z);if(z)W=U.content,K=!0}catch(z){W=$0(U.type==="if"?"If":"Elseif",`Error in @${U.type}(${U.condition}): ${z instanceof Error?z.message:String(z)}`,l.EVALUATION_ERROR),K=!0}}J=J.substring(0,q.start)+W+J.substring(q.end)}catch(W){let K=W instanceof Error?W.message:String(W),U=$0("If",`Error processing @if block: ${K}`,l.EVALUATION_ERROR);J=J.substring(0,q.start)+U+J.substring(q.end)}}return!0};while(!0){let Q=J;if(!Y())break;if(J===Q)break}return J}function p6($){let Z=0;while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!=="(")return null;Z++;while(Z<$.length&&/\s/.test($[Z]))Z++;let X=$[Z];if(X!=="'"&&X!=='"')return null;Z++;let J=[];while(Z<$.length){let Y=$[Z];if(Y==="\\"&&Z+1<$.length){J.push($[Z+1]),Z+=2;continue}if(Y===X){Z++;break}J.push(Y),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:J.join(""),consumed:Z}}function y3($,Z){let X=$;function J(q,W,K,U){let z=1,H=U,j=new RegExp(`@${W}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<q.length&&z>0){j.lastIndex=H,B.lastIndex=H;let _=j.exec(q),L=B.exec(q),V=_?_.index:1/0,O=L?L.index:1/0;if(V<O)z++,H=V+_[0].length;else if(O<1/0){if(z--,z===0)return O;H=O+L[0].length}else break}return-1}function Y(q,W,K){let U=0,z=new RegExp(`@${W}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],_;while((_=z.exec(q))!==null)B.push({pos:_.index,type:"open"});while((_=H.exec(q))!==null)B.push({pos:_.index,type:"close"});while((_=j.exec(q))!==null)B.push({pos:_.index,type:"else"});B.sort((L,V)=>L.pos-V.pos);for(let L of B)if(L.type==="open")U++;else if(L.type==="close")U--;else if(L.type==="else"&&U===0)return L.pos;return-1}{let q=!0;while(q){q=!1;let W=X.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!W||W.index===void 0)break;let K=W.index,U,z,H=X.slice(K+5),j=p6(H);if(j)U=j.value,z=K+5+j.consumed;else z=K+5;let B=J(X,"auth","endauth",z);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let _=X.slice(z,B),L=Y(_,"auth","endauth"),V;if(!Z.auth)V=!1;else V=U?U1(`auth?.check && auth?.user?.[${U}]`,Z):U1("auth?.check",Z);let O;if(L!==-1){let F=_.slice(0,L),w=_.slice(L+5);O=V?F:w}else O=V?_:"";X=X.substring(0,K)+O+X.substring(B+8),q=!0}}{let q=!0;while(q){q=!1;let W=X.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!W||W.index===void 0)break;let K=W.index,U,z,H=X.slice(K+6),j=p6(H);if(j)U=j.value,z=K+6+j.consumed;else z=K+6;let B=J(X,"guest","endguest",z);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let _=X.slice(z,B),L=Y(_,"guest","endguest"),V;if(!Z.auth)V=!0;else V=U?U1(`!auth?.check || !auth?.user?.[${U}]`,Z):U1("!auth?.check",Z);let O;if(L!==-1){let F=_.slice(0,L),w=_.slice(L+5);O=V?F:w}else O=V?_:"";X=X.substring(0,K)+O+X.substring(B+9),q=!0}}function Q(q,W,K){if(Z.userCan&&typeof Z.userCan[q]==="boolean")return Z.userCan[q];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let U=[q];if(W)U.push(W);if(K){let z=U1(K,Z);U.push(z)}return Z.permissions.check(...U)}catch{return!1}return!1}function G(q){let W=q.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!W)return null;return{ability:W[1],type:W[2],id:W[3]?.trim(),paramsEnd:W[0].length}}for(let q of["can","cannot"]){let W=`end${q}`,K=q==="can"?"elsecan":"elsecannot",U=!0;while(U){U=!1;let z=X.match(new RegExp(`@${q}\\s*\\(`));if(!z||z.index===void 0)break;let H=z.index,j=X.slice(H+`@${q}`.length),B=G(j);if(!B)break;let _=H+`@${q}`.length+B.paramsEnd,L=J(X,q,W,_);if(L===-1){console.warn(`[stx] @${q} directive at position ${H} has no matching @${W} \u2014 the block was skipped.`);break}let V=X.slice(_,L),O=[],F=0,w=new RegExp(`@${q}\\s*\\(`,"g"),R=new RegExp(`@${W}(?![a-z])`,"g"),D=new RegExp(`@${K}\\s*\\(`,"g"),N=/@else(?![a-z])/g,k=[],A;while((A=w.exec(V))!==null)k.push({pos:A.index,type:"open"});while((A=R.exec(V))!==null)k.push({pos:A.index,type:"close"});while((A=D.exec(V))!==null)k.push({pos:A.index,type:"elseDirective"});while((A=N.exec(V))!==null)k.push({pos:A.index,type:"else"});k.sort((b,S)=>b.pos-S.pos);for(let b of k){if(b.type==="open"){F++;continue}if(b.type==="close"){F--;continue}if(F===0)O.push(b)}let M=[],T=0;for(let b=0;b<O.length;b++){let S=O[b];if(M.push({content:V.slice(T,S.pos),ability:void 0}),S.type==="elseDirective"){let v=V.slice(S.pos+`@${K}`.length),x=G(v);if(x){M[M.length-1]={content:V.slice(T,S.pos)},T=S.pos+`@${K}`.length+x.paramsEnd,M.push({content:"",ability:x.ability,type:x.type,id:x.id}),M.pop();let d=O[b+1],g=d?d.pos:V.length;M.push({content:V.slice(T,g),ability:x.ability,type:x.type,id:x.id}),T=g}}else T=S.pos+5}if(T<V.length){let b=M[M.length-1];if(O.length>0&&O[O.length-1].type==="else")M.push({content:V.slice(T),isFinalElse:!0});else if(M.length===0)M.push({content:V.slice(T)})}let I=Q(B.ability,B.type,B.id),y=q==="can"?I:!I,E="";if(y)E=M[0]?.content||"";else{let b=!1;for(let S=1;S<M.length;S++){let v=M[S];if(v.isFinalElse){E=v.content,b=!0;break}if(v.ability){let x=Q(v.ability,v.type,v.id);if(q==="can"?x:!x){E=v.content,b=!0;break}}}if(!b&&M.length>0){let S=M[M.length-1];if(S.isFinalElse)E=S.content}}X=X.substring(0,H)+E+X.substring(L+`@${W}`.length),U=!0}}return X}function S3($,Z,X){let J=$;function Y(Q,G,q,W,K){let U=!0;while(U){U=!1;let z=new RegExp(`@${G}\\s*\\(`),H=Q.match(z);if(!H||H.index===void 0)break;let j=H.index,B=z1(Q,j+`@${G}`.length);if(!B)break;let _=B.endPos,L=R1(Q,G,q,_);if(L===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${q} \u2014 the block was skipped.`);break}let V=Q.slice(_,L),O=B.expression,F=-1,w=0,R=0;while(R<V.length){let D=V.indexOf("@",R);if(D===-1)break;let N=V.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(N)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(N)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(N)){F=D;break}R=D+1}try{let D=W(O.trim()),N;if(F!==-1){let k=V.slice(0,F),A=V.slice(F+5);N=D?k:A}else N=D?V:"";Q=Q.substring(0,j)+N+Q.substring(L+`@${q}`.length),U=!0}catch(D){let N=D instanceof Error?D.message:String(D),k=$0(K,`Error processing @${G} directive: ${N}`,l.EVALUATION_ERROR);Q=Q.substring(0,j)+k+Q.substring(L+`@${q}`.length);break}}return Q}return J=Y(J,"isset","endisset",(Q)=>{let G=U1(Q,Z);return G!==void 0&&G!==null},"Isset"),J=Y(J,"empty","endempty",(Q)=>{let G=U1(Q,Z);return G===void 0||G===null||G===""||G===0||G===!1||Array.isArray(G)&&G.length===0||typeof G==="object"&&G!==null&&Object.keys(G).length===0},"Empty"),J}function C3($,Z,X){let J=$,Y="development";function Q(G,q,W,K){let U=new RegExp(`@${q}(?![a-z])`,"g"),z=new RegExp(`@${W}(?![a-z])`,"g"),H=new RegExp(`^@${q}(?![a-z])`),j=new RegExp(`^@${W}(?![a-z])`),B=G,_=!0;while(_){_=!1,U.lastIndex=0;let L=U.exec(B);if(!L)break;let V=L.index,O=V+L[0].length;if(q==="env"){let I=B.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!I)break;O+=I[0].length,K=Y===I[2]}let F=1,w=O,R=-1;while(F>0&&w<B.length){U.lastIndex=w,z.lastIndex=w;let I=U.exec(B),y=z.exec(B),E=I?I.index:1/0,b=y?y.index:1/0;if(E<b)F++,w=E+I[0].length;else if(b<1/0){if(F--,F===0){R=b;break}w=b+y[0].length}else break}if(R===-1){console.warn(`[stx] @${q} directive at position ${V} has no matching @${W} \u2014 the block was skipped.`);break}let D=B.substring(O,R),N=-1,k=0,A=0;while(A<D.length){let I=D.indexOf("@",A);if(I===-1)break;let y=D.substring(I);if(H.test(y)){k++,A=I+1;continue}if(j.test(y)){k--,A=I+1;continue}if(k===0&&/^@else(?![a-z])/.test(y)){N=I;break}A=I+1}let M;if(N!==-1){let I=D.slice(0,N),y=D.slice(N+5);M=K?I:y}else M=K?D:"";let T=`@${W}`.length;B=B.substring(0,V)+M+B.substring(R+T),_=!0}return B}return J=Q(J,"env","endenv",!1),J=Q(J,"production","endproduction",Y==="production"),J=Q(J,"development","enddevelopment",Y==="development"),J=Q(J,"staging","endstaging",Y==="staging"),J=Q(J,"testing","endtesting",Y==="testing"),J}var P3=new WeakMap;function i6($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function D1($,Z){if(!$)return Z?.nonceGenerator?.()??i6();let X=P3.get($);if(!X)X=Z?.nonceGenerator?.()??i6(),P3.set($,X);return X}function wz($){P3.delete($)}function n6($,Z){let X=[];for(let[J,Y]of Object.entries($)){if(Y===void 0||Y===null)continue;if(typeof Y==="boolean"){if(Y)X.push(J);continue}if(Array.isArray(Y)){let Q=[...Y];if(Z&&(J==="script-src"||J==="style-src"))Q=Q.filter((G)=>!G.startsWith("'nonce-")),Q.push(`'nonce-${Z}'`);if(Q.length>0)X.push(`${J} ${Q.join(" ")}`)}}return X.join("; ")}function f3($,Z){return`<meta http-equiv="Content-Security-Policy" content="${n6($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var PJ={"default-src":["'self'"],"script-src":["'self'","'strict-dynamic'"],"style-src":["'self'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"],"frame-ancestors":["'self'"],"upgrade-insecure-requests":!0},v3={"default-src":["'self'"],"script-src":["'self'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'","https:"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"upgrade-insecure-requests":!0},vJ={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:","http:"],"font-src":["'self'","https:","http:","data:"],"connect-src":["'self'","https:","http:","ws:","wss:"],"media-src":["'self'","https:","http:"],"object-src":["'none'"],"frame-src":["'self'","https:"],"base-uri":["'self'"]},fJ={"default-src":["'none'"],"frame-ancestors":["'none'"]};function Rz($){return{enabled:!0,directives:{strict:PJ,moderate:v3,relaxed:vJ,api:fJ}[$]||v3,useNonce:$==="strict",addMetaTag:!0}}function Dz($,Z){let X={...$};for(let[J,Y]of Object.entries(Z)){let Q=J,G=X[Q];if(Y===void 0||Y===null)continue;if(typeof Y==="boolean")X[Q]=G||Y;else if(Array.isArray(Y)){let q=Array.isArray(G)?G:[],W=[...new Set([...q,...Y])];X[Q]=W}}return X}function s6($,Z,X){if(!Z.enabled||!Z.addMetaTag)return $;if($.includes('http-equiv="Content-Security-Policy"'))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let J=Z.useNonce?D1(X,Z):void 0,Y=f3(Z.directives,J);return $.replace(/<head([^>]*)>/,`<head$1>
3265
- ${Y}`)}function o6($,Z){let X=$;return X=X.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(J,Y)=>{if(Y.includes("nonce="))return J;return`<script nonce="${Z}"${Y}>`}),X=X.replace(/<style([^>]*)>/gi,(J,Y)=>{if(Y.includes("nonce="))return J;return`<style nonce="${Z}"${Y}>`}),X}function r6($,Z,X,J){let Y=$,Q=J.csp;if(Y=Y.replace(/@csp\b/g,()=>{if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?D1(Z,Q):void 0;return f3(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return D1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=D1(Z,Q);return Y}var xJ={name:"csp",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?D1(X,Q):void 0;return f3(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},gJ={name:"cspNonce",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return D1(X,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function Nz(){return[xJ,gJ]}function Az($){let Z=[];if($["script-src"]?.includes("'unsafe-inline'"))Z.push("CSP: Using unsafe-inline in script-src significantly reduces XSS protection");if($["script-src"]?.includes("'unsafe-eval'"))Z.push("CSP: Using unsafe-eval in script-src allows eval() and related functions");if(!$["default-src"])Z.push("CSP: No default-src specified. Recommend adding default-src as a fallback");if($["default-src"]?.includes("*"))Z.push("CSP: Using * in default-src provides minimal protection");if(!$["object-src"]&&!$["default-src"]?.includes("'none'"))Z.push("CSP: Consider adding object-src: none to block plugins");if(!$["base-uri"])Z.push("CSP: Consider adding base-uri to prevent base tag injection attacks");for(let[X,J]of Object.entries($))if(Array.isArray(J)&&J.includes("http:"))Z.push(`CSP: Using http: in ${X} allows insecure resources`);return Z}function hJ($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function Mz($,Z){if(!$.enabled)return{};let X=$.useNonce?D1(Z,$):void 0,J=n6($.directives,X);return{[hJ($.reportOnly)]:J}}var kz={enabled:!1,reportOnly:!1,directives:v3,useNonce:!1,addMetaTag:!0};import uJ from"crypto";var dJ=40,a6="_token",x3=null;function mJ($=dJ){let Z=uJ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return x3=Z,Z}function lJ(){if(!x3)mJ();return x3}function cJ($=a6){let Z=lJ();return`<input type="hidden" name="${$}" value="${Z}">`}function t6($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,X,J)=>{return cJ(J||a6)})}async function e6($,Z,X,J){if(!J.customDirectives||J.customDirectives.length===0)return $;let Y=$;for(let Q of J.customDirectives){if(!Q.name||typeof Q.handler!=="function"){if(J.debug)console.warn("Invalid custom directive:",Q);continue}if(Q.hasEndTag)Y=await pJ(Y,Q,Z,X,J);else Y=await iJ(Y,Q,Z,X,J)}return Y}async function pJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=`@${Q}`,W=`@end${Q}`,K=$,U=m1(`${q}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${W}`,"g"),z=[],H=U.exec(K);while(H!==null){let[j,B="",_=""]=H,L=H.index||0;try{let V=B?$9(B):[],O=_.trim(),F=await G(O,V,X,J);z.push({original:j,processed:F,startIndex:L})}catch(V){let O=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);z.push({original:j,processed:$0("CustomDirective",`Error in @${Q}${B?`(${B})`:""}: ${O}`,l.EVALUATION_ERROR),startIndex:L})}H=U.exec(K)}for(let j=z.length-1;j>=0;j--){let{original:B,processed:_}=z[j];K=K.replace(B,_)}return K}async function iJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=$,W=m1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],U=W.exec(q);while(U!==null){let[j,B=""]=U,_=U.index||0;try{let L=$9(B),V=await G("",L,X,J);K.push({original:j,processed:V,startIndex:_})}catch(L){let V=L instanceof Error?L.message:String(L);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,L);K.push({original:j,processed:$0("CustomDirective",`Error in @${Q}(${B}): ${V}`,l.EVALUATION_ERROR),startIndex:_})}U=W.exec(q)}let z=m1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=z.exec(q);while(H!==null){let[j]=H,B=H.index||0;try{let _=await G("",[],X,J);K.push({original:j,processed:_,startIndex:B})}catch(_){let L=_ instanceof Error?_.message:String(_);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,_);K.push({original:j,processed:$0("CustomDirective",`Error in @${Q}: ${L}`,l.EVALUATION_ERROR),startIndex:B})}H=z.exec(q)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:_}=K[j];q=q.replace(B,_)}return q}function $9($){if(!$.trim())return[];let Z=[],X="",J=!1,Y="";for(let Q=0;Q<$.length;Q++){let G=$[Q];if((G==='"'||G==="'")&&(Q===0||$[Q-1]!=="\\"))if(!J)J=!0,Y=G;else if(G===Y)J=!1;else X+=G;else if(G===","&&!J)Z.push(X.trim()),X="";else X+=G}if(X.trim())Z.push(X.trim());return Z.map((Q)=>{let G=Q.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var Z9=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,X9=/^[A-Za-z_$][\w$]*$/,nJ=new Set(["light","dark","system"]);function N1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function sJ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,X=Z.appearance,J=Z.colorMode;if(N1(Z.storageKey,"storageKey"),!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap appearance must be an object");if(!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap colorMode must be an object");if(N1(X.key,"appearance.key"),N1(X.attribute,"appearance.attribute"),N1(X.default,"appearance.default"),N1(J.key,"colorMode.key"),N1(J.attribute,"colorMode.attribute"),N1(J.default,"colorMode.default"),!X9.test(X.key)||!X9.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Z9.test(X.attribute)||!Z9.test(J.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(X.allowed)||X.allowed.length===0||X.allowed.some((Y)=>typeof Y!=="string"||Y.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!X.allowed.includes(X.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");if(!nJ.has(J.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:X.key,attribute:X.attribute,allowed:[...new Set(X.allowed)],default:X.default},colorMode:{key:J.key,attribute:J.attribute,default:J.default}}}function oJ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function rJ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${oJ($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function aJ($,Z){let X=1,J=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(J){if(G==="\\")Y=!0;else if(G===J)J=null;continue}if(G==='"'||G==="'"||G==="`"){J=G;continue}if(G==="(")X++;else if(G===")"&&--X===0)return Q}return-1}function J9($,Z){let X=$,J=/@appearanceBootstrap\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index+Y[0].length-1,G=aJ(X,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let q=X.slice(Q+1,G).trim(),W=e(`(${q})`,Z),K=rJ(sJ(W));X=X.slice(0,Y.index)+K+X.slice(G+1),J.lastIndex=Y.index+K.length}return X}import tJ from"crypto";function _0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var h3={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function eJ($){return{...h3,...$.forms?.classes}}function B$($,Z,X,J){let Y=$||Z;return X?`${Y} ${J}`:Y}function u0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function l1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${_0(Z)}"`}function g3($,Z,X){if(!Z)return"";let J="";if(!/\baria-invalid\s*=/i.test(X))J+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(X))J+=` aria-describedby="${_0(`${u0($)}-error`)}"`;return J}function $Y(){return tJ.randomUUID()}function xz($,Z,X,J){let Y=eJ(J),Q=$;return Q=XY(Q,Z),Q=N5(Q,Z),Q=u3(Q,Z,Y),Q=d3(Q,Z,Y),Q}function N5($,Z){let X=$;return X=X.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let J=$Y();Z.csrf={token:J}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${_0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),X=X.replace(/@method\(['"]([^'"]+)['"]\)/g,(J,Y)=>{let Q=Y.toUpperCase();if(Y&&!["GET","POST"].includes(Q))return`<input type="hidden" name="_method" value="${_0(Q)}">`;return J}),X}function u3($,Z,X=h3){let J=$;return J=J.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,q,W,K="")=>{let U=Q||G||"POST",z=q||W||"",H=H1(K),j=U.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",_=`<form method="${_0(B)}" action="${_0(z)}"${H?` ${H}`:""}>`;if(_+=`
3264
+ `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function B0($,Z,X,J=0){let Y=0,Q=J,G=null,q=0,W=!1;while(Q<$.length){let K=$[Q];if(G&&W){W=!1,Q++;continue}if(G&&K==="\\"){W=!0,Q++;continue}if(W=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Q++;continue}if(K===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&K==="$"&&$[Q+1]==="{"){q++,Q+=2;continue}if(q>0&&K==="}"){q--,Q++;continue}if(K==="`"&&G==="`"&&q===0){G=null,Q++;continue}if(G){Q++;continue}if(K===Z)Y++;else if(K===X){if(Y--,Y===0)return Q}Q++}return-1}function u6($,Z){let X=Z,J={paren:0,bracket:0,brace:0},Y=null,Q=0;while(X<$.length){let G=$[X];if((X>0?$[X-1]:"")==="\\"&&Y){X++;continue}if((G==='"'||G==="'")&&!Y){Y=G,X++;continue}if(G===Y&&Y!=="`"){Y=null,X++;continue}if(G==="`"&&!Y){Y="`",X++;continue}if(G==="`"&&Y==="`"&&Q===0){Y=null,X++;continue}if(Y==="`"&&G==="$"&&$[X+1]==="{"){Q++,X+=2;continue}if(Q>0){if(G==="{")Q++;else if(G==="}")Q--;X++;continue}if(Y){X++;continue}if(J.paren===0&&J.bracket===0&&J.brace===0){if($.slice(X,X+2)==="}}"||$.slice(X,X+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")J.paren++;else if(G===")"){if(J.paren--,J.paren<0)break}else if(G==="[")J.bracket++;else if(G==="]"){if(J.bracket--,J.bracket<0)break}else if(G==="{")J.brace++;else if(G==="}"){if(J.brace--,J.brace<0)break}X++}return{expression:$.slice(Z,X),endPos:X}}function E3($){let Z=[],X="",J={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let q=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){X+=q;continue}if((q==='"'||q==="'")&&!Y){Y=q,X+=q;continue}if(q===Y&&Y!=="`"){Y=null,X+=q;continue}if(q==="`"&&!Y){Y="`",X+=q;continue}if(q==="`"&&Y==="`"&&Q===0){Y=null,X+=q;continue}if(Y==="`"&&q==="$"&&$[G+1]==="{"){Q++,X+=q+$[G+1],G++;continue}if(Q>0&&q==="{"){Q++,X+=q;continue}if(Q>0&&q==="}"){Q--,X+=q;continue}if(Y){X+=q;continue}if(q==="(")J.paren++;else if(q===")")J.paren--;else if(q==="[")J.bracket++;else if(q==="]")J.bracket--;else if(q==="{")J.brace++;else if(q==="}")J.brace--;if(q==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&J.paren===0&&J.bracket===0&&J.brace===0){Z.push(X.trim()),X="";continue}if(q==="|"&&$[G-1]==="\\"&&!Y){X=X.slice(0,-1)+q;continue}X+=q}if(X.trim())Z.push(X.trim());return Z}function z1($,Z){let X=DJ($,Z);return X.ok?{expression:X.expression,endPos:X.endPos}:null}function DJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return{ok:!1,reason:"missing-open-paren",pos:X};let J=B0($,"(",")",X);if(J===-1)return{ok:!1,reason:"unclosed-paren",pos:X};return{ok:!0,expression:$.slice(X+1,J),endPos:J+1}}function NJ($,Z){let X=$.lastIndexOf("<",Z);if(X===-1)return!1;return X>$.lastIndexOf(">",Z)}function R1($,Z,X,J){let Y=1,Q=J,G=new RegExp(`@${Z}\\s*\\(`,"g"),q=new RegExp(`@${X}(?![a-z])`,"g");while(Q<$.length&&Y>0){G.lastIndex=Q,q.lastIndex=Q;let W=G.exec($),K=q.exec($),U=W?W.index:1/0,z=K?K.index:1/0;if(U<z)Y++,Q=U+W[0].length;else if(z<1/0){if(Y--,Y===0)return z;Q=z+K[0].length}else break}return-1}function d6($,Z){let X=$.slice(Z).match(/^@if\s*/);if(!X)return null;let J=Z+X[0].length,Y=z1($,J);if(!Y)return null;let Q=Y.endPos,G=R1($,"if","endif",Q);if(G===-1)return null;let q=$.slice(Q,G),W=[],K=0,U="if",z=Y.expression,H=0,j=0;while(K<q.length){let B=q.indexOf("@",K);if(B===-1)break;K=B;let _=q.substring(B);if(NJ(q,B)){K++;continue}if(/^@if\s*\(/.test(_)){j++,K++;continue}if(/^@endif(?![a-z])/.test(_)){j--,K+=6;continue}if(j===0){let L=_.match(/^@elseif\s*/);if(L){W.push({type:U,condition:z,content:q.substring(H,K),start:Q+H,end:Q+K});let V=K+L[0].length,O=z1(q,V);if(!O){K++;continue}U="elseif",z=O.expression,K=O.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(_)){W.push({type:U,condition:z,content:q.substring(H,K),start:Q+H,end:Q+K}),U="else",z=void 0,K+=5,H=K;continue}}K++}return W.push({type:U,condition:z,content:q.slice(H),start:Q+H,end:Q+q.length}),{fullMatch:$.slice(Z,G+6),branches:W,start:Z,end:G+6}}function w5($){let Z=[],X=/@if\s*\(/g,J=X.exec($);while(J!==null){if(Z.some((G)=>J.index>G.start&&J.index<G.end)){J=X.exec($);continue}let Q=d6($,J.index);if(Q)Z.push(Q),X.lastIndex=Q.end;J=X.exec($)}return Z}function j$($,Z,X){let J=[],Y=new RegExp(`@${Z}\\s*\\(`,"g"),Q=Y.exec($);while(Q!==null){if(J.some((_)=>Q.index>_.start&&Q.index<_.end)){Q=Y.exec($);continue}let q=Q.index,W=q+Q[0].length-1,K=B0($,"(",")",W);if(K===-1){Q=Y.exec($);continue}let U=$.slice(W+1,K),z=K+1,H=R1($,Z,X,z);if(H===-1){Q=Y.exec($);continue}let j=$.slice(z,H),B=H+`@${X}`.length;J.push({fullMatch:$.slice(q,B),name:Z,params:U,content:j,start:q,end:B}),Y.lastIndex=B,Q=Y.exec($)}return J}function b3($,Z){let X=$.slice(Z).match(/^@switch\s*/);if(!X)return null;let J=Z+X[0].length,Y=z1($,J);if(!Y)return null;let Q=Y.endPos,G=R1($,"switch","endswitch",Q);if(G===-1)return null;let q=$.slice(Q,G),W=[],K=0,U=null,z=0;while(K<q.length){let H=q.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(z++,U)U.content+=j[0];K+=j[0].length;continue}if(B){if(z--,U)U.content+=B[0];K+=B[0].length;continue}if(z>0){if(U)U.content+=q[K];K++;continue}let _=H.match(/^@case\s*/),L=H.match(/^@default(?![a-z])/),V=H.match(/^@break(?![a-z])/);if(_&&H.startsWith("@case")){if(U)W.push(U);let O=K+_[0].length,F=z1(q,O);if(!F){K++;continue}U={type:"case",value:F.expression,content:""},K=F.endPos}else if(L&&H.startsWith("@default")){if(U)W.push(U);U={type:"default",content:""},K+=L[0].length}else if(V&&H.startsWith("@break"))K+=V[0].length;else{if(U)U.content+=q[K];K++}}if(U)W.push(U);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:W,start:Z,end:G+10}}function AJ($){let Z=[],X=0;while(X<$.length){let J=$.indexOf("{{",X),Y=$.indexOf("{!!",X),Q=!1,G;if(J===-1&&Y===-1)break;else if(J===-1)G=Y,Q=!0;else if(Y===-1)G=J,Q=!1;else if(Y<J)G=Y,Q=!0;else G=J,Q=!1;if(!Q&&$.slice(G,G+3)==="{{{")Q=!0;let q=Q?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",W=Q?q==="{{{"?"}}}":"!!}":"}}",K=G+q.length,U=MJ($,K,W);if(U===-1){X=G+1;continue}let z=$.slice(K,U).trim(),H=U+W.length;Z.push({fullMatch:$.slice(G,H),expression:z,start:G,end:H,isRaw:Q}),X=H}return Z}function MJ($,Z,X){let J=Z,Y=null,Q={paren:0,bracket:0,brace:0},G=0;while(J<$.length){let q=$[J];if((J>0?$[J-1]:"")==="\\"&&Y){J++;continue}if((q==='"'||q==="'")&&!Y){Y=q,J++;continue}if(q===Y&&Y!=="`"){Y=null,J++;continue}if(q==="`"&&!Y){Y="`",J++;continue}if(q==="`"&&Y==="`"&&G===0){Y=null,J++;continue}if(Y==="`"&&q==="$"&&$[J+1]==="{"){G++,J+=2;continue}if(G>0){if(q==="{")G++;else if(q==="}")G--;J++;continue}if(Y){J++;continue}if(q==="(")Q.paren++;else if(q===")")Q.paren--;else if(q==="[")Q.bracket++;else if(q==="]")Q.bracket--;else if(q==="{")Q.brace++;else if(q==="}")Q.brace--;if(Q.paren===0&&Q.bracket===0&&Q.brace<=0){if($.slice(J,J+X.length)===X)return J}J++}return-1}function kJ($){let Z=E3($);if(Z.length===0)return{baseExpression:"",filters:[]};let X=Z[0],J=[];for(let Y=1;Y<Z.length;Y++){let Q=IJ(Z[Y]);if(Q)J.push(Q)}return{baseExpression:X,filters:J}}function IJ($){let Z=$.trim();if(!Z)return null;let X=Z.indexOf("(");if(X===-1)return{name:Z,args:[]};let J=Z.slice(0,X).trim(),Y=X+1,Q=B0(Z,"(",")",X);if(Q===-1)return{name:J,args:[]};let G=Z.slice(Y,Q),q=c6(G);return{name:J,args:q}}function c6($){let Z=[],X="",J={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let q=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){X+=q;continue}if((q==='"'||q==="'")&&!Y){Y=q,X+=q;continue}if(q===Y&&Y!=="`"){Y=null,X+=q;continue}if(q==="`"&&!Y){Y="`",X+=q;continue}if(q==="`"&&Y==="`"&&Q===0){Y=null,X+=q;continue}if(Y==="`"&&q==="$"&&$[G+1]==="{"){Q++,X+="${",G++;continue}if(Q>0&&q==="{"){Q++,X+=q;continue}if(Q>0&&q==="}"){Q--,X+=q;continue}if(Y){X+=q;continue}if(q==="(")J.paren++;else if(q===")")J.paren--;else if(q==="[")J.bracket++;else if(q==="]")J.bracket--;else if(q==="{")J.brace++;else if(q==="}")J.brace--;if(q===","&&J.paren===0&&J.bracket===0&&J.brace===0){Z.push(X.trim()),X="";continue}X+=q}if(X.trim())Z.push(X.trim());return Z}function TJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return null;let J=B0($,"(",")",X);if(J===-1)return null;return{params:$.slice(X+1,J),endPos:J+1}}function EJ($){let Z=[],J=new H$($).tokenize().filter((Q)=>Q.type!=="WHITESPACE"&&Q.type!=="COMMENT"),Y=0;while(Y<J.length){let Q=J[Y],G=!1;if(Q.type==="IDENTIFIER"&&Q.value==="export"){if(G=!0,Y++,Y>=J.length)break}let q=J[Y];if(q.type==="IDENTIFIER"&&(q.value==="const"||q.value==="let"||q.value==="var")){let W=q.value;if(Y++,Y>=J.length)break;let K=J[Y];if(K.type==="IDENTIFIER"){let U=K.value;if(Y++,Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let z=Y<J.length?J[Y].start:$.length,H=m6(J,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:U,value:$.slice(z,H.endPos),exported:G,start:q.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let U=K.start,z=K.value==="{"?"}":"]",H=B0($,K.value,z,U);if(H!==-1){let j=$.slice(U,H+1);if(Y=l6(J,H+1),Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let B=Y<J.length?J[Y].start:$.length,_=m6(J,Y,$);Y=_.nextIndex;let L=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:L,value:`${$.slice(B,_.endPos)}; ${W} ${j} = ${L}`,exported:G,start:q.start,end:_.endPos})}}}}else if(q.type==="IDENTIFIER"&&q.value==="function"){let W=G?J[Y-1].start:q.start;if(Y++,Y>=J.length)break;let K=J[Y];if(K.type==="IDENTIFIER"){let U=K.value;Y++;let z=-1;while(Y<J.length){if(J[Y].type==="PUNCTUATION"&&J[Y].value==="{"){z=J[Y].start;break}Y++}if(z!==-1){let H=B0($,"{","}",z);if(H!==-1)Z.push({type:"function",name:U,value:$.slice(W,H+1).replace(/^export\s+/,""),exported:G,start:W,end:H+1}),Y=l6(J,H+1)}}}else Y++}return Z}function m6($,Z,X){let J=Z,Y={paren:0,bracket:0,brace:0},Q=Z<$.length?$[Z].start:X.length;while(J<$.length){let G=$[J];if(G.type==="PUNCTUATION"){if(G.value==="(")Y.paren++;else if(G.value===")")Y.paren--;else if(G.value==="[")Y.bracket++;else if(G.value==="]")Y.bracket--;else if(G.value==="{")Y.brace++;else if(G.value==="}")Y.brace--;if(G.value===";"&&Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=G.start,J++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=$[J-1]?.end??G.start;break}}Q=G.end,J++}return{nextIndex:J,endPos:Q}}function l6($,Z){for(let X=0;X<$.length;X++)if($[X].start>=Z)return X;return $.length}function bJ($,Z,X){let J=$,Y=!0;while(Y){Y=!1;let Q=J.match(/@switch\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,q=b3(J,G);if(!q)break;try{let W;if(q0(q.expression))W=W0(q.expression,Object.keys(Z))(...Object.values(Z));else W=e(q.expression,Z);let K="",U=!1;for(let z of q.cases)if(z.type==="default"){if(!U)K=z.content.trim()}else try{let H;if(z.value&&q0(z.value))H=W0(z.value,Object.keys(Z))(...Object.values(Z));else if(z.value)H=e(z.value,Z);if(W===H){K=z.content.trim(),U=!0;break}}catch{continue}J=J.substring(0,G)+K+J.substring(q.end),Y=!0}catch(W){let K=W instanceof Error?W.message:String(W),U=$0("Switch",`Error evaluating @switch expression: ${K}`,l.EVALUATION_ERROR);J=J.substring(0,G)+U+J.substring(q.end);break}}return J}function yJ($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(J)=>{return Z.push(J),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function SJ($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(X,J)=>Z[Number(J)]??X)}function X1($,Z,X){let{masked:J,scripts:Y}=yJ($);return SJ(CJ(J,Z,X),Y)}function CJ($,Z,X){let J=$;J=bJ(J,Z,X);{let Q=!0;while(Q){Q=!1;let G=J.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let q=G.index,W=z1(J,q+7);if(!W)break;let K=W.endPos,U=R1(J,"unless","endunless",K);if(U===-1){console.warn(`[stx] @unless directive at position ${q} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let z=J.slice(K,U),H=W.expression,j=-1;{let _=0,L=/@(?:if|unless)\s*\(/g,V=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,F=[],w;while((w=L.exec(z))!==null)F.push({pos:w.index,type:"open"});while((w=V.exec(z))!==null)F.push({pos:w.index,type:"close"});while((w=O.exec(z))!==null)F.push({pos:w.index,type:"else"});F.sort((R,D)=>R.pos-D.pos);for(let R of F)if(R.type==="open")_++;else if(R.type==="close")_--;else if(R.type==="else"&&_===0){j=R.pos;break}}let B;if(j!==-1){let _=z.slice(0,j),L=z.slice(j+5);B=`@if (${H})${L}@else ${_}@endif`}else B=`@if (!(${H}))${z}@endif`;J=J.substring(0,q)+B+J.substring(U+10),Q=!0}}J=S3(J,Z,X),J=C3(J,Z,X),J=y3(J,Z);let Y=()=>{let Q=w5(J);if(Q.length===0)return!1;for(let G=Q.length-1;G>=0;G--){let q=Q[G];try{let W="",K=!1;for(let U of q.branches){if(K)break;if(U.type==="else")W=U.content,K=!0;else try{let z;if(U.condition&&q0(U.condition))z=W0(U.condition,Object.keys(Z))(...Object.values(Z));else if(U.condition)z=e(U.condition,Z);if(z)W=U.content,K=!0}catch(z){W=$0(U.type==="if"?"If":"Elseif",`Error in @${U.type}(${U.condition}): ${z instanceof Error?z.message:String(z)}`,l.EVALUATION_ERROR),K=!0}}J=J.substring(0,q.start)+W+J.substring(q.end)}catch(W){let K=W instanceof Error?W.message:String(W),U=$0("If",`Error processing @if block: ${K}`,l.EVALUATION_ERROR);J=J.substring(0,q.start)+U+J.substring(q.end)}}return!0};while(!0){let Q=J;if(!Y())break;if(J===Q)break}return J}function p6($){let Z=0;while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!=="(")return null;Z++;while(Z<$.length&&/\s/.test($[Z]))Z++;let X=$[Z];if(X!=="'"&&X!=='"')return null;Z++;let J=[];while(Z<$.length){let Y=$[Z];if(Y==="\\"&&Z+1<$.length){J.push($[Z+1]),Z+=2;continue}if(Y===X){Z++;break}J.push(Y),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:J.join(""),consumed:Z}}function y3($,Z){let X=$;function J(q,W,K,U){let z=1,H=U,j=new RegExp(`@${W}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<q.length&&z>0){j.lastIndex=H,B.lastIndex=H;let _=j.exec(q),L=B.exec(q),V=_?_.index:1/0,O=L?L.index:1/0;if(V<O)z++,H=V+_[0].length;else if(O<1/0){if(z--,z===0)return O;H=O+L[0].length}else break}return-1}function Y(q,W,K){let U=0,z=new RegExp(`@${W}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],_;while((_=z.exec(q))!==null)B.push({pos:_.index,type:"open"});while((_=H.exec(q))!==null)B.push({pos:_.index,type:"close"});while((_=j.exec(q))!==null)B.push({pos:_.index,type:"else"});B.sort((L,V)=>L.pos-V.pos);for(let L of B)if(L.type==="open")U++;else if(L.type==="close")U--;else if(L.type==="else"&&U===0)return L.pos;return-1}{let q=!0;while(q){q=!1;let W=X.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!W||W.index===void 0)break;let K=W.index,U,z,H=X.slice(K+5),j=p6(H);if(j)U=j.value,z=K+5+j.consumed;else z=K+5;let B=J(X,"auth","endauth",z);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let _=X.slice(z,B),L=Y(_,"auth","endauth"),V;if(!Z.auth)V=!1;else V=U?U1(`auth?.check && auth?.user?.[${U}]`,Z):U1("auth?.check",Z);let O;if(L!==-1){let F=_.slice(0,L),w=_.slice(L+5);O=V?F:w}else O=V?_:"";X=X.substring(0,K)+O+X.substring(B+8),q=!0}}{let q=!0;while(q){q=!1;let W=X.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!W||W.index===void 0)break;let K=W.index,U,z,H=X.slice(K+6),j=p6(H);if(j)U=j.value,z=K+6+j.consumed;else z=K+6;let B=J(X,"guest","endguest",z);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let _=X.slice(z,B),L=Y(_,"guest","endguest"),V;if(!Z.auth)V=!0;else V=U?U1(`!auth?.check || !auth?.user?.[${U}]`,Z):U1("!auth?.check",Z);let O;if(L!==-1){let F=_.slice(0,L),w=_.slice(L+5);O=V?F:w}else O=V?_:"";X=X.substring(0,K)+O+X.substring(B+9),q=!0}}function Q(q,W,K){if(Z.userCan&&typeof Z.userCan[q]==="boolean")return Z.userCan[q];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let U=[q];if(W)U.push(W);if(K){let z=U1(K,Z);U.push(z)}return Z.permissions.check(...U)}catch{return!1}return!1}function G(q){let W=q.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!W)return null;return{ability:W[1],type:W[2],id:W[3]?.trim(),paramsEnd:W[0].length}}for(let q of["can","cannot"]){let W=`end${q}`,K=q==="can"?"elsecan":"elsecannot",U=!0;while(U){U=!1;let z=X.match(new RegExp(`@${q}\\s*\\(`));if(!z||z.index===void 0)break;let H=z.index,j=X.slice(H+`@${q}`.length),B=G(j);if(!B)break;let _=H+`@${q}`.length+B.paramsEnd,L=J(X,q,W,_);if(L===-1){console.warn(`[stx] @${q} directive at position ${H} has no matching @${W} \u2014 the block was skipped.`);break}let V=X.slice(_,L),O=[],F=0,w=new RegExp(`@${q}\\s*\\(`,"g"),R=new RegExp(`@${W}(?![a-z])`,"g"),D=new RegExp(`@${K}\\s*\\(`,"g"),N=/@else(?![a-z])/g,k=[],A;while((A=w.exec(V))!==null)k.push({pos:A.index,type:"open"});while((A=R.exec(V))!==null)k.push({pos:A.index,type:"close"});while((A=D.exec(V))!==null)k.push({pos:A.index,type:"elseDirective"});while((A=N.exec(V))!==null)k.push({pos:A.index,type:"else"});k.sort((b,S)=>b.pos-S.pos);for(let b of k){if(b.type==="open"){F++;continue}if(b.type==="close"){F--;continue}if(F===0)O.push(b)}let M=[],T=0;for(let b=0;b<O.length;b++){let S=O[b];if(M.push({content:V.slice(T,S.pos),ability:void 0}),S.type==="elseDirective"){let v=V.slice(S.pos+`@${K}`.length),x=G(v);if(x){M[M.length-1]={content:V.slice(T,S.pos)},T=S.pos+`@${K}`.length+x.paramsEnd,M.push({content:"",ability:x.ability,type:x.type,id:x.id}),M.pop();let d=O[b+1],g=d?d.pos:V.length;M.push({content:V.slice(T,g),ability:x.ability,type:x.type,id:x.id}),T=g}}else T=S.pos+5}if(T<V.length){let b=M[M.length-1];if(O.length>0&&O[O.length-1].type==="else")M.push({content:V.slice(T),isFinalElse:!0});else if(M.length===0)M.push({content:V.slice(T)})}let I=Q(B.ability,B.type,B.id),y=q==="can"?I:!I,E="";if(y)E=M[0]?.content||"";else{let b=!1;for(let S=1;S<M.length;S++){let v=M[S];if(v.isFinalElse){E=v.content,b=!0;break}if(v.ability){let x=Q(v.ability,v.type,v.id);if(q==="can"?x:!x){E=v.content,b=!0;break}}}if(!b&&M.length>0){let S=M[M.length-1];if(S.isFinalElse)E=S.content}}X=X.substring(0,H)+E+X.substring(L+`@${W}`.length),U=!0}}return X}function S3($,Z,X){let J=$;function Y(Q,G,q,W,K){let U=!0;while(U){U=!1;let z=new RegExp(`@${G}\\s*\\(`),H=Q.match(z);if(!H||H.index===void 0)break;let j=H.index,B=z1(Q,j+`@${G}`.length);if(!B)break;let _=B.endPos,L=R1(Q,G,q,_);if(L===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${q} \u2014 the block was skipped.`);break}let V=Q.slice(_,L),O=B.expression,F=-1,w=0,R=0;while(R<V.length){let D=V.indexOf("@",R);if(D===-1)break;let N=V.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(N)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(N)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(N)){F=D;break}R=D+1}try{let D=W(O.trim()),N;if(F!==-1){let k=V.slice(0,F),A=V.slice(F+5);N=D?k:A}else N=D?V:"";Q=Q.substring(0,j)+N+Q.substring(L+`@${q}`.length),U=!0}catch(D){let N=D instanceof Error?D.message:String(D),k=$0(K,`Error processing @${G} directive: ${N}`,l.EVALUATION_ERROR);Q=Q.substring(0,j)+k+Q.substring(L+`@${q}`.length);break}}return Q}return J=Y(J,"isset","endisset",(Q)=>{let G=U1(Q,Z);return G!==void 0&&G!==null},"Isset"),J=Y(J,"empty","endempty",(Q)=>{let G=U1(Q,Z);return G===void 0||G===null||G===""||G===0||G===!1||Array.isArray(G)&&G.length===0||typeof G==="object"&&G!==null&&Object.keys(G).length===0},"Empty"),J}function C3($,Z,X){let J=$,Y="development";function Q(G,q,W,K){let U=new RegExp(`@${q}(?![a-z])`,"g"),z=new RegExp(`@${W}(?![a-z])`,"g"),H=new RegExp(`^@${q}(?![a-z])`),j=new RegExp(`^@${W}(?![a-z])`),B=G,_=!0;while(_){_=!1,U.lastIndex=0;let L=U.exec(B);if(!L)break;let V=L.index,O=V+L[0].length;if(q==="env"){let I=B.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!I)break;O+=I[0].length,K=Y===I[2]}let F=1,w=O,R=-1;while(F>0&&w<B.length){U.lastIndex=w,z.lastIndex=w;let I=U.exec(B),y=z.exec(B),E=I?I.index:1/0,b=y?y.index:1/0;if(E<b)F++,w=E+I[0].length;else if(b<1/0){if(F--,F===0){R=b;break}w=b+y[0].length}else break}if(R===-1){console.warn(`[stx] @${q} directive at position ${V} has no matching @${W} \u2014 the block was skipped.`);break}let D=B.substring(O,R),N=-1,k=0,A=0;while(A<D.length){let I=D.indexOf("@",A);if(I===-1)break;let y=D.substring(I);if(H.test(y)){k++,A=I+1;continue}if(j.test(y)){k--,A=I+1;continue}if(k===0&&/^@else(?![a-z])/.test(y)){N=I;break}A=I+1}let M;if(N!==-1){let I=D.slice(0,N),y=D.slice(N+5);M=K?I:y}else M=K?D:"";let T=`@${W}`.length;B=B.substring(0,V)+M+B.substring(R+T),_=!0}return B}return J=Q(J,"env","endenv",!1),J=Q(J,"production","endproduction",Y==="production"),J=Q(J,"development","enddevelopment",Y==="development"),J=Q(J,"staging","endstaging",Y==="staging"),J=Q(J,"testing","endtesting",Y==="testing"),J}var P3=new WeakMap;function i6($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function D1($,Z){if(!$)return Z?.nonceGenerator?.()??i6();let X=P3.get($);if(!X)X=Z?.nonceGenerator?.()??i6(),P3.set($,X);return X}function Rz($){P3.delete($)}function n6($,Z){let X=[];for(let[J,Y]of Object.entries($)){if(Y===void 0||Y===null)continue;if(typeof Y==="boolean"){if(Y)X.push(J);continue}if(Array.isArray(Y)){let Q=[...Y];if(Z&&(J==="script-src"||J==="style-src"))Q=Q.filter((G)=>!G.startsWith("'nonce-")),Q.push(`'nonce-${Z}'`);if(Q.length>0)X.push(`${J} ${Q.join(" ")}`)}}return X.join("; ")}function f3($,Z){return`<meta http-equiv="Content-Security-Policy" content="${n6($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var PJ={"default-src":["'self'"],"script-src":["'self'","'strict-dynamic'"],"style-src":["'self'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"],"frame-ancestors":["'self'"],"upgrade-insecure-requests":!0},v3={"default-src":["'self'"],"script-src":["'self'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'","https:"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"upgrade-insecure-requests":!0},vJ={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:","http:"],"font-src":["'self'","https:","http:","data:"],"connect-src":["'self'","https:","http:","ws:","wss:"],"media-src":["'self'","https:","http:"],"object-src":["'none'"],"frame-src":["'self'","https:"],"base-uri":["'self'"]},fJ={"default-src":["'none'"],"frame-ancestors":["'none'"]};function Dz($){return{enabled:!0,directives:{strict:PJ,moderate:v3,relaxed:vJ,api:fJ}[$]||v3,useNonce:$==="strict",addMetaTag:!0}}function Nz($,Z){let X={...$};for(let[J,Y]of Object.entries(Z)){let Q=J,G=X[Q];if(Y===void 0||Y===null)continue;if(typeof Y==="boolean")X[Q]=G||Y;else if(Array.isArray(Y)){let q=Array.isArray(G)?G:[],W=[...new Set([...q,...Y])];X[Q]=W}}return X}function s6($,Z,X){if(!Z.enabled||!Z.addMetaTag)return $;if($.includes('http-equiv="Content-Security-Policy"'))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let J=Z.useNonce?D1(X,Z):void 0,Y=f3(Z.directives,J);return $.replace(/<head([^>]*)>/,`<head$1>
3265
+ ${Y}`)}function o6($,Z){let X=$;return X=X.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(J,Y)=>{if(Y.includes("nonce="))return J;return`<script nonce="${Z}"${Y}>`}),X=X.replace(/<style([^>]*)>/gi,(J,Y)=>{if(Y.includes("nonce="))return J;return`<style nonce="${Z}"${Y}>`}),X}function r6($,Z,X,J){let Y=$,Q=J.csp;if(Y=Y.replace(/@csp\b/g,()=>{if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?D1(Z,Q):void 0;return f3(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return D1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=D1(Z,Q);return Y}var xJ={name:"csp",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?D1(X,Q):void 0;return f3(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},gJ={name:"cspNonce",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return D1(X,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function Az(){return[xJ,gJ]}function Mz($){let Z=[];if($["script-src"]?.includes("'unsafe-inline'"))Z.push("CSP: Using unsafe-inline in script-src significantly reduces XSS protection");if($["script-src"]?.includes("'unsafe-eval'"))Z.push("CSP: Using unsafe-eval in script-src allows eval() and related functions");if(!$["default-src"])Z.push("CSP: No default-src specified. Recommend adding default-src as a fallback");if($["default-src"]?.includes("*"))Z.push("CSP: Using * in default-src provides minimal protection");if(!$["object-src"]&&!$["default-src"]?.includes("'none'"))Z.push("CSP: Consider adding object-src: none to block plugins");if(!$["base-uri"])Z.push("CSP: Consider adding base-uri to prevent base tag injection attacks");for(let[X,J]of Object.entries($))if(Array.isArray(J)&&J.includes("http:"))Z.push(`CSP: Using http: in ${X} allows insecure resources`);return Z}function hJ($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function kz($,Z){if(!$.enabled)return{};let X=$.useNonce?D1(Z,$):void 0,J=n6($.directives,X);return{[hJ($.reportOnly)]:J}}var Iz={enabled:!1,reportOnly:!1,directives:v3,useNonce:!1,addMetaTag:!0};import uJ from"crypto";var dJ=40,a6="_token",x3=null;function mJ($=dJ){let Z=uJ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return x3=Z,Z}function lJ(){if(!x3)mJ();return x3}function cJ($=a6){let Z=lJ();return`<input type="hidden" name="${$}" value="${Z}">`}function t6($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,X,J)=>{return cJ(J||a6)})}async function e6($,Z,X,J){if(!J.customDirectives||J.customDirectives.length===0)return $;let Y=$;for(let Q of J.customDirectives){if(!Q.name||typeof Q.handler!=="function"){if(J.debug)console.warn("Invalid custom directive:",Q);continue}if(Q.hasEndTag)Y=await pJ(Y,Q,Z,X,J);else Y=await iJ(Y,Q,Z,X,J)}return Y}async function pJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=`@${Q}`,W=`@end${Q}`,K=$,U=m1(`${q}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${W}`,"g"),z=[],H=U.exec(K);while(H!==null){let[j,B="",_=""]=H,L=H.index||0;try{let V=B?$9(B):[],O=_.trim(),F=await G(O,V,X,J);z.push({original:j,processed:F,startIndex:L})}catch(V){let O=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);z.push({original:j,processed:$0("CustomDirective",`Error in @${Q}${B?`(${B})`:""}: ${O}`,l.EVALUATION_ERROR),startIndex:L})}H=U.exec(K)}for(let j=z.length-1;j>=0;j--){let{original:B,processed:_}=z[j];K=K.replace(B,_)}return K}async function iJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=$,W=m1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],U=W.exec(q);while(U!==null){let[j,B=""]=U,_=U.index||0;try{let L=$9(B),V=await G("",L,X,J);K.push({original:j,processed:V,startIndex:_})}catch(L){let V=L instanceof Error?L.message:String(L);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,L);K.push({original:j,processed:$0("CustomDirective",`Error in @${Q}(${B}): ${V}`,l.EVALUATION_ERROR),startIndex:_})}U=W.exec(q)}let z=m1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=z.exec(q);while(H!==null){let[j]=H,B=H.index||0;try{let _=await G("",[],X,J);K.push({original:j,processed:_,startIndex:B})}catch(_){let L=_ instanceof Error?_.message:String(_);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,_);K.push({original:j,processed:$0("CustomDirective",`Error in @${Q}: ${L}`,l.EVALUATION_ERROR),startIndex:B})}H=z.exec(q)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:_}=K[j];q=q.replace(B,_)}return q}function $9($){if(!$.trim())return[];let Z=[],X="",J=!1,Y="";for(let Q=0;Q<$.length;Q++){let G=$[Q];if((G==='"'||G==="'")&&(Q===0||$[Q-1]!=="\\"))if(!J)J=!0,Y=G;else if(G===Y)J=!1;else X+=G;else if(G===","&&!J)Z.push(X.trim()),X="";else X+=G}if(X.trim())Z.push(X.trim());return Z.map((Q)=>{let G=Q.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var Z9=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,X9=/^[A-Za-z_$][\w$]*$/,nJ=new Set(["light","dark","system"]);function N1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function sJ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,X=Z.appearance,J=Z.colorMode;if(N1(Z.storageKey,"storageKey"),!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap appearance must be an object");if(!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap colorMode must be an object");if(N1(X.key,"appearance.key"),N1(X.attribute,"appearance.attribute"),N1(X.default,"appearance.default"),N1(J.key,"colorMode.key"),N1(J.attribute,"colorMode.attribute"),N1(J.default,"colorMode.default"),!X9.test(X.key)||!X9.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Z9.test(X.attribute)||!Z9.test(J.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(X.allowed)||X.allowed.length===0||X.allowed.some((Y)=>typeof Y!=="string"||Y.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!X.allowed.includes(X.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");if(!nJ.has(J.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:X.key,attribute:X.attribute,allowed:[...new Set(X.allowed)],default:X.default},colorMode:{key:J.key,attribute:J.attribute,default:J.default}}}function oJ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function rJ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${oJ($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function aJ($,Z){let X=1,J=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(J){if(G==="\\")Y=!0;else if(G===J)J=null;continue}if(G==='"'||G==="'"||G==="`"){J=G;continue}if(G==="(")X++;else if(G===")"&&--X===0)return Q}return-1}function J9($,Z){let X=$,J=/@appearanceBootstrap\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index+Y[0].length-1,G=aJ(X,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let q=X.slice(Q+1,G).trim(),W=e(`(${q})`,Z),K=rJ(sJ(W));X=X.slice(0,Y.index)+K+X.slice(G+1),J.lastIndex=Y.index+K.length}return X}import tJ from"crypto";function _0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var h3={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function eJ($){return{...h3,...$.forms?.classes}}function B$($,Z,X,J){let Y=$||Z;return X?`${Y} ${J}`:Y}function u0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function l1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${_0(Z)}"`}function g3($,Z,X){if(!Z)return"";let J="";if(!/\baria-invalid\s*=/i.test(X))J+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(X))J+=` aria-describedby="${_0(`${u0($)}-error`)}"`;return J}function $Y(){return tJ.randomUUID()}function gz($,Z,X,J){let Y=eJ(J),Q=$;return Q=XY(Q,Z),Q=N5(Q,Z),Q=u3(Q,Z,Y),Q=d3(Q,Z,Y),Q}function N5($,Z){let X=$;return X=X.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let J=$Y();Z.csrf={token:J}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${_0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),X=X.replace(/@method\(['"]([^'"]+)['"]\)/g,(J,Y)=>{let Q=Y.toUpperCase();if(Y&&!["GET","POST"].includes(Q))return`<input type="hidden" name="_method" value="${_0(Q)}">`;return J}),X}function u3($,Z,X=h3){let J=$;return J=J.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,q,W,K="")=>{let U=Q||G||"POST",z=q||W||"",H=H1(K),j=U.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",_=`<form method="${_0(B)}" action="${_0(z)}"${H?` ${H}`:""}>`;if(_+=`
3266
3266
  ${N5("@csrf",Z)}`,!["GET","POST"].includes(j))_+=`
3267
- ${N5(`@method('${j}')`,Z)}`;return _}),J=J.replace(/@endform/g,"</form>"),J=J.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Y,Q,G,q,W,K="")=>{let U=Q||G||"",z=q||W||"",H=H1(K),j=R5(U,Z),B=j!==void 0&&j!==null?j:z||"",_=H.match(/type=['"]([^'"]+)['"]/i),L=_?_[1]:"text",V=D5(U,Z),O=H.match(/class=['"]([^'"]+)['"]/i),F=B$(O?O[1]:"",X.input,V,X.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${_0(L)}" name="${_0(U)}"${l1(H,u0(U))} value="${_0(B)}" class="${F}"${g3(U,V,H)}${w?` ${w}`:""}>`}),J=J.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",q="")=>{let W=H1(G),K=R5(Q,Z)||q.trim(),U=D5(Q,Z),z=W.match(/class=['"]([^'"]+)['"]/i),H=B$(z?z[1]:"",X.input,U,X.inputError),j=W.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${_0(Q)}"${l1(W,u0(Q))} class="${H}"${g3(Q,U,W)}${j?` ${j}`:""}>${_0(K)}</textarea>`}),J=J.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",q)=>{let W=H1(G),K=R5(Q,Z),U=D5(Q,Z),z=W.match(/class=['"]([^'"]+)['"]/i),H=B$(z?z[1]:"",X.input,U,X.inputError),j=W.replace(/class=['"][^'"]+['"]/i,""),B=q;if(K!==void 0)B=q.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(_,L,V)=>{if((Array.isArray(K)?K.some((F)=>String(F)===V):String(K)===V)&&!L.includes("selected"))return L.replace(/(<option)/,"$1 selected");return _});return`<select name="${_0(Q)}"${l1(W,u0(Q))} class="${H}"${g3(Q,U,W)}${j?` ${j}`:""}>${B}</select>`}),J=J.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let W=G===void 0?"1":G,K=G===void 0?u0(Q):`${u0(Q)}-${u0(W)}`,U=H1(q),z=R5(Q,Z),H=z!==void 0&&(Array.isArray(z)?z.some((L)=>String(L)===W):z===!0||String(z)===W),j=U.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:X.checkInput,_=U.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${_0(Q)}"${l1(U,K)} value="${_0(W)}" class="${B}"${H?" checked":""}${_?` ${_}`:""}>`}),J=J.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let W=H1(q),K=R5(Q,Z),U=K!==void 0&&K===G,z=W.match(/class=['"]([^'"]+)['"]/i),H=z?z[1]:X.checkInput,j=W.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${_0(Q)}"${l1(W,`${u0(Q)}-${u0(G)}`)} value="${_0(G)}" class="${H}"${U?" checked":""}${j?` ${j}`:""}>`}),J=J.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let q=H1(G),W=q.match(/accept=['"]([^'"]+)['"]/i),K=W?W[1]:"",U=q.includes("multiple"),z=D5(Q,Z),H=q.match(/class=['"]([^'"]+)['"]/i),j=B$(H?H[1]:"",X.input,z,X.inputError),B=q.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),_=[`<input type="file" name="${_0(Q)}"${l1(q,u0(Q))}`,`class="${j}"`];if(K)_.push(`accept="${_0(K)}"`);if(U)_.push("multiple");if(B)_.push(B);return`${_.join(" ")}>`}),J=J.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Y,Q,G="",q)=>{let W=H1(G),K=W.match(/class=['"]([^'"]+)['"]/i),U=K?K[1]:X.label,z=W.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${_0(u0(Q))}" class="${U}"${z?` ${z}`:""}>${q}</label>`}),J}function d3($,Z,X=h3){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(J,Y,Q)=>{try{if(D5(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(q,W)=>{try{if(W.trim()==="$message"||W.trim()==="message")return Y9(Y,Z);if(W.trim().includes("errors.first")||W.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return Y9(Y,Z)}let K=W.trim();if(q0(K)){let U=e(K,Z);return U!==void 0?String(U):K}return K}catch{return W}});return`<div id="${_0(`${u0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),J}})}function D5($,Z){if(!Z.errors)return!1;if(typeof Z.errors.has==="function")return Z.errors.has($);if(typeof Z.errors==="object")return Object.prototype.hasOwnProperty.call(Z.errors,$);return!1}function Y9($,Z){if(!Z.errors)return"";if(typeof Z.errors.get==="function")return Z.errors.get($);if(typeof Z.errors==="object"&&Object.prototype.hasOwnProperty.call(Z.errors,$)){let X=Z.errors[$];return Array.isArray(X)?X[0]:String(X)}return""}function R5($,Z){let X;if(Z.old&&typeof Z.old==="function")return Z.old($);if(Z.old&&typeof Z.old==="object")return Z.old[$];if($.endsWith("[]")){let J=$.slice(0,-2);if(X=Z[J],X!==void 0)return X}return Z[$]}function H1($){if(!$.trim())return"";let Z=[],X=$.trim(),J=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,Y;while((Y=J.exec(X))!==null){let[,Q,,G]=Y;Z.push(`${Q}="${G.trim()}"`)}return Z.join(" ")}var Q9={required:($,Z,X)=>{if($===void 0||$===null||$===""||Array.isArray($)&&$.length===0)return`The ${X} field is required.`;return null},email:($,Z,X)=>{if(!$)return null;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($)))return`The ${X} field must be a valid email address.`;return null},min:($,Z,X)=>{if(!$)return null;let J=Number(Z[0]);if(typeof $==="string"&&$.length<J)return`The ${X} field must be at least ${J} characters.`;if(typeof $==="number"&&$<J)return`The ${X} field must be at least ${J}.`;if(Array.isArray($)&&$.length<J)return`The ${X} field must have at least ${J} items.`;return null},max:($,Z,X)=>{if(!$)return null;let J=Number(Z[0]);if(typeof $==="string"&&$.length>J)return`The ${X} field must not exceed ${J} characters.`;if(typeof $==="number"&&$>J)return`The ${X} field must not exceed ${J}.`;if(Array.isArray($)&&$.length>J)return`The ${X} field must not have more than ${J} items.`;return null},confirmed:($,Z,X)=>{if(Z[0]!==void 0&&$!==Z[0])return`The ${X} confirmation does not match.`;return null},numeric:($,Z,X)=>{if(!$)return null;if(Number.isNaN(Number($)))return`The ${X} field must be a number.`;return null},integer:($,Z,X)=>{if(!$)return null;if(!Number.isInteger(Number($)))return`The ${X} field must be an integer.`;return null},alpha:($,Z,X)=>{if(!$)return null;if(!/^[a-z]+$/i.test(String($)))return`The ${X} field must only contain letters.`;return null},alphanumeric:($,Z,X)=>{if(!$)return null;if(!/^[a-z0-9]+$/i.test(String($)))return`The ${X} field must only contain letters and numbers.`;return null},url:($,Z,X)=>{if(!$)return null;try{return new URL(String($))?null:null}catch{return`The ${X} field must be a valid URL.`}},regex:($,Z,X)=>{if(!$)return null;try{if(!new RegExp(Z[0]).test(String($)))return`The ${X} field format is invalid.`;return null}catch{return`The ${X} field has an invalid validation pattern.`}},in:($,Z,X)=>{if(!$)return null;if(!Z.includes(String($)))return`The ${X} field must be one of: ${Z.join(", ")}.`;return null},notIn:($,Z,X)=>{if(!$)return null;if(Z.includes(String($)))return`The ${X} field must not be: ${Z.join(", ")}.`;return null},date:($,Z,X)=>{if(!$)return null;let J=new Date($);if(Number.isNaN(J.getTime()))return`The ${X} field must be a valid date.`;return null},before:($,Z,X)=>{if(!$)return null;let J=new Date($),Y=new Date(Z[0]);if(J>=Y)return`The ${X} field must be before ${Z[0]}.`;return null},after:($,Z,X)=>{if(!$)return null;let J=new Date($),Y=new Date(Z[0]);if(J<=Y)return`The ${X} field must be after ${Z[0]}.`;return null}};function gz($,Z){Q9[$]=Z}function m3($){let[Z,...X]=$.split(":"),J=X.length>0?X.join(":").split(","):[];return{name:Z.trim(),params:J}}function ZY($,Z,X,J={}){let Y=[],Q=X.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let q=m3(G),W=Q9[q.name];if(!W){console.warn(`Unknown validation rule: ${q.name}`);continue}if(q.name==="confirmed"){let U=`${$}_confirmation`;q.params=[J[U]]}let K=W(Z,q.params||[],$);if(K)Y.push(q.message||K)}return{field:$,valid:Y.length===0,errors:Y}}function hz($,Z){let X={};for(let[J,Y]of Object.entries(Z)){let Q=ZY(J,$[J],Y,$);if(!Q.valid)X[J]=Q.errors}return X}function XY($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(X,J,Y,Q)=>{let G=Y.split("|").map((W)=>W.trim()),q=[];for(let W of G){let K=m3(W);switch(K.name){case"required":q.push("required");break;case"email":q.push('type="email"');break;case"url":q.push('type="url"');break;case"numeric":case"integer":if(q.push('type="number"'),K.name==="integer")q.push('step="1"');break;case"min":if(K.params?.[0])q.push(`minlength="${K.params[0]}"`);break;case"max":if(K.params?.[0])q.push(`maxlength="${K.params[0]}"`);break;case"regex":if(K.params?.[0])q.push(`pattern="${K.params[0]}"`);break}}return`<!-- @validate:${J}:${Y} -->${q.length>0?`<!-- attrs:${q.join(" ")} -->`:""}`})}var G9={required:{name:"required",validate:($)=>{if($===null||$===void 0||$==="")return"This field is required";if(Array.isArray($)&&$.length===0)return"This field is required";return!0},toHtml5:()=>["required"],message:"This field is required"},email:{name:"email",validate:($)=>{if(!$)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($))||"Please enter a valid email address"},toHtml5:()=>['type="email"'],message:"Please enter a valid email address"},url:{name:"url",validate:($)=>{if(!$)return!0;try{return new URL(String($)).protocol.startsWith("http")||"Please enter a valid URL"}catch{return"Please enter a valid URL"}},toHtml5:()=>['type="url"'],message:"Please enter a valid URL"},numeric:{name:"numeric",validate:($)=>{if(!$)return!0;return!Number.isNaN(Number($))||"Please enter a number"},toHtml5:()=>['type="number"'],message:"Please enter a number"},integer:{name:"integer",validate:($)=>{if(!$)return!0;let Z=Number($);return Number.isInteger(Z)||"Please enter a whole number"},toHtml5:()=>['type="number"','step="1"'],message:"Please enter a whole number"},alpha:{name:"alpha",validate:($)=>{if(!$)return!0;return/^[a-z]+$/i.test(String($))||"Please enter only letters"},toHtml5:()=>['pattern="[a-zA-Z]+"'],message:"Please enter only letters"},alphanumeric:{name:"alphanumeric",validate:($)=>{if(!$)return!0;return/^[a-z0-9]+$/i.test(String($))||"Please enter only letters and numbers"},toHtml5:()=>['pattern="[a-zA-Z0-9]+"'],message:"Please enter only letters and numbers"},min:{name:"min",validate:($,Z)=>{if(!$)return!0;let X=Number(Z[0]);if(typeof $==="string")return $.length>=X||`Must be at least ${X} characters`;if(typeof $==="number")return $>=X||`Must be at least ${X}`;if(Array.isArray($))return $.length>=X||`Must have at least ${X} items`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`min="${$[0]}"`],message:"Must be at least {{param}} characters"},max:{name:"max",validate:($,Z)=>{if(!$)return!0;let X=Number(Z[0]);if(typeof $==="string")return $.length<=X||`Must be no more than ${X} characters`;if(typeof $==="number")return $<=X||`Must be no more than ${X}`;if(Array.isArray($))return $.length<=X||`Must have no more than ${X} items`;return!0},toHtml5:($)=>[`maxlength="${$[0]}"`,`max="${$[0]}"`],message:"Must be no more than {{param}} characters"},between:{name:"between",validate:($,Z)=>{if(!$)return!0;let[X,J]=Z.map(Number);if(typeof $==="string")return $.length>=X&&$.length<=J||`Must be between ${X} and ${J} characters`;if(typeof $==="number")return $>=X&&$<=J||`Must be between ${X} and ${J}`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`maxlength="${$[1]}"`],message:"Must be between {{min}} and {{max}}"},confirmed:{name:"confirmed",validate:($,Z,X)=>{let J=Object.keys(X);for(let Y of J)if(Y.endsWith("_confirmation")&&X[Y]===$)return!0;return"Confirmation does not match"},message:"Confirmation does not match"},in:{name:"in",validate:($,Z)=>{if(!$)return!0;return Z.includes(String($))||`Must be one of: ${Z.join(", ")}`},message:"Must be one of: {{values}}"},notIn:{name:"notIn",validate:($,Z)=>{if(!$)return!0;return!Z.includes(String($))||`Must not be: ${Z.join(", ")}`},message:"Must not be: {{values}}"},regex:{name:"regex",validate:($,Z)=>{if(!$)return!0;try{return new RegExp(Z[0]).test(String($))||"Invalid format"}catch{return"Invalid format"}},toHtml5:($)=>[`pattern="${$[0]}"`],message:"Invalid format"},date:{name:"date",validate:($)=>{if(!$)return!0;let Z=new Date(String($));return!Number.isNaN(Z.getTime())||"Please enter a valid date"},toHtml5:()=>['type="date"'],message:"Please enter a valid date"},before:{name:"before",validate:($,Z)=>{if(!$)return!0;let X=new Date(String($)),J=new Date(Z[0]);return X<J||`Must be before ${Z[0]}`},toHtml5:($)=>[`max="${$[0]}"`],message:"Must be before {{date}}"},after:{name:"after",validate:($,Z)=>{if(!$)return!0;let X=new Date(String($)),J=new Date(Z[0]);return X>J||`Must be after ${Z[0]}`},toHtml5:($)=>[`min="${$[0]}"`],message:"Must be after {{date}}"},size:{name:"size",validate:($,Z)=>{if(!$)return!0;let X=Number(Z[0]);if(typeof $==="string")return $.length===X||`Must be exactly ${X} characters`;if(Array.isArray($))return $.length===X||`Must have exactly ${X} items`;return!0},message:"Must be exactly {{size}}"},phone:{name:"phone",validate:($)=>{if(!$)return!0;return/^\+?\(?\d{1,4}\)?[-\s./\d]*$/.test(String($))||"Please enter a valid phone number"},toHtml5:()=>['type="tel"','pattern="\\+?\\(?\\d{1,4}\\)?[-\\s./\\d]*"'],message:"Please enter a valid phone number"}};function uz($){G9[$.name]=$}function JY($,Z,X={}){let J=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=m3(Q),q=G9[G.name];if(!q){console.warn(`Unknown validation rule: ${G.name}`);continue}let W=q.validate($,G.params||[],X);if(W!==!0)J.push(W)}return{valid:J.length===0,errors:J}}function dz($,Z){let X={},J=!0;for(let[Y,Q]of Object.entries(Z)){let G=JY($[Y],Q,$);if(!G.valid)J=!1,X[Y]=G.errors}return{valid:J,errors:X}}function mz($,Z){let X=JSON.stringify(Z);return`
3267
+ ${N5(`@method('${j}')`,Z)}`;return _}),J=J.replace(/@endform/g,"</form>"),J=J.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Y,Q,G,q,W,K="")=>{let U=Q||G||"",z=q||W||"",H=H1(K),j=R5(U,Z),B=j!==void 0&&j!==null?j:z||"",_=H.match(/type=['"]([^'"]+)['"]/i),L=_?_[1]:"text",V=D5(U,Z),O=H.match(/class=['"]([^'"]+)['"]/i),F=B$(O?O[1]:"",X.input,V,X.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${_0(L)}" name="${_0(U)}"${l1(H,u0(U))} value="${_0(B)}" class="${F}"${g3(U,V,H)}${w?` ${w}`:""}>`}),J=J.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",q="")=>{let W=H1(G),K=R5(Q,Z)||q.trim(),U=D5(Q,Z),z=W.match(/class=['"]([^'"]+)['"]/i),H=B$(z?z[1]:"",X.input,U,X.inputError),j=W.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${_0(Q)}"${l1(W,u0(Q))} class="${H}"${g3(Q,U,W)}${j?` ${j}`:""}>${_0(K)}</textarea>`}),J=J.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",q)=>{let W=H1(G),K=R5(Q,Z),U=D5(Q,Z),z=W.match(/class=['"]([^'"]+)['"]/i),H=B$(z?z[1]:"",X.input,U,X.inputError),j=W.replace(/class=['"][^'"]+['"]/i,""),B=q;if(K!==void 0)B=q.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(_,L,V)=>{if((Array.isArray(K)?K.some((F)=>String(F)===V):String(K)===V)&&!L.includes("selected"))return L.replace(/(<option)/,"$1 selected");return _});return`<select name="${_0(Q)}"${l1(W,u0(Q))} class="${H}"${g3(Q,U,W)}${j?` ${j}`:""}>${B}</select>`}),J=J.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let W=G===void 0?"1":G,K=G===void 0?u0(Q):`${u0(Q)}-${u0(W)}`,U=H1(q),z=R5(Q,Z),H=z!==void 0&&(Array.isArray(z)?z.some((L)=>String(L)===W):z===!0||String(z)===W),j=U.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:X.checkInput,_=U.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${_0(Q)}"${l1(U,K)} value="${_0(W)}" class="${B}"${H?" checked":""}${_?` ${_}`:""}>`}),J=J.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let W=H1(q),K=R5(Q,Z),U=K!==void 0&&K===G,z=W.match(/class=['"]([^'"]+)['"]/i),H=z?z[1]:X.checkInput,j=W.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${_0(Q)}"${l1(W,`${u0(Q)}-${u0(G)}`)} value="${_0(G)}" class="${H}"${U?" checked":""}${j?` ${j}`:""}>`}),J=J.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let q=H1(G),W=q.match(/accept=['"]([^'"]+)['"]/i),K=W?W[1]:"",U=q.includes("multiple"),z=D5(Q,Z),H=q.match(/class=['"]([^'"]+)['"]/i),j=B$(H?H[1]:"",X.input,z,X.inputError),B=q.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),_=[`<input type="file" name="${_0(Q)}"${l1(q,u0(Q))}`,`class="${j}"`];if(K)_.push(`accept="${_0(K)}"`);if(U)_.push("multiple");if(B)_.push(B);return`${_.join(" ")}>`}),J=J.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Y,Q,G="",q)=>{let W=H1(G),K=W.match(/class=['"]([^'"]+)['"]/i),U=K?K[1]:X.label,z=W.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${_0(u0(Q))}" class="${U}"${z?` ${z}`:""}>${q}</label>`}),J}function d3($,Z,X=h3){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(J,Y,Q)=>{try{if(D5(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(q,W)=>{try{if(W.trim()==="$message"||W.trim()==="message")return Y9(Y,Z);if(W.trim().includes("errors.first")||W.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return Y9(Y,Z)}let K=W.trim();if(q0(K)){let U=e(K,Z);return U!==void 0?String(U):K}return K}catch{return W}});return`<div id="${_0(`${u0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),J}})}function D5($,Z){if(!Z.errors)return!1;if(typeof Z.errors.has==="function")return Z.errors.has($);if(typeof Z.errors==="object")return Object.prototype.hasOwnProperty.call(Z.errors,$);return!1}function Y9($,Z){if(!Z.errors)return"";if(typeof Z.errors.get==="function")return Z.errors.get($);if(typeof Z.errors==="object"&&Object.prototype.hasOwnProperty.call(Z.errors,$)){let X=Z.errors[$];return Array.isArray(X)?X[0]:String(X)}return""}function R5($,Z){let X;if(Z.old&&typeof Z.old==="function")return Z.old($);if(Z.old&&typeof Z.old==="object")return Z.old[$];if($.endsWith("[]")){let J=$.slice(0,-2);if(X=Z[J],X!==void 0)return X}return Z[$]}function H1($){if(!$.trim())return"";let Z=[],X=$.trim(),J=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,Y;while((Y=J.exec(X))!==null){let[,Q,,G]=Y;Z.push(`${Q}="${G.trim()}"`)}return Z.join(" ")}var Q9={required:($,Z,X)=>{if($===void 0||$===null||$===""||Array.isArray($)&&$.length===0)return`The ${X} field is required.`;return null},email:($,Z,X)=>{if(!$)return null;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($)))return`The ${X} field must be a valid email address.`;return null},min:($,Z,X)=>{if(!$)return null;let J=Number(Z[0]);if(typeof $==="string"&&$.length<J)return`The ${X} field must be at least ${J} characters.`;if(typeof $==="number"&&$<J)return`The ${X} field must be at least ${J}.`;if(Array.isArray($)&&$.length<J)return`The ${X} field must have at least ${J} items.`;return null},max:($,Z,X)=>{if(!$)return null;let J=Number(Z[0]);if(typeof $==="string"&&$.length>J)return`The ${X} field must not exceed ${J} characters.`;if(typeof $==="number"&&$>J)return`The ${X} field must not exceed ${J}.`;if(Array.isArray($)&&$.length>J)return`The ${X} field must not have more than ${J} items.`;return null},confirmed:($,Z,X)=>{if(Z[0]!==void 0&&$!==Z[0])return`The ${X} confirmation does not match.`;return null},numeric:($,Z,X)=>{if(!$)return null;if(Number.isNaN(Number($)))return`The ${X} field must be a number.`;return null},integer:($,Z,X)=>{if(!$)return null;if(!Number.isInteger(Number($)))return`The ${X} field must be an integer.`;return null},alpha:($,Z,X)=>{if(!$)return null;if(!/^[a-z]+$/i.test(String($)))return`The ${X} field must only contain letters.`;return null},alphanumeric:($,Z,X)=>{if(!$)return null;if(!/^[a-z0-9]+$/i.test(String($)))return`The ${X} field must only contain letters and numbers.`;return null},url:($,Z,X)=>{if(!$)return null;try{return new URL(String($))?null:null}catch{return`The ${X} field must be a valid URL.`}},regex:($,Z,X)=>{if(!$)return null;try{if(!new RegExp(Z[0]).test(String($)))return`The ${X} field format is invalid.`;return null}catch{return`The ${X} field has an invalid validation pattern.`}},in:($,Z,X)=>{if(!$)return null;if(!Z.includes(String($)))return`The ${X} field must be one of: ${Z.join(", ")}.`;return null},notIn:($,Z,X)=>{if(!$)return null;if(Z.includes(String($)))return`The ${X} field must not be: ${Z.join(", ")}.`;return null},date:($,Z,X)=>{if(!$)return null;let J=new Date($);if(Number.isNaN(J.getTime()))return`The ${X} field must be a valid date.`;return null},before:($,Z,X)=>{if(!$)return null;let J=new Date($),Y=new Date(Z[0]);if(J>=Y)return`The ${X} field must be before ${Z[0]}.`;return null},after:($,Z,X)=>{if(!$)return null;let J=new Date($),Y=new Date(Z[0]);if(J<=Y)return`The ${X} field must be after ${Z[0]}.`;return null}};function hz($,Z){Q9[$]=Z}function m3($){let[Z,...X]=$.split(":"),J=X.length>0?X.join(":").split(","):[];return{name:Z.trim(),params:J}}function ZY($,Z,X,J={}){let Y=[],Q=X.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let q=m3(G),W=Q9[q.name];if(!W){console.warn(`Unknown validation rule: ${q.name}`);continue}if(q.name==="confirmed"){let U=`${$}_confirmation`;q.params=[J[U]]}let K=W(Z,q.params||[],$);if(K)Y.push(q.message||K)}return{field:$,valid:Y.length===0,errors:Y}}function uz($,Z){let X={};for(let[J,Y]of Object.entries(Z)){let Q=ZY(J,$[J],Y,$);if(!Q.valid)X[J]=Q.errors}return X}function XY($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(X,J,Y,Q)=>{let G=Y.split("|").map((W)=>W.trim()),q=[];for(let W of G){let K=m3(W);switch(K.name){case"required":q.push("required");break;case"email":q.push('type="email"');break;case"url":q.push('type="url"');break;case"numeric":case"integer":if(q.push('type="number"'),K.name==="integer")q.push('step="1"');break;case"min":if(K.params?.[0])q.push(`minlength="${K.params[0]}"`);break;case"max":if(K.params?.[0])q.push(`maxlength="${K.params[0]}"`);break;case"regex":if(K.params?.[0])q.push(`pattern="${K.params[0]}"`);break}}return`<!-- @validate:${J}:${Y} -->${q.length>0?`<!-- attrs:${q.join(" ")} -->`:""}`})}var G9={required:{name:"required",validate:($)=>{if($===null||$===void 0||$==="")return"This field is required";if(Array.isArray($)&&$.length===0)return"This field is required";return!0},toHtml5:()=>["required"],message:"This field is required"},email:{name:"email",validate:($)=>{if(!$)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($))||"Please enter a valid email address"},toHtml5:()=>['type="email"'],message:"Please enter a valid email address"},url:{name:"url",validate:($)=>{if(!$)return!0;try{return new URL(String($)).protocol.startsWith("http")||"Please enter a valid URL"}catch{return"Please enter a valid URL"}},toHtml5:()=>['type="url"'],message:"Please enter a valid URL"},numeric:{name:"numeric",validate:($)=>{if(!$)return!0;return!Number.isNaN(Number($))||"Please enter a number"},toHtml5:()=>['type="number"'],message:"Please enter a number"},integer:{name:"integer",validate:($)=>{if(!$)return!0;let Z=Number($);return Number.isInteger(Z)||"Please enter a whole number"},toHtml5:()=>['type="number"','step="1"'],message:"Please enter a whole number"},alpha:{name:"alpha",validate:($)=>{if(!$)return!0;return/^[a-z]+$/i.test(String($))||"Please enter only letters"},toHtml5:()=>['pattern="[a-zA-Z]+"'],message:"Please enter only letters"},alphanumeric:{name:"alphanumeric",validate:($)=>{if(!$)return!0;return/^[a-z0-9]+$/i.test(String($))||"Please enter only letters and numbers"},toHtml5:()=>['pattern="[a-zA-Z0-9]+"'],message:"Please enter only letters and numbers"},min:{name:"min",validate:($,Z)=>{if(!$)return!0;let X=Number(Z[0]);if(typeof $==="string")return $.length>=X||`Must be at least ${X} characters`;if(typeof $==="number")return $>=X||`Must be at least ${X}`;if(Array.isArray($))return $.length>=X||`Must have at least ${X} items`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`min="${$[0]}"`],message:"Must be at least {{param}} characters"},max:{name:"max",validate:($,Z)=>{if(!$)return!0;let X=Number(Z[0]);if(typeof $==="string")return $.length<=X||`Must be no more than ${X} characters`;if(typeof $==="number")return $<=X||`Must be no more than ${X}`;if(Array.isArray($))return $.length<=X||`Must have no more than ${X} items`;return!0},toHtml5:($)=>[`maxlength="${$[0]}"`,`max="${$[0]}"`],message:"Must be no more than {{param}} characters"},between:{name:"between",validate:($,Z)=>{if(!$)return!0;let[X,J]=Z.map(Number);if(typeof $==="string")return $.length>=X&&$.length<=J||`Must be between ${X} and ${J} characters`;if(typeof $==="number")return $>=X&&$<=J||`Must be between ${X} and ${J}`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`maxlength="${$[1]}"`],message:"Must be between {{min}} and {{max}}"},confirmed:{name:"confirmed",validate:($,Z,X)=>{let J=Object.keys(X);for(let Y of J)if(Y.endsWith("_confirmation")&&X[Y]===$)return!0;return"Confirmation does not match"},message:"Confirmation does not match"},in:{name:"in",validate:($,Z)=>{if(!$)return!0;return Z.includes(String($))||`Must be one of: ${Z.join(", ")}`},message:"Must be one of: {{values}}"},notIn:{name:"notIn",validate:($,Z)=>{if(!$)return!0;return!Z.includes(String($))||`Must not be: ${Z.join(", ")}`},message:"Must not be: {{values}}"},regex:{name:"regex",validate:($,Z)=>{if(!$)return!0;try{return new RegExp(Z[0]).test(String($))||"Invalid format"}catch{return"Invalid format"}},toHtml5:($)=>[`pattern="${$[0]}"`],message:"Invalid format"},date:{name:"date",validate:($)=>{if(!$)return!0;let Z=new Date(String($));return!Number.isNaN(Z.getTime())||"Please enter a valid date"},toHtml5:()=>['type="date"'],message:"Please enter a valid date"},before:{name:"before",validate:($,Z)=>{if(!$)return!0;let X=new Date(String($)),J=new Date(Z[0]);return X<J||`Must be before ${Z[0]}`},toHtml5:($)=>[`max="${$[0]}"`],message:"Must be before {{date}}"},after:{name:"after",validate:($,Z)=>{if(!$)return!0;let X=new Date(String($)),J=new Date(Z[0]);return X>J||`Must be after ${Z[0]}`},toHtml5:($)=>[`min="${$[0]}"`],message:"Must be after {{date}}"},size:{name:"size",validate:($,Z)=>{if(!$)return!0;let X=Number(Z[0]);if(typeof $==="string")return $.length===X||`Must be exactly ${X} characters`;if(Array.isArray($))return $.length===X||`Must have exactly ${X} items`;return!0},message:"Must be exactly {{size}}"},phone:{name:"phone",validate:($)=>{if(!$)return!0;return/^\+?\(?\d{1,4}\)?[-\s./\d]*$/.test(String($))||"Please enter a valid phone number"},toHtml5:()=>['type="tel"','pattern="\\+?\\(?\\d{1,4}\\)?[-\\s./\\d]*"'],message:"Please enter a valid phone number"}};function dz($){G9[$.name]=$}function JY($,Z,X={}){let J=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=m3(Q),q=G9[G.name];if(!q){console.warn(`Unknown validation rule: ${G.name}`);continue}let W=q.validate($,G.params||[],X);if(W!==!0)J.push(W)}return{valid:J.length===0,errors:J}}function mz($,Z){let X={},J=!0;for(let[Y,Q]of Object.entries(Z)){let G=JY($[Y],Q,$);if(!G.valid)J=!1,X[Y]=G.errors}return{valid:J,errors:X}}function lz($,Z){let X=JSON.stringify(Z);return`
3268
3268
  <script>
3269
3269
  (function() {
3270
3270
  const form = document.getElementById('${$}');
@@ -3316,8 +3316,8 @@ catch { return 'Please enter a valid URL'; } },
3316
3316
  }
3317
3317
  });
3318
3318
  })();
3319
- </script>`.trim()}import c3 from"path";var A5;async function YY(){if(A5!==void 0)return A5;try{A5=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{A5=null}return A5}var n3={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},y0={},n0={},J1={};function nz($){if($)delete y0[$];else for(let Z of Object.keys(y0))delete y0[Z]}function sz(){let $=Object.entries(y0).map(([Z,X])=>({locale:Z,loadedAt:new Date(X.loadedAt),keyCount:W9(X.translations)}));return{size:Object.keys(y0).length,locales:Object.keys(y0),entries:$}}function W9($,Z=0){for(let X of Object.values($))if(Z++,X&&typeof X==="object"&&!Array.isArray(X))Z=W9(X,Z);return Z}function QY($,Z=0){if(Z<=0)return!1;return Date.now()-$.loadedAt>Z}function oz($){if(y0[$])return"loaded";return J1[$]||"idle"}function rz($){return J1[$]==="loading"}function az($){return!!y0[$]}async function GY($,Z){let{locales:X,parallel:J=!0,priority:Y={},onLocaleLoaded:Q,onComplete:G,onError:q}=$,W=J?X:[...X].sort((K,U)=>(Y[U]||0)-(Y[K]||0));if(J){let K=W.map(async(U)=>{try{await _$(U,Z),Q?.(U)}catch(z){q?.(U,z instanceof Error?z:Error(String(z)))}});await Promise.all(K)}else for(let K of W)try{await _$(K,Z),Q?.(K)}catch(U){q?.(K,U instanceof Error?U:Error(String(U)))}G?.()}function tz($,Z){queueMicrotask(()=>{GY($,Z).catch((X)=>{if(Z.debug)console.error("Background preload error:",X)})})}async function _$($,Z){if({...n3,...Z.i18n}.cache&&y0[$]){let Y=y0[$],Q=Z.i18n?.cacheMaxAge??0;if(!QY(Y,Q))return Y.translations}if(n0[$]?.state==="loading")return n0[$].promise;J1[$]="loading";let J=p3($,Z).then((Y)=>{return J1[$]="loaded",delete n0[$],Y}).catch((Y)=>{throw J1[$]="error",n0[$]={promise:J,state:"error",error:Y instanceof Error?Y:Error(String(Y))},Y});return n0[$]={promise:J,state:"loading"},J}function qY($){return y0[$]?.translations}async function ez($,Z){let X=qY($);if(X)return X;return _$($,Z)}async function $H($,Z){if(y0[$])return y0[$].translations;if(n0[$]){if(Z)return Promise.race([n0[$].promise,new Promise((X,J)=>setTimeout(()=>J(Error(`Timeout waiting for locale: ${$}`)),Z))]);return n0[$].promise}throw Error(`Locale "${$}" is not loading. Call loadTranslationLazy first.`)}function ZH(){return Object.entries(J1).filter(([$,Z])=>Z==="loading").map(([$])=>$)}function XH($){if($)delete n0[$],delete J1[$];else{for(let Z of Object.keys(n0))delete n0[Z];for(let Z of Object.keys(J1))delete J1[Z]}}async function p3($,Z){let X={...n3,...Z.i18n},J=c3.isAbsolute(X.translationsDir)?X.translationsDir:c3.resolve(Z.root||process.cwd(),X.translationsDir);try{let Y=await YY(),Q=Y?await Y($,{translationsDir:J,defaultLocale:X.defaultLocale,sources:HY(X.format)}):await WY($,X,J);if(Q===void 0){if($!==X.defaultLocale)return p3(X.defaultLocale,Z);return{}}let G=Q;if(X.cache)y0[$]={translations:G,loadedAt:Date.now(),locale:$};return G}catch(Y){if(Z.debug)console.error(`Error loading translation file for locale "${$}":`,Y);if($!==X.defaultLocale)return p3(X.defaultLocale,Z);return{}}}async function WY($,Z,X){let J=c3.join(X,`${$}${KY(Z.format)}`);try{let Y=await import(J);return Y.default||Y}catch(Y){try{let Q=await Bun.file(J).text();if(Z.format==="yaml"||Z.format==="yml")return UY(Q);if(Z.format==="json")return JSON.parse(Q);throw Y}catch{return}}}function KY($){switch($){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function UY($){let Z={},X=$.split(`
3320
- `),J=[{obj:Z,indent:-1}];for(let Y of X){let Q=Y.replace(/#.*$/,"").trimEnd();if(!Q.trim())continue;let G=Q.search(/\S/);if(G===-1)continue;while(J.length>1&&J[J.length-1].indent>=G)J.pop();let q=J[J.length-1].obj,W=Q.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(W){let[,,K,U]=W,z=K.trim(),H=U.trim();if(H==="")q[z]={},J.push({obj:q[z],indent:G});else q[z]=zY(H)}}return Z}function zY($){if($.startsWith("'")&&$.endsWith("'")||$.startsWith('"')&&$.endsWith('"'))return $.slice(1,-1);let Z=$.toLowerCase();if(Z==="true"||Z==="yes")return!0;if(Z==="false"||Z==="no")return!1;if(Z==="null"||Z==="~")return null;let X=Number($);if(!Number.isNaN(X)&&$!=="")return X;return $}function HY($){switch($){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function jY($,Z){return _$($,Z)}function BY($,Z){for(let X of $){let J=X.trim(),Y=J.match(/^\{(\d+)\}\s*(.*)$/);if(Y){let G=Number.parseInt(Y[1],10);if(Z===G)return Y[2];continue}let Q=J.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(Q){let G=Number.parseInt(Q[1],10),q=Q[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(Q[2],10);if(Z>=G&&Z<=q)return Q[3];continue}}if($.length===2)return Z===1?$[0].trim():$[1].trim();if(Z<$.length)return $[Z].trim();return $[$.length-1].trim()}function _Y($,Z={}){return K9($,Z)}function K9($,Z){let X="",J=0;while(J<$.length)if($[J]==="{"){let Y=VY($,J);if(Y===-1){X+=$[J],J++;continue}let Q=$.slice(J+1,Y);X+=OY(Q,Z),J=Y+1}else if($[J]==="'"&&J+1<$.length)if($[J+1]==="'")X+="'",J+=2;else if($[J+1]==="{"||$[J+1]==="}")X+=$[J+1],J+=2;else X+=$[J],J++;else X+=$[J],J++;return X}function VY($,Z){let X=0;for(let J=Z;J<$.length;J++)if($[J]==="{")X++;else if($[J]==="}"){if(X--,X===0)return J}return-1}function OY($,Z){let X=FY($);if(X.length===0)return`{${$}}`;let J=X[0].trim(),Y=Z[J];if(X.length===1)return Y!==void 0?String(Y):`{${J}}`;switch(X[1].trim().toLowerCase()){case"plural":return LY(Y,X.slice(2).join(","),Z);case"select":return RY(Y,X.slice(2).join(","));case"selectordinal":return DY(Y,X.slice(2).join(","));case"number":return AY(Y,X[2]?.trim());case"date":return MY(Y,X[2]?.trim());case"time":return kY(Y,X[2]?.trim());default:return Y!==void 0?String(Y):`{${$}}`}}function FY($){let Z=[],X="",J=0;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if(Q==="{")J++,X+=Q;else if(Q==="}")J--,X+=Q;else if(Q===","&&J===0)Z.push(X),X="";else X+=Q}if(X)Z.push(X);return Z}function LY($,Z,X){let J=Number($)||0,Y=s3(Z),Q=`=${J}`;if(Y[Q])return l3(Y[Q],J,X);let G=wY(J);if(Y[G])return l3(Y[G],J,X);if(Y.other)return l3(Y.other,J,X);return String(J)}function l3($,Z,X){let J=$.replace(/#/g,String(Z));return K9(J,X)}function wY($){let Z=Math.abs($),X=Math.floor(Z),J=String($).includes(".")?String($).split(".")[1].length:0;if(X===1&&J===0)return"one";return"other"}function RY($,Z){let X=String($||""),J=s3(Z);if(J[X])return J[X];return J.other||String($)}function DY($,Z){let X=Number($)||0,J=s3(Z),Y=NY(X);if(J[Y])return J[Y].replace(/#/g,String(X));if(J.other)return J.other.replace(/#/g,String(X));return String(X)}function NY($){let Z=Math.abs($),X=Z%10,J=Z%100;if(X===1&&J!==11)return"one";if(X===2&&J!==12)return"two";if(X===3&&J!==13)return"few";return"other"}function s3($){let Z={},X=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,J=X.exec($);while(J!==null)Z[J[1]]=J[2],J=X.exec($);return Z}function AY($,Z){let X=Number($);if(Number.isNaN(X))return String($);switch(Z){case"integer":return Math.floor(X).toLocaleString();case"percent":return`${(X*100).toFixed(0)}%`;case"currency":return X.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return X.toLocaleString()}}function MY($,Z){let X=$ instanceof Date?$:new Date(String($));if(Number.isNaN(X.getTime()))return String($);let J={};switch(Z){case"short":J.dateStyle="short";break;case"medium":J.dateStyle="medium";break;case"long":J.dateStyle="long";break;case"full":J.dateStyle="full";break;default:J.dateStyle="medium"}return X.toLocaleDateString(void 0,J)}function kY($,Z){let X=$ instanceof Date?$:new Date(String($));if(Number.isNaN(X.getTime()))return String($);let J={};switch(Z){case"short":J.timeStyle="short";break;case"medium":J.timeStyle="medium";break;case"long":J.timeStyle="long";break;case"full":J.timeStyle="full";break;default:J.timeStyle="short"}return X.toLocaleTimeString(void 0,J)}function IY($){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test($)}function i3($,Z,X=!0,J={}){let Y=$.split("."),Q=Z;for(let q of Y){if(Q===void 0||Q===null)break;Q=Q[q]}if(Q===void 0||Q===null)return X?$:"";let G=String(Q);if(IY(G))return _Y(G,J);if(G.includes("|")&&"count"in J){let q=Number(J.count),W=G.split("|");G=BY(W,q)}for(let[q,W]of Object.entries(J)){let K=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");G=G.replace(new RegExp(`:${K}`,"g"),String(W))}return G}async function U9($,Z,X,J){let Y=$,Q=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,G={...n3,...J.i18n},q=await jY(G.locale,J);Z.__translations=q,Z.__locale=G.locale,Z.__i18nConfig=G,Y=await q9(Y,Q,async(U,z,H,j,B)=>{try{let _={};if(H)try{let V=[()=>JSON.parse(H),()=>{let O=`{"data":${H}}`,F=JSON.parse(O);return typeof F.data==="object"?F.data:{}},()=>{return R0(H,Z)}];for(let O of V)try{if(_=O(),Object.keys(_).length>0)break}catch{}}catch(V){if(J.debug)console.error("Error parsing parameters for @translate directive:",V)}return i3(z,q,G.fallbackToKey,_)||j.trim()}catch(_){if(J.debug)console.error("Error processing @translate directive:",_);return $0("Translate",`Error in @translate('${z}'): ${_ instanceof Error?_.message:String(_)}`,l.EVALUATION_ERROR)}});let W=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(J.debug){console.warn(`Processing translations in template. Sections: ${Y.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let U=[...Y.matchAll(W)];console.warn(`Found ${U.length} @translate matches`),U.forEach((z,H)=>console.warn(`Match ${H}: ${z[0]}, Key: ${z[1]}, Params: ${z[2]||"none"}`))}return Y=await q9(Y,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(U,z,H,j)=>{try{let B={};if(H)try{let _=[()=>JSON.parse(H),()=>{let L=`{"data":${H}}`,V=JSON.parse(L);return typeof V.data==="object"?V.data:{}},()=>{return R0(H,Z)}];for(let L of _)try{if(B=L(),Object.keys(B).length>0)break}catch{}}catch(_){if(J.debug)console.error("Error parsing parameters for @translate directive:",_)}return i3(z,q,G.fallbackToKey,B)}catch(B){if(J.debug)console.error("Error processing @translate directive:",B);return $0("Translate",`Error in @translate('${z}'): ${B instanceof Error?B.message:String(B)}`,l.EVALUATION_ERROR)}}),Y}async function q9($,Z,X){let J=[];return $.replace(Z,(Q,...G)=>{let q=X(Q,...G).then((W)=>({match:Q,replacement:W}));return J.push(q),Q}),(await Promise.all(J)).reduce((Q,{match:G,replacement:q})=>Q.replace(G,q),$)}function JH($,Z=!0){return(X,J={})=>{return i3(X,$,Z,J)}}var M5=/<\/?template\b[^>]*>/gi,TY=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function EY($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return TY.test(Z)}function V$($){M5.lastIndex=0;let Z;while((Z=M5.exec($))!==null){if(Z[0].startsWith("</")||EY(Z[0]))continue;let X=Z.index,J=M5.lastIndex,Y=1,Q;while((Q=M5.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:X,openEnd:J,closeStart:G,end:M5.lastIndex,content:$.slice(J,G)}}}else Y++;return null}return null}import z0 from"path";function o3($,Z){let X=0;for(let J=Z;J<$.length;J++){let Y=$[J];if(Y==="("||Y==="["||Y==="{")X++;else if(Y===")"||Y==="]"||Y==="}")X--;else if(Y===","&&X===0)return J}return-1}function bY($,Z,X){let J=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),Q=Y.exec(J);while(Q){let G=Q.index,q=G+Q[0].length-1,W=1,K=q+1;while(K<J.length&&W>0){if(J[K]==="(")W++;else if(J[K]===")")W--;K++}if(W!==0)break;let U=J.substring(q+1,K-1),z=`${X}(${U})`;J=J.substring(0,G)+z+J.substring(K),Y.lastIndex=G+z.length,Q=Y.exec(J)}return J}function yY($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function H9($){let Z=$,X=[],J=new Set,Y=0,Q=0,G=Z.length,q=(z)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===z){Q++;return}Q++}},W=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let z=1;while(Q<G&&z>0)if(Z[Q]==="{")z++,Q++;else if(Z[Q]==="}")z--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')q(Z[Q]);else if(Z[Q]==="`")W();else Q++;continue}Q++}},K=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3319
+ </script>`.trim()}import c3 from"path";var A5;async function YY(){if(A5!==void 0)return A5;try{A5=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{A5=null}return A5}var n3={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},y0={},n0={},J1={};function sz($){if($)delete y0[$];else for(let Z of Object.keys(y0))delete y0[Z]}function oz(){let $=Object.entries(y0).map(([Z,X])=>({locale:Z,loadedAt:new Date(X.loadedAt),keyCount:W9(X.translations)}));return{size:Object.keys(y0).length,locales:Object.keys(y0),entries:$}}function W9($,Z=0){for(let X of Object.values($))if(Z++,X&&typeof X==="object"&&!Array.isArray(X))Z=W9(X,Z);return Z}function QY($,Z=0){if(Z<=0)return!1;return Date.now()-$.loadedAt>Z}function rz($){if(y0[$])return"loaded";return J1[$]||"idle"}function az($){return J1[$]==="loading"}function tz($){return!!y0[$]}async function GY($,Z){let{locales:X,parallel:J=!0,priority:Y={},onLocaleLoaded:Q,onComplete:G,onError:q}=$,W=J?X:[...X].sort((K,U)=>(Y[U]||0)-(Y[K]||0));if(J){let K=W.map(async(U)=>{try{await _$(U,Z),Q?.(U)}catch(z){q?.(U,z instanceof Error?z:Error(String(z)))}});await Promise.all(K)}else for(let K of W)try{await _$(K,Z),Q?.(K)}catch(U){q?.(K,U instanceof Error?U:Error(String(U)))}G?.()}function ez($,Z){queueMicrotask(()=>{GY($,Z).catch((X)=>{if(Z.debug)console.error("Background preload error:",X)})})}async function _$($,Z){if({...n3,...Z.i18n}.cache&&y0[$]){let Y=y0[$],Q=Z.i18n?.cacheMaxAge??0;if(!QY(Y,Q))return Y.translations}if(n0[$]?.state==="loading")return n0[$].promise;J1[$]="loading";let J=p3($,Z).then((Y)=>{return J1[$]="loaded",delete n0[$],Y}).catch((Y)=>{throw J1[$]="error",n0[$]={promise:J,state:"error",error:Y instanceof Error?Y:Error(String(Y))},Y});return n0[$]={promise:J,state:"loading"},J}function qY($){return y0[$]?.translations}async function $H($,Z){let X=qY($);if(X)return X;return _$($,Z)}async function ZH($,Z){if(y0[$])return y0[$].translations;if(n0[$]){if(Z)return Promise.race([n0[$].promise,new Promise((X,J)=>setTimeout(()=>J(Error(`Timeout waiting for locale: ${$}`)),Z))]);return n0[$].promise}throw Error(`Locale "${$}" is not loading. Call loadTranslationLazy first.`)}function XH(){return Object.entries(J1).filter(([$,Z])=>Z==="loading").map(([$])=>$)}function JH($){if($)delete n0[$],delete J1[$];else{for(let Z of Object.keys(n0))delete n0[Z];for(let Z of Object.keys(J1))delete J1[Z]}}async function p3($,Z){let X={...n3,...Z.i18n},J=c3.isAbsolute(X.translationsDir)?X.translationsDir:c3.resolve(Z.root||process.cwd(),X.translationsDir);try{let Y=await YY(),Q=Y?await Y($,{translationsDir:J,defaultLocale:X.defaultLocale,sources:HY(X.format)}):await WY($,X,J);if(Q===void 0){if($!==X.defaultLocale)return p3(X.defaultLocale,Z);return{}}let G=Q;if(X.cache)y0[$]={translations:G,loadedAt:Date.now(),locale:$};return G}catch(Y){if(Z.debug)console.error(`Error loading translation file for locale "${$}":`,Y);if($!==X.defaultLocale)return p3(X.defaultLocale,Z);return{}}}async function WY($,Z,X){let J=c3.join(X,`${$}${KY(Z.format)}`);try{let Y=await import(J);return Y.default||Y}catch(Y){try{let Q=await Bun.file(J).text();if(Z.format==="yaml"||Z.format==="yml")return UY(Q);if(Z.format==="json")return JSON.parse(Q);throw Y}catch{return}}}function KY($){switch($){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function UY($){let Z={},X=$.split(`
3320
+ `),J=[{obj:Z,indent:-1}];for(let Y of X){let Q=Y.replace(/#.*$/,"").trimEnd();if(!Q.trim())continue;let G=Q.search(/\S/);if(G===-1)continue;while(J.length>1&&J[J.length-1].indent>=G)J.pop();let q=J[J.length-1].obj,W=Q.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(W){let[,,K,U]=W,z=K.trim(),H=U.trim();if(H==="")q[z]={},J.push({obj:q[z],indent:G});else q[z]=zY(H)}}return Z}function zY($){if($.startsWith("'")&&$.endsWith("'")||$.startsWith('"')&&$.endsWith('"'))return $.slice(1,-1);let Z=$.toLowerCase();if(Z==="true"||Z==="yes")return!0;if(Z==="false"||Z==="no")return!1;if(Z==="null"||Z==="~")return null;let X=Number($);if(!Number.isNaN(X)&&$!=="")return X;return $}function HY($){switch($){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function jY($,Z){return _$($,Z)}function BY($,Z){for(let X of $){let J=X.trim(),Y=J.match(/^\{(\d+)\}\s*(.*)$/);if(Y){let G=Number.parseInt(Y[1],10);if(Z===G)return Y[2];continue}let Q=J.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(Q){let G=Number.parseInt(Q[1],10),q=Q[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(Q[2],10);if(Z>=G&&Z<=q)return Q[3];continue}}if($.length===2)return Z===1?$[0].trim():$[1].trim();if(Z<$.length)return $[Z].trim();return $[$.length-1].trim()}function _Y($,Z={}){return K9($,Z)}function K9($,Z){let X="",J=0;while(J<$.length)if($[J]==="{"){let Y=VY($,J);if(Y===-1){X+=$[J],J++;continue}let Q=$.slice(J+1,Y);X+=OY(Q,Z),J=Y+1}else if($[J]==="'"&&J+1<$.length)if($[J+1]==="'")X+="'",J+=2;else if($[J+1]==="{"||$[J+1]==="}")X+=$[J+1],J+=2;else X+=$[J],J++;else X+=$[J],J++;return X}function VY($,Z){let X=0;for(let J=Z;J<$.length;J++)if($[J]==="{")X++;else if($[J]==="}"){if(X--,X===0)return J}return-1}function OY($,Z){let X=FY($);if(X.length===0)return`{${$}}`;let J=X[0].trim(),Y=Z[J];if(X.length===1)return Y!==void 0?String(Y):`{${J}}`;switch(X[1].trim().toLowerCase()){case"plural":return LY(Y,X.slice(2).join(","),Z);case"select":return RY(Y,X.slice(2).join(","));case"selectordinal":return DY(Y,X.slice(2).join(","));case"number":return AY(Y,X[2]?.trim());case"date":return MY(Y,X[2]?.trim());case"time":return kY(Y,X[2]?.trim());default:return Y!==void 0?String(Y):`{${$}}`}}function FY($){let Z=[],X="",J=0;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if(Q==="{")J++,X+=Q;else if(Q==="}")J--,X+=Q;else if(Q===","&&J===0)Z.push(X),X="";else X+=Q}if(X)Z.push(X);return Z}function LY($,Z,X){let J=Number($)||0,Y=s3(Z),Q=`=${J}`;if(Y[Q])return l3(Y[Q],J,X);let G=wY(J);if(Y[G])return l3(Y[G],J,X);if(Y.other)return l3(Y.other,J,X);return String(J)}function l3($,Z,X){let J=$.replace(/#/g,String(Z));return K9(J,X)}function wY($){let Z=Math.abs($),X=Math.floor(Z),J=String($).includes(".")?String($).split(".")[1].length:0;if(X===1&&J===0)return"one";return"other"}function RY($,Z){let X=String($||""),J=s3(Z);if(J[X])return J[X];return J.other||String($)}function DY($,Z){let X=Number($)||0,J=s3(Z),Y=NY(X);if(J[Y])return J[Y].replace(/#/g,String(X));if(J.other)return J.other.replace(/#/g,String(X));return String(X)}function NY($){let Z=Math.abs($),X=Z%10,J=Z%100;if(X===1&&J!==11)return"one";if(X===2&&J!==12)return"two";if(X===3&&J!==13)return"few";return"other"}function s3($){let Z={},X=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,J=X.exec($);while(J!==null)Z[J[1]]=J[2],J=X.exec($);return Z}function AY($,Z){let X=Number($);if(Number.isNaN(X))return String($);switch(Z){case"integer":return Math.floor(X).toLocaleString();case"percent":return`${(X*100).toFixed(0)}%`;case"currency":return X.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return X.toLocaleString()}}function MY($,Z){let X=$ instanceof Date?$:new Date(String($));if(Number.isNaN(X.getTime()))return String($);let J={};switch(Z){case"short":J.dateStyle="short";break;case"medium":J.dateStyle="medium";break;case"long":J.dateStyle="long";break;case"full":J.dateStyle="full";break;default:J.dateStyle="medium"}return X.toLocaleDateString(void 0,J)}function kY($,Z){let X=$ instanceof Date?$:new Date(String($));if(Number.isNaN(X.getTime()))return String($);let J={};switch(Z){case"short":J.timeStyle="short";break;case"medium":J.timeStyle="medium";break;case"long":J.timeStyle="long";break;case"full":J.timeStyle="full";break;default:J.timeStyle="short"}return X.toLocaleTimeString(void 0,J)}function IY($){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test($)}function i3($,Z,X=!0,J={}){let Y=$.split("."),Q=Z;for(let q of Y){if(Q===void 0||Q===null)break;Q=Q[q]}if(Q===void 0||Q===null)return X?$:"";let G=String(Q);if(IY(G))return _Y(G,J);if(G.includes("|")&&"count"in J){let q=Number(J.count),W=G.split("|");G=BY(W,q)}for(let[q,W]of Object.entries(J)){let K=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");G=G.replace(new RegExp(`:${K}`,"g"),String(W))}return G}async function U9($,Z,X,J){let Y=$,Q=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,G={...n3,...J.i18n},q=await jY(G.locale,J);Z.__translations=q,Z.__locale=G.locale,Z.__i18nConfig=G,Y=await q9(Y,Q,async(U,z,H,j,B)=>{try{let _={};if(H)try{let V=[()=>JSON.parse(H),()=>{let O=`{"data":${H}}`,F=JSON.parse(O);return typeof F.data==="object"?F.data:{}},()=>{return R0(H,Z)}];for(let O of V)try{if(_=O(),Object.keys(_).length>0)break}catch{}}catch(V){if(J.debug)console.error("Error parsing parameters for @translate directive:",V)}return i3(z,q,G.fallbackToKey,_)||j.trim()}catch(_){if(J.debug)console.error("Error processing @translate directive:",_);return $0("Translate",`Error in @translate('${z}'): ${_ instanceof Error?_.message:String(_)}`,l.EVALUATION_ERROR)}});let W=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(J.debug){console.warn(`Processing translations in template. Sections: ${Y.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let U=[...Y.matchAll(W)];console.warn(`Found ${U.length} @translate matches`),U.forEach((z,H)=>console.warn(`Match ${H}: ${z[0]}, Key: ${z[1]}, Params: ${z[2]||"none"}`))}return Y=await q9(Y,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(U,z,H,j)=>{try{let B={};if(H)try{let _=[()=>JSON.parse(H),()=>{let L=`{"data":${H}}`,V=JSON.parse(L);return typeof V.data==="object"?V.data:{}},()=>{return R0(H,Z)}];for(let L of _)try{if(B=L(),Object.keys(B).length>0)break}catch{}}catch(_){if(J.debug)console.error("Error parsing parameters for @translate directive:",_)}return i3(z,q,G.fallbackToKey,B)}catch(B){if(J.debug)console.error("Error processing @translate directive:",B);return $0("Translate",`Error in @translate('${z}'): ${B instanceof Error?B.message:String(B)}`,l.EVALUATION_ERROR)}}),Y}async function q9($,Z,X){let J=[];return $.replace(Z,(Q,...G)=>{let q=X(Q,...G).then((W)=>({match:Q,replacement:W}));return J.push(q),Q}),(await Promise.all(J)).reduce((Q,{match:G,replacement:q})=>Q.replace(G,q),$)}function YH($,Z=!0){return(X,J={})=>{return i3(X,$,Z,J)}}var M5=/<\/?template\b[^>]*>/gi,TY=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function EY($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return TY.test(Z)}function V$($){M5.lastIndex=0;let Z;while((Z=M5.exec($))!==null){if(Z[0].startsWith("</")||EY(Z[0]))continue;let X=Z.index,J=M5.lastIndex,Y=1,Q;while((Q=M5.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:X,openEnd:J,closeStart:G,end:M5.lastIndex,content:$.slice(J,G)}}}else Y++;return null}return null}import z0 from"path";function o3($,Z){let X=0;for(let J=Z;J<$.length;J++){let Y=$[J];if(Y==="("||Y==="["||Y==="{")X++;else if(Y===")"||Y==="]"||Y==="}")X--;else if(Y===","&&X===0)return J}return-1}function bY($,Z,X){let J=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),Q=Y.exec(J);while(Q){let G=Q.index,q=G+Q[0].length-1,W=1,K=q+1;while(K<J.length&&W>0){if(J[K]==="(")W++;else if(J[K]===")")W--;K++}if(W!==0)break;let U=J.substring(q+1,K-1),z=`${X}(${U})`;J=J.substring(0,G)+z+J.substring(K),Y.lastIndex=G+z.length,Q=Y.exec(J)}return J}function yY($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function H9($){let Z=$,X=[],J=new Set,Y=0,Q=0,G=Z.length,q=(z)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===z){Q++;return}Q++}},W=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let z=1;while(Q<G&&z>0)if(Z[Q]==="{")z++,Q++;else if(Z[Q]==="}")z--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')q(Z[Q]);else if(Z[Q]==="`")W();else Q++;continue}Q++}},K=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3321
3321
  `)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},U=()=>{if(Y!==0)return;let z=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(z){let B=z[2];if(!J.has(B))X.push(B),J.add(B);return}let H=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))X.push(B),J.add(B);return}let j=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))X.push(B),J.add(B)}};while(Q<G){if(K())continue;if(Z[Q]==="'"||Z[Q]==='"'){q(Z[Q]);continue}if(Z[Q]==="`"){W();continue}if(Z[Q]==="{"){Y++,Q++;continue}if(Z[Q]==="}"){Y--,Q++;continue}if(Y===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))U();Q++}return X.join(", ")}function j9($,Z=""){let X=H9($).split(",").map((J)=>J.trim()).filter(Boolean);return`
3322
3322
  (function() {
3323
3323
  ${c1("var",X)}
@@ -3352,9 +3352,9 @@ ${H9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3352
3352
  } finally {
3353
3353
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3354
3354
  }
3355
- })();`}function CY($,Z){if(q1($)){let Y=q1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:v1($,(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],q=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${q}${$.slice(X[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var z9=0,OH=new p1(500),_9=new Set;function FH(){_9.clear()}function PY($){if($.__onceStore instanceof Set)return $.__onceStore;return _9}async function r3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||z0.join(z0.dirname(X),"partials");if(G&&!z0.isAbsolute(G))G=z0.resolve(process.cwd(),G);let q=bY($,"@partial","@include"),W=PY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,L,V)=>{let O=L.trim(),F=`${X}:${O}`;if(W.has(F))return"";return W.add(F),L});{let _=/@includeIf\s*\(/g,L;while((L=_.exec(q))!==null){let V=L.index,O=V+L[0].length-1,F=1,w=O+1;while(w<q.length&&F>0){if(q[w]==="(")F++;else if(q[w]===")")F--;w++}if(F!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],k=K(N,G,X),A="";if(k&&await Bun.file(k).exists())Y.add(k),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,L]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let F=O.index,w=F+O[0].length-1,R=1,D=w+1;while(D<q.length&&R>0){if(q[D]==="(")R++;else if(q[D]===")")R--;D++}if(R!==0)break;let N=q.substring(w+1,D-1),k=o3(N,0);if(k===-1){V.lastIndex=D;continue}let A=N.substring(0,k).trim(),M=N.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=o3(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let S=`Boolean(${A})`,v;if(q0(S)){let g=W0(S,Object.keys(Z));v=Boolean(g(...Object.values(Z)))}else v=Boolean(e(S,Z));let x=L?!v:v,d="";if(x){let g=K(I,G,X);if(g&&await Bun.file(g).exists())Y.add(g);d=`@include('${I}'${E?`, ${E}`:""})`}q=q.substring(0,F)+d+q.substring(D),V.lastIndex=0}catch(S){let v=S instanceof Error?S.message:String(S),x=j0("Include",`Error evaluating ${_} condition: ${v}`,X,$,F);q=q.substring(0,F)+x+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,L;while((L=_.exec(q))!==null){let V=L.index,O=V+L[0].length-1,F=1,w=O+1;while(w<q.length&&F>0){if(q[w]==="(")F++;else if(q[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let[,k,A,M,T]=N;try{let I,y=A.trim();if(q0(y))I=W0(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 S={...Z,[M]:b},v=await H(k,S,$,V);E+=v}else if(T)E=await H(T,{},$,V);q=q.substring(0,V)+E+q.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);q=q.substring(0,V)+j0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,L;while((L=_.exec(q))!==null){let V=L.index,O=V+L[0].length-1,F=1,w=O+1;while(w<q.length&&F>0){if(q[w]==="(")F++;else if(q[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let k=N[1],A=R.slice(N[0].length),M,T=A.match(/^\s*,\s*\{/);if(T){A=A.slice(T[0].length-1);let E=1,b=1;while(b<A.length&&E>0){if(A[b]==="{")E++;else if(A[b]==="}"){if(E--,E===0)break}b++}M=A.substring(0,b+1),A=A.slice(b+1)}let I,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let E=JSON.parse(k.replace(/'/g,'"')),b={};if(M)try{b=R0(M,Z)}catch(v){let x=v instanceof Error?v.message:String(v);if(J.debug){let d=j0("Include",`Error parsing includeFirst variables: ${x}`,X,$,V,D);q=q.replace(D,()=>d)}else q=q.replace(D,()=>I||"");continue}let S=!1;for(let v of E){let x=K(v,G,X);if(!x)continue;if(await t(x)){let d=await H(v,b,$,V);q=q.replace(D,()=>d),S=!0;break}}if(!S)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let v=j0("Include",`None of the includeFirst paths exist: ${k}`,X,$,V,D);q=q.replace(D,()=>v)}else q=q.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),S=j0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>S)}_.lastIndex=0}}function K(_,L,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let F=z0.resolve(L),w=z0.resolve(z0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=z0.resolve(L,O);else R=z0.resolve(w,O);let D=z0.normalize(R),N=D.startsWith(F+z0.sep)||D===F,k=D.startsWith(w+z0.sep)||D===w,A=!1,M=z0.dirname(w);if(D.startsWith(M+z0.sep)){if(!z0.relative(M,D).split(z0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))A=!0}if(!N&&!k&&!A)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(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let U=z0.resolve(X);Q.add(U);function z(_,L,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:L,partialsDir:G}),j0("Include",L,X,V,O)}async function H(_,L={},V,O){let F=K(_,G,X);if(!F)return z(_,`Could not resolve path for include: ${_}`,V,O);let w=z0.resolve(F);if(Q.has(w)){let R=[...Q,w].map((D)=>z0.basename(D)).join(" -> ");return z(_,`Circular include detected: ${R}`,V,O)}try{Y.add(F);let R;if(!R)try{R=await Bun.file(F).text()}catch(x){let d=x instanceof Error?x.message:String(x);return z(_,`Error loading include file ${_}: ${d}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:x}=await import("./chunk-7fs8qzdd.js");R=x(R,Z)}if(R&&(J.debug||!O5()&&!Z$()))try{let{warnUnbalancedTags:x}=await import("./chunk-6nar1v2y.js");x(R,F)}catch{}let D=R;try{let{processESImports:x}=await import("./chunk-zvygp42b.js");await x(R,Z,F,J,Y)}catch(x){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${F}:`,x instanceof Error?x.message:x)}let N=V$(D);if(N)D=N.content.trim();let A=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(A)M=`<style${A[1]}>${A[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=G1(R,F);for(let[x,d]of Object.entries(L))T[x]=d;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],E="",b=null;for(let x of y){let d=x[1]||"",g=x[2]||"",X0=d.includes("server"),e0=A1(d);if(!X0&&g.trim()){let{interpolateScriptExpressions:J0}=await import("./chunk-bab9k1e8.js");g=J0(g,T)}let k0="";try{let{extractAndStripCssImports:J0,renderVendorStyleTags:H0}=await import("./chunk-qkhw6tdx.js"),I0=J0(g,{filePath:F,projectRoot:process.cwd()});g=I0.code,k0=H0(I0.styles)}catch(J0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${F}:`,J0 instanceof Error?J0.message:J0)}if(e0&&g.trim())g=M1(g);if(!X0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-qkhw6tdx.js");g=H0(g).code;let{hasUserImports:I0,bundleClientScript:E0}=await import("./chunk-ertf9176.js");if(I0(g))g=await E0(g,F,{projectRoot:process.cwd()})}catch(H0){if(J.debug)console.warn(`[stx] bundler skipped for ${F}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:J0}=await import("./chunk-5a07gxnz.js");g=J0(g)}let C0=yY(g);if(C0&&!X0){b=`stx_scope_${z0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++z9}`;let J0=$1(g),H0=SY(J0,b);E+=`${k0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3356
- `;continue}if(X0)try{let{extractVariables:J0}=await import("./chunk-man5awsh.js");await J0(g,T,F)}catch(J0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${F}:`,J0)}if(!X0&&!C0){let J0=d.replace(/\bclient\b/i,"").trim();b=`stx_scope_${z0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++z9}`;let H0=$1(g),I0=B9(H0,b),E0=j9(H0,I0);E+=`${k0}<script data-stx-scoped data-stx-run="always"${J0?` ${J0}`:""}>${E0}</script>
3357
- `}}if(b){let x=CY(D,b);if(D=x.html,x.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${x.mergedIntoExisting}']`),b=x.mergedIntoExisting;else if(!x.stamped)console.warn(`[stx] ${z0.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 r3(D,T,F,J,Y,Q);let{processLoops:S}=await import("./chunk-f0z8dy89.js"),v=S(D,T,F);if(v=X1(v,T,F),v=O1(v,T,F),M)v+=`
3355
+ })();`}function CY($,Z){if(q1($)){let Y=q1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:v1($,(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],q=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${q}${$.slice(X[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var z9=0,FH=new p1(500),_9=new Set;function LH(){_9.clear()}function PY($){if($.__onceStore instanceof Set)return $.__onceStore;return _9}async function r3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||z0.join(z0.dirname(X),"partials");if(G&&!z0.isAbsolute(G))G=z0.resolve(process.cwd(),G);let q=bY($,"@partial","@include"),W=PY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,L,V)=>{let O=L.trim(),F=`${X}:${O}`;if(W.has(F))return"";return W.add(F),L});{let _=/@includeIf\s*\(/g,L;while((L=_.exec(q))!==null){let V=L.index,O=V+L[0].length-1,F=1,w=O+1;while(w<q.length&&F>0){if(q[w]==="(")F++;else if(q[w]===")")F--;w++}if(F!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],k=K(N,G,X),A="";if(k&&await Bun.file(k).exists())Y.add(k),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,L]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let F=O.index,w=F+O[0].length-1,R=1,D=w+1;while(D<q.length&&R>0){if(q[D]==="(")R++;else if(q[D]===")")R--;D++}if(R!==0)break;let N=q.substring(w+1,D-1),k=o3(N,0);if(k===-1){V.lastIndex=D;continue}let A=N.substring(0,k).trim(),M=N.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=o3(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let S=`Boolean(${A})`,v;if(q0(S)){let g=W0(S,Object.keys(Z));v=Boolean(g(...Object.values(Z)))}else v=Boolean(e(S,Z));let x=L?!v:v,d="";if(x){let g=K(I,G,X);if(g&&await Bun.file(g).exists())Y.add(g);d=`@include('${I}'${E?`, ${E}`:""})`}q=q.substring(0,F)+d+q.substring(D),V.lastIndex=0}catch(S){let v=S instanceof Error?S.message:String(S),x=j0("Include",`Error evaluating ${_} condition: ${v}`,X,$,F);q=q.substring(0,F)+x+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,L;while((L=_.exec(q))!==null){let V=L.index,O=V+L[0].length-1,F=1,w=O+1;while(w<q.length&&F>0){if(q[w]==="(")F++;else if(q[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let[,k,A,M,T]=N;try{let I,y=A.trim();if(q0(y))I=W0(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 S={...Z,[M]:b},v=await H(k,S,$,V);E+=v}else if(T)E=await H(T,{},$,V);q=q.substring(0,V)+E+q.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);q=q.substring(0,V)+j0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,L;while((L=_.exec(q))!==null){let V=L.index,O=V+L[0].length-1,F=1,w=O+1;while(w<q.length&&F>0){if(q[w]==="(")F++;else if(q[w]===")"){if(F--,F===0)break}w++}if(F!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let k=N[1],A=R.slice(N[0].length),M,T=A.match(/^\s*,\s*\{/);if(T){A=A.slice(T[0].length-1);let E=1,b=1;while(b<A.length&&E>0){if(A[b]==="{")E++;else if(A[b]==="}"){if(E--,E===0)break}b++}M=A.substring(0,b+1),A=A.slice(b+1)}let I,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let E=JSON.parse(k.replace(/'/g,'"')),b={};if(M)try{b=R0(M,Z)}catch(v){let x=v instanceof Error?v.message:String(v);if(J.debug){let d=j0("Include",`Error parsing includeFirst variables: ${x}`,X,$,V,D);q=q.replace(D,()=>d)}else q=q.replace(D,()=>I||"");continue}let S=!1;for(let v of E){let x=K(v,G,X);if(!x)continue;if(await t(x)){let d=await H(v,b,$,V);q=q.replace(D,()=>d),S=!0;break}}if(!S)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let v=j0("Include",`None of the includeFirst paths exist: ${k}`,X,$,V,D);q=q.replace(D,()=>v)}else q=q.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),S=j0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>S)}_.lastIndex=0}}function K(_,L,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let F=z0.resolve(L),w=z0.resolve(z0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=z0.resolve(L,O);else R=z0.resolve(w,O);let D=z0.normalize(R),N=D.startsWith(F+z0.sep)||D===F,k=D.startsWith(w+z0.sep)||D===w,A=!1,M=z0.dirname(w);if(D.startsWith(M+z0.sep)){if(!z0.relative(M,D).split(z0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))A=!0}if(!N&&!k&&!A)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(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let U=z0.resolve(X);Q.add(U);function z(_,L,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:L,partialsDir:G}),j0("Include",L,X,V,O)}async function H(_,L={},V,O){let F=K(_,G,X);if(!F)return z(_,`Could not resolve path for include: ${_}`,V,O);let w=z0.resolve(F);if(Q.has(w)){let R=[...Q,w].map((D)=>z0.basename(D)).join(" -> ");return z(_,`Circular include detected: ${R}`,V,O)}try{Y.add(F);let R;if(!R)try{R=await Bun.file(F).text()}catch(x){let d=x instanceof Error?x.message:String(x);return z(_,`Error loading include file ${_}: ${d}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:x}=await import("./chunk-myk6g2bz.js");R=x(R,Z)}if(R&&(J.debug||!O5()&&!Z$()))try{let{warnUnbalancedTags:x}=await import("./chunk-6nar1v2y.js");x(R,F)}catch{}let D=R;try{let{processESImports:x}=await import("./chunk-0j58q0tb.js");await x(R,Z,F,J,Y)}catch(x){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${F}:`,x instanceof Error?x.message:x)}let N=V$(D);if(N)D=N.content.trim();let A=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(A)M=`<style${A[1]}>${A[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=G1(R,F);for(let[x,d]of Object.entries(L))T[x]=d;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],E="",b=null;for(let x of y){let d=x[1]||"",g=x[2]||"",Q0=d.includes("server"),e0=A1(d);if(!Q0&&g.trim()){let{interpolateScriptExpressions:X0}=await import("./chunk-6s3yxjmr.js");g=X0(g,T)}let k0="";try{let{extractAndStripCssImports:X0,renderVendorStyleTags:H0}=await import("./chunk-br9c5dsn.js"),I0=X0(g,{filePath:F,projectRoot:process.cwd()});g=I0.code,k0=H0(I0.styles)}catch(X0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${F}:`,X0 instanceof Error?X0.message:X0)}if(e0&&g.trim())g=M1(g);if(!Q0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-br9c5dsn.js");g=H0(g).code;let{hasUserImports:I0,bundleClientScript:E0}=await import("./chunk-z3cme6c9.js");if(I0(g))g=await E0(g,F,{projectRoot:process.cwd()})}catch(H0){if(J.debug)console.warn(`[stx] bundler skipped for ${F}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:X0}=await import("./chunk-jrfehndk.js");g=X0(g)}let C0=yY(g);if(C0&&!Q0){b=`stx_scope_${z0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++z9}`;let X0=$1(g),H0=SY(X0,b);E+=`${k0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3356
+ `;continue}if(Q0)try{let{extractVariables:X0}=await import("./chunk-rcfaqy69.js");await X0(g,T,F)}catch(X0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${F}:`,X0)}if(!Q0&&!C0){let X0=d.replace(/\bclient\b/i,"").trim();b=`stx_scope_${z0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++z9}`;let H0=$1(g),I0=B9(H0,b),E0=j9(H0,I0);E+=`${k0}<script data-stx-scoped data-stx-run="always"${X0?` ${X0}`:""}>${E0}</script>
3357
+ `}}if(b){let x=CY(D,b);if(D=x.html,x.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${x.mergedIntoExisting}']`),b=x.mergedIntoExisting;else if(!x.stamped)console.warn(`[stx] ${z0.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 r3(D,T,F,J,Y,Q);let{processLoops:S}=await import("./chunk-grt377yc.js"),v=S(D,T,F);if(v=X1(v,T,F),v=O1(v,T,F),M)v+=`
3358
3358
  `+M;if(E)v+=`
3359
3359
  `+E;return v}catch(R){let D=R instanceof Error?R.message:String(R);return z(_,`Error processing include ${_}: ${D}`,V,O)}}let j=/@include\s*\(/g,B;while((B=j.exec(q))!==null){let _=B.index,L=_+B[0].length-1,V=1,O=L+1;while(O<q.length&&V>0){if(q[O]==="(")V++;else if(q[O]===")")V--;O++}if(V!==0)break;let F=q.substring(_,O),w=q.substring(L+1,O-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=O;continue}let D=R[1],N,k=w.substring(R[0].length),A=o3(k,0);if(A!==-1)N=k.substring(A+1).trim();let M={};if(N)try{M=R0(N,Z)}catch(I){let y=I instanceof Error?I.message:String(I);q=q.replace(F,j0("Include",`Error parsing include variables for ${D}: ${y}`,X,$,_)),j.lastIndex=0;continue}let T=await H(D,M,$,_);q=q.substring(0,_)+T+q.substring(O),j.lastIndex=0}return q}function a3($,Z){let X=$;function J(Y,Q,G,q){let W=Y,K=!0;while(K){K=!1;let U=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),z=W.match(U);if(!z||z.index===void 0)break;let H=z.index,j=z[1],B=H+z[0].length,_=new RegExp(`@${Q}\\(`),L=new RegExp(`@${G}(?![a-z])`),V=1,O=B,F=-1;while(V>0&&O<W.length){let R=W.slice(O),D=R.match(_),N=R.match(L),k=D?O+D.index:1/0,A=N?O+N.index:1/0;if(k<A)V++,O=k+(D[0].length||1);else if(A<1/0){if(V--,V===0){F=A;break}O=A+G.length+1}else break}if(F===-1)break;let w=W.slice(B,F);if(!Z[j])Z[j]=[];if(q)Z[j].unshift(w);else Z[j].push(w);W=W.substring(0,H)+W.substring(F+`@${G}`.length),K=!0}return W}return X=J(X,"push","endpush",!1),X=J(X,"prepend","endprepend",!0),X}function t3($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(X,J)=>{if(!Z[J]||Z[J].length===0)return"";return Z[J].join(`
3360
3360
  `)})}import*as e3 from"path";async function V9($,Z,X=""){if(e3.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 F9($,Z,X,"@js","@endjs")}async function O9($,Z,X=""){if(e3.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 F9($,Z,X,"@ts","@endts")}async function F9($,Z,X,J,Y){let Q=$,G=m1(`${J}([\\s\\S]*?)${Y}`,"g"),q=[],W;while((W=G.exec($))!==null)q.push({fullMatch:W[0],content:W[1]||"",index:W.index});for(let{fullMatch:K,content:U,index:z}of q)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),O=V.length>0?`return { ${V.join(", ")} };`:"return {};",F=`
@@ -3384,7 +3384,7 @@ ${H9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3384
3384
  return result;
3385
3385
  `)(...B);J=J.substring(0,G)+V+J.substring(H),Y=!0}catch(j){let B=$0("While",`Error in @while(${K}): ${j instanceof Error?j.message:String(j)}`,l.EVALUATION_ERROR);J=J.substring(0,G)+B+J.substring(H),Y=!0}}return J}function iY($,Z="_method"){let X=$.toUpperCase();if(X==="GET"||X==="POST")return"";return`<input type="hidden" name="${Z}" value="${X}">`}function I9($){return $.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(Z,X,J,Y,Q)=>{return iY(J,Q||"_method")})}async function T9($,Z,X,J,Y){if(!J.middleware||J.middleware.length===0)return $;let Q=$,G=J.middleware.filter((q)=>q.timing===Y);if(G.length===0)return Q;for(let q of G){if(!q.name||typeof q.handler!=="function"){if(J.debug)console.warn("Invalid middleware:",q);continue}try{let W=await q.handler(Q,Z,X,J);if(typeof W==="string")Q=W;else if(J.debug)console.warn(`Middleware ${q.name} did not return a string`)}catch(W){if(J.debug)console.error(`Error in middleware ${q.name}:`,W);if(J.debug){let K=j0("Middleware",`Error in middleware '${q.name}': ${W instanceof Error?W.message:String(W)}`,X,$);Q=Q.replace(/<body[^>]*>/,`$&
3386
3386
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${i$(K)}</div>
3387
- `)}}}return Q}async function E9($,Z,X,J){return T9($,Z,X,J,"before")}async function b9($,Z,X,J){return T9($,Z,X,J,"after")}j5();j5();function y9($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,X,J,Y,Q)=>{try{let G=Y?R0(Y,{}):{};return $4(J,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var s0={patterns:[],exact:{}};function dH($,Z){if(!s0.exact[$])s0.exact[$]=[];s0.exact[$].push(Z)}function mH($,Z){let X=typeof $==="string"?new RegExp($):$;s0.patterns.push({pattern:X,callback:Z})}async function S9($,Z){let X=$.split("/").pop()?.split(".")[0]||"";if(s0.exact[$])for(let J of s0.exact[$])await Promise.resolve(J(Z,$));if(s0.exact[X])for(let J of s0.exact[X])await Promise.resolve(J(Z,$));for(let{pattern:J,callback:Y}of s0.patterns)if(J.test($)||J.test(X))await Promise.resolve(Y(Z,$))}function lH(){s0.patterns=[],s0.exact={}}var nY=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),sY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function oY($){let Z=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,J;while((J=X.exec($))!==null){let Y=J[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(Y))continue;let Q=J.index,G=Q+J[0].length,q=J[1].toLowerCase();if(J[0].endsWith("/>")||sY.has(q)){Z.push([Q,G]);continue}let W=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`<\\/?${W}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");K.lastIndex=G;let U=1,z=G,H;while((H=K.exec($))!==null)if(H[0].startsWith("</")){if(U--,U===0){z=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))U++;Z.push([Q,z])}return Z}function P9($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>P9(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function v9($,Z){if(!/:[\w-]+=/.test($))return $;let X=$,J=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,Y=[],Q;while((Q=J.exec($))!==null)Y.push([Q.index,Q.index+Q[0].length]);Y.push(...oY($));function G(K){return Y.some(([U,z])=>K>=U&&K<z)}let q=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,W=[];while((Q=q.exec(X))!==null){if(G(Q.index))continue;let K=Q[0],U=Q[2];if(!U||!U.includes(":"))continue;let z=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,H,j=U,B=!1;while((H=z.exec(U))!==null){let _=H[1],L=H[2];if(C9(_))continue;if(L.includes("()")&&!L.includes(".get(")||L.includes("$store")||L.includes("$ref"))continue;try{let V=Object.keys(Z),O=Object.values(Z),F=L.match(/^([a-zA-Z_$][\w$]*)/);if(F&&!V.includes(F[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(F[1]))continue;let R=Function(...V,`return (${L})`)(...O);if(_==="class"){let D=P9(R);if(D){let N=j.match(/\sclass="([^"]*)"/);if(N)j=j.replace(N[0],` class="${N[1]} ${D}"`);else j=j.replace(H[0],` class="${D}"`)}else j=j.replace(H[0],"");B=!0;continue}if(nY.has(_)){if(R)j=j.replace(H[0],` ${_}`);else j=j.replace(H[0],"");B=!0;continue}if(R===null||R===void 0||R===!1)j=j.replace(H[0],"");else{let D=String(R).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");j=j.replace(H[0],` ${_}="${D}"`)}B=!0}catch{continue}}if(B){let _=K.endsWith("/>")?" /":"",V=`<${Q[1]}${j}${_}>`;W.push({start:Q.index,end:Q.index+K.length,replacement:V})}}for(let K=W.length-1;K>=0;K--){let{start:U,end:z,replacement:H}=W[K];X=X.slice(0,U)+H+X.slice(z)}return X}var rY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),aY=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function k1($,Z){let X=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;X.lastIndex=Z;let J=X.exec($);if(!J)return null;let Y=/\/\s*>$/.test(J[0])||J[1]===J[1].toLowerCase()&&rY.has(J[1]),Q=Y?J[2].replace(/\/\s*$/,""):J[2];return{full:J[0],tag:J[1],attrs:Q,selfClosing:Y,start:J.index,end:J.index+J[0].length}}function tY($,Z,X){let J=1,Y=X,Q=new RegExp(`<${Z}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),G=new RegExp(`</${Z}\\s*>`,"gi");while(J>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y;let q=Q.exec($),W=G.exec($);if(!W)return-1;if(q&&q.index<W.index)J++,Y=q.index+q[0].length;else{if(J--,J===0)return W.index+W[0].length;Y=W.index+W[0].length}}return-1}function a0($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let X=tY($,Z.tag,Z.end);if(X===-1)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};return{outerStart:Z.start,outerEnd:X,innerHTML:$.slice(Z.end,X-`</${Z.tag}>`.length)}}function f9($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function i1($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),J=$.match(new RegExp(`${X}="([^"]*)"`,"s"))||$.match(new RegExp(`${X}='([^']*)'`,"s"));return J?J[1]:null}function j1($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return $.replace(new RegExp(`\\s*${X}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${X}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${X}(?=\\s|$|>|/)`,"g"),"")}function B1($,Z,X){let J=Z.selfClosing?" /":"",Y=`<${Z.tag}${X}${J}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function eY($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function $Q($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=i1(J.attrs,"v-for");if(Y===null){X=J.end;continue}let Q=Y.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!Q){X=J.end;continue}let G=Q[1].trim(),q=Q[2].trim(),W;if(G.includes(",")){let L=G.split(",").map((F)=>F.trim()),V=L[0],O=L[1];W=`${q} as ${O} => ${V}`}else W=`${q} as ${G}`;let K=j1(J.attrs,"v-for"),U=j1(K,":key").replace(/\s*v-bind:key="[^"]*"/g,""),z=a0(Z,J),H=Z.slice(z.outerStart,z.outerEnd),j=B1(H,{...J,start:0,end:J.end-J.start},U),B=`@foreach(${W})
3387
+ `)}}}return Q}async function E9($,Z,X,J){return T9($,Z,X,J,"before")}async function b9($,Z,X,J){return T9($,Z,X,J,"after")}j5();j5();function y9($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,X,J,Y,Q)=>{try{let G=Y?R0(Y,{}):{};return $4(J,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var s0={patterns:[],exact:{}};function mH($,Z){if(!s0.exact[$])s0.exact[$]=[];s0.exact[$].push(Z)}function lH($,Z){let X=typeof $==="string"?new RegExp($):$;s0.patterns.push({pattern:X,callback:Z})}async function S9($,Z){let X=$.split("/").pop()?.split(".")[0]||"";if(s0.exact[$])for(let J of s0.exact[$])await Promise.resolve(J(Z,$));if(s0.exact[X])for(let J of s0.exact[X])await Promise.resolve(J(Z,$));for(let{pattern:J,callback:Y}of s0.patterns)if(J.test($)||J.test(X))await Promise.resolve(Y(Z,$))}function cH(){s0.patterns=[],s0.exact={}}var nY=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),sY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function oY($){let Z=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,J;while((J=X.exec($))!==null){let Y=J[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(Y))continue;let Q=J.index,G=Q+J[0].length,q=J[1].toLowerCase();if(J[0].endsWith("/>")||sY.has(q)){Z.push([Q,G]);continue}let W=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`<\\/?${W}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");K.lastIndex=G;let U=1,z=G,H;while((H=K.exec($))!==null)if(H[0].startsWith("</")){if(U--,U===0){z=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))U++;Z.push([Q,z])}return Z}function P9($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>P9(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function v9($,Z){if(!/:[\w-]+=/.test($))return $;let X=$,J=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,Y=[],Q;while((Q=J.exec($))!==null)Y.push([Q.index,Q.index+Q[0].length]);Y.push(...oY($));function G(K){return Y.some(([U,z])=>K>=U&&K<z)}let q=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,W=[];while((Q=q.exec(X))!==null){if(G(Q.index))continue;let K=Q[0],U=Q[2];if(!U||!U.includes(":"))continue;let z=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,H,j=U,B=!1;while((H=z.exec(U))!==null){let _=H[1],L=H[2];if(C9(_))continue;if(L.includes("()")&&!L.includes(".get(")||L.includes("$store")||L.includes("$ref"))continue;try{let V=Object.keys(Z),O=Object.values(Z),F=L.match(/^([a-zA-Z_$][\w$]*)/);if(F&&!V.includes(F[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(F[1]))continue;let R=Function(...V,`return (${L})`)(...O);if(_==="class"){let D=P9(R);if(D){let N=j.match(/\sclass="([^"]*)"/);if(N)j=j.replace(N[0],` class="${N[1]} ${D}"`);else j=j.replace(H[0],` class="${D}"`)}else j=j.replace(H[0],"");B=!0;continue}if(nY.has(_)){if(R)j=j.replace(H[0],` ${_}`);else j=j.replace(H[0],"");B=!0;continue}if(R===null||R===void 0||R===!1)j=j.replace(H[0],"");else{let D=String(R).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");j=j.replace(H[0],` ${_}="${D}"`)}B=!0}catch{continue}}if(B){let _=K.endsWith("/>")?" /":"",V=`<${Q[1]}${j}${_}>`;W.push({start:Q.index,end:Q.index+K.length,replacement:V})}}for(let K=W.length-1;K>=0;K--){let{start:U,end:z,replacement:H}=W[K];X=X.slice(0,U)+H+X.slice(z)}return X}var rY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),aY=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function k1($,Z){let X=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;X.lastIndex=Z;let J=X.exec($);if(!J)return null;let Y=/\/\s*>$/.test(J[0])||J[1]===J[1].toLowerCase()&&rY.has(J[1]),Q=Y?J[2].replace(/\/\s*$/,""):J[2];return{full:J[0],tag:J[1],attrs:Q,selfClosing:Y,start:J.index,end:J.index+J[0].length}}function tY($,Z,X){let J=1,Y=X,Q=new RegExp(`<${Z}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),G=new RegExp(`</${Z}\\s*>`,"gi");while(J>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y;let q=Q.exec($),W=G.exec($);if(!W)return-1;if(q&&q.index<W.index)J++,Y=q.index+q[0].length;else{if(J--,J===0)return W.index+W[0].length;Y=W.index+W[0].length}}return-1}function a0($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let X=tY($,Z.tag,Z.end);if(X===-1)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};return{outerStart:Z.start,outerEnd:X,innerHTML:$.slice(Z.end,X-`</${Z.tag}>`.length)}}function f9($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function i1($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),J=$.match(new RegExp(`${X}="([^"]*)"`,"s"))||$.match(new RegExp(`${X}='([^']*)'`,"s"));return J?J[1]:null}function j1($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return $.replace(new RegExp(`\\s*${X}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${X}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${X}(?=\\s|$|>|/)`,"g"),"")}function B1($,Z,X){let J=Z.selfClosing?" /":"",Y=`<${Z.tag}${X}${J}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function eY($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function $Q($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=i1(J.attrs,"v-for");if(Y===null){X=J.end;continue}let Q=Y.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!Q){X=J.end;continue}let G=Q[1].trim(),q=Q[2].trim(),W;if(G.includes(",")){let L=G.split(",").map((F)=>F.trim()),V=L[0],O=L[1];W=`${q} as ${O} => ${V}`}else W=`${q} as ${G}`;let K=j1(J.attrs,"v-for"),U=j1(K,":key").replace(/\s*v-bind:key="[^"]*"/g,""),z=a0(Z,J),H=Z.slice(z.outerStart,z.outerEnd),j=B1(H,{...J,start:0,end:J.end-J.start},U),B=`@foreach(${W})
3388
3388
  `,_=`${B}${j}
3389
3389
  @endforeach`;Z=Z.slice(0,z.outerStart)+_+Z.slice(z.outerEnd),X=z.outerStart+B.length}return Z}function ZQ($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=i1(J.attrs,"v-if");if(Y===null){X=J.end;continue}let Q=[],G=a0(Z,J),q=j1(J.attrs,"v-if"),W=B1(Z.slice(G.outerStart,G.outerEnd),{...J,start:0,end:J.end-J.start},q);Q.push({type:"if",expr:Y,outerStart:G.outerStart,outerEnd:G.outerEnd,element:W,parsedTag:J});let K=G.outerEnd,U=!0;while(U){let _=Z.slice(K).match(/^\s*/),L=_?_[0].length:0,V=k1(Z,K+L);if(!V){U=!1;break}let O=i1(V.attrs,"v-else-if"),F=f9(V.attrs,"v-else");if(O!==null){let w=a0(Z,V),R=j1(V.attrs,"v-else-if"),D=B1(Z.slice(w.outerStart,w.outerEnd),{...V,start:0,end:V.end-V.start},R);Q.push({type:"else-if",expr:O,outerStart:K,outerEnd:w.outerEnd,element:D,parsedTag:V}),K=w.outerEnd}else if(F){let w=a0(Z,V),R=j1(V.attrs,"v-else"),D=B1(Z.slice(w.outerStart,w.outerEnd),{...V,start:0,end:V.end-V.start},R);Q.push({type:"else",outerStart:K,outerEnd:w.outerEnd,element:D,parsedTag:V}),U=!1}else U=!1}let z=[];for(let _ of Q)if(_.type==="if")z.push(`@if(${_.expr})
3390
3390
  ${_.element}`);else if(_.type==="else-if")z.push(`@elseif(${_.expr})
@@ -3398,10 +3398,10 @@ ${B1(G,{...J,start:0,end:J.end-J.start},Y)}
3398
3398
  `)})}else Z.push({selector:`@${U} ${z.trim()}`,declarations:H.trim()})}G="",Q=!1}else if(Y.trim()){Y+=W;let K=Y.match(/([^{]+)\{([^}]*)\}/);if(K)Z.push({selector:K[1].trim(),declarations:K[2].trim()});Y=""}continue}}if(Q)G+=W;else Y+=W}return Z}function c9($,Z,X,J,Y,Q){let{selector:G,declarations:q}=$;if(G.startsWith("@")){if(G.startsWith("@keyframes")){let U=G.replace("@keyframes ","").trim();return`@keyframes ${Y.get(U)||U} { ${q} }`}if(G.startsWith("@media")||G.startsWith("@supports")||G.startsWith("@container")){let z=X4(`x { ${q} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((H)=>c9(H,Z,X,J,Y,Q)).join(`
3399
3399
  `);return`${G} {
3400
3400
  ${z}
3401
- }`}return`${G} { ${q} }`}let W=BQ(G,Z,X,J),K=q;for(let[U,z]of Y)K=K.replace(new RegExp(`\\b${U}\\b`,"g"),z);if(Q)K=K.replace(/--([a-z-]+)/gi,`--${Z}-$1`);return`${W} { ${K} }`}function BQ($,Z,X,J){let Y=$.split(",").map((G)=>G.trim()),Q=[];for(let G of Y){if(G.startsWith(":host")){if(J)Q.push(G);else{let K=G.replace(/:host(\([^)]*\))?/,`.${Z}$1`);Q.push(K)}continue}if(G.includes("::slotted")){Q.push(G);continue}if(G===":root"){Q.push(`:root .${Z}`);continue}let q=X?`${X} .${Z}`:`.${Z}`;Q.push(`${q} ${G}`);let W=_Q(G,Z);if(W)Q.push(X?`${X} ${W}`:W)}return Q.join(", ")}function _Q($,Z){let X=0,J=$.length;for(let W=0;W<$.length;W++){let K=$[W];if(K==="["||K==="(")X++;else if(K==="]"||K===")")X--;else if(X===0&&(K===" "||K===">"||K==="+"||K==="~")){J=W;break}}let Y=$.slice(0,J),Q=$.slice(J);if(!Y)return"";let G=Y.length,q=0;for(let W=0;W<Y.length;W++){let K=Y[W];if(K==="["||K==="(")q++;else if(K==="]"||K===")")q--;else if(X===0&&q===0&&K===":"){G=W;break}}return`${Y.slice(0,G)}.${Z}${Y.slice(G)}${Q}`}var n9=String.raw`(?<![\w-])scoped(?![\w-])`,J4=/<style\s+([^>]*)>/gi,p9=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,s9=new RegExp(n9,"i"),VQ=new RegExp(n9,"gi");function OQ($){J4.lastIndex=0;let Z=J4.exec($);while(Z!==null){if(s9.test(Z[1]))return!0;Z=J4.exec($)}return!1}function o9($){let Z=new Set;return $.replace(/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi,(X)=>{let J=X.trim();if(Z.has(J))return"";return Z.add(J),X})}function R$($,Z){if(!OQ($))return{html:$,hasScoped:!1};let X=m9(Z),J=`data-v-${X}`,Y=$,Q=!1;if(p9.lastIndex=0,Y=Y.replace(p9,(G,q,W)=>{if(!s9.test(q))return G;Q=!0;let K=FQ(W,J),U=q.replace(VQ,"").trim(),z=U?` ${U}`:"";return`<style data-stx-scoped="${X}"${z}>${K}</style>`}),!Q)return{html:$,hasScoped:!1};return Y=wQ(Y,J),{html:Y,hasScoped:!0}}function FQ($,Z){return l9($,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${Z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${Z}]`)}var LQ=($)=>`\x00stx-scope-mask-${$}\x00`,i9=/\u0000stx-scope-mask-(\d+)\u0000/g;function wQ($,Z){let X=o0($,(Y,Q)=>{let G=Q1(Y,Q);return G>Q?G:C1(Y,Q)},(Y,Q)=>LQ(Q)),J=RQ(X.output,Z);return i9.lastIndex=0,J.replace(i9,(Y,Q)=>X.tokens[Number(Q)])}function RQ($,Z){let X=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return $.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(J,Y,Q)=>{if(X.has(Y.toLowerCase()))return J;if(J.includes(Z))return J;if(Y.toLowerCase()==="style"||Y.toLowerCase()==="script")return J;if(Q)return J.replace(`<${Y}${Q}`,`<${Y} ${Z}${Q}`);if(J.endsWith("/>"))return`<${Y} ${Z} />`;return`<${Y} ${Z}>`})}var Xj="data-stx-color-mode-boot",Jj="__STX_COLOR_MODE__",DQ=new Set(["light","dark","auto","system"]),NQ=new Set(["auto","system"]),AQ=/^[a-z][\w:-]*$/i,MQ=/^[\w-]+$/;function kQ($){let Z=$.storageKey??"stx-color-mode",X=$.initialMode??"auto",J=$.darkClass===void 0?"dark":$.darkClass,Y=$.attribute??null,Q=$.autoValue??null;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!DQ.has(X))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(X)}`);if(J!==null&&(typeof J!=="string"||!MQ.test(J)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(J)}`);if(Y!==null&&(typeof Y!=="string"||!AQ.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!NQ.has(Q))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(Q)}`);if(J===null&&Y===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:Z,initialMode:X==="system"?"auto":X,darkClass:J,attribute:Y,autoValue:Q}}function IQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Q4($={}){let Z=kQ($);return`<script data-stx-color-mode-boot>${`(function(){"use strict";var c=${IQ(Z)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.__STX_COLOR_MODE__={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`}</script>`}function t9($,Z={}){if($.includes("data-stx-color-mode-boot"))return $;let X=Y4($);if(X===null)return $;let J=Q4(Z);return`${$.slice(0,X)}
3401
+ }`}return`${G} { ${q} }`}let W=BQ(G,Z,X,J),K=q;for(let[U,z]of Y)K=K.replace(new RegExp(`\\b${U}\\b`,"g"),z);if(Q)K=K.replace(/--([a-z-]+)/gi,`--${Z}-$1`);return`${W} { ${K} }`}function BQ($,Z,X,J){let Y=$.split(",").map((G)=>G.trim()),Q=[];for(let G of Y){if(G.startsWith(":host")){if(J)Q.push(G);else{let K=G.replace(/:host(\([^)]*\))?/,`.${Z}$1`);Q.push(K)}continue}if(G.includes("::slotted")){Q.push(G);continue}if(G===":root"){Q.push(`:root .${Z}`);continue}let q=X?`${X} .${Z}`:`.${Z}`;Q.push(`${q} ${G}`);let W=_Q(G,Z);if(W)Q.push(X?`${X} ${W}`:W)}return Q.join(", ")}function _Q($,Z){let X=0,J=$.length;for(let W=0;W<$.length;W++){let K=$[W];if(K==="["||K==="(")X++;else if(K==="]"||K===")")X--;else if(X===0&&(K===" "||K===">"||K==="+"||K==="~")){J=W;break}}let Y=$.slice(0,J),Q=$.slice(J);if(!Y)return"";let G=Y.length,q=0;for(let W=0;W<Y.length;W++){let K=Y[W];if(K==="["||K==="(")q++;else if(K==="]"||K===")")q--;else if(X===0&&q===0&&K===":"){G=W;break}}return`${Y.slice(0,G)}.${Z}${Y.slice(G)}${Q}`}var n9=String.raw`(?<![\w-])scoped(?![\w-])`,J4=/<style\s+([^>]*)>/gi,p9=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,s9=new RegExp(n9,"i"),VQ=new RegExp(n9,"gi");function OQ($){J4.lastIndex=0;let Z=J4.exec($);while(Z!==null){if(s9.test(Z[1]))return!0;Z=J4.exec($)}return!1}function o9($){let Z=new Set;return $.replace(/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi,(X)=>{let J=X.trim();if(Z.has(J))return"";return Z.add(J),X})}function R$($,Z){if(!OQ($))return{html:$,hasScoped:!1};let X=m9(Z),J=`data-v-${X}`,Y=$,Q=!1;if(p9.lastIndex=0,Y=Y.replace(p9,(G,q,W)=>{if(!s9.test(q))return G;Q=!0;let K=FQ(W,J),U=q.replace(VQ,"").trim(),z=U?` ${U}`:"";return`<style data-stx-scoped="${X}"${z}>${K}</style>`}),!Q)return{html:$,hasScoped:!1};return Y=wQ(Y,J),{html:Y,hasScoped:!0}}function FQ($,Z){return l9($,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${Z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${Z}]`)}var LQ=($)=>`\x00stx-scope-mask-${$}\x00`,i9=/\u0000stx-scope-mask-(\d+)\u0000/g;function wQ($,Z){let X=o0($,(Y,Q)=>{let G=Q1(Y,Q);return G>Q?G:C1(Y,Q)},(Y,Q)=>LQ(Q)),J=RQ(X.output,Z);return i9.lastIndex=0,J.replace(i9,(Y,Q)=>X.tokens[Number(Q)])}function RQ($,Z){let X=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return $.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(J,Y,Q)=>{if(X.has(Y.toLowerCase()))return J;if(J.includes(Z))return J;if(Y.toLowerCase()==="style"||Y.toLowerCase()==="script")return J;if(Q)return J.replace(`<${Y}${Q}`,`<${Y} ${Z}${Q}`);if(J.endsWith("/>"))return`<${Y} ${Z} />`;return`<${Y} ${Z}>`})}var Jj="data-stx-color-mode-boot",Yj="__STX_COLOR_MODE__",DQ=new Set(["light","dark","auto","system"]),NQ=new Set(["auto","system"]),AQ=/^[a-z][\w:-]*$/i,MQ=/^[\w-]+$/;function kQ($){let Z=$.storageKey??"stx-color-mode",X=$.initialMode??"auto",J=$.darkClass===void 0?"dark":$.darkClass,Y=$.attribute??null,Q=$.autoValue??null;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!DQ.has(X))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(X)}`);if(J!==null&&(typeof J!=="string"||!MQ.test(J)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(J)}`);if(Y!==null&&(typeof Y!=="string"||!AQ.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!NQ.has(Q))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(Q)}`);if(J===null&&Y===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:Z,initialMode:X==="system"?"auto":X,darkClass:J,attribute:Y,autoValue:Q}}function IQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Q4($={}){let Z=kQ($);return`<script data-stx-color-mode-boot>${`(function(){"use strict";var c=${IQ(Z)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.__STX_COLOR_MODE__={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`}</script>`}function t9($,Z={}){if($.includes("data-stx-color-mode-boot"))return $;let X=Y4($);if(X===null)return $;let J=Q4(Z);return`${$.slice(0,X)}
3402
3402
  ${J}${$.slice(X)}`}function Y4($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let X=Z.index+Z[0].length;r9.lastIndex=X;let J=r9.exec($);if(J)X+=J[0].length;return X}var TQ=new RegExp("<script\\b[^>]*\\bdata-stx-color-mode-boot\\b[^>]*>[\\s\\S]*?<\\/script>","i"),EQ=/<meta\b[^>]*\bcharset\b[^>]*>/i,r9=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy,a9=/<\/head>/gi;function bQ($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let X=Z.index+Z[0].length;a9.lastIndex=X;let J=a9.exec($),Y=J?J.index:-1,Q=$.slice(X,Y===-1?$.length:Y),G=EQ.exec(Q);if(!G||Q.slice(0,G.index).trim()==="")return $;let q=Q.slice(0,G.index)+Q.slice(G.index+G[0].length);return $.slice(0,X)+`
3403
3403
  ${G[0]}`+q+$.slice(X+Q.length)}function e9($){return yQ(bQ($))}function yQ($){let Z=TQ.exec($);if(!Z)return $;let X=Y4($);if(X===null)return $;if(Z.index<=X||$.slice(X,Z.index).trim()==="")return $;let J=$.slice(0,Z.index)+$.slice(Z.index+Z[0].length),Y=Y4(J);if(Y===null)return $;return`${J.slice(0,Y)}
3404
- ${Z[0]}${J.slice(Y)}`}var Qj="stx-build",Gj="X-STX-Build",D$=null;function SQ(){if(D$===null)D$=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return D$}function qj($){D$=$}function $8($,Z=SQ()){if($.includes('name="stx-build"'))return $;let X=/<head\b[^>]*>/i.exec($);if(!X)return $;let J=X.index+X[0].length;return`${$.slice(0,J)}
3404
+ ${Z[0]}${J.slice(Y)}`}var Gj="stx-build",qj="X-STX-Build",D$=null;function SQ(){if(D$===null)D$=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return D$}function Wj($){D$=$}function $8($,Z=SQ()){if($.includes('name="stx-build"'))return $;let X=/<head\b[^>]*>/i.exec($);if(!X)return $;let J=X.index+X[0].length;return`${$.slice(0,J)}
3405
3405
  <meta name="stx-build" content="${Z}">${$.slice(J)}`}var Z8="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",N$="data-stx-html-attrs",A$="data-stx-html-class",X8=/^[A-Za-z_:][\w:.-]*$/;function Y1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function CQ($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s1($){if($.name)return`name="${$.name}"`;if($.property)return`property="${$.property}"`;if($.charset!=null)return"charset=";if($["http-equiv"])return`http-equiv="${$["http-equiv"]}"`;return""}function n1($,Z){return Object.entries($).filter(([X])=>!Z?.(X)).map(([X,J])=>`${X}="${Y1(String(J))}"`).join(" ")}function PQ($={},Z="en"){let X=[],J=[],Y="",Q=Z;for(let[q,W]of Object.entries($||{})){if(W==null)continue;let K=q.trim();if(!X8.test(K))continue;let U=K.toLowerCase();if(U==="lang"){Q=String(W);continue}if(U==="class"){Y=String(W).trim();continue}X.push(` ${K}="${Y1(String(W))}"`),J.push(K)}let G=` lang="${Y1(Q)}"`;if(Y)G+=` class="${Y1(Y)}"`;if(G+=X.join(""),Y)G+=` ${A$}="${Y1(Y)}"`;if(J.length)G+=` ${N$}="${Y1(J.join(" "))}"`;return G}function J8($={},Z={}){let X={...$,...Z};if($.class&&Z.class){let J=$.class.split(/\s+/).filter(Boolean);for(let Y of Z.class.split(/\s+/).filter(Boolean))if(!J.includes(Y))J.push(Y);X.class=J.join(" ")}return X}function Y8($,Z={}){if(!Z||Object.keys(Z).length===0)return $;let X=$.match(/<html\b([^>]*)>/i);if(!X)return $;let J={},Y=[],Q=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,G;while((G=Q.exec(X[1]))!==null){let U=G[1];if(!(U in J))Y.push(U);J[U]=G[2]??G[3]??G[4]??""}let q=[],W=[];for(let[U,z]of Object.entries(Z)){if(z==null)continue;let H=U.trim();if(!X8.test(H))continue;let j=H.toLowerCase();if(j==="class"){let B=(J.class||"").split(/\s+/).filter(Boolean);for(let _ of String(z).split(/\s+/).filter(Boolean))if(!B.includes(_))B.push(_),q.push(_);if(!("class"in J))Y.push("class");J.class=B.join(" ");continue}if(!(H in J))Y.push(H);if(J[H]=String(z),j!=="lang")W.push(H)}if(q.length){if(!(A$ in J))Y.push(A$);J[A$]=q.join(" ")}if(W.length){if(!(N$ in J))Y.push(N$);J[N$]=W.join(" ")}let K=Y.map((U)=>` ${U}="${Y1(J[U])}"`).join("");return $.replace(X[0],()=>`<html${K}>`)}function Q8($){if($.includes("data-stx-cloak"))return $;let Z=$.lastIndexOf("</head>");if(Z===-1)return $;return`${$.slice(0,Z)}${Z8}
3406
3406
  ${$.slice(Z)}`}function vQ($){let Z=[],X=0;while(X<$.length){let Q=$.slice(X),G=Q.match(/^\s+/);if(G){X+=G[0].length;continue}if(Q.startsWith("<!--")){let z=$.indexOf("-->",X);if(z===-1)break;X=z+3;continue}let q=Q.match(/^<script\b[^>]*>/i);if(q){let z=$.toLowerCase().indexOf("</script>",X+q[0].length);if(z===-1)break;X=z+9;continue}let W=Q.match(/^<link\b[^>]*>/i);if(W){Z.push(W[0]),X+=W[0].length;continue}let K=Q.match(/^<meta\b[^>]*>/i);if(K){Z.push(K[0]),X+=K[0].length;continue}let U=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(U){Z.push(U[0]),X+=U[0].length;continue}break}if(Z.length===0)return{body:$,hoisted:Z};let J="",Y=0;while(Y<$.length&&Y<X){let Q=$.slice(Y),G=Q.match(/^<link\b[^>]*>/i);if(G&&Z.includes(G[0])){Y+=G[0].length;continue}let q=Q.match(/^<meta\b[^>]*>/i);if(q&&Z.includes(q[0])){Y+=q[0].length;continue}let W=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(W&&Z.includes(W[0])){Y+=W[0].length;continue}J+=$[Y],Y++}return J+=$.slice(X),{body:J,hoisted:Z}}function fQ($,Z={},X={}){let{title:J="stx App",lang:Y="en",meta:Q=[],link:G=[],script:q=[],headRaw:W="",htmlAttrs:K={},bodyClass:U="",bodyAttrs:z={}}=Z,H=X.title||J,j=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],B=new Set(Q.map(s1).filter(Boolean)),L=[...j.filter((M)=>!B.has(s1(M))),...Q].map((M)=>{return` <meta ${n1(M)}>`}).join(`
3407
3407
  `),V=G.map((M)=>{return` <link ${n1(M)}>`}).join(`
@@ -3418,7 +3418,7 @@ ${A.join(`
3418
3418
  </body>
3419
3419
  </html>`}function G4($){let Z=0;while(Z<$.length){let X=$.slice(Z),J=X.match(/^\s+/);if(J){Z+=J[0].length;continue}if(X.startsWith("<!--")){let Q=$.indexOf("-->",Z);if(Q===-1)return!1;Z=Q+3;continue}let Y=X.match(/^<(script|style)\b[^>]*>/i);if(Y){let Q=`</${Y[1].toLowerCase()}>`,G=$.toLowerCase().indexOf(Q,Z+Y[0].length);if(G===-1)return!1;Z=G+Q.length;continue}return/^<!DOCTYPE\b/i.test(X)||/^<html[\s>]/i.test(X)}return!1}function q4($){return G4($)}function G8($,Z={}){let X=$.lastIndexOf("</head>");if(X===-1)return $;let{meta:J=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,q=$.slice(0,X),W=[];for(let K of J){let U=s1(K);if(U&&q.includes(U))continue;W.push(` <meta ${n1(K)}>`)}for(let K of Y){if(K.href&&q.includes(`href="${K.href}"`))continue;W.push(` <link ${n1(K)}>`)}for(let K of Q)if(K.src){if(q.includes(`src="${K.src}"`))continue;W.push(` <script ${n1(K,(U)=>U==="content")}></script>`)}else if(K.content){if(q.includes(K.content))continue;W.push(` <script>${K.content}</script>`)}if(G&&!q.includes(G))W.push(` ${G}`);if(W.length===0)return $;return`${$.slice(0,X)}${W.join(`
3420
3420
  `)}
3421
- ${$.slice(X)}`}function q8($,Z={},X={}){if(q4($))return $;return fQ($,Z,X)}var xQ=/<\/(script)/gi;function o1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(xQ,"<\\/$1")}var k5=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useDocumentVisibility","useIntervalFn","useObjectUrl","useTimeoutFn"];j5();j5();function K8($,Z={}){return new W8($,Z).routes}function Fj($,Z){let X=W4($,Z);return X?X.params:null}var U8=new Map;async function z8($){let Z=$;if(!Z)try{Z=(await k3())?.pagesDir||"pages"}catch{Z="pages"}let X=Z,J=U8.get(X);if(J)return J;let Y=[];try{Y=K8(".",{pagesDir:X}).map((Q)=>Q.regex.source).filter(Boolean)}catch{Y=[]}return U8.set(X,Y),Y}function gQ($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function H8($){return gQ(JSON.stringify($))}function K4(){return`
3421
+ ${$.slice(X)}`}function q8($,Z={},X={}){if(q4($))return $;return fQ($,Z,X)}var xQ=/<\/(script)/gi;function o1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(xQ,"<\\/$1")}var k5=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useDocumentVisibility","useIntervalFn","useObjectUrl","useTimeoutFn"];j5();j5();function K8($,Z={}){return new W8($,Z).routes}function Lj($,Z){let X=W4($,Z);return X?X.params:null}var U8=new Map;async function z8($){let Z=$;if(!Z)try{Z=(await k3())?.pagesDir||"pages"}catch{Z="pages"}let X=Z,J=U8.get(X);if(J)return J;let Y=[];try{Y=K8(".",{pagesDir:X}).map((Q)=>Q.regex.source).filter(Boolean)}catch{Y=[]}return U8.set(X,Y),Y}function gQ($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function H8($){return gQ(JSON.stringify($))}function K4(){return`
3422
3422
  (function(){
3423
3423
  var tip=null,hideTimer=null,currentEl=null;
3424
3424
 
@@ -3526,14 +3526,14 @@ document.addEventListener("focusout",function(e){
3526
3526
  ${Z}${$.slice(G)}`}if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3527
3527
  `+$.slice(G)}if(q1($))return v1($,(G)=>`${G}
3528
3528
  ${Z}`);return`${Z}
3529
- ${$}`}async function M$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return U4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return U4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-cvkjsa0m.js"),J=await X(Z.debug);return U4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function hQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function _8($){if($.includes("data-stx-tooltip-runtime")||!hQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${K4()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3529
+ ${$}`}async function M$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return U4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return U4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-45gasjkt.js"),J=await X(Z.debug);return U4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function hQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function _8($){if($.includes("data-stx-tooltip-runtime")||!hQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${K4()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3530
3530
  ${Z}`;return`${$.slice(0,X)}${Z}
3531
3531
  ${$.slice(X)}`}var uQ=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function dQ($){return uQ.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function mQ($,Z){if(!$.includes("</body>"))return $;if(dQ($))return $;let X=Z?.router,J="";{let q={};if(X){if(X.container)q.container=X.container;if(X.interceptAllLinks!==void 0)q.interceptAllLinks=X.interceptAllLinks;if(X.progress!==void 0)q.progress=X.progress;if(X.viewTransitions!==void 0)q.viewTransitions=X.viewTransitions;if(X.viewTransitionDuration!==void 0)q.viewTransitionDuration=X.viewTransitionDuration;if(X.viewTransitionEasing!==void 0)q.viewTransitionEasing=X.viewTransitionEasing;if(X.scrollToTop!==void 0)q.scrollToTop=X.scrollToTop;if(X.prefetch!==void 0)q.prefetch=X.prefetch;if(X.cache!==void 0)q.cache=X.cache;if(X.progressColor!==void 0)q.progressColor=X.progressColor;if(X.progressHeight!==void 0)q.progressHeight=X.progressHeight}try{let W=await z8(Z?.pagesDir);if(W.length>0)q.ownedRoutes=W}catch{}if(Object.keys(q).length>0)J=`<script>window.__stxRouterConfig=${H8(q)};</script>
3532
- `}let{getCachedRouterScript:Y}=await import("./chunk-cvkjsa0m.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+`
3532
+ `}let{getCachedRouterScript:Y}=await import("./chunk-45gasjkt.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+`
3533
3533
  </body>`+$.slice(G+7)}var V8=Symbol.for("stx.lazy-module-promises");function lQ(){let $=globalThis;return $[V8]??=new Map,$[V8]}function o($,Z){let X=lQ(),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 H4=`(?:"[^"]*"|'[^']*'|[^>"'])*`,D8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function cQ($,Z={}){let X=[];for(let J of n5($,Q1)){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 q=Y[0].length,W=J.token.length-Q[0].length;X.push({fullMatch:J.token,attrs:G,body:J.token.slice(q,W),start:J.start,end:J.end})}return X}function N8($){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:q}=O8(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:q}}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:q}=O8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:q}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function O8($){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 B4($,Z){return R8($,Z)}function pQ($){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 iQ($){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 nQ($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${H4})>`,"iy"),X=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,J=n5($,(Q,G)=>{Z.lastIndex=G;let q=Z.exec(Q);if(!q||q.index!==G||!X.test(q[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 q=G[2].match(X),W=N8(q?.[1]??q?.[2]??""),K=[W.itemVar,W.indexVar].filter(Boolean);if(K.length===0)continue;let U=G[1],H=/\/\s*>$/.test(Q.token)||I$.has(U.toLowerCase())?Q.end:M8($,Q.start,U,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(K)})}return Y}var F8=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 sQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function L8($,Z,X,J){if(!$)return!1;let Y=sQ($),Q=!1,G=!1,q=!1,W=/([a-zA-Z_$][\w$]*)/g,K;while((K=W.exec(Y))!==null){let j=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(F8.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,z;while((z=U.exec(Y))!==null){let j=z[1];if(Y.slice(0,z.index).trimEnd().endsWith("."))continue;if(F8.has(j)||X&&j in X)continue;q=!0}return(Q||q)&&!G}function k$($,Z,X){let J=X===void 0?` ${Z}`:` ${Z}="${X.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(D8);if(Q&&oQ(Q[3],Q[1])){let[,G,q,W]=Q;return`<${G}${q}${J}>${W}</${G}>`}return`<template${J}>${Y}</template>`}function oQ($,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 A8($,Z){let X=iQ($);function J(Y){let Q=Y,G=nQ(Y),q=(z)=>{let H=new Set;for(let j of G)if(z>j.start&&z<j.end)for(let B of j.vars)H.add(B);return H},W=/@if\s*\(/g,K,U=[];while((K=W.exec(Q))!==null){let z=K.index,H=z+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(),L=B,V=1,O=L,F=/@(if\s*\(|endif)/g;F.lastIndex=L;let w;while((w=F.exec(Q))!==null)if(w[1].startsWith("if"))V++;else if(w[1]==="endif"){if(V--,V===0){O=w.index+w[0].length;break}}if(V!==0)continue;let R=Q.substring(L,O-6).trim(),D;if(pQ(R)){let N=w5(Q.substring(z,O));if(N.length===0)continue;let k=N[0].branches.filter((I)=>I.type!=="else"),A=q(z);if(!(k.length>0&&k.every((I)=>L8(I.condition,X,Z,A))))continue;D=N[0].branches.map((I)=>{let y=J(I.content);if(I.type==="elseif")return k$(y,"@else-if",I.condition??"");if(I.type==="else")return k$(y,"@else");return k$(y,"@if",I.condition??"")}).join(`
3534
3534
  `)}else{if(!L8(_,X,Z,q(z)))continue;D=k$(J(R),"@if",_)}U.push({start:z,end:O,replacement:D}),W.lastIndex=O}for(let z=U.length-1;z>=0;z--){let{start:H,end:j,replacement:B}=U[z];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return J($)}function rQ($){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 I$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function M8($,Z,X,J){if(I$.has(X.toLowerCase()))return J;let Y=X.toLowerCase(),Q=$.toLowerCase(),G=$.length,q=1,W=J;while(W<G){let K=$.indexOf("<",W);if(K===-1)return-1;if(W=K,$.startsWith("<!--",W)){let j=$.indexOf("-->",W+4);if(j===-1)return-1;W=j+3;continue}let U=/^<(script|style)\b/i.exec($.slice(W,W+8));if(U){let j=$.indexOf(">",W);if(j===-1)return-1;if($[j-1]==="/"){W=j+1;continue}let B=Q.indexOf(`</${U[1].toLowerCase()}`,W);if(B===-1)return-1;let _=$.indexOf(">",B);if(_===-1)return-1;W=_+1;continue}if($[W+1]==="/"){let j=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(W,W+64));if(!j){W++;continue}if(j[1].toLowerCase()===Y){if(q--,W+=j[0].length,q===0)return W;continue}W+=j[0].length;continue}let z=/^<([a-z][\w-]*)\b/i.exec($.slice(W,W+64));if(!z){W++;continue}let H=$.indexOf(">",W);if(H===-1)return-1;if(z[1].toLowerCase()===Y){let j=$.slice(W,H+1);if(!(/\/\s*>$/.test(j)||I$.has(Y)))q++}W=H+1}return-1}var aQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function tQ($,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 aQ.test(Q)}function k8($){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=(z)=>Z.some(([H,j])=>z>=H&&z<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=[],q;while((q=Q.exec($))!==null){if(Y(q.index))continue;let[z,H,j,B,_,L,V]=q,O=rQ(_);if(O===void 0)continue;let F=q.index,w=F+z.length,N=!!V||/\/\s*>$/.test(z)||I$.has(H.toLowerCase())?w:M8($,F,H,w);if(N===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&tQ($,N)){Q.lastIndex=w;continue}if(O===!0){let A=`<${H}${j}${L}${V}>`;G.push({start:F,end:w,replacement:A});continue}G.push({start:F,end:N,replacement:""}),Q.lastIndex=N}if(G.length===0)return $;G.sort((z,H)=>z.start-H.start);let W=[],K=-1;for(let z of G){if(z.start<K)continue;W.push(z),K=z.end}let U=$;for(let z=W.length-1;z>=0;z--){let{start:H,end:j,replacement:B}=W[z];U=U.substring(0,H)+B+U.substring(j)}return U}function I8($,Z){let X=$,J=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=J.exec(X))!==null){let q=Y[1],W=Y.index,K=W+Y[0].length,U=1,z=K;while(z<X.length&&U>0){if(X[z]==="(")U++;else if(X[z]===")")U--;z++}if(U!==0)continue;let H=X.substring(K,z-1).trim(),j=z,B=N8(H),_=q==="for"?"@endfor":"@endforeach",L=1,V=j,O=q==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${q}\\s*\\(|end${q})`,"g");O.lastIndex=j;let F;while((F=O.exec(X))!==null)if(F[1].startsWith(q))L++;else if(L--,L===0){V=F.index+F[0].length;break}if(L!==0)continue;let w=()=>{let k=[B.itemVar,B.indexVar].filter(Boolean);if(k.length)G.push({start:W,end:V,vars:k})};if(B.iterable){let k=B.iterable.trim();if(k.startsWith("[")||k.startsWith("{")||k.startsWith("'")||k.startsWith('"')||k.startsWith("`")||/^-?\d/.test(k)){w();continue}let A=k.split(/[.[(]/)[0].trim(),M=Z?A in Z:!1,T=G.some((I)=>W>I.start&&W<I.end&&I.vars.includes(A));if(A&&(M||T)){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=R.match(D8),N;if(D){let[,k,A,M]=D;N=`<${k}${A} @for="${H}">${M}</${k}>`}else N=`<template @for="${H}">${R}</template>`;Q.push({start:W,end:V,replacement:N})}for(let q=Q.length-1;q>=0;q--){let{start:W,end:K,replacement:U}=Q[q];X=X.substring(0,W)+U+X.substring(K)}return X}function eQ($){let Z=new Set,X=[],J=0,Y=0,Q=$.length,G=(U)=>{let z=J+1;while(z<Q){let H=$[z];if(H==="\\"){z+=2;continue}if(H===U)return z+1;z++}return Q},q=()=>{let U=J+2;while(U<Q&&$[U]!==`
3535
3535
  `)U++;return U},W=()=>{let U=J+2;while(U<Q-1){if($[U]==="*"&&$[U+1]==="/")return U+2;U++}return Q},K=(U)=>{let z=U,H=0;while(z<Q){let j=$[z];if(j==="/"&&$[z+1]==="/"){let B=z+2;while(B<Q&&$[B]!==`
3536
- `)B++;z=B;continue}if(j==="/"&&$[z+1]==="*"){let B=z+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;z=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=z+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}z=B;continue}if(j==="("||j==="["||j==="{"){H++,z++;continue}if(j===")"||j==="]"||j==="}"){H--,z++;continue}if(j===";"&&H===0)return z+1;z++}return Q};while(J<Q){let U=$[J];if(U==="/"&&$[J+1]==="/"){let z=q();X.push($.slice(J,z)),J=z;continue}if(U==="/"&&$[J+1]==="*"){let z=W();X.push($.slice(J,z)),J=z;continue}if(U==='"'||U==="'"||U==="`"){let z=G(U);X.push($.slice(J,z)),J=z;continue}if(U==="{"){Y++,X.push(U),J++;continue}if(U==="}"){Y--,X.push(U),J++;continue}if(Y===0){let z=J>0?$[J-1]:"";if(z===""||/\s/.test(z)||z===";"||z==="}"||z==="{"){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 $G($,Z,X){let J=cQ($,{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:q}=await o("stx/client-script-bundler",()=>import("./chunk-ertf9176.js"));for(let V of J){let O=V.body;if(A1(V.attrs))O=M1(O);if(Y.test(O)){Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O});continue}if(!G(O))continue;try{let F=await q(r1(O).code,Z||"",{projectRoot:process.cwd()});if(Y.test(F))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O,bundled:F})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let W=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(W).toString(36).slice(0,10)}`,U=[];for(let V=0;V<Q.length;V++){let O=Q[V].bundled??r1(Q[V].content).code;if(!Q[V].bundled&&G(O))O=await q(O,Z||"",{projectRoot:process.cwd()});O=YG(O);let F=$1(O);U.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3536
+ `)B++;z=B;continue}if(j==="/"&&$[z+1]==="*"){let B=z+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;z=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=z+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}z=B;continue}if(j==="("||j==="["||j==="{"){H++,z++;continue}if(j===")"||j==="]"||j==="}"){H--,z++;continue}if(j===";"&&H===0)return z+1;z++}return Q};while(J<Q){let U=$[J];if(U==="/"&&$[J+1]==="/"){let z=q();X.push($.slice(J,z)),J=z;continue}if(U==="/"&&$[J+1]==="*"){let z=W();X.push($.slice(J,z)),J=z;continue}if(U==='"'||U==="'"||U==="`"){let z=G(U);X.push($.slice(J,z)),J=z;continue}if(U==="{"){Y++,X.push(U),J++;continue}if(U==="}"){Y--,X.push(U),J++;continue}if(Y===0){let z=J>0?$[J-1]:"";if(z===""||/\s/.test(z)||z===";"||z==="}"||z==="{"){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 $G($,Z,X){let J=cQ($,{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:q}=await o("stx/client-script-bundler",()=>import("./chunk-z3cme6c9.js"));for(let V of J){let O=V.body;if(A1(V.attrs))O=M1(O);if(Y.test(O)){Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O});continue}if(!G(O))continue;try{let F=await q(r1(O).code,Z||"",{projectRoot:process.cwd()});if(Y.test(F))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O,bundled:F})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let W=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(W).toString(36).slice(0,10)}`,U=[];for(let V=0;V<Q.length;V++){let O=Q[V].bundled??r1(Q[V].content).code;if(!Q[V].bundled&&G(O))O=await q(O,Z||"",{projectRoot:process.cwd()});O=YG(O);let F=$1(O);U.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3537
3537
  ${F}`)}let z=U.join(`
3538
3538
 
3539
3539
  `);z=eQ(z);let H=ZG(z),j=H.split(",").map((V)=>V.trim()).filter(Boolean),B=j4(z,X),_=`
@@ -3550,19 +3550,19 @@ if(window.stx)window.stx._latestSetup=${K};
3550
3550
  `)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},j=()=>{if(Y!==0)return;let B=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(B){let F=B[2];if(!J.has(F))X.push(F),J.add(F);return}let _=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(_){_[1].split(",").forEach((F)=>{let w=F.trim();if(!w)return;let R=w.indexOf(":"),N=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(N&&!J.has(N))X.push(N),J.add(N)});return}let L=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(L){L[1].split(",").forEach((F)=>{let w=F.trim().replace(/^\.\.\./,"");if(!w)return;let R=w.split(/[\s=]/)[0];if(R&&!J.has(R))X.push(R),J.add(R)});return}let V=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(V){let F=V[1];if(!J.has(F))X.push(F),J.add(F);return}let O=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let F=O[1];if(!J.has(F))X.push(F),J.add(F)}};while(Q<G){if(H())continue;if(Z[Q]==="'"||Z[Q]==='"'){U(Z[Q]),q=Z[Q-1];continue}if(Z[Q]==="`"){z(),q="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&K()){W(),q="/";continue}if(Z[Q]==="{"){Y++,q="{",Q++;continue}if(Z[Q]==="}"){Y--,q="}",Q++;continue}if(Y===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))j();if(!/\s/.test(Z[Q]))q=Z[Q];Q++}return X.join(", ")}async function T8($,Z,X,J){if(!B4($,X))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await $G(Y,X,J);if(Y=Q,Y=await M$(Y,Z),G){let U=z4(Y,/<\/head>/i),z=U===-1?z4(Y,/<body[^>]*>/i):-1;if(U!==-1)Y=`${Y.slice(0,U)}${G}
3551
3551
  ${Y.slice(U)}`;else if(z!==-1){let H=/<body[^>]*>/i.exec(Y.slice(z))[0],j=z+H.length;Y=`${Y.slice(0,j)}
3552
3552
  ${G}${Y.slice(j)}`}else Y=`${Y}
3553
- ${G}`}let W=Y.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i),K=W&&/data-stx/.test(W[1]);if(!G&&!K&&W&&!/data-stx-auto/.test(W[1])){let U=/<body[^>]*>/i,z=z4(Y,U);if(z!==-1){let H=Y.slice(0,z),j=Y.slice(z).replace(U,(B)=>B.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));Y=H+j}}return Y}function z4($,Z){let X=/<(script|style)\b[\s\S]*?<\/\1>/gi,J=[],Y;while((Y=X.exec($))!==null)J.push([Y.index,Y.index+Y[0].length]);let Q=new RegExp(Z.source,Z.flags.replace(/[gy]/g,"")),G=0;while(G<$.length){let q=Q.exec($.slice(G));if(!q)return-1;let W=G+q.index;if(!J.some(([U,z])=>W>=U&&W<z))return W;G=W+Math.max(q[0].length,1)}return-1}var w8="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function XG($){let Z=[];for(let X of $.split(",")){let J=X.trim();if(!J||J.startsWith("type "))continue;let Y=J.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(Y&&Y[1]!==Y[2])Z.push(`${Y[2]} = ${Y[1]}`)}if(Z.length===0)return w8;return`var ${Z.join(", ")}; ${w8}`}var JG=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function YG($){return $.replace(JG,(Z,X)=>XG(X))}import d0 from"path";import _4 from"fs";function E8($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function b8($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class y8{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,X,J){let Y=$.endsWith(".stx")?$.slice(0,-4):$,Q=J?.__importedComponents;if(Q){let j=[Y,Y.toLowerCase(),E8(Y),b8(Y)];for(let B of j)if(Q.has(B))return Q.get(B)}let G=[...new Set([`${Y}.stx`,`${E8(Y)}.stx`,`${b8(Y)}.stx`])];if(Y.startsWith("./")||Y.startsWith("../")){let j=d0.resolve(d0.dirname(Z),`${Y}.stx`);if(await t(j))return j;return null}let q=[],W=X.componentsDir||"",K=J?.__originalFilePath;if(K)q.push(d0.join(d0.dirname(K),"components"));if(W)q.push(W);let U=d0.join(d0.dirname(Z),"components");if(!q.includes(U))q.push(U);let z=process.cwd(),H=[d0.resolve(z,"src/components"),d0.resolve(z,"components"),d0.resolve(import.meta.dir,"components")];for(let j of H)if(!q.includes(j))q.push(j);for(let j of q){if(!j)continue;for(let B of G){let _=d0.join(j,B);if(await t(_))return _}try{if(!_4.statSync(j,{throwIfNoEntry:!1})?.isDirectory())continue;let _=_4.readdirSync(j,{withFileTypes:!0});for(let L of _)if(L.isDirectory()){let V=d0.join(j,L.name);for(let O of G){let F=d0.join(V,O);if(await t(F))return F}}}catch{}}return null}}var S0=new y8;function w0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var T1="\x00stx-boolean-attribute";function V4($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function a1($,Z){let X=[];for(let[J,Y]of Object.entries($.static)){if(Z.has(J))continue;let Q=$.staticNames?.[J]??J;if(typeof Y==="boolean"){if(Y)X.push(w0(Q));continue}if(Y===T1){X.push(w0(Q));continue}X.push(`${w0(Q)}="${w0(V4(String(Y)))}"`)}return X}function t1($,Z){let X=[];for(let[J,Y]of Object.entries($.serverDynamic??{})){if(Z.has(J))continue;if(Y===null||Y===void 0||Y===!1)continue;let Q=$.serverDynamicNames?.[J]??J;if(Y===!0){X.push(w0(Q));continue}if(typeof Y==="object")continue;X.push(`${w0(Q)}="${w0(V4(String(Y)))}"`)}return X}function I5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function QG($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var O4={name:"StxLink",aliases:["stx-link"],render($,Z,X){let J=QG($),Y=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",q=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,W=[];if(J.reactive)W.push(`:href="${I5(J.value)}"`);else W.push(`href="${I5(J.value)}"`);if(Y)W.push(`class="${I5(Y)}"`);if(W.push("data-stx-link"),W.push(`data-stx-active-class="${I5(Q)}"`),W.push(`data-stx-exact-active-class="${I5(G)}"`),q)W.push("data-stx-prefetch");let K=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);return W.push(...a1($,K)),W.push(...t1($,K)),`<a ${W.join(" ")}>${Z}</a>`}};import $5 from"fs";import F4 from"path";var GG=new Set([".jpg",".jpeg",".png",".webp",".avif"]),_1=new Map,e1=!1;function S8($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return _1.get(Z)}function JB(){return e1}function YB(){_1.clear(),e1=!1}function QB($,Z){_1.set($,Z),e1=!0}function qG($){let Z=0,X=0,J=0,Y=0;for(let G=0;G<$.length;G+=4)Z+=$[G],X+=$[G+1],J+=$[G+2],Y++;if(Y===0)return"#e5e7eb";let Q=(G)=>Math.round(G/Y).toString(16).padStart(2,"0");return`#${Q(Z)}${Q(X)}${Q(J)}`}function WG($,Z,X,J=4,Y=3){let Q=[];for(let G=0;G<Y;G++)for(let q=0;q<J;q++){let W=Math.floor(q*Z/J),K=Math.max(W+1,Math.floor((q+1)*Z/J)),U=Math.floor(G*X/Y),z=Math.max(U+1,Math.floor((G+1)*X/Y)),H=0,j=0,B=0,_=0;for(let V=U;V<z;V++)for(let O=W;O<K;O++){let F=(V*Z+O)*4;H+=$[F],j+=$[F+1],B+=$[F+2],_++}let L=(V)=>Math.round(V/_).toString(16).padStart(2,"0");Q.push(`<rect x="${q}" y="${G}" width="1" height="1" fill="#${L(H)}${L(j)}${L(B)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${J} ${Y}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${Q.join("")}</g></svg>`}function KG($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function UG($){try{return JSON.parse($5.readFileSync($,"utf8"))}catch{return{}}}function zG($,Z){try{$5.mkdirSync(F4.dirname($),{recursive:!0}),$5.writeFileSync($,JSON.stringify(Z))}catch{}}function C8($,Z,X=[]){let J;try{J=$5.readdirSync($,{withFileTypes:!0})}catch{return X}for(let Y of J){let Q=F4.join($,Y.name);if(Y.isDirectory()){C8(Q,`${Z}/${Y.name}`,X);continue}if(!GG.has(F4.extname(Y.name).toLowerCase()))continue;X.push([`${Z}/${Y.name}`,Q])}return X}async function GB($,Z={}){let{cachePath:X,maxBytes:J=33554432,limit:Y=2000}=Z;if(!$||!$5.existsSync($))return e1=!0,_1.size;let Q;try{Q=await import("ts-images")}catch{return e1=!0,_1.size}let G=X?UG(X):{},q=!1,W=C8($,"").slice(0,Y),K=8,U=async([z,H])=>{let j;try{j=$5.statSync(H)}catch{return}if(j.size>J)return;let B=G[z];if(B&&B.mtimeMs===j.mtimeMs&&B.size===j.size){_1.set(z,{dataUrl:B.dataUrl,color:B.color});return}try{let{hash:_}=await Q.generateThumbHash(H);if(!_)return;let{rgba:L,w:V,h:O}=Q.thumbHashToRGBA(_),F={dataUrl:KG(WG(L,V,O)),color:qG(L)};_1.set(z,F),G[z]={mtimeMs:j.mtimeMs,size:j.size,...F},q=!0}catch{}};for(let z=0;z<W.length;z+=K)await Promise.all(W.slice(z,z+K).map(U));if(X&&q)zG(X,G);return e1=!0,_1.size}var HG={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},L4=[320,640,768,1024,1280,1536,1920];function V0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function T$($,Z,X=!1){let J=$.serverDynamic[Z];if(J!==void 0)return J!==!1&&J!=="false";let Y=$.static[Z];if(Y!==void 0)return Y!=="false"&&Y!==!1;return X}function w4($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),X=[];for(let J of Z)if(J.includes(":")){let[Y,Q]=J.split(":"),G=HG[Y];if(G)X.push(`(max-width: ${G}px) ${Q}`);else{let q=Number.parseInt(Y);if(!Number.isNaN(q))X.push(`(max-width: ${q}px) ${Q}`)}}else X.push(J);return X.join(", ")}function R4($,Z,X,J){return Z.map((Y)=>`${T5($,Y,void 0,X,J)} ${Y}w`).join(", ")}function jG($,Z,X,J,Y){return Z.map((Q)=>{let G=X?X*Q:void 0;return`${T5($,G,void 0,J,Y)} ${Q}x`}).join(", ")}function T5($,Z,X,J,Y){if(!J||J==="local"||J==="static")return $;if(J==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(X)Q.push(`h_${X}`);if(Y)Q.push(`f_${Y}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(J==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(X)Q.set("h",String(X));if(Y)Q.set("fm",Y);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(J==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(X)Q.set("height",String(X));if(Y)Q.set("format",Y);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function BG($,Z,X="#e5e7eb"){let J=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${X}"/></svg>`;return`data:image/svg+xml;base64,${btoa(J)}`}var D4={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,X){let J=A0($,"src")||"",Y=P8(J),Q=A0($,"alt")||"",G=A0($,"width")||(Y?String(Y.source.width):void 0),q=A0($,"height")||(Y?String(Y.source.height):void 0),W=A0($,"sizes"),K=A0($,"srcset"),U=A0($,"densities"),z=A0($,"format"),H=A0($,"placeholder")||(Y?"thumbhash":void 0),j=A0($,"placeholderColor")||"#e5e7eb",B=A0($,"provider"),_=A0($,"class")||A0($,"className")||"",L=A0($,"style")||"",V=A0($,"quality"),O=T$($,"lazy",!0),F=T$($,"preload",!1),w=T$($,"priority",!1),R=A0($,"loading"),D=A0($,"decoding")||"async",N=!!Y||T$($,"picture",!1)||!!z,k=G?Number.parseInt(G):void 0,A=q?Number.parseInt(q):void 0,M=K||"",T="";if(Y)M=Y.sources[Y.fallback.format]||"",T=W?w4(W):"100vw";else if(!M&&W&&B&&B!=="local"&&B!=="static")M=R4(J,L4,B,z),T=w4(W);else if(!M&&U){let d=U.split(/\s+/).map((g)=>Number.parseFloat(g.replace("x","")));M=jG(J,d,k,B,z)}else if(W)T=w4(W);let I=[];if(L)I.push(L);if(k&&A)I.push(`aspect-ratio:${k}/${A}`);if(H==="blur"||H==="color"||H==="thumbhash"){let d=Y?.placeholder?{dataUrl:Y.placeholder.dataUrl,color:j}:S8(J);if(d&&H==="color")I.push(`background-color:${d.color}`);else if(d)I.push(`background-color:${d.color}`),I.push(`background-image:url(${d.dataUrl})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat");else{let g=BG(k||16,A||9,j);I.push(`background-image:url(${g})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat")}}else if(H&&H!=="empty"&&H!=="none")I.push(`background-image:url(${V0(H)})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat");let y=Y?.fallback.url||T5(J,k,A,B,z),E=[];if(E.push(`src="${V0(y)}"`),E.push(`alt="${V0(Q)}"`),G)E.push(`width="${V0(G)}"`);if(q)E.push(`height="${V0(q)}"`);let b=R||(w||F?"eager":O?"lazy":"");if(b)E.push(`loading="${V0(b)}"`);if(w)E.push('fetchpriority="high"');if(E.push(`decoding="${V0(D)}"`),_)E.push(`class="${V0(_)}"`);if(I.length>0)E.push(`style="${V0(I.join(";"))}"`);if(M)E.push(`srcset="${V0(M)}"`);if(T)E.push(`sizes="${V0(T)}"`);let S=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);E.push(...a1($,S)),E.push(...t1($,S));let v=`<img ${E.join(" ")} />`,x="";if(F){let g=z==="webp"?"image/webp":z==="avif"?"image/avif":"";x=`<link rel="preload" as="image" href="${V0(y)}"${g?` type="${g}"`:""}${M?` imagesrcset="${V0(M)}"`:""}${T?` imagesizes="${V0(T)}"`:""} />
3554
- `}if(N){let d=[];if(Y)for(let g of["avif","webp"]){let X0=Y.sources[g];if(X0)d.push(`<source type="image/${g}" srcset="${V0(X0)}"${T?` sizes="${V0(T)}"`:""} />`)}if(!Y&&(z==="avif"||z==="auto")){let g=T5(J,k,A,B,"avif"),X0=M?R4(J,L4,B,"avif"):`${g}`;d.push(`<source type="image/avif" srcset="${V0(X0)}"${T?` sizes="${V0(T)}"`:""} />`)}if(!Y&&(z==="webp"||z==="auto")){let g=T5(J,k,A,B,"webp"),X0=M?R4(J,L4,B,"webp"):`${g}`;d.push(`<source type="image/webp" srcset="${V0(X0)}"${T?` sizes="${V0(T)}"`:""} />`)}return`${x}<picture>
3553
+ ${G}`}let W=Y.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i),K=W&&/data-stx/.test(W[1]);if(!G&&!K&&W&&!/data-stx-auto/.test(W[1])){let U=/<body[^>]*>/i,z=z4(Y,U);if(z!==-1){let H=Y.slice(0,z),j=Y.slice(z).replace(U,(B)=>B.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));Y=H+j}}return Y}function z4($,Z){let X=/<(script|style)\b[\s\S]*?<\/\1>/gi,J=[],Y;while((Y=X.exec($))!==null)J.push([Y.index,Y.index+Y[0].length]);let Q=new RegExp(Z.source,Z.flags.replace(/[gy]/g,"")),G=0;while(G<$.length){let q=Q.exec($.slice(G));if(!q)return-1;let W=G+q.index;if(!J.some(([U,z])=>W>=U&&W<z))return W;G=W+Math.max(q[0].length,1)}return-1}var w8="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function XG($){let Z=[];for(let X of $.split(",")){let J=X.trim();if(!J||J.startsWith("type "))continue;let Y=J.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(Y&&Y[1]!==Y[2])Z.push(`${Y[2]} = ${Y[1]}`)}if(Z.length===0)return w8;return`var ${Z.join(", ")}; ${w8}`}var JG=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function YG($){return $.replace(JG,(Z,X)=>XG(X))}import d0 from"path";import _4 from"fs";function E8($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function b8($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class y8{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,X,J){let Y=$.endsWith(".stx")?$.slice(0,-4):$,Q=J?.__importedComponents;if(Q){let j=[Y,Y.toLowerCase(),E8(Y),b8(Y)];for(let B of j)if(Q.has(B))return Q.get(B)}let G=[...new Set([`${Y}.stx`,`${E8(Y)}.stx`,`${b8(Y)}.stx`])];if(Y.startsWith("./")||Y.startsWith("../")){let j=d0.resolve(d0.dirname(Z),`${Y}.stx`);if(await t(j))return j;return null}let q=[],W=X.componentsDir||"",K=J?.__originalFilePath;if(K)q.push(d0.join(d0.dirname(K),"components"));if(W)q.push(W);let U=d0.join(d0.dirname(Z),"components");if(!q.includes(U))q.push(U);let z=process.cwd(),H=[d0.resolve(z,"src/components"),d0.resolve(z,"components"),d0.resolve(import.meta.dir,"components")];for(let j of H)if(!q.includes(j))q.push(j);for(let j of q){if(!j)continue;for(let B of G){let _=d0.join(j,B);if(await t(_))return _}try{if(!_4.statSync(j,{throwIfNoEntry:!1})?.isDirectory())continue;let _=_4.readdirSync(j,{withFileTypes:!0});for(let L of _)if(L.isDirectory()){let V=d0.join(j,L.name);for(let O of G){let F=d0.join(V,O);if(await t(F))return F}}}catch{}}return null}}var S0=new y8;function w0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var T1="\x00stx-boolean-attribute";function V4($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function a1($,Z){let X=[];for(let[J,Y]of Object.entries($.static)){if(Z.has(J))continue;let Q=$.staticNames?.[J]??J;if(typeof Y==="boolean"){if(Y)X.push(w0(Q));continue}if(Y===T1){X.push(w0(Q));continue}X.push(`${w0(Q)}="${w0(V4(String(Y)))}"`)}return X}function t1($,Z){let X=[];for(let[J,Y]of Object.entries($.serverDynamic??{})){if(Z.has(J))continue;if(Y===null||Y===void 0||Y===!1)continue;let Q=$.serverDynamicNames?.[J]??J;if(Y===!0){X.push(w0(Q));continue}if(typeof Y==="object")continue;X.push(`${w0(Q)}="${w0(V4(String(Y)))}"`)}return X}function I5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function QG($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var O4={name:"StxLink",aliases:["stx-link"],render($,Z,X){let J=QG($),Y=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",q=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,W=[];if(J.reactive)W.push(`:href="${I5(J.value)}"`);else W.push(`href="${I5(J.value)}"`);if(Y)W.push(`class="${I5(Y)}"`);if(W.push("data-stx-link"),W.push(`data-stx-active-class="${I5(Q)}"`),W.push(`data-stx-exact-active-class="${I5(G)}"`),q)W.push("data-stx-prefetch");let K=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);return W.push(...a1($,K)),W.push(...t1($,K)),`<a ${W.join(" ")}>${Z}</a>`}};import $5 from"fs";import F4 from"path";var GG=new Set([".jpg",".jpeg",".png",".webp",".avif"]),_1=new Map,e1=!1;function S8($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return _1.get(Z)}function YB(){return e1}function QB(){_1.clear(),e1=!1}function GB($,Z){_1.set($,Z),e1=!0}function qG($){let Z=0,X=0,J=0,Y=0;for(let G=0;G<$.length;G+=4)Z+=$[G],X+=$[G+1],J+=$[G+2],Y++;if(Y===0)return"#e5e7eb";let Q=(G)=>Math.round(G/Y).toString(16).padStart(2,"0");return`#${Q(Z)}${Q(X)}${Q(J)}`}function WG($,Z,X,J=4,Y=3){let Q=[];for(let G=0;G<Y;G++)for(let q=0;q<J;q++){let W=Math.floor(q*Z/J),K=Math.max(W+1,Math.floor((q+1)*Z/J)),U=Math.floor(G*X/Y),z=Math.max(U+1,Math.floor((G+1)*X/Y)),H=0,j=0,B=0,_=0;for(let V=U;V<z;V++)for(let O=W;O<K;O++){let F=(V*Z+O)*4;H+=$[F],j+=$[F+1],B+=$[F+2],_++}let L=(V)=>Math.round(V/_).toString(16).padStart(2,"0");Q.push(`<rect x="${q}" y="${G}" width="1" height="1" fill="#${L(H)}${L(j)}${L(B)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${J} ${Y}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${Q.join("")}</g></svg>`}function KG($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function UG($){try{return JSON.parse($5.readFileSync($,"utf8"))}catch{return{}}}function zG($,Z){try{$5.mkdirSync(F4.dirname($),{recursive:!0}),$5.writeFileSync($,JSON.stringify(Z))}catch{}}function C8($,Z,X=[]){let J;try{J=$5.readdirSync($,{withFileTypes:!0})}catch{return X}for(let Y of J){let Q=F4.join($,Y.name);if(Y.isDirectory()){C8(Q,`${Z}/${Y.name}`,X);continue}if(!GG.has(F4.extname(Y.name).toLowerCase()))continue;X.push([`${Z}/${Y.name}`,Q])}return X}async function qB($,Z={}){let{cachePath:X,maxBytes:J=33554432,limit:Y=2000}=Z;if(!$||!$5.existsSync($))return e1=!0,_1.size;let Q;try{Q=await import("ts-images")}catch{return e1=!0,_1.size}let G=X?UG(X):{},q=!1,W=C8($,"").slice(0,Y),K=8,U=async([z,H])=>{let j;try{j=$5.statSync(H)}catch{return}if(j.size>J)return;let B=G[z];if(B&&B.mtimeMs===j.mtimeMs&&B.size===j.size){_1.set(z,{dataUrl:B.dataUrl,color:B.color});return}try{let{hash:_}=await Q.generateThumbHash(H);if(!_)return;let{rgba:L,w:V,h:O}=Q.thumbHashToRGBA(_),F={dataUrl:KG(WG(L,V,O)),color:qG(L)};_1.set(z,F),G[z]={mtimeMs:j.mtimeMs,size:j.size,...F},q=!0}catch{}};for(let z=0;z<W.length;z+=K)await Promise.all(W.slice(z,z+K).map(U));if(X&&q)zG(X,G);return e1=!0,_1.size}var HG={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},L4=[320,640,768,1024,1280,1536,1920];function V0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function T$($,Z,X=!1){let J=$.serverDynamic[Z];if(J!==void 0)return J!==!1&&J!=="false";let Y=$.static[Z];if(Y!==void 0)return Y!=="false"&&Y!==!1;return X}function jG($){let Z=(J)=>$.variants.filter((Y)=>Y.format===J).reduce((Y,Q)=>Y+Q.bytes,0),X=Z($.fallback.format);return["avif","webp"].map((J)=>({format:J,srcset:$.sources[J]||"",bytes:Z(J)})).filter((J)=>J.srcset&&J.bytes>0&&J.bytes<X).sort((J,Y)=>J.bytes-Y.bytes).map(({format:J,srcset:Y})=>({format:J,srcset:Y}))}function w4($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),X=[];for(let J of Z)if(J.includes(":")){let[Y,Q]=J.split(":"),G=HG[Y];if(G)X.push(`(max-width: ${G}px) ${Q}`);else{let q=Number.parseInt(Y);if(!Number.isNaN(q))X.push(`(max-width: ${q}px) ${Q}`)}}else X.push(J);return X.join(", ")}function R4($,Z,X,J){return Z.map((Y)=>`${T5($,Y,void 0,X,J)} ${Y}w`).join(", ")}function BG($,Z,X,J,Y){return Z.map((Q)=>{let G=X?X*Q:void 0;return`${T5($,G,void 0,J,Y)} ${Q}x`}).join(", ")}function T5($,Z,X,J,Y){if(!J||J==="local"||J==="static")return $;if(J==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(X)Q.push(`h_${X}`);if(Y)Q.push(`f_${Y}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(J==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(X)Q.set("h",String(X));if(Y)Q.set("fm",Y);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(J==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(X)Q.set("height",String(X));if(Y)Q.set("format",Y);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function _G($,Z,X="#e5e7eb"){let J=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${X}"/></svg>`;return`data:image/svg+xml;base64,${btoa(J)}`}var D4={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,X){let J=A0($,"src")||"",Y=P8(J),Q=A0($,"alt")||"",G=A0($,"width")||(Y?String(Y.source.width):void 0),q=A0($,"height")||(Y?String(Y.source.height):void 0),W=A0($,"sizes"),K=A0($,"srcset"),U=A0($,"densities"),z=A0($,"format"),H=A0($,"placeholder")||(Y?"thumbhash":void 0),j=A0($,"placeholderColor")||"#e5e7eb",B=A0($,"provider"),_=A0($,"class")||A0($,"className")||"",L=A0($,"style")||"",V=A0($,"quality"),O=T$($,"lazy",!0),F=T$($,"preload",!1),w=T$($,"priority",!1),R=A0($,"loading"),D=A0($,"decoding")||"async",N=!!Y||T$($,"picture",!1)||!!z,k=G?Number.parseInt(G):void 0,A=q?Number.parseInt(q):void 0,M=K||"",T="";if(Y)M=Y.sources[Y.fallback.format]||"",T=W?w4(W):"100vw";else if(!M&&W&&B&&B!=="local"&&B!=="static")M=R4(J,L4,B,z),T=w4(W);else if(!M&&U){let d=U.split(/\s+/).map((g)=>Number.parseFloat(g.replace("x","")));M=BG(J,d,k,B,z)}else if(W)T=w4(W);let I=[];if(L)I.push(L);if(k&&A)I.push(`aspect-ratio:${k}/${A}`);if(H==="blur"||H==="color"||H==="thumbhash"){let d=Y?.placeholder?{dataUrl:Y.placeholder.dataUrl,color:j}:S8(J);if(d&&H==="color")I.push(`background-color:${d.color}`);else if(d)I.push(`background-color:${d.color}`),I.push(`background-image:url(${d.dataUrl})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat");else{let g=_G(k||16,A||9,j);I.push(`background-image:url(${g})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat")}}else if(H&&H!=="empty"&&H!=="none")I.push(`background-image:url(${V0(H)})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat");let y=Y?.fallback.url||T5(J,k,A,B,z),E=[];if(E.push(`src="${V0(y)}"`),E.push(`alt="${V0(Q)}"`),G)E.push(`width="${V0(G)}"`);if(q)E.push(`height="${V0(q)}"`);let b=R||(w||F?"eager":O?"lazy":"");if(b)E.push(`loading="${V0(b)}"`);if(w)E.push('fetchpriority="high"');if(E.push(`decoding="${V0(D)}"`),_)E.push(`class="${V0(_)}"`);if(I.length>0)E.push(`style="${V0(I.join(";"))}"`);if(M)E.push(`srcset="${V0(M)}"`);if(T)E.push(`sizes="${V0(T)}"`);let S=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);E.push(...a1($,S)),E.push(...t1($,S));let v=`<img ${E.join(" ")} />`,x="";if(F){let g=z==="webp"?"image/webp":z==="avif"?"image/avif":"";x=`<link rel="preload" as="image" href="${V0(y)}"${g?` type="${g}"`:""}${M?` imagesrcset="${V0(M)}"`:""}${T?` imagesizes="${V0(T)}"`:""} />
3554
+ `}if(N){let d=[];if(Y)for(let g of jG(Y))d.push(`<source type="image/${g.format}" srcset="${V0(g.srcset)}"${T?` sizes="${V0(T)}"`:""} />`);if(!Y&&(z==="avif"||z==="auto")){let g=T5(J,k,A,B,"avif"),Q0=M?R4(J,L4,B,"avif"):`${g}`;d.push(`<source type="image/avif" srcset="${V0(Q0)}"${T?` sizes="${V0(T)}"`:""} />`)}if(!Y&&(z==="webp"||z==="auto")){let g=T5(J,k,A,B,"webp"),Q0=M?R4(J,L4,B,"webp"):`${g}`;d.push(`<source type="image/webp" srcset="${V0(Q0)}"${T?` sizes="${V0(T)}"`:""} />`)}return`${x}<picture>
3555
3555
  ${d.join(`
3556
3556
  `)}
3557
3557
  ${v}
3558
- </picture>`}return`${x}${v}`}};var v8="/images/safe-image-default.svg";function E5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Z5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var _G=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${v8}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,N4={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,X){let J=Z5($,"src")||"",Y=Z5($,"alt")||"",Q=Z5($,"fallback")||v8,G=Z5($,"class")||Z5($,"className")||"",q=Z5($,"fallbackClassName")||"",W=[];if(W.push(`src="${E5(J)}"`),W.push(`alt="${E5(Y)}"`),G)W.push(`class="${E5(G)}"`);if(W.push(`data-fallback="${E5(Q)}"`),q)W.push(`data-fallback-class="${E5(q)}"`);W.push('onerror="window.__stxSafeImageHandler(this)"');let K=new Set(["src","alt","fallback","class","className","fallbackClassName"]);W.push(...a1($,K)),W.push(...t1($,K));let U=`<img ${W.join(" ")} />`,z=X.context;if(!z.__safeImageHandlerEmitted)return z.__safeImageHandlerEmitted=!0,`${_G}${U}`;return U}};function A4($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function b5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function E$($,Z,X){let J=b5($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var M4={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,X){let J=A4(b5($,"color")||"#6366f1"),Y=A4(b5($,"initialColor")||b5($,"initial-color")||""),Q=A4(b5($,"height")||"3px"),G=E$($,"duration",2000),q=E$($,"throttle",200),W=E$($,"zIndex",999999)||E$($,"z-index",999999),K=Y?`linear-gradient(to right, ${Y}, ${J})`:J;return`
3558
+ </picture>`}return`${x}${v}`}};var v8="/images/safe-image-default.svg";function E5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Z5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var VG=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${v8}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,N4={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,X){let J=Z5($,"src")||"",Y=Z5($,"alt")||"",Q=Z5($,"fallback")||v8,G=Z5($,"class")||Z5($,"className")||"",q=Z5($,"fallbackClassName")||"",W=[];if(W.push(`src="${E5(J)}"`),W.push(`alt="${E5(Y)}"`),G)W.push(`class="${E5(G)}"`);if(W.push(`data-fallback="${E5(Q)}"`),q)W.push(`data-fallback-class="${E5(q)}"`);W.push('onerror="window.__stxSafeImageHandler(this)"');let K=new Set(["src","alt","fallback","class","className","fallbackClassName"]);W.push(...a1($,K)),W.push(...t1($,K));let U=`<img ${W.join(" ")} />`,z=X.context;if(!z.__safeImageHandlerEmitted)return z.__safeImageHandlerEmitted=!0,`${VG}${U}`;return U}};function A4($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function b5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function E$($,Z,X){let J=b5($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var M4={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,X){let J=A4(b5($,"color")||"#6366f1"),Y=A4(b5($,"initialColor")||b5($,"initial-color")||""),Q=A4(b5($,"height")||"3px"),G=E$($,"duration",2000),q=E$($,"throttle",200),W=E$($,"zIndex",999999)||E$($,"z-index",999999),K=Y?`linear-gradient(to right, ${Y}, ${J})`:J;return`
3559
3559
  <div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${Q};background:${K};z-index:${W};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
3560
3560
  <div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
3561
3561
  </div>
3562
3562
  <style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
3563
3563
  <script>
3564
3564
  (function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${q})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
3565
- </script>`}};function x8($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function VG($,Z,X){let J=x8($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var f8={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},k4={name:"StxToast",aliases:["stx-toast"],render($,Z,X){let J=w0(x8($,"position")||"top-right"),Y=VG($,"max",5),Q=f8[J]||f8["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${J}" data-stx-toast-max="${Y}" style="position:fixed;${Q};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
3565
+ </script>`}};function x8($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function OG($,Z,X){let J=x8($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var f8={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},k4={name:"StxToast",aliases:["stx-toast"],render($,Z,X){let J=w0(x8($,"position")||"top-right"),Y=OG($,"max",5),Q=f8[J]||f8["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${J}" data-stx-toast-max="${Y}" style="position:fixed;${Q};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
3566
3566
  <style>
3567
3567
  @keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
3568
3568
  @keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
@@ -3588,14 +3588,14 @@ ${v}
3588
3588
  @media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
3589
3589
  .stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
3590
3590
  .stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
3591
- </style>`}};import{existsSync as OG,readFileSync as FG}from"fs";var E1=new Map,u8=new Set;function d8($){if(u8.has($))return;u8.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function m8($){let Z=process.cwd();for(let X of[`${Z}/node_modules/@iconify-json/${$}/icons.json`,`${Z}/pantry/@iconify-json/${$}/icons.json`,`${Z}/node_modules/@iconify/json/json/${$}.json`,`${Z}/pantry/@iconify/json/json/${$}.json`])if(OG(X))return X;for(let X of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return f.resolve(X)}catch{}return null}function LG($){if(E1.has($))return E1.get($);let Z=m8($);if(!Z)return d8($),null;try{let X=JSON.parse(FG(Z,"utf8"));return E1.set($,X.icons),X.icons}catch{return null}}async function wG($,Z=!1){if(E1.has($))return E1.get($);let X=m8($);if(!X){if(!Z)d8($);return null}try{let J=await Bun.file(X).json();return E1.set($,J.icons),J.icons}catch{return null}}function J5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);if($.static[Z]!==void 0)return String($.static[Z]);if($.clientReactive[Z]!==void 0)return $.clientReactive[Z];return}var E4={name:"Icon",aliases:["icon","stx-icon"],render($,Z,X){let J=J5($,"name")??J5($,"icon");if(!J)return"<!-- Icon: missing name/icon prop -->";let Y="lucide",Q=J;if(J.includes(":")){let O=J.split(":");Y=O[0],Q=O[1]}let G=w0(J5($,"size")||"24"),q=w0(J5($,"color")||"currentColor"),W=w0(J5($,"class")||""),K=w0(J5($,"style")||""),U=E1.get(Y)??LG(Y);if(!U)return`<!-- Icon: collection "${Y}" not loaded -->`;let z=U[Q];if(!z)return`<!-- Icon: "${Q}" not found in ${Y} -->`;let H=z.width||24,j=z.height||24,B=`0 0 ${H} ${j}`,_=z.body;if(q!=="currentColor")_=_.replace(/currentColor/g,q);let L=W?` class="${W}"`:"",V=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${B}" fill="none"${L}${V}>${_}</svg>`}};async function RG($="lucide",Z={}){await wG($,Z.speculative??!0)}function l8($,...Z){for(let X of Z){if($.serverDynamic[X]!==void 0)return String($.serverDynamic[X]);let J=$.static[X];if(typeof J==="string")return J}return}function c8($,Z){let X=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${Z}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),J=$.match(X);if(!J)return{region:null,rest:$};return{region:J[2],rest:$.replace(J[0],"")}}var b4={name:"Suspense",aliases:["suspense"],render($,Z,X){let J=c8(Z,"fallback"),Y=J.rest,Q=c8(Y,"error"),G=Q.rest,q=J.region??l8($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',W=Q.region??l8($,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${q}</div><div data-stx-suspense-error hidden>${W}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function y$($,...Z){for(let X of Z){if($.serverDynamic[X]!==void 0)return String($.serverDynamic[X]);let J=$.static[X];if(typeof J==="string")return J}return}var y4={name:"TransitionGroup",aliases:["transition-group"],render($,Z,X){let J=(y$($,"name")||"v").replace(/["'<>]/g,""),Y=(y$($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Q=y$($,"class"),G=y$($,"id"),q=[`data-stx-transition-group="${J}"`,Q?`class="${Q}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Y} ${q}>${Z}</${Y}>`}};function p8(){S0.registerBuiltin(O4),S0.registerBuiltin(D4),S0.registerBuiltin(N4),S0.registerBuiltin(M4),S0.registerBuiltin(k4),S0.registerBuiltin(I4),S0.registerBuiltin(T4),S0.registerBuiltin(E4),S0.registerBuiltin(b4),S0.registerBuiltin(y4)}function S$($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}function i8($,Z,X){let J=[],Y=0;while(Y<$.length){let Q=$.indexOf("<",Y);if(Q===-1)break;let q=$.slice(Q+1).match(new RegExp(`^(${Z.source})(?![\\w.:-])`));if(!q){Y=Q+1;continue}let W=q[1];if(X&&X.has(W.toLowerCase())){let _=Q+1+W.length;while(_<$.length&&$[_]!==">")_++;Y=_+1;continue}let K=Q+1+W.length,U=null,z=K,H=-1,j=!1;while(K<$.length){let _=$[K];if(U){if(_==="\\"&&K+1<$.length){K+=2;continue}if(_===U)U=null;K++;continue}if(_==='"'||_==="'"){U=_,K++;continue}if(_==="/"&&K+1<$.length&&$[K+1]===">"){H=K+2,j=!0;break}if(_===">"){H=K+1;break}K++}if(H===-1){Y=Q+1;continue}let B=$.slice(z,j?H-2:H-1).trim();if(j)J.push({fullMatch:$.slice(Q,H),tagName:W,attributes:B,content:"",startIndex:Q,endIndex:H,isSelfClosing:!0}),Y=H;else{let _=`<${W}`,L=`</${W}>`,V=1,O=H,F=-1;while(V>0&&O<$.length){let D=$.indexOf(_,O),N=$.indexOf(L,O);if(N===-1)break;if(D!==-1&&D<N){let k=$[D+_.length];if(k===" "||k===">"||k==="/"||k===`
3592
- `||k==="\t")V++;O=D+_.length}else{if(V--,V===0){F=N;break}O=N+L.length}}if(F===-1){Y=H;continue}let w=$.slice(H,F),R=F+L.length;J.push({fullMatch:$.slice(Q,R),tagName:W,attributes:B,content:w,startIndex:Q,endIndex:R,isSelfClosing:!1}),Y=R}}return J}function n8($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function s8($,Z){try{let X=Buffer.from($,"base64").toString("utf8");return JSON.parse(X)}catch{}try{let X=$.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(X)}catch(X){if(Z?.debug)console.error("Error decoding __stx_ prop:",X);return $}}import P$ from"fs";import g0 from"path";var o8=!1,DG=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function NG($,Z,X){let J={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},Y=new Set(Array.isArray(Z.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),Q=(K)=>{if(Y.size===0)return!1;let U=c0(K),z=U.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(z&&Y.has(z))return!0;for(let H of Y){let j=H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${j}\\s*\\(`).test(U))return!0}return!1},G=new Set(e8),q=(K)=>{if(!K.includes("-")||K.startsWith("@")||K.startsWith(":")||K.startsWith("x-")||K.startsWith("__"))return K;if(K.startsWith("aria-")||K.startsWith("data-"))return K;return K.replace(/-([a-z0-9])/g,(U,z)=>z.toUpperCase())},W=(K,U)=>{let z=q(K);if(J.static[z]=U,z!==K)J.staticNames[z]=K};for(let[K,U]of Object.entries($)){let z=K.startsWith("x-")&&!G.has(K)&&!K.startsWith("x-bind:")&&!K.startsWith("x-on:")?`:${K.slice(2)}`:K;if(z.startsWith("@")){J.events[z]=U;continue}if(z.startsWith("__stx_")){let H=q(z.slice(6));J.serverDynamic[H]=s8(U,X);continue}if(z.startsWith(":")){let H=q(z.slice(1)),j=U===T1?H:U;if(H==="if"||H==="for"||H==="show"){J.clientReactive[H]=j;continue}if(Q(j)){J.clientReactive[H]=j;continue}try{if(!q0(j)){if(X.debug)console.error(`Unsafe expression in :${H} binding: ${j}`);J.clientReactive[H]=j;continue}let B=Object.keys(Z),L=W0(j,B)(...Object.values(Z));if(L===void 0){let V=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(l5(j).some((F)=>!V.has(F)&&!B.includes(F))){J.clientReactive[H]=j;continue}}if(J.serverDynamic[H]=L,H!==z.slice(1)&&J.serverDynamicNames)J.serverDynamicNames[H]=z.slice(1)}catch{J.clientReactive[H]=j}continue}if(typeof U==="string"&&U.includes("{{")&&U.includes("}}")){let H=U.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(H)try{let j=H[1];if(q0(j)){let _=W0(j,Object.keys(Z))(...Object.values(Z));W(z,_!=null?String(_):"")}else{if(X.debug)console.error(`Unsafe expression in ${z}: ${j}`);W(z,U)}}catch(j){if(X.debug)console.error(`Error evaluating expression for ${z}:`,j);W(z,U)}else{let j=U,B=/\{\{\s*([\s\S]+?)\s*\}\}/g,_;while((_=B.exec(U))!==null)try{let L=_[1];if(!q0(L)){if(X.debug)console.error(`Unsafe expression in ${z}: ${L}`);continue}let O=W0(L,Object.keys(Z))(...Object.values(Z));j=j.replace(_[0],String(O??""))}catch(L){if(X.debug)console.error(`Error evaluating expression in ${z}:`,L)}W(z,j)}continue}W(z,U===T1?"true":n8(U))}return J}var AG=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function MG($,Z,X){if(!$.includes("@"))return $;if(!AG.some(([Y,Q])=>Y.test($)&&$.includes(Q)))return $;try{return X1($,Z,X)}catch{return $}}function kG($){let Z={},X=0,J=$.length;while(X<J){while(X<J&&/\s/.test($[X]))X++;if(X>=J)break;let Y="";while(X<J&&!/[\s=]/.test($[X]))Y+=$[X],X++;if(!Y)break;while(X<J&&/\s/.test($[X]))X++;if(X<J&&$[X]==="="){X++;while(X<J&&/\s/.test($[X]))X++;let Q="";if(X<J&&($[X]==='"'||$[X]==="'")){let G=$[X];X++;while(X<J){let q=$[X];if(q==="\\"&&X+1<J){X++,Q+=$[X],X++;continue}if(q===G){X++;break}Q+=q,X++}}else while(X<J&&!/\s/.test($[X]))Q+=$[X],X++;Z[Y]=Q}else Z[Y]=T1}return Z}function r8($){return Object.entries($).map(([Z,X])=>X===T1?Z:`${Z}="${IG(X)}"`).join(" ")}function IG($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function TG($){let Z=new Set,X=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,J;while((J=X.exec($))!==null){let Y=J[1];if(S0.isBuiltin(Y))Z.add(Y)}return[...Z].sort()}var a8=new Map;function EG($){let Z=a8.get($);if(Z)return Z;let X=new Map,J=[g0.join($,"src"),g0.join($,"dist"),$];function Y(Q,G){if(G>6)return;let q;try{q=P$.readdirSync(Q,{withFileTypes:!0})}catch{return}for(let W of q){let K=g0.join(Q,W.name);if(W.isDirectory()){if(W.name==="node_modules"||W.name.startsWith("."))continue;Y(K,G+1)}else if(W.isFile()&&W.name.endsWith(".stx")){let U=W.name.slice(0,-4);if(!X.has(U))X.set(U,K);let z=U.toLowerCase();if(!X.has(z))X.set(z,K);let H=U.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!X.has(H))X.set(H,K)}}}for(let Q of J)if(Y(Q,0),X.size>0)break;return a8.set($,X),X}function bG($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let X=Z;while(!0){let J=g0.join(X,"node_modules",$);try{if(P$.statSync(J).isDirectory())return J}catch{}let Y=g0.dirname(X);if(Y===X)return null;X=Y}}async function yG($,Z,X,J,Y){if(!$.includes("import"))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Q=Z.__importedComponents,G=g0.dirname(X),q=$,W=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;return q=q.replace(W,(K,U,z)=>{let H=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,j=z,B,_=[];while((B=H.exec(z))!==null){let[L,V,O,F]=B,w=null,R=null;if(F.startsWith(".")||F.startsWith("/")){let k=g0.resolve(G,F);if(k.endsWith(".stx"))R=k;else{let A=`${k}.stx`;try{if(P$.statSync(A).isFile())R=A}catch{try{if(P$.statSync(k).isDirectory())w=k}catch{}}}}else w=bG(F,G);if(!w&&!R)continue;let D=!1,N=(k,A)=>{Q.set(k,A),Q.set(k.toLowerCase(),A);let M=k.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();Q.set(M,A),Y.add(A)};if(O&&R)N(O,R),D=!0;else if(V){let k=V.slice(1,-1).split(",").map((M)=>M.trim()).filter(Boolean).map((M)=>{let T=M.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(T)return{source:T[1],local:T[2]};return{source:M,local:M}}),A=w?EG(w):null;for(let{source:M,local:T}of k){let I=null;if(R)I=R;else if(A)I=A.get(M)??A.get(M.toLowerCase())??A.get(M.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(I)N(T,I),D=!0}}if(D)_.push({start:B.index,end:B.index+L.length})}if(_.length===0)return K;for(let L=_.length-1;L>=0;L--)j=j.slice(0,_[L].start)+j.slice(_[L].end);return`<script${U}>${j}</script>`}),q}async function SG($,Z,X,J,Y){let Q=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,q=/@import\s*\(\s*([^)]+)\s*\)/g,W;while((W=q.exec(Q))!==null){let[K,U]=W,z=U.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of z){let j=H.split("/"),_=j[j.length-1].replace(/\.stx$/,""),L=_.includes("-")?_.split("-").map((F)=>F.charAt(0).toUpperCase()+F.slice(1)).join(""):_.charAt(0).toUpperCase()+_.slice(1),V=null,O=[g0.resolve(g0.dirname(X),`${H}.stx`),g0.resolve(g0.dirname(X),H),g0.resolve(J.componentsDir||"components",`${H}.stx`),g0.resolve(J.componentsDir||"components",H),H.endsWith(".stx")?H:`${H}.stx`];for(let F of O)try{if(await Bun.file(F).exists()){V=F;break}}catch{}if(V){G.set(L,V),G.set(_,V),G.set(_.toLowerCase(),V);let F=L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(F,V),Y.add(V),J.debug)console.log(`Imported component: ${L} -> ${V}`)}else if(J.debug)console.warn(`Could not resolve imported component: ${H}`)}Q=Q.replace(K,""),q.lastIndex=0}return Q}async function CG($,Z,X,J,Y){let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,W=/@component\s*\(/g,K;while((K=W.exec(Q))!==null){let U=K.index,z=U+K[0].length-1,H=1,j=z+1;while(j<Q.length&&H>0){if(Q[j]==="(")H++;else if(Q[j]===")"){if(H--,H===0)break}j++}if(H!==0)break;let B=Q.substring(z+1,j),_=j+1,L=B.match(/^\s*['"]([^'"]+)['"]/);if(!L){W.lastIndex=0;continue}let V=L[1],O,F=B.slice(L[0].length),w=F.match(/^\s*,\s*/);if(w)O=F.slice(w[0].length).trim();let R={};if(O)try{R=R0(O,Z)}catch(T){let I=T instanceof Error?T.message:String(T);Q=Q.replace(Q.substring(U,_),`[Error parsing component props: ${I}]`);continue}let D="",N=_,A=Q.substring(_).match(/^([\s\S]*?)@endcomponent/);if(A)D=A[1].trim(),N=_+A[0].length;let M=await I1(V,R,D,G,Z,X,J,q,Y);Q=Q.substring(0,U)+M+Q.substring(N),W.lastIndex=0}return Q}async function PG($,Z,X,J,Y){if(!$)return $;let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,W=r0(Q);return Q=W.output,Q=await H(Q,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),Q=await H(Q,/[A-Z][a-zA-Z0-9]*/,!0),Q=await H(Q,/[a-z][a-z0-9]*/,!1,DG),Q=P1(Q,W.scripts),Q;async function H(j,B,_,L){if(!j)return j;let V=j,O=i8(V,B,L);for(let F=O.length-1;F>=0;F--){let w=O[F],R=_?S$(w.tagName):w.tagName,D=kG(MG(w.attributes,Z,X)),N=NG(D,Z,J),k=S0.getBuiltin(w.tagName),A=k?await C$(R,G,Z,X,J):!1;if(k&&!A){let y={context:Z,filePath:X,options:J,dependencies:Y},E=k.render(N,w.content,y);if(Object.keys(N.events).length>0){let b=r8(N.events);E=E.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${b}`)}if(Object.keys(N.clientReactive).length>0)E=t8(E,N.clientReactive);V=V.substring(0,w.startIndex)+E+V.substring(w.endIndex);continue}if(!_&&w.tagName.includes("-")&&!await C$(R,G,Z,X,J))continue;let M={};for(let[y,E]of Object.entries(N.static))M[y]=E;for(let[y,E]of Object.entries(N.serverDynamic))M[y]=E;let I=await I1(R,M,P1(w.content,W.scripts),G,Z,X,J,q,Y);if(Object.keys(N.events).length>0){let y=$2(I);if(y){let E=r8(N.events),b=Object.keys(N.events).map((S)=>S.replace(/^@/,"").split(".")[0]).join(" ");I=I.substring(0,y.insertPos)+` data-stx-parent-events="${b}" ${E}`+I.substring(y.insertPos)}}if(Object.keys(N.clientReactive).length>0)I=t8(I,N.clientReactive);V=V.substring(0,w.startIndex)+I+V.substring(w.endIndex)}return V}}function t8($,Z){let X=new Set(["if","for"]),J=new Set(["show"]),Y=Object.entries(Z).filter(([U])=>!X.has(U)),Q=Y.filter(([U])=>!J.has(U)).map(([U])=>S$(U)).join(" "),G=$,q=Y.length>0?$2(G):null;if(q){let U=Y.map(([H,j])=>`:${S$(H)}="${j.replace(/"/g,"&quot;")}"`).join(" "),z=Q?` data-stx-parent-bindings="${Q}"`:"";G=G.substring(0,q.insertPos)+`${z} ${U}`+G.substring(q.insertPos)}let W=Z.if;if(W)G=`<template :if="${W.replace(/"/g,"&quot;")}">${G}</template>`;let K=Z.for;if(K)G=`<template :for="${K.replace(/"/g,"&quot;")}">${G}</template>`;return G}function $2($){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec($);if(Z)return{insertPos:Z.index+1+Z[1].length};let X=0;while(X<$.length){let J=$.slice(X),Y=J.match(/^\s+/);if(Y){X+=Y[0].length;continue}if(J.startsWith("<!--")){let q=$.indexOf("-->",X+4);if(q===-1)return null;X=q+3;continue}let Q=J.match(/^<(script|style)\b[^>]*>/i);if(Q){let q=`</${Q[1].toLowerCase()}>`,W=$.toLowerCase().indexOf(q,X+Q[0].length);if(W===-1)return null;X=W+q.length;continue}let G=J.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!G)return null;return{insertPos:X+1+G[1].length}}return null}async function S4($,Z,X,J,Y){if(!o8)p8(),o8=!0;let Q=await yG($,Z,X,J,Y);Q=await SG(Q,Z,X,J,Y),Q=await CG(Q,Z,X,J,Y);let G=[];for(let q=0;q<3;q++){let W=o0(Q,U5,(U,z)=>`\x00STX_COMPONENT_COMMENT_${G.length+z}\x00`);G.push(...W.tokens);let K=Q;if(Q=await PG(W.output,Z,X,J,Y),Q===K)break}if(G.length>0)Q=Q.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(q,W)=>G[Number(W)]??"");if(J.debug){let q=TG(Q);if(q.length>0)console.warn(`[stx] ${X}: unresolved component tag(s) after render passes: ${q.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return Q}import Q5 from"path";import Z2 from"process";function Y5($="STX_PUBLIC_"){let Z={},X={};for(let[J,Y]of Object.entries(Z2.env)){if(!J.startsWith($)||Y===void 0)continue;Z[`import.meta.env.${J}`]=JSON.stringify(Y),X[J]=Y}return Z["import.meta.env"]=JSON.stringify(X),Z}function __($="STX_PUBLIC_"){let Z={};for(let[X,J]of Object.entries(Z2.env))if(X.startsWith($)&&J!==void 0)Z[X]=J;return Z}function X2($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function J2($,Z,X){try{let J;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=Q5.join(Y,$);if(await Bun.file(G).exists())return G;Y=Q5.dirname(Y)}J=Q5.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))J=Q5.resolve(Z,$);else J=Q5.resolve(Z,$);if(await Bun.file(J).exists())return J;return null}catch{return null}}async function Y2($,Z,X){let J=$,Y=Q5.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(J))!==null){let[K,U,z,H]=G;if(X2(z))continue;let j=await J2(z,Y,Z);if(j)try{let B=await Bun.file(j).text();if(X.add(j),z.endsWith(".ts")||z.endsWith(".tsx")){let L=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:Y5()});if(L.outputs.length>0)B=await L.outputs[0].text()}let _=`<script>
3591
+ </style>`}};import{existsSync as FG,readFileSync as LG}from"fs";var E1=new Map,u8=new Set;function d8($){if(u8.has($))return;u8.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function m8($){let Z=process.cwd();for(let X of[`${Z}/node_modules/@iconify-json/${$}/icons.json`,`${Z}/pantry/@iconify-json/${$}/icons.json`,`${Z}/node_modules/@iconify/json/json/${$}.json`,`${Z}/pantry/@iconify/json/json/${$}.json`])if(FG(X))return X;for(let X of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return f.resolve(X)}catch{}return null}function wG($){if(E1.has($))return E1.get($);let Z=m8($);if(!Z)return d8($),null;try{let X=JSON.parse(LG(Z,"utf8"));return E1.set($,X.icons),X.icons}catch{return null}}async function RG($,Z=!1){if(E1.has($))return E1.get($);let X=m8($);if(!X){if(!Z)d8($);return null}try{let J=await Bun.file(X).json();return E1.set($,J.icons),J.icons}catch{return null}}function J5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);if($.static[Z]!==void 0)return String($.static[Z]);if($.clientReactive[Z]!==void 0)return $.clientReactive[Z];return}var E4={name:"Icon",aliases:["icon","stx-icon"],render($,Z,X){let J=J5($,"name")??J5($,"icon");if(!J)return"<!-- Icon: missing name/icon prop -->";let Y="lucide",Q=J;if(J.includes(":")){let O=J.split(":");Y=O[0],Q=O[1]}let G=w0(J5($,"size")||"24"),q=w0(J5($,"color")||"currentColor"),W=w0(J5($,"class")||""),K=w0(J5($,"style")||""),U=E1.get(Y)??wG(Y);if(!U)return`<!-- Icon: collection "${Y}" not loaded -->`;let z=U[Q];if(!z)return`<!-- Icon: "${Q}" not found in ${Y} -->`;let H=z.width||24,j=z.height||24,B=`0 0 ${H} ${j}`,_=z.body;if(q!=="currentColor")_=_.replace(/currentColor/g,q);let L=W?` class="${W}"`:"",V=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${B}" fill="none"${L}${V}>${_}</svg>`}};async function DG($="lucide",Z={}){await RG($,Z.speculative??!0)}function l8($,...Z){for(let X of Z){if($.serverDynamic[X]!==void 0)return String($.serverDynamic[X]);let J=$.static[X];if(typeof J==="string")return J}return}function c8($,Z){let X=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${Z}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),J=$.match(X);if(!J)return{region:null,rest:$};return{region:J[2],rest:$.replace(J[0],"")}}var b4={name:"Suspense",aliases:["suspense"],render($,Z,X){let J=c8(Z,"fallback"),Y=J.rest,Q=c8(Y,"error"),G=Q.rest,q=J.region??l8($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',W=Q.region??l8($,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${q}</div><div data-stx-suspense-error hidden>${W}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function y$($,...Z){for(let X of Z){if($.serverDynamic[X]!==void 0)return String($.serverDynamic[X]);let J=$.static[X];if(typeof J==="string")return J}return}var y4={name:"TransitionGroup",aliases:["transition-group"],render($,Z,X){let J=(y$($,"name")||"v").replace(/["'<>]/g,""),Y=(y$($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Q=y$($,"class"),G=y$($,"id"),q=[`data-stx-transition-group="${J}"`,Q?`class="${Q}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Y} ${q}>${Z}</${Y}>`}};function p8(){S0.registerBuiltin(O4),S0.registerBuiltin(D4),S0.registerBuiltin(N4),S0.registerBuiltin(M4),S0.registerBuiltin(k4),S0.registerBuiltin(I4),S0.registerBuiltin(T4),S0.registerBuiltin(E4),S0.registerBuiltin(b4),S0.registerBuiltin(y4)}function S$($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}function i8($,Z,X){let J=[],Y=0;while(Y<$.length){let Q=$.indexOf("<",Y);if(Q===-1)break;let q=$.slice(Q+1).match(new RegExp(`^(${Z.source})(?![\\w.:-])`));if(!q){Y=Q+1;continue}let W=q[1];if(X&&X.has(W.toLowerCase())){let _=Q+1+W.length;while(_<$.length&&$[_]!==">")_++;Y=_+1;continue}let K=Q+1+W.length,U=null,z=K,H=-1,j=!1;while(K<$.length){let _=$[K];if(U){if(_==="\\"&&K+1<$.length){K+=2;continue}if(_===U)U=null;K++;continue}if(_==='"'||_==="'"){U=_,K++;continue}if(_==="/"&&K+1<$.length&&$[K+1]===">"){H=K+2,j=!0;break}if(_===">"){H=K+1;break}K++}if(H===-1){Y=Q+1;continue}let B=$.slice(z,j?H-2:H-1).trim();if(j)J.push({fullMatch:$.slice(Q,H),tagName:W,attributes:B,content:"",startIndex:Q,endIndex:H,isSelfClosing:!0}),Y=H;else{let _=`<${W}`,L=`</${W}>`,V=1,O=H,F=-1;while(V>0&&O<$.length){let D=$.indexOf(_,O),N=$.indexOf(L,O);if(N===-1)break;if(D!==-1&&D<N){let k=$[D+_.length];if(k===" "||k===">"||k==="/"||k===`
3592
+ `||k==="\t")V++;O=D+_.length}else{if(V--,V===0){F=N;break}O=N+L.length}}if(F===-1){Y=H;continue}let w=$.slice(H,F),R=F+L.length;J.push({fullMatch:$.slice(Q,R),tagName:W,attributes:B,content:w,startIndex:Q,endIndex:R,isSelfClosing:!1}),Y=R}}return J}function n8($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function s8($,Z){try{let X=Buffer.from($,"base64").toString("utf8");return JSON.parse(X)}catch{}try{let X=$.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(X)}catch(X){if(Z?.debug)console.error("Error decoding __stx_ prop:",X);return $}}import P$ from"fs";import g0 from"path";var o8=!1,NG=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function AG($,Z,X){let J={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},Y=new Set(Array.isArray(Z.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),Q=(K)=>{if(Y.size===0)return!1;let U=c0(K),z=U.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(z&&Y.has(z))return!0;for(let H of Y){let j=H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${j}\\s*\\(`).test(U))return!0}return!1},G=new Set(e8),q=(K)=>{if(!K.includes("-")||K.startsWith("@")||K.startsWith(":")||K.startsWith("x-")||K.startsWith("__"))return K;if(K.startsWith("aria-")||K.startsWith("data-"))return K;return K.replace(/-([a-z0-9])/g,(U,z)=>z.toUpperCase())},W=(K,U)=>{let z=q(K);if(J.static[z]=U,z!==K)J.staticNames[z]=K};for(let[K,U]of Object.entries($)){let z=K.startsWith("x-")&&!G.has(K)&&!K.startsWith("x-bind:")&&!K.startsWith("x-on:")?`:${K.slice(2)}`:K;if(z.startsWith("@")){J.events[z]=U;continue}if(z.startsWith("__stx_")){let H=q(z.slice(6));J.serverDynamic[H]=s8(U,X);continue}if(z.startsWith(":")){let H=q(z.slice(1)),j=U===T1?H:U;if(H==="if"||H==="for"||H==="show"){J.clientReactive[H]=j;continue}if(Q(j)){J.clientReactive[H]=j;continue}try{if(!q0(j)){if(X.debug)console.error(`Unsafe expression in :${H} binding: ${j}`);J.clientReactive[H]=j;continue}let B=Object.keys(Z),L=W0(j,B)(...Object.values(Z));if(L===void 0){let V=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(l5(j).some((F)=>!V.has(F)&&!B.includes(F))){J.clientReactive[H]=j;continue}}if(J.serverDynamic[H]=L,H!==z.slice(1)&&J.serverDynamicNames)J.serverDynamicNames[H]=z.slice(1)}catch{J.clientReactive[H]=j}continue}if(typeof U==="string"&&U.includes("{{")&&U.includes("}}")){let H=U.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(H)try{let j=H[1];if(q0(j)){let _=W0(j,Object.keys(Z))(...Object.values(Z));W(z,_!=null?String(_):"")}else{if(X.debug)console.error(`Unsafe expression in ${z}: ${j}`);W(z,U)}}catch(j){if(X.debug)console.error(`Error evaluating expression for ${z}:`,j);W(z,U)}else{let j=U,B=/\{\{\s*([\s\S]+?)\s*\}\}/g,_;while((_=B.exec(U))!==null)try{let L=_[1];if(!q0(L)){if(X.debug)console.error(`Unsafe expression in ${z}: ${L}`);continue}let O=W0(L,Object.keys(Z))(...Object.values(Z));j=j.replace(_[0],String(O??""))}catch(L){if(X.debug)console.error(`Error evaluating expression in ${z}:`,L)}W(z,j)}continue}W(z,U===T1?"true":n8(U))}return J}var MG=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function kG($,Z,X){if(!$.includes("@"))return $;if(!MG.some(([Y,Q])=>Y.test($)&&$.includes(Q)))return $;try{return X1($,Z,X)}catch{return $}}function IG($){let Z={},X=0,J=$.length;while(X<J){while(X<J&&/\s/.test($[X]))X++;if(X>=J)break;let Y="";while(X<J&&!/[\s=]/.test($[X]))Y+=$[X],X++;if(!Y)break;while(X<J&&/\s/.test($[X]))X++;if(X<J&&$[X]==="="){X++;while(X<J&&/\s/.test($[X]))X++;let Q="";if(X<J&&($[X]==='"'||$[X]==="'")){let G=$[X];X++;while(X<J){let q=$[X];if(q==="\\"&&X+1<J){X++,Q+=$[X],X++;continue}if(q===G){X++;break}Q+=q,X++}}else while(X<J&&!/\s/.test($[X]))Q+=$[X],X++;Z[Y]=Q}else Z[Y]=T1}return Z}function r8($){return Object.entries($).map(([Z,X])=>X===T1?Z:`${Z}="${TG(X)}"`).join(" ")}function TG($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function EG($){let Z=new Set,X=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,J;while((J=X.exec($))!==null){let Y=J[1];if(S0.isBuiltin(Y))Z.add(Y)}return[...Z].sort()}var a8=new Map;function bG($){let Z=a8.get($);if(Z)return Z;let X=new Map,J=[g0.join($,"src"),g0.join($,"dist"),$];function Y(Q,G){if(G>6)return;let q;try{q=P$.readdirSync(Q,{withFileTypes:!0})}catch{return}for(let W of q){let K=g0.join(Q,W.name);if(W.isDirectory()){if(W.name==="node_modules"||W.name.startsWith("."))continue;Y(K,G+1)}else if(W.isFile()&&W.name.endsWith(".stx")){let U=W.name.slice(0,-4);if(!X.has(U))X.set(U,K);let z=U.toLowerCase();if(!X.has(z))X.set(z,K);let H=U.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!X.has(H))X.set(H,K)}}}for(let Q of J)if(Y(Q,0),X.size>0)break;return a8.set($,X),X}function yG($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let X=Z;while(!0){let J=g0.join(X,"node_modules",$);try{if(P$.statSync(J).isDirectory())return J}catch{}let Y=g0.dirname(X);if(Y===X)return null;X=Y}}async function SG($,Z,X,J,Y){if(!$.includes("import"))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Q=Z.__importedComponents,G=g0.dirname(X),q=$,W=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;return q=q.replace(W,(K,U,z)=>{let H=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,j=z,B,_=[];while((B=H.exec(z))!==null){let[L,V,O,F]=B,w=null,R=null;if(F.startsWith(".")||F.startsWith("/")){let k=g0.resolve(G,F);if(k.endsWith(".stx"))R=k;else{let A=`${k}.stx`;try{if(P$.statSync(A).isFile())R=A}catch{try{if(P$.statSync(k).isDirectory())w=k}catch{}}}}else w=yG(F,G);if(!w&&!R)continue;let D=!1,N=(k,A)=>{Q.set(k,A),Q.set(k.toLowerCase(),A);let M=k.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();Q.set(M,A),Y.add(A)};if(O&&R)N(O,R),D=!0;else if(V){let k=V.slice(1,-1).split(",").map((M)=>M.trim()).filter(Boolean).map((M)=>{let T=M.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(T)return{source:T[1],local:T[2]};return{source:M,local:M}}),A=w?bG(w):null;for(let{source:M,local:T}of k){let I=null;if(R)I=R;else if(A)I=A.get(M)??A.get(M.toLowerCase())??A.get(M.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(I)N(T,I),D=!0}}if(D)_.push({start:B.index,end:B.index+L.length})}if(_.length===0)return K;for(let L=_.length-1;L>=0;L--)j=j.slice(0,_[L].start)+j.slice(_[L].end);return`<script${U}>${j}</script>`}),q}async function CG($,Z,X,J,Y){let Q=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,q=/@import\s*\(\s*([^)]+)\s*\)/g,W;while((W=q.exec(Q))!==null){let[K,U]=W,z=U.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of z){let j=H.split("/"),_=j[j.length-1].replace(/\.stx$/,""),L=_.includes("-")?_.split("-").map((F)=>F.charAt(0).toUpperCase()+F.slice(1)).join(""):_.charAt(0).toUpperCase()+_.slice(1),V=null,O=[g0.resolve(g0.dirname(X),`${H}.stx`),g0.resolve(g0.dirname(X),H),g0.resolve(J.componentsDir||"components",`${H}.stx`),g0.resolve(J.componentsDir||"components",H),H.endsWith(".stx")?H:`${H}.stx`];for(let F of O)try{if(await Bun.file(F).exists()){V=F;break}}catch{}if(V){G.set(L,V),G.set(_,V),G.set(_.toLowerCase(),V);let F=L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(F,V),Y.add(V),J.debug)console.log(`Imported component: ${L} -> ${V}`)}else if(J.debug)console.warn(`Could not resolve imported component: ${H}`)}Q=Q.replace(K,""),q.lastIndex=0}return Q}async function PG($,Z,X,J,Y){let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,W=/@component\s*\(/g,K;while((K=W.exec(Q))!==null){let U=K.index,z=U+K[0].length-1,H=1,j=z+1;while(j<Q.length&&H>0){if(Q[j]==="(")H++;else if(Q[j]===")"){if(H--,H===0)break}j++}if(H!==0)break;let B=Q.substring(z+1,j),_=j+1,L=B.match(/^\s*['"]([^'"]+)['"]/);if(!L){W.lastIndex=0;continue}let V=L[1],O,F=B.slice(L[0].length),w=F.match(/^\s*,\s*/);if(w)O=F.slice(w[0].length).trim();let R={};if(O)try{R=R0(O,Z)}catch(T){let I=T instanceof Error?T.message:String(T);Q=Q.replace(Q.substring(U,_),`[Error parsing component props: ${I}]`);continue}let D="",N=_,A=Q.substring(_).match(/^([\s\S]*?)@endcomponent/);if(A)D=A[1].trim(),N=_+A[0].length;let M=await I1(V,R,D,G,Z,X,J,q,Y);Q=Q.substring(0,U)+M+Q.substring(N),W.lastIndex=0}return Q}async function vG($,Z,X,J,Y){if(!$)return $;let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,W=r0(Q);return Q=W.output,Q=await H(Q,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),Q=await H(Q,/[A-Z][a-zA-Z0-9]*/,!0),Q=await H(Q,/[a-z][a-z0-9]*/,!1,NG),Q=P1(Q,W.scripts),Q;async function H(j,B,_,L){if(!j)return j;let V=j,O=i8(V,B,L);for(let F=O.length-1;F>=0;F--){let w=O[F],R=_?S$(w.tagName):w.tagName,D=IG(kG(w.attributes,Z,X)),N=AG(D,Z,J),k=S0.getBuiltin(w.tagName),A=k?await C$(R,G,Z,X,J):!1;if(k&&!A){let y={context:Z,filePath:X,options:J,dependencies:Y},E=k.render(N,w.content,y);if(Object.keys(N.events).length>0){let b=r8(N.events);E=E.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${b}`)}if(Object.keys(N.clientReactive).length>0)E=t8(E,N.clientReactive);V=V.substring(0,w.startIndex)+E+V.substring(w.endIndex);continue}if(!_&&w.tagName.includes("-")&&!await C$(R,G,Z,X,J))continue;let M={};for(let[y,E]of Object.entries(N.static))M[y]=E;for(let[y,E]of Object.entries(N.serverDynamic))M[y]=E;let I=await I1(R,M,P1(w.content,W.scripts),G,Z,X,J,q,Y);if(Object.keys(N.events).length>0){let y=$2(I);if(y){let E=r8(N.events),b=Object.keys(N.events).map((S)=>S.replace(/^@/,"").split(".")[0]).join(" ");I=I.substring(0,y.insertPos)+` data-stx-parent-events="${b}" ${E}`+I.substring(y.insertPos)}}if(Object.keys(N.clientReactive).length>0)I=t8(I,N.clientReactive);V=V.substring(0,w.startIndex)+I+V.substring(w.endIndex)}return V}}function t8($,Z){let X=new Set(["if","for"]),J=new Set(["show"]),Y=Object.entries(Z).filter(([U])=>!X.has(U)),Q=Y.filter(([U])=>!J.has(U)).map(([U])=>S$(U)).join(" "),G=$,q=Y.length>0?$2(G):null;if(q){let U=Y.map(([H,j])=>`:${S$(H)}="${j.replace(/"/g,"&quot;")}"`).join(" "),z=Q?` data-stx-parent-bindings="${Q}"`:"";G=G.substring(0,q.insertPos)+`${z} ${U}`+G.substring(q.insertPos)}let W=Z.if;if(W)G=`<template :if="${W.replace(/"/g,"&quot;")}">${G}</template>`;let K=Z.for;if(K)G=`<template :for="${K.replace(/"/g,"&quot;")}">${G}</template>`;return G}function $2($){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec($);if(Z)return{insertPos:Z.index+1+Z[1].length};let X=0;while(X<$.length){let J=$.slice(X),Y=J.match(/^\s+/);if(Y){X+=Y[0].length;continue}if(J.startsWith("<!--")){let q=$.indexOf("-->",X+4);if(q===-1)return null;X=q+3;continue}let Q=J.match(/^<(script|style)\b[^>]*>/i);if(Q){let q=`</${Q[1].toLowerCase()}>`,W=$.toLowerCase().indexOf(q,X+Q[0].length);if(W===-1)return null;X=W+q.length;continue}let G=J.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!G)return null;return{insertPos:X+1+G[1].length}}return null}async function S4($,Z,X,J,Y){if(!o8)p8(),o8=!0;let Q=await SG($,Z,X,J,Y);Q=await CG(Q,Z,X,J,Y),Q=await PG(Q,Z,X,J,Y);let G=[];for(let q=0;q<3;q++){let W=o0(Q,U5,(U,z)=>`\x00STX_COMPONENT_COMMENT_${G.length+z}\x00`);G.push(...W.tokens);let K=Q;if(Q=await vG(W.output,Z,X,J,Y),Q===K)break}if(G.length>0)Q=Q.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(q,W)=>G[Number(W)]??"");if(J.debug){let q=EG(Q);if(q.length>0)console.warn(`[stx] ${X}: unresolved component tag(s) after render passes: ${q.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return Q}import Q5 from"path";import Z2 from"process";function Y5($="STX_PUBLIC_"){let Z={},X={};for(let[J,Y]of Object.entries(Z2.env)){if(!J.startsWith($)||Y===void 0)continue;Z[`import.meta.env.${J}`]=JSON.stringify(Y),X[J]=Y}return Z["import.meta.env"]=JSON.stringify(X),Z}function V_($="STX_PUBLIC_"){let Z={};for(let[X,J]of Object.entries(Z2.env))if(X.startsWith($)&&J!==void 0)Z[X]=J;return Z}function X2($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function J2($,Z,X){try{let J;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=Q5.join(Y,$);if(await Bun.file(G).exists())return G;Y=Q5.dirname(Y)}J=Q5.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))J=Q5.resolve(Z,$);else J=Q5.resolve(Z,$);if(await Bun.file(J).exists())return J;return null}catch{return null}}async function Y2($,Z,X){let J=$,Y=Q5.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(J))!==null){let[K,U,z,H]=G;if(X2(z))continue;let j=await J2(z,Y,Z);if(j)try{let B=await Bun.file(j).text();if(X.add(j),z.endsWith(".ts")||z.endsWith(".tsx")){let L=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:Y5()});if(L.outputs.length>0)B=await L.outputs[0].text()}let _=`<script>
3593
3593
  // Source: ${z}
3594
3594
  ${B}
3595
3595
  </script>`;J=J.replace(K,_),Q.lastIndex=0}catch(B){}}let q=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,W;while((W=q.exec(J))!==null){let[K,U,z,H]=W,j=U+H;if(X2(z))continue;if(/rel=["']stylesheet["']/.test(j)||z.endsWith(".css")){let _=await J2(z,Y,Z);if(_)try{let L=await Bun.file(_).text();X.add(_);let V=`<style>
3596
3596
  /* Source: ${z} */
3597
3597
  ${L}
3598
- </style>`;J=J.replace(K,V),q.lastIndex=0}catch(L){}}}return J}function C4($,Z){let X=$,J=/@json\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index,G=Q+Y[0].length-1,q=1,W=G+1,K=null,U=!1;while(W<X.length&&q>0){let F=X[W];if(U){U=!1,W++;continue}if(F==="\\"&&K){U=!0,W++;continue}if(K){if(F===K)K=null;W++;continue}if(F==='"'||F==="'"||F==="`"){K=F,W++;continue}if(F==="(")q++;else if(F===")"){if(q--,q===0)break}W++}if(q!==0)break;let z=X.substring(G+1,W).trim(),H=X.substring(Q,W+1),j=-1,B=0,_=null,L=!1;for(let F=0;F<z.length;F++){let w=z[F];if(L){L=!1;continue}if(w==="\\"&&_){L=!0;continue}if(_){if(w===_)_=null;continue}if(w==='"'||w==="'"||w==="`"){_=w;continue}if(w==="("||w==="["||w==="{")B++;else if(w===")"||w==="]"||w==="}")B--;if(w===","&&B===0){j=F;break}}let V=j>=0?z.substring(0,j).trim():z,O=j>=0?z.substring(j+1).trim():void 0;try{let F=V.trim(),w;if(q0(F))w=W0(F,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(O==="true")R=JSON.stringify(w,null,2);else R=JSON.stringify(w);let D=R.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");X=X.substring(0,Q)+D+X.substring(W+1),J.lastIndex=Q+D.length}catch(F){i0.log(F instanceof Error?F:Error(String(F)),{directive:"@json"},"error"),J.lastIndex=Q+H.length}}return X}function P4($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Q2($){let Z=$,X=/@memo\s*\(/g,J,Y=[];while((J=X.exec(Z))!==null){let Q=J.index,G=Q+J[0].length,q=1,W=G;while(W<Z.length&&q>0){if(Z[W]==="(")q++;else if(Z[W]===")")q--;W++}if(q!==0)continue;let K=Z.slice(G,W-1).trim(),U=W,z=Z.slice(U),H=z.indexOf("@endmemo");if(H===-1)continue;let j=z.slice(0,H),B=U+H+8,_=j.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),L=_?_[0].length:0,V=j.slice(L),O=j.match(/(\s*)$/),F=O?O[0].length:0,w=V.slice(0,V.length-F),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[N,k,A="",M]=R,T=`<${k}${A} data-stx-memo="${K}"${M}>`;D=j.slice(0,L)+T+w.slice(N.length)+j.slice(L+w.length)}else D=`${j.slice(0,L)}<div data-stx-memo="${K}">${w}</div>${j.slice(L+w.length)}`;Y.push({start:Q,end:B,replacement:D}),X.lastIndex=B}for(let Q=Y.length-1;Q>=0;Q--){let G=Y[Q];Z=Z.slice(0,G.start)+G.replacement+Z.slice(G.end)}return Z.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function v4($){let Z=$.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return Z=Z.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),Z}var vG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),G2=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/;function fG($,Z){let X=!1,J=!1;for(let Y=Z;Y<$.length;Y++){let Q=$[Y];if(X){if(Q==="'")X=!1}else if(J){if(Q==='"')J=!1}else if(Q==="'")X=!0;else if(Q==='"')J=!0;else if(Q===">")return Y}return-1}function xG($,Z){let X=0,J="",Y=Z;while(Y<$.length){let Q=$[Y];if(Q!=="<"){if(X===0)J+=Q;Y++;continue}if($.startsWith("<!--",Y)){let K=$.indexOf("-->",Y);Y=K===-1?$.length:K+3;continue}let G=fG($,Y);if(G===-1)break;let q=$.slice(Y,G+1),W=/^<\/?\s*([a-z][\w-]*)/i.exec(q)?.[1]?.toLowerCase()??"";if(q[1]==="/"){if(X===0)break;X--}else if(!/\/\s*>$/.test(q)&&!vG.has(W))X++;Y=G+1}return J}function q2($){let X=new RegExp("<(div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i)\\b","gi"),J="",Y=0,Q;while((Q=X.exec($))!==null){let G=Q.index,q=G+Q[0].length,W=!1,K=!1,U=-1;while(q<$.length){let j=$[q];if(W){if(j==="'")W=!1}else if(K){if(j==='"')K=!1}else if(j==="'")W=!0;else if(j==='"')K=!0;else if(j===">"){U=q;break}q++}if(U===-1)continue;let z=$.slice(G,U+1);if(G2.test(z))continue;if(z.includes("x-cloak"))continue;let H=xG($,U+1);if(/\{\{[\s\S]*?\}\}/.test(H))J+=$.slice(Y,U)+" x-cloak>",Y=U+1}return J+=$.slice(Y),J}var gG=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/;function W2($){let Z=/<[a-z][\w-]*/gi,X="",J=0,Y;while((Y=Z.exec($))!==null){let Q=Y.index,G=Y[0].slice(1).toLowerCase();if(G==="script"||G==="style"){let B=`</${G}>`,_=$.toLowerCase().indexOf(B,Q);if(_!==-1)Z.lastIndex=_+B.length;continue}let q=Q+Y[0].length,W=!1,K=!1,U=-1;while(q<$.length){let B=$[q];if(W){if(B==="'")W=!1}else if(K){if(B==='"')K=!1}else if(B==="'")W=!0;else if(B==='"')K=!0;else if(B===">"){U=q;break}q++}if(U===-1)continue;let z=$.slice(Q+Y[0].length,U);if(G2.test(z))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(z))continue;if(!gG.test(z))continue;let H=$[U-1]==="/",j=H?U-1:U;X+=`${$.slice(J,j)} x-cloak${H?" ":""}`,J=j}return X+=$.slice(J),X}var f4=G5(256),hG=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}];function x4($,Z,X,J){let Y=typeof X==="boolean"?{enabled:X,failOnViolation:X}:X??{enabled:!1};if(!Y.enabled)return;let Q=b1($,Z,J,JSON.stringify(Y)),G=f4.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let q=Y.allowPatterns??[],W=[],K=c0($.replace(/\{\{--[\s\S]*?--\}\}/g,(j)=>j.replace(/[^\n]/g," ")));for(let{pattern:j,message:B,suggestion:_}of hG){if(q.some((V)=>/\w/.test(V)&&B.includes(V)))continue;j.lastIndex=0;let L=K.match(j);if(L&&L.length>0){let V=K.split(`
3598
+ </style>`;J=J.replace(K,V),q.lastIndex=0}catch(L){}}}return J}function C4($,Z){let X=$,J=/@json\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index,G=Q+Y[0].length-1,q=1,W=G+1,K=null,U=!1;while(W<X.length&&q>0){let F=X[W];if(U){U=!1,W++;continue}if(F==="\\"&&K){U=!0,W++;continue}if(K){if(F===K)K=null;W++;continue}if(F==='"'||F==="'"||F==="`"){K=F,W++;continue}if(F==="(")q++;else if(F===")"){if(q--,q===0)break}W++}if(q!==0)break;let z=X.substring(G+1,W).trim(),H=X.substring(Q,W+1),j=-1,B=0,_=null,L=!1;for(let F=0;F<z.length;F++){let w=z[F];if(L){L=!1;continue}if(w==="\\"&&_){L=!0;continue}if(_){if(w===_)_=null;continue}if(w==='"'||w==="'"||w==="`"){_=w;continue}if(w==="("||w==="["||w==="{")B++;else if(w===")"||w==="]"||w==="}")B--;if(w===","&&B===0){j=F;break}}let V=j>=0?z.substring(0,j).trim():z,O=j>=0?z.substring(j+1).trim():void 0;try{let F=V.trim(),w;if(q0(F))w=W0(F,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(O==="true")R=JSON.stringify(w,null,2);else R=JSON.stringify(w);let D=R.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");X=X.substring(0,Q)+D+X.substring(W+1),J.lastIndex=Q+D.length}catch(F){i0.log(F instanceof Error?F:Error(String(F)),{directive:"@json"},"error"),J.lastIndex=Q+H.length}}return X}function P4($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Q2($){let Z=$,X=/@memo\s*\(/g,J,Y=[];while((J=X.exec(Z))!==null){let Q=J.index,G=Q+J[0].length,q=1,W=G;while(W<Z.length&&q>0){if(Z[W]==="(")q++;else if(Z[W]===")")q--;W++}if(q!==0)continue;let K=Z.slice(G,W-1).trim(),U=W,z=Z.slice(U),H=z.indexOf("@endmemo");if(H===-1)continue;let j=z.slice(0,H),B=U+H+8,_=j.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),L=_?_[0].length:0,V=j.slice(L),O=j.match(/(\s*)$/),F=O?O[0].length:0,w=V.slice(0,V.length-F),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[N,k,A="",M]=R,T=`<${k}${A} data-stx-memo="${K}"${M}>`;D=j.slice(0,L)+T+w.slice(N.length)+j.slice(L+w.length)}else D=`${j.slice(0,L)}<div data-stx-memo="${K}">${w}</div>${j.slice(L+w.length)}`;Y.push({start:Q,end:B,replacement:D}),X.lastIndex=B}for(let Q=Y.length-1;Q>=0;Q--){let G=Y[Q];Z=Z.slice(0,G.start)+G.replacement+Z.slice(G.end)}return Z.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function v4($){let Z=$.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return Z=Z.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),Z}var fG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),G2=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/;function xG($,Z){let X=!1,J=!1;for(let Y=Z;Y<$.length;Y++){let Q=$[Y];if(X){if(Q==="'")X=!1}else if(J){if(Q==='"')J=!1}else if(Q==="'")X=!0;else if(Q==='"')J=!0;else if(Q===">")return Y}return-1}function gG($,Z){let X=0,J="",Y=Z;while(Y<$.length){let Q=$[Y];if(Q!=="<"){if(X===0)J+=Q;Y++;continue}if($.startsWith("<!--",Y)){let K=$.indexOf("-->",Y);Y=K===-1?$.length:K+3;continue}let G=xG($,Y);if(G===-1)break;let q=$.slice(Y,G+1),W=/^<\/?\s*([a-z][\w-]*)/i.exec(q)?.[1]?.toLowerCase()??"";if(q[1]==="/"){if(X===0)break;X--}else if(!/\/\s*>$/.test(q)&&!fG.has(W))X++;Y=G+1}return J}function q2($){let X=new RegExp("<(div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i)\\b","gi"),J="",Y=0,Q;while((Q=X.exec($))!==null){let G=Q.index,q=G+Q[0].length,W=!1,K=!1,U=-1;while(q<$.length){let j=$[q];if(W){if(j==="'")W=!1}else if(K){if(j==='"')K=!1}else if(j==="'")W=!0;else if(j==='"')K=!0;else if(j===">"){U=q;break}q++}if(U===-1)continue;let z=$.slice(G,U+1);if(G2.test(z))continue;if(z.includes("x-cloak"))continue;let H=gG($,U+1);if(/\{\{[\s\S]*?\}\}/.test(H))J+=$.slice(Y,U)+" x-cloak>",Y=U+1}return J+=$.slice(Y),J}var hG=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/;function W2($){let Z=/<[a-z][\w-]*/gi,X="",J=0,Y;while((Y=Z.exec($))!==null){let Q=Y.index,G=Y[0].slice(1).toLowerCase();if(G==="script"||G==="style"){let B=`</${G}>`,_=$.toLowerCase().indexOf(B,Q);if(_!==-1)Z.lastIndex=_+B.length;continue}let q=Q+Y[0].length,W=!1,K=!1,U=-1;while(q<$.length){let B=$[q];if(W){if(B==="'")W=!1}else if(K){if(B==='"')K=!1}else if(B==="'")W=!0;else if(B==='"')K=!0;else if(B===">"){U=q;break}q++}if(U===-1)continue;let z=$.slice(Q+Y[0].length,U);if(G2.test(z))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(z))continue;if(!hG.test(z))continue;let H=$[U-1]==="/",j=H?U-1:U;X+=`${$.slice(J,j)} x-cloak${H?" ":""}`,J=j}return X+=$.slice(J),X}var f4=G5(256),uG=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}];function x4($,Z,X,J){let Y=typeof X==="boolean"?{enabled:X,failOnViolation:X}:X??{enabled:!1};if(!Y.enabled)return;let Q=b1($,Z,J,JSON.stringify(Y)),G=f4.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let q=Y.allowPatterns??[],W=[],K=c0($.replace(/\{\{--[\s\S]*?--\}\}/g,(j)=>j.replace(/[^\n]/g," ")));for(let{pattern:j,message:B,suggestion:_}of uG){if(q.some((V)=>/\w/.test(V)&&B.includes(V)))continue;j.lastIndex=0;let L=K.match(j);if(L&&L.length>0){let V=K.split(`
3599
3599
  `),O=$.split(`
3600
3600
  `),F=[];V.forEach((N,k)=>{if(j.lastIndex=0,j.test(N))F.push(k+1)});let w=F.length>0?` (script line${F.length>1?"s":""} ${F.join(", ")})`:"",R=F.slice(0,3).map((N)=>` ${N} | ${(O[N-1]??"").trim().slice(0,100)}`).join(`
3601
3601
  `),D=R?`
@@ -3603,25 +3603,25 @@ ${R}`:"";W.push(` \u2717 ${B}${w}
3603
3603
  \u2192 ${_}${D}`)}}if(W.length===0){f4.set(Q,"");return}let U=(j)=>{let B=`${process.cwd()}/`;return j.startsWith(B)?j.slice(B.length):j},H=`[STX] DOM API violation in ${J&&J!==Z?`${U(J)} (composed into ${U(Z)})`:U(Z)}:
3604
3604
  ${W.join(`
3605
3605
  `)}
3606
- Tip: prefer useRef(), navigate(), and composables for component code`;if(f4.set(Q,H),Y.failOnViolation)throw Error(H);else console.warn(H)}uG();var y1="<!--PARENT_CONTENT_PLACEHOLDER-->";function K2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function mG($,Z){let X=$.length,J=Z,Y=!0,Q=[],G=(q)=>q+9<=X&&$[q]==="<"&&$[q+1]==="/"&&($[q+2]==="s"||$[q+2]==="S")&&($[q+3]==="c"||$[q+3]==="C")&&($[q+4]==="r"||$[q+4]==="R")&&($[q+5]==="i"||$[q+5]==="I")&&($[q+6]==="p"||$[q+6]==="P")&&($[q+7]==="t"||$[q+7]==="T")&&($[q+8]===">"||/\s/.test($[q+8]));while(J<X){let q=$[J];if(G(J))return J;if(q==="/"&&$[J+1]==="/"){if(J=$.indexOf(`
3606
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(f4.set(Q,H),Y.failOnViolation)throw Error(H);else console.warn(H)}dG();var y1="<!--PARENT_CONTENT_PLACEHOLDER-->";function K2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function lG($,Z){let X=$.length,J=Z,Y=!0,Q=[],G=(q)=>q+9<=X&&$[q]==="<"&&$[q+1]==="/"&&($[q+2]==="s"||$[q+2]==="S")&&($[q+3]==="c"||$[q+3]==="C")&&($[q+4]==="r"||$[q+4]==="R")&&($[q+5]==="i"||$[q+5]==="I")&&($[q+6]==="p"||$[q+6]==="P")&&($[q+7]==="t"||$[q+7]==="T")&&($[q+8]===">"||/\s/.test($[q+8]));while(J<X){let q=$[J];if(G(J))return J;if(q==="/"&&$[J+1]==="/"){if(J=$.indexOf(`
3607
3607
  `,J+2),J===-1)return-1;J+=1,Y=!0;continue}if(q==="/"&&$[J+1]==="*"){let W=$.indexOf("*/",J+2);if(W===-1)return-1;J=W+2,Y=!0;continue}if(q==="/"&&Y){let W=J+1,K=!1;while(W<X){let U=$[W];if(U==="\\"){W+=2;continue}if(U==="[")K=!0;else if(U==="]")K=!1;else if(U==="/"&&!K){W++;break}else if(U===`
3608
3608
  `){W=-1;break}W++}if(W===-1){J++,Y=!1;continue}while(W<X&&/[a-z]/.test($[W]))W++;J=W,Y=!1;continue}if(q==="'"||q==='"'){let W=q;J++;while(J<X){if($[J]==="\\"){J+=2;continue}if($[J]===W){J++;break}if($[J]===`
3609
- `)break;J++}Y=!1;continue}if(q==="`"){J++;while(J<X){if($[J]==="\\"){J+=2;continue}if($[J]==="`"){J++;break}if($[J]==="$"&&$[J+1]==="{"){Q.push(!0),J+=2,Y=!0;break}J++}if(Q.length===0)Y=!1;continue}if(q==="}"&&Q.length>0){Q.pop(),J++;while(J<X){if($[J]==="\\"){J+=2;continue}if($[J]==="`"){J++,Y=!1;break}if($[J]==="$"&&$[J+1]==="{"){Q.push(!0),J+=2,Y=!0;break}J++}continue}if(/\s/.test(q));else if(/[)\].\w$]/.test(q))Y=!1;else Y=!0;J++}return-1}function q5($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),J=new RegExp(`<script\\b(?=[^>]*\\b${X}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!J)return null;let Y=J.index+J[0].length,Q=$.indexOf("</script>",Y);if(Q===-1)return null;let G=$.indexOf(">",Q);if(G===-1)return null;return{start:J.index,end:G+1}}function U2($){let Z=0;while(Z<$.length){let X=$.indexOf("<",Z);if(X===-1)return-1;if($.startsWith("<!--",X)){let Q=$.indexOf("-->",X+4);Z=Q===-1?$.length:Q+3;continue}let J=$.slice(X),Y=/^<style\b[^>]*>/i.exec(J);if(Y){let Q=$.toLowerCase().indexOf("</style>",X+Y[0].length);Z=Q===-1?$.length:Q+8;continue}if(/^<script\b[^>]*>/i.test(J))return X;Z=X+1}return-1}function lG($){let Z=q5($,"data-stx-runtime");if(!Z)return $;let X=U2($);if(X===-1||X===Z.start)return $;let J=$.slice(Z.start,Z.end),Y=$.slice(0,Z.start)+$.slice(Z.end),Q=U2(Y);if(Q===-1)return J+`
3609
+ `)break;J++}Y=!1;continue}if(q==="`"){J++;while(J<X){if($[J]==="\\"){J+=2;continue}if($[J]==="`"){J++;break}if($[J]==="$"&&$[J+1]==="{"){Q.push(!0),J+=2,Y=!0;break}J++}if(Q.length===0)Y=!1;continue}if(q==="}"&&Q.length>0){Q.pop(),J++;while(J<X){if($[J]==="\\"){J+=2;continue}if($[J]==="`"){J++,Y=!1;break}if($[J]==="$"&&$[J+1]==="{"){Q.push(!0),J+=2,Y=!0;break}J++}continue}if(/\s/.test(q));else if(/[)\].\w$]/.test(q))Y=!1;else Y=!0;J++}return-1}function q5($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),J=new RegExp(`<script\\b(?=[^>]*\\b${X}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!J)return null;let Y=J.index+J[0].length,Q=$.indexOf("</script>",Y);if(Q===-1)return null;let G=$.indexOf(">",Q);if(G===-1)return null;return{start:J.index,end:G+1}}function U2($){let Z=0;while(Z<$.length){let X=$.indexOf("<",Z);if(X===-1)return-1;if($.startsWith("<!--",X)){let Q=$.indexOf("-->",X+4);Z=Q===-1?$.length:Q+3;continue}let J=$.slice(X),Y=/^<style\b[^>]*>/i.exec(J);if(Y){let Q=$.toLowerCase().indexOf("</style>",X+Y[0].length);Z=Q===-1?$.length:Q+8;continue}if(/^<script\b[^>]*>/i.test(J))return X;Z=X+1}return-1}function cG($){let Z=q5($,"data-stx-runtime");if(!Z)return $;let X=U2($);if(X===-1||X===Z.start)return $;let J=$.slice(Z.start,Z.end),Y=$.slice(0,Z.start)+$.slice(Z.end),Q=U2(Y);if(Q===-1)return J+`
3610
3610
  `+Y;return Y.slice(0,Q)+J+`
3611
- `+Y.slice(Q)}async function g4($,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=G1($,X);let Q=!Z.__stxProcessingDepth;if(Q)Z7(Z);if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!O5()&&!Z$())&&X&&X.endsWith(".stx"))O2($,X);try{return await B2.timeAsync("template-processing",async()=>{let G=await cG($,Z,X,J,Y);if(Q)G=v4(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let q=J.app?.head||{},K=(Z.__stx_runtime_head||null)??V2(),U=(Z.__stx_head_raw||"").trim(),z,H=U.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)z=H[1].trim(),U=U.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||z||j,_=!K.title&&(!!z||!!j),L=K.meta||[],V=new Set(L.map((N)=>s1(N)).filter(Boolean)),O={...q,...B&&{title:B},meta:[...(q.meta||[]).filter((N)=>!V.has(s1(N))),...L],link:[...q.link||[],...K.link||[]],script:[...q.script||[],...K.script||[]],headRaw:[q.headRaw,U].filter(Boolean).join(`
3611
+ `+Y.slice(Q)}async function g4($,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=G1($,X);let Q=!Z.__stxProcessingDepth;if(Q)Z7(Z);if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!O5()&&!Z$())&&X&&X.endsWith(".stx"))O2($,X);try{return await B2.timeAsync("template-processing",async()=>{let G=await pG($,Z,X,J,Y);if(Q)G=v4(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let q=J.app?.head||{},K=(Z.__stx_runtime_head||null)??V2(),U=(Z.__stx_head_raw||"").trim(),z,H=U.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)z=H[1].trim(),U=U.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||z||j,_=!K.title&&(!!z||!!j),L=K.meta||[],V=new Set(L.map((N)=>s1(N)).filter(Boolean)),O={...q,...B&&{title:B},meta:[...(q.meta||[]).filter((N)=>!V.has(s1(N))),...L],link:[...q.link||[],...K.link||[]],script:[...q.script||[],...K.script||[]],headRaw:[q.headRaw,U].filter(Boolean).join(`
3612
3612
  `),...K.htmlAttrs&&{htmlAttrs:J8(q.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...q.bodyAttrs||{},...K.bodyAttrs}}},F=q4(G);if(G=q8(G,O,{..._&&{titleIsHtml:!0},...J.app?.colorMode&&{colorMode:J.app.colorMode}}),F)G=G8(G,q),G=Y8(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let N=w[1],k=j2(N);G=G.replace(/<head\b[^>]*>/i,(A)=>`${A}
3613
3613
  <meta name="stx-layout" content="${K2(N)}">
3614
- <meta name="stx-layout-group" content="${K2(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?q1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=v1(G,(k,A)=>`<body${A} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){G=Q8(G);let q=J.app?.colorMode;if(q)G=t9(G,q);G=$8(G),G=lG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-xn65rbw3.js")),W=J.storesDir,K=await q(W);if(K){let U=`<script data-stx-stores>${K}</script>`,z=q5(G,"data-stx-runtime");if(z)G=G.slice(0,z.end)+`
3615
- `+U+G.slice(z.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-f9decgn9.js")),W=await q(G);if(W){let K=q5(G,"data-stx-stores")||q5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3616
- `+W+G.slice(K.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-1mr82303.js")),W=J.composablesDir,K=await q(W,G);if(K){let U=`<script data-stx-composables>${K}</script>`,z=q5(G,"data-stx-stores")||q5(G,"data-stx-runtime");if(z)G=G.slice(0,z.end)+`
3617
- `+U+G.slice(z.end)}}catch{}if(Q)G=e9(G);if(Q&&Z.__stx_inject_css!==!1)G=await _2(G,void 0,J.buildMode==="serve");if(Q)G=o9(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof Y$)throw G;let q=G instanceof Error?G.message:String(G),W=new w1(`Template processing failed: ${q}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(i0.log(W,{filePath:X,context:Z}),F3.logDetailedError(W,{filePath:X,template:$.substring(0,500)}),J.debug)throw W;return V3.createFallbackContent("Template Processing",W)}}async function cG($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!M0.isAbsolute(J.partialsDir)?M0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!M0.isAbsolute(J.componentsDir)?M0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!M0.isAbsolute(J.layoutsDir)?M0.resolve(Q,J.layoutsDir):J.layoutsDir},q=G,W=$;await nG(X,Z),iG(Z,q),W=await h1(()=>E9(W,Z,X,q),W,(F)=>{i0.log(F,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${F.message}`)}),W=W.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=o0(W,U5,(F,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);W=K.output;let U=K.tokens,z=(F)=>U.length===0?F:F.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>U[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";W=W.replace(/@@/g,H),W=W.replace(/@\{\{([\s\S]*?)\}\}/g,(F,w)=>{return`{{ ${w} }}`}),W=x9(W),W=await Y2(W,X,Y);let j={};W=a3(W,j);let B={...Z.__sections||{}},_="",L=x7(f7($)),V=/@nolayout\b/.test(W)||L===!1;if(/@nolayout\b/.test(W))W=W.replace(/@nolayout\b\s*/g,"");let O=W.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],W=W.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof L==="string"){if(_=L,!/@section\s*\(/.test(W))W=`@section('content')
3614
+ <meta name="stx-layout-group" content="${K2(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?q1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=v1(G,(k,A)=>`<body${A} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){G=Q8(G);let q=J.app?.colorMode;if(q)G=t9(G,q);G=$8(G),G=cG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-9jtdrj58.js")),W=J.storesDir,K=await q(W);if(K){let U=`<script data-stx-stores>${K}</script>`,z=q5(G,"data-stx-runtime");if(z)G=G.slice(0,z.end)+`
3615
+ `+U+G.slice(z.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-gz8nrsc7.js")),W=await q(G);if(W){let K=q5(G,"data-stx-stores")||q5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3616
+ `+W+G.slice(K.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-j6aga9pq.js")),W=J.composablesDir,K=await q(W,G);if(K){let U=`<script data-stx-composables>${K}</script>`,z=q5(G,"data-stx-stores")||q5(G,"data-stx-runtime");if(z)G=G.slice(0,z.end)+`
3617
+ `+U+G.slice(z.end)}}catch{}if(Q)G=e9(G);if(Q&&Z.__stx_inject_css!==!1)G=await _2(G,void 0,J.buildMode==="serve");if(Q)G=o9(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof Y$)throw G;let q=G instanceof Error?G.message:String(G),W=new w1(`Template processing failed: ${q}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(i0.log(W,{filePath:X,context:Z}),F3.logDetailedError(W,{filePath:X,template:$.substring(0,500)}),J.debug)throw W;return V3.createFallbackContent("Template Processing",W)}}async function pG($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!M0.isAbsolute(J.partialsDir)?M0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!M0.isAbsolute(J.componentsDir)?M0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!M0.isAbsolute(J.layoutsDir)?M0.resolve(Q,J.layoutsDir):J.layoutsDir},q=G,W=$;await sG(X,Z),nG(Z,q),W=await h1(()=>E9(W,Z,X,q),W,(F)=>{i0.log(F,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${F.message}`)}),W=W.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=o0(W,U5,(F,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);W=K.output;let U=K.tokens,z=(F)=>U.length===0?F:F.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>U[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";W=W.replace(/@@/g,H),W=W.replace(/@\{\{([\s\S]*?)\}\}/g,(F,w)=>{return`{{ ${w} }}`}),W=x9(W),W=await Y2(W,X,Y);let j={};W=a3(W,j);let B={...Z.__sections||{}},_="",L=x7(f7($)),V=/@nolayout\b/.test(W)||L===!1;if(/@nolayout\b/.test(W))W=W.replace(/@nolayout\b\s*/g,"");let O=W.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],W=W.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof L==="string"){if(_=L,!/@section\s*\(/.test(W))W=`@section('content')
3618
3618
  ${W.trim()}
3619
3619
  @endsection`}if(!_&&!V&&q.defaultLayout){let F=G4(W),w=/@section\s*\(/.test(W);if(!F||w){let R="",D=M0.dirname(X),N=q.layoutsDir?M0.dirname(q.layoutsDir):process.cwd();for(let k=0;k<20;k++){let A=M0.join(D,"_layout.stx");if(await t(A)){R=A;break}let M=M0.dirname(D);if(M===D||M.length<N.length)break;D=M}if(R)_=R;else if(q.layoutsDir){let k=M0.isAbsolute(q.layoutsDir)?q.layoutsDir:M0.resolve(process.cwd(),q.layoutsDir),A=M0.join(k,`${q.defaultLayout}.stx`);if(await t(A))_=A}if(_&&!w)W=`@section('content')
3620
3620
  ${W.trim()}
3621
3621
  @endsection`}}if(W=W.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(F,w,R)=>{return B[w]=R,""}),W=W.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}}),W=W.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(F,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",y1);else B[w]=R.trim();return""}),Z.__sections=B,W=W.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(F,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)W=W.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(W=t3(W,j),_){let F=[],w=r0(W),R=o0(w.output,C1,(D,N)=>`\x00STX_ORPHAN_STYLE_${N}\x00`);if(W=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,N,k)=>{let A=N==="SCRIPT"?w.scripts[Number(k)]:R.tokens[Number(k)];if(A)F.push(A);return""}),F.length>0){let D=F.join(`
3622
3622
  `);B.content=B.content?`${B.content}
3623
- ${D}`:D,Z.__sections=B}}if(_)try{let F;if(M0.isAbsolute(_))F=_,Y.add(_);else F=await h1(()=>q$(_,X,G,Y),null,()=>{throw new w1(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!F){let A=(I)=>{if(!I)return[];try{let y=M0.isAbsolute(I)?I:M0.resolve(process.cwd(),I);return dG.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},M=[...A(G.layoutsDir),...A(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(i0.log(Error(T),{layoutPath:_,filePath:X,available:M},"error"),console.error(`[stx] ${T}`),G.debug)throw new w1(T,X);return W}let w=await h1(()=>Bun.file(F).text(),"",()=>{throw new w1(`Failed to read layout file: ${F}`,X,void 0,void 0,"Layout content could not be loaded")}),R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${F}`);let A={},M=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,E,b)=>{return A[E]=b.trim(),""});for(let[y,E]of Object.entries(A))if(B[y]&&B[y].includes(y1)){let b=B[y].indexOf(y1);B[y]=B[y].slice(0,b)+E+B[y].slice(b+y1.length)}else if(!B[y])B[y]=E;let T={...Z,__sections:B},I=`@layout('${R[1]}')${M}`;return await g4(I,T,F,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=a3(D,j),k={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(A,M,T)=>{return k[M]=T.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(A,M,T)=>{if(B[M]){let I=B[M];if(I.includes(y1)){let y=k[M]||"",E=I.indexOf(y1);I=I.slice(0,E)+y+I.slice(E+y1.length)}return I}return T||""}),N=pG(N,B),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),N=t3(N,j),Z.__originalFilePath=X,W=await z2(N,Z,F,G,Y),W=`<!-- stx-layout: ${_} -->
3624
- ${W}`,z(W)}catch(F){return i0.log(F instanceof Error?F:Error(String(F)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${F instanceof Error?F.message:String(F)}]`}return z(await z2(W,Z,X,G,Y))}function pG($,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 iG($,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 nG($,Z){await h1(()=>S9($,Z),void 0,(X)=>{i0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function sG($,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:W}=await o("stx/variable-extractor",()=>import("./chunk-man5awsh.js"));await W(G,Z,X,{preserveExisting:!0})}catch(W){let K=W instanceof Error?W:Error(String(W));i0.log(K,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${K.message}`)}}}async function oG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-bab9k1e8.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return i0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function z2($,Z,X,J,Y){let Q=$,G=J;if(await sG(Q,Z,X),Q=await oG(Q,Z,X),Q=await V9(Q,Z,X),Q=await O9(Q,Z,X),Q=await e6(Q,Z,X,G),G1(Q))Q=A8(Q,Z),Q=I8(Q,Z);Q=k8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-7fs8qzdd.js"));Q=q(Q,Z),Q=A9(Q,Z,X,G),Q=await d9(Q,Z,X,G,Y),Q=await S4(Q,Z,X,G,Y),Q=v7(Q,Z,X,G);let{processDeferDirectives:W}=await o("stx/defer",()=>import("./chunk-d8np0m39.js"));Q=W(Q,Z,X);let{processTeleportDirectives:K}=await o("stx/teleport",()=>import("./chunk-fk5y786g.js"));Q=K(Q,Z,X);let{processTransitionDirectives:U,processTransitionAttributes:z}=await o("stx/transitions",()=>import("./chunk-s5r7hwsw.js"));Q=U(Q,Z,X),Q=z(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-e5z100yg.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:j}=await o("stx/suspense",()=>import("./chunk-1fgbwc7a.js"));Q=j(Q,Z,X);let{processAsyncDirectives:B}=await o("stx/async-components",()=>import("./chunk-0gpkptex.js"));Q=B(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-5xj9t4wa.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:L,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-a53v7hcy.js"));Q=L(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:F,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-nsn7gfew.js"));Q=F(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-t1xzgpdm.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-qyfh6mf4.js"));Q=N(Q,Z,X);let{processHeadDirective:k,processTitleDirective:A,processMetaDirective:M,resetHead:T}=await o("stx/head",()=>import("./chunk-0ye9aj3r.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}
3623
+ ${D}`:D,Z.__sections=B}}if(_)try{let F;if(M0.isAbsolute(_))F=_,Y.add(_);else F=await h1(()=>q$(_,X,G,Y),null,()=>{throw new w1(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!F){let A=(I)=>{if(!I)return[];try{let y=M0.isAbsolute(I)?I:M0.resolve(process.cwd(),I);return mG.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},M=[...A(G.layoutsDir),...A(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(i0.log(Error(T),{layoutPath:_,filePath:X,available:M},"error"),console.error(`[stx] ${T}`),G.debug)throw new w1(T,X);return W}let w=await h1(()=>Bun.file(F).text(),"",()=>{throw new w1(`Failed to read layout file: ${F}`,X,void 0,void 0,"Layout content could not be loaded")}),R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${F}`);let A={},M=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,E,b)=>{return A[E]=b.trim(),""});for(let[y,E]of Object.entries(A))if(B[y]&&B[y].includes(y1)){let b=B[y].indexOf(y1);B[y]=B[y].slice(0,b)+E+B[y].slice(b+y1.length)}else if(!B[y])B[y]=E;let T={...Z,__sections:B},I=`@layout('${R[1]}')${M}`;return await g4(I,T,F,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=a3(D,j),k={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(A,M,T)=>{return k[M]=T.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(A,M,T)=>{if(B[M]){let I=B[M];if(I.includes(y1)){let y=k[M]||"",E=I.indexOf(y1);I=I.slice(0,E)+y+I.slice(E+y1.length)}return I}return T||""}),N=iG(N,B),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),N=t3(N,j),Z.__originalFilePath=X,W=await z2(N,Z,F,G,Y),W=`<!-- stx-layout: ${_} -->
3624
+ ${W}`,z(W)}catch(F){return i0.log(F instanceof Error?F:Error(String(F)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${F instanceof Error?F.message:String(F)}]`}return z(await z2(W,Z,X,G,Y))}function iG($,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 nG($,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 sG($,Z){await h1(()=>S9($,Z),void 0,(X)=>{i0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function oG($,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:W}=await o("stx/variable-extractor",()=>import("./chunk-rcfaqy69.js"));await W(G,Z,X,{preserveExisting:!0})}catch(W){let K=W instanceof Error?W:Error(String(W));i0.log(K,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${K.message}`)}}}async function rG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-6s3yxjmr.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return i0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function z2($,Z,X,J,Y){let Q=$,G=J;if(await oG(Q,Z,X),Q=await rG(Q,Z,X),Q=await V9(Q,Z,X),Q=await O9(Q,Z,X),Q=await e6(Q,Z,X,G),G1(Q))Q=A8(Q,Z),Q=I8(Q,Z);Q=k8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-myk6g2bz.js"));Q=q(Q,Z),Q=A9(Q,Z,X,G),Q=await d9(Q,Z,X,G,Y),Q=await S4(Q,Z,X,G,Y),Q=v7(Q,Z,X,G);let{processDeferDirectives:W}=await o("stx/defer",()=>import("./chunk-d8np0m39.js"));Q=W(Q,Z,X);let{processTeleportDirectives:K}=await o("stx/teleport",()=>import("./chunk-fk5y786g.js"));Q=K(Q,Z,X);let{processTransitionDirectives:U,processTransitionAttributes:z}=await o("stx/transitions",()=>import("./chunk-s5r7hwsw.js"));Q=U(Q,Z,X),Q=z(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-e5z100yg.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:j}=await o("stx/suspense",()=>import("./chunk-1fgbwc7a.js"));Q=j(Q,Z,X);let{processAsyncDirectives:B}=await o("stx/async-components",()=>import("./chunk-0gpkptex.js"));Q=B(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-5xj9t4wa.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:L,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-a53v7hcy.js"));Q=L(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:F,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-nsn7gfew.js"));Q=F(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-t1xzgpdm.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-qyfh6mf4.js"));Q=N(Q,Z,X);let{processHeadDirective:k,processTitleDirective:A,processMetaDirective:M,resetHead:T}=await o("stx/head",()=>import("./chunk-0ye9aj3r.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}
3625
3625
  `;if(Q=A(Q,Z),Q=M(Q,Z),Q=y9(Q),Q=y3(Q,Z),Q=t6(Q),Q=I9(Q),Q=await r3(Q,Z,X,G,Y),Q=await S4(Q,Z,X,G,Y),Z.__stxProcessingDepth===1)Q=X7(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=v4(Q),Q=X1(Q,Z,X),Q=h7(Q,Z,{filePath:X,buildMode:G.buildMode}),Q=S3(Q,Z),Q=C3(Q,Z),Q=N5(Q,Z),Q=u3(Q,Z),Q=d3(Q,Z),Q=await h6(Q,Z,X,G),Q=await i7(Q,Z,X),Q=await U9(Q,Z,X,G),Q=H2(Q,Z,X,G),Q=A6(Q,Z,X,G),Q=M6(Q,Z,X),Q=k6(Q,Z,X,G),Q=r6(Q,Z,X,G),Q=C4(Q,Z),Q=P4(Q),Q=Q2(Q),!G.skipEventDirectives)Q=$7(Q,Z,X);if(Q=m7(Q,Z,X),G.debug){let p=/\bx-data\s*=/.test(Q),i=B4($);if(p&&i)console.warn(`[stx] ${X}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3626
3626
  Both work on the same page, but they manage separate scopes.
3627
3627
  Prefer signals (state/derived/effect) for new components.`)}Q=v9(Q,Z),Q=await O1(Q,Z,X),Q=q2(Q),Q=W2(Q),Q=I7(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-vesr13aj.js"));Q=y(Q);let E=Z.__originalFilePath||X,b=v$(Z);if(Q=await T8(Q,G,E,b),Q=J9(Q,Z),Q=await b9(Q,Z,X,G),G.media?.image?.autoSiblings){let p=G.publicDir||"public",{rewriteImagesWithSiblings:i}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-5arv7j0q.js"));Q=await i(Q,{publicDir:p})}if(G.seo?.enabled)Q=I6(Q,Z,G);let S=(p,i,K0=!0)=>{if(!i)return p;let G0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),N0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(G0&&N0){if(K0)p=p.replace(N0[0],G0[0]);if(i=i.replace(G0[0],"").trim(),!i)return p}if(/<\/head>/i.test(p))return p.replace(/<\/head>/i,`${i}
@@ -3629,47 +3629,47 @@ ${W}`,z(W)}catch(F){return i0.log(F instanceof Error?F:Error(String(F)),{layoutP
3629
3629
  ${i}`);if(/<html\b[^>]*>/i.test(p))return p.replace(/(<html\b[^>]*>)/i,`$1
3630
3630
  <head>
3631
3631
  ${i}
3632
- </head>`);return p},{renderHead:v,getHead:x}=await o("stx/head",()=>import("./chunk-0ye9aj3r.js")),g=Z.__stx_runtime_head??x();if(g.title||g.meta?.length||g.link?.length){let p=v(g);if(p)Q=S(Q,p)}if(I.headContent)Q=S(Q,I.headContent,!g.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=s6(Q,G.csp,Z);if(G.analytics?.enabled)Q=E7(Q,G);if(G.heatmap?.enabled)Q=y7(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:p}=await o("stx/pwa/inject",()=>import("./chunk-3zd2f5qr.js"));Q=p(Q,G)}let X0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),e0=/\bSTX\.\w+/.test(Q),k0=/window\.STX\s*=/.test(Q);if(X0&&e0&&!k0){let i=`<script data-stx-scoped data-stx-run="once">
3632
+ </head>`);return p},{renderHead:v,getHead:x}=await o("stx/head",()=>import("./chunk-0ye9aj3r.js")),g=Z.__stx_runtime_head??x();if(g.title||g.meta?.length||g.link?.length){let p=v(g);if(p)Q=S(Q,p)}if(I.headContent)Q=S(Q,I.headContent,!g.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=s6(Q,G.csp,Z);if(G.analytics?.enabled)Q=E7(Q,G);if(G.heatmap?.enabled)Q=y7(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:p}=await o("stx/pwa/inject",()=>import("./chunk-3zd2f5qr.js"));Q=p(Q,G)}let Q0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),e0=/\bSTX\.\w+/.test(Q),k0=/window\.STX\s*=/.test(Q);if(Q0&&e0&&!k0){let i=`<script data-stx-scoped data-stx-run="once">
3633
3633
  ${A7()}
3634
3634
  </script>`;if(Q.includes("</head>")){let K0=Q.indexOf("</head>"),N0=Q.slice(0,K0).indexOf("<script");if(N0!==-1){let P0=Q.slice(0,N0),K5=Q.slice(N0);Q=P0+i+`
3635
3635
  `+K5}else Q=Q.replace("</head>",`${i}
3636
3636
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3637
3637
  ${i}`);else Q=i+`
3638
- `+Q}{let{scanScriptTags:p}=await o("stx/signal-processing",()=>import("./chunk-5a07gxnz.js")),i=[];for(let K0 of p(Q)){if(!/\bserver\b/i.test(K0.attrs))continue;let G0=K0.start+K0.fullMatch.indexOf(">")+1,N0=mG(Q,G0);if(N0===-1)continue;let P0=N0+9;while(P0<Q.length&&/\s/.test(Q[P0]))P0++;i.push({start:K0.start,end:P0})}for(let K0=i.length-1;K0>=0;K0--){let{start:G0,end:N0}=i[K0];Q=Q.substring(0,G0)+Q.substring(N0)}}let C0=R$(Q,X);if(C0.hasScoped)Q=C0.html;let J0=Z.__stx_event_bindings||[],H0=!1,I0=[],E0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:m0}=await o("stx/signal-processing",()=>import("./chunk-5a07gxnz.js"));for(let p of m0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))I0.push({match:p.fullMatch,attrs:p.attrs,content:p.body});for(let{match:p,attrs:i,content:K0}of I0){H0=!0;let G0=K0;x4(K0,X,J.strict,Z.__originalFilePath);let N0=await f$(K0,{eventBindings:J0,attrs:i,hasColonDirectives:E0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(p,()=>N0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let p=Z.__stx_event_bindings||[];if(p.length>0){let i=l$(p);if(i){let K0=Q.lastIndexOf("</body>");Q=K0===-1?Q+i:Q.slice(0,K0)+i+`
3639
- `+Q.slice(K0)}Z.__stx_event_bindings=[]}}if(!j8(Q)&&B8(Q))Q=await M$(Q,G);if(Q=_8(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=o6(Q,Z.cspNonce);return Q}var rG=[{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"}],aG=[{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')"}],tG=[{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 eG($){let Z=[],X=[];return $q($,Z),Zq($,Z,X),Xq($,X),Jq($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function $q($,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 Zq($,Z,X){for(let J of rG){let Y=new RegExp(`${J.open}(?:\\s|\\()`,"g"),Q=new RegExp(J.close,"g"),G=($.match(Y)||[]).length,q=($.match(Q)||[]).length;if(J.altClose){let W=new RegExp(J.altClose,"g");q+=($.match(W)||[]).length}if(G>q)Z.push({type:"directive",message:`Unclosed @${J.name} directive: found ${G} opening and ${q} closing`,suggestion:`Add ${G-q} missing ${J.close} tag(s)`});else if(q>G)X.push({type:"directive",message:`Extra ${J.close} found: ${q-G} more closing than opening`,suggestion:`Check for orphaned ${J.close} tags`})}}function Xq($,Z){for(let X of aG)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function Jq($,Z){for(let X of tG)if(X.pattern.test($))Z.push({type:"expression",message:`Security warning: ${X.message}`,suggestion:"Remove dangerous code from template expressions"})}function Yq($,Z){let X=$.slice(0,Z).split(`
3640
- `);return{line:X.length,column:X[X.length-1].length+1}}function Qq($,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 Gq($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function qq($){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 t0 from"path";import W5 from"process";var k2=["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"],F2=new Set(k2),Wq=new Set(["props","$props","defineProps"]),Kq=new Set(["stx","@stacksjs/stx"]),L2=G5(128);function Uq($){let Z=[],X=0,J=$.split(`
3641
- `);for(let Y of J){let Q=X,G=null,q=!1;for(let W=0;W<Y.length;W++){let K=Y[W];if(q){q=!1;continue}if(K==="\\"){q=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&W+1<Y.length&&Y[W+1]==="/")break;if(K==="{")X++;else if(K==="}")X--}if(Q===0){let W=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(W)Z.push(W[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 z=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(...z)}}}}return[...new Set(Z)]}function zq($){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,q=0,W=null;for(let K=0;K<J.length;K++){let U=J[K];if(W){if(Q+=U,U===W)W=null;continue}if(U==='"'||U==="'"||U==="`"){W=U,Q+=U;continue}if(U==="<")G++;else if(U===">"&&G>0)G--;else if(U==="(")q++;else if(U===")")q--;if(U===","&&G===0&&q===0){Y.push(Q),Q="";continue}Q+=U}if(Q)Y.push(Q);return Y.map((K)=>{let U=K.trim(),z=U.startsWith("..."),H=z?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 L=H.substring(0,j).trim().replace(/\?$/,""),V=H.substring(j+1),O=-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){O=R;break}let w=z?"...":"";if(O!==-1)return`${w}${L} = ${V.substring(O+1).trim()}`;return`${w}${L}`}).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,q=1,W=G+1,K=0,U=null;while(W<Z.length&&q>0){let j=Z[W];if(U){if(j===U)U=null;W++;continue}if(j==='"'||j==="'"||j==="`"){U=j,W++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")q++;else if(j===")")q--}if(q>0)W++}if(q!==0)continue;let z=Z.substring(G+1,W);if(!z.includes(":"))continue;let H=X(z);Q.push({start:G+1,end:W,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:q,end:W,replacement:K}=Q[G];Z=Z.substring(0,q)+K+Z.substring(W)}}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[q,...W]=G.split("="),K=q.split(":")[0].trim();if(W.length>0)return`${K} = ${W.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,`
3638
+ `+Q}{let{scanScriptTags:p}=await o("stx/signal-processing",()=>import("./chunk-jrfehndk.js")),i=[];for(let K0 of p(Q)){if(!/\bserver\b/i.test(K0.attrs))continue;let G0=K0.start+K0.fullMatch.indexOf(">")+1,N0=lG(Q,G0);if(N0===-1)continue;let P0=N0+9;while(P0<Q.length&&/\s/.test(Q[P0]))P0++;i.push({start:K0.start,end:P0})}for(let K0=i.length-1;K0>=0;K0--){let{start:G0,end:N0}=i[K0];Q=Q.substring(0,G0)+Q.substring(N0)}}let C0=R$(Q,X);if(C0.hasScoped)Q=C0.html;let X0=Z.__stx_event_bindings||[],H0=!1,I0=[],E0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:m0}=await o("stx/signal-processing",()=>import("./chunk-jrfehndk.js"));for(let p of m0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))I0.push({match:p.fullMatch,attrs:p.attrs,content:p.body});for(let{match:p,attrs:i,content:K0}of I0){H0=!0;let G0=K0;x4(K0,X,J.strict,Z.__originalFilePath);let N0=await f$(K0,{eventBindings:X0,attrs:i,hasColonDirectives:E0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(p,()=>N0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let p=Z.__stx_event_bindings||[];if(p.length>0){let i=l$(p);if(i){let K0=Q.lastIndexOf("</body>");Q=K0===-1?Q+i:Q.slice(0,K0)+i+`
3639
+ `+Q.slice(K0)}Z.__stx_event_bindings=[]}}if(!j8(Q)&&B8(Q))Q=await M$(Q,G);if(Q=_8(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=o6(Q,Z.cspNonce);return Q}var aG=[{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"}],tG=[{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')"}],eG=[{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 $q($){let Z=[],X=[];return Zq($,Z),Xq($,Z,X),Jq($,X),Yq($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function Zq($,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 Xq($,Z,X){for(let J of aG){let Y=new RegExp(`${J.open}(?:\\s|\\()`,"g"),Q=new RegExp(J.close,"g"),G=($.match(Y)||[]).length,q=($.match(Q)||[]).length;if(J.altClose){let W=new RegExp(J.altClose,"g");q+=($.match(W)||[]).length}if(G>q)Z.push({type:"directive",message:`Unclosed @${J.name} directive: found ${G} opening and ${q} closing`,suggestion:`Add ${G-q} missing ${J.close} tag(s)`});else if(q>G)X.push({type:"directive",message:`Extra ${J.close} found: ${q-G} more closing than opening`,suggestion:`Check for orphaned ${J.close} tags`})}}function Jq($,Z){for(let X of tG)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function Yq($,Z){for(let X of eG)if(X.pattern.test($))Z.push({type:"expression",message:`Security warning: ${X.message}`,suggestion:"Remove dangerous code from template expressions"})}function Qq($,Z){let X=$.slice(0,Z).split(`
3640
+ `);return{line:X.length,column:X[X.length-1].length+1}}function Gq($,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 qq($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function Wq($){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 t0 from"path";import W5 from"process";var k2=["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"],F2=new Set(k2),Kq=new Set(["props","$props","defineProps"]),Uq=new Set(["stx","@stacksjs/stx"]),L2=G5(128);function zq($){let Z=[],X=0,J=$.split(`
3641
+ `);for(let Y of J){let Q=X,G=null,q=!1;for(let W=0;W<Y.length;W++){let K=Y[W];if(q){q=!1;continue}if(K==="\\"){q=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&W+1<Y.length&&Y[W+1]==="/")break;if(K==="{")X++;else if(K==="}")X--}if(Q===0){let W=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(W)Z.push(W[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 z=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(...z)}}}}return[...new Set(Z)]}function Hq($){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,q=0,W=null;for(let K=0;K<J.length;K++){let U=J[K];if(W){if(Q+=U,U===W)W=null;continue}if(U==='"'||U==="'"||U==="`"){W=U,Q+=U;continue}if(U==="<")G++;else if(U===">"&&G>0)G--;else if(U==="(")q++;else if(U===")")q--;if(U===","&&G===0&&q===0){Y.push(Q),Q="";continue}Q+=U}if(Q)Y.push(Q);return Y.map((K)=>{let U=K.trim(),z=U.startsWith("..."),H=z?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 L=H.substring(0,j).trim().replace(/\?$/,""),V=H.substring(j+1),O=-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){O=R;break}let w=z?"...":"";if(O!==-1)return`${w}${L} = ${V.substring(O+1).trim()}`;return`${w}${L}`}).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,q=1,W=G+1,K=0,U=null;while(W<Z.length&&q>0){let j=Z[W];if(U){if(j===U)U=null;W++;continue}if(j==='"'||j==="'"||j==="`"){U=j,W++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")q++;else if(j===")")q--}if(q>0)W++}if(q!==0)continue;let z=Z.substring(G+1,W);if(!z.includes(":"))continue;let H=X(z);Q.push({start:G+1,end:W,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:q,end:W,replacement:K}=Q[G];Z=Z.substring(0,q)+K+Z.substring(W)}}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[q,...W]=G.split("="),K=q.split(":")[0].trim();if(W.length>0)return`${K} = ${W.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,`
3642
3642
 
3643
- `),Z}function Hq($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function jq($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function Bq($,Z,X,J={}){if(!$.trim())return;let Y=Y5(),Q=b1($,JSON.stringify(Y)),G=L2.get(Q);if(G===void 0){try{let C=u4({loader:"ts",target:"browser",define:Y}),P=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");P=P.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),G=C.transformSync(P)}catch{G=zq($)}L2.set(Q,G)}let q={exports:{}},W=q.exports,K=W5.cwd(),U={},z=[...G.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((C)=>C[1]).filter((C)=>!C.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(C)),H=new Map;for(let C of z)try{if(C.startsWith(".")){U[C]=await import(t0.resolve(t0.dirname(X),C));continue}let P=t0.resolve(K,"node_modules",C),r=t0.join(P,"package.json"),a=JSON.parse(f("fs").readFileSync(r,"utf8")),Y0=a.main||"index.js";if(a.exports){let Q0=typeof a.exports==="string"?a.exports:a.exports["."];if(typeof Q0==="string")Y0=Q0;else if(Q0?.bun)Y0=Q0.bun;else if(Q0?.import)Y0=Q0.import;else if(Q0?.default)Y0=Q0.default}U[C]=await import(t0.resolve(P,Y0))}catch(P){if(C.startsWith("."))H.set(C,P instanceof Error?P.message:String(P))}let j=(C)=>{if(U[C])return U[C];let P=H.get(C);if(P!==void 0)throw Error(`Cannot require '${C}' from ${X}: ${P}`);return f(C)},B=Z.props||{},_=(C)=>{if(!C)return B;let P={};for(let[r,a]of Object.entries(C)){let Y0=B[r];if(Y0!==void 0)P[r]=Y0;else if(typeof a==="function")P[r]=a();else P[r]=a}return P};for(let[C,P]of Object.entries(B))Object.defineProperty(_,C,{value:P,enumerable:!0,configurable:!0,writable:!0});for(let C of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(B,C))continue;try{Object.defineProperty(_,C,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let L=(C)=>{if(!C)return B;let P={...B};for(let[r,a]of Object.entries(C)){let Y0=a&&typeof a==="object"&&!Array.isArray(a)?a:{type:a};if(P[r]===void 0&&Y0.default!==void 0)P[r]=typeof Y0.default==="function"?Y0.default():Y0.default}return P},V=()=>Z.slots||{},O=(C,P)=>{let r={...C};for(let[a,Y0]of Object.entries(P))if(r[a]===void 0)if(typeof Y0==="function")r[a]=Y0();else r[a]=Y0;return r},F=(C)=>{let P=()=>C;return P.set=(r)=>{},P.update=(r)=>{},P},w=(C)=>{let P,r=!1;return()=>{if(!r)try{P=C(),r=!0}catch{P=void 0}return P}},R=(C)=>{},D=(C)=>C(),N=(C)=>{},k=(C)=>{},A=g7(Z);function M(C){let P=C||{};if(P.title!==void 0||P.description!==void 0)b({title:P.title,description:P.description})}function T(C){if(!C||typeof C!=="object")return;let P=Z.__stxClientPayload??{};Object.assign(P,C),Z.__stxClientPayload=P}let I=()=>{let C=Z.__stxServeContext,P=Z.__stxServeSearch??C?.search??"",r=C?.path??"",a=Object.fromEntries(new URLSearchParams(P)),Y0=Z.query,Q0=Object.keys(a).length>0?a:Y0??{},u=P||(Object.keys(Q0).length>0?`?${new URLSearchParams(Q0).toString()}`:"");return{params:Z.params??{},query:Q0,path:r,name:"",fullPath:r+u,hash:"",matched:[]}},y=()=>({push:(C)=>{},replace:(C)=>{},back:()=>{},forward:()=>{},go:(C)=>{}}),E=(C)=>{let P=Z.__stx_runtime_head||{};Z.__stx_runtime_head=G$(P,C||{})},b=(C)=>{E(M2(C||{}))},S=(C)=>({value:C}),v=(C)=>C,x=(C)=>({value:typeof C==="function"?C():C}),d=(C,P)=>{},g=(C)=>{},X0=(C)=>{},e0=(C)=>C?C():Promise.resolve(),k0=(C)=>(P,...r)=>{},C0=(C)=>{},J0=(C,P)=>{},H0=(C,P)=>P,I0=()=>({value:"light"}),E0=()=>F(!1),m0=(C)=>F(!1),p=()=>F(!1),i=()=>m0("(prefers-color-scheme: dark)"),K0=()=>m0("(prefers-color-scheme: light)"),G0=()=>m0("(prefers-reduced-motion: reduce)"),N0=()=>m0("(prefers-contrast: more)"),P0={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},K5=new Proxy(P0,{get(C,P){if(P in C)return C[P];return},set(C,P,r){return C[P]=r,!0}}),C5={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},P5=console;try{let C=I2(G,X),P=new Set(Object.keys(B)),r=(s)=>/^[a-z_$][\w$]*$/i.test(s),a=Object.keys(Z).filter((s)=>!P.has(s)&&!Wq.has(s)&&r(s)),Y0=a.map((s)=>Z[s]);if(!a.includes("__stxServeContext"))a.push("__stxServeContext"),Y0.push(void 0);let Q0=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","let","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","await","async","module","exports","require","params","window","document","console","state","derived","effect"]),u=[],m=[];for(let[s,l0]of Object.entries(B)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))continue;if(Q0.has(s))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${s}\\b`).test(C))continue;u.push(s),m.push(l0)}let n=Uq(C).map((s)=>`module.exports.${s} = typeof ${s} !== 'undefined' ? ${s} : module.exports.${s};`).join(`
3644
- `),O0=Z.params??{},F0=[],v0=[];for(let s=0;s<a.length;s++){if(a[s]==="params")continue;F0.push(a[s]),v0.push(Y0[s])}let b0=await Function(...k2,...u,...F0,`return (async () => {
3643
+ `),Z}function jq($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function Bq($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function _q($,Z,X,J={}){if(!$.trim())return;let Y=Y5(),Q=b1($,JSON.stringify(Y)),G=L2.get(Q);if(G===void 0){try{let C=u4({loader:"ts",target:"browser",define:Y}),P=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");P=P.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),G=C.transformSync(P)}catch{G=Hq($)}L2.set(Q,G)}let q={exports:{}},W=q.exports,K=W5.cwd(),U={},z=[...G.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((C)=>C[1]).filter((C)=>!C.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(C)),H=new Map;for(let C of z)try{if(C.startsWith(".")){U[C]=await import(t0.resolve(t0.dirname(X),C));continue}let P=t0.resolve(K,"node_modules",C),r=t0.join(P,"package.json"),a=JSON.parse(f("fs").readFileSync(r,"utf8")),J0=a.main||"index.js";if(a.exports){let Y0=typeof a.exports==="string"?a.exports:a.exports["."];if(typeof Y0==="string")J0=Y0;else if(Y0?.bun)J0=Y0.bun;else if(Y0?.import)J0=Y0.import;else if(Y0?.default)J0=Y0.default}U[C]=await import(t0.resolve(P,J0))}catch(P){if(C.startsWith("."))H.set(C,P instanceof Error?P.message:String(P))}let j=(C)=>{if(U[C])return U[C];let P=H.get(C);if(P!==void 0)throw Error(`Cannot require '${C}' from ${X}: ${P}`);return f(C)},B=Z.props||{},_=(C)=>{if(!C)return B;let P={};for(let[r,a]of Object.entries(C)){let J0=B[r];if(J0!==void 0)P[r]=J0;else if(typeof a==="function")P[r]=a();else P[r]=a}return P};for(let[C,P]of Object.entries(B))Object.defineProperty(_,C,{value:P,enumerable:!0,configurable:!0,writable:!0});for(let C of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(B,C))continue;try{Object.defineProperty(_,C,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let L=(C)=>{if(!C)return B;let P={...B};for(let[r,a]of Object.entries(C)){let J0=a&&typeof a==="object"&&!Array.isArray(a)?a:{type:a};if(P[r]===void 0&&J0.default!==void 0)P[r]=typeof J0.default==="function"?J0.default():J0.default}return P},V=()=>Z.slots||{},O=(C,P)=>{let r={...C};for(let[a,J0]of Object.entries(P))if(r[a]===void 0)if(typeof J0==="function")r[a]=J0();else r[a]=J0;return r},F=(C)=>{let P=()=>C;return P.set=(r)=>{},P.update=(r)=>{},P},w=(C)=>{let P,r=!1;return()=>{if(!r)try{P=C(),r=!0}catch{P=void 0}return P}},R=(C)=>{},D=(C)=>C(),N=(C)=>{},k=(C)=>{},A=g7(Z);function M(C){let P=C||{};if(P.title!==void 0||P.description!==void 0)b({title:P.title,description:P.description})}function T(C){if(!C||typeof C!=="object")return;let P=Z.__stxClientPayload??{};Object.assign(P,C),Z.__stxClientPayload=P}let I=()=>{let C=Z.__stxServeContext,P=Z.__stxServeSearch??C?.search??"",r=C?.path??"",a=Object.fromEntries(new URLSearchParams(P)),J0=Z.query,Y0=Object.keys(a).length>0?a:J0??{},u=P||(Object.keys(Y0).length>0?`?${new URLSearchParams(Y0).toString()}`:"");return{params:Z.params??{},query:Y0,path:r,name:"",fullPath:r+u,hash:"",matched:[]}},y=()=>({push:(C)=>{},replace:(C)=>{},back:()=>{},forward:()=>{},go:(C)=>{}}),E=(C)=>{let P=Z.__stx_runtime_head||{};Z.__stx_runtime_head=G$(P,C||{})},b=(C)=>{E(M2(C||{}))},S=(C)=>({value:C}),v=(C)=>C,x=(C)=>({value:typeof C==="function"?C():C}),d=(C,P)=>{},g=(C)=>{},Q0=(C)=>{},e0=(C)=>C?C():Promise.resolve(),k0=(C)=>(P,...r)=>{},C0=(C)=>{},X0=(C,P)=>{},H0=(C,P)=>P,I0=()=>({value:"light"}),E0=()=>F(!1),m0=(C)=>F(!1),p=()=>F(!1),i=()=>m0("(prefers-color-scheme: dark)"),K0=()=>m0("(prefers-color-scheme: light)"),G0=()=>m0("(prefers-reduced-motion: reduce)"),N0=()=>m0("(prefers-contrast: more)"),P0={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},K5=new Proxy(P0,{get(C,P){if(P in C)return C[P];return},set(C,P,r){return C[P]=r,!0}}),C5={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},P5=console;try{let C=I2(G,X),P=new Set(Object.keys(B)),r=(s)=>/^[a-z_$][\w$]*$/i.test(s),a=Object.keys(Z).filter((s)=>!P.has(s)&&!Kq.has(s)&&r(s)),J0=a.map((s)=>Z[s]);if(!a.includes("__stxServeContext"))a.push("__stxServeContext"),J0.push(void 0);let Y0=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","let","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","await","async","module","exports","require","params","window","document","console","state","derived","effect"]),u=[],m=[];for(let[s,l0]of Object.entries(B)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))continue;if(Y0.has(s))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${s}\\b`).test(C))continue;u.push(s),m.push(l0)}let n=zq(C).map((s)=>`module.exports.${s} = typeof ${s} !== 'undefined' ? ${s} : module.exports.${s};`).join(`
3644
+ `),O0=Z.params??{},F0=[],v0=[];for(let s=0;s<a.length;s++){if(a[s]==="params")continue;F0.push(a[s]),v0.push(J0[s])}let b0=await Function(...k2,...u,...F0,`return (async () => {
3645
3645
  ${C}
3646
3646
  ${n}
3647
3647
  return module.exports
3648
- })()`)(q,W,j,B,_,L,O,T,F,w,R,D,N,k,M,I,y,E,b,A.setResponseStatus,A.setResponseHeader,A.notFound,S,v,x,d,g,X0,e0,k0,C0,V,J0,H0,I0,E0,m0,p,i,K0,G0,N0,K5,C5,P5,P0.confirm,P0.alert,P0.fetch,O0,...m,...v0);if(J.preserveExisting){for(let[s,l0]of Object.entries(b0))if(!(s in Z)||Z[s]===void 0)Z[s]=l0}else Object.assign(Z,b0);for(let[s,l0]of Object.entries(B))if(!(s in Z))Z[s]=l0}catch(C){let P=C instanceof Error?C.message:String(C);if(Hq(P))console.warn(`[stx] server <script> in ${X??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${P}`);else if(jq(P))console.warn(`[stx] server <script> in ${X??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${P}`);else if(W5.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${X??"<unknown>"} \u2014 falling back to static extraction. Cause: ${P}`);try{await Dq(G,Z,X)}catch(r){if(W5.env.STX_DEBUG){let a=r instanceof Error?r.message:String(r);console.warn(`[stx] fallback extraction also failed in ${X??"<unknown>"}: ${a}`)}}}}function _q($){let Z=0,X=null,J=!1,Y=!1;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(X){if(G===X){if(X=null,J||Z===0)Y=!0}continue}if(G==="'"||G==='"'||G==="`"){X=G;continue}if(G==="{")Z++;else if(G==="}")Z--;else if($.startsWith("from",Q)&&Z===0)J=!0}return X===null&&Z===0&&Y}var Vq=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function I2($,Z){let X=Z?t0.dirname(Z):W5.cwd(),J=W5.cwd(),Y=$.split(`
3648
+ })()`)(q,W,j,B,_,L,O,T,F,w,R,D,N,k,M,I,y,E,b,A.setResponseStatus,A.setResponseHeader,A.notFound,S,v,x,d,g,Q0,e0,k0,C0,V,X0,H0,I0,E0,m0,p,i,K0,G0,N0,K5,C5,P5,P0.confirm,P0.alert,P0.fetch,O0,...m,...v0);if(J.preserveExisting){for(let[s,l0]of Object.entries(b0))if(!(s in Z)||Z[s]===void 0)Z[s]=l0}else Object.assign(Z,b0);for(let[s,l0]of Object.entries(B))if(!(s in Z))Z[s]=l0}catch(C){let P=C instanceof Error?C.message:String(C);if(jq(P))console.warn(`[stx] server <script> in ${X??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${P}`);else if(Bq(P))console.warn(`[stx] server <script> in ${X??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${P}`);else if(W5.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${X??"<unknown>"} \u2014 falling back to static extraction. Cause: ${P}`);try{await Nq(G,Z,X)}catch(r){if(W5.env.STX_DEBUG){let a=r instanceof Error?r.message:String(r);console.warn(`[stx] fallback extraction also failed in ${X??"<unknown>"}: ${a}`)}}}}function Vq($){let Z=0,X=null,J=!1,Y=!1;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(X){if(G===X){if(X=null,J||Z===0)Y=!0}continue}if(G==="'"||G==='"'||G==="`"){X=G;continue}if(G==="{")Z++;else if(G==="}")Z--;else if($.startsWith("from",Q)&&Z===0)J=!0}return X===null&&Z===0&&Y}var Oq=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function I2($,Z){let X=Z?t0.dirname(Z):W5.cwd(),J=W5.cwd(),Y=$.split(`
3649
3649
  `),Q=[],G=0;while(G<Y.length){let q=Y[G].trim();if(q.startsWith("interface ")||q.startsWith("export interface ")||q.startsWith("type ")||q.startsWith("export type ")){if(q.includes("{")&&!q.includes("}")){let W=0;for(;G<Y.length;G++){for(let K of Y[G])if(K==="{")W++;else if(K==="}")W--;if(W<=0)break}}G++;continue}if(q.startsWith("definePageMeta(")){let W=0,K=!1,U=G;for(let j=G;j<Y.length&&!K;j++){let B=null,_=!1,L=Y[j];for(let V=0;V<L.length;V++){let O=L[V];if(_){_=!1;continue}if(O==="\\"){_=!0;continue}if(B){if(O===B)B=null;continue}if(O==='"'||O==="'"||O==="`"){B=O;continue}if(O==="(")W++;else if(O===")"){if(W--,W===0){G=j+1,K=!0;break}}}}if(!K)G=Y.length;let z=Y.slice(U,G).join(`
3650
- `),H=[];for(let j of["title","description"]){let B=new RegExp(`\\b${j}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(z);if(B)H.push(`${j}: ${JSON.stringify(B[2])}`)}if(H.length>0)Q.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(q.startsWith("import ")||q==="import"||q.startsWith("import{")){let W=q,K=0;while(!_q(W)&&G+K+1<Y.length)K++,W=`${W} ${Y[G+K].trim()}`;G+=K;let U=W.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),z=W.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=W.match(/^import\s+['"](.+?)['"]/),j=W,B=(_)=>{if(_.startsWith("."))return t0.resolve(X,_);if(_.startsWith("~/")||_.startsWith("@/"))return t0.resolve(J,_.slice(2));return _};if(U){let[,_,L]=U,V=B(L);Q.push(`const ${_} = (await import('${V}')).default`),Q.push(`module.exports.${_} = ${_};`)}else if(z){let[,_,L]=z,V=B(L),O=[],F=[],w=Kq.has(L);for(let R of _.split(",")){let D=R.trim();if(!D)continue;let N=D.split(/\s+as\s+/);if(N.length===2){let[k,A]=[N[0].trim(),N[1].trim()];if(w&&F2.has(k)){Q.push(`const ${A} = ${k};`);continue}O.push(`${k}: ${A}`),F.push(A)}else{if(w&&F2.has(D))continue;O.push(D),F.push(D)}}if(O.length>0)Q.push(`const { ${O.join(", ")} } = await import('${V}')`);for(let R of F)Q.push(`module.exports.${R} = ${R};`)}else if(H){let _=B(H[1]);Q.push(`await import('${_}')`)}else Q.push(j);G++;continue}if(Vq.test(q))Q.push(Y[G]),G++;else if(q.startsWith("export const ")||q.startsWith("export let ")||q.startsWith("export var ")){let W=R2(Y,G),{type:K,name:U,value:z}=W;Q.push(`${K} ${U} = ${z};`),Q.push(`module.exports.${U} = ${U};`),G=W.nextIndex}else if(q.startsWith("export function ")||q.startsWith("export async function ")){let W=h4(Y,G);Q.push(W.functionCode),Q.push(`module.exports.${W.name} = ${W.name};`),G=W.nextIndex}else if(q.startsWith("const ")||q.startsWith("let ")||q.startsWith("var ")){let W=R2(Y,G),{type:K,name:U,value:z}=W;Q.push(`${K} ${U} = ${z};`),Q.push(`module.exports.${U} = ${U};`),G=W.nextIndex}else if(q.startsWith("function ")||q.startsWith("async function ")){let W=h4(Y,G);Q.push(W.functionCode),Q.push(`module.exports.${W.name} = ${W.name};`),G=W.nextIndex}else if(q.startsWith("export default function ")||q.startsWith("export default async function ")){let W=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),K=[...Y];K[G]=W;let U=h4(K,G);if(Q.push(U.functionCode),U.name)Q.push(`module.exports.default = ${U.name};`);G=U.nextIndex}else if(q.startsWith("export default ")){let W=q.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${W};`),G++}else if(q.startsWith("class ")||q.startsWith("export class ")){let W=q.match(/(?:export\s+)?class\s+(\w+)/);if(W){let K=W[1],U=Y[G].replace(/^export\s+/,""),z=0,H=G;for(;H<Y.length;H++){let j=Y[H];for(let B of j)if(B==="{")z++;else if(B==="}")z--;if(H>G)U+=`
3651
- `+j;if(z<=0&&H>=G)break}Q.push(U),Q.push(`module.exports.${K} = ${K};`),G=H+1}else Q.push(q),G++}else if(q.includes("module.exports"))Q.push(q),G++;else if(q.trim()&&!q.startsWith("//"))Q.push(q),G++;else G++}return Oq(Q.join(`
3652
- `),X,J)}function Oq($,Z,X){let J=$.length,Y="",Q=0,G=null,q=!1,W=!1,K=0;while(Q<J){let U=$[Q],z=$[Q+1];if(q){if(Y+=U,U===`
3653
- `)q=!1;Q++;continue}if(W){if(Y+=U,U==="*"&&z==="/"){Y+=z,Q+=2,W=!1;continue}Q++;continue}if(!G&&U==="/"&&z==="/"){q=!0,Y+=U,Q++;continue}if(!G&&U==="/"&&z==="*"){W=!0,Y+=U,Q++;continue}if(G){if(Y+=U,U==="\\"){Y+=z,Q+=2;continue}if(U===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(U==="$"&&z==="{"){K++,Y+=z,Q+=2;continue}if(U==="`"){G=null,Q++;continue}}Q++;continue}if(K>0){if(U==="{")K++;else if(U==="}")K--}if(U==='"'||U==="'"||U==="`"){G=U,Y+=U,Q++;continue}if(U==="a"&&$.startsWith("await",Q)){let H=Fq($,Q);if(H){let{quote:j,path:B,end:_}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let L=B.startsWith(".")?t0.resolve(Z,B):t0.resolve(X,B.slice(2));Y+=`await import(${j}${L}${j})`,Q=_;continue}}}Y+=U,Q++}return Y}function Fq($,Z){let X=Z+5;if(X>=$.length)return null;if(!/\s/.test($[X]))return null;while(X<$.length&&/\s/.test($[X]))X++;if(!$.startsWith("import",X))return null;X+=6;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return null;X++;while(X<$.length&&/\s/.test($[X]))X++;let J=$[X];if(J!=="'"&&J!=='"')return null;X++;let Y=X;while(X<$.length&&$[X]!==J)if($[X]==="\\")X+=2;else X++;if(X>=$.length)return null;let Q=$.slice(Y,X);X++;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!==")")return null;return{quote:J,path:Q,end:X+1}}function T2($,Z){let X=$[Z];if(X!=="{"&&X!=="[")return null;let Y=B0($,X,X==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function E2($){let Z=[],X=$.slice(1,-1).trim();if(!X)return Z;let J=0,Y=0,Q="";while(J<X.length){let G=X[J];if(G==="{"||G==="["){let q=Y===0?T2(X,J):null;if(q){Z.push(...E2(q.pattern)),J=q.endPos,Q="";continue}Y++}else if(G==="}"||G==="]")Y--;if(Y>0){J++;continue}if(G===","){if(Q.trim())Z.push(Q.trim());Q="",J++;continue}if(G===":"){Q="",J++;continue}if(G==="="){if(Q.trim())Z.push(Q.trim());Q="",J++;while(J<X.length&&X[J]!==","&&Y===0){if(X[J]==="{"||X[J]==="[")Y++;else if(X[J]==="}"||X[J]==="]")Y--;J++}continue}if(/[\w$]/.test(G))Q+=G;J++}if(Q.trim())Z.push(Q.trim());return Z}function Lq($){let Z=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec($);if(!Z)return null;let X=Z[0].length,J=(Y)=>Y===" "||Y==="\t";while(X<$.length&&J($[X]))X++;if($[X]===":"){let Y=0,Q=null;X++;for(;X<$.length;X++){let G=$[X];if(Q){if(G==="\\"){X++;continue}if(G===Q)Q=null;continue}if(G==="'"||G==='"'||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{"||G==="<"){Y++;continue}if(G===")"||G==="]"||G==="}"||G===">"){Y--;continue}if(G==="="&&Y<=0){let q=$[X+1],W=$[X-1];if(q!=="="&&q!==">"&&W!=="="&&W!=="!"&&W!=="<"&&W!==">")break}}if($[X]!=="=")return null}while(X<$.length&&J($[X]))X++;if($[X]!=="=")return null;return{type:Z[1],name:Z[2],value:$.slice(X+1).trim()}}function w2($,Z,X,J){let Y=null,Q=!1;for(let G of $){if(Q){Q=!1;continue}if(G==="\\"){Q=!0;continue}if(Y){if(G===Y)Y=null;continue}if(G==="'"||G==='"'||G==="`"){Y=G;continue}if(G===Z)J++;else if(G===X)J--}return J}function R2($,Z){let X=$[Z].trim(),J=Lq(X),Y=J?[X,J.type,J.name,J.value]:null;if(!Y){let U=X.match(/^(?:export\s+)?(const|let|var)\s+/);if(U){let z=X.slice(U[0].length),H=Z;if(z.startsWith("{")||z.startsWith("[")){let B=z[0],_=B==="{"?"}":"]",L=w2(z,B,_,0),V=z;for(let O=Z+1;O<$.length&&L>0;O++)V+=` ${$[O].trim()}`,H=O,L=w2($[O],B,_,L);if(L>0)V=z,H=Z;z=V}let j=T2(z,0);if(j){let B=U[1],_=j.pattern,L=z.slice(j.endPos).trim();if(L.startsWith("=")){let V=L.slice(1).trim(),O=V,F=Math.max(H,Z);if(D2(V)){let N=N2($,F,V);O=N.value,F=N.nextIndex}else F=F+1;O=O.trim().replace(/;$/,"");let w=E2(_),R=`__stx_src_${Z}`,D=w.map((N)=>`module.exports.${N} = ${N};`).join(`
3650
+ `),H=[];for(let j of["title","description"]){let B=new RegExp(`\\b${j}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(z);if(B)H.push(`${j}: ${JSON.stringify(B[2])}`)}if(H.length>0)Q.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(q.startsWith("import ")||q==="import"||q.startsWith("import{")){let W=q,K=0;while(!Vq(W)&&G+K+1<Y.length)K++,W=`${W} ${Y[G+K].trim()}`;G+=K;let U=W.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),z=W.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=W.match(/^import\s+['"](.+?)['"]/),j=W,B=(_)=>{if(_.startsWith("."))return t0.resolve(X,_);if(_.startsWith("~/")||_.startsWith("@/"))return t0.resolve(J,_.slice(2));return _};if(U){let[,_,L]=U,V=B(L);Q.push(`const ${_} = (await import('${V}')).default`),Q.push(`module.exports.${_} = ${_};`)}else if(z){let[,_,L]=z,V=B(L),O=[],F=[],w=Uq.has(L);for(let R of _.split(",")){let D=R.trim();if(!D)continue;let N=D.split(/\s+as\s+/);if(N.length===2){let[k,A]=[N[0].trim(),N[1].trim()];if(w&&F2.has(k)){Q.push(`const ${A} = ${k};`);continue}O.push(`${k}: ${A}`),F.push(A)}else{if(w&&F2.has(D))continue;O.push(D),F.push(D)}}if(O.length>0)Q.push(`const { ${O.join(", ")} } = await import('${V}')`);for(let R of F)Q.push(`module.exports.${R} = ${R};`)}else if(H){let _=B(H[1]);Q.push(`await import('${_}')`)}else Q.push(j);G++;continue}if(Oq.test(q))Q.push(Y[G]),G++;else if(q.startsWith("export const ")||q.startsWith("export let ")||q.startsWith("export var ")){let W=R2(Y,G),{type:K,name:U,value:z}=W;Q.push(`${K} ${U} = ${z};`),Q.push(`module.exports.${U} = ${U};`),G=W.nextIndex}else if(q.startsWith("export function ")||q.startsWith("export async function ")){let W=h4(Y,G);Q.push(W.functionCode),Q.push(`module.exports.${W.name} = ${W.name};`),G=W.nextIndex}else if(q.startsWith("const ")||q.startsWith("let ")||q.startsWith("var ")){let W=R2(Y,G),{type:K,name:U,value:z}=W;Q.push(`${K} ${U} = ${z};`),Q.push(`module.exports.${U} = ${U};`),G=W.nextIndex}else if(q.startsWith("function ")||q.startsWith("async function ")){let W=h4(Y,G);Q.push(W.functionCode),Q.push(`module.exports.${W.name} = ${W.name};`),G=W.nextIndex}else if(q.startsWith("export default function ")||q.startsWith("export default async function ")){let W=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),K=[...Y];K[G]=W;let U=h4(K,G);if(Q.push(U.functionCode),U.name)Q.push(`module.exports.default = ${U.name};`);G=U.nextIndex}else if(q.startsWith("export default ")){let W=q.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${W};`),G++}else if(q.startsWith("class ")||q.startsWith("export class ")){let W=q.match(/(?:export\s+)?class\s+(\w+)/);if(W){let K=W[1],U=Y[G].replace(/^export\s+/,""),z=0,H=G;for(;H<Y.length;H++){let j=Y[H];for(let B of j)if(B==="{")z++;else if(B==="}")z--;if(H>G)U+=`
3651
+ `+j;if(z<=0&&H>=G)break}Q.push(U),Q.push(`module.exports.${K} = ${K};`),G=H+1}else Q.push(q),G++}else if(q.includes("module.exports"))Q.push(q),G++;else if(q.trim()&&!q.startsWith("//"))Q.push(q),G++;else G++}return Fq(Q.join(`
3652
+ `),X,J)}function Fq($,Z,X){let J=$.length,Y="",Q=0,G=null,q=!1,W=!1,K=0;while(Q<J){let U=$[Q],z=$[Q+1];if(q){if(Y+=U,U===`
3653
+ `)q=!1;Q++;continue}if(W){if(Y+=U,U==="*"&&z==="/"){Y+=z,Q+=2,W=!1;continue}Q++;continue}if(!G&&U==="/"&&z==="/"){q=!0,Y+=U,Q++;continue}if(!G&&U==="/"&&z==="*"){W=!0,Y+=U,Q++;continue}if(G){if(Y+=U,U==="\\"){Y+=z,Q+=2;continue}if(U===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(U==="$"&&z==="{"){K++,Y+=z,Q+=2;continue}if(U==="`"){G=null,Q++;continue}}Q++;continue}if(K>0){if(U==="{")K++;else if(U==="}")K--}if(U==='"'||U==="'"||U==="`"){G=U,Y+=U,Q++;continue}if(U==="a"&&$.startsWith("await",Q)){let H=Lq($,Q);if(H){let{quote:j,path:B,end:_}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let L=B.startsWith(".")?t0.resolve(Z,B):t0.resolve(X,B.slice(2));Y+=`await import(${j}${L}${j})`,Q=_;continue}}}Y+=U,Q++}return Y}function Lq($,Z){let X=Z+5;if(X>=$.length)return null;if(!/\s/.test($[X]))return null;while(X<$.length&&/\s/.test($[X]))X++;if(!$.startsWith("import",X))return null;X+=6;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return null;X++;while(X<$.length&&/\s/.test($[X]))X++;let J=$[X];if(J!=="'"&&J!=='"')return null;X++;let Y=X;while(X<$.length&&$[X]!==J)if($[X]==="\\")X+=2;else X++;if(X>=$.length)return null;let Q=$.slice(Y,X);X++;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!==")")return null;return{quote:J,path:Q,end:X+1}}function T2($,Z){let X=$[Z];if(X!=="{"&&X!=="[")return null;let Y=B0($,X,X==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function E2($){let Z=[],X=$.slice(1,-1).trim();if(!X)return Z;let J=0,Y=0,Q="";while(J<X.length){let G=X[J];if(G==="{"||G==="["){let q=Y===0?T2(X,J):null;if(q){Z.push(...E2(q.pattern)),J=q.endPos,Q="";continue}Y++}else if(G==="}"||G==="]")Y--;if(Y>0){J++;continue}if(G===","){if(Q.trim())Z.push(Q.trim());Q="",J++;continue}if(G===":"){Q="",J++;continue}if(G==="="){if(Q.trim())Z.push(Q.trim());Q="",J++;while(J<X.length&&X[J]!==","&&Y===0){if(X[J]==="{"||X[J]==="[")Y++;else if(X[J]==="}"||X[J]==="]")Y--;J++}continue}if(/[\w$]/.test(G))Q+=G;J++}if(Q.trim())Z.push(Q.trim());return Z}function wq($){let Z=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec($);if(!Z)return null;let X=Z[0].length,J=(Y)=>Y===" "||Y==="\t";while(X<$.length&&J($[X]))X++;if($[X]===":"){let Y=0,Q=null;X++;for(;X<$.length;X++){let G=$[X];if(Q){if(G==="\\"){X++;continue}if(G===Q)Q=null;continue}if(G==="'"||G==='"'||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{"||G==="<"){Y++;continue}if(G===")"||G==="]"||G==="}"||G===">"){Y--;continue}if(G==="="&&Y<=0){let q=$[X+1],W=$[X-1];if(q!=="="&&q!==">"&&W!=="="&&W!=="!"&&W!=="<"&&W!==">")break}}if($[X]!=="=")return null}while(X<$.length&&J($[X]))X++;if($[X]!=="=")return null;return{type:Z[1],name:Z[2],value:$.slice(X+1).trim()}}function w2($,Z,X,J){let Y=null,Q=!1;for(let G of $){if(Q){Q=!1;continue}if(G==="\\"){Q=!0;continue}if(Y){if(G===Y)Y=null;continue}if(G==="'"||G==='"'||G==="`"){Y=G;continue}if(G===Z)J++;else if(G===X)J--}return J}function R2($,Z){let X=$[Z].trim(),J=wq(X),Y=J?[X,J.type,J.name,J.value]:null;if(!Y){let U=X.match(/^(?:export\s+)?(const|let|var)\s+/);if(U){let z=X.slice(U[0].length),H=Z;if(z.startsWith("{")||z.startsWith("[")){let B=z[0],_=B==="{"?"}":"]",L=w2(z,B,_,0),V=z;for(let O=Z+1;O<$.length&&L>0;O++)V+=` ${$[O].trim()}`,H=O,L=w2($[O],B,_,L);if(L>0)V=z,H=Z;z=V}let j=T2(z,0);if(j){let B=U[1],_=j.pattern,L=z.slice(j.endPos).trim();if(L.startsWith("=")){let V=L.slice(1).trim(),O=V,F=Math.max(H,Z);if(D2(V)){let N=N2($,F,V);O=N.value,F=N.nextIndex}else F=F+1;O=O.trim().replace(/;$/,"");let w=E2(_),R=`__stx_src_${Z}`,D=w.map((N)=>`module.exports.${N} = ${N};`).join(`
3654
3654
  `);return{type:B,name:R,value:`${O}; ${B} ${_} = ${R};
3655
3655
  ${D}`,nextIndex:F}}}}throw Error(`Failed to parse variable declaration: ${X}`)}let[,Q,G,q]=Y,W=q,K=Z;if(D2(q)){let U=N2($,Z,q);W=U.value,K=U.nextIndex}else K=Z+1;while(K<$.length){let U=$[K].trim();if(U.startsWith(".")||U.startsWith("?."))W+=`
3656
- ${$[K]}`,K++;else break}return W=W.trim().replace(/;$/,""),{type:Q,name:G,value:W,nextIndex:K}}function h4($,Z){let X=$[Z].trim(),J=X.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!J)throw Error(`Failed to parse function declaration: ${X}`);let[,Y]=J,Q=X.replace(/^export\s+/,""),G=Z;if(wq(X)){let q=Rq($,Z,Q);Q=q.functionCode,G=q.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function D2($){let Z=$.trim();if(Z.startsWith("{"))return B0(Z,"{","}",0)===-1;if(Z.startsWith("["))return B0(Z,"[","]",0)===-1;return!b2(Z)}function b2($){let Z={paren:0,bracket:0,brace:0},X=null,J=0;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if((Y>0?$[Y-1]:"")==="\\"&&X)continue;if((Q==='"'||Q==="'")&&!X){X=Q;continue}if(Q===X&&X!=="`"){X=null;continue}if(Q==="`"&&!X){X="`";continue}if(Q==="`"&&X==="`"&&J===0){X=null;continue}if(X==="`"&&Q==="$"&&$[Y+1]==="{"){J++,Y++;continue}if(J>0&&Q==="{"){J++;continue}if(J>0&&Q==="}"){J--;continue}if(X)continue;if(Q==="(")Z.paren++;else if(Q===")")Z.paren--;else if(Q==="[")Z.bracket++;else if(Q==="]")Z.bracket--;else if(Q==="{")Z.brace++;else if(Q==="}")Z.brace--}return Z.paren===0&&Z.bracket===0&&Z.brace===0&&X===null}function y2($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let X=B0($,"(",")",Z);if(X===-1)return-1;return $.indexOf("{",X)}function wq($){let Z=y2($);if(Z===-1)return!0;return B0($,"{","}",Z)===-1}function N2($,Z,X){let J=X,Y=Z+1;while(Y<$.length&&!b2(J)){let Q=$[Y];J+=`
3656
+ ${$[K]}`,K++;else break}return W=W.trim().replace(/;$/,""),{type:Q,name:G,value:W,nextIndex:K}}function h4($,Z){let X=$[Z].trim(),J=X.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!J)throw Error(`Failed to parse function declaration: ${X}`);let[,Y]=J,Q=X.replace(/^export\s+/,""),G=Z;if(Rq(X)){let q=Dq($,Z,Q);Q=q.functionCode,G=q.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function D2($){let Z=$.trim();if(Z.startsWith("{"))return B0(Z,"{","}",0)===-1;if(Z.startsWith("["))return B0(Z,"[","]",0)===-1;return!b2(Z)}function b2($){let Z={paren:0,bracket:0,brace:0},X=null,J=0;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if((Y>0?$[Y-1]:"")==="\\"&&X)continue;if((Q==='"'||Q==="'")&&!X){X=Q;continue}if(Q===X&&X!=="`"){X=null;continue}if(Q==="`"&&!X){X="`";continue}if(Q==="`"&&X==="`"&&J===0){X=null;continue}if(X==="`"&&Q==="$"&&$[Y+1]==="{"){J++,Y++;continue}if(J>0&&Q==="{"){J++;continue}if(J>0&&Q==="}"){J--;continue}if(X)continue;if(Q==="(")Z.paren++;else if(Q===")")Z.paren--;else if(Q==="[")Z.bracket++;else if(Q==="]")Z.bracket--;else if(Q==="{")Z.brace++;else if(Q==="}")Z.brace--}return Z.paren===0&&Z.bracket===0&&Z.brace===0&&X===null}function y2($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let X=B0($,"(",")",Z);if(X===-1)return-1;return $.indexOf("{",X)}function Rq($){let Z=y2($);if(Z===-1)return!0;return B0($,"{","}",Z)===-1}function N2($,Z,X){let J=X,Y=Z+1;while(Y<$.length&&!b2(J)){let Q=$[Y];J+=`
3657
3657
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))J+=`
3658
- ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function Rq($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=y2(J);if(Q!==-1){if(B0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3659
- ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function A2($,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:{...W5.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 Dq($,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,q]=Q;try{let W=q.trim().replace(/;$/,""),K=A2(W,Z);if(K!==void 0)Z[G]=K}catch(W){console.warn(`Failed to parse export ${G} in fallback:`,W)}}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,q]=Q;if(!(G in Z))try{let W=q.trim().replace(/;$/,""),K=A2(W,Z);if(K!==void 0)Z[G]=K}catch{}}}function Nq($){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 Aq($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var y5=new p1(500),g$=new p1(1000),kq=33554432,m4=new p1(2000,{maxBytes:kq,sizeOf:($)=>$.output.length});function Iq($){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 S2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Tq($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function A1($){return!Tq($)}var x$=new Map;function u4($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=x$.get(Z);if(X)return X;if(x$.size>=16)x$.clear();let J=new Bun.Transpiler($);return x$.set(Z,J),J}function M1($){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=u4({loader:"ts",target:"browser",define:Y5()}).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 Eq($){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++}},q=()=>{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]==="`")q();else Y++;continue}Y++}},W=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3660
- `)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 L=_.trim().split(":");return L[L.length-1].trim()});for(let _ of B)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let z=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(z){let B=z[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(W())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){q();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 bq($){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 yq($){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 Sq($,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 W=$[J];if(W==="}")Q++;else if(W==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let W of bq(q)){let K=W.trim();if(!K||K.startsWith("..."))continue;let U=yq(K);if(U===-1)continue;let z=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(z))continue;if(Z[z]!==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[z]=B(...j.map((_)=>Z[_]))}catch{}}}catch{}}async function C$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),W=X.__importedComponents;if(W){for(let L of[Q,Q.toLowerCase(),G(Q),q(Q)])if(W.has(L))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,z=U??h.dirname(J),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},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 L of _)j(typeof L==="string"?L:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return t(h.resolve(h.dirname(J),`${Q}.stx`));for(let L of H){let V=h.isAbsolute(L)?L:h.resolve(z,L);for(let O of K)if(await t(h.join(V,O)))return!0}return!1}function Cq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Pq($){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 vq($){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 I1($,Z,X,J,Y,Q,G,q=new Set,W){let{extractVariables:K}=await o("stx/variable-extractor",()=>import("./chunk-man5awsh.js")),U=q??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let z=new Set(U);z.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Cq(H)?H:"";try{let B=(u)=>u.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),_=(u)=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),L=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let u=[L,L.toLowerCase(),B(L),_(L)];for(let m of u)if(O.has(m)){V=O.get(m);break}}let F=[];if(!V){let u=[`${L}.stx`,`${B(L)}.stx`,`${_(L)}.stx`],m=[...new Set(u)],U0=Y.__originalFilePath,n=[];if(U0){let L0=h.join(h.dirname(U0),"components");n.push(L0)}if(J)n.push(J);let O0=G._rootComponentsDir;if(typeof O0==="string"&&!n.includes(O0))n.push(O0);let F0=h.join(h.dirname(Q),"components");if(!n.includes(F0))n.push(F0);if(G.componentsDir&&G.componentsDir!==J&&!n.includes(G.componentsDir))n.push(G.componentsDir);let v0=typeof G.root==="string"?h.resolve(G.root):void 0,V1=v0??h.dirname(Q),b0=[];if(v0)b0.push(h.resolve(v0,"resources/views/components")),b0.push(h.resolve(v0,"resources/components")),b0.push(h.resolve(v0,"src/components")),b0.push(h.resolve(v0,"components"));b0.push(h.resolve(import.meta.dir,"components"));for(let L0 of b0)if(!n.includes(L0))n.push(L0);let s=G._pluginComponentDirs;if(Array.isArray(s)){for(let L0 of s)if(typeof L0==="string"&&!n.includes(L0))n.push(L0)}if(G.fallbackComponentsDir&&!n.includes(G.fallbackComponentsDir))n.push(G.fallbackComponentsDir);let l0=[...new Set(n.map((L0)=>{if(!L0)return L0;return h.isAbsolute(L0)?L0:h.resolve(V1,L0)}))];n.length=0,n.push(...l0);let v5=`${L}\x00${Q}\x00${l0.join("\x00")}`,h$=g$.get(v5);if(h$)if(await t(h$))V=h$;else g$.delete(v5);if(!V&&(L.startsWith("./")||L.startsWith("../")))V=h.resolve(h.dirname(Q),`${L}.stx`),F.push(V);else if(!V)for(let L0 of n){if(!L0)continue;for(let f5 of m){let x5=h.join(L0,f5);if(F.push(x5),await t(x5)){V=x5;break}}if(V)break;if(!V)try{let f5=await import("fs");if(!f5.statSync(L0,{throwIfNoEntry:!1})?.isDirectory())continue;let p2=8,u$=[{path:L0,depth:0}];while(u$.length>0&&!V){let g5=u$.pop();if(g5.depth>=p2)continue;let i4;try{i4=f5.readdirSync(g5.path,{withFileTypes:!0})}catch{continue}for(let h5 of i4){if(!h5.isDirectory())continue;if(h5.name==="node_modules"||h5.name.startsWith("."))continue;let n4=h.join(g5.path,h5.name);for(let i2 of m){let d$=h.join(n4,i2);if(F.push(d$),await t(d$)){V=d$;break}}if(V)break;u$.push({path:n4,depth:g5.depth+1})}}}catch{}if(V)break}if(V)g$.set(v5,V)}if(!V||!await t(V)){let u=F.length>0?`
3658
+ ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function Dq($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=y2(J);if(Q!==-1){if(B0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3659
+ ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function A2($,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:{...W5.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 Nq($,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,q]=Q;try{let W=q.trim().replace(/;$/,""),K=A2(W,Z);if(K!==void 0)Z[G]=K}catch(W){console.warn(`Failed to parse export ${G} in fallback:`,W)}}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,q]=Q;if(!(G in Z))try{let W=q.trim().replace(/;$/,""),K=A2(W,Z);if(K!==void 0)Z[G]=K}catch{}}}function Aq($){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 Mq($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var y5=new p1(500),g$=new p1(1000),Iq=33554432,m4=new p1(2000,{maxBytes:Iq,sizeOf:($)=>$.output.length});function Tq($){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 S2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Eq($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function A1($){return!Eq($)}var x$=new Map;function u4($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=x$.get(Z);if(X)return X;if(x$.size>=16)x$.clear();let J=new Bun.Transpiler($);return x$.set(Z,J),J}function M1($){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=u4({loader:"ts",target:"browser",define:Y5()}).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 bq($){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++}},q=()=>{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]==="`")q();else Y++;continue}Y++}},W=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3660
+ `)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 L=_.trim().split(":");return L[L.length-1].trim()});for(let _ of B)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let z=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(z){let B=z[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(W())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){q();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 yq($){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 Sq($){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 Cq($,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 W=$[J];if(W==="}")Q++;else if(W==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let W of yq(q)){let K=W.trim();if(!K||K.startsWith("..."))continue;let U=Sq(K);if(U===-1)continue;let z=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(z))continue;if(Z[z]!==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[z]=B(...j.map((_)=>Z[_]))}catch{}}}catch{}}async function C$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),W=X.__importedComponents;if(W){for(let L of[Q,Q.toLowerCase(),G(Q),q(Q)])if(W.has(L))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,z=U??h.dirname(J),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},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 L of _)j(typeof L==="string"?L:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return t(h.resolve(h.dirname(J),`${Q}.stx`));for(let L of H){let V=h.isAbsolute(L)?L:h.resolve(z,L);for(let O of K)if(await t(h.join(V,O)))return!0}return!1}function Pq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function vq($){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 fq($){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 I1($,Z,X,J,Y,Q,G,q=new Set,W){let{extractVariables:K}=await o("stx/variable-extractor",()=>import("./chunk-rcfaqy69.js")),U=q??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let z=new Set(U);z.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Pq(H)?H:"";try{let B=(u)=>u.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),_=(u)=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),L=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let u=[L,L.toLowerCase(),B(L),_(L)];for(let m of u)if(O.has(m)){V=O.get(m);break}}let F=[];if(!V){let u=[`${L}.stx`,`${B(L)}.stx`,`${_(L)}.stx`],m=[...new Set(u)],U0=Y.__originalFilePath,n=[];if(U0){let L0=h.join(h.dirname(U0),"components");n.push(L0)}if(J)n.push(J);let O0=G._rootComponentsDir;if(typeof O0==="string"&&!n.includes(O0))n.push(O0);let F0=h.join(h.dirname(Q),"components");if(!n.includes(F0))n.push(F0);if(G.componentsDir&&G.componentsDir!==J&&!n.includes(G.componentsDir))n.push(G.componentsDir);let v0=typeof G.root==="string"?h.resolve(G.root):void 0,V1=v0??h.dirname(Q),b0=[];if(v0)b0.push(h.resolve(v0,"resources/views/components")),b0.push(h.resolve(v0,"resources/components")),b0.push(h.resolve(v0,"src/components")),b0.push(h.resolve(v0,"components"));b0.push(h.resolve(import.meta.dir,"components"));for(let L0 of b0)if(!n.includes(L0))n.push(L0);let s=G._pluginComponentDirs;if(Array.isArray(s)){for(let L0 of s)if(typeof L0==="string"&&!n.includes(L0))n.push(L0)}if(G.fallbackComponentsDir&&!n.includes(G.fallbackComponentsDir))n.push(G.fallbackComponentsDir);let l0=[...new Set(n.map((L0)=>{if(!L0)return L0;return h.isAbsolute(L0)?L0:h.resolve(V1,L0)}))];n.length=0,n.push(...l0);let v5=`${L}\x00${Q}\x00${l0.join("\x00")}`,h$=g$.get(v5);if(h$)if(await t(h$))V=h$;else g$.delete(v5);if(!V&&(L.startsWith("./")||L.startsWith("../")))V=h.resolve(h.dirname(Q),`${L}.stx`),F.push(V);else if(!V)for(let L0 of n){if(!L0)continue;for(let f5 of m){let x5=h.join(L0,f5);if(F.push(x5),await t(x5)){V=x5;break}}if(V)break;if(!V)try{let f5=await import("fs");if(!f5.statSync(L0,{throwIfNoEntry:!1})?.isDirectory())continue;let p2=8,u$=[{path:L0,depth:0}];while(u$.length>0&&!V){let g5=u$.pop();if(g5.depth>=p2)continue;let i4;try{i4=f5.readdirSync(g5.path,{withFileTypes:!0})}catch{continue}for(let h5 of i4){if(!h5.isDirectory())continue;if(h5.name==="node_modules"||h5.name.startsWith("."))continue;let n4=h.join(g5.path,h5.name);for(let i2 of m){let d$=h.join(n4,i2);if(F.push(d$),await t(d$)){V=d$;break}}if(V)break;u$.push({path:n4,depth:g5.depth+1})}}}catch{}if(V)break}if(V)g$.set(v5,V)}if(!V||!await t(V)){let u=F.length>0?`
3661
3661
  Searched paths:
3662
3662
  ${F.map((m)=>` - ${m}`).join(`
3663
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${u}`}W.add(V);let w;if(y5.has(V))w=y5.get(V);else try{w=await Bun.file(V).text(),y5.set(V,w)}catch(u){return`[Error loading component: ${u instanceof Error?u.message:String(u)}]`}let R=new Set(["__originalFilePath","__importedComponents",u5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[u,m]of Object.entries(Y))if(!u.startsWith("__")||R.has(u))D[u]=m;let N=X;if(X.includes("@include")){let{processIncludes:u}=await o("stx/includes",()=>import("./chunk-11x9r23q.js"));N=await u(X,Y,Q,G,W)}let k=r0(N),A=[],M=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(u,m)=>{let U0=k.scripts[Number(m)]||"",n=U0.match(/^<script\b([^>]*)>/i)?.[1]||"",O0=n.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),F0=!O0||["module","text/javascript","application/javascript"].includes(O0);if(!/\bserver\b/i.test(n)&&F0)return A.push(U0),"";return U0}),{extractSlotContent:T}=await o("stx/slots",()=>import("./chunk-v413wmmr.js")),I=T(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[u,m]of I.namedSlots)y[u]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${L.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,S={...D,$uid:b,...Z,props:Z,slot:M,$slots:y,__processedComponents:z,__sections:{},__stx_signals_gate:G1(w)||Pq(X)};Sq(w,S);let v=w,x=V$(v);if(x)v=x.content.trim();let d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g=[...w.matchAll(d)],X0=[],e0=g.some((u)=>/\bserver\b/.test(u[1]||"")&&/\bcache\b/.test(u[1]||"")),k0=null,C0=null,J0=null,H0=0,I0=null;if(e0){let u=Iq({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(u!==null){k0=`${V}\x00${b1(w)}\x00${u}`;let m=m4.get(k0);if(m){for(let U0 of m.dependencies)W.add(U0);if(Q7(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let U0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let n of m.preservedClientExpressions)U0.add(n);Y.__stx_preserved_client_expressions=[...U0]}return m.output}C0=new Set(W),J0=J7(Y),H0=E.n,I0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let u of g){let m=u[1]||"",U0=u[2]||"",n=m.includes("server");if(A1(m)&&U0.trim())U0=M1(U0);if(n&&U0)try{await K(U0,S,V)}catch(F0){}if(!n){let F0=U0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=F0.includes("{{")&&F0.includes("}}"),V1=F0.includes("{!!")&&F0.includes("!!}");if(v0||V1)F0=n$(F0,S);let b0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");X0.push(`<script${b0}>${F0}</script>`)}}let E0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),m0=E0?E0[1]:"",p=E0?E0[2]:"",i="",K0=m0&&/\bscoped\b/i.test(m0);if(E0)i=`<style${m0}>${p}</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 u=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(G0=G0.replace(u,(U0,n)=>{let O0=n.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(O0)m.push(`<style${O0[1]}>${O0[2]}</style>`);return""}),G0=G0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)i=`${i}${m.join(`
3664
- `)}`}if(X&&G0.includes("{{ text || slot }}"))G0=G0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:N0}=await o("stx/slots",()=>import("./chunk-v413wmmr.js")),{defaultSlot:P0,namedSlots:K5}=I;G0=await N0(G0,P0,K5,S);let C5=X0.some((u)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(u)),P5=vq(X0),C=Array.isArray(S.__stx_client_signal_names)?S.__stx_client_signal_names:[];if(P5.length>0||C.length>0)S.__stx_client_signal_names=[...new Set([...C,...P5])];let P={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:C5||X0.length===0,defaultLayout:void 0};S.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let r=await g4(G0,S,V,P,W),a=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let u of r.matchAll(/\{\{([\s\S]*?)\}\}/g))a.add(u[1].trim());if(a.size>0)Y.__stx_preserved_client_expressions=[...a];let Y0=b,Q0=r;if(C5){let u="";if(Object.keys(Z).length>0)try{u=` data-stx-props="${S2(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${S2(j)}"`:"";Q0=`<div data-stx-scope="${Y0}"${u}${m}>${r}</div>`;let U0=await Promise.all(X0.map(async(n)=>{let O0=n.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!O0)return n;let[,F0,v0]=O0,{vendorStyleTags:V1,factoryBody:b0}=await gq(v0,V,G.buildMode==="compile"),s=j?null:c$(Y,b0),l0=s?`window.__stxComponentFactories[${JSON.stringify(s)}](${JSON.stringify(Y0)});`:`(${b0})(${JSON.stringify(Y0)});`;if(j)return`${V1}<script type="stx/island" data-stx-island="${Y0}" data-stx-scoped${F0}>${l0}</script>`;return`${V1}<script data-stx-scoped data-stx-run="always"${F0}>${l0}</script>`}));if(Q0=Q0+`
3663
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${u}`}W.add(V);let w;if(y5.has(V))w=y5.get(V);else try{w=await Bun.file(V).text(),y5.set(V,w)}catch(u){return`[Error loading component: ${u instanceof Error?u.message:String(u)}]`}let R=new Set(["__originalFilePath","__importedComponents",u5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[u,m]of Object.entries(Y))if(!u.startsWith("__")||R.has(u))D[u]=m;let N=X;if(X.includes("@include")){let{processIncludes:u}=await o("stx/includes",()=>import("./chunk-1znt2vmy.js"));N=await u(X,Y,Q,G,W)}let k=r0(N),A=[],M=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(u,m)=>{let U0=k.scripts[Number(m)]||"",n=U0.match(/^<script\b([^>]*)>/i)?.[1]||"",O0=n.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),F0=!O0||["module","text/javascript","application/javascript"].includes(O0);if(!/\bserver\b/i.test(n)&&F0)return A.push(U0),"";return U0}),{extractSlotContent:T}=await o("stx/slots",()=>import("./chunk-cfnvwm5n.js")),I=T(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[u,m]of I.namedSlots)y[u]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${L.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,S={...D,$uid:b,...Z,props:Z,slot:M,$slots:y,__processedComponents:z,__sections:{},__stx_signals_gate:G1(w)||vq(X)};Cq(w,S);let v=w,x=V$(v);if(x)v=x.content.trim();let d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g=[...w.matchAll(d)],Q0=[],e0=g.some((u)=>/\bserver\b/.test(u[1]||"")&&/\bcache\b/.test(u[1]||"")),k0=null,C0=null,X0=null,H0=0,I0=null;if(e0){let u=Tq({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(u!==null){k0=`${V}\x00${b1(w)}\x00${u}`;let m=m4.get(k0);if(m){for(let U0 of m.dependencies)W.add(U0);if(Q7(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let U0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let n of m.preservedClientExpressions)U0.add(n);Y.__stx_preserved_client_expressions=[...U0]}return m.output}C0=new Set(W),X0=J7(Y),H0=E.n,I0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let u of g){let m=u[1]||"",U0=u[2]||"",n=m.includes("server");if(A1(m)&&U0.trim())U0=M1(U0);if(n&&U0)try{await K(U0,S,V)}catch(F0){}if(!n){let F0=U0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=F0.includes("{{")&&F0.includes("}}"),V1=F0.includes("{!!")&&F0.includes("!!}");if(v0||V1)F0=n$(F0,S);let b0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Q0.push(`<script${b0}>${F0}</script>`)}}let E0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),m0=E0?E0[1]:"",p=E0?E0[2]:"",i="",K0=m0&&/\bscoped\b/i.test(m0);if(E0)i=`<style${m0}>${p}</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 u=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(G0=G0.replace(u,(U0,n)=>{let O0=n.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(O0)m.push(`<style${O0[1]}>${O0[2]}</style>`);return""}),G0=G0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)i=`${i}${m.join(`
3664
+ `)}`}if(X&&G0.includes("{{ text || slot }}"))G0=G0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:N0}=await o("stx/slots",()=>import("./chunk-cfnvwm5n.js")),{defaultSlot:P0,namedSlots:K5}=I;G0=await N0(G0,P0,K5,S);let C5=Q0.some((u)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(u)),P5=fq(Q0),C=Array.isArray(S.__stx_client_signal_names)?S.__stx_client_signal_names:[];if(P5.length>0||C.length>0)S.__stx_client_signal_names=[...new Set([...C,...P5])];let P={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:C5||Q0.length===0,defaultLayout:void 0};S.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let r=await g4(G0,S,V,P,W),a=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let u of r.matchAll(/\{\{([\s\S]*?)\}\}/g))a.add(u[1].trim());if(a.size>0)Y.__stx_preserved_client_expressions=[...a];let J0=b,Y0=r;if(C5){let u="";if(Object.keys(Z).length>0)try{u=` data-stx-props="${S2(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${S2(j)}"`:"";Y0=`<div data-stx-scope="${J0}"${u}${m}>${r}</div>`;let U0=await Promise.all(Q0.map(async(n)=>{let O0=n.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!O0)return n;let[,F0,v0]=O0,{vendorStyleTags:V1,factoryBody:b0}=await hq(v0,V,G.buildMode==="compile"),s=j?null:c$(Y,b0),l0=s?`window.__stxComponentFactories[${JSON.stringify(s)}](${JSON.stringify(J0)});`:`(${b0})(${JSON.stringify(J0)});`;if(j)return`${V1}<script type="stx/island" data-stx-island="${J0}" data-stx-scoped${F0}>${l0}</script>`;return`${V1}<script data-stx-scoped data-stx-run="always"${F0}>${l0}</script>`}));if(Y0=Y0+`
3665
3665
  `+U0.join(`
3666
- `),i)Q0+=`
3667
- `+i}else{if(i)Q0+=`
3668
- `+i;if(X0.length>0){let u=S.__stx_event_bindings||[],m=v$(S),U0=await Promise.all(X0.map(async(n)=>{let O0=n.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!O0)return n;return await f$(O0[1],{eventBindings:u,templateContent:Q0,filePath:V,projectRoot:process.cwd(),serverData:m})}));Q0+=`
3666
+ `),i)Y0+=`
3667
+ `+i}else{if(i)Y0+=`
3668
+ `+i;if(Q0.length>0){let u=S.__stx_event_bindings||[],m=v$(S),U0=await Promise.all(Q0.map(async(n)=>{let O0=n.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!O0)return n;return await f$(O0[1],{eventBindings:u,templateContent:Y0,filePath:V,projectRoot:process.cwd(),serverData:m})}));Y0+=`
3669
3669
  `+U0.join(`
3670
- `),S.__stx_event_bindings=[]}}if(K0){let u=R$(Q0,V);if(u.hasScoped)Q0=u.html}if(k0&&C0){let u=Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[];m4.set(k0,{output:Q0,dependencies:[...W].filter((m)=>!C0.has(m)),clientFactories:J0?Y7(Y,J0):[],uidsConsumed:E.n-H0,preservedClientExpressions:I0?u.filter((m)=>!I0.has(m)):[]})}return A.length>0?`${Q0}
3670
+ `),S.__stx_event_bindings=[]}}if(K0){let u=R$(Y0,V);if(u.hasScoped)Y0=u.html}if(k0&&C0){let u=Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[];m4.set(k0,{output:Y0,dependencies:[...W].filter((m)=>!C0.has(m)),clientFactories:X0?Y7(Y,X0):[],uidsConsumed:E.n-H0,preservedClientExpressions:I0?u.filter((m)=>!I0.has(m)):[]})}return A.length>0?`${Y0}
3671
3671
  ${A.join(`
3672
- `)}`:Q0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{U.delete($)}}async function t($){return Bun.file($).exists()}function l4($,Z){let X=h.resolve(Z),J=h.resolve($),Y=X.endsWith(h.sep)?X:X+h.sep;if(J===X||J.startsWith(Y))return J;return null}async function fq($,Z,X,J){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=h.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await t(G)){if(J)console.log(`Found layout in ${$}: ${G}`);return X?.add(G),G}return null}async function q$($,Z,X,J){let Y=await xq($,Z,X,J);if(Y===null)return null;let Q=l4(Y,process.cwd());if(Q)return Q;let G=[X.root,X.layoutsDir,X.fallbackLayoutsDir,X.componentsDir,X.partialsDir,X.pagesDir].filter((q)=>typeof q==="string"&&q.length>0);for(let q of G){let W=h.isAbsolute(q)?q:h.resolve(process.cwd(),q);if(l4(Y,W))return h.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function xq($,Z,X,J){if(X.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=h.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=h.join(Q,$),j=l4(H,Q);if(!j)return console.warn(`[stx] rejected template path that escapes project root: ${$} (from ${Z})`),null;if(X.debug)console.log(`Checking absolute path: ${j}`);if(await t(j)&&J)J.add(j);return j}let G=h.join(Y,$);if(await t(G)){if(X.debug)console.log(`Found direct path: ${G}`);if(J)J.add(G);return G}if(!$.endsWith(".stx")&&!$.endsWith(".jsx")&&!$.endsWith(".tsx"))for(let H of[".stx",".tsx",".jsx"]){let j=`${G}${H}`;if(await t(j)){if(X.debug)console.log(`Found direct path with extension: ${j}`);if(J)J.add(j);return j}}let q=[];if(X.layoutsDir)q.push(h.isAbsolute(X.layoutsDir)?X.layoutsDir:h.resolve(process.cwd(),X.layoutsDir));let W=h.resolve(Y),K=process.cwd();for(let H=0;H<10;H++){let j=h.join(W,"layouts"),B=!1;try{B=Mq.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){q.push(j);break}let _=h.dirname(W);if(_===W||_.length<K.length)break;W=_}for(let H of q){let j=await fq(H,$,J,X.debug);if(j)return j}if(X.fallbackLayoutsDir){let H=h.isAbsolute(X.fallbackLayoutsDir)?X.fallbackLayoutsDir:h.resolve(process.cwd(),X.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[h.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let _ of B)if(await t(_)){if(X.debug)console.log(`Found in options.fallbackLayoutsDir: ${_}`);if(J)J.add(_);return _}}if($.startsWith("layouts/")||$.includes("/layouts/")){let H=$.split("layouts/"),j=h.join(X.partialsDir||Y,"layouts",H[1]);if(await t(j)){if(X.debug)console.log(`Found in layouts path: ${j}`);if(J)J.add(j);return j}if(!j.endsWith(".stx")){let B=`${j}.stx`;if(await t(B)){if(X.debug)console.log(`Found in layouts path with extension: ${B}`);if(J)J.add(B);return B}}}if(X.partialsDir){let H=h.join(X.partialsDir,"layouts");if(await t(H)){let j=h.join(H,$);if(await t(j)){if(X.debug)console.log(`Found in partials layouts dir: ${j}`);if(J)J.add(j);return j}if(!$.endsWith(".stx")){let B=`${j}.stx`;if(await t(B)){if(X.debug)console.log(`Found in partials layouts dir with extension: ${B}`);if(J)J.add(B);return B}}}}let U=X.partialsDir||h.join(process.cwd(),"views"),z=h.join(U,$);if(await t(z)){if(X.debug)console.log(`Found in views path: ${z}`);if(J)J.add(z);return z}if(!$.endsWith(".stx")){let H=`${z}.stx`;if(await t(H)){if(X.debug)console.log(`Found in views path with extension: ${H}`);if(J)J.add(H);return H}}if(Y.includes("temp")){let H=h.join(h.dirname(Y),"layouts",$);if(await t(H)){if(X.debug)console.log(`Found in temp layouts dir: ${H}`);if(J)J.add(H);return H}if(!$.endsWith(".stx")){let j=`${H}.stx`;if(await t(j)){if(X.debug)console.log(`Found in temp layouts dir with extension: ${j}`);if(J)J.add(j);return j}}}if(X.debug)console.warn(`Template not found after trying all paths: ${$} (referenced from ${Z})`);else console.warn(`Template not found: ${$} (referenced from ${Z})`);return null}function f2($,Z,X){let J=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3672
+ `)}`:Y0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{U.delete($)}}async function t($){return Bun.file($).exists()}function l4($,Z){let X=h.resolve(Z),J=h.resolve($),Y=X.endsWith(h.sep)?X:X+h.sep;if(J===X||J.startsWith(Y))return J;return null}async function xq($,Z,X,J){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=h.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await t(G)){if(J)console.log(`Found layout in ${$}: ${G}`);return X?.add(G),G}return null}async function q$($,Z,X,J){let Y=await gq($,Z,X,J);if(Y===null)return null;let Q=l4(Y,process.cwd());if(Q)return Q;let G=[X.root,X.layoutsDir,X.fallbackLayoutsDir,X.componentsDir,X.partialsDir,X.pagesDir].filter((q)=>typeof q==="string"&&q.length>0);for(let q of G){let W=h.isAbsolute(q)?q:h.resolve(process.cwd(),q);if(l4(Y,W))return h.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function gq($,Z,X,J){if(X.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=h.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=h.join(Q,$),j=l4(H,Q);if(!j)return console.warn(`[stx] rejected template path that escapes project root: ${$} (from ${Z})`),null;if(X.debug)console.log(`Checking absolute path: ${j}`);if(await t(j)&&J)J.add(j);return j}let G=h.join(Y,$);if(await t(G)){if(X.debug)console.log(`Found direct path: ${G}`);if(J)J.add(G);return G}if(!$.endsWith(".stx")&&!$.endsWith(".jsx")&&!$.endsWith(".tsx"))for(let H of[".stx",".tsx",".jsx"]){let j=`${G}${H}`;if(await t(j)){if(X.debug)console.log(`Found direct path with extension: ${j}`);if(J)J.add(j);return j}}let q=[];if(X.layoutsDir)q.push(h.isAbsolute(X.layoutsDir)?X.layoutsDir:h.resolve(process.cwd(),X.layoutsDir));let W=h.resolve(Y),K=process.cwd();for(let H=0;H<10;H++){let j=h.join(W,"layouts"),B=!1;try{B=kq.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){q.push(j);break}let _=h.dirname(W);if(_===W||_.length<K.length)break;W=_}for(let H of q){let j=await xq(H,$,J,X.debug);if(j)return j}if(X.fallbackLayoutsDir){let H=h.isAbsolute(X.fallbackLayoutsDir)?X.fallbackLayoutsDir:h.resolve(process.cwd(),X.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[h.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let _ of B)if(await t(_)){if(X.debug)console.log(`Found in options.fallbackLayoutsDir: ${_}`);if(J)J.add(_);return _}}if($.startsWith("layouts/")||$.includes("/layouts/")){let H=$.split("layouts/"),j=h.join(X.partialsDir||Y,"layouts",H[1]);if(await t(j)){if(X.debug)console.log(`Found in layouts path: ${j}`);if(J)J.add(j);return j}if(!j.endsWith(".stx")){let B=`${j}.stx`;if(await t(B)){if(X.debug)console.log(`Found in layouts path with extension: ${B}`);if(J)J.add(B);return B}}}if(X.partialsDir){let H=h.join(X.partialsDir,"layouts");if(await t(H)){let j=h.join(H,$);if(await t(j)){if(X.debug)console.log(`Found in partials layouts dir: ${j}`);if(J)J.add(j);return j}if(!$.endsWith(".stx")){let B=`${j}.stx`;if(await t(B)){if(X.debug)console.log(`Found in partials layouts dir with extension: ${B}`);if(J)J.add(B);return B}}}}let U=X.partialsDir||h.join(process.cwd(),"views"),z=h.join(U,$);if(await t(z)){if(X.debug)console.log(`Found in views path: ${z}`);if(J)J.add(z);return z}if(!$.endsWith(".stx")){let H=`${z}.stx`;if(await t(H)){if(X.debug)console.log(`Found in views path with extension: ${H}`);if(J)J.add(H);return H}}if(Y.includes("temp")){let H=h.join(h.dirname(Y),"layouts",$);if(await t(H)){if(X.debug)console.log(`Found in temp layouts dir: ${H}`);if(J)J.add(H);return H}if(!$.endsWith(".stx")){let j=`${H}.stx`;if(await t(j)){if(X.debug)console.log(`Found in temp layouts dir with extension: ${j}`);if(J)J.add(j);return j}}}if(X.debug)console.warn(`Template not found after trying all paths: ${$} (referenced from ${Z})`);else console.warn(`Template not found: ${$} (referenced from ${Z})`);return null}function f2($,Z,X){let J=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3673
3673
  `),q=0;for(let W=0;W<G.length;W++)if(q+=G[W].length+1,q>=Z){J=W+1,Y=G[W].trim();let K=Math.max(0,W-2),U=Math.min(G.length,W+3);Q=G.slice(K,U).map((z,H)=>{let j=K+H+1;return`${j===J?"> ":" "}${j}: ${z}`}).join(`
3674
3674
  `);break}}else if(X){let G=$.indexOf(X);if(G>=0)return f2($,G)}}catch{}return{lineNumber:J,lineContent:Y,context:Q}}var Z0={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function j0($,Z,X,J,Y,Q){let{lineNumber:G,context:q}=f2(J,Y,Q),W=X.split("/").pop(),K=0;if(typeof Y==="number"&&Y>=0&&J){let z=J.lastIndexOf(`
3675
3675
  `,Math.max(0,Y-1));K=Y-(z+1)+1}let U="";if(G>0)U+=`
@@ -3684,7 +3684,7 @@ ${Z0.yellow}${Z0.bold}Message:${Z0.reset} ${Z}
3684
3684
  `,q)U+=`
3685
3685
  ${Z0.blue}${Z0.bold}Context:${Z0.reset}
3686
3686
  ${Z0.dim}${q}${Z0.reset}
3687
- `;return U}function qO(){y5.clear(),g$.clear(),m4.clear()}function WO(){return{size:y5.size,maxSize:500}}var d4=G5(128);async function gq($,Z,X){let J=b1($,Z,X),Y=d4.get(J);if(Y){if(v2(Y.deps))return Y;d4.delete(J)}let Q=c4($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,q=p4(Q.styles);G=r1(G).code;let{hasUserImports:W,bundleClientScript:K}=await o("stx/client-script-bundler",()=>import("./chunk-ertf9176.js")),U=[],z=!1;if(W(G)){let V=G;G=await K(V,Z,{projectRoot:process.cwd(),minify:X,collectInputs:U}),z=G===V}let{stripStxRuntimeImports:H}=await o("stx/signal-processing",()=>import("./chunk-5a07gxnz.js"));G=H(G);let j=$1(G),B=Eq(j),_=`function(__scopeId) {
3687
+ `;return U}function WO(){y5.clear(),g$.clear(),m4.clear()}function KO(){return{size:y5.size,maxSize:500}}var d4=G5(128);async function hq($,Z,X){let J=b1($,Z,X),Y=d4.get(J);if(Y){if(v2(Y.deps))return Y;d4.delete(J)}let Q=c4($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,q=p4(Q.styles);G=r1(G).code;let{hasUserImports:W,bundleClientScript:K}=await o("stx/client-script-bundler",()=>import("./chunk-z3cme6c9.js")),U=[],z=!1;if(W(G)){let V=G;G=await K(V,Z,{projectRoot:process.cwd(),minify:X,collectInputs:U}),z=G===V}let{stripStxRuntimeImports:H}=await o("stx/signal-processing",()=>import("./chunk-jrfehndk.js"));G=H(G);let j=$1(G),B=bq(j),_=`function(__scopeId) {
3688
3688
  ${c1("const",[...C2,...B],j)}
3689
3689
  const __scope = window.stx._scopes = window.stx._scopes || {};
3690
3690
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3713,18 +3713,18 @@ catch (e) {}
3713
3713
  finally {
3714
3714
  window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
3715
3715
  }
3716
- }`,L={vendorStyleTags:q,factoryBody:_,deps:P2([...U,...Q.styles.map((V)=>V.resolvedPath)])};if(!z&&Q.unresolved.length===0)d4.set(J,L);return L}var hq=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function uq($){if($.startsWith(".")||$.startsWith("/"))return null;if($.startsWith("@")){let X=$.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!X)return null;return{pkg:X[1],subpath:X[2]||""}}let Z=$.match(/^([^/]+)(\/.*)?$/);if(!Z)return null;return{pkg:Z[1],subpath:Z[2]||""}}function dq($,Z){let X=Z;while(!0){let J=S1.join(X,"node_modules",$,"package.json");if(S5.existsSync(J))return S1.dirname(J);let Y=S1.dirname(X);if(Y===X)return null;X=Y}}function mq($,Z){if(!$||typeof $!=="object")return null;let X=(Y)=>{if(typeof Y==="string")return Y;if(Y&&typeof Y==="object"){if(typeof Y.import==="string")return Y.import;if(typeof Y.default==="string")return Y.default;if(typeof Y.import==="object")return X(Y.import);if(typeof Y.default==="object")return X(Y.default)}return null};if(Object.prototype.hasOwnProperty.call($,Z))return X($[Z]);let J=null;for(let Y of Object.keys($)){let Q=Y.indexOf("*");if(Q===-1)continue;let G=Y.slice(0,Q),q=Y.slice(Q+1);if(!Z.startsWith(G)||!Z.endsWith(q))continue;if(Z.length<G.length+q.length)continue;if(!J||G.length>J.prefix.length)J={pattern:Y,prefix:G,suffix:q}}if(J){let Y=Z.slice(J.prefix.length,Z.length-J.suffix.length),Q=X($[J.pattern]);if(Q)return Q.replace("*",Y)}return null}function lq($,Z){let X=uq($);if(!X||!X.subpath)return null;let J=dq(X.pkg,Z);if(!J)return null;let Y;try{Y=JSON.parse(S5.readFileSync(S1.join(J,"package.json"),"utf8"))}catch{return null}let Q=`.${X.subpath}`,G=mq(Y.exports,Q);if(!G)return null;let q=S1.resolve(J,G);return S5.existsSync(q)?q:null}function c4($,Z){let X=Z.filePath?S1.dirname(Z.filePath):Z.projectRoot||process.cwd(),J=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(hq,(W,K)=>{let U;try{if(K.startsWith("./")||K.startsWith("../")||K.startsWith("/")){if(U=K.startsWith("/")?K:S1.resolve(X,K),!S5.existsSync(U))throw Error(`file not found: ${U}`)}else{let z=null;try{z=Bun.resolveSync(K,J)}catch{z=lq(K,J)}if(!z)throw Error(`could not resolve ${K} (Bun.resolveSync + exports fallback both failed)`);U=z}}catch(z){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(K)} (from ${Z.filePath||"<unknown>"}): ${z?.message||z}`),G.push(K),""}if(Y.has(U))return"";Y.add(U);try{let z=S5.readFileSync(U,"utf8");Q.push({source:K,resolvedPath:U,contents:z})}catch(z){console.warn(`[stx:vendor-css] could not read ${U}: ${z?.message||z}`),G.push(K)}return""}),styles:Q,unresolved:G}}function cq($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function p4($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${cq(Z.source)}" data-stx-layer="vendor">
3716
+ }`,L={vendorStyleTags:q,factoryBody:_,deps:P2([...U,...Q.styles.map((V)=>V.resolvedPath)])};if(!z&&Q.unresolved.length===0)d4.set(J,L);return L}var uq=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function dq($){if($.startsWith(".")||$.startsWith("/"))return null;if($.startsWith("@")){let X=$.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!X)return null;return{pkg:X[1],subpath:X[2]||""}}let Z=$.match(/^([^/]+)(\/.*)?$/);if(!Z)return null;return{pkg:Z[1],subpath:Z[2]||""}}function mq($,Z){let X=Z;while(!0){let J=S1.join(X,"node_modules",$,"package.json");if(S5.existsSync(J))return S1.dirname(J);let Y=S1.dirname(X);if(Y===X)return null;X=Y}}function lq($,Z){if(!$||typeof $!=="object")return null;let X=(Y)=>{if(typeof Y==="string")return Y;if(Y&&typeof Y==="object"){if(typeof Y.import==="string")return Y.import;if(typeof Y.default==="string")return Y.default;if(typeof Y.import==="object")return X(Y.import);if(typeof Y.default==="object")return X(Y.default)}return null};if(Object.prototype.hasOwnProperty.call($,Z))return X($[Z]);let J=null;for(let Y of Object.keys($)){let Q=Y.indexOf("*");if(Q===-1)continue;let G=Y.slice(0,Q),q=Y.slice(Q+1);if(!Z.startsWith(G)||!Z.endsWith(q))continue;if(Z.length<G.length+q.length)continue;if(!J||G.length>J.prefix.length)J={pattern:Y,prefix:G,suffix:q}}if(J){let Y=Z.slice(J.prefix.length,Z.length-J.suffix.length),Q=X($[J.pattern]);if(Q)return Q.replace("*",Y)}return null}function cq($,Z){let X=dq($);if(!X||!X.subpath)return null;let J=mq(X.pkg,Z);if(!J)return null;let Y;try{Y=JSON.parse(S5.readFileSync(S1.join(J,"package.json"),"utf8"))}catch{return null}let Q=`.${X.subpath}`,G=lq(Y.exports,Q);if(!G)return null;let q=S1.resolve(J,G);return S5.existsSync(q)?q:null}function c4($,Z){let X=Z.filePath?S1.dirname(Z.filePath):Z.projectRoot||process.cwd(),J=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(uq,(W,K)=>{let U;try{if(K.startsWith("./")||K.startsWith("../")||K.startsWith("/")){if(U=K.startsWith("/")?K:S1.resolve(X,K),!S5.existsSync(U))throw Error(`file not found: ${U}`)}else{let z=null;try{z=Bun.resolveSync(K,J)}catch{z=cq(K,J)}if(!z)throw Error(`could not resolve ${K} (Bun.resolveSync + exports fallback both failed)`);U=z}}catch(z){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(K)} (from ${Z.filePath||"<unknown>"}): ${z?.message||z}`),G.push(K),""}if(Y.has(U))return"";Y.add(U);try{let z=S5.readFileSync(U,"utf8");Q.push({source:K,resolvedPath:U,contents:z})}catch(z){console.warn(`[stx:vendor-css] could not read ${U}: ${z?.message||z}`),G.push(K)}return""}),styles:Q,unresolved:G}}function pq($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function p4($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${pq(Z.source)}" data-stx-layer="vendor">
3717
3717
  @layer vendor {
3718
3718
  ${Z.contents}
3719
3719
  }
3720
3720
  </style>`}).join(`
3721
3721
  `)}
3722
- `}var pq=u2;function r1($){let Z=c0($),X=new Set;for(let q of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let W of q[1].split(",")){let K=W.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(K)X.add(K)}let J=new Set;for(let q of Z.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))J.add(q[1]);for(let q of Z.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let W of q[1].split(",")){let K=W.trim().split(/[:=]/).pop()?.trim();if(K)J.add(K)}let Y=k5.filter((q)=>{if(X.has(q)||J.has(q))return!1;return new RegExp(`\\b${q}\\s*\\(`).test(Z)}),Q=m2(Z).filter((q)=>!X.has(q)&&!J.has(q));if(Y.length===0&&Q.length===0)return{code:$,imports:Y,models:Q};return{code:`${[Y.length>0?`import { ${Y.join(", ")} } from '@stacksjs/browser'`:"",Q.length>0?"import '@stacksjs/browser'":"",Q.length>0?`const { ${Q.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
3722
+ `}var iq=u2;function r1($){let Z=c0($),X=new Set;for(let q of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let W of q[1].split(",")){let K=W.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(K)X.add(K)}let J=new Set;for(let q of Z.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))J.add(q[1]);for(let q of Z.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let W of q[1].split(",")){let K=W.trim().split(/[:=]/).pop()?.trim();if(K)J.add(K)}let Y=k5.filter((q)=>{if(X.has(q)||J.has(q))return!1;return new RegExp(`\\b${q}\\s*\\(`).test(Z)}),Q=m2(Z).filter((q)=>!X.has(q)&&!J.has(q));if(Y.length===0&&Q.length===0)return{code:$,imports:Y,models:Q};return{code:`${[Y.length>0?`import { ${Y.join(", ")} } from '@stacksjs/browser'`:"",Q.length>0?"import '@stacksjs/browser'":"",Q.length>0?`const { ${Q.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
3723
3723
  `)}
3724
- ${$}`,imports:Y,models:Q}}var iq=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function m2($){let Z=new Set,X=/\b([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g,J;while((J=X.exec($))!==null)if(!iq.has(J[1]))Z.add(J[1]);return Array.from(Z)}function nq($){let Z=new Set;for(let X of $.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))Z.add(X[1]);for(let X of $.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let J of X[1].split(",")){let Y=J.trim().split(/[:=]/).pop()?.trim();if(Y&&/^[A-Za-z_$][\w$]*$/.test(Y))Z.add(Y)}return Z}function l2($){let Z=new Set,X=new Set,J=$;J=J.replace(/^\s*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm,"// [type import stripped]");let Y=new Set,Q=/^\s*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"]\s*;?\s*$/gm,G;while((G=Q.exec($))!==null){let z=G[1],H=G[2];if(G[0].includes("import type"))continue;let j=[];for(let _ of z.split(",")){let L=_.trim();if(!L||L.startsWith("type "))continue;let V=L.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!V)continue;let O=V[1],F=V[2]||O;if(Y.add(O),Y.add(F),H==="stx"||H==="@stacksjs/stx")Z.add(O);else X.add(O);if(F!==O)j.push(`${F} = ${O}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";J=J.replace(G[0],B)}let q=nq(J);for(let z of pq){if(Y.has(z)||q.has(z))continue;if(new RegExp(`\\b${z}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(J))Z.add(z)}let W=c0(J),K=new Set;for(let z of J.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of z[1].split(",")){let j=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let B of j){let _=B.trim();if(_)K.add(_)}}for(let z of k5){if(Y.has(z)||q.has(z)||K.has(z))continue;if(new RegExp(`\\b${z}\\b`,"g").test(W))X.add(z)}let U=m2(J);for(let z of U)if(!Y.has(z)&&!q.has(z))X.add(z);return{code:J,stxImports:Array.from(Z),browserImports:Array.from(X)}}function c2($,Z){let X=[];if($.length>0)X.push(` var { ${$.join(", ")} } = window.stx || window;`);if(Z.length>0)X.push(` var { ${Z.join(", ")} } = window.StacksBrowser || {};`);if(X.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
3724
+ ${$}`,imports:Y,models:Q}}var nq=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function m2($){let Z=new Set,X=/\b([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g,J;while((J=X.exec($))!==null)if(!nq.has(J[1]))Z.add(J[1]);return Array.from(Z)}function sq($){let Z=new Set;for(let X of $.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))Z.add(X[1]);for(let X of $.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let J of X[1].split(",")){let Y=J.trim().split(/[:=]/).pop()?.trim();if(Y&&/^[A-Za-z_$][\w$]*$/.test(Y))Z.add(Y)}return Z}function l2($){let Z=new Set,X=new Set,J=$;J=J.replace(/^\s*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm,"// [type import stripped]");let Y=new Set,Q=/^\s*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"]\s*;?\s*$/gm,G;while((G=Q.exec($))!==null){let z=G[1],H=G[2];if(G[0].includes("import type"))continue;let j=[];for(let _ of z.split(",")){let L=_.trim();if(!L||L.startsWith("type "))continue;let V=L.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!V)continue;let O=V[1],F=V[2]||O;if(Y.add(O),Y.add(F),H==="stx"||H==="@stacksjs/stx")Z.add(O);else X.add(O);if(F!==O)j.push(`${F} = ${O}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";J=J.replace(G[0],B)}let q=sq(J);for(let z of iq){if(Y.has(z)||q.has(z))continue;if(new RegExp(`\\b${z}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(J))Z.add(z)}let W=c0(J),K=new Set;for(let z of J.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of z[1].split(",")){let j=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let B of j){let _=B.trim();if(_)K.add(_)}}for(let z of k5){if(Y.has(z)||q.has(z)||K.has(z))continue;if(new RegExp(`\\b${z}\\b`,"g").test(W))X.add(z)}let U=m2(J);for(let z of U)if(!Y.has(z)&&!q.has(z))X.add(z);return{code:J,stxImports:Array.from(Z),browserImports:Array.from(X)}}function c2($,Z){let X=[];if($.length>0)X.push(` var { ${$.join(", ")} } = window.stx || window;`);if(Z.length>0)X.push(` var { ${Z.join(", ")} } = window.StacksBrowser || {};`);if(X.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
3725
3725
  ${X.join(`
3726
3726
  `)}
3727
- ${sq($,Z)}`;return""}function AO($,Z=[]){let{browserImports:X}=l2($),J=new Set(Z);return c2([],X.filter((Y)=>!J.has(Y)))}function sq($,Z){let X=[...$.map((J)=>`['${J}', typeof ${J}, 'stx']`),...Z.map((J)=>`['${J}', typeof ${J}, '@stacksjs/browser']`)];if(X.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
3727
+ ${oq($,Z)}`;return""}function MO($,Z=[]){let{browserImports:X}=l2($),J=new Set(Z);return c2([],X.filter((Y)=>!J.has(Y)))}function oq($,Z){let X=[...$.map((J)=>`['${J}', typeof ${J}, 'stx']`),...Z.map((J)=>`['${J}', typeof ${J}, '@stacksjs/browser']`)];if(X.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
3728
3728
  [${X.join(", ")}].forEach(function (e) {
3729
3729
  if (e[1] !== 'undefined') return;
3730
3730
  console.error(
@@ -3733,10 +3733,10 @@ ${sq($,Z)}`;return""}function AO($,Z=[]){let{browserImports:X}=l2($),J=new Set(Z
3733
3733
  + 'or it should be imported from a relative path so the bundler includes it.'
3734
3734
  );
3735
3735
  });
3736
- `}function v$($){let Z=$.__stxClientPayload;if(Z&&typeof Z==="object"){let J={};for(let Y in Z){let Q=Z[Y];if(typeof Q==="function")continue;J[Y]=Q}return J.__stxDeclaredPayload=!0,J}let X={};for(let J in $){if(J.startsWith("__")||J.startsWith("$"))continue;let Y=$[J];if(typeof Y==="function")continue;X[J]=Y}return X}function x2($,Z){let X=new Set;for(let J of $.split(",")){let Y=J.trim().replace(/^\.\.\./,"").trim();if(!Y)continue;if(Z){let Q=Y.lastIndexOf(":");if(Q!==-1)Y=Y.slice(Q+1).trim()}if(Y=Y.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(Y))X.add(Y)}return X}function oq($,Z){if(new RegExp(`(?:const|let|var|function|class)\\s+${Z}\\b`).test($))return!0;for(let X of $.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(x2(X[1],!0).has(Z))return!0;for(let X of $.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(x2(X[1],!1).has(Z))return!0;return!1}function rq($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var aq=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,g2=new Set;function tq($,Z){let X=aq.test($),J=Z.length>32768;if(!X&&!J)return;if(g2.has($))return;if(g2.add($),X)console.warn(`[stx] server\u2192client bridge is publishing "${$}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(J)console.warn(`[stx] server\u2192client bridge is publishing ${(Z.length/1024).toFixed(1)}KB under "${$}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function j4($,Z){if(!Z)return"";let X=c0($),J=Z.__stxDeclaredPayload===!0,Y=[];for(let[Q,G]of Object.entries(Z)){if(!/^[A-Za-z_$][\w$]*$/.test(Q))continue;if(Q.startsWith("__")||Q.startsWith("$"))continue;if(!J&&!rq(X,Q))continue;if(oq($,Q))continue;let q;try{q=JSON.stringify(G)}catch{continue}if(q===void 0)continue;tq(Q,q),Y.push(` var ${Q} = ${q.replace(/</g,"\\u003c")};`)}if(Y.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
3736
+ `}function v$($){let Z=$.__stxClientPayload;if(Z&&typeof Z==="object"){let J={};for(let Y in Z){let Q=Z[Y];if(typeof Q==="function")continue;J[Y]=Q}return J.__stxDeclaredPayload=!0,J}let X={};for(let J in $){if(J.startsWith("__")||J.startsWith("$"))continue;let Y=$[J];if(typeof Y==="function")continue;X[J]=Y}return X}function x2($,Z){let X=new Set;for(let J of $.split(",")){let Y=J.trim().replace(/^\.\.\./,"").trim();if(!Y)continue;if(Z){let Q=Y.lastIndexOf(":");if(Q!==-1)Y=Y.slice(Q+1).trim()}if(Y=Y.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(Y))X.add(Y)}return X}function rq($,Z){if(new RegExp(`(?:const|let|var|function|class)\\s+${Z}\\b`).test($))return!0;for(let X of $.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(x2(X[1],!0).has(Z))return!0;for(let X of $.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(x2(X[1],!1).has(Z))return!0;return!1}function aq($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var tq=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,g2=new Set;function eq($,Z){let X=tq.test($),J=Z.length>32768;if(!X&&!J)return;if(g2.has($))return;if(g2.add($),X)console.warn(`[stx] server\u2192client bridge is publishing "${$}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(J)console.warn(`[stx] server\u2192client bridge is publishing ${(Z.length/1024).toFixed(1)}KB under "${$}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function j4($,Z){if(!Z)return"";let X=c0($),J=Z.__stxDeclaredPayload===!0,Y=[];for(let[Q,G]of Object.entries(Z)){if(!/^[A-Za-z_$][\w$]*$/.test(Q))continue;if(Q.startsWith("__")||Q.startsWith("$"))continue;if(!J&&!aq(X,Q))continue;if(rq($,Q))continue;let q;try{q=JSON.stringify(G)}catch{continue}if(q===void 0)continue;eq(Q,q),Y.push(` var ${Q} = ${q.replace(/</g,"\\u003c")};`)}if(Y.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
3737
3737
  ${Y.join(`
3738
3738
  `)}
3739
- `}var eq={left:0,middle:1,right:2};function $W($){let Z=[];if($.self)Z.push("if ($event.target !== $el) return");for(let X of $.systemKeys)Z.push(`if (!$event.${X}Key) return`);if($.keys.length>0){let X=$.keys.map((J)=>`$event.key === '${J}'`).join(" || ");Z.push(`if (!(${X})) return`)}if($.mouse!==null){let X=eq[$.mouse];Z.push(`if ($event.button !== ${X}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function ZW($,Z){let{elementId:X,event:J,modifiers:Y}=$,Q=m$($.handler),G=$W(Y),q=[];if(Y.once)q.push("once: true");if(Y.capture)q.push("capture: true");if(Y.passive)q.push("passive: true");let W=q.length>0?`, { ${q.join(", ")} }`:"",K="";if(G)K+=`${G}; `;let U=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),z=`var $emit = function(name, detail) {
3739
+ `}var $W={left:0,middle:1,right:2};function ZW($){let Z=[];if($.self)Z.push("if ($event.target !== $el) return");for(let X of $.systemKeys)Z.push(`if (!$event.${X}Key) return`);if($.keys.length>0){let X=$.keys.map((J)=>`$event.key === '${J}'`).join(" || ");Z.push(`if (!(${X})) return`)}if($.mouse!==null){let X=$W[$.mouse];Z.push(`if ($event.button !== ${X}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function XW($,Z){let{elementId:X,event:J,modifiers:Y}=$,Q=m$($.handler),G=ZW(Y),q=[];if(Y.once)q.push("once: true");if(Y.capture)q.push("capture: true");if(Y.passive)q.push("passive: true");let W=q.length>0?`, { ${q.join(", ")} }`:"",K="";if(G)K+=`${G}; `;let U=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),z=`var $emit = function(name, detail) {
3740
3740
  $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
3741
3741
  };`;function H(j){if(/\$emit\s*\(/.test(j))return`${z}
3742
3742
  ${j}`;return`var scope = $el.closest('[data-stx-scope]');
@@ -3779,11 +3779,11 @@ else {
3779
3779
  else {
3780
3780
  ${Q}
3781
3781
  }
3782
- }${W})`}function XW($){if($.length===0)return"";return`
3782
+ }${W})`}function JW($){if($.length===0)return"";return`
3783
3783
  // STX: auto-generated event bindings
3784
- ${$.map((X,J)=>ZW(X,J)).join(`
3784
+ ${$.map((X,J)=>XW(X,J)).join(`
3785
3785
  `)}`}function h2($){let Z=[],X=new Set,J=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=J.length,G=0;while(G<Q){let q=J[G];if(q==="'"||q==='"'||q==="`"){let W=q;if(G++,W==="`"){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]===W){G++;break}G++}continue}if(q==="/"&&J[G+1]==="/"){while(G<Q&&J[G]!==`
3786
- `)G++;continue}if(q==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(q==="{"){Y++,G++;continue}if(q==="}"){Y--,G++;continue}if(Y===0){let W=J.slice(G),K=W.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=W.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 z=W.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(z){let H=z[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=z[0].length;continue}}G++}return Z}var JW=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 YW($){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(!JW.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 q=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=W.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 z=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);return Z}async function f$($,Z={}){let X=$,J="",Y=!1,Q=[],G=c4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=p4(G.styles),W=r1(X);X=W.code,Q=[...W.imports,...W.models];let{hasUserImports:K,bundleClientScript:U}=await o("stx/client-script-bundler",()=>import("./chunk-ertf9176.js"));if(K(X))X=await U(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=l2(X);X=O.code,J=c2(O.stxImports,O.browserImports.filter((F)=>!Q.includes(F)))}if(J=`${j4(X,Z.serverData)}${J}`,X=$1(X),!Y&&A1(Z.attrs||""))X=M1(X);let z=XW(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),F=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${F}>
3786
+ `)G++;continue}if(q==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(q==="{"){Y++,G++;continue}if(q==="}"){Y--,G++;continue}if(Y===0){let W=J.slice(G),K=W.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=W.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 z=W.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(z){let H=z[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=z[0].length;continue}}G++}return Z}var YW=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 QW($){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(!YW.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 q=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=W.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 z=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);return Z}async function f$($,Z={}){let X=$,J="",Y=!1,Q=[],G=c4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=p4(G.styles),W=r1(X);X=W.code,Q=[...W.imports,...W.models];let{hasUserImports:K,bundleClientScript:U}=await o("stx/client-script-bundler",()=>import("./chunk-z3cme6c9.js"));if(K(X))X=await U(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=l2(X);X=O.code,J=c2(O.stxImports,O.browserImports.filter((F)=>!Q.includes(F)))}if(J=`${j4(X,Z.serverData)}${J}`,X=$1(X),!Y&&A1(Z.attrs||""))X=M1(X);let z=JW(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),F=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${F}>
3787
3787
  ${o1(`${J}${X}
3788
3788
  ${z}`)}
3789
3789
  </script>`}let B=d2($),_=/function __stx_setup_/.test(X),L=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function V(O){let F=O.length>0?`
@@ -3792,10 +3792,10 @@ window.stx.mount(function() {
3792
3792
  'use strict';
3793
3793
  ${o1(`${J}${X}
3794
3794
  ${z}${F}`)}
3795
- })</script>`}if(!L&&!_){if(B)return V(h2($));if(Z.templateContent){let O=h2($);if(O.length>0){let F=YW(Z.templateContent);if(O.some((R)=>F.has(R)))return V(O)}}}return`${q}<script data-stx-scoped data-stx-run="always">
3795
+ })</script>`}if(!L&&!_){if(B)return V(h2($));if(Z.templateContent){let O=h2($);if(O.length>0){let F=QW(Z.templateContent);if(O.some((R)=>F.has(R)))return V(O)}}}return`${q}<script data-stx-scoped data-stx-run="always">
3796
3796
  ;(function() {
3797
3797
  'use strict';
3798
3798
  ${o1(`${J}${X}
3799
3799
  ${z}`)}
3800
3800
  })()</script>`}
3801
- export{EZ as jl,bZ as kl,yZ as ll,Z1 as ml,r$ as nl,a$ as ol,t$ as pl,e$ as ql,v7 as rl,P7 as sl,hZ as tl,dZ as ul,lZ as vl,mW as wl,lW as xl,cW as yl,pW as zl,iW as Al,IZ as Bl,b7 as Cl,y7 as Dl,S7 as El,C7 as Fl,uW as Gl,p7 as Hl,B5 as Il,m$ as Jl,l$ as Kl,a2 as Ll,$7 as Ml,GW as Nl,$1 as Ol,WW as Pl,k5 as Ql,Y5 as Rl,__ as Sl,c4 as Tl,p4 as Ul,pq as Vl,r1 as Wl,l2 as Xl,c2 as Yl,AO as Zl,v$ as _l,j4 as $l,f$ as am,q0 as bm,R0 as cm,l5 as dm,W0 as em,jW as fm,i5 as gm,BW as hm,_W as im,VW as jm,OW as km,Q1 as lm,U5 as mm,s5 as nm,WZ as om,kW as pm,KZ as qm,IW as rm,i$ as sm,w7 as tm,G1 as um,n$ as vm,HZ as wm,TW as xm,O1 as ym,jZ as zm,f0 as Am,EW as Bm,SW as Cm,wZ as Dm,RZ as Em,I7 as Fm,T7 as Gm,E7 as Hm,gW as Im,f7 as Jm,Z3 as Km,H5 as Lm,o5 as Mm,rW as Nm,$3 as Om,iZ as Pm,nZ as Qm,sZ as Rm,aW as Sm,g7 as Tm,h7 as Um,U1 as Vm,bX as Wm,yX as Xm,SX as Ym,CX as Zm,_6 as _m,PX as $m,l as an,B3 as bn,O5 as cn,F5 as dn,Z$ as en,fX as fn,X$ as gn,xX as hn,J$ as in,L1 as jn,O6 as kn,w1 as ln,F6 as mn,L6 as nn,Y$ as on,_3 as pn,$0 as qn,lX as rn,cX as sn,pX as tn,h1 as un,V3 as vn,O3 as wn,i0 as xn,F3 as yn,w3 as zn,Q$ as An,nX as Bn,sX as Cn,oX as Dn,D6 as En,H$ as Fn,B0 as Gn,u6 as Hn,E3 as In,z1 as Jn,R1 as Kn,d6 as Ln,w5 as Mn,j$ as Nn,b3 as On,AJ as Pn,kJ as Qn,c6 as Rn,TJ as Sn,EJ as Tn,i6 as Un,D1 as Vn,wz as Wn,n6 as Xn,f3 as Yn,PJ as Zn,v3 as _n,vJ as $n,fJ as ao,Rz as bo,Dz as co,s6 as do,o6 as eo,r6 as fo,xJ as go,gJ as ho,Nz as io,Az as jo,hJ as ko,Mz as lo,kz as mo,e6 as no,J9 as oo,h3 as po,xz as qo,N5 as ro,u3 as so,d3 as to,gz as uo,ZY as vo,hz as wo,XY as xo,G9 as yo,uz as zo,JY as Ao,dz as Bo,mz as Co,n3 as Do,nz as Eo,sz as Fo,oz as Go,rz as Ho,az as Io,GY as Jo,tz as Ko,_$ as Lo,qY as Mo,ez as No,$H as Oo,ZH as Po,XH as Qo,jY as Ro,_Y as So,IY as To,i3 as Uo,U9 as Vo,JH as Wo,V$ as Xo,S8 as Yo,JB as Zo,YB as _o,QB as $o,GB as ap,RG as bp,yG as cp,S4 as dp,K8 as ep,Fj as fp,j8 as gp,mQ as hp,cQ as ip,N8 as jp,B4 as kp,A8 as lp,k8 as mp,I8 as np,$G as op,ZG as pp,T8 as qp,z4 as rp,XG as sp,YG as tp,k2 as up,zq as vp,Hq as wp,jq as xp,Bq as yp,_q as zp,I2 as Ap,Lq as Bp,Nq as Cp,Aq as Dp,N9 as Ep,A9 as Fp,OH as Gp,_9 as Hp,FH as Ip,r3 as Jp,a3 as Kp,t3 as Lp,T9 as Mp,E9 as Np,b9 as Op,A6 as Pp,M6 as Qp,k6 as Rp,I6 as Sp,R3 as Tp,D3 as Up,_U as Vp,VU as Wp,OU as Xp,aX as Yp,FU as Zp,dH as _p,mH as $p,S9 as aq,lH as bq,v9 as cq,eY as dq,x9 as eq,d9 as fq,o9 as gq,R$ as hq,Xj as iq,Jj as jq,Q4 as kq,t9 as lq,e9 as mq,yQ as nq,Qj as oq,Gj as pq,SQ as qq,qj as rq,$8 as sq,Z8 as tq,N$ as uq,A$ as vq,s1 as wq,PQ as xq,J8 as yq,Y8 as zq,Q8 as Aq,vQ as Bq,fQ as Cq,G4 as Dq,q4 as Eq,G8 as Fq,q8 as Gq,C4 as Hq,P4 as Iq,x4 as Jq,g4 as Kq,eG as Lq,Yq as Mq,Qq as Nq,Gq as Oq,qq as Pq,Tq as Qq,A1 as Rq,u4 as Sq,M1 as Tq,C$ as Uq,Cq as Vq,Pq as Wq,vq as Xq,I1 as Yq,t as Zq,q$ as _q,f2 as $q,j0 as ar,qO as br,WO as cr,i7 as dr,n7 as er,F1 as fr,s7 as gr,f1 as hr,o7 as ir,_5 as jr,UK as kr,WX as lr,J3 as mr,zK as nr,Y3 as or,HK as pr,jK as qr,K1 as rr,BK as sr,_K as tr,VK as ur,OK as vr,FK as wr,LK as xr,KX as yr,G3 as zr,r7 as Ar,RK as Br,DK as Cr,NK as Dr,AK as Er,MK as Fr,t7 as Gr,kK as Hr,e7 as Ir,IK as Jr,TK as Kr,V5 as Lr,_X as Mr,SK as Nr,OX as Or,Q6 as Pr,e5 as Qr,gK as Rr,H6 as Sr,j3 as Tr,AU as Ur,A3 as Vr,JJ as Wr,qJ as Xr,MU as Yr,kU as Zr,IU as _r,TU as $r,EU as as,bU as bs,WJ as cs,KJ as ds,T6 as es,x6 as fs,jJ as gs,k3 as hs,g6 as is,iU as js,nU as ks,T3 as ls,LJ as ms,h6 as ns};
3801
+ export{EZ as jl,bZ as kl,yZ as ll,Z1 as ml,r$ as nl,a$ as ol,t$ as pl,e$ as ql,v7 as rl,P7 as sl,hZ as tl,dZ as ul,lZ as vl,lW as wl,cW as xl,pW as yl,iW as zl,nW as Al,IZ as Bl,b7 as Cl,y7 as Dl,S7 as El,C7 as Fl,dW as Gl,p7 as Hl,B5 as Il,m$ as Jl,l$ as Kl,a2 as Ll,$7 as Ml,qW as Nl,$1 as Ol,KW as Pl,k5 as Ql,Y5 as Rl,V_ as Sl,c4 as Tl,p4 as Ul,iq as Vl,r1 as Wl,l2 as Xl,c2 as Yl,MO as Zl,v$ as _l,j4 as $l,f$ as am,q0 as bm,R0 as cm,l5 as dm,W0 as em,BW as fm,i5 as gm,_W as hm,VW as im,OW as jm,FW as km,Q1 as lm,U5 as mm,s5 as nm,WZ as om,IW as pm,KZ as qm,TW as rm,i$ as sm,w7 as tm,G1 as um,n$ as vm,HZ as wm,EW as xm,O1 as ym,jZ as zm,f0 as Am,bW as Bm,CW as Cm,wZ as Dm,RZ as Em,I7 as Fm,T7 as Gm,E7 as Hm,hW as Im,f7 as Jm,Z3 as Km,H5 as Lm,o5 as Mm,aW as Nm,$3 as Om,iZ as Pm,nZ as Qm,sZ as Rm,tW as Sm,g7 as Tm,h7 as Um,U1 as Vm,bX as Wm,yX as Xm,SX as Ym,CX as Zm,_6 as _m,PX as $m,l as an,B3 as bn,O5 as cn,F5 as dn,Z$ as en,fX as fn,X$ as gn,xX as hn,J$ as in,L1 as jn,O6 as kn,w1 as ln,F6 as mn,L6 as nn,Y$ as on,_3 as pn,$0 as qn,lX as rn,cX as sn,pX as tn,h1 as un,V3 as vn,O3 as wn,i0 as xn,F3 as yn,w3 as zn,Q$ as An,nX as Bn,sX as Cn,oX as Dn,D6 as En,H$ as Fn,B0 as Gn,u6 as Hn,E3 as In,z1 as Jn,R1 as Kn,d6 as Ln,w5 as Mn,j$ as Nn,b3 as On,AJ as Pn,kJ as Qn,c6 as Rn,TJ as Sn,EJ as Tn,i6 as Un,D1 as Vn,Rz as Wn,n6 as Xn,f3 as Yn,PJ as Zn,v3 as _n,vJ as $n,fJ as ao,Dz as bo,Nz as co,s6 as do,o6 as eo,r6 as fo,xJ as go,gJ as ho,Az as io,Mz as jo,hJ as ko,kz as lo,Iz as mo,e6 as no,J9 as oo,h3 as po,gz as qo,N5 as ro,u3 as so,d3 as to,hz as uo,ZY as vo,uz as wo,XY as xo,G9 as yo,dz as zo,JY as Ao,mz as Bo,lz as Co,n3 as Do,sz as Eo,oz as Fo,rz as Go,az as Ho,tz as Io,GY as Jo,ez as Ko,_$ as Lo,qY as Mo,$H as No,ZH as Oo,XH as Po,JH as Qo,jY as Ro,_Y as So,IY as To,i3 as Uo,U9 as Vo,YH as Wo,V$ as Xo,S8 as Yo,YB as Zo,QB as _o,GB as $o,qB as ap,DG as bp,SG as cp,S4 as dp,K8 as ep,Lj as fp,j8 as gp,mQ as hp,cQ as ip,N8 as jp,B4 as kp,A8 as lp,k8 as mp,I8 as np,$G as op,ZG as pp,T8 as qp,z4 as rp,XG as sp,YG as tp,k2 as up,Hq as vp,jq as wp,Bq as xp,_q as yp,Vq as zp,I2 as Ap,wq as Bp,Aq as Cp,Mq as Dp,N9 as Ep,A9 as Fp,FH as Gp,_9 as Hp,LH as Ip,r3 as Jp,a3 as Kp,t3 as Lp,T9 as Mp,E9 as Np,b9 as Op,A6 as Pp,M6 as Qp,k6 as Rp,I6 as Sp,R3 as Tp,D3 as Up,VU as Vp,OU as Wp,FU as Xp,aX as Yp,LU as Zp,mH as _p,lH as $p,S9 as aq,cH as bq,v9 as cq,eY as dq,x9 as eq,d9 as fq,o9 as gq,R$ as hq,Jj as iq,Yj as jq,Q4 as kq,t9 as lq,e9 as mq,yQ as nq,Gj as oq,qj as pq,SQ as qq,Wj as rq,$8 as sq,Z8 as tq,N$ as uq,A$ as vq,s1 as wq,PQ as xq,J8 as yq,Y8 as zq,Q8 as Aq,vQ as Bq,fQ as Cq,G4 as Dq,q4 as Eq,G8 as Fq,q8 as Gq,C4 as Hq,P4 as Iq,x4 as Jq,g4 as Kq,$q as Lq,Qq as Mq,Gq as Nq,qq as Oq,Wq as Pq,Eq as Qq,A1 as Rq,u4 as Sq,M1 as Tq,C$ as Uq,Pq as Vq,vq as Wq,fq as Xq,I1 as Yq,t as Zq,q$ as _q,f2 as $q,j0 as ar,WO as br,KO as cr,i7 as dr,n7 as er,F1 as fr,s7 as gr,f1 as hr,o7 as ir,_5 as jr,zK as kr,WX as lr,J3 as mr,HK as nr,Y3 as or,jK as pr,BK as qr,K1 as rr,_K as sr,VK as tr,OK as ur,FK as vr,LK as wr,wK as xr,KX as yr,G3 as zr,r7 as Ar,DK as Br,NK as Cr,AK as Dr,MK as Er,kK as Fr,t7 as Gr,IK as Hr,e7 as Ir,TK as Jr,EK as Kr,V5 as Lr,_X as Mr,CK as Nr,OX as Or,Q6 as Pr,e5 as Qr,hK as Rr,H6 as Sr,j3 as Tr,MU as Ur,A3 as Vr,JJ as Wr,qJ as Xr,kU as Yr,IU as Zr,TU as _r,EU as $r,bU as as,yU as bs,WJ as cs,KJ as ds,T6 as es,x6 as fs,jJ as gs,k3 as hs,g6 as is,nU as js,sU as ks,T3 as ls,LJ as ms,h6 as ns};